All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Stern <stern@rowland.harvard.edu>
To: George Cherian <gcherian@caviumnetworks.com>
Cc: Oliver Neukum <oneukum@suse.com>,
	hdegoede@redhat.com, linux-scsi@vger.kernel.org,
	linux-usb@vger.kernel.org
Subject: Re: JMS56x not working reliably with uas driver
Date: Tue, 27 Dec 2016 21:19:35 -0500 (EST)	[thread overview]
Message-ID: <Pine.LNX.4.44L0.1612272109450.3821-100000@netrider.rowland.org> (raw)
In-Reply-To: <ab607030-bb4f-f6ac-755b-f38e7cd13be7@caviumnetworks.com>

On Tue, 27 Dec 2016, George Cherian wrote:

> Hi Alan,
> 
> 
> On Tuesday 27 December 2016 08:50 PM, Alan Stern wrote:
> > On Tue, 27 Dec 2016, Oliver Neukum wrote:
> >
> >> On Thu, 2016-12-22 at 17:44 -0500, Alan Stern wrote:
> >>> I don't see how this patch fixes anything.  Unless I'm mistaken, it
> >>> just avoids the problem by preventing the system from issuing the
> >>> command that provokes the error, rather than really fixing the
> >>> underlying error.
> >> Please clarify. If a reset leads to a disconnect, isn't that
> >> exactly what we want?
> > I didn't express myself clearly enough.  Yes, if a reset leads to a
> > disconnect then avoiding the reset will avoid problems.
> >
> > But the _real_ error here is that xhci-hcd says "ERROR Transfer event
> > for disabled endpoint or incorrect stream ring" when the disconnect
> > occurs during reset.
> I think there is some misunderstanding of the issues.
> 
> "ERROR Transfer event for disabled endpoint or incorrect stream ring"
> This particular message is during the connect of the device and not
> during the disconnect.
> To avoid this message the unusual_uas.h patch was sent earlier.

Right -- the patch _avoids_ the message.  But it doesn't fix the actual 
error/bug that caused to message to be logged in the first place.

> During disconnect of the device I get   "scsi host4: uas_post_reset: alloc streams error -19 after reset" and 
> I dont get the same with the modified patch which Alan suggested, 
> instead I get a proper disconnect.

Good.


On Tue, 27 Dec 2016, Oliver Neukum wrote:

> On Tue, 2016-12-27 at 10:20 -0500, Alan Stern wrote:
> > On Tue, 27 Dec 2016, Oliver Neukum wrote:
> > 
> > > On Thu, 2016-12-22 at 17:44 -0500, Alan Stern wrote:
> > > > I don't see how this patch fixes anything.  Unless I'm mistaken, it
> > > > just avoids the problem by preventing the system from issuing the
> > > > command that provokes the error, rather than really fixing the
> > > > underlying error.
> > > 
> > > Please clarify. If a reset leads to a disconnect, isn't that
> > > exactly what we want?
> > 
> > I didn't express myself clearly enough.  Yes, if a reset leads to a 
> > disconnect then avoiding the reset will avoid problems.
> 
> Good. Then we need to clarify whether the device was physically
> disconnected when the logs were taken.

According to George, it was connected when the first error message 
occurred and physically disconnected when the second message occurred.

> > But the _real_ error here is that xhci-hcd says "ERROR Transfer event
> > for disabled endpoint or incorrect stream ring" when the disconnect 
> > occurs during reset.  That shouldn't happen, no matter what quirks the 
> > device has.  It indicates a bug either in uas or in xhci-hcd.
> 
> True. I am afraid that there necessarily is a window for resetting a
> disconnected device. But the check you proposed is better.
> however, I'd like to encapsulate that together with a test for
> logical disconnect. Uas is unlikely to be the only driver that has
> this issue.

True enough.  We could have a usb_device_is_disconnected() inline
helper for this purpose.  There's no need to try to distinguish 
between physical and logical disconnects, as far as I can see.

However, as George points out, the "Transfer event" error has nothing 
to do with disconnection.  It was triggered by the device's bogus 
response to a REPORT OPCODES command, or something of the sort.  We 
should be able to handle bogus responses without logging ERROR 
messages, because such messages indicate a bug in a kernel driver.

Alan Stern



  reply	other threads:[~2016-12-28  2:26 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
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 [this message]
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.1612272109450.3821-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.