aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aic7xxx
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@steeleye.com>2007-07-26 17:13:10 -0400
committerJames Bottomley <jejb@mulgrave.localdomain>2007-07-27 09:20:20 -0400
commit0f82cb9211f800f77636af11f0670e5fc6de6256 (patch)
treeabda8332877503a5a16f5138ab4298c6072a574b /drivers/scsi/aic7xxx
parent281afe1947d855661754850de29d7530b2ff18dc (diff)
[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." <freelsjd@ornl.gov> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/aic7xxx')
-rw-r--r--drivers/scsi/aic7xxx/aic79xx_osm.c23
-rw-r--r--drivers/scsi/aic7xxx/aic7xxx_osm.c11
2 files changed, 21 insertions, 13 deletions
diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c
index 286ab83116f9..a055a96e3ad3 100644
--- a/drivers/scsi/aic7xxx/aic79xx_osm.c
+++ b/drivers/scsi/aic7xxx/aic79xx_osm.c
@@ -2284,9 +2284,12 @@ static void ahd_linux_set_period(struct scsi_target *starget, int period)
2284 if (period < 8) 2284 if (period < 8)
2285 period = 8; 2285 period = 8;
2286 if (period < 10) { 2286 if (period < 10) {
2287 ppr_options |= MSG_EXT_PPR_DT_REQ; 2287 if (spi_max_width(starget)) {
2288 if (period == 8) 2288 ppr_options |= MSG_EXT_PPR_DT_REQ;
2289 ppr_options |= MSG_EXT_PPR_IU_REQ; 2289 if (period == 8)
2290 ppr_options |= MSG_EXT_PPR_IU_REQ;
2291 } else
2292 period = 10;
2290 } 2293 }
2291 2294
2292 dt = ppr_options & MSG_EXT_PPR_DT_REQ; 2295 dt = ppr_options & MSG_EXT_PPR_DT_REQ;
@@ -2365,7 +2368,7 @@ static void ahd_linux_set_dt(struct scsi_target *starget, int dt)
2365 printf("%s: %s DT\n", ahd_name(ahd), 2368 printf("%s: %s DT\n", ahd_name(ahd),
2366 dt ? "enabling" : "disabling"); 2369 dt ? "enabling" : "disabling");
2367#endif 2370#endif
2368 if (dt) { 2371 if (dt && spi_max_width(starget)) {
2369 ppr_options |= MSG_EXT_PPR_DT_REQ; 2372 ppr_options |= MSG_EXT_PPR_DT_REQ;
2370 if (!width) 2373 if (!width)
2371 ahd_linux_set_width(starget, 1); 2374 ahd_linux_set_width(starget, 1);
@@ -2447,7 +2450,7 @@ static void ahd_linux_set_iu(struct scsi_target *starget, int iu)
2447 iu ? "enabling" : "disabling"); 2450 iu ? "enabling" : "disabling");
2448#endif 2451#endif
2449 2452
2450 if (iu) { 2453 if (iu && spi_max_width(starget)) {
2451 ppr_options |= MSG_EXT_PPR_IU_REQ; 2454 ppr_options |= MSG_EXT_PPR_IU_REQ;
2452 ppr_options |= MSG_EXT_PPR_DT_REQ; /* IU requires DT */ 2455 ppr_options |= MSG_EXT_PPR_DT_REQ; /* IU requires DT */
2453 } 2456 }
@@ -2487,7 +2490,7 @@ static void ahd_linux_set_rd_strm(struct scsi_target *starget, int rdstrm)
2487 rdstrm ? "enabling" : "disabling"); 2490 rdstrm ? "enabling" : "disabling");
2488#endif 2491#endif
2489 2492
2490 if (rdstrm) 2493 if (rdstrm && spi_max_width(starget))
2491 ppr_options |= MSG_EXT_PPR_RD_STRM; 2494 ppr_options |= MSG_EXT_PPR_RD_STRM;
2492 2495
2493 ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, 2496 ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0,
@@ -2523,7 +2526,7 @@ static void ahd_linux_set_wr_flow(struct scsi_target *starget, int wrflow)
2523 wrflow ? "enabling" : "disabling"); 2526 wrflow ? "enabling" : "disabling");
2524#endif 2527#endif
2525 2528
2526 if (wrflow) 2529 if (wrflow && spi_max_width(starget))
2527 ppr_options |= MSG_EXT_PPR_WR_FLOW; 2530 ppr_options |= MSG_EXT_PPR_WR_FLOW;
2528 2531
2529 ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, 2532 ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0,
@@ -2567,7 +2570,7 @@ static void ahd_linux_set_rti(struct scsi_target *starget, int rti)
2567 rti ? "enabling" : "disabling"); 2570 rti ? "enabling" : "disabling");
2568#endif 2571#endif
2569 2572
2570 if (rti) 2573 if (rti && spi_max_width(starget))
2571 ppr_options |= MSG_EXT_PPR_RTI; 2574 ppr_options |= MSG_EXT_PPR_RTI;
2572 2575
2573 ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, 2576 ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0,
@@ -2603,7 +2606,7 @@ static void ahd_linux_set_pcomp_en(struct scsi_target *starget, int pcomp)
2603 pcomp ? "Enable" : "Disable"); 2606 pcomp ? "Enable" : "Disable");
2604#endif 2607#endif
2605 2608
2606 if (pcomp) { 2609 if (pcomp && spi_max_width(starget)) {
2607 uint8_t precomp; 2610 uint8_t precomp;
2608 2611
2609 if (ahd->unit < ARRAY_SIZE(aic79xx_iocell_info)) { 2612 if (ahd->unit < ARRAY_SIZE(aic79xx_iocell_info)) {
@@ -2647,7 +2650,7 @@ static void ahd_linux_set_hold_mcs(struct scsi_target *starget, int hold)
2647 unsigned int dt = ppr_options & MSG_EXT_PPR_DT_REQ; 2650 unsigned int dt = ppr_options & MSG_EXT_PPR_DT_REQ;
2648 unsigned long flags; 2651 unsigned long flags;
2649 2652
2650 if (hold) 2653 if (hold && spi_max_width(starget))
2651 ppr_options |= MSG_EXT_PPR_HOLD_MCS; 2654 ppr_options |= MSG_EXT_PPR_HOLD_MCS;
2652 2655
2653 ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, 2656 ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0,
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c
index 1803ab6fc21c..2e9c38f2e8a6 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)
2317 2317
2318 if (period < 9) 2318 if (period < 9)
2319 period = 9; /* 12.5ns is our minimum */ 2319 period = 9; /* 12.5ns is our minimum */
2320 if (period == 9) 2320 if (period == 9) {
2321 ppr_options |= MSG_EXT_PPR_DT_REQ; 2321 if (spi_max_width(starget))
2322 ppr_options |= MSG_EXT_PPR_DT_REQ;
2323 else
2324 /* need wide for DT and need DT for 12.5 ns */
2325 period = 10;
2326 }
2322 2327
2323 ahc_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, 2328 ahc_compile_devinfo(&devinfo, shost->this_id, starget->id, 0,
2324 starget->channel + 'A', ROLE_INITIATOR); 2329 starget->channel + 'A', ROLE_INITIATOR);
@@ -2381,7 +2386,7 @@ static void ahc_linux_set_dt(struct scsi_target *starget, int dt)
2381 unsigned long flags; 2386 unsigned long flags;
2382 struct ahc_syncrate *syncrate; 2387 struct ahc_syncrate *syncrate;
2383 2388
2384 if (dt) { 2389 if (dt && spi_max_width(starget)) {
2385 ppr_options |= MSG_EXT_PPR_DT_REQ; 2390 ppr_options |= MSG_EXT_PPR_DT_REQ;
2386 if (!width) 2391 if (!width)
2387 ahc_linux_set_width(starget, 1); 2392 ahc_linux_set_width(starget, 1);