public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sym53c8xx PPR negotiation fix
@ 2003-10-29 17:07 Doug Ledford
  2003-10-29 17:11 ` James Bottomley
  0 siblings, 1 reply; 19+ messages in thread
From: Doug Ledford @ 2003-10-29 17:07 UTC (permalink / raw)
  To: Marcelo Tosatti, James Bottomley; +Cc: linux-scsi mailing list

[-- Attachment #1: Type: text/plain, Size: 1267 bytes --]

Marcelo,

I've verified that this problem still exists as of 2.4.23-pre8.  The
sym53c8xx driver doesn't bother to check that a device should support
PPR negotiation messages before attempting to use them on Ultra160
controllers.  PPR negotiations were added to the SCSI-3 standard (they
are required to negotiate Ultra160 or higher speeds) and should be
limited to SCSI-3 devices.  For back compatibility some modern devices
that support Ultra160 or above speeds still need to report themselves as
SCSI-2 devices.  Those devices are required to signal that they know
about PPR messages by setting the DT bit in the device's INQUIRY data. 
This patch adds that check.

Why add this check?  Two reasons.  One, correctness.  It's the right
thing to do.  Two, it fixes a bug with some DVD drives (the drives don't
report that they support PPR, but if the driver tries to use PPR then
the drive will accept it and respond in kind, but the drive fails to
actually properly set the sync speed after the PPR negotiation is
complete and the bus locks up as a result).

I haven't checked if this is applicable to 2.6 as well.  James?

-- 
  Doug Ledford <dledford@redhat.com>     919-754-3700 x44233
         Red Hat, Inc.
         1801 Varsity Dr.
         Raleigh, NC 27606


[-- Attachment #2: sym.patch --]
[-- Type: text/x-patch, Size: 682 bytes --]

diff -urNp linux-5420/drivers/scsi/sym53c8xx.c linux-5430/drivers/scsi/sym53c8xx.c
--- linux-5420/drivers/scsi/sym53c8xx.c
+++ linux-5430/drivers/scsi/sym53c8xx.c
@@ -11981,6 +11981,19 @@ static lcb_p ncr_setup_lcb (ncb_p np, u_
 		inq_byte7 |= INQ7_SYNC;
 
 	/*
+	**	Don't do PPR negotiations on SCSI-2 devices unless
+	**	they set the DT bit (0x04) in byte 57 of the INQUIRY
+	**	return data.
+	*/
+	if (((inq_data[2] & 0x07) < 3) && (inq_data[4] < 53 ||
+					   !(inq_data[56] & 0x04))) {
+		if (tp->minsync < 10)
+			tp->minsync = 10;
+		if (tp->usrsync < 10)
+			tp->usrsync = 10;
+	}
+
+	/*
 	**	Prepare negotiation if SIP capabilities have changed.
 	*/
 	tp->inq_done = 1;

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2003-11-06  9:30 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-29 17:07 [PATCH] sym53c8xx PPR negotiation fix Doug Ledford
2003-10-29 17:11 ` James Bottomley
2003-10-29 17:50   ` Matthew Wilcox
2003-10-29 18:02     ` Doug Ledford
     [not found]       ` <20031029183159.GE25237@parcelfarce.linux.theplanet.co.uk>
2003-10-29 18:45         ` Doug Ledford
2003-10-31 23:55           ` Justin T. Gibbs
2003-10-31 23:55             ` James Bottomley
2003-11-01  0:08               ` Doug Ledford
2003-11-01  0:16                 ` Justin T. Gibbs
2003-11-01  1:22                   ` Mike Anderson
2003-11-01  2:34                     ` James Bottomley
2003-11-01  3:09                       ` Doug Ledford
2003-11-03 18:10                       ` Mike Anderson
2003-11-04  7:10                         ` Christoph Hellwig
2003-11-05  9:26                           ` Mike Anderson
2003-11-06  9:04                           ` Mike Anderson
2003-11-06  9:07                             ` Christoph Hellwig
2003-11-06  9:21                               ` Mike Anderson
2003-11-01  0:02             ` Doug Ledford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox