[SCSI] Negotiate correctly with async-only devices
authorMatthew Wilcox <matthew@wil.cx>
Wed, 30 Nov 2005 04:08:40 +0000 (23:08 -0500)
committerJames Bottomley <jejb@mulgrave.(none)>
Wed, 14 Dec 2005 00:27:10 +0000 (17:27 -0700)
When we got a device only capable of async, we would zero out goal->period
which would cause us to try PPR negotiations.  Leave goal->period alone,
and check goal->offset before doing PPR.  Kudos to Daniel Forsgren for
figuring this out.

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/scsi/sym53c8xx_2/sym_hipd.c

index a7420cad4547d068951fe768408f6f6a150db102..1564ca203a3e6b0d62217fd4a8c2529689215eeb 100644 (file)
@@ -1405,7 +1405,6 @@ static void sym_check_goals(struct sym_hcb *np, struct scsi_target *starget,
                goal->iu = 0;
                goal->dt = 0;
                goal->qas = 0;
-               goal->period = 0;
                goal->offset = 0;
                return;
        }
@@ -1465,7 +1464,8 @@ static int sym_prepare_nego(struct sym_hcb *np, struct sym_ccb *cp, u_char *msgp
         * Many devices implement PPR in a buggy way, so only use it if we
         * really want to.
         */
-       if (goal->iu || goal->dt || goal->qas || (goal->period < 0xa)) {
+       if (goal->offset &&
+           (goal->iu || goal->dt || goal->qas || (goal->period < 0xa))) {
                nego = NS_PPR;
        } else if (spi_width(starget) != goal->width) {
                nego = NS_WIDE;