usb: gadget: core: force synchronous registration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: John Keeping <jkeeping@xxxxxxxxxxxxxxxxx>

commit df9158826b00e53f42c67d62c887a84490d80a0a upstream.

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")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: John Keeping <jkeeping@xxxxxxxxxxxxxxxxx>
Link: https://lore.kernel.org/r/20240913102325.2826261-1-jkeeping@xxxxxxxxxxxxxxxxx
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/usb/gadget/udc/core.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/usb/gadget/udc/core.c
+++ b/drivers/usb/gadget/udc/core.c
@@ -1671,6 +1671,7 @@ int usb_gadget_register_driver_owner(str
 	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",


Patches currently in stable-queue which might be from jkeeping@xxxxxxxxxxxxxxxxx are

queue-6.1/usb-gadget-core-force-synchronous-registration.patch




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux