From: "Bjørn Mork" <bjorn@mork.no>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Xu Yang <xu.yang_2@nxp.com>,
gregkh@linuxfoundation.org, khtsai@google.com,
kexinsun@smail.nju.edu.cn, hhhuuu@google.com, kees@kernel.org,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
imx@lists.linux.dev, jun.li@nxp.com
Subject: Re: [PATCH] usb: gadget: udc: skip pullup() if already connected
Date: Tue, 21 Apr 2026 17:27:32 +0200 [thread overview]
Message-ID: <87v7dkpc4b.fsf@miraculix.mork.no> (raw)
In-Reply-To: <e431e2f9-ce24-491a-9447-1b872099ab25@rowland.harvard.edu> (Alan Stern's message of "Tue, 21 Apr 2026 10:37:53 -0400")
Alan Stern <stern@rowland.harvard.edu> writes:
> This patch is wrong. To see why, read the comments just below the end
> of the patch and see also usb_gadget_activate().
Made me look...
Must say. This strikes me as a nice way to filter out humans from the
rest of the submitters:
gadget->connected = true;
goto out;
}
ret = gadget->ops->pullup(gadget, 1);
if (!ret)
gadget->connected = 1;
The indecisiveness looks strange. There's a nice symmetry with
usb_gadget_disconnect_locked() though:
gadget->connected = false;
goto out;
}
ret = gadget->ops->pullup(gadget, 0);
if (!ret)
gadget->connected = 0;
What surprised me most was that the different variants were added by the
same commit
ccdf138fe3e2 ("usb: gadget: add usb_gadget_activate/deactivate functions").
Bjørn
next prev parent reply other threads:[~2026-04-21 15:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-21 8:20 [PATCH] usb: gadget: udc: skip pullup() if already connected Xu Yang
2026-04-21 14:37 ` Alan Stern
2026-04-21 15:27 ` Bjørn Mork [this message]
2026-04-21 20:18 ` Alan Stern
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=87v7dkpc4b.fsf@miraculix.mork.no \
--to=bjorn@mork.no \
--cc=gregkh@linuxfoundation.org \
--cc=hhhuuu@google.com \
--cc=imx@lists.linux.dev \
--cc=jun.li@nxp.com \
--cc=kees@kernel.org \
--cc=kexinsun@smail.nju.edu.cn \
--cc=khtsai@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
--cc=xu.yang_2@nxp.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox