All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Zick" <lkml@morethan.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Oliver Neukum <oliver@neukum.org>, Jiri Kosina <jkosina@suse.cz>,
	linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
Subject: uhci_hcd fails to off-line device/hub on error condition
Date: Sat, 11 Jul 2009 14:07:51 -0500	[thread overview]
Message-ID: <200907111407.54152.lkml@morethan.org> (raw)
In-Reply-To: <200907081138.39211.lkml@morethan.org>

On Wed July 8 2009, Michael S. Zick wrote:
> On Wed July 8 2009, Michael S. Zick wrote:
> > On Wed July 8 2009, Michael S. Zick wrote:
> > > On Tue July 7 2009, Alan Stern wrote:
> > > > On Tue, 7 Jul 2009, Michael S. Zick wrote:
> > > > 
> > > > > On Tue July 7 2009, Alan Stern wrote:
> > > > > > On Tue, 7 Jul 2009, Michael S. Zick wrote:
> > > > > > 
> > > > > > > > It looks like there's a serious problem in your UHCI hardware.  
> > > > > > > > According to the log you posted, it's not working at all.
> > > > > > > > 
> > > > > > > 
> > > > > > > I am using the x86-generic drivers - -
> > > > > > 
> > > > > > Not a problem with the drivers, a problem in the hardware.
> > > > > > 
> > > > > 
> > > > > Or hardware that works as the manufacturer intended, but differently
> > > > > than expected.  Same difference as "broken" when compared to "standard".
> > > > 
> > > > No, hardware that doesn't work at all.  As in "all reads return
> > > > 0xffffffff" -- that's just a guess but something like it would account
> > > > for what you saw.
> > > > 
> 
> I tried to combine the addition of the diagnostic print (BUG())
> statements and the potential fix - -
> This is what I put into the code for today's testing:
> 
> diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
> index be86ae3..d686f1d 100644
> --- a/drivers/usb/core/hub.c
> +++ b/drivers/usb/core/hub.c
> @@ -160,8 +160,10 @@ static inline char *portspeed(int portstatus)
>  }
> 
>  /* Note that hdev or one of its children must be locked! */
> -static inline struct usb_hub *hdev_to_hub(struct usb_device *hdev)
> +static struct usb_hub *hdev_to_hub(struct usb_device *hdev)
>  {
> +       if (!hdev || !hdev->actconfig)
> +               return NULL;
>         return usb_get_intfdata(hdev->actconfig->interface[0]);
>  }
> 
> @@ -369,11 +371,16 @@ static void kick_khubd(struct usb_hub *hub)
>  {
>         unsigned long   flags;
> 
> -       /* Suppress autosuspend until khubd runs */
> -       to_usb_interface(hub->intfdev)->pm_usage_cnt = 1;
> +       if (!hub) {
> +               BUG();
> +               return;
> +       }
> 
>         spin_lock_irqsave(&hub_event_lock, flags);
>         if (!hub->disconnected && list_empty(&hub->event_list)) {
> +               /* Suppress autosuspend until khubd runs */
> +               to_usb_interface(hub->intfdev)->pm_usage_cnt = 1;
> +
>                 list_add_tail(&hub->event_list, &hub_event_list);
>                 wake_up(&khubd_wait);
>         }
> @@ -382,8 +389,19 @@ static void kick_khubd(struct usb_hub *hub)
> 
>  void usb_kick_khubd(struct usb_device *hdev)
>  {
> -       /* FIXME: What if hdev isn't bound to the hub driver? */
> -       kick_khubd(hdev_to_hub(hdev));
> +       struct usb_hub *hub;
> +
> +       if (!hdev) {
> +               BUG();
> +               return;
> +       }
> +       hub = hdev_to_hub(hdev);
> +       if (hub) {
> +               kick_khubd(hub);
> +       } else {
> +               BUG();
> +               return;
> +       }
>  }
>

- - Megabytes of the same snipped - -
uhci_hcd 0000:00:10.2: host controller process error, something bad happened!
uhci_hcd 0000:00:10.1: host system error, PCI problems?
uhci_hcd 0000:00:10.1: host controller process error, something bad happened!
uhci_hcd 0000:00:10.2: host system error, PCI problems?
uhci_hcd 0000:00:10.2: host controller process error, something bad happened!

- - driver can detect unexpected behavior sufficent to post the messages - -

uhci_hcd 0000:00:10.1: host system error, PCI problems?
uhci_hcd 0000:00:10.1: host controller process error, something bad happened!

- - but never does anything about it - other than bitch - -
- - insert external action: rmmod uhci_hcd here - -

uhci_hcd 0000:00:10.2: remove, state 1
uhci_hcd 0000:00:10.2: roothub graceful disconnect
usb usb4: USB disconnect, address 1
usb usb4: unregistering device
usb usb4: usb_disable_device nuking all URBs
usb usb4: unregistering interface 4-0:1.0
uhci_hcd 0000:00:10.2: host system error, PCI problems?
uhci_hcd 0000:00:10.2: host controller process error, something bad happened!
uhci_hcd 0000:00:10.1: host system error, PCI problems?
uhci_hcd 0000:00:10.1: host controller process error, something bad happened!
uhci_hcd 0000:00:10.1: host system error, PCI problems?
uhci_hcd 0000:00:10.1: host controller process error, something bad happened!
uhci_hcd 0000:00:10.2: host system error, PCI problems?
uhci_hcd 0000:00:10.2: host controller process error, something bad happened!
uhci_hcd 0000:00:10.1: host system error, PCI problems?
uhci_hcd 0000:00:10.1: host controller process error, something bad happened!
uhci_hcd 0000:00:10.2: host system error, PCI problems?
uhci_hcd 0000:00:10.2: host controller process error, something bad happened!
uhci_hcd 0000:00:10.1: host system error, PCI problems?
uhci_hcd 0000:00:10.1: host controller process error, something bad happened!
uhci_hcd 0000:00:10.2: host system error, PCI problems?
uhci_hcd 0000:00:10.2: host controller process error, something bad happened!
uhci_hcd 0000:00:10.1: host system error, PCI problems?
uhci_hcd 0000:00:10.1: host controller process error, something bad happened!
usb 4-0:1.0: uevent
usb usb4: uevent
uhci_hcd 0000:00:10.2: USB bus 4 deregistered
uhci_hcd 0000:00:10.1: remove, state 1
uhci_hcd 0000:00:10.1: roothub graceful disconnect
usb usb3: USB disconnect, address 1
usb usb3: unregistering device
usb usb3: usb_disable_device nuking all URBs
usb usb3: unregistering interface 3-0:1.0
usb 3-0:1.0: uevent
usb usb3: uevent
uhci_hcd 0000:00:10.1: USB bus 3 deregistered
uhci_hcd 0000:00:10.0: remove, state 0
uhci_hcd 0000:00:10.0: roothub graceful disconnect
usb usb2: USB disconnect, address 1
usb usb2: unregistering device
usb usb2: usb_disable_device nuking all URBs
usb usb2: unregistering interface 2-0:1.0
usb 2-0:1.0: uevent
usb usb2: uevent
uhci_hcd 0000:00:10.0: USB bus 2 deregistered
 
- - end event - - (with apologies to China Syndrome)

Mike
> Mike
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 
> 



  reply	other threads:[~2009-07-11 19:08 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-05 22:20 Null Pointer BUG in uhci_hcd Michael S. Zick
2009-07-07  9:13 ` Jiri Kosina
2009-07-07 14:08   ` Oliver Neukum
2009-07-07 14:32     ` Michael S. Zick
2009-07-07 15:10     ` Alan Stern
2009-07-07 15:23       ` Michael S. Zick
2009-07-07 15:31         ` Alan Stern
2009-07-07 15:43           ` Michael S. Zick
2009-07-07 17:28             ` Alan Stern
2009-07-07 17:56               ` Michael S. Zick
2009-07-07 19:21                 ` Alan Stern
2009-07-07 19:51                   ` Michael S. Zick
2009-07-07 20:00                     ` Alan Stern
2009-07-07 20:52                       ` Michael S. Zick
2009-07-07 21:24                         ` Michael S. Zick
2009-07-08 19:54                           ` Alan Stern
2009-07-08 14:43                   ` Michael S. Zick
2009-07-08 16:30                     ` Michael S. Zick
2009-07-08 16:38                       ` Michael S. Zick
2009-07-11 19:07                         ` Michael S. Zick [this message]
2009-07-12 15:16                           ` uhci_hcd fails to off-line device/hub on error condition Alan Stern
2009-07-08 19:57                       ` Null Pointer BUG in uhci_hcd Alan Stern
2009-07-08 20:22                         ` Michael S. Zick
2009-07-08 21:02                           ` Alan Stern
2009-07-08 22:31                             ` Michael S. Zick
2009-07-09 14:18                               ` Alan Stern
2009-07-08 23:56                         ` Michael S. Zick
2009-07-08 23:59                           ` Michael S. Zick
2009-07-09 14:20                           ` Alan Stern
2009-07-09 14:46                             ` Michael S. Zick
2009-07-09 15:08                               ` Alan Stern
2009-07-09 16:07                                 ` Michael S. Zick
2009-07-09 20:58                                   ` Michael S. Zick

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=200907111407.54152.lkml@morethan.org \
    --to=lkml@morethan.org \
    --cc=jkosina@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=oliver@neukum.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.