From: Oliver Neukum <oneukum@suse.com>
To: Johan Hovold <johan@kernel.org>
Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/4] USB: serial: add support for multi-interface functions
Date: Wed, 31 Mar 2021 13:21:15 +0200 [thread overview]
Message-ID: <3ae68552f3c689c23cbf2573772239c00e2c94be.camel@suse.com> (raw)
In-Reply-To: <e4d3d21cdfe94068c76ceb4ba38630d76fa9418c.camel@suse.com>
Am Mittwoch, den 31.03.2021, 09:08 +0200 schrieb Oliver Neukum:
> Am Dienstag, den 30.03.2021, 17:22 +0200 schrieb Johan Hovold:
> > On Tue, Mar 30, 2021 at 04:44:32PM +0200, Oliver Neukum wrote:
> > > Am Dienstag, den 30.03.2021, 16:38 +0200 schrieb Johan Hovold:
> > > > @@ -1115,6 +1161,8 @@ static void usb_serial_disconnect(struct usb_interface *interface)
> > > > if (serial->type->disconnect)
> > > > serial->type->disconnect(serial);
> > > >
> > > > + release_sibling(serial, interface);
> > > > +
> > > > /* let the last holder of this object cause it to be cleaned up */
> > > > usb_serial_put(serial);
> > > > dev_info(dev, "device disconnected\n");
> > >
> > > Hi,
> > >
> > > does this assume you are called for the original interface first?
> >
> > No, I handle either interface being unbound first (e.g. see
> > release_sibling()).
> >
> > > I am afraid that is an assumption you cannot make. In fact, if somebody
> > > is doing odd things with sysfs you cannot even assume both will see a
> > > disconnect()
> >
> > Right, but disconnect() will still be called also for the sibling
> > interface as part of release_sibling() above.
>
> OK, sorry I overlooked that.
Hi,
on the third hand, the more I look at this, would you mind putting
sibling_release() with a modified name into usbcore? This functionality
is not limited to serial drivers. btusb needs it; cdc-acm needs it;
usbaudio neds it. We have code duplication.
Regards
Oliver
next prev parent reply other threads:[~2021-03-31 11:22 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-30 14:38 [PATCH 0/4] USB: serial: add support for multi-interface functions Johan Hovold
2021-03-30 14:38 ` [PATCH 1/4] USB: serial: drop unused suspending flag Johan Hovold
2021-03-30 14:38 ` [PATCH 2/4] USB: serial: refactor endpoint classification Johan Hovold
2021-03-30 14:38 ` [PATCH 3/4] USB: serial: add support for multi-interface functions Johan Hovold
2021-03-30 14:44 ` Oliver Neukum
2021-03-30 15:22 ` Johan Hovold
2021-03-31 7:08 ` Oliver Neukum
2021-03-31 11:21 ` Oliver Neukum [this message]
2021-04-01 7:46 ` Johan Hovold
2021-04-08 10:10 ` Oliver Neukum
2021-03-30 14:38 ` [PATCH 4/4] USB: serial: xr: claim both interfaces Johan Hovold
2021-03-30 14:50 ` [PATCH 0/4] USB: serial: add support for multi-interface functions Greg KH
2021-04-01 8:09 ` Johan Hovold
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=3ae68552f3c689c23cbf2573772239c00e2c94be.camel@suse.com \
--to=oneukum@suse.com \
--cc=johan@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mchehab+huawei@kernel.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;
as well as URLs for NNTP newsgroup(s).