All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Korsgaard <peter@korsgaard.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org,  Michal Nazarewicz <mina86@mina86.com>
Subject: Re: [PATCH] usb: gadget: f_fs: expose ready state in configfs
Date: Thu, 18 Jan 2024 13:43:06 +0100	[thread overview]
Message-ID: <87le8mizhh.fsf@48ers.dk> (raw)
In-Reply-To: <2024011857-existing-shucking-97d4@gregkh> (Greg Kroah-Hartman's message of "Thu, 18 Jan 2024 13:28:16 +0100")

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

 > On Thu, Jan 18, 2024 at 01:18:16PM +0100, Peter Korsgaard wrote:
 >> When a USB gadget is configured through configfs with 1 or more f_fs
 >> functions, then the logic setting up the gadget configuration has to wait
 >> until the user space code (typically separate applications) responsible for
 >> those functions have written their descriptors before the gadget can be
 >> activated.
 >> 
 >> The f_fs instance already knows if this has been done, so expose it through
 >> a "ready" attribute in configfs for easier synchronization.
 >> 
 >> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
 >> ---
 >> drivers/usb/gadget/function/f_fs.c | 15 +++++++++++++++
 >> 1 file changed, 15 insertions(+)
 >> 
 >> diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c
 >> index fdd0fc7b8f25..ae44dd5f3a94 100644
 >> --- a/drivers/usb/gadget/function/f_fs.c
 >> +++ b/drivers/usb/gadget/function/f_fs.c
 >> @@ -3446,6 +3446,20 @@ static inline struct f_fs_opts *to_ffs_opts(struct config_item *item)
 >> func_inst.group);
 >> }
 >> 
 >> +static ssize_t f_fs_opts_ready_show(struct config_item *item, char *page)
 >> +{
 >> +	struct f_fs_opts *opts = to_ffs_opts(item);
 >> +
 >> +	return sprintf(page, "%d\n", opts->dev->desc_ready);
 >> +}
 >> +
 >> +CONFIGFS_ATTR_RO(f_fs_opts_, ready);
 >> +
 >> +static struct configfs_attribute *ffs_attrs[] = {
 >> +	&f_fs_opts_attr_ready,
 >> +	NULL,
 >> +};

 > No documentation entry for this new attribute?

Ups, I'll add a snippet to Documentation/usb/gadget-testing.rst and send
a v2.

-- 
Bye, Peter Korsgaard

      reply	other threads:[~2024-01-18 12:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-18 12:18 [PATCH] usb: gadget: f_fs: expose ready state in configfs Peter Korsgaard
2024-01-18 12:28 ` Greg Kroah-Hartman
2024-01-18 12:43   ` Peter Korsgaard [this message]

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=87le8mizhh.fsf@48ers.dk \
    --to=peter@korsgaard.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mina86@mina86.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.