From 0f82cb9211f800f77636af11f0670e5fc6de6256 Mon Sep 17 00:00:00 2001 From: James Bottomley Date: Thu, 26 Jul 2007 17:13:10 -0400 Subject: [SCSI] aic79xx, aic7xxx: Fix incorrect width setting Wide transfers are required for every setting of PPR apart from QAS. It seems the DV code starts at the minimum, which turns on DT and Wide regardless of the setting of max_width. Redo the PPR and period setting routines to respect max_width (i.e. start at period = 10 if it is zero). This fixes bugzilla 8366 Acked-by: "Freels, James D." Signed-off-by: James Bottomley --- drivers/scsi/aic7xxx/aic7xxx_osm.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'drivers/scsi/aic7xxx/aic7xxx_osm.c') diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c index 1803ab6fc21..2e9c38f2e8a 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm.c +++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c @@ -2317,8 +2317,13 @@ static void ahc_linux_set_period(struct scsi_target *starget, int period) if (period < 9) period = 9; /* 12.5ns is our minimum */ - if (period == 9) - ppr_options |= MSG_EXT_PPR_DT_REQ; + if (period == 9) { + if (spi_max_width(starget)) + ppr_options |= MSG_EXT_PPR_DT_REQ; + else + /* need wide for DT and need DT for 12.5 ns */ + period = 10; + } ahc_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, starget->channel + 'A', ROLE_INITIATOR); @@ -2381,7 +2386,7 @@ static void ahc_linux_set_dt(struct scsi_target *starget, int dt) unsigned long flags; struct ahc_syncrate *syncrate; - if (dt) { + if (dt && spi_max_width(starget)) { ppr_options |= MSG_EXT_PPR_DT_REQ; if (!width) ahc_linux_set_width(starget, 1); -- cgit v1.2.3