public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andiry Xu <andiry.xu@amd.com>
To: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Sarah Sharp <sarah.a.sharp@linux.intel.com>,
	USB list <linux-usb@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>, v4mp <gaigo88@hotmail.it>
Subject: Re: Question about error from xhci-hcd
Date: Thu, 29 Dec 2011 12:30:25 +0800	[thread overview]
Message-ID: <4EFBECE1.2060001@amd.com> (raw)
In-Reply-To: <4EFBE4B2.5000801@lwfinger.net>

On 12/29/2011 11:55 AM, Larry Finger wrote:
> On 12/28/2011 09:32 PM, Andiry Xu wrote:
>>
>> Thanks for your test. However, I did not find anything abnormal
>> information in the dmesg, except for the dump, but it seems unrelated
>> with "no room on ring" error.
>>
>> The patch is supposed to print the ep ring when it encounters a "no room
>> on ring" error, but it's not triggered. I see you added some control
>> transfer prints in the dmesg, but it seems quite normal: note the
>> "Toggle cycle state for ring" info, it means the ring is looped
>> normally, and driver does not report any no room on ring error. Can it
>> be reproduced frequently or hard to trigger?
>>
>> The short transfer message is normal for control transfer too. Sarah has
>> posted some patches to remove the corresponding printk and downgrade the
>> debug warn level so people will not be scared.
> 
> The patch I added was as follows:
> 
> Index: compat-wireless-2011-10-28/drivers/usb/host/xhci-ring.c
> ===================================================================
> --- compat-wireless-2011-10-28.orig/drivers/usb/host/xhci-ring.c
> +++ compat-wireless-2011-10-28/drivers/usb/host/xhci-ring.c
> @@ -2462,9 +2462,15 @@ static int prepare_ring(struct xhci_hcd
>         }
>         if (!room_on_ring(xhci, ep_ring, num_trbs)) {
>                 /* FIXME allocate more room */
> -               xhci_err(xhci, "ERROR no room on ep ring\n");
> +               if (count++ < 25) {
> +                       xhci_err(xhci, "ERROR no room on ep ring\n");
> +                       xhci_err(xhci, "Event ring:\n");
> +                       xhci_debug_ring(xhci, xhci->event_ring);
> +                       xhci_err(xhci, "Endpoint ring:\n");
> +                       xhci_debug_ring(xhci, ep_ring);
> +                       if (count < 2)
> +                               dump_stack();
> +               }
>                 return -ENOMEM;
>         }
> 
> Count is a static int to limit the amount of output to help prevent
> wrapping of the dmesg buffer.
> 
> With the rtl8192cu driver, the "no room" message occurs repeatedly. A
> piece of the unrestrained log is as follows:
> 
> [  269.214841] xhci_hcd 0000:05:00.0: ERROR no room on ep ring
> [  269.214847] xhci_hcd 0000:05:00.0: ERROR no room on ep ring
> [  269.214853] xhci_hcd 0000:05:00.0: ERROR no room on ep ring
> [  269.214859] xhci_hcd 0000:05:00.0: ERROR no room on ep ring
> [  269.214865] xhci_hcd 0000:05:00.0: ERROR no room on ep ring
> [  269.214916] xhci_hcd 0000:05:00.0: ERROR no room on ep ring
> [  269.214926] xhci_hcd 0000:05:00.0: ERROR no room on ep ring
> [  269.214936] xhci_hcd 0000:05:00.0: ERROR no room on ep ring
> [  269.214945] xhci_hcd 0000:05:00.0: ERROR no room on ep ring
> [  269.214954] xhci_hcd 0000:05:00.0: ERROR no room on ep ring
> [  269.214964] xhci_hcd 0000:05:00.0: ERROR no room on ep ring
> [  269.214973] xhci_hcd 0000:05:00.0: ERROR no room on ep ring
> [  269.214981] xhci_hcd 0000:05:00.0: ERROR no room on ep ring
> [  269.214990] xhci_hcd 0000:05:00.0: ERROR no room on ep ring
> [  269.215000] xhci_hcd 0000:05:00.0: ERROR no room on ep ring
> [  269.215009] xhci_hcd 0000:05:00.0: ERROR no room on ep ring
> [  269.215018] xhci_hcd 0000:05:00.0: ERROR no room on ep ring
> [  269.215027] xhci_hcd 0000:05:00.0: ERROR no room on ep ring
> 
> If the ring appears to be normal, any idea why the error is being
> triggered?
> 
> Whatever the cause, the device fails, but works fine on a USB 2.0 port.
> If you have any other tests we could run, please let me know.
> 

That's the error I want to see, but I didn't find it in the dmesg you
posted. is it wrapped?

Anyway, please post the full dmesg with no room on ring error and the
dump of the ep ring and event ring (so the xhci_debug_ring() is
triggered in the patch), so we can see if the ring is mangled or there
is just too many transfers.

Another thing you can try is the andiry-ring-expansion branch on Sarah's
xhci git tree, check if there is still no room on ring error.

Thanks,
Andiry


  reply	other threads:[~2011-12-29  4:30 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-29 17:48 Question about error from xhci-hcd Larry Finger
2011-10-30  5:04 ` Sarah Sharp
2011-10-30 15:30   ` Larry Finger
2011-11-01 16:06   ` Larry Finger
2011-11-14  9:18     ` Andiry Xu
2011-11-28 18:14       ` Sarah Sharp
2011-11-28 21:53         ` Larry Finger
2011-12-28 16:30       ` Larry Finger
2011-12-29  3:32         ` Andiry Xu
2011-12-29  3:55           ` Larry Finger
2011-12-29  4:30             ` Andiry Xu [this message]
2011-12-29 16:49               ` Larry Finger
  -- strict thread matches above, loose matches on Subject: below --
2012-02-07  5:47 Richard Farina
2012-02-07  9:52 ` Andiry Xu
2012-02-07 13:30 ` Larry Finger
2012-02-07 14:55   ` Sarah Sharp
2012-02-07 19:28     ` Larry Finger
2012-02-07 14:59   ` Richard Farina

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=4EFBECE1.2060001@amd.com \
    --to=andiry.xu@amd.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=gaigo88@hotmail.it \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=sarah.a.sharp@linux.intel.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