Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 29480
b: refs/heads/master
c: 5a04bf4
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo committed May 31, 2006
1 parent 4f8302a commit 1379285
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 315343637b988ac32d730a6a9f7bf5866838bcb0
refs/heads/master: 5a04bf4befa8bffa012eedc3a0903c158b9131a9
21 changes: 12 additions & 9 deletions trunk/drivers/scsi/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2466,17 +2466,9 @@ static int sata_phy_resume(struct ata_port *ap)
*/
void ata_std_probeinit(struct ata_port *ap)
{
u32 scontrol;

/* resume link */
sata_phy_resume(ap);

/* init sata_spd_limit to the current value */
if (sata_scr_read(ap, SCR_CONTROL, &scontrol) == 0) {
int spd = (scontrol >> 4) & 0xf;
ap->sata_spd_limit &= (1 << spd) - 1;
}

/* wait for device */
if (ata_port_online(ap))
ata_busy_sleep(ap, ATA_TMOUT_BOOT_QUICK, ATA_TMOUT_BOOT);
Expand Down Expand Up @@ -5155,6 +5147,9 @@ void ata_dev_init(struct ata_device *dev)
struct ata_port *ap = dev->ap;
unsigned long flags;

/* SATA spd limit is bound to the first device */
ap->sata_spd_limit = ap->hw_sata_spd_limit;

/* High bits of dev->flags are used to record warm plug
* requests which occur asynchronously. Synchronize using
* host_set lock.
Expand Down Expand Up @@ -5210,7 +5205,7 @@ 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->sata_spd_limit = UINT_MAX;
ap->hw_sata_spd_limit = UINT_MAX;
ap->active_tag = ATA_TAG_POISON;
ap->last_ctl = 0xFF;
ap->msg_enable = ATA_MSG_DRV;
Expand Down Expand Up @@ -5375,10 +5370,18 @@ int ata_device_add(const struct ata_probe_ent *ent)
DPRINTK("probe begin\n");
for (i = 0; i < count; i++) {
struct ata_port *ap;
u32 scontrol;
int rc;

ap = host_set->ports[i];

/* init sata_spd_limit to the current value */
if (sata_scr_read(ap, SCR_CONTROL, &scontrol) == 0) {
int spd = (scontrol >> 4) & 0xf;
ap->hw_sata_spd_limit &= (1 << spd) - 1;
}
ap->sata_spd_limit = ap->hw_sata_spd_limit;

DPRINTK("ata%u: bus probe begin\n", ap->id);
rc = ata_bus_probe(ap);
DPRINTK("ata%u: bus probe end\n", ap->id);
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/libata.h
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,7 @@ struct ata_port {
unsigned int mwdma_mask;
unsigned int udma_mask;
unsigned int cbl; /* cable type; ATA_CBL_xxx */
unsigned int hw_sata_spd_limit;
unsigned int sata_spd_limit; /* SATA PHY speed limit */

/* record runtime error info, protected by host_set lock */
Expand Down

0 comments on commit 1379285

Please sign in to comment.