public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] usb: gadget: core: force synchronous registration
@ 2024-09-12 16:45 John Keeping
  2024-09-12 17:47 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 2+ messages in thread
From: John Keeping @ 2024-09-12 16:45 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: John Keeping, Roy Luo, Alan Stern, Chris Wulff, yuan linyu,
	Paul Cercueil, Krishna Kurapati, linux-usb, linux-kernel

Registering a gadget driver is expected to complete synchronously and
immediately after calling driver_register() this function checks that
the driver has bound so as to return an error.

Set PROBE_FORCE_SYNCHRONOUS to ensure this is the case even when
asynchronous probing is set as the default.

Fixes: fc274c1e99731 ("USB: gadget: Add a new bus for gadgets")
Signed-off-by: John Keeping <jkeeping@inmusicbrands.com>
---
v2:
- Add "Fixes" trailer

 drivers/usb/gadget/udc/core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/gadget/udc/core.c b/drivers/usb/gadget/udc/core.c
index cf6478f97f4a3..a6f46364be65f 100644
--- a/drivers/usb/gadget/udc/core.c
+++ b/drivers/usb/gadget/udc/core.c
@@ -1696,6 +1696,7 @@ int usb_gadget_register_driver_owner(struct usb_gadget_driver *driver,
 	driver->driver.bus = &gadget_bus_type;
 	driver->driver.owner = owner;
 	driver->driver.mod_name = mod_name;
+	driver->driver.probe_type = PROBE_FORCE_SYNCHRONOUS;
 	ret = driver_register(&driver->driver);
 	if (ret) {
 		pr_warn("%s: driver registration failed: %d\n",
-- 
2.46.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] usb: gadget: core: force synchronous registration
  2024-09-12 16:45 [PATCH v2] usb: gadget: core: force synchronous registration John Keeping
@ 2024-09-12 17:47 ` Greg Kroah-Hartman
  0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2024-09-12 17:47 UTC (permalink / raw)
  To: John Keeping
  Cc: Roy Luo, Alan Stern, Chris Wulff, yuan linyu, Paul Cercueil,
	Krishna Kurapati, linux-usb, linux-kernel

On Thu, Sep 12, 2024 at 05:45:00PM +0100, John Keeping wrote:
> Registering a gadget driver is expected to complete synchronously and
> immediately after calling driver_register() this function checks that
> the driver has bound so as to return an error.
> 
> Set PROBE_FORCE_SYNCHRONOUS to ensure this is the case even when
> asynchronous probing is set as the default.
> 
> Fixes: fc274c1e99731 ("USB: gadget: Add a new bus for gadgets")
> Signed-off-by: John Keeping <jkeeping@inmusicbrands.com>
> ---
> v2:
> - Add "Fixes" trailer
> 
>  drivers/usb/gadget/udc/core.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/usb/gadget/udc/core.c b/drivers/usb/gadget/udc/core.c
> index cf6478f97f4a3..a6f46364be65f 100644
> --- a/drivers/usb/gadget/udc/core.c
> +++ b/drivers/usb/gadget/udc/core.c
> @@ -1696,6 +1696,7 @@ int usb_gadget_register_driver_owner(struct usb_gadget_driver *driver,
>  	driver->driver.bus = &gadget_bus_type;
>  	driver->driver.owner = owner;
>  	driver->driver.mod_name = mod_name;
> +	driver->driver.probe_type = PROBE_FORCE_SYNCHRONOUS;
>  	ret = driver_register(&driver->driver);
>  	if (ret) {
>  		pr_warn("%s: driver registration failed: %d\n",
> -- 
> 2.46.0
> 
> 

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman.  You have sent him
a patch that has triggered this response.  He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created.  Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- You have marked a patch with a "Fixes:" tag for a commit that is in an
  older released kernel, yet you do not have a cc: stable line in the
  signed-off-by area at all, which means that the patch will not be
  applied to any older kernel releases.  To properly fix this, please
  follow the documented rules in the
  Documentation/process/stable-kernel-rules.rst file for how to resolve
  this.

If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-09-12 17:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-12 16:45 [PATCH v2] usb: gadget: core: force synchronous registration John Keeping
2024-09-12 17:47 ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox