public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Josua Dietze <digidietze@draisberghof.de>,
	Ben Efros <ben@pc-doctor.com>, fangxiaozhi <huananhu@huawei.com>,
	Greg KH <greg@kroah.com>,
	Kernel development list <linux-kernel@vger.kernel.org>,
	USB list <linux-usb@vger.kernel.org>,
	Hugh Blemings <hugh@blemings.org>
Subject: Re: USB serial regression 2.6.31.1 -> 2.6.31.2
Date: Sun, 11 Oct 2009 10:47:17 +1100	[thread overview]
Message-ID: <1255218437.2192.26.camel@pasglop> (raw)
In-Reply-To: <1255217186.2192.18.camel@pasglop>

On Sun, 2009-10-11 at 10:26 +1100, Benjamin Herrenschmidt wrote:
> On Sat, 2009-10-10 at 18:52 -0400, Alan Stern wrote:
> > > Maybe a better approach would be to go back to 18 bytes when it fails,
> > > what do you think ?
> > 
> > We certainly could do that.  But should we turn off the SANE_SENSE flag 
> > at the same time? 
> 
> I would think so, and not set it back the next time the sense buffer
> claims more data in it (something like setting a NOT_REALLY_SANE_SENSE
> flag ? :-)
> 
> Or not care and always do double sense on those devices. Whatever
> works. It's not that sense was a fast path.

Ok, so here's an absolutely horrible hack that makes it work here,
but of course, I think that should be done more cleanly.

With some printk added I verified that it does ping pong
US_FL_SANE_SENSE (ie, sets it back as soon as the command
succeeds) but I don't see that as a big deal though.

I doubt you want to apply that as-is though but in case you do:

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Cheers,
Ben.

--- a/drivers/usb/storage/transport.c	2009-10-09 14:34:14.638445171 +1100
+++ b/drivers/usb/storage/transport.c	2009-10-11 10:40:55.890868361 +1100
@@ -687,6 +687,7 @@
 		US_DEBUGP("-- unexpectedly short transfer\n");
 	}
 
+ Retry_Sense:
 	/* Now, if we need to do the auto-sense, let's do it */
 	if (need_auto_sense) {
 		int temp_result;
@@ -722,6 +723,11 @@
 		}
 		if (temp_result != USB_STOR_TRANSPORT_GOOD) {
 			US_DEBUGP("-- auto-sense failure\n");
+			if (us->fflags & US_FL_SANE_SENSE) {
+				us->fflags &= ~US_FL_SANE_SENSE;
+				US_DEBUGP("-- retry without SANE_SENSE\n");
+				goto Retry_Sense;
+			}
 
 			/* we skip the reset if this happens to be a
 			 * multi-target device, since failure of an



  reply	other threads:[~2009-10-10 23:48 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-10  0:25 USB serial regression 2.6.31.1 -> 2.6.31.2 Benjamin Herrenschmidt
2009-10-10  0:31 ` USB serial regression 2.6.31.1 -> 2.6.31.2 (and 2.6.32-rc3) Benjamin Herrenschmidt
2009-10-10  0:32   ` Benjamin Herrenschmidt
2009-10-10  1:56     ` Alan Stern
2009-10-10  2:03       ` Alan Stern
2009-10-10  2:48         ` Benjamin Herrenschmidt
2009-10-10  3:11         ` Benjamin Herrenschmidt
2009-10-10 16:20           ` Alan Stern
2009-10-10  2:45       ` Benjamin Herrenschmidt
2009-10-10  7:38 ` USB serial regression 2.6.31.1 -> 2.6.31.2 Josua Dietze
2009-10-10  7:41   ` Benjamin Herrenschmidt
2009-10-10  9:55     ` Oliver Neukum
2009-10-10 15:05       ` Greg KH
2009-10-10 17:05   ` Alan Stern
2009-10-10 17:43     ` Ondrej Zary
2009-10-10 20:41     ` Alan Stern
2009-10-10 21:20       ` Benjamin Herrenschmidt
2009-10-10 22:17         ` Benjamin Herrenschmidt
2009-10-11 14:45           ` Alan Stern
2009-10-10 21:18     ` Benjamin Herrenschmidt
2009-10-10 21:56     ` Benjamin Herrenschmidt
2009-10-10 22:52       ` Alan Stern
2009-10-10 23:26         ` Benjamin Herrenschmidt
2009-10-10 23:47           ` Benjamin Herrenschmidt [this message]
     [not found] <11818577.563251255220394815.JavaMail.root@mail.pc-doctor.com>
2009-10-11  0:21 ` Ben Efros
2009-10-11  5:24   ` Benjamin Herrenschmidt

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=1255218437.2192.26.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=ben@pc-doctor.com \
    --cc=digidietze@draisberghof.de \
    --cc=greg@kroah.com \
    --cc=huananhu@huawei.com \
    --cc=hugh@blemings.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox