Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 96949
b: refs/heads/master
c: dc98c32
h: refs/heads/master
i:
  96947: cb4b6dc
v: v3
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed May 19, 2008
1 parent 3055902 commit 48559ab
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 33 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: 932648b007de76badc61c1b13d7282288dbe887e
refs/heads/master: dc98c32cbe80750ae2d9d9fbdae305d38f005de7
46 changes: 18 additions & 28 deletions trunk/drivers/ata/libata-eh.c
Original file line number Diff line number Diff line change
Expand Up @@ -2170,6 +2170,9 @@ int ata_eh_reset(struct ata_link *link, int classify,
/*
* Perform reset
*/
if (ata_is_host_link(link))
ata_eh_freeze_port(ap);

deadline = jiffies + ata_eh_reset_timeouts[try++];

if (reset) {
Expand Down Expand Up @@ -2238,6 +2241,10 @@ int ata_eh_reset(struct ata_link *link, int classify,
if (sata_scr_read(link, SCR_STATUS, &sstatus) == 0)
link->sata_spd = (sstatus >> 4) & 0xf;

/* thaw the port */
if (ata_is_host_link(link))
ata_eh_thaw_port(ap);

if (postreset)
postreset(link, classes);

Expand Down Expand Up @@ -2589,7 +2596,7 @@ int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset,
struct ata_link *link;
struct ata_device *dev;
int nr_failed_devs, nr_disabled_devs;
int reset, rc;
int rc;
unsigned long flags;

DPRINTK("ENTER\n");
Expand Down Expand Up @@ -2632,7 +2639,6 @@ int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset,
rc = 0;
nr_failed_devs = 0;
nr_disabled_devs = 0;
reset = 0;

/* if UNLOADING, finish immediately */
if (ap->pflags & ATA_PFLAG_UNLOADING)
Expand All @@ -2646,40 +2652,24 @@ int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset,
if (ata_eh_skip_recovery(link))
ehc->i.action = 0;

/* do we need to reset? */
if (ehc->i.action & ATA_EH_RESET)
reset = 1;

ata_link_for_each_dev(dev, link)
ehc->classes[dev->devno] = ATA_DEV_UNKNOWN;
}

/* reset */
if (reset) {
/* if PMP is attached, this function only deals with
* downstream links, port should stay thawed.
*/
if (!sata_pmp_attached(ap))
ata_eh_freeze_port(ap);

ata_port_for_each_link(link, ap) {
struct ata_eh_context *ehc = &link->eh_context;
ata_port_for_each_link(link, ap) {
struct ata_eh_context *ehc = &link->eh_context;

if (!(ehc->i.action & ATA_EH_RESET))
continue;
if (!(ehc->i.action & ATA_EH_RESET))
continue;

rc = ata_eh_reset(link, ata_link_nr_vacant(link),
prereset, softreset, hardreset,
postreset);
if (rc) {
ata_link_printk(link, KERN_ERR,
"reset failed, giving up\n");
goto out;
}
rc = ata_eh_reset(link, ata_link_nr_vacant(link),
prereset, softreset, hardreset, postreset);
if (rc) {
ata_link_printk(link, KERN_ERR,
"reset failed, giving up\n");
goto out;
}

if (!sata_pmp_attached(ap))
ata_eh_thaw_port(ap);
}

/* the rest */
Expand Down
4 changes: 0 additions & 4 deletions trunk/drivers/ata/libata-pmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -700,8 +700,6 @@ static int sata_pmp_eh_recover_pmp(struct ata_port *ap,
if (ehc->i.action & ATA_EH_RESET) {
struct ata_link *tlink;

ata_eh_freeze_port(ap);

/* reset */
rc = ata_eh_reset(link, 0, prereset, softreset, hardreset,
postreset);
Expand All @@ -711,8 +709,6 @@ static int sata_pmp_eh_recover_pmp(struct ata_port *ap,
goto fail;
}

ata_eh_thaw_port(ap);

/* PMP is reset, SErrors cannot be trusted, scan all */
ata_port_for_each_link(tlink, ap) {
struct ata_eh_context *ehc = &tlink->eh_context;
Expand Down

0 comments on commit 48559ab

Please sign in to comment.