Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758322AbYG3V3I (ORCPT ); Wed, 30 Jul 2008 17:29:08 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753884AbYG3V2v (ORCPT ); Wed, 30 Jul 2008 17:28:51 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:49426 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752977AbYG3V2v (ORCPT ); Wed, 30 Jul 2008 17:28:51 -0400 Date: Wed, 30 Jul 2008 17:28:49 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Pete Zaitcev cc: Douglas Gilbert , Matthew Dharm , Matt Frost , linux-scsi , USB Storage list , , James Bottomley , Matthew Frost Subject: Re: [usb-storage] BUG: SCSI: usb storage SDHC card doesn't work in 2.6.27-rc1 In-Reply-To: <20080730150953.771b1345.zaitcev@redhat.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: 1669 Lines: 40 On Wed, 30 Jul 2008, Pete Zaitcev wrote: > On Wed, 30 Jul 2008 17:00:10 -0400 (EDT), Alan Stern wrote: > > > +++ 2.6.26/drivers/usb/storage/transport.c > > @@ -1034,8 +1034,21 @@ int usb_stor_Bulk_transport(struct scsi_ > > + /* 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; > > Why do you do this for INQUIRY and READ_CAPACITY only? > Why not do it for any command? Because those are the only two commands for which I'm reasonably certain the device should never return a nonzero residue with Okay status. For other commands there might be a valid positive residue -- although if there is then the device should also return Check Condition status (the spec is unclear on this point). Actually I'm a little concerned about the READ CAPACITY command; it's conceivable that a removable-media device with no media present might return a valid positive residue. However the chance of something like that happening and causing a problem is probably sufficiently small that we can ignore it. 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/