public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Douglas Gilbert <dougg@torque.net>
To: Matthew Frost <artusemrys@yahoo.com>
Cc: Matthew Frost <artusemrys@sbcglobal.net>,
	Alan Stern <stern@rowland.harvard.edu>,
	James Bottomley <James.Bottomley@HansenPartnership.com>,
	Matthew Dharm <mdharm-kernel@one-eyed-alien.net>,
	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: Sun, 03 Aug 2008 13:56:42 +0200	[thread overview]
Message-ID: <48959CFA.6080500@torque.net> (raw)
In-Reply-To: <656254.26203.qm@web83208.mail.mud.yahoo.com>

Matthew Frost wrote:
> --- 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

The above patch made my USB key:
   Alcor Micro Corp. Transcend JetFlash 110 USB 2.0 Flash Drive (2GB)
usable in a pretty clean lk 2.6.26 .

Thanks
Doug Gilbert




  reply	other threads:[~2008-08-03 11:56 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <103966.68801.qm@web83207.mail.mud.yahoo.com>
2008-07-30  4:08 ` BUG: SCSI: usb storage SDHC card doesn't work in 2.6.27-rc1 James Bottomley
2008-07-30  5:21   ` [usb-storage] " Matthew Dharm
2008-07-30 14:17     ` Alan Stern
2008-07-30 14:55       ` James Bottomley
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:09             ` Pete Zaitcev
2008-07-30 21:28               ` Alan Stern
2008-07-30 21:58                 ` Pete Zaitcev
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 [this message]
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 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=48959CFA.6080500@torque.net \
    --to=dougg@torque.net \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=artusemrys@sbcglobal.net \
    --cc=artusemrys@yahoo.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox