All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Frost <artusemrys@yahoo.com>
To: Matthew Frost <artusemrys@sbcglobal.net>,
	Alan Stern <stern@rowland.harvard.edu>,
	Douglas Gilbert <dougg@torque.net>
Cc: 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-kernel@vger.kernel.org,
	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: Fri, 1 Aug 2008 15:22:12 -0700 (PDT)	[thread overview]
Message-ID: <656254.26203.qm@web83208.mail.mud.yahoo.com> (raw)
In-Reply-To: <101516.95411.qm@web83205.mail.mud.yahoo.com>

--- Matthew Frost <artusemrys@sbcglobal.net> wrote:

> Alan Stern wrote:
> > > The patches to fix this that I have tried do not apply
> > > cleanly to lk 2.6.26 (and break during compile if forced:
> > > "us->fflags" is not defined).
> > > 
> > > Is there a lk 2.6.26 patch available?
> > 
> > Sorry about that; my patches are against the USB development tree and
> > I tend to forget to redo them against the vanilla kernel.  Below is a
> > patch against 2.6.26.  Or you can just edit the original patch and
> > change the occurrences of "fflags" to "flags".
> > 
> > Alan Stern
> > 
> > 
> > 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

  reply	other threads:[~2008-08-01 22:22 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 [this message]
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
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=656254.26203.qm@web83208.mail.mud.yahoo.com \
    --to=artusemrys@yahoo.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=artusemrys@sbcglobal.net \
    --cc=dougg@torque.net \
    --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.