From: Greg KH <greg@kroah.com>
To: Alan Stern <stern@rowland.harvard.edu>,
bluez-devel@lists.sourceforge.net
Cc: Marcel Holtmann <marcel@holtmann.org>,
USB development list <linux-usb-devel@lists.sourceforge.net>
Subject: Re: PATCH: (as265) Fix bluetooth driver's wait_for_urb()
Date: Wed, 28 Apr 2004 10:43:25 -0700 [thread overview]
Message-ID: <20040428174325.GG32040@kroah.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0404281321520.1238-100000@ida.rowland.org>
On Wed, Apr 28, 2004 at 01:25:08PM -0400, Alan Stern wrote:
> Greg:
>
> Your recent change to struct urb broke this function in the bluetooth
> driver.
I know. I really hate what the Bluetooth driver does, and it's up to
them to keep up with the changes in urbs due to them statically
including a urb in their structures. That is what they agreed to when
they did this a while ago. They are on their own here...
> You know, I think usb_wait_for_urb() would make an excellent
> addition to usbcore.
No, no one should do that. Just use the proper usb_alloc_urb() and
usb_free_urb() and you will be fine.
> At some future time we could consider replacing
> synchronous unlink_urb with asynchronous unlink plus wait_for_urb.
Why? Does it cause undue hardship in the host controllers to have a
synchronous unlink_urb?
> ===== drivers/bluetooth/hci_usb.c 1.43 vs edited =====
> --- 1.43/drivers/bluetooth/hci_usb.c Wed Apr 21 01:11:06 2004
> +++ edited/drivers/bluetooth/hci_usb.c Wed Apr 28 13:20:22 2004
> @@ -342,7 +342,7 @@
>
> static inline void hci_usb_wait_for_urb(struct urb *urb)
> {
> - while (atomic_read(&urb->count) > 1) {
> + while (atomic_read(&urb->kref.refcount) > 1) {
> current->state = TASK_UNINTERRUPTIBLE;
> schedule_timeout((5 * HZ + 999) / 1000);
> }
I really just hate that whole function, it's such a hack.
So, Bluetooth developers, have you reconsidered your "need" to put a
static urb in your structure? Are you convinced yet of the wrongness of
your ways? Do you want a patch to change your subsystem to follow the
rest of the kernel with regards to USB?
thanks,
greg k-h
next parent reply other threads:[~2004-04-28 17:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.LNX.4.44L0.0404281321520.1238-100000@ida.rowland.org>
2004-04-28 17:43 ` Greg KH [this message]
2004-04-28 18:08 ` [Bluez-devel] Re: PATCH: (as265) Fix bluetooth driver's wait_for_urb() Marcel Holtmann
2004-04-28 18:18 ` Greg KH
2004-04-28 22:05 ` [Bluez-devel] " Marcel Holtmann
2004-04-28 19:13 ` Alan Stern
2004-04-28 20:05 ` [linux-usb-devel] " 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=20040428174325.GG32040@kroah.com \
--to=greg@kroah.com \
--cc=bluez-devel@lists.sourceforge.net \
--cc=linux-usb-devel@lists.sourceforge.net \
--cc=marcel@holtmann.org \
--cc=stern@rowland.harvard.edu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.