aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-eh.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-09-23 00:19:54 -0400
committerJeff Garzik <jeff@garzik.org>2007-10-12 14:55:44 -0400
commit633273a3ed1cf37ced90475b0f95cf81deab04f1 (patch)
tree5cd42191d1ea8d5ee84fb2f7c7660f124787d9e8 /drivers/ata/libata-eh.c
parent3af9a77af9e2b72366363864bfcd3d51465ff98a (diff)
libata-pmp: hook PMP support and enable it
Hook PMP support into libata and enable it. Connect SCR and probing functions, and update ata_dev_classify() to detect PMP. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/libata-eh.c')
-rw-r--r--drivers/ata/libata-eh.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 687419b66708..5f2c0f376f74 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -2209,6 +2209,8 @@ static int ata_eh_revalidate_and_attach(struct ata_link *link,
2209 readid_flags |= ATA_READID_POSTRESET; 2209 readid_flags |= ATA_READID_POSTRESET;
2210 2210
2211 if ((action & ATA_EH_REVALIDATE) && ata_dev_enabled(dev)) { 2211 if ((action & ATA_EH_REVALIDATE) && ata_dev_enabled(dev)) {
2212 WARN_ON(dev->class == ATA_DEV_PMP);
2213
2212 if (ata_link_offline(link)) { 2214 if (ata_link_offline(link)) {
2213 rc = -EIO; 2215 rc = -EIO;
2214 goto err; 2216 goto err;
@@ -2234,8 +2236,11 @@ static int ata_eh_revalidate_and_attach(struct ata_link *link,
2234 ata_class_enabled(ehc->classes[dev->devno])) { 2236 ata_class_enabled(ehc->classes[dev->devno])) {
2235 dev->class = ehc->classes[dev->devno]; 2237 dev->class = ehc->classes[dev->devno];
2236 2238
2237 rc = ata_dev_read_id(dev, &dev->class, readid_flags, 2239 if (dev->class == ATA_DEV_PMP)
2238 dev->id); 2240 rc = sata_pmp_attach(dev);
2241 else
2242 rc = ata_dev_read_id(dev, &dev->class,
2243 readid_flags, dev->id);
2239 switch (rc) { 2244 switch (rc) {
2240 case 0: 2245 case 0:
2241 new_mask |= 1 << dev->devno; 2246 new_mask |= 1 << dev->devno;
@@ -2264,7 +2269,8 @@ static int ata_eh_revalidate_and_attach(struct ata_link *link,
2264 * device detection messages backwards. 2269 * device detection messages backwards.
2265 */ 2270 */
2266 ata_link_for_each_dev(dev, link) { 2271 ata_link_for_each_dev(dev, link) {
2267 if (!(new_mask & (1 << dev->devno))) 2272 if (!(new_mask & (1 << dev->devno)) ||
2273 dev->class == ATA_DEV_PMP)
2268 continue; 2274 continue;
2269 2275
2270 ehc->i.flags |= ATA_EHI_PRINTINFO; 2276 ehc->i.flags |= ATA_EHI_PRINTINFO;
@@ -2521,6 +2527,12 @@ int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset,
2521 if (rc) 2527 if (rc)
2522 goto dev_fail; 2528 goto dev_fail;
2523 2529
2530 /* if PMP got attached, return, pmp EH will take care of it */
2531 if (link->device->class == ATA_DEV_PMP) {
2532 ehc->i.action = 0;
2533 return 0;
2534 }
2535
2524 /* configure transfer mode if necessary */ 2536 /* configure transfer mode if necessary */
2525 if (ehc->i.flags & ATA_EHI_SETMODE) { 2537 if (ehc->i.flags & ATA_EHI_SETMODE) {
2526 rc = ata_set_mode(link, &dev); 2538 rc = ata_set_mode(link, &dev);