aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2006-04-11 09:16:44 -0400
committerJeff Garzik <jeff@garzik.org>2006-04-11 13:12:46 -0400
commitdb70fef0750e5f8dbb64f9fadb333d2c7caf26a1 (patch)
tree3ae791d9a7034701ee9cdd22ac79355f675105b8 /drivers
parent35bb94b116e1fd4959ef0d3187458b5820eac8c4 (diff)
[PATCH] libata: set default cbl in probeinit
Make setting CBL type responsibility of probeinit. This allows using only ap->cbl == ATA_CBL_SATA test in all other parts. Without this, ata_down_sata_spd_limit() doesn't work during probe reset. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/libata-core.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index 6420062f2c1e..f37179623efa 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -2369,12 +2369,16 @@ void ata_std_probeinit(struct ata_port *ap)
2369 if ((ap->flags & ATA_FLAG_SATA) && ap->ops->scr_read) { 2369 if ((ap->flags & ATA_FLAG_SATA) && ap->ops->scr_read) {
2370 u32 spd; 2370 u32 spd;
2371 2371
2372 /* set cable type and resume link */
2373 ap->cbl = ATA_CBL_SATA;
2372 sata_phy_resume(ap); 2374 sata_phy_resume(ap);
2373 2375
2376 /* init sata_spd_limit to the current value */
2374 spd = (scr_read(ap, SCR_CONTROL) & 0xf0) >> 4; 2377 spd = (scr_read(ap, SCR_CONTROL) & 0xf0) >> 4;
2375 if (spd) 2378 if (spd)
2376 ap->sata_spd_limit &= (1 << spd) - 1; 2379 ap->sata_spd_limit &= (1 << spd) - 1;
2377 2380
2381 /* wait for device */
2378 if (sata_dev_present(ap)) 2382 if (sata_dev_present(ap))
2379 ata_busy_sleep(ap, ATA_TMOUT_BOOT_QUICK, ATA_TMOUT_BOOT); 2383 ata_busy_sleep(ap, ATA_TMOUT_BOOT_QUICK, ATA_TMOUT_BOOT);
2380 } 2384 }
@@ -2531,10 +2535,6 @@ void ata_std_postreset(struct ata_port *ap, unsigned int *classes)
2531{ 2535{
2532 DPRINTK("ENTER\n"); 2536 DPRINTK("ENTER\n");
2533 2537
2534 /* set cable type if it isn't already set */
2535 if (ap->cbl == ATA_CBL_NONE && ap->flags & ATA_FLAG_SATA)
2536 ap->cbl = ATA_CBL_SATA;
2537
2538 /* print link status */ 2538 /* print link status */
2539 if (ap->cbl == ATA_CBL_SATA) 2539 if (ap->cbl == ATA_CBL_SATA)
2540 sata_print_link_status(ap); 2540 sata_print_link_status(ap);
@@ -2584,7 +2584,7 @@ int ata_std_probe_reset(struct ata_port *ap, unsigned int *classes)
2584 ata_reset_fn_t hardreset; 2584 ata_reset_fn_t hardreset;
2585 2585
2586 hardreset = NULL; 2586 hardreset = NULL;
2587 if (ap->flags & ATA_FLAG_SATA && ap->ops->scr_read) 2587 if (ap->cbl == ATA_CBL_SATA && ap->ops->scr_read)
2588 hardreset = sata_std_hardreset; 2588 hardreset = sata_std_hardreset;
2589 2589
2590 return ata_drive_probe_reset(ap, ata_std_probeinit, 2590 return ata_drive_probe_reset(ap, ata_std_probeinit,