All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Frost <artusemrys@sbcglobal.net>
To: Alan Stern <stern@rowland.harvard.edu>,
	Matthew Frost <artusemrys@sbcglobal.net>
Cc: Greg KH <greg@kroah.com>,
	Kernel development list <linux-kernel@vger.kernel.org>,
	Douglas Gilbert <dougg@torque.net>,
	James Bottomley <James.Bottomley@HansenPartnership.com>,
	Matthew Dharm <mdharm-kernel@one-eyed-alien.net>,
	Matthew Frost <artusemrys@yahoo.com>,
	USB Storage list <usb-storage@lists.one-eyed-alien.net>,
	linux-scsi <linux-scsi@vger.kernel.org>
Subject: Re: [usb-storage] BUG: SCSI: usb storage SDHC card doesn't work in 2.6.27-rc1
Date: Sat, 9 Aug 2008 08:51:22 -0700 (PDT)	[thread overview]
Message-ID: <72707.75302.qm@web83208.mail.mud.yahoo.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0808081728340.24293-100000@netrider.rowland.org>

--- Alan Stern <stern@rowland.harvard.edu> wrote:

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

Thanks for the feedback!  

Matt

  reply	other threads:[~2008-08-09 15:51 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-30  0:06 BUG: SCSI: usb storage SDHC card doesn't work in 2.6.27-rc1 Matthew Frost
2008-07-30  4:08 ` James Bottomley
2008-07-30  5:21   ` [usb-storage] " Matthew Dharm
2008-07-30 14:17     ` Alan Stern
2008-07-30 14:17       ` Alan Stern
2008-07-30 14:55       ` James Bottomley
2008-07-30 15:27         ` Alan Stern
2008-07-30 15:27           ` Alan Stern
2008-07-30 19:50         ` Douglas Gilbert
2008-07-30 21:00           ` Alan Stern
2008-07-30 21:00             ` Alan Stern
2008-07-30 21:09             ` Pete Zaitcev
2008-07-30 21:28               ` Alan Stern
2008-07-30 21:28                 ` Alan Stern
2008-07-30 21:58                 ` Pete Zaitcev
2008-07-30 21:58                   ` Pete Zaitcev
2008-07-31 15:10                   ` Alan Stern
2008-07-31 15:10                     ` Alan Stern
2008-08-01 18:46             ` [usb-storage] " Matthew Frost
2008-08-01 22:22               ` Matthew Frost
2008-08-03 11:56                 ` Douglas Gilbert
2008-08-08 21:07                 ` Matthew Frost
2008-08-08 21:30                   ` Alan Stern
2008-08-09 15:51                     ` Matthew Frost [this message]
2008-07-30 14:15   ` Alan Stern
2008-07-30 14:15     ` Alan Stern
2008-07-30 15:39     ` Matthew Frost

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=72707.75302.qm@web83208.mail.mud.yahoo.com \
    --to=artusemrys@sbcglobal.net \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=artusemrys@yahoo.com \
    --cc=dougg@torque.net \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mdharm-kernel@one-eyed-alien.net \
    --cc=stern@rowland.harvard.edu \
    --cc=usb-storage@lists.one-eyed-alien.net \
    /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.