lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 11 Oct 2009 10:47:17 +1100
From:	Benjamin Herrenschmidt <benh@...nel.crashing.org>
To:	Alan Stern <stern@...land.harvard.edu>
Cc:	Josua Dietze <digidietze@...isberghof.de>,
	Ben Efros <ben@...doctor.com>,
	fangxiaozhi <huananhu@...wei.com>, Greg KH <greg@...ah.com>,
	Kernel development list <linux-kernel@...r.kernel.org>,
	USB list <linux-usb@...r.kernel.org>,
	Hugh Blemings <hugh@...mings.org>
Subject: Re: USB serial regression 2.6.31.1 -> 2.6.31.2

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@...nel.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


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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ