Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760829AbYHHVaX (ORCPT ); Fri, 8 Aug 2008 17:30:23 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754249AbYHHVaJ (ORCPT ); Fri, 8 Aug 2008 17:30:09 -0400 Received: from netrider.rowland.org ([192.131.102.5]:3208 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753675AbYHHVaI (ORCPT ); Fri, 8 Aug 2008 17:30:08 -0400 Date: Fri, 8 Aug 2008 17:30:07 -0400 (EDT) From: Alan Stern X-X-Sender: stern@netrider.rowland.org To: Matthew Frost cc: Greg KH , Kernel development list , Douglas Gilbert , James Bottomley , Matthew Dharm , Matthew Frost , USB Storage list , linux-scsi Subject: Re: [usb-storage] BUG: SCSI: usb storage SDHC card doesn't work in 2.6.27-rc1 In-Reply-To: <779703.44181.qm@web83203.mail.mud.yahoo.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2320 Lines: 61 On Fri, 8 Aug 2008, Matthew Frost wrote: > > > > Index: 2.6.26/drivers/usb/storage/transport.c > > > > =================================================================== > > > > --- 2.6.26.orig/drivers/usb/storage/transport.c > > > > +++ 2.6.26/drivers/usb/storage/transport.c > > > > @@ -1034,8 +1034,21 @@ int usb_stor_Bulk_transport(struct scsi_ > > > > > > > > /* try to compute the actual residue, based on how much data > > > > * was really transferred and what the device tells us */ > > > > - if (residue) { > > > > - if (!(us->flags & US_FL_IGNORE_RESIDUE)) { > > > > + if (residue && !(us->flags & US_FL_IGNORE_RESIDUE)) { > > > > + > > > > + /* Heuristically detect devices that generate bogus residues > > > > + * by seeing what happens with INQUIRY and READ CAPACITY > > > > + * commands. > > > > + */ > > > > + if (bcs->Status == US_BULK_STAT_OK && > > > > + scsi_get_resid(srb) == 0 && > > > > + ((srb->cmnd[0] == INQUIRY && > > > > + transfer_length == 36) || > > > > + (srb->cmnd[0] == READ_CAPACITY && > > > > + transfer_length == 8))) { > > > > + us->flags |= US_FL_IGNORE_RESIDUE; > > > > + > > > > + } else { > > > > residue = min(residue, transfer_length); > > > > scsi_set_resid(srb, max(scsi_get_resid(srb), > > > > (int) residue)); > > > > > > > > > > > > > > Thanks! I've been trying to fix it manually, and it wouldn't work. > > Trying > > > this version now. Let's see if this fixes my problem. > > > > > > Matt Frost > > > > > > > Tested under two distributions, this patch restores correct functionality > > to my hardware. Thank you very much! > > > > Matt > > > Update/sqeaking-of-the-wheel: > > The same problem still happens under 2.6.27-rc2, and I haven't seen this > bumped to -stable, either. It continues to solve the problem here. The patch has not yet been pushed to mainline but it is present in Greg KH's USB development tree. Presumably it will end up in the mainline kernel before 2.6.27-final is released. Alan Stern -- 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/