* [PATCH] Fix SCSI regression in 2.6.27 [was [Bugme-new] [Bug 12099] New: Nokia 5310 storage-mode]
[not found] <20081125055939.a96796ec.akpm@linux-foundation.org>
@ 2008-11-25 15:34 ` Alan Stern
2008-11-26 5:07 ` James Bottomley
0 siblings, 1 reply; 3+ messages in thread
From: Alan Stern @ 2008-11-25 15:34 UTC (permalink / raw)
To: James Bottomley, Andrew Morton
Cc: SCSI development list, Kernel development list, stable
This patch is intended for 2.6.27.stable and 2.6.28. It's a temporary
fix for a problem affecting a number of USB mass-storage devices
(including many Nokia phones): When trying to access a nonexistent
"last" sector, the SCSI midlayer gets caught in an endless retry loop.
See for example Bugzilla #11843 and #12099.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
---
On Tue, 25 Nov 2008, Andrew Morton wrote:
> On Tue, 25 Nov 2008 01:07:43 -0800 (PST) bugme-daemon@bugzilla.kernel.org wrote:
>
> > http://bugzilla.kernel.org/show_bug.cgi?id=12099
> >
> > Summary: Nokia 5310 storage-mode
> > Product: Drivers
> > Version: 2.5
> > KernelVersion: 2.6.27
> > Platform: All
> > OS/Version: Linux
> > Tree: Mainline
> > Status: NEW
> > Severity: normal
> > Priority: P1
> > Component: USB
> > AssignedTo: greg@kroah.com
> > ReportedBy: robsonpeixoto@gmail.com
> >
> >
> > Latest working kernel version: 2.6.26
> > Earliest failing kernel version: 2.6.27
>
> A regression.
>
> > Distribution: ArchLinux
> > Hardware Environment: USB(ohci,ehci)
> > Software Environment: gcc 4.3.2, glibc 2.8
> > Problem Description:
> >
> > When I plug in my Nokia 5310 show a msg in cel "Transferring data" and in
> > computer nothing happend.
Unless we want to keep on receiving regression reports like this one,
this patch or something like it needs to be applied. We can hope
2.6.29 will work better... But unhappily, to date James has not
responded to any of my patch submissions in this area.
Alan Stern
Index: 2.6.27.4/drivers/scsi/scsi_lib.c
===================================================================
--- 2.6.27.4.orig/drivers/scsi/scsi_lib.c
+++ 2.6.27.4/drivers/scsi/scsi_lib.c
@@ -611,6 +611,11 @@ static void scsi_requeue_command(struct
struct request *req = cmd->request;
unsigned long flags;
+ if (--req->retries < 0) {
+ blk_end_request(req, -EIO, blk_rq_bytes(req));
+ scsi_next_command(cmd);
+ return;
+ }
scsi_unprep_request(req);
spin_lock_irqsave(q->queue_lock, flags);
blk_requeue_request(q, req);
@@ -690,6 +695,8 @@ static struct scsi_cmnd *scsi_end_reques
* leftovers in the front of the
* queue, and goose the queue again.
*/
+ if (bytes > 0) /* Made progress */
+ ++req->retries;
scsi_requeue_command(q, cmd);
cmd = NULL;
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix SCSI regression in 2.6.27 [was [Bugme-new] [Bug 12099] New: Nokia 5310 storage-mode]
2008-11-25 15:34 ` [PATCH] Fix SCSI regression in 2.6.27 [was [Bugme-new] [Bug 12099] New: Nokia 5310 storage-mode] Alan Stern
@ 2008-11-26 5:07 ` James Bottomley
2008-11-26 15:01 ` Alan Stern
0 siblings, 1 reply; 3+ messages in thread
From: James Bottomley @ 2008-11-26 5:07 UTC (permalink / raw)
To: Alan Stern
Cc: Andrew Morton, SCSI development list, Kernel development list,
stable
On Tue, 2008-11-25 at 10:34 -0500, Alan Stern wrote:
> This patch is intended for 2.6.27.stable and 2.6.28. It's a temporary
> fix for a problem affecting a number of USB mass-storage devices
> (including many Nokia phones): When trying to access a nonexistent
> "last" sector, the SCSI midlayer gets caught in an endless retry loop.
Can't we just invoke the last sector handling flag for all Nokia
devices?
> See for example Bugzilla #11843 and #12099.
>
> Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
>
> ---
>
> On Tue, 25 Nov 2008, Andrew Morton wrote:
>
> > On Tue, 25 Nov 2008 01:07:43 -0800 (PST) bugme-daemon@bugzilla.kernel.org wrote:
> >
> > > http://bugzilla.kernel.org/show_bug.cgi?id=12099
> > >
> > > Summary: Nokia 5310 storage-mode
> > > Product: Drivers
> > > Version: 2.5
> > > KernelVersion: 2.6.27
> > > Platform: All
> > > OS/Version: Linux
> > > Tree: Mainline
> > > Status: NEW
> > > Severity: normal
> > > Priority: P1
> > > Component: USB
> > > AssignedTo: greg@kroah.com
> > > ReportedBy: robsonpeixoto@gmail.com
> > >
> > >
> > > Latest working kernel version: 2.6.26
> > > Earliest failing kernel version: 2.6.27
> >
> > A regression.
> >
> > > Distribution: ArchLinux
> > > Hardware Environment: USB(ohci,ehci)
> > > Software Environment: gcc 4.3.2, glibc 2.8
> > > Problem Description:
> > >
> > > When I plug in my Nokia 5310 show a msg in cel "Transferring data" and in
> > > computer nothing happend.
>
> Unless we want to keep on receiving regression reports like this one,
> this patch or something like it needs to be applied. We can hope
> 2.6.29 will work better... But unhappily, to date James has not
> responded to any of my patch submissions in this area.
>
> Alan Stern
>
>
>
> Index: 2.6.27.4/drivers/scsi/scsi_lib.c
> ===================================================================
> --- 2.6.27.4.orig/drivers/scsi/scsi_lib.c
> +++ 2.6.27.4/drivers/scsi/scsi_lib.c
> @@ -611,6 +611,11 @@ static void scsi_requeue_command(struct
> struct request *req = cmd->request;
> unsigned long flags;
>
> + if (--req->retries < 0) {
> + blk_end_request(req, -EIO, blk_rq_bytes(req));
> + scsi_next_command(cmd);
> + return;
> + }
This would cause tape errors on unit attention (fairly common
condition). It can be argued that we get more users of USB mobile
phones than tapes, but I'd rather keep both communities happy
By and large, the reason we backport from head if at all possible is so
we can avoid bugs like this creeping into stable. (And backporting from
head is far easier if the bug fixes are small and don't contain
miscellaneous code clean ups, control flow changes and comment fixes)
> Unless we want to keep on receiving regression reports like this one,
> this patch or something like it needs to be applied. We can hope
> 2.6.29 will work better... But unhappily, to date James has not
> responded to any of my patch submissions in this area.
I tried to untangle it on the 'plane yesterday. I've just got a bit
more testing to do then I'll post the patch to your patch.
James
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix SCSI regression in 2.6.27 [was [Bugme-new] [Bug 12099] New: Nokia 5310 storage-mode]
2008-11-26 5:07 ` James Bottomley
@ 2008-11-26 15:01 ` Alan Stern
0 siblings, 0 replies; 3+ messages in thread
From: Alan Stern @ 2008-11-26 15:01 UTC (permalink / raw)
To: James Bottomley
Cc: Andrew Morton, SCSI development list, Kernel development list,
stable
On Tue, 25 Nov 2008, James Bottomley wrote:
> On Tue, 2008-11-25 at 10:34 -0500, Alan Stern wrote:
> > This patch is intended for 2.6.27.stable and 2.6.28. It's a temporary
> > fix for a problem affecting a number of USB mass-storage devices
> > (including many Nokia phones): When trying to access a nonexistent
> > "last" sector, the SCSI midlayer gets caught in an endless retry loop.
>
> Can't we just invoke the last sector handling flag for all Nokia
> devices?
That would work for those devices... until and unless Nokia ever
decides to correct their bug. It won't help anything else.
> This would cause tape errors on unit attention (fairly common
> condition). It can be argued that we get more users of USB mobile
> phones than tapes, but I'd rather keep both communities happy
Me too. I realize this patch hasn't been tested or vetted by anyone in
the SCSI development crowd. That's why I've been pestering you guys
about it!
> By and large, the reason we backport from head if at all possible is so
> we can avoid bugs like this creeping into stable. (And backporting from
> head is far easier if the bug fixes are small and don't contain
> miscellaneous code clean ups, control flow changes and comment fixes)
> I tried to untangle it on the 'plane yesterday. I've just got a bit
> more testing to do then I'll post the patch to your patch.
That's fine with me. I just don't want to see the same problem
continuing on into 2.6.28.final.
Alan Stern
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-11-26 15:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20081125055939.a96796ec.akpm@linux-foundation.org>
2008-11-25 15:34 ` [PATCH] Fix SCSI regression in 2.6.27 [was [Bugme-new] [Bug 12099] New: Nokia 5310 storage-mode] Alan Stern
2008-11-26 5:07 ` James Bottomley
2008-11-26 15:01 ` Alan Stern
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox