Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 42095
b: refs/heads/master
c: baa1e78
h: refs/heads/master
i:
  42093: 1d48912
  42091: 1f97354
  42087: 638af79
  42079: 23c15fb
v: v3
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Dec 2, 2006
1 parent fd1ace5 commit 896420a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 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: efdaedc443e935eda82e9e78a6e65d1f993d242f
refs/heads/master: baa1e78a834c917984a4659fd282f712c17ee3bf
3 changes: 3 additions & 0 deletions trunk/drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2158,6 +2158,7 @@ int ata_down_xfermask_limit(struct ata_device *dev, int force_pio0)

static int ata_dev_set_mode(struct ata_device *dev)
{
struct ata_eh_context *ehc = &dev->ap->eh_context;
unsigned int err_mask;
int rc;

Expand All @@ -2172,7 +2173,9 @@ static int ata_dev_set_mode(struct ata_device *dev)
return -EIO;
}

ehc->i.flags |= ATA_EHI_POST_SETMODE;
rc = ata_dev_revalidate(dev, 0);
ehc->i.flags &= ~ATA_EHI_POST_SETMODE;
if (rc)
return rc;

Expand Down
13 changes: 11 additions & 2 deletions trunk/drivers/ata/libata-eh.c
Original file line number Diff line number Diff line change
Expand Up @@ -1653,6 +1653,11 @@ static int ata_eh_revalidate_and_attach(struct ata_port *ap,

ata_eh_done(ap, dev, ATA_EH_REVALIDATE);

/* Configuration may have changed, reconfigure
* transfer mode.
*/
ehc->i.flags |= ATA_EHI_SETMODE;

/* schedule the scsi_rescan_device() here */
queue_work(ata_aux_wq, &(ap->scsi_rescan_task));
} else if (dev->class == ATA_DEV_UNKNOWN &&
Expand All @@ -1675,6 +1680,9 @@ static int ata_eh_revalidate_and_attach(struct ata_port *ap,
spin_lock_irqsave(ap->lock, flags);
ap->pflags |= ATA_PFLAG_SCSI_HOTPLUG;
spin_unlock_irqrestore(ap->lock, flags);

/* new device discovered, configure transfer mode */
ehc->i.flags |= ATA_EHI_SETMODE;
}
}

Expand Down Expand Up @@ -1990,13 +1998,14 @@ static int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset,
if (rc)
goto dev_fail;

/* configure transfer mode if the port has been reset */
if (ehc->i.flags & ATA_EHI_DID_RESET) {
/* configure transfer mode if necessary */
if (ehc->i.flags & ATA_EHI_SETMODE) {
rc = ata_set_mode(ap, &dev);
if (rc) {
down_xfermask = 1;
goto dev_fail;
}
ehc->i.flags &= ~ATA_EHI_SETMODE;
}

/* suspend devices */
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/libata.h
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,8 @@ enum {

ATA_EHI_DID_RESET = (1 << 16), /* already reset this port */
ATA_EHI_PRINTINFO = (1 << 17), /* print configuration info */
ATA_EHI_SETMODE = (1 << 18), /* configure transfer mode */
ATA_EHI_POST_SETMODE = (1 << 19), /* revaildating after setmode */

ATA_EHI_RESET_MODIFIER_MASK = ATA_EHI_RESUME_LINK,

Expand Down

0 comments on commit 896420a

Please sign in to comment.