diff options
author | Tejun Heo <htejun@gmail.com> | 2008-04-07 09:47:19 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-04-17 15:44:22 -0400 |
commit | 9dadd45b24145d6aee2fabb28d7aef972301892b (patch) | |
tree | c97c323e2edd400bc94eaceddf20f84e9a6da005 /drivers/ata/libata-pmp.c | |
parent | a89611e8489ac24f371c9fd6fef6605b170b16ba (diff) |
libata: move generic hardreset code from sata_sff_hardreset() to sata_link_hardreset()
sata_sff_hardreset() contains link readiness wait logic which isn't
SFF specific. Move that part into sata_link_hardreset(), which now
takes two more parameters - @online and @check_ready. Both are
optional. The former is out parameter for link onlineness after
reset. The latter is used to wait for link readiness after hardreset.
Users of sata_link_hardreset() is updated to use new funtionality and
ahci_hardreset() is updated to use sata_link_hardreset() instead of
sata_sff_hardreset(). This doesn't really cause any behavior change.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Diffstat (limited to 'drivers/ata/libata-pmp.c')
-rw-r--r-- | drivers/ata/libata-pmp.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/ata/libata-pmp.c b/drivers/ata/libata-pmp.c index a7cb1498c9b2..7f1a87f01ab2 100644 --- a/drivers/ata/libata-pmp.c +++ b/drivers/ata/libata-pmp.c | |||
@@ -239,13 +239,14 @@ int sata_pmp_std_hardreset(struct ata_link *link, unsigned int *class, | |||
239 | unsigned long deadline) | 239 | unsigned long deadline) |
240 | { | 240 | { |
241 | const unsigned long *timing = sata_ehc_deb_timing(&link->eh_context); | 241 | const unsigned long *timing = sata_ehc_deb_timing(&link->eh_context); |
242 | bool online; | ||
242 | u32 tmp; | 243 | u32 tmp; |
243 | int rc; | 244 | int rc; |
244 | 245 | ||
245 | DPRINTK("ENTER\n"); | 246 | DPRINTK("ENTER\n"); |
246 | 247 | ||
247 | /* do hardreset */ | 248 | /* do hardreset */ |
248 | rc = sata_link_hardreset(link, timing, deadline); | 249 | rc = sata_link_hardreset(link, timing, deadline, &online, NULL); |
249 | if (rc) { | 250 | if (rc) { |
250 | ata_link_printk(link, KERN_ERR, | 251 | ata_link_printk(link, KERN_ERR, |
251 | "COMRESET failed (errno=%d)\n", rc); | 252 | "COMRESET failed (errno=%d)\n", rc); |
@@ -261,7 +262,7 @@ int sata_pmp_std_hardreset(struct ata_link *link, unsigned int *class, | |||
261 | } | 262 | } |
262 | 263 | ||
263 | /* if device is present, follow up with srst to wait for !BSY */ | 264 | /* if device is present, follow up with srst to wait for !BSY */ |
264 | if (ata_link_online(link)) | 265 | if (online) |
265 | rc = -EAGAIN; | 266 | rc = -EAGAIN; |
266 | out: | 267 | out: |
267 | /* if SCR isn't accessible, we need to reset the PMP */ | 268 | /* if SCR isn't accessible, we need to reset the PMP */ |
@@ -916,7 +917,7 @@ static int sata_pmp_eh_handle_disabled_links(struct ata_port *ap) | |||
916 | * SError.N working. | 917 | * SError.N working. |
917 | */ | 918 | */ |
918 | sata_link_hardreset(link, sata_deb_timing_normal, | 919 | sata_link_hardreset(link, sata_deb_timing_normal, |
919 | jiffies + ATA_TMOUT_INTERNAL_QUICK); | 920 | jiffies + ATA_TMOUT_INTERNAL_QUICK, NULL, NULL); |
920 | 921 | ||
921 | /* unconditionally clear SError.N */ | 922 | /* unconditionally clear SError.N */ |
922 | rc = sata_scr_write(link, SCR_ERROR, SERR_PHYRDY_CHG); | 923 | rc = sata_scr_write(link, SCR_ERROR, SERR_PHYRDY_CHG); |