All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Stern <stern@rowland.harvard.edu>
To: George Cherian <gcherian@caviumnetworks.com>
Cc: oneukum@suse.com, linux-scsi@vger.kernel.org,
	linux-usb@vger.kernel.org, hdegoede@redhat.com
Subject: Re: JMS56x not working reliably with uas driver
Date: Fri, 23 Dec 2016 09:22:34 -0500 (EST)	[thread overview]
Message-ID: <Pine.LNX.4.44L0.1612230918500.31927-100000@netrider.rowland.org> (raw)
In-Reply-To: <64608b5d-e90f-3839-eb80-7e3cd042a887@caviumnetworks.com>

On Fri, 23 Dec 2016, George Cherian wrote:

> >> 2) On disconnect I am seeing the following issue
> >>
> >>    scsi host4: uas_post_reset: alloc streams error -19 after reset
> >>    sd 4:0:0:0: [sdb] Synchronizing SCSI cache
> >>
> >> This is more fatal because after these messages the USB port becomes
> >> unusable. Even an lsusb invocation hangs for ever.
> > This problem looks pretty simple.  uas doesn't check properly to see if
> > the device was disconnected following a reset.
> >
> > Try changing the line in uas_post_reset() that says:
> >
> > 	if (devinfo->shutdown)
> >
> > to:
> >
> > 	if (devinfo->shutdown ||
> > 			devinfo->udev->state == USB_STATE_NOTATTACHED)
> Yes this works for me but with a little bit change as follows, But am 
> not sure whether we should goto reset_scsi in case of shutdown.
> Please advice.
> 
> diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c
> index 5ef014b..24db3fd 100644
> --- a/drivers/usb/storage/uas.c
> +++ b/drivers/usb/storage/uas.c
> @@ -1072,8 +1072,8 @@ static int uas_post_reset(struct usb_interface *intf)
>          unsigned long flags;
>          int err;
> 
> -       if (devinfo->shutdown)
> -               return 0;
> +       if (devinfo->shutdown || devinfo->udev->state == 
> USB_STATE_NOTATTACHED)
> +               goto reset_scsi;
> 
>          err = uas_configure_endpoints(devinfo);
>          if (err) {
> @@ -1083,6 +1083,7 @@ static int uas_post_reset(struct usb_interface *intf)
>                  return 1;
>          }
> 
> +reset_scsi:
>          spin_lock_irqsave(shost->host_lock, flags);
>          scsi_report_bus_reset(shost, 0);
>          spin_unlock_irqrestore(shost->host_lock, flags);

As far as I can tell, adding the "goto reset_scsi" line does not help 
at all.  There's no reason to report that the bus has been reset after 
the device is gone.

Alan Stern


  reply	other threads:[~2016-12-23 14:22 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-21 11:39 JMS56x not working reliably with uas driver George Cherian
2016-12-21 11:42 ` Oliver Neukum
     [not found]   ` <1482320547.7638.7.camel-IBi9RG/b67k@public.gmane.org>
2016-12-21 11:54     ` Hans de Goede
2016-12-21 11:54       ` Oliver Neukum
2016-12-21 12:07   ` George Cherian
2016-12-21 12:12     ` Oliver Neukum
2016-12-21 12:20     ` Hans de Goede
2016-12-21 12:47       ` George Cherian
     [not found]         ` <585A79F5.7080701-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>
2016-12-21 14:39           ` Oliver Neukum
     [not found]             ` <1482331185.7638.14.camel-IBi9RG/b67k@public.gmane.org>
2016-12-22  2:04               ` George Cherian
     [not found]                 ` <98b66992-826f-7073-2a1d-eee6a2a9590f-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>
2016-12-22 10:13                   ` George Cherian
2016-12-22 11:25                     ` Oliver Neukum
2016-12-21 11:50 ` Hans de Goede
     [not found] ` <585A69E6.6040009-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>
2016-12-22 22:44   ` Alan Stern
2016-12-23  3:01     ` George Cherian
2016-12-23 14:22       ` Alan Stern [this message]
2016-12-27 14:34     ` Oliver Neukum
     [not found]       ` <1482849255.1731.1.camel-IBi9RG/b67k@public.gmane.org>
2016-12-27 15:20         ` Alan Stern
     [not found]           ` <Pine.LNX.4.44L0.1612271015100.21478-100000-pYrvlCTfrz9XsRXLowluHWD2FQJk+8+b@public.gmane.org>
2016-12-27 15:53             ` Oliver Neukum
2016-12-27 18:22           ` George Cherian
2016-12-28  2:19             ` Alan Stern
2016-12-29  8:28               ` 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=Pine.LNX.4.44L0.1612230918500.31927-100000@netrider.rowland.org \
    --to=stern@rowland.harvard.edu \
    --cc=gcherian@caviumnetworks.com \
    --cc=hdegoede@redhat.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=oneukum@suse.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 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.