mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH master 3/3] usb: gadget: return error on missing UDC
Date: Fri,  7 Jul 2023 14:13:54 +0200	[thread overview]
Message-ID: <20230707121354.3248365-3-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20230707121354.3248365-1-a.fatoum@pengutronix.de>

Recent sync with kernel added the match_existing_only member, but set it
no where, leading to usb_gadget_register_driver succeeding on missing
UDC. This used to be an error and we depend on it, e.g.
global.usbgadget.autostart=1 is a no-op once usb_composite_probe has
succeeded, but if we signal success in error cases, it can't be used
to retry registration.

Fixes: 14211ab8b0e1 ("usb: gadget: Update core to Linux-6.3-rc2")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/usb/gadget/composite.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index 58c10f1191f8..f55ae5698e08 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -2496,6 +2496,7 @@ int usb_composite_probe(struct usb_composite_driver *driver)
 	gadget_driver->function =  (char *) driver->name;
 	gadget_driver->driver.name = driver->name;
 	gadget_driver->max_speed = driver->max_speed;
+	gadget_driver->match_existing_only = true;
 
 	return usb_gadget_register_driver(gadget_driver);
 }
-- 
2.39.2




  parent reply	other threads:[~2023-07-07 12:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-07 12:13 [PATCH master 1/3] usb: gadget: multi: do not double free on error Ahmad Fatoum
2023-07-07 12:13 ` [PATCH master 2/3] commands: usbserial: prevent double free Ahmad Fatoum
2023-07-07 12:13 ` Ahmad Fatoum [this message]
2023-07-26 13:32 ` [PATCH master 1/3] usb: gadget: multi: do not double free on error Sascha Hauer

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=20230707121354.3248365-3-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.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