From: Al Viro <viro@ftp.linux.org.uk>
To: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: linux-scsi@vger.kernel.org, linux1394-devel@lists.sourceforge.net
Subject: Re: TYPE_RBC cache fixes (sbp2.c affected)
Date: Tue, 21 Feb 2006 21:51:44 +0000 [thread overview]
Message-ID: <20060221215144.GW27946@ftp.linux.org.uk> (raw)
In-Reply-To: <43FB7058.4040008@s5r6.in-berlin.de>
On Tue, Feb 21, 2006 at 08:56:08PM +0100, Stefan Richter wrote:
> 2.6.16-rc4-mm1's sbp2 already detects most of the Initio bridges and
> flags them with skip_ms_page_8. It does so based on the
> firmware_revision config ROM entry. This seems to catch most Initio
> bridges but there was at least one report of a different
> firmware_revision key value. However all of them feature "Initio" as
> vendor string. I suppose I should let sbp2_slave_configure check for
> this string in sdev->vendor and for sdev->type == TYPE_DISK, then bend
> sdev->type to TYPE_RBC. (Or set skip_ms_page_8; I will check how my disk
> behaves when forced to TYPE_RBC...)
Same - it still forgets to generate proper header.
See if that helps (might allow killing that skip_ms_page_8 in those, BTW):
--- a/drivers/scsi/scsi_lib.c 2006-02-20 10:02:58.000000000 -0600
+++ b/drivers/scsi/scsi_lib.c 2006-02-21 01:47:18.000000000 -0600
@@ -1892,8 +1892,16 @@
}
if(scsi_status_is_good(result)) {
- data->header_length = header_length;
- if(use_10_for_ms) {
+ if (unlikely(buffer[0] == 0x86 && buffer[1] == 0x0b &&
+ (modepage == 6 || modepage == 8))) {
+ /* Initio breakage? */
+ header_length = 0;
+ data->length = 13;
+ data->medium_type = 0;
+ data->device_specific = 0;
+ data->longlba = 0;
+ data->block_descriptor_length = 0;
+ } else if(use_10_for_ms) {
data->length = buffer[0]*256 + buffer[1] + 2;
data->medium_type = buffer[2];
data->device_specific = buffer[3];
@@ -1906,6 +1914,7 @@
data->device_specific = buffer[2];
data->block_descriptor_length = buffer[3];
}
+ data->header_length = header_length;
}
return result;
--- a/drivers/scsi/sd.c 2006-02-17 16:26:52.000000000 -0600
+++ b/drivers/scsi/sd.c 2006-02-20 18:15:44.000000000 -0600
@@ -1328,6 +1328,12 @@
if (!scsi_status_is_good(res))
goto bad_sense;
+ if (!data.header_length) {
+ modepage = 6;
+ printk(KERN_ERR "%s: missing header in MODE_SENSE response\n",
+ diskname);
+ }
+
/* that went OK, now ask for the proper length */
len = data.length;
@@ -1342,6 +1348,8 @@
/* Take headers and block descriptors into account */
len += data.header_length + data.block_descriptor_length;
+ if (len > 512)
+ goto bad_sense;
/* Get the data */
res = sd_do_mode_sense(sdp, dbd, modepage, buffer, len, &data, &sshdr);
@@ -1354,8 +1362,15 @@
int ct = 0;
int offset = data.header_length + data.block_descriptor_length;
+ if (offset >= 512 - 2) {
+ printk(KERN_ERR "%s: malformed MODE SENSE response",
+ diskname);
+ goto defaults;
+ }
+
if ((buffer[offset] & 0x3f) != modepage) {
- printk(KERN_ERR "%s: got wrong page\n", diskname);
+ printk(KERN_ERR "%s: got wrong page (%d -> %d)\n",
+ diskname, modepage, buffer[offset] & 0x3f);
goto defaults;
}
next prev parent reply other threads:[~2006-02-21 21:51 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-16 1:59 TYPE_RBC cache fixes (sbp2.c affected) Al Viro
2005-05-16 3:26 ` Douglas Gilbert
2005-05-16 4:18 ` Al Viro
2005-05-21 5:03 ` Douglas Gilbert
2005-05-21 15:01 ` James Bottomley
2005-05-21 15:38 ` Jeff Garzik
2005-05-21 16:00 ` James Bottomley
2005-05-21 16:22 ` Al Viro
2005-05-21 18:12 ` James Bottomley
2005-05-21 22:06 ` Douglas Gilbert
2005-05-22 5:08 ` Douglas Gilbert
2005-05-21 15:24 ` James Bottomley
2005-05-22 10:15 ` Douglas Gilbert
2005-05-22 6:31 ` Douglas Gilbert
2005-05-22 14:06 ` James Bottomley
2005-05-23 15:14 ` Douglas Gilbert
2006-02-08 23:39 ` Stefan Richter
2006-02-08 23:54 ` Al Viro
2006-02-11 9:50 ` Stefan Richter
2006-02-11 13:05 ` Al Viro
2006-02-13 20:40 ` Stefan Richter
2006-02-20 6:08 ` Al Viro
2006-02-21 19:56 ` Stefan Richter
2006-02-21 21:51 ` Al Viro [this message]
2006-02-21 22:41 ` Stefan Richter
2006-02-22 7:08 ` Stefan Richter
2006-02-22 7:16 ` Al Viro
2006-02-22 7:35 ` Stefan Richter
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=20060221215144.GW27946@ftp.linux.org.uk \
--to=viro@ftp.linux.org.uk \
--cc=linux-scsi@vger.kernel.org \
--cc=linux1394-devel@lists.sourceforge.net \
--cc=stefanr@s5r6.in-berlin.de \
/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.