Skip to content

Commit

Permalink
[PATCH] libata: init ap->cbl to ATA_CBL_SATA early
Browse files Browse the repository at this point in the history
Init ap->cbl to ATA_CBL_SATA in ata_host_init().  This is necessary
for soon-to-follow SCR handling function changes.  LLDDs are free to
change ap->cbl during probing.

Signed-off-by: Tejun Heo <htejun@gmail.com>
  • Loading branch information
Tejun Heo committed May 15, 2006
1 parent ce5f7f3 commit 838df62
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/scsi/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2370,8 +2370,7 @@ void ata_std_probeinit(struct ata_port *ap)
if ((ap->flags & ATA_FLAG_SATA) && ap->ops->scr_read) {
u32 spd;

/* set cable type and resume link */
ap->cbl = ATA_CBL_SATA;
/* resume link */
sata_phy_resume(ap);

/* init sata_spd_limit to the current value */
Expand Down Expand Up @@ -4586,14 +4585,18 @@ static void ata_host_init(struct ata_port *ap, struct Scsi_Host *host,
ap->udma_mask = ent->udma_mask;
ap->flags |= ent->host_flags;
ap->ops = ent->port_ops;
ap->cbl = ATA_CBL_NONE;
ap->sata_spd_limit = UINT_MAX;
ap->active_tag = ATA_TAG_POISON;
ap->last_ctl = 0xFF;

INIT_WORK(&ap->port_task, NULL, NULL);
INIT_LIST_HEAD(&ap->eh_done_q);

/* set cable type */
ap->cbl = ATA_CBL_NONE;
if (ap->flags & ATA_FLAG_SATA)
ap->cbl = ATA_CBL_SATA;

for (i = 0; i < ATA_MAX_DEVICES; i++) {
struct ata_device *dev = &ap->device[i];
dev->devno = i;
Expand Down

0 comments on commit 838df62

Please sign in to comment.