mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexander Shishkin <alexander.shishkin@linux.intel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	alexander.shishkin@linux.intel.com
Subject: Re: [GIT PULL 5/9] intel_th: msu: Introduce buffer driver interface
Date: Wed, 03 Jul 2019 19:33:58 +0300	[thread overview]
Message-ID: <87h883t6vd.fsf@ashishki-desk.ger.corp.intel.com> (raw)
In-Reply-To: <20190703155547.GA32438@kroah.com>

Greg Kroah-Hartman <gregkh@linuxfoundation.org> writes:

>> +	/*
>> +	 * ->assign() called when buffer 'mode' is set to this driver
>> +	 *   (aka mode_store())
>> +	 * @device:	struct device * of the msc
>> +	 * @mode:	allows the driver to set HW mode (see the enum above)
>> +	 * Returns:	a pointer to a private structure associated with this
>> +	 *		msc or NULL in case of error. This private structure
>> +	 *		will then be passed into all other callbacks.
>> +	 */
>> +	void	*(*assign)(struct device *dev, int *mode);
>> +	/* ->unassign():	some other mode is selected, clean up */
>> +	void	(*unassign)(void *priv);
>> +	/*
>> +	 * ->alloc_window(): allocate memory for the window of a given
>> +	 *		size
>> +	 * @sgt:	pointer to sg_table, can be overridden by the buffer
>> +	 *		driver, or kept intact
>> +	 * Returns:	number of sg table entries <= number of pages;
>> +	 *		0 is treated as an allocation failure.
>> +	 */
>> +	int	(*alloc_window)(void *priv, struct sg_table **sgt,
>> +				size_t size);
>> +	void	(*free_window)(void *priv, struct sg_table *sgt);
>> +	/* ->activate():	trace has started */
>> +	void	(*activate)(void *priv);
>> +	/* ->deactivate():	trace is about to stop */
>> +	void	(*deactivate)(void *priv);
>> +	/*
>> +	 * ->ready():	window @sgt is filled up to the last block OR
>> +	 *		tracing is stopped by the user; this window contains
>> +	 *		@bytes data. The window in question transitions into
>> +	 *		the "LOCKED" state, indicating that it can't be used
>> +	 *		by hardware. To clear this state and make the window
>> +	 *		available to the hardware again, call
>> +	 *		intel_th_msc_window_unlock().
>> +	 */
>> +	int	(*ready)(void *priv, struct sg_table *sgt, size_t bytes);
>> +};
>
> Why isn't this based off of 'struct driver'?

It's not a real driver, in a sense that there's no underlying
device. None of the usual driver stuff applies. It's still a set of
callbacks, though. Should this be an elaborate comment, should I replace
the word "driver" with something else?

I'd really like to avoid shoehorning the whole 'struct device' + 'struct
driver' here.

Thanks,
--
Alex

  reply	other threads:[~2019-07-03 16:34 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-27 12:51 [GIT PULL 0/9] intel_th: Updates for v5.3 Alexander Shishkin
2019-06-27 12:51 ` [GIT PULL 1/9] intel_th: msu: Fix unused variable warning on arm64 platform Alexander Shishkin
2019-07-03 15:45   ` Greg Kroah-Hartman
2019-07-03 15:45   ` Greg Kroah-Hartman
2019-07-03 15:54     ` Alexander Shishkin
2019-07-03 15:58       ` Greg Kroah-Hartman
2019-07-03 16:03         ` Alexander Shishkin
2019-06-27 12:51 ` [GIT PULL 2/9] intel_th: msu: Support multipage blocks Alexander Shishkin
2019-06-27 12:51 ` [GIT PULL 3/9] intel_th: msu: Split sgt array and pointer in multiwindow mode Alexander Shishkin
2019-06-27 12:51 ` [GIT PULL 4/9] intel_th: msu: Start read iterator from a non-empty window Alexander Shishkin
2019-06-27 12:51 ` [GIT PULL 5/9] intel_th: msu: Introduce buffer driver interface Alexander Shishkin
2019-07-03 15:55   ` Greg Kroah-Hartman
2019-07-03 16:33     ` Alexander Shishkin [this message]
2019-07-03 16:49       ` Greg Kroah-Hartman
2019-07-05 15:08     ` Alexander Shishkin
2019-06-27 12:51 ` [GIT PULL 6/9] intel_th: msu: Prevent freeing buffers while locked windows exist Alexander Shishkin
2019-06-27 12:51 ` [GIT PULL 7/9] intel_th: msu: Get rid of the window size limit Alexander Shishkin
2019-06-27 12:51 ` [GIT PULL 8/9] intel_th: msu-sink: An example msu buffer driver Alexander Shishkin
2019-07-03 15:56   ` Greg Kroah-Hartman
2019-06-27 12:51 ` [GIT PULL 9/9] intel_th: msu: Preserve pre-existing buffer configuration Alexander Shishkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h883t6vd.fsf@ashishki-desk.ger.corp.intel.com \
    --to=alexander.shishkin@linux.intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome