* Fw: legacy megaraid driver bug in mm-series
@ 2005-09-07 9:52 Andrew Morton
2005-09-08 14:35 ` Christoph Hellwig
0 siblings, 1 reply; 7+ messages in thread
From: Andrew Morton @ 2005-09-07 9:52 UTC (permalink / raw)
To: linux-scsi; +Cc: Jack Byer
Begin forwarded message:
Date: Mon, 05 Sep 2005 21:05:40 -0400
From: Jack Byer <ojbyer@usa.net>
To: linux-kernel@vger.kernel.org
Subject: legacy megaraid driver bug in mm-series
My AMI megaraid card no longer works with recent mm-series kernels. The
bug appears on mm- kernels newer than 2.6.12-rc6-mm1; mainline kernels
are not affected.
The driver will load and detect both devices on the card (sda and sdb).
It will scan each device and read the partition table successfully,
however the megaraid driver message will include the following errors:
sda: sector size 0 reported, assuming 512.
sda: asking for cache data failed.
sda: assuming drive cache: write through
When the kernel tries to mount the root file system, I get the following
error:
ReiserFS: sda3: warning: sh-2006: read_super_block: bread failed (dev
sda3, block 2, size 4096)
ReiserFS: sda3: warning: sh-2006: read_super_block: bread failed (dev
sda3, block 16, size 4096)
VFS: Cannot open root device "sda3" or unknown-block(0,3)
Here is a summary of the kernels I have tested for this bug:
2.6.11-mm1: works
2.6.11-mm4: works
2.6.12-rc5-mm1: will not compile
2.6.12-rc6-mm1: works
2.6.12-mm1: will not compile megaraid driver
2.6.12-mm2: broken
2.6.13-mm1: broken
2.6.12: works
2.6.13: works
-
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/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Fw: legacy megaraid driver bug in mm-series
2005-09-07 9:52 Fw: legacy megaraid driver bug in mm-series Andrew Morton
@ 2005-09-08 14:35 ` Christoph Hellwig
2005-09-09 23:58 ` Andrew Morton
0 siblings, 1 reply; 7+ messages in thread
From: Christoph Hellwig @ 2005-09-08 14:35 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-scsi, Jack Byer
On Wed, Sep 07, 2005 at 02:52:58AM -0700, Andrew Morton wrote:
>
>
> Begin forwarded message:
This looks preyyu much like a breakage because we're now always sending
S/G list down the scsi layer.
The patch below brings over code to handle that case from the megaraid_mbox
driver. It's still wrong for the case someone sends a MODE_SENSE from
highmem userspace, but it should at least boot with the patch applied.
Index: scsi-misc-2.6/drivers/scsi/megaraid.c
===================================================================
--- scsi-misc-2.6.orig/drivers/scsi/megaraid.c 2005-08-13 13:53:52.000000000 +0200
+++ scsi-misc-2.6/drivers/scsi/megaraid.c 2005-09-08 16:34:06.000000000 +0200
@@ -621,8 +621,6 @@
if(islogical) {
switch (cmd->cmnd[0]) {
case TEST_UNIT_READY:
- memset(cmd->request_buffer, 0, cmd->request_bufflen);
-
#if MEGA_HAVE_CLUSTERING
/*
* Do we support clustering and is the support enabled
@@ -653,7 +651,19 @@
#endif
case MODE_SENSE:
- memset(cmd->request_buffer, 0, cmd->cmnd[4]);
+ if (cmd->use_sg) {
+ struct scatterlist *sgl;
+ caddr_t vaddr;
+
+ sgl = (struct scatterlist *)cmd->request_buffer;
+ vaddr = (caddr_t)
+ (page_address((&sgl[0])->page)
+ + (&sgl[0])->offset);
+
+ memset(vaddr, 0, cmd->cmnd[4]);
+ } else {
+ memset(cmd->request_buffer, 0, cmd->cmnd[4]);
+ }
cmd->result = (DID_OK << 16);
cmd->scsi_done(cmd);
return NULL;
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Fw: legacy megaraid driver bug in mm-series
2005-09-08 14:35 ` Christoph Hellwig
@ 2005-09-09 23:58 ` Andrew Morton
2005-09-12 23:48 ` Jack Byer
0 siblings, 1 reply; 7+ messages in thread
From: Andrew Morton @ 2005-09-09 23:58 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linux-scsi, ojbyer
Christoph Hellwig <hch@infradead.org> wrote:
>
> On Wed, Sep 07, 2005 at 02:52:58AM -0700, Andrew Morton wrote:
> >
> >
> > Begin forwarded message:
>
> This looks preyyu much like a breakage because we're now always sending
> S/G list down the scsi layer.
>
> The patch below brings over code to handle that case from the megaraid_mbox
> driver. It's still wrong for the case someone sends a MODE_SENSE from
> highmem userspace, but it should at least boot with the patch applied.
>
Jack, have you had a chance to test this?
Thanks.
>
> Index: scsi-misc-2.6/drivers/scsi/megaraid.c
> ===================================================================
> --- scsi-misc-2.6.orig/drivers/scsi/megaraid.c 2005-08-13 13:53:52.000000000 +0200
> +++ scsi-misc-2.6/drivers/scsi/megaraid.c 2005-09-08 16:34:06.000000000 +0200
> @@ -621,8 +621,6 @@
> if(islogical) {
> switch (cmd->cmnd[0]) {
> case TEST_UNIT_READY:
> - memset(cmd->request_buffer, 0, cmd->request_bufflen);
> -
> #if MEGA_HAVE_CLUSTERING
> /*
> * Do we support clustering and is the support enabled
> @@ -653,7 +651,19 @@
> #endif
>
> case MODE_SENSE:
> - memset(cmd->request_buffer, 0, cmd->cmnd[4]);
> + if (cmd->use_sg) {
> + struct scatterlist *sgl;
> + caddr_t vaddr;
> +
> + sgl = (struct scatterlist *)cmd->request_buffer;
> + vaddr = (caddr_t)
> + (page_address((&sgl[0])->page)
> + + (&sgl[0])->offset);
> +
> + memset(vaddr, 0, cmd->cmnd[4]);
> + } else {
> + memset(cmd->request_buffer, 0, cmd->cmnd[4]);
> + }
> cmd->result = (DID_OK << 16);
> cmd->scsi_done(cmd);
> return NULL;
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Fw: legacy megaraid driver bug in mm-series
2005-09-09 23:58 ` Andrew Morton
@ 2005-09-12 23:48 ` Jack Byer
2005-09-13 9:23 ` Christoph Hellwig
0 siblings, 1 reply; 7+ messages in thread
From: Jack Byer @ 2005-09-12 23:48 UTC (permalink / raw)
To: Andrew Morton; +Cc: Christoph Hellwig, linux-scsi
Andrew Morton wrote:
> Christoph Hellwig <hch@infradead.org> wrote:
>
>>On Wed, Sep 07, 2005 at 02:52:58AM -0700, Andrew Morton wrote:
>>
>>>
>>>Begin forwarded message:
>>
>>This looks preyyu much like a breakage because we're now always sending
>>S/G list down the scsi layer.
>>
>>The patch below brings over code to handle that case from the megaraid_mbox
>>driver. It's still wrong for the case someone sends a MODE_SENSE from
>>highmem userspace, but it should at least boot with the patch applied.
>>
>
>
> Jack, have you had a chance to test this?
>
> Thanks.
>
Sorry, I spent the weekend whitewater rafting :) I will be able to test
this patch on Wednesday. Which kernel versions should I apply this patch to?
>
>>Index: scsi-misc-2.6/drivers/scsi/megaraid.c
>>===================================================================
>>--- scsi-misc-2.6.orig/drivers/scsi/megaraid.c 2005-08-13 13:53:52.000000000 +0200
>>+++ scsi-misc-2.6/drivers/scsi/megaraid.c 2005-09-08 16:34:06.000000000 +0200
>>@@ -621,8 +621,6 @@
>> if(islogical) {
>> switch (cmd->cmnd[0]) {
>> case TEST_UNIT_READY:
>>- memset(cmd->request_buffer, 0, cmd->request_bufflen);
>>-
>> #if MEGA_HAVE_CLUSTERING
>> /*
>> * Do we support clustering and is the support enabled
>>@@ -653,7 +651,19 @@
>> #endif
>>
>> case MODE_SENSE:
>>- memset(cmd->request_buffer, 0, cmd->cmnd[4]);
>>+ if (cmd->use_sg) {
>>+ struct scatterlist *sgl;
>>+ caddr_t vaddr;
>>+
>>+ sgl = (struct scatterlist *)cmd->request_buffer;
>>+ vaddr = (caddr_t)
>>+ (page_address((&sgl[0])->page)
>>+ + (&sgl[0])->offset);
>>+
>>+ memset(vaddr, 0, cmd->cmnd[4]);
>>+ } else {
>>+ memset(cmd->request_buffer, 0, cmd->cmnd[4]);
>>+ }
>> cmd->result = (DID_OK << 16);
>> cmd->scsi_done(cmd);
>> return NULL;
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Fw: legacy megaraid driver bug in mm-series
2005-09-12 23:48 ` Jack Byer
@ 2005-09-13 9:23 ` Christoph Hellwig
[not found] ` <4326A4A5.6090200@usa.net>
0 siblings, 1 reply; 7+ messages in thread
From: Christoph Hellwig @ 2005-09-13 9:23 UTC (permalink / raw)
To: Jack Byer; +Cc: Andrew Morton, Christoph Hellwig, linux-scsi
On Mon, Sep 12, 2005 at 07:48:10PM -0400, Jack Byer wrote:
> Andrew Morton wrote:
> > Christoph Hellwig <hch@infradead.org> wrote:
> >
> >>On Wed, Sep 07, 2005 at 02:52:58AM -0700, Andrew Morton wrote:
> >>
> >>>
> >>>Begin forwarded message:
> >>
> >>This looks preyyu much like a breakage because we're now always sending
> >>S/G list down the scsi layer.
> >>
> >>The patch below brings over code to handle that case from the megaraid_mbox
> >>driver. It's still wrong for the case someone sends a MODE_SENSE from
> >>highmem userspace, but it should at least boot with the patch applied.
> >>
> >
> >
> > Jack, have you had a chance to test this?
> >
> > Thanks.
> >
> Sorry, I spent the weekend whitewater rafting :) I will be able to test
> this patch on Wednesday. Which kernel versions should I apply this patch to?
I did it against the at that time latest scsi-misc tree. The old megaraid
driver hasn'tt changed much for a long time so it should apply against
any recent-ish tree.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Fw: legacy megaraid driver bug in mm-series
@ 2005-09-13 10:17 Jack Byer
0 siblings, 0 replies; 7+ messages in thread
From: Jack Byer @ 2005-09-13 10:17 UTC (permalink / raw)
To: linux-scsi, Andrew Morton
-------- Original Message --------
Subject: Re: Fw: legacy megaraid driver bug in mm-series
Date: Tue, 13 Sep 2005 06:06:29 -0400
From: Jack Byer <ojbyer@usa.net>
To: Christoph Hellwig <hch@infradead.org>
References: <20050907025258.35100c34.akpm@osdl.org>
<20050908143547.GA9741@infradead.org>
<20050909165817.1a8ad251.akpm@osdl.org> <432613BA.5060606@usa.net>
<20050913092359.GA29552@infradead.org>
Christoph Hellwig wrote:
> On Mon, Sep 12, 2005 at 07:48:10PM -0400, Jack Byer wrote:
>
>>Andrew Morton wrote:
>>
>>>Christoph Hellwig <hch@infradead.org> wrote:
>>>
>>>
>>>>On Wed, Sep 07, 2005 at 02:52:58AM -0700, Andrew Morton wrote:
>>>>
>>>>
>>>>>Begin forwarded message:
>>>>
>>>>This looks preyyu much like a breakage because we're now always sending
>>>>S/G list down the scsi layer.
>>>>
>>>>The patch below brings over code to handle that case from the megaraid_mbox
>>>>driver. It's still wrong for the case someone sends a MODE_SENSE from
>>>>highmem userspace, but it should at least boot with the patch applied.
>>>>
>>>
>>>
>>>Jack, have you had a chance to test this?
>>>
>>>Thanks.
>>>
>>
>>Sorry, I spent the weekend whitewater rafting :) I will be able to test
>>this patch on Wednesday. Which kernel versions should I apply this patch to?
>
>
> I did it against the at that time latest scsi-misc tree. The old megaraid
> driver hasn'tt changed much for a long time so it should apply against
> any recent-ish tree.
>
>
I tried the patch on a 2.6.13-mm1 tree. It applied cleanly, but produced
a few compiler warnings:
/usr/src/linux-2.6.13-mm1/drivers/scsi/megaraid.c: In function `issue_scb':
/usr/src/linux-2.6.13-mm1/drivers/scsi/megaraid.c:1143: warning: passing
arg 2 of `writel' makes pointer from integer without a cast
/usr/src/linux-2.6.13-mm1/drivers/scsi/megaraid.c: In function
`issue_scb_block':
/usr/src/linux-2.6.13-mm1/drivers/scsi/megaraid.c:1206: warning: passing
arg 2 of `writel' makes pointer from integer without a cast
/usr/src/linux-2.6.13-mm1/drivers/scsi/megaraid.c:1219: warning: passing
arg 2 of `writel' makes pointer from integer without a cast
/usr/src/linux-2.6.13-mm1/drivers/scsi/megaraid.c:1221: warning: passing
arg 1 of `readl' makes pointer from integer without a cast
/usr/src/linux-2.6.13-mm1/drivers/scsi/megaraid.c: In function
`megaraid_isr_memmapped':
/usr/src/linux-2.6.13-mm1/drivers/scsi/megaraid.c:1351: warning: passing
arg 1 of `readl' makes pointer from integer without a cast
/usr/src/linux-2.6.13-mm1/drivers/scsi/megaraid.c:1358: warning: passing
arg 2 of `writel' makes pointer from integer without a cast
/usr/src/linux-2.6.13-mm1/drivers/scsi/megaraid.c:1377: warning: passing
arg 2 of `writel' makes pointer from integer without a cast
/usr/src/linux-2.6.13-mm1/drivers/scsi/megaraid.c:1381: warning: passing
arg 1 of `readl' makes pointer from integer without a cast
Booting the kernel resulted in the same symptoms as before (can not
mount root fs).
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Fw: legacy megaraid driver bug in mm-series
[not found] ` <4326A4A5.6090200@usa.net>
@ 2005-09-14 18:14 ` Jack Byer
0 siblings, 0 replies; 7+ messages in thread
From: Jack Byer @ 2005-09-14 18:14 UTC (permalink / raw)
To: akpm; +Cc: Christoph Hellwig, linux-scsi
>>>>>This looks preyyu much like a breakage because we're now always sending
>>>>>S/G list down the scsi layer.
>>>>>
>>>>>The patch below brings over code to handle that case from the megaraid_mbox
>>>>>driver. It's still wrong for the case someone sends a MODE_SENSE from
>>>>>highmem userspace, but it should at least boot with the patch applied.
>>>>>
>>>>
>>>>
>>>>Jack, have you had a chance to test this?
>>>>
>>>>Thanks.
>>>>
>>>
>>>Sorry, I spent the weekend whitewater rafting :) I will be able to test
>>>this patch on Wednesday. Which kernel versions should I apply this patch to?
>>
>>
>>I did it against the at that time latest scsi-misc tree. The old megaraid
>>driver hasn'tt changed much for a long time so it should apply against
>>any recent-ish tree.
>>
>>
>
>
> I tried the patch on a 2.6.13-mm1 tree. It applied cleanly, but produced
> a few compiler warnings:
>
>
> /usr/src/linux-2.6.13-mm1/drivers/scsi/megaraid.c: In function `issue_scb':
> /usr/src/linux-2.6.13-mm1/drivers/scsi/megaraid.c:1143: warning: passing
> arg 2 of `writel' makes pointer from integer without a cast
> /usr/src/linux-2.6.13-mm1/drivers/scsi/megaraid.c: In function
> `issue_scb_block':
> /usr/src/linux-2.6.13-mm1/drivers/scsi/megaraid.c:1206: warning: passing
> arg 2 of `writel' makes pointer from integer without a cast
> /usr/src/linux-2.6.13-mm1/drivers/scsi/megaraid.c:1219: warning: passing
> arg 2 of `writel' makes pointer from integer without a cast
> /usr/src/linux-2.6.13-mm1/drivers/scsi/megaraid.c:1221: warning: passing
> arg 1 of `readl' makes pointer from integer without a cast
> /usr/src/linux-2.6.13-mm1/drivers/scsi/megaraid.c: In function
> `megaraid_isr_memmapped':
> /usr/src/linux-2.6.13-mm1/drivers/scsi/megaraid.c:1351: warning: passing
> arg 1 of `readl' makes pointer from integer without a cast
> /usr/src/linux-2.6.13-mm1/drivers/scsi/megaraid.c:1358: warning: passing
> arg 2 of `writel' makes pointer from integer without a cast
> /usr/src/linux-2.6.13-mm1/drivers/scsi/megaraid.c:1377: warning: passing
> arg 2 of `writel' makes pointer from integer without a cast
> /usr/src/linux-2.6.13-mm1/drivers/scsi/megaraid.c:1381: warning: passing
> arg 1 of `readl' makes pointer from integer without a cast
>
> Booting the kernel resulted in the same symptoms as before (can not
> mount root fs).
>
I have also tested the 2-6-14-rc1 and I have the same bug.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2005-09-14 18:14 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-07 9:52 Fw: legacy megaraid driver bug in mm-series Andrew Morton
2005-09-08 14:35 ` Christoph Hellwig
2005-09-09 23:58 ` Andrew Morton
2005-09-12 23:48 ` Jack Byer
2005-09-13 9:23 ` Christoph Hellwig
[not found] ` <4326A4A5.6090200@usa.net>
2005-09-14 18:14 ` Jack Byer
-- strict thread matches above, loose matches on Subject: below --
2005-09-13 10:17 Jack Byer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).