linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alan Stern <stern@rowland.harvard.edu>
To: naveen yadav <yad.naveen@gmail.com>
Cc: linux-kernel@vger.kernel.org, <majordomo@vger.kernel.org>,
	<linux-usb@vger.kernel.org>, <marcel@holtmann.org>,
	<padovan@profusion.mobi>
Subject: Re: USB 2.0: No giveback comes for one submitted URB
Date: Thu, 22 Nov 2012 10:38:17 -0500 (EST)	[thread overview]
Message-ID: <Pine.LNX.4.44L0.1211221036030.345-100000@netrider.rowland.org> (raw)
In-Reply-To: <CAJ8eaTwTM3b2wTa9=o3POy-dcP6hkE_DdoAVX06PBuPDhz4W6w@mail.gmail.com>

On Thu, 22 Nov 2012, naveen yadav wrote:

> Hi,
> 
> we are using 3.2.2 version of kernel.
> 
> When Bluetooth(connected to USB 2.0) is suspended, urb->use_count
> value does not become zero and eventually there is a continuous wait
> in wait_event() of usb_kill_urb().
>           wait_event(usb_kill_urb_queue, atomic_read(&urb->use_count) == 0);
> 
> urb_count is incremented at only one place in usb_hcd_submit_urb() and

That's how it is _supposed_ to work.  You have discovered that
something else increments urb->use_count.

> decremented in usb_hcd_giveback_urb(). (Also, in error case inside
> usb_hcd_submit_urb()). After taking print of  urb->use_count at all
> these places, I see, even without connecting the Bluetooth device
> urb_count is incremented while below execution has never been
> decremented.

> .....
> [    3.490000] ====>[usb_hcd_giveback_urb][1626] urb->use_count = 0
> pipe=2147484032 [vid=0x1d6b] [pid=0x0002][devno=1]
> [    3.540000] ====>[usb_hcd_submit_urb][1482] urb->use_count = 2
> pipe=1077969280 [vid=0x1d6b] [pid=0x0002][devno=1]
> [    3.540000] ====>[usb_hcd_giveback_urb][1626] urb->use_count = 1
> pipe=1077969280 [vid=0x1d6b] [pid=0x0002][devno=1]

Now you need to find out what other code has changed urb->use_count and
fix it.

Alan Stern


  reply	other threads:[~2012-11-22 19:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CA+vmRF6jXXu+-ZMFgYNVJXV=kXUrezyYzpu5HOKPme95xQt0ug@mail.gmail.com>
     [not found] ` <CA+vmRF6SCfvN2B6TnV1_XSoGmVG2WdRn2Cv-J-w+_tMd8hbeuw@mail.gmail.com>
2012-11-22 13:20   ` USB 2.0: No giveback comes for one submitted URB naveen yadav
2012-11-22 15:38     ` Alan Stern [this message]
2012-11-26 12:23       ` naveen yadav
2012-11-26 16:11         ` 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=Pine.LNX.4.44L0.1211221036030.345-100000@netrider.rowland.org \
    --to=stern@rowland.harvard.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=majordomo@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=padovan@profusion.mobi \
    --cc=yad.naveen@gmail.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;
as well as URLs for NNTP newsgroup(s).