mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 22:02:02 +00:00
[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>
This commit is contained in:
parent
35bb94b116
commit
db70fef075
1 changed files with 5 additions and 5 deletions
|
@ -2369,12 +2369,16 @@ void ata_std_probeinit(struct ata_port *ap)
|
||||||
if ((ap->flags & ATA_FLAG_SATA) && ap->ops->scr_read) {
|
if ((ap->flags & ATA_FLAG_SATA) && ap->ops->scr_read) {
|
||||||
u32 spd;
|
u32 spd;
|
||||||
|
|
||||||
|
/* set cable type and resume link */
|
||||||
|
ap->cbl = ATA_CBL_SATA;
|
||||||
sata_phy_resume(ap);
|
sata_phy_resume(ap);
|
||||||
|
|
||||||
|
/* init sata_spd_limit to the current value */
|
||||||
spd = (scr_read(ap, SCR_CONTROL) & 0xf0) >> 4;
|
spd = (scr_read(ap, SCR_CONTROL) & 0xf0) >> 4;
|
||||||
if (spd)
|
if (spd)
|
||||||
ap->sata_spd_limit &= (1 << spd) - 1;
|
ap->sata_spd_limit &= (1 << spd) - 1;
|
||||||
|
|
||||||
|
/* wait for device */
|
||||||
if (sata_dev_present(ap))
|
if (sata_dev_present(ap))
|
||||||
ata_busy_sleep(ap, ATA_TMOUT_BOOT_QUICK, ATA_TMOUT_BOOT);
|
ata_busy_sleep(ap, ATA_TMOUT_BOOT_QUICK, ATA_TMOUT_BOOT);
|
||||||
}
|
}
|
||||||
|
@ -2531,10 +2535,6 @@ void ata_std_postreset(struct ata_port *ap, unsigned int *classes)
|
||||||
{
|
{
|
||||||
DPRINTK("ENTER\n");
|
DPRINTK("ENTER\n");
|
||||||
|
|
||||||
/* set cable type if it isn't already set */
|
|
||||||
if (ap->cbl == ATA_CBL_NONE && ap->flags & ATA_FLAG_SATA)
|
|
||||||
ap->cbl = ATA_CBL_SATA;
|
|
||||||
|
|
||||||
/* print link status */
|
/* print link status */
|
||||||
if (ap->cbl == ATA_CBL_SATA)
|
if (ap->cbl == ATA_CBL_SATA)
|
||||||
sata_print_link_status(ap);
|
sata_print_link_status(ap);
|
||||||
|
@ -2584,7 +2584,7 @@ int ata_std_probe_reset(struct ata_port *ap, unsigned int *classes)
|
||||||
ata_reset_fn_t hardreset;
|
ata_reset_fn_t hardreset;
|
||||||
|
|
||||||
hardreset = NULL;
|
hardreset = NULL;
|
||||||
if (ap->flags & ATA_FLAG_SATA && ap->ops->scr_read)
|
if (ap->cbl == ATA_CBL_SATA && ap->ops->scr_read)
|
||||||
hardreset = sata_std_hardreset;
|
hardreset = sata_std_hardreset;
|
||||||
|
|
||||||
return ata_drive_probe_reset(ap, ata_std_probeinit,
|
return ata_drive_probe_reset(ap, ata_std_probeinit,
|
||||||
|
|
Loading…
Reference in a new issue