public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Oliver Neukum <oliver@neukum.org>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: linux-bluetooth@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: [patch]race condition in btusb disconnect() handling
Date: Tue, 19 Aug 2008 15:09:00 +0200	[thread overview]
Message-ID: <200808191509.00705.oliver@neukum.org> (raw)
In-Reply-To: <1219149781.7591.137.camel@violet.holtmann.net>

Am Dienstag 19 August 2008 14:43:01 schrieb Marcel Holtmann:
> Hi Oliver,
>=20
> > btusb has some races in disconnect()
> >=20
> > - it doesn't deal with only the iso interface disconnected
>=20
> It see the point here, but then we have to release the main interface
> cleanly or just disable SCO. I would prefer to just disable SCO.

The patch disables the main interface. Just disabling SCO means that
btusb_data.isoc could no longer be treated as constant and locking for it
would be necessary. This seems extravagant for a minor use case.

> > - it releases the data interface before unregistering the iso interface
>=20
> How does this happen? It doesn't do it that way.

=46rom your version:
	if (data->isoc)
		usb_driver_release_interface(&btusb_driver, data->isoc);

	usb_set_intfdata(intf, NULL);

	hci_unregister_dev(hdev);

=46irst you release the interface, then you unregister the hci.

>=20
> > - it isn't carefull to kill all URBs in case of soft disconnect
>=20
> The hci_unregister_dev will be calling the close() callback. Check
> hci_core.c and hci_dev_do_close().

OK, I'll modify the patch.

	Regards
		Oliver

  reply	other threads:[~2008-08-19 13:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-19 12:23 [patch]race condition in btusb disconnect() handling Oliver Neukum
2008-08-19 12:43 ` Marcel Holtmann
2008-08-19 13:09   ` Oliver Neukum [this message]
2008-08-19 13:28     ` Marcel Holtmann
2008-08-19 13:40       ` Oliver Neukum
2008-08-19 14:05       ` Oliver Neukum
2008-08-19 14:31         ` Marcel Holtmann
2008-08-19 15:14           ` Oliver Neukum
2008-08-19 15:27             ` Marcel Holtmann
2008-08-19 15:34               ` Oliver Neukum

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=200808191509.00705.oliver@neukum.org \
    --to=oliver@neukum.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=marcel@holtmann.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