Re: [PATCH] usb: core: deattach child device from typec connector on port unbind
From: Heikki Krogerus
Date: Mon Jul 27 2026 - 07:14:03 EST
Hi Marco,
On Wed, Jul 22, 2026 at 06:25:30PM +0200, Marco Tormento wrote:
> On Wed, 22 Jul 2026 at 18:02, Heikki Krogerus
> <heikki.krogerus@xxxxxxxxxxxxxxx> wrote:
> > There is already a fix for this:
> > https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git/commit/?h=usb-linus&id=e0b291fe117964037e0ba382eff4bb365d531c3a
>
> Sorry, I did not notice it.
> Shouldn't the typec deattach come before the sysfs removals though,
> reversing what happens in connector_bind?
We should not need to reverse anything. We can't avoid calling
typec_attach() separately from connector_bind() because we can't
prevent USB devices from being enumerated before the typec drivers are
loaded for example during bootup. But that does not mean we need to
call typec_deattach() in connector_unbind().
After the USB device is "attached" to the typec connector, the
connector device should be pinned down for as long as the USB device
exists, but that is not happening. So what both you guys are doing, is
working around a problem with the reference count.
I can see that most of your commit message is written by some LLM, and
the parts that you've added don't usually belong to the commit
message. That makes me a bit concerned about how much you actually
understand what the code that you are modifying does.
Use of LLMs is fine, but you still have understand the code that you
modify.
Br,
--
heikki