diff options
-rw-r--r-- | drivers/ata/ahci_platform.c | 46 | ||||
-rw-r--r-- | drivers/ata/ata_piix.c | 444 | ||||
-rw-r--r-- | drivers/ata/libahci.c | 2 | ||||
-rw-r--r-- | drivers/ata/libata-acpi.c | 4 | ||||
-rw-r--r-- | drivers/ata/libata-core.c | 31 | ||||
-rw-r--r-- | drivers/ata/libata-eh.c | 1 | ||||
-rw-r--r-- | drivers/ata/libata-scsi.c | 6 | ||||
-rw-r--r-- | drivers/ata/pata_arasan_cf.c | 7 | ||||
-rw-r--r-- | drivers/ata/pata_cmd64x.c | 6 | ||||
-rw-r--r-- | drivers/ata/pata_cs5536.c | 32 | ||||
-rw-r--r-- | drivers/ata/pata_ep93xx.c | 6 | ||||
-rw-r--r-- | drivers/ata/pata_imx.c | 2 | ||||
-rw-r--r-- | drivers/ata/pata_ixp4xx_cf.c | 11 | ||||
-rw-r--r-- | drivers/ata/pata_mpc52xx.c | 17 | ||||
-rw-r--r-- | drivers/ata/pata_of_platform.c | 8 | ||||
-rw-r--r-- | drivers/ata/pata_palmld.c | 4 | ||||
-rw-r--r-- | drivers/ata/pata_platform.c | 24 | ||||
-rw-r--r-- | drivers/ata/pata_rdc.c | 3 | ||||
-rw-r--r--[-rwxr-xr-x] | drivers/ata/sata_dwc_460ex.c | 1 | ||||
-rw-r--r-- | drivers/ata/sata_highbank.c | 14 | ||||
-rw-r--r-- | drivers/ata/sata_inic162x.c | 2 | ||||
-rw-r--r-- | drivers/ata/sata_promise.c | 15 | ||||
-rw-r--r-- | drivers/ata/sata_sil24.c | 4 | ||||
-rw-r--r-- | drivers/ata/sata_sx4.c | 14 | ||||
-rw-r--r-- | include/linux/ata_platform.h | 2 | ||||
-rw-r--r-- | include/linux/libata.h | 5 |
26 files changed, 355 insertions, 356 deletions
diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c index b7078afddb74..1cc467bdb63d 100644 --- a/drivers/ata/ahci_platform.c +++ b/drivers/ata/ahci_platform.c | |||
@@ -25,6 +25,8 @@ | |||
25 | #include <linux/ahci_platform.h> | 25 | #include <linux/ahci_platform.h> |
26 | #include "ahci.h" | 26 | #include "ahci.h" |
27 | 27 | ||
28 | static void ahci_host_stop(struct ata_host *host); | ||
29 | |||
28 | enum ahci_type { | 30 | enum ahci_type { |
29 | AHCI, /* standard platform ahci */ | 31 | AHCI, /* standard platform ahci */ |
30 | IMX53_AHCI, /* ahci on i.mx53 */ | 32 | IMX53_AHCI, /* ahci on i.mx53 */ |
@@ -47,6 +49,15 @@ static struct platform_device_id ahci_devtype[] = { | |||
47 | }; | 49 | }; |
48 | MODULE_DEVICE_TABLE(platform, ahci_devtype); | 50 | MODULE_DEVICE_TABLE(platform, ahci_devtype); |
49 | 51 | ||
52 | static struct ata_port_operations ahci_platform_ops = { | ||
53 | .inherits = &ahci_ops, | ||
54 | .host_stop = ahci_host_stop, | ||
55 | }; | ||
56 | |||
57 | static struct ata_port_operations ahci_platform_retry_srst_ops = { | ||
58 | .inherits = &ahci_pmp_retry_srst_ops, | ||
59 | .host_stop = ahci_host_stop, | ||
60 | }; | ||
50 | 61 | ||
51 | static const struct ata_port_info ahci_port_info[] = { | 62 | static const struct ata_port_info ahci_port_info[] = { |
52 | /* by features */ | 63 | /* by features */ |
@@ -54,20 +65,20 @@ static const struct ata_port_info ahci_port_info[] = { | |||
54 | .flags = AHCI_FLAG_COMMON, | 65 | .flags = AHCI_FLAG_COMMON, |
55 | .pio_mask = ATA_PIO4, | 66 | .pio_mask = ATA_PIO4, |
56 | .udma_mask = ATA_UDMA6, | 67 | .udma_mask = ATA_UDMA6, |
57 | .port_ops = &ahci_ops, | 68 | .port_ops = &ahci_platform_ops, |
58 | }, | 69 | }, |
59 | [IMX53_AHCI] = { | 70 | [IMX53_AHCI] = { |
60 | .flags = AHCI_FLAG_COMMON, | 71 | .flags = AHCI_FLAG_COMMON, |
61 | .pio_mask = ATA_PIO4, | 72 | .pio_mask = ATA_PIO4, |
62 | .udma_mask = ATA_UDMA6, | 73 | .udma_mask = ATA_UDMA6, |
63 | .port_ops = &ahci_pmp_retry_srst_ops, | 74 | .port_ops = &ahci_platform_retry_srst_ops, |
64 | }, | 75 | }, |
65 | [STRICT_AHCI] = { | 76 | [STRICT_AHCI] = { |
66 | AHCI_HFLAGS (AHCI_HFLAG_DELAY_ENGINE), | 77 | AHCI_HFLAGS (AHCI_HFLAG_DELAY_ENGINE), |
67 | .flags = AHCI_FLAG_COMMON, | 78 | .flags = AHCI_FLAG_COMMON, |
68 | .pio_mask = ATA_PIO4, | 79 | .pio_mask = ATA_PIO4, |
69 | .udma_mask = ATA_UDMA6, | 80 | .udma_mask = ATA_UDMA6, |
70 | .port_ops = &ahci_ops, | 81 | .port_ops = &ahci_platform_ops, |
71 | }, | 82 | }, |
72 | }; | 83 | }; |
73 | 84 | ||
@@ -75,7 +86,7 @@ static struct scsi_host_template ahci_platform_sht = { | |||
75 | AHCI_SHT("ahci_platform"), | 86 | AHCI_SHT("ahci_platform"), |
76 | }; | 87 | }; |
77 | 88 | ||
78 | static int __init ahci_probe(struct platform_device *pdev) | 89 | static int __devinit ahci_probe(struct platform_device *pdev) |
79 | { | 90 | { |
80 | struct device *dev = &pdev->dev; | 91 | struct device *dev = &pdev->dev; |
81 | struct ahci_platform_data *pdata = dev_get_platdata(dev); | 92 | struct ahci_platform_data *pdata = dev_get_platdata(dev); |
@@ -218,15 +229,12 @@ free_clk: | |||
218 | return rc; | 229 | return rc; |
219 | } | 230 | } |
220 | 231 | ||
221 | static int __devexit ahci_remove(struct platform_device *pdev) | 232 | static void ahci_host_stop(struct ata_host *host) |
222 | { | 233 | { |
223 | struct device *dev = &pdev->dev; | 234 | struct device *dev = host->dev; |
224 | struct ahci_platform_data *pdata = dev_get_platdata(dev); | 235 | struct ahci_platform_data *pdata = dev_get_platdata(dev); |
225 | struct ata_host *host = dev_get_drvdata(dev); | ||
226 | struct ahci_host_priv *hpriv = host->private_data; | 236 | struct ahci_host_priv *hpriv = host->private_data; |
227 | 237 | ||
228 | ata_host_detach(host); | ||
229 | |||
230 | if (pdata && pdata->exit) | 238 | if (pdata && pdata->exit) |
231 | pdata->exit(dev); | 239 | pdata->exit(dev); |
232 | 240 | ||
@@ -234,8 +242,6 @@ static int __devexit ahci_remove(struct platform_device *pdev) | |||
234 | clk_disable_unprepare(hpriv->clk); | 242 | clk_disable_unprepare(hpriv->clk); |
235 | clk_put(hpriv->clk); | 243 | clk_put(hpriv->clk); |
236 | } | 244 | } |
237 | |||
238 | return 0; | ||
239 | } | 245 | } |
240 | 246 | ||
241 | #ifdef CONFIG_PM_SLEEP | 247 | #ifdef CONFIG_PM_SLEEP |
@@ -317,7 +323,7 @@ disable_unprepare_clk: | |||
317 | } | 323 | } |
318 | #endif | 324 | #endif |
319 | 325 | ||
320 | SIMPLE_DEV_PM_OPS(ahci_pm_ops, ahci_suspend, ahci_resume); | 326 | static SIMPLE_DEV_PM_OPS(ahci_pm_ops, ahci_suspend, ahci_resume); |
321 | 327 | ||
322 | static const struct of_device_id ahci_of_match[] = { | 328 | static const struct of_device_id ahci_of_match[] = { |
323 | { .compatible = "snps,spear-ahci", }, | 329 | { .compatible = "snps,spear-ahci", }, |
@@ -326,7 +332,8 @@ static const struct of_device_id ahci_of_match[] = { | |||
326 | MODULE_DEVICE_TABLE(of, ahci_of_match); | 332 | MODULE_DEVICE_TABLE(of, ahci_of_match); |
327 | 333 | ||
328 | static struct platform_driver ahci_driver = { | 334 | static struct platform_driver ahci_driver = { |
329 | .remove = __devexit_p(ahci_remove), | 335 | .probe = ahci_probe, |
336 | .remove = ata_platform_remove_one, | ||
330 | .driver = { | 337 | .driver = { |
331 | .name = "ahci", | 338 | .name = "ahci", |
332 | .owner = THIS_MODULE, | 339 | .owner = THIS_MODULE, |
@@ -335,18 +342,7 @@ static struct platform_driver ahci_driver = { | |||
335 | }, | 342 | }, |
336 | .id_table = ahci_devtype, | 343 | .id_table = ahci_devtype, |
337 | }; | 344 | }; |
338 | 345 | module_platform_driver(ahci_driver); | |
339 | static int __init ahci_init(void) | ||
340 | { | ||
341 | return platform_driver_probe(&ahci_driver, ahci_probe); | ||
342 | } | ||
343 | module_init(ahci_init); | ||
344 | |||
345 | static void __exit ahci_exit(void) | ||
346 | { | ||
347 | platform_driver_unregister(&ahci_driver); | ||
348 | } | ||
349 | module_exit(ahci_exit); | ||
350 | 346 | ||
351 | MODULE_DESCRIPTION("AHCI SATA platform driver"); | 347 | MODULE_DESCRIPTION("AHCI SATA platform driver"); |
352 | MODULE_AUTHOR("Anton Vorontsov <avorontsov@ru.mvista.com>"); | 348 | MODULE_AUTHOR("Anton Vorontsov <avorontsov@ru.mvista.com>"); |
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c index ef773e12af79..acffcf0b3ad3 100644 --- a/drivers/ata/ata_piix.c +++ b/drivers/ata/ata_piix.c | |||
@@ -164,28 +164,6 @@ struct piix_host_priv { | |||
164 | void __iomem *sidpr; | 164 | void __iomem *sidpr; |
165 | }; | 165 | }; |
166 | 166 | ||
167 | static int piix_init_one(struct pci_dev *pdev, | ||
168 | const struct pci_device_id *ent); | ||
169 | static void piix_remove_one(struct pci_dev *pdev); | ||
170 | static int piix_pata_prereset(struct ata_link *link, unsigned long deadline); | ||
171 | static void piix_set_piomode(struct ata_port *ap, struct ata_device *adev); | ||
172 | static void piix_set_dmamode(struct ata_port *ap, struct ata_device *adev); | ||
173 | static void ich_set_dmamode(struct ata_port *ap, struct ata_device *adev); | ||
174 | static int ich_pata_cable_detect(struct ata_port *ap); | ||
175 | static u8 piix_vmw_bmdma_status(struct ata_port *ap); | ||
176 | static int piix_sidpr_scr_read(struct ata_link *link, | ||
177 | unsigned int reg, u32 *val); | ||
178 | static int piix_sidpr_scr_write(struct ata_link *link, | ||
179 | unsigned int reg, u32 val); | ||
180 | static int piix_sidpr_set_lpm(struct ata_link *link, enum ata_lpm_policy policy, | ||
181 | unsigned hints); | ||
182 | static bool piix_irq_check(struct ata_port *ap); | ||
183 | static int piix_port_start(struct ata_port *ap); | ||
184 | #ifdef CONFIG_PM | ||
185 | static int piix_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg); | ||
186 | static int piix_pci_device_resume(struct pci_dev *pdev); | ||
187 | #endif | ||
188 | |||
189 | static unsigned int in_module_init = 1; | 167 | static unsigned int in_module_init = 1; |
190 | 168 | ||
191 | static const struct pci_device_id piix_pci_tbl[] = { | 169 | static const struct pci_device_id piix_pci_tbl[] = { |
@@ -342,64 +320,6 @@ static const struct pci_device_id piix_pci_tbl[] = { | |||
342 | { } /* terminate list */ | 320 | { } /* terminate list */ |
343 | }; | 321 | }; |
344 | 322 | ||
345 | static struct pci_driver piix_pci_driver = { | ||
346 | .name = DRV_NAME, | ||
347 | .id_table = piix_pci_tbl, | ||
348 | .probe = piix_init_one, | ||
349 | .remove = piix_remove_one, | ||
350 | #ifdef CONFIG_PM | ||
351 | .suspend = piix_pci_device_suspend, | ||
352 | .resume = piix_pci_device_resume, | ||
353 | #endif | ||
354 | }; | ||
355 | |||
356 | static struct scsi_host_template piix_sht = { | ||
357 | ATA_BMDMA_SHT(DRV_NAME), | ||
358 | }; | ||
359 | |||
360 | static struct ata_port_operations piix_sata_ops = { | ||
361 | .inherits = &ata_bmdma32_port_ops, | ||
362 | .sff_irq_check = piix_irq_check, | ||
363 | .port_start = piix_port_start, | ||
364 | }; | ||
365 | |||
366 | static struct ata_port_operations piix_pata_ops = { | ||
367 | .inherits = &piix_sata_ops, | ||
368 | .cable_detect = ata_cable_40wire, | ||
369 | .set_piomode = piix_set_piomode, | ||
370 | .set_dmamode = piix_set_dmamode, | ||
371 | .prereset = piix_pata_prereset, | ||
372 | }; | ||
373 | |||
374 | static struct ata_port_operations piix_vmw_ops = { | ||
375 | .inherits = &piix_pata_ops, | ||
376 | .bmdma_status = piix_vmw_bmdma_status, | ||
377 | }; | ||
378 | |||
379 | static struct ata_port_operations ich_pata_ops = { | ||
380 | .inherits = &piix_pata_ops, | ||
381 | .cable_detect = ich_pata_cable_detect, | ||
382 | .set_dmamode = ich_set_dmamode, | ||
383 | }; | ||
384 | |||
385 | static struct device_attribute *piix_sidpr_shost_attrs[] = { | ||
386 | &dev_attr_link_power_management_policy, | ||
387 | NULL | ||
388 | }; | ||
389 | |||
390 | static struct scsi_host_template piix_sidpr_sht = { | ||
391 | ATA_BMDMA_SHT(DRV_NAME), | ||
392 | .shost_attrs = piix_sidpr_shost_attrs, | ||
393 | }; | ||
394 | |||
395 | static struct ata_port_operations piix_sidpr_sata_ops = { | ||
396 | .inherits = &piix_sata_ops, | ||
397 | .hardreset = sata_std_hardreset, | ||
398 | .scr_read = piix_sidpr_scr_read, | ||
399 | .scr_write = piix_sidpr_scr_write, | ||
400 | .set_lpm = piix_sidpr_set_lpm, | ||
401 | }; | ||
402 | |||
403 | static const struct piix_map_db ich5_map_db = { | 323 | static const struct piix_map_db ich5_map_db = { |
404 | .mask = 0x7, | 324 | .mask = 0x7, |
405 | .port_enable = 0x3, | 325 | .port_enable = 0x3, |
@@ -504,147 +424,6 @@ static const struct piix_map_db *piix_map_db_table[] = { | |||
504 | [ich8_sata_snb] = &ich8_map_db, | 424 | [ich8_sata_snb] = &ich8_map_db, |
505 | }; | 425 | }; |
506 | 426 | ||
507 | static struct ata_port_info piix_port_info[] = { | ||
508 | [piix_pata_mwdma] = /* PIIX3 MWDMA only */ | ||
509 | { | ||
510 | .flags = PIIX_PATA_FLAGS, | ||
511 | .pio_mask = ATA_PIO4, | ||
512 | .mwdma_mask = ATA_MWDMA12_ONLY, /* mwdma1-2 ?? CHECK 0 should be ok but slow */ | ||
513 | .port_ops = &piix_pata_ops, | ||
514 | }, | ||
515 | |||
516 | [piix_pata_33] = /* PIIX4 at 33MHz */ | ||
517 | { | ||
518 | .flags = PIIX_PATA_FLAGS, | ||
519 | .pio_mask = ATA_PIO4, | ||
520 | .mwdma_mask = ATA_MWDMA12_ONLY, /* mwdma1-2 ?? CHECK 0 should be ok but slow */ | ||
521 | .udma_mask = ATA_UDMA2, | ||
522 | .port_ops = &piix_pata_ops, | ||
523 | }, | ||
524 | |||
525 | [ich_pata_33] = /* ICH0 - ICH at 33Mhz*/ | ||
526 | { | ||
527 | .flags = PIIX_PATA_FLAGS, | ||
528 | .pio_mask = ATA_PIO4, | ||
529 | .mwdma_mask = ATA_MWDMA12_ONLY, /* Check: maybe MWDMA0 is ok */ | ||
530 | .udma_mask = ATA_UDMA2, | ||
531 | .port_ops = &ich_pata_ops, | ||
532 | }, | ||
533 | |||
534 | [ich_pata_66] = /* ICH controllers up to 66MHz */ | ||
535 | { | ||
536 | .flags = PIIX_PATA_FLAGS, | ||
537 | .pio_mask = ATA_PIO4, | ||
538 | .mwdma_mask = ATA_MWDMA12_ONLY, /* MWDMA0 is broken on chip */ | ||
539 | .udma_mask = ATA_UDMA4, | ||
540 | .port_ops = &ich_pata_ops, | ||
541 | }, | ||
542 | |||
543 | [ich_pata_100] = | ||
544 | { | ||
545 | .flags = PIIX_PATA_FLAGS | PIIX_FLAG_CHECKINTR, | ||
546 | .pio_mask = ATA_PIO4, | ||
547 | .mwdma_mask = ATA_MWDMA12_ONLY, | ||
548 | .udma_mask = ATA_UDMA5, | ||
549 | .port_ops = &ich_pata_ops, | ||
550 | }, | ||
551 | |||
552 | [ich_pata_100_nomwdma1] = | ||
553 | { | ||
554 | .flags = PIIX_PATA_FLAGS | PIIX_FLAG_CHECKINTR, | ||
555 | .pio_mask = ATA_PIO4, | ||
556 | .mwdma_mask = ATA_MWDMA2_ONLY, | ||
557 | .udma_mask = ATA_UDMA5, | ||
558 | .port_ops = &ich_pata_ops, | ||
559 | }, | ||
560 | |||
561 | [ich5_sata] = | ||
562 | { | ||
563 | .flags = PIIX_SATA_FLAGS, | ||
564 | .pio_mask = ATA_PIO4, | ||
565 | .mwdma_mask = ATA_MWDMA2, | ||
566 | .udma_mask = ATA_UDMA6, | ||
567 | .port_ops = &piix_sata_ops, | ||
568 | }, | ||
569 | |||
570 | [ich6_sata] = | ||
571 | { | ||
572 | .flags = PIIX_SATA_FLAGS, | ||
573 | .pio_mask = ATA_PIO4, | ||
574 | .mwdma_mask = ATA_MWDMA2, | ||
575 | .udma_mask = ATA_UDMA6, | ||
576 | .port_ops = &piix_sata_ops, | ||
577 | }, | ||
578 | |||
579 | [ich6m_sata] = | ||
580 | { | ||
581 | .flags = PIIX_SATA_FLAGS, | ||
582 | .pio_mask = ATA_PIO4, | ||
583 | .mwdma_mask = ATA_MWDMA2, | ||
584 | .udma_mask = ATA_UDMA6, | ||
585 | .port_ops = &piix_sata_ops, | ||
586 | }, | ||
587 | |||
588 | [ich8_sata] = | ||
589 | { | ||
590 | .flags = PIIX_SATA_FLAGS | PIIX_FLAG_SIDPR, | ||
591 | .pio_mask = ATA_PIO4, | ||
592 | .mwdma_mask = ATA_MWDMA2, | ||
593 | .udma_mask = ATA_UDMA6, | ||
594 | .port_ops = &piix_sata_ops, | ||
595 | }, | ||
596 | |||
597 | [ich8_2port_sata] = | ||
598 | { | ||
599 | .flags = PIIX_SATA_FLAGS | PIIX_FLAG_SIDPR, | ||
600 | .pio_mask = ATA_PIO4, | ||
601 | .mwdma_mask = ATA_MWDMA2, | ||
602 | .udma_mask = ATA_UDMA6, | ||
603 | .port_ops = &piix_sata_ops, | ||
604 | }, | ||
605 | |||
606 | [tolapai_sata] = | ||
607 | { | ||
608 | .flags = PIIX_SATA_FLAGS, | ||
609 | .pio_mask = ATA_PIO4, | ||
610 | .mwdma_mask = ATA_MWDMA2, | ||
611 | .udma_mask = ATA_UDMA6, | ||
612 | .port_ops = &piix_sata_ops, | ||
613 | }, | ||
614 | |||
615 | [ich8m_apple_sata] = | ||
616 | { | ||
617 | .flags = PIIX_SATA_FLAGS, | ||
618 | .pio_mask = ATA_PIO4, | ||
619 | .mwdma_mask = ATA_MWDMA2, | ||
620 | .udma_mask = ATA_UDMA6, | ||
621 | .port_ops = &piix_sata_ops, | ||
622 | }, | ||
623 | |||
624 | [piix_pata_vmw] = | ||
625 | { | ||
626 | .flags = PIIX_PATA_FLAGS, | ||
627 | .pio_mask = ATA_PIO4, | ||
628 | .mwdma_mask = ATA_MWDMA12_ONLY, /* mwdma1-2 ?? CHECK 0 should be ok but slow */ | ||
629 | .udma_mask = ATA_UDMA2, | ||
630 | .port_ops = &piix_vmw_ops, | ||
631 | }, | ||
632 | |||
633 | /* | ||
634 | * some Sandybridge chipsets have broken 32 mode up to now, | ||
635 | * see https://bugzilla.kernel.org/show_bug.cgi?id=40592 | ||
636 | */ | ||
637 | [ich8_sata_snb] = | ||
638 | { | ||
639 | .flags = PIIX_SATA_FLAGS | PIIX_FLAG_SIDPR | PIIX_FLAG_PIO16, | ||
640 | .pio_mask = ATA_PIO4, | ||
641 | .mwdma_mask = ATA_MWDMA2, | ||
642 | .udma_mask = ATA_UDMA6, | ||
643 | .port_ops = &piix_sata_ops, | ||
644 | }, | ||
645 | |||
646 | }; | ||
647 | |||
648 | static struct pci_bits piix_enable_bits[] = { | 427 | static struct pci_bits piix_enable_bits[] = { |
649 | { 0x41U, 1U, 0x80UL, 0x80UL }, /* port 0 */ | 428 | { 0x41U, 1U, 0x80UL, 0x80UL }, /* port 0 */ |
650 | { 0x43U, 1U, 0x80UL, 0x80UL }, /* port 1 */ | 429 | { 0x43U, 1U, 0x80UL, 0x80UL }, /* port 1 */ |
@@ -1261,6 +1040,193 @@ static u8 piix_vmw_bmdma_status(struct ata_port *ap) | |||
1261 | return ata_bmdma_status(ap) & ~ATA_DMA_ERR; | 1040 | return ata_bmdma_status(ap) & ~ATA_DMA_ERR; |
1262 | } | 1041 | } |
1263 | 1042 | ||
1043 | static struct scsi_host_template piix_sht = { | ||
1044 | ATA_BMDMA_SHT(DRV_NAME), | ||
1045 | }; | ||
1046 | |||
1047 | static struct ata_port_operations piix_sata_ops = { | ||
1048 | .inherits = &ata_bmdma32_port_ops, | ||
1049 | .sff_irq_check = piix_irq_check, | ||
1050 | .port_start = piix_port_start, | ||
1051 | }; | ||
1052 | |||
1053 | static struct ata_port_operations piix_pata_ops = { | ||
1054 | .inherits = &piix_sata_ops, | ||
1055 | .cable_detect = ata_cable_40wire, | ||
1056 | .set_piomode = piix_set_piomode, | ||
1057 | .set_dmamode = piix_set_dmamode, | ||
1058 | .prereset = piix_pata_prereset, | ||
1059 | }; | ||
1060 | |||
1061 | static struct ata_port_operations piix_vmw_ops = { | ||
1062 | .inherits = &piix_pata_ops, | ||
1063 | .bmdma_status = piix_vmw_bmdma_status, | ||
1064 | }; | ||
1065 | |||
1066 | static struct ata_port_operations ich_pata_ops = { | ||
1067 | .inherits = &piix_pata_ops, | ||
1068 | .cable_detect = ich_pata_cable_detect, | ||
1069 | .set_dmamode = ich_set_dmamode, | ||
1070 | }; | ||
1071 | |||
1072 | static struct device_attribute *piix_sidpr_shost_attrs[] = { | ||
1073 | &dev_attr_link_power_management_policy, | ||
1074 | NULL | ||
1075 | }; | ||
1076 | |||
1077 | static struct scsi_host_template piix_sidpr_sht = { | ||
1078 | ATA_BMDMA_SHT(DRV_NAME), | ||
1079 | .shost_attrs = piix_sidpr_shost_attrs, | ||
1080 | }; | ||
1081 | |||
1082 | static struct ata_port_operations piix_sidpr_sata_ops = { | ||
1083 | .inherits = &piix_sata_ops, | ||
1084 | .hardreset = sata_std_hardreset, | ||
1085 | .scr_read = piix_sidpr_scr_read, | ||
1086 | .scr_write = piix_sidpr_scr_write, | ||
1087 | .set_lpm = piix_sidpr_set_lpm, | ||
1088 | }; | ||
1089 | |||
1090 | static struct ata_port_info piix_port_info[] = { | ||
1091 | [piix_pata_mwdma] = /* PIIX3 MWDMA only */ | ||
1092 | { | ||
1093 | .flags = PIIX_PATA_FLAGS, | ||
1094 | .pio_mask = ATA_PIO4, | ||
1095 | .mwdma_mask = ATA_MWDMA12_ONLY, /* mwdma1-2 ?? CHECK 0 should be ok but slow */ | ||
1096 | .port_ops = &piix_pata_ops, | ||
1097 | }, | ||
1098 | |||
1099 | [piix_pata_33] = /* PIIX4 at 33MHz */ | ||
1100 | { | ||
1101 | .flags = PIIX_PATA_FLAGS, | ||
1102 | .pio_mask = ATA_PIO4, | ||
1103 | .mwdma_mask = ATA_MWDMA12_ONLY, /* mwdma1-2 ?? CHECK 0 should be ok but slow */ | ||
1104 | .udma_mask = ATA_UDMA2, | ||
1105 | .port_ops = &piix_pata_ops, | ||
1106 | }, | ||
1107 | |||
1108 | [ich_pata_33] = /* ICH0 - ICH at 33Mhz*/ | ||
1109 | { | ||
1110 | .flags = PIIX_PATA_FLAGS, | ||
1111 | .pio_mask = ATA_PIO4, | ||
1112 | .mwdma_mask = ATA_MWDMA12_ONLY, /* Check: maybe MWDMA0 is ok */ | ||
1113 | .udma_mask = ATA_UDMA2, | ||
1114 | .port_ops = &ich_pata_ops, | ||
1115 | }, | ||
1116 | |||
1117 | [ich_pata_66] = /* ICH controllers up to 66MHz */ | ||
1118 | { | ||
1119 | .flags = PIIX_PATA_FLAGS, | ||
1120 | .pio_mask = ATA_PIO4, | ||
1121 | .mwdma_mask = ATA_MWDMA12_ONLY, /* MWDMA0 is broken on chip */ | ||
1122 | .udma_mask = ATA_UDMA4, | ||
1123 | .port_ops = &ich_pata_ops, | ||
1124 | }, | ||
1125 | |||
1126 | [ich_pata_100] = | ||
1127 | { | ||
1128 | .flags = PIIX_PATA_FLAGS | PIIX_FLAG_CHECKINTR, | ||
1129 | .pio_mask = ATA_PIO4, | ||
1130 | .mwdma_mask = ATA_MWDMA12_ONLY, | ||
1131 | .udma_mask = ATA_UDMA5, | ||
1132 | .port_ops = &ich_pata_ops, | ||
1133 | }, | ||
1134 | |||
1135 | [ich_pata_100_nomwdma1] = | ||
1136 | { | ||
1137 | .flags = PIIX_PATA_FLAGS | PIIX_FLAG_CHECKINTR, | ||
1138 | .pio_mask = ATA_PIO4, | ||
1139 | .mwdma_mask = ATA_MWDMA2_ONLY, | ||
1140 | .udma_mask = ATA_UDMA5, | ||
1141 | .port_ops = &ich_pata_ops, | ||
1142 | }, | ||
1143 | |||
1144 | [ich5_sata] = | ||
1145 | { | ||
1146 | .flags = PIIX_SATA_FLAGS, | ||
1147 | .pio_mask = ATA_PIO4, | ||
1148 | .mwdma_mask = ATA_MWDMA2, | ||
1149 | .udma_mask = ATA_UDMA6, | ||
1150 | .port_ops = &piix_sata_ops, | ||
1151 | }, | ||
1152 | |||
1153 | [ich6_sata] = | ||
1154 | { | ||
1155 | .flags = PIIX_SATA_FLAGS, | ||
1156 | .pio_mask = ATA_PIO4, | ||
1157 | .mwdma_mask = ATA_MWDMA2, | ||
1158 | .udma_mask = ATA_UDMA6, | ||
1159 | .port_ops = &piix_sata_ops, | ||
1160 | }, | ||
1161 | |||
1162 | [ich6m_sata] = | ||
1163 | { | ||
1164 | .flags = PIIX_SATA_FLAGS, | ||
1165 | .pio_mask = ATA_PIO4, | ||
1166 | .mwdma_mask = ATA_MWDMA2, | ||
1167 | .udma_mask = ATA_UDMA6, | ||
1168 | .port_ops = &piix_sata_ops, | ||
1169 | }, | ||
1170 | |||
1171 | [ich8_sata] = | ||
1172 | { | ||
1173 | .flags = PIIX_SATA_FLAGS | PIIX_FLAG_SIDPR, | ||
1174 | .pio_mask = ATA_PIO4, | ||
1175 | .mwdma_mask = ATA_MWDMA2, | ||
1176 | .udma_mask = ATA_UDMA6, | ||
1177 | .port_ops = &piix_sata_ops, | ||
1178 | }, | ||
1179 | |||
1180 | [ich8_2port_sata] = | ||
1181 | { | ||
1182 | .flags = PIIX_SATA_FLAGS | PIIX_FLAG_SIDPR, | ||
1183 | .pio_mask = ATA_PIO4, | ||
1184 | .mwdma_mask = ATA_MWDMA2, | ||
1185 | .udma_mask = ATA_UDMA6, | ||
1186 | .port_ops = &piix_sata_ops, | ||
1187 | }, | ||
1188 | |||
1189 | [tolapai_sata] = | ||
1190 | { | ||
1191 | .flags = PIIX_SATA_FLAGS, | ||
1192 | .pio_mask = ATA_PIO4, | ||
1193 | .mwdma_mask = ATA_MWDMA2, | ||
1194 | .udma_mask = ATA_UDMA6, | ||
1195 | .port_ops = &piix_sata_ops, | ||
1196 | }, | ||
1197 | |||
1198 | [ich8m_apple_sata] = | ||
1199 | { | ||
1200 | .flags = PIIX_SATA_FLAGS, | ||
1201 | .pio_mask = ATA_PIO4, | ||
1202 | .mwdma_mask = ATA_MWDMA2, | ||
1203 | .udma_mask = ATA_UDMA6, | ||
1204 | .port_ops = &piix_sata_ops, | ||
1205 | }, | ||
1206 | |||
1207 | [piix_pata_vmw] = | ||
1208 | { | ||
1209 | .flags = PIIX_PATA_FLAGS, | ||
1210 | .pio_mask = ATA_PIO4, | ||
1211 | .mwdma_mask = ATA_MWDMA12_ONLY, /* mwdma1-2 ?? CHECK 0 should be ok but slow */ | ||
1212 | .udma_mask = ATA_UDMA2, | ||
1213 | .port_ops = &piix_vmw_ops, | ||
1214 | }, | ||
1215 | |||
1216 | /* | ||
1217 | * some Sandybridge chipsets have broken 32 mode up to now, | ||
1218 | * see https://bugzilla.kernel.org/show_bug.cgi?id=40592 | ||
1219 | */ | ||
1220 | [ich8_sata_snb] = | ||
1221 | { | ||
1222 | .flags = PIIX_SATA_FLAGS | PIIX_FLAG_SIDPR | PIIX_FLAG_PIO16, | ||
1223 | .pio_mask = ATA_PIO4, | ||
1224 | .mwdma_mask = ATA_MWDMA2, | ||
1225 | .udma_mask = ATA_UDMA6, | ||
1226 | .port_ops = &piix_sata_ops, | ||
1227 | }, | ||
1228 | }; | ||
1229 | |||
1264 | #define AHCI_PCI_BAR 5 | 1230 | #define AHCI_PCI_BAR 5 |
1265 | #define AHCI_GLOBAL_CTL 0x04 | 1231 | #define AHCI_GLOBAL_CTL 0x04 |
1266 | #define AHCI_ENABLE (1 << 31) | 1232 | #define AHCI_ENABLE (1 << 31) |
@@ -1585,12 +1551,31 @@ static void piix_ignore_devices_quirk(struct ata_host *host) | |||
1585 | }, | 1551 | }, |
1586 | { } /* terminate list */ | 1552 | { } /* terminate list */ |
1587 | }; | 1553 | }; |
1588 | const struct dmi_system_id *dmi = dmi_first_match(ignore_hyperv); | 1554 | static const struct dmi_system_id allow_virtual_pc[] = { |
1555 | { | ||
1556 | /* In MS Virtual PC guests the DMI ident is nearly | ||
1557 | * identical to a Hyper-V guest. One difference is the | ||
1558 | * product version which is used here to identify | ||
1559 | * a Virtual PC guest. This entry allows ata_piix to | ||
1560 | * drive the emulated hardware. | ||
1561 | */ | ||
1562 | .ident = "MS Virtual PC 2007", | ||
1563 | .matches = { | ||
1564 | DMI_MATCH(DMI_SYS_VENDOR, | ||
1565 | "Microsoft Corporation"), | ||
1566 | DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"), | ||
1567 | DMI_MATCH(DMI_PRODUCT_VERSION, "VS2005R2"), | ||
1568 | }, | ||
1569 | }, | ||
1570 | { } /* terminate list */ | ||
1571 | }; | ||
1572 | const struct dmi_system_id *ignore = dmi_first_match(ignore_hyperv); | ||
1573 | const struct dmi_system_id *allow = dmi_first_match(allow_virtual_pc); | ||
1589 | 1574 | ||
1590 | if (dmi && prefer_ms_hyperv) { | 1575 | if (ignore && !allow && prefer_ms_hyperv) { |
1591 | host->flags |= ATA_HOST_IGNORE_ATA; | 1576 | host->flags |= ATA_HOST_IGNORE_ATA; |
1592 | dev_info(host->dev, "%s detected, ATA device ignore set\n", | 1577 | dev_info(host->dev, "%s detected, ATA device ignore set\n", |
1593 | dmi->ident); | 1578 | ignore->ident); |
1594 | } | 1579 | } |
1595 | #endif | 1580 | #endif |
1596 | } | 1581 | } |
@@ -1727,6 +1712,17 @@ static void piix_remove_one(struct pci_dev *pdev) | |||
1727 | ata_pci_remove_one(pdev); | 1712 | ata_pci_remove_one(pdev); |
1728 | } | 1713 | } |
1729 | 1714 | ||
1715 | static struct pci_driver piix_pci_driver = { | ||
1716 | .name = DRV_NAME, | ||
1717 | .id_table = piix_pci_tbl, | ||
1718 | .probe = piix_init_one, | ||
1719 | .remove = piix_remove_one, | ||
1720 | #ifdef CONFIG_PM | ||
1721 | .suspend = piix_pci_device_suspend, | ||
1722 | .resume = piix_pci_device_resume, | ||
1723 | #endif | ||
1724 | }; | ||
1725 | |||
1730 | static int __init piix_init(void) | 1726 | static int __init piix_init(void) |
1731 | { | 1727 | { |
1732 | int rc; | 1728 | int rc; |
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index 4201e535a8c8..320712a7b9ea 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c | |||
@@ -1384,7 +1384,7 @@ int ahci_pmp_retry_softreset(struct ata_link *link, unsigned int *class, | |||
1384 | if (rc == -EIO) { | 1384 | if (rc == -EIO) { |
1385 | irq_sts = readl(port_mmio + PORT_IRQ_STAT); | 1385 | irq_sts = readl(port_mmio + PORT_IRQ_STAT); |
1386 | if (irq_sts & PORT_IRQ_BAD_PMP) { | 1386 | if (irq_sts & PORT_IRQ_BAD_PMP) { |
1387 | ata_link_printk(link, KERN_WARNING, | 1387 | ata_link_warn(link, |
1388 | "applying PMP SRST workaround " | 1388 | "applying PMP SRST workaround " |
1389 | "and retrying\n"); | 1389 | "and retrying\n"); |
1390 | rc = ahci_do_softreset(link, class, 0, deadline, | 1390 | rc = ahci_do_softreset(link, class, 0, deadline, |
diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c index 5b0ba3f20edc..ef01ac07502e 100644 --- a/drivers/ata/libata-acpi.c +++ b/drivers/ata/libata-acpi.c | |||
@@ -76,6 +76,9 @@ acpi_handle ata_dev_acpi_handle(struct ata_device *dev) | |||
76 | acpi_integer adr; | 76 | acpi_integer adr; |
77 | struct ata_port *ap = dev->link->ap; | 77 | struct ata_port *ap = dev->link->ap; |
78 | 78 | ||
79 | if (dev->flags & ATA_DFLAG_ACPI_DISABLED) | ||
80 | return NULL; | ||
81 | |||
79 | if (ap->flags & ATA_FLAG_ACPI_SATA) { | 82 | if (ap->flags & ATA_FLAG_ACPI_SATA) { |
80 | if (!sata_pmp_attached(ap)) | 83 | if (!sata_pmp_attached(ap)) |
81 | adr = SATA_ADR(ap->port_no, NO_PORT_MULT); | 84 | adr = SATA_ADR(ap->port_no, NO_PORT_MULT); |
@@ -945,6 +948,7 @@ int ata_acpi_on_devcfg(struct ata_device *dev) | |||
945 | return rc; | 948 | return rc; |
946 | } | 949 | } |
947 | 950 | ||
951 | dev->flags |= ATA_DFLAG_ACPI_DISABLED; | ||
948 | ata_dev_warn(dev, "ACPI: failed the second time, disabled\n"); | 952 | ata_dev_warn(dev, "ACPI: failed the second time, disabled\n"); |
949 | 953 | ||
950 | /* We can safely continue if no _GTF command has been executed | 954 | /* We can safely continue if no _GTF command has been executed |
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index f46fbd3bd3fb..9e8b99af400d 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -67,6 +67,7 @@ | |||
67 | #include <linux/cdrom.h> | 67 | #include <linux/cdrom.h> |
68 | #include <linux/ratelimit.h> | 68 | #include <linux/ratelimit.h> |
69 | #include <linux/pm_runtime.h> | 69 | #include <linux/pm_runtime.h> |
70 | #include <linux/platform_device.h> | ||
70 | 71 | ||
71 | #include "libata.h" | 72 | #include "libata.h" |
72 | #include "libata-transport.h" | 73 | #include "libata-transport.h" |
@@ -2560,6 +2561,7 @@ int ata_bus_probe(struct ata_port *ap) | |||
2560 | * bus as we may be talking too fast. | 2561 | * bus as we may be talking too fast. |
2561 | */ | 2562 | */ |
2562 | dev->pio_mode = XFER_PIO_0; | 2563 | dev->pio_mode = XFER_PIO_0; |
2564 | dev->dma_mode = 0xff; | ||
2563 | 2565 | ||
2564 | /* If the controller has a pio mode setup function | 2566 | /* If the controller has a pio mode setup function |
2565 | * then use it to set the chipset to rights. Don't | 2567 | * then use it to set the chipset to rights. Don't |
@@ -6286,8 +6288,7 @@ void ata_host_detach(struct ata_host *host) | |||
6286 | */ | 6288 | */ |
6287 | void ata_pci_remove_one(struct pci_dev *pdev) | 6289 | void ata_pci_remove_one(struct pci_dev *pdev) |
6288 | { | 6290 | { |
6289 | struct device *dev = &pdev->dev; | 6291 | struct ata_host *host = pci_get_drvdata(pdev); |
6290 | struct ata_host *host = dev_get_drvdata(dev); | ||
6291 | 6292 | ||
6292 | ata_host_detach(host); | 6293 | ata_host_detach(host); |
6293 | } | 6294 | } |
@@ -6356,7 +6357,7 @@ int ata_pci_device_do_resume(struct pci_dev *pdev) | |||
6356 | 6357 | ||
6357 | int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg) | 6358 | int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg) |
6358 | { | 6359 | { |
6359 | struct ata_host *host = dev_get_drvdata(&pdev->dev); | 6360 | struct ata_host *host = pci_get_drvdata(pdev); |
6360 | int rc = 0; | 6361 | int rc = 0; |
6361 | 6362 | ||
6362 | rc = ata_host_suspend(host, mesg); | 6363 | rc = ata_host_suspend(host, mesg); |
@@ -6370,7 +6371,7 @@ int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg) | |||
6370 | 6371 | ||
6371 | int ata_pci_device_resume(struct pci_dev *pdev) | 6372 | int ata_pci_device_resume(struct pci_dev *pdev) |
6372 | { | 6373 | { |
6373 | struct ata_host *host = dev_get_drvdata(&pdev->dev); | 6374 | struct ata_host *host = pci_get_drvdata(pdev); |
6374 | int rc; | 6375 | int rc; |
6375 | 6376 | ||
6376 | rc = ata_pci_device_do_resume(pdev); | 6377 | rc = ata_pci_device_do_resume(pdev); |
@@ -6382,6 +6383,26 @@ int ata_pci_device_resume(struct pci_dev *pdev) | |||
6382 | 6383 | ||
6383 | #endif /* CONFIG_PCI */ | 6384 | #endif /* CONFIG_PCI */ |
6384 | 6385 | ||
6386 | /** | ||
6387 | * ata_platform_remove_one - Platform layer callback for device removal | ||
6388 | * @pdev: Platform device that was removed | ||
6389 | * | ||
6390 | * Platform layer indicates to libata via this hook that hot-unplug or | ||
6391 | * module unload event has occurred. Detach all ports. Resource | ||
6392 | * release is handled via devres. | ||
6393 | * | ||
6394 | * LOCKING: | ||
6395 | * Inherited from platform layer (may sleep). | ||
6396 | */ | ||
6397 | int ata_platform_remove_one(struct platform_device *pdev) | ||
6398 | { | ||
6399 | struct ata_host *host = platform_get_drvdata(pdev); | ||
6400 | |||
6401 | ata_host_detach(host); | ||
6402 | |||
6403 | return 0; | ||
6404 | } | ||
6405 | |||
6385 | static int __init ata_parse_force_one(char **cur, | 6406 | static int __init ata_parse_force_one(char **cur, |
6386 | struct ata_force_ent *force_ent, | 6407 | struct ata_force_ent *force_ent, |
6387 | const char **reason) | 6408 | const char **reason) |
@@ -6877,6 +6898,8 @@ EXPORT_SYMBOL_GPL(ata_pci_device_resume); | |||
6877 | #endif /* CONFIG_PM */ | 6898 | #endif /* CONFIG_PM */ |
6878 | #endif /* CONFIG_PCI */ | 6899 | #endif /* CONFIG_PCI */ |
6879 | 6900 | ||
6901 | EXPORT_SYMBOL_GPL(ata_platform_remove_one); | ||
6902 | |||
6880 | EXPORT_SYMBOL_GPL(__ata_ehi_push_desc); | 6903 | EXPORT_SYMBOL_GPL(__ata_ehi_push_desc); |
6881 | EXPORT_SYMBOL_GPL(ata_ehi_push_desc); | 6904 | EXPORT_SYMBOL_GPL(ata_ehi_push_desc); |
6882 | EXPORT_SYMBOL_GPL(ata_ehi_clear_desc); | 6905 | EXPORT_SYMBOL_GPL(ata_ehi_clear_desc); |
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index e60437cd0d19..bf039b0e97b7 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c | |||
@@ -2657,6 +2657,7 @@ int ata_eh_reset(struct ata_link *link, int classify, | |||
2657 | * bus as we may be talking too fast. | 2657 | * bus as we may be talking too fast. |
2658 | */ | 2658 | */ |
2659 | dev->pio_mode = XFER_PIO_0; | 2659 | dev->pio_mode = XFER_PIO_0; |
2660 | dev->dma_mode = 0xff; | ||
2660 | 2661 | ||
2661 | /* If the controller has a pio mode setup function | 2662 | /* If the controller has a pio mode setup function |
2662 | * then use it to set the chipset to rights. Don't | 2663 | * then use it to set the chipset to rights. Don't |
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index a6df6a351d6e..7c337e754dab 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -309,7 +309,8 @@ ata_scsi_activity_show(struct device *dev, struct device_attribute *attr, | |||
309 | struct ata_port *ap = ata_shost_to_port(sdev->host); | 309 | struct ata_port *ap = ata_shost_to_port(sdev->host); |
310 | struct ata_device *atadev = ata_scsi_find_dev(ap, sdev); | 310 | struct ata_device *atadev = ata_scsi_find_dev(ap, sdev); |
311 | 311 | ||
312 | if (ap->ops->sw_activity_show && (ap->flags & ATA_FLAG_SW_ACTIVITY)) | 312 | if (atadev && ap->ops->sw_activity_show && |
313 | (ap->flags & ATA_FLAG_SW_ACTIVITY)) | ||
313 | return ap->ops->sw_activity_show(atadev, buf); | 314 | return ap->ops->sw_activity_show(atadev, buf); |
314 | return -EINVAL; | 315 | return -EINVAL; |
315 | } | 316 | } |
@@ -324,7 +325,8 @@ ata_scsi_activity_store(struct device *dev, struct device_attribute *attr, | |||
324 | enum sw_activity val; | 325 | enum sw_activity val; |
325 | int rc; | 326 | int rc; |
326 | 327 | ||
327 | if (ap->ops->sw_activity_store && (ap->flags & ATA_FLAG_SW_ACTIVITY)) { | 328 | if (atadev && ap->ops->sw_activity_store && |
329 | (ap->flags & ATA_FLAG_SW_ACTIVITY)) { | ||
328 | val = simple_strtoul(buf, NULL, 0); | 330 | val = simple_strtoul(buf, NULL, 0); |
329 | switch (val) { | 331 | switch (val) { |
330 | case OFF: case BLINK_ON: case BLINK_OFF: | 332 | case OFF: case BLINK_ON: case BLINK_OFF: |
diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c index 371fd2c698b7..9764e80f9320 100644 --- a/drivers/ata/pata_arasan_cf.c +++ b/drivers/ata/pata_arasan_cf.c | |||
@@ -674,13 +674,16 @@ void arasan_cf_error_handler(struct ata_port *ap) | |||
674 | 674 | ||
675 | static void arasan_cf_dma_start(struct arasan_cf_dev *acdev) | 675 | static void arasan_cf_dma_start(struct arasan_cf_dev *acdev) |
676 | { | 676 | { |
677 | struct ata_queued_cmd *qc = acdev->qc; | ||
678 | struct ata_port *ap = qc->ap; | ||
679 | struct ata_taskfile *tf = &qc->tf; | ||
677 | u32 xfer_ctr = readl(acdev->vbase + XFER_CTR) & ~XFER_DIR_MASK; | 680 | u32 xfer_ctr = readl(acdev->vbase + XFER_CTR) & ~XFER_DIR_MASK; |
678 | u32 write = acdev->qc->tf.flags & ATA_TFLAG_WRITE; | 681 | u32 write = tf->flags & ATA_TFLAG_WRITE; |
679 | 682 | ||
680 | xfer_ctr |= write ? XFER_WRITE : XFER_READ; | 683 | xfer_ctr |= write ? XFER_WRITE : XFER_READ; |
681 | writel(xfer_ctr, acdev->vbase + XFER_CTR); | 684 | writel(xfer_ctr, acdev->vbase + XFER_CTR); |
682 | 685 | ||
683 | acdev->qc->ap->ops->sff_exec_command(acdev->qc->ap, &acdev->qc->tf); | 686 | ap->ops->sff_exec_command(ap, tf); |
684 | ata_sff_queue_work(&acdev->work); | 687 | ata_sff_queue_work(&acdev->work); |
685 | } | 688 | } |
686 | 689 | ||
diff --git a/drivers/ata/pata_cmd64x.c b/drivers/ata/pata_cmd64x.c index 7ba01415b676..2949cfc2dd31 100644 --- a/drivers/ata/pata_cmd64x.c +++ b/drivers/ata/pata_cmd64x.c | |||
@@ -474,14 +474,14 @@ static int cmd64x_init_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
474 | /* check for enabled ports */ | 474 | /* check for enabled ports */ |
475 | pci_read_config_byte(pdev, CNTRL, ®); | 475 | pci_read_config_byte(pdev, CNTRL, ®); |
476 | if (!port_ok) | 476 | if (!port_ok) |
477 | dev_printk(KERN_NOTICE, &pdev->dev, "Mobility Bridge detected, ignoring CNTRL port enable/disable\n"); | 477 | dev_notice(&pdev->dev, "Mobility Bridge detected, ignoring CNTRL port enable/disable\n"); |
478 | if (port_ok && cntrl_ch0_ok && !(reg & CNTRL_CH0)) { | 478 | if (port_ok && cntrl_ch0_ok && !(reg & CNTRL_CH0)) { |
479 | dev_printk(KERN_NOTICE, &pdev->dev, "Primary port is disabled\n"); | 479 | dev_notice(&pdev->dev, "Primary port is disabled\n"); |
480 | ppi[0] = &ata_dummy_port_info; | 480 | ppi[0] = &ata_dummy_port_info; |
481 | 481 | ||
482 | } | 482 | } |
483 | if (port_ok && !(reg & CNTRL_CH1)) { | 483 | if (port_ok && !(reg & CNTRL_CH1)) { |
484 | dev_printk(KERN_NOTICE, &pdev->dev, "Secondary port is disabled\n"); | 484 | dev_notice(&pdev->dev, "Secondary port is disabled\n"); |
485 | ppi[1] = &ata_dummy_port_info; | 485 | ppi[1] = &ata_dummy_port_info; |
486 | } | 486 | } |
487 | 487 | ||
diff --git a/drivers/ata/pata_cs5536.c b/drivers/ata/pata_cs5536.c index dec1b6c4b351..0448860a2077 100644 --- a/drivers/ata/pata_cs5536.c +++ b/drivers/ata/pata_cs5536.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include <linux/delay.h> | 38 | #include <linux/delay.h> |
39 | #include <linux/libata.h> | 39 | #include <linux/libata.h> |
40 | #include <scsi/scsi_host.h> | 40 | #include <scsi/scsi_host.h> |
41 | #include <linux/dmi.h> | ||
41 | 42 | ||
42 | #ifdef CONFIG_X86_32 | 43 | #ifdef CONFIG_X86_32 |
43 | #include <asm/msr.h> | 44 | #include <asm/msr.h> |
@@ -80,6 +81,21 @@ enum { | |||
80 | IDE_ETC_UDMA_MASK = 0xc0, | 81 | IDE_ETC_UDMA_MASK = 0xc0, |
81 | }; | 82 | }; |
82 | 83 | ||
84 | /* Some Bachmann OT200 devices have a non working UDMA support due a | ||
85 | * missing resistor. | ||
86 | */ | ||
87 | static const struct dmi_system_id udma_quirk_dmi_table[] = { | ||
88 | { | ||
89 | .ident = "Bachmann electronic OT200", | ||
90 | .matches = { | ||
91 | DMI_MATCH(DMI_SYS_VENDOR, "Bachmann electronic"), | ||
92 | DMI_MATCH(DMI_PRODUCT_NAME, "OT200"), | ||
93 | DMI_MATCH(DMI_PRODUCT_VERSION, "1") | ||
94 | }, | ||
95 | }, | ||
96 | { } | ||
97 | }; | ||
98 | |||
83 | static int cs5536_read(struct pci_dev *pdev, int reg, u32 *val) | 99 | static int cs5536_read(struct pci_dev *pdev, int reg, u32 *val) |
84 | { | 100 | { |
85 | if (unlikely(use_msr)) { | 101 | if (unlikely(use_msr)) { |
@@ -242,9 +258,23 @@ static int cs5536_init_one(struct pci_dev *dev, const struct pci_device_id *id) | |||
242 | .port_ops = &cs5536_port_ops, | 258 | .port_ops = &cs5536_port_ops, |
243 | }; | 259 | }; |
244 | 260 | ||
245 | const struct ata_port_info *ppi[] = { &info, &ata_dummy_port_info }; | 261 | static const struct ata_port_info no_udma_info = { |
262 | .flags = ATA_FLAG_SLAVE_POSS, | ||
263 | .pio_mask = ATA_PIO4, | ||
264 | .port_ops = &cs5536_port_ops, | ||
265 | }; | ||
266 | |||
267 | |||
268 | const struct ata_port_info *ppi[2]; | ||
246 | u32 cfg; | 269 | u32 cfg; |
247 | 270 | ||
271 | if (dmi_check_system(udma_quirk_dmi_table)) | ||
272 | ppi[0] = &no_udma_info; | ||
273 | else | ||
274 | ppi[0] = &info; | ||
275 | |||
276 | ppi[1] = &ata_dummy_port_info; | ||
277 | |||
248 | if (use_msr) | 278 | if (use_msr) |
249 | printk(KERN_ERR DRV_NAME ": Using MSR regs instead of PCI\n"); | 279 | printk(KERN_ERR DRV_NAME ": Using MSR regs instead of PCI\n"); |
250 | 280 | ||
diff --git a/drivers/ata/pata_ep93xx.c b/drivers/ata/pata_ep93xx.c index e056406d6a11..3982cef91f3c 100644 --- a/drivers/ata/pata_ep93xx.c +++ b/drivers/ata/pata_ep93xx.c | |||
@@ -822,8 +822,7 @@ static int ep93xx_pata_softreset(struct ata_link *al, unsigned int *classes, | |||
822 | rc = ep93xx_pata_bus_softreset(ap, devmask, deadline); | 822 | rc = ep93xx_pata_bus_softreset(ap, devmask, deadline); |
823 | /* if link is ocuppied, -ENODEV too is an error */ | 823 | /* if link is ocuppied, -ENODEV too is an error */ |
824 | if (rc && (rc != -ENODEV || sata_scr_valid(al))) { | 824 | if (rc && (rc != -ENODEV || sata_scr_valid(al))) { |
825 | ata_link_printk(al, KERN_ERR, "SRST failed (errno=%d)\n", | 825 | ata_link_err(al, "SRST failed (errno=%d)\n", rc); |
826 | rc); | ||
827 | return rc; | 826 | return rc; |
828 | } | 827 | } |
829 | 828 | ||
@@ -857,8 +856,7 @@ static void ep93xx_pata_drain_fifo(struct ata_queued_cmd *qc) | |||
857 | 856 | ||
858 | /* Can become DEBUG later */ | 857 | /* Can become DEBUG later */ |
859 | if (count) | 858 | if (count) |
860 | ata_port_printk(ap, KERN_DEBUG, | 859 | ata_port_dbg(ap, "drained %d bytes to clear DRQ.\n", count); |
861 | "drained %d bytes to clear DRQ.\n", count); | ||
862 | 860 | ||
863 | } | 861 | } |
864 | 862 | ||
diff --git a/drivers/ata/pata_imx.c b/drivers/ata/pata_imx.c index 87bb05b3cafc..7d40b526ef11 100644 --- a/drivers/ata/pata_imx.c +++ b/drivers/ata/pata_imx.c | |||
@@ -60,7 +60,7 @@ static int pata_imx_set_mode(struct ata_link *link, struct ata_device **unused) | |||
60 | val &= ~PATA_IMX_ATA_CTRL_IORDY_EN; | 60 | val &= ~PATA_IMX_ATA_CTRL_IORDY_EN; |
61 | __raw_writel(val, priv->host_regs + PATA_IMX_ATA_CONTROL); | 61 | __raw_writel(val, priv->host_regs + PATA_IMX_ATA_CONTROL); |
62 | 62 | ||
63 | ata_dev_printk(dev, KERN_INFO, "configured for PIO\n"); | 63 | ata_dev_info(dev, "configured for PIO\n"); |
64 | } | 64 | } |
65 | return 0; | 65 | return 0; |
66 | } | 66 | } |
diff --git a/drivers/ata/pata_ixp4xx_cf.c b/drivers/ata/pata_ixp4xx_cf.c index badb1789a918..0566e67b5e12 100644 --- a/drivers/ata/pata_ixp4xx_cf.c +++ b/drivers/ata/pata_ixp4xx_cf.c | |||
@@ -187,22 +187,13 @@ static __devinit int ixp4xx_pata_probe(struct platform_device *pdev) | |||
187 | return ata_host_activate(host, irq, ata_sff_interrupt, 0, &ixp4xx_sht); | 187 | return ata_host_activate(host, irq, ata_sff_interrupt, 0, &ixp4xx_sht); |
188 | } | 188 | } |
189 | 189 | ||
190 | static __devexit int ixp4xx_pata_remove(struct platform_device *dev) | ||
191 | { | ||
192 | struct ata_host *host = platform_get_drvdata(dev); | ||
193 | |||
194 | ata_host_detach(host); | ||
195 | |||
196 | return 0; | ||
197 | } | ||
198 | |||
199 | static struct platform_driver ixp4xx_pata_platform_driver = { | 190 | static struct platform_driver ixp4xx_pata_platform_driver = { |
200 | .driver = { | 191 | .driver = { |
201 | .name = DRV_NAME, | 192 | .name = DRV_NAME, |
202 | .owner = THIS_MODULE, | 193 | .owner = THIS_MODULE, |
203 | }, | 194 | }, |
204 | .probe = ixp4xx_pata_probe, | 195 | .probe = ixp4xx_pata_probe, |
205 | .remove = __devexit_p(ixp4xx_pata_remove), | 196 | .remove = ata_platform_remove_one, |
206 | }; | 197 | }; |
207 | 198 | ||
208 | module_platform_driver(ixp4xx_pata_platform_driver); | 199 | module_platform_driver(ixp4xx_pata_platform_driver); |
diff --git a/drivers/ata/pata_mpc52xx.c b/drivers/ata/pata_mpc52xx.c index d2c102fd4330..ec67f54dc56f 100644 --- a/drivers/ata/pata_mpc52xx.c +++ b/drivers/ata/pata_mpc52xx.c | |||
@@ -663,18 +663,6 @@ mpc52xx_ata_init_one(struct device *dev, struct mpc52xx_ata_priv *priv, | |||
663 | &mpc52xx_ata_sht); | 663 | &mpc52xx_ata_sht); |
664 | } | 664 | } |
665 | 665 | ||
666 | static struct mpc52xx_ata_priv * | ||
667 | mpc52xx_ata_remove_one(struct device *dev) | ||
668 | { | ||
669 | struct ata_host *host = dev_get_drvdata(dev); | ||
670 | struct mpc52xx_ata_priv *priv = host->private_data; | ||
671 | |||
672 | ata_host_detach(host); | ||
673 | |||
674 | return priv; | ||
675 | } | ||
676 | |||
677 | |||
678 | /* ======================================================================== */ | 666 | /* ======================================================================== */ |
679 | /* OF Platform driver */ | 667 | /* OF Platform driver */ |
680 | /* ======================================================================== */ | 668 | /* ======================================================================== */ |
@@ -815,11 +803,12 @@ mpc52xx_ata_probe(struct platform_device *op) | |||
815 | static int | 803 | static int |
816 | mpc52xx_ata_remove(struct platform_device *op) | 804 | mpc52xx_ata_remove(struct platform_device *op) |
817 | { | 805 | { |
818 | struct mpc52xx_ata_priv *priv; | 806 | struct ata_host *host = platform_get_drvdata(op); |
807 | struct mpc52xx_ata_priv *priv = host->private_data; | ||
819 | int task_irq; | 808 | int task_irq; |
820 | 809 | ||
821 | /* Deregister the ATA interface */ | 810 | /* Deregister the ATA interface */ |
822 | priv = mpc52xx_ata_remove_one(&op->dev); | 811 | ata_platform_remove_one(op); |
823 | 812 | ||
824 | /* Clean up DMA */ | 813 | /* Clean up DMA */ |
825 | task_irq = bcom_get_task_irq(priv->dmatsk); | 814 | task_irq = bcom_get_task_irq(priv->dmatsk); |
diff --git a/drivers/ata/pata_of_platform.c b/drivers/ata/pata_of_platform.c index 1654dc27e7f8..e5b234c370fa 100644 --- a/drivers/ata/pata_of_platform.c +++ b/drivers/ata/pata_of_platform.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/of_address.h> | 14 | #include <linux/of_address.h> |
15 | #include <linux/platform_device.h> | 15 | #include <linux/platform_device.h> |
16 | #include <linux/ata_platform.h> | 16 | #include <linux/ata_platform.h> |
17 | #include <linux/libata.h> | ||
17 | 18 | ||
18 | static int __devinit pata_of_platform_probe(struct platform_device *ofdev) | 19 | static int __devinit pata_of_platform_probe(struct platform_device *ofdev) |
19 | { | 20 | { |
@@ -76,11 +77,6 @@ static int __devinit pata_of_platform_probe(struct platform_device *ofdev) | |||
76 | reg_shift, pio_mask); | 77 | reg_shift, pio_mask); |
77 | } | 78 | } |
78 | 79 | ||
79 | static int __devexit pata_of_platform_remove(struct platform_device *ofdev) | ||
80 | { | ||
81 | return __pata_platform_remove(&ofdev->dev); | ||
82 | } | ||
83 | |||
84 | static struct of_device_id pata_of_platform_match[] = { | 80 | static struct of_device_id pata_of_platform_match[] = { |
85 | { .compatible = "ata-generic", }, | 81 | { .compatible = "ata-generic", }, |
86 | { .compatible = "electra-ide", }, | 82 | { .compatible = "electra-ide", }, |
@@ -95,7 +91,7 @@ static struct platform_driver pata_of_platform_driver = { | |||
95 | .of_match_table = pata_of_platform_match, | 91 | .of_match_table = pata_of_platform_match, |
96 | }, | 92 | }, |
97 | .probe = pata_of_platform_probe, | 93 | .probe = pata_of_platform_probe, |
98 | .remove = __devexit_p(pata_of_platform_remove), | 94 | .remove = ata_platform_remove_one, |
99 | }; | 95 | }; |
100 | 96 | ||
101 | module_platform_driver(pata_of_platform_driver); | 97 | module_platform_driver(pata_of_platform_driver); |
diff --git a/drivers/ata/pata_palmld.c b/drivers/ata/pata_palmld.c index 5ff31b68135c..f9f79fc04a8f 100644 --- a/drivers/ata/pata_palmld.c +++ b/drivers/ata/pata_palmld.c | |||
@@ -111,9 +111,7 @@ err1: | |||
111 | 111 | ||
112 | static __devexit int palmld_pata_remove(struct platform_device *dev) | 112 | static __devexit int palmld_pata_remove(struct platform_device *dev) |
113 | { | 113 | { |
114 | struct ata_host *host = platform_get_drvdata(dev); | 114 | ata_platform_remove_one(dev); |
115 | |||
116 | ata_host_detach(host); | ||
117 | 115 | ||
118 | /* power down the HDD */ | 116 | /* power down the HDD */ |
119 | gpio_set_value(GPIO_NR_PALMLD_IDE_PWEN, 0); | 117 | gpio_set_value(GPIO_NR_PALMLD_IDE_PWEN, 0); |
diff --git a/drivers/ata/pata_platform.c b/drivers/ata/pata_platform.c index f1848aeda783..f4372d0c7ce6 100644 --- a/drivers/ata/pata_platform.c +++ b/drivers/ata/pata_platform.c | |||
@@ -178,23 +178,6 @@ int __devinit __pata_platform_probe(struct device *dev, | |||
178 | } | 178 | } |
179 | EXPORT_SYMBOL_GPL(__pata_platform_probe); | 179 | EXPORT_SYMBOL_GPL(__pata_platform_probe); |
180 | 180 | ||
181 | /** | ||
182 | * __pata_platform_remove - unplug a platform interface | ||
183 | * @dev: device | ||
184 | * | ||
185 | * A platform bus ATA device has been unplugged. Perform the needed | ||
186 | * cleanup. Also called on module unload for any active devices. | ||
187 | */ | ||
188 | int __pata_platform_remove(struct device *dev) | ||
189 | { | ||
190 | struct ata_host *host = dev_get_drvdata(dev); | ||
191 | |||
192 | ata_host_detach(host); | ||
193 | |||
194 | return 0; | ||
195 | } | ||
196 | EXPORT_SYMBOL_GPL(__pata_platform_remove); | ||
197 | |||
198 | static int __devinit pata_platform_probe(struct platform_device *pdev) | 181 | static int __devinit pata_platform_probe(struct platform_device *pdev) |
199 | { | 182 | { |
200 | struct resource *io_res; | 183 | struct resource *io_res; |
@@ -242,14 +225,9 @@ static int __devinit pata_platform_probe(struct platform_device *pdev) | |||
242 | pio_mask); | 225 | pio_mask); |
243 | } | 226 | } |
244 | 227 | ||
245 | static int __devexit pata_platform_remove(struct platform_device *pdev) | ||
246 | { | ||
247 | return __pata_platform_remove(&pdev->dev); | ||
248 | } | ||
249 | |||
250 | static struct platform_driver pata_platform_driver = { | 228 | static struct platform_driver pata_platform_driver = { |
251 | .probe = pata_platform_probe, | 229 | .probe = pata_platform_probe, |
252 | .remove = __devexit_p(pata_platform_remove), | 230 | .remove = ata_platform_remove_one, |
253 | .driver = { | 231 | .driver = { |
254 | .name = DRV_NAME, | 232 | .name = DRV_NAME, |
255 | .owner = THIS_MODULE, | 233 | .owner = THIS_MODULE, |
diff --git a/drivers/ata/pata_rdc.c b/drivers/ata/pata_rdc.c index 32a3499e83e7..e71f998dd90d 100644 --- a/drivers/ata/pata_rdc.c +++ b/drivers/ata/pata_rdc.c | |||
@@ -327,7 +327,6 @@ static int __devinit rdc_init_one(struct pci_dev *pdev, | |||
327 | struct device *dev = &pdev->dev; | 327 | struct device *dev = &pdev->dev; |
328 | struct ata_port_info port_info[2]; | 328 | struct ata_port_info port_info[2]; |
329 | const struct ata_port_info *ppi[] = { &port_info[0], &port_info[1] }; | 329 | const struct ata_port_info *ppi[] = { &port_info[0], &port_info[1] }; |
330 | unsigned long port_flags; | ||
331 | struct ata_host *host; | 330 | struct ata_host *host; |
332 | struct rdc_host_priv *hpriv; | 331 | struct rdc_host_priv *hpriv; |
333 | int rc; | 332 | int rc; |
@@ -337,8 +336,6 @@ static int __devinit rdc_init_one(struct pci_dev *pdev, | |||
337 | port_info[0] = rdc_port_info; | 336 | port_info[0] = rdc_port_info; |
338 | port_info[1] = rdc_port_info; | 337 | port_info[1] = rdc_port_info; |
339 | 338 | ||
340 | port_flags = port_info[0].flags; | ||
341 | |||
342 | /* enable device and prepare host */ | 339 | /* enable device and prepare host */ |
343 | rc = pcim_enable_device(pdev); | 340 | rc = pcim_enable_device(pdev); |
344 | if (rc) | 341 | if (rc) |
diff --git a/drivers/ata/sata_dwc_460ex.c b/drivers/ata/sata_dwc_460ex.c index 937aeb34b310..2e391730e8be 100755..100644 --- a/drivers/ata/sata_dwc_460ex.c +++ b/drivers/ata/sata_dwc_460ex.c | |||
@@ -43,6 +43,7 @@ | |||
43 | /* These two are defined in "libata.h" */ | 43 | /* These two are defined in "libata.h" */ |
44 | #undef DRV_NAME | 44 | #undef DRV_NAME |
45 | #undef DRV_VERSION | 45 | #undef DRV_VERSION |
46 | |||
46 | #define DRV_NAME "sata-dwc" | 47 | #define DRV_NAME "sata-dwc" |
47 | #define DRV_VERSION "1.3" | 48 | #define DRV_VERSION "1.3" |
48 | 49 | ||
diff --git a/drivers/ata/sata_highbank.c b/drivers/ata/sata_highbank.c index 400bf1c3e982..dc7d78eecb19 100644 --- a/drivers/ata/sata_highbank.c +++ b/drivers/ata/sata_highbank.c | |||
@@ -213,7 +213,7 @@ static int ahci_highbank_hardreset(struct ata_link *link, unsigned int *class, | |||
213 | 213 | ||
214 | /* clear D2H reception area to properly wait for D2H FIS */ | 214 | /* clear D2H reception area to properly wait for D2H FIS */ |
215 | ata_tf_init(link->device, &tf); | 215 | ata_tf_init(link->device, &tf); |
216 | tf.command = 0x80; | 216 | tf.command = ATA_BUSY; |
217 | ata_tf_to_fis(&tf, 0, 0, d2h_fis); | 217 | ata_tf_to_fis(&tf, 0, 0, d2h_fis); |
218 | 218 | ||
219 | do { | 219 | do { |
@@ -368,16 +368,6 @@ err0: | |||
368 | return rc; | 368 | return rc; |
369 | } | 369 | } |
370 | 370 | ||
371 | static int __devexit ahci_highbank_remove(struct platform_device *pdev) | ||
372 | { | ||
373 | struct device *dev = &pdev->dev; | ||
374 | struct ata_host *host = dev_get_drvdata(dev); | ||
375 | |||
376 | ata_host_detach(host); | ||
377 | |||
378 | return 0; | ||
379 | } | ||
380 | |||
381 | #ifdef CONFIG_PM_SLEEP | 371 | #ifdef CONFIG_PM_SLEEP |
382 | static int ahci_highbank_suspend(struct device *dev) | 372 | static int ahci_highbank_suspend(struct device *dev) |
383 | { | 373 | { |
@@ -432,7 +422,7 @@ SIMPLE_DEV_PM_OPS(ahci_highbank_pm_ops, | |||
432 | ahci_highbank_suspend, ahci_highbank_resume); | 422 | ahci_highbank_suspend, ahci_highbank_resume); |
433 | 423 | ||
434 | static struct platform_driver ahci_highbank_driver = { | 424 | static struct platform_driver ahci_highbank_driver = { |
435 | .remove = __devexit_p(ahci_highbank_remove), | 425 | .remove = ata_platform_remove_one, |
436 | .driver = { | 426 | .driver = { |
437 | .name = "highbank-ahci", | 427 | .name = "highbank-ahci", |
438 | .owner = THIS_MODULE, | 428 | .owner = THIS_MODULE, |
diff --git a/drivers/ata/sata_inic162x.c b/drivers/ata/sata_inic162x.c index dc35f4d42b8b..1e6827c89429 100644 --- a/drivers/ata/sata_inic162x.c +++ b/drivers/ata/sata_inic162x.c | |||
@@ -273,12 +273,10 @@ static void inic_reset_port(void __iomem *port_base) | |||
273 | static int inic_scr_read(struct ata_link *link, unsigned sc_reg, u32 *val) | 273 | static int inic_scr_read(struct ata_link *link, unsigned sc_reg, u32 *val) |
274 | { | 274 | { |
275 | void __iomem *scr_addr = inic_port_base(link->ap) + PORT_SCR; | 275 | void __iomem *scr_addr = inic_port_base(link->ap) + PORT_SCR; |
276 | void __iomem *addr; | ||
277 | 276 | ||
278 | if (unlikely(sc_reg >= ARRAY_SIZE(scr_map))) | 277 | if (unlikely(sc_reg >= ARRAY_SIZE(scr_map))) |
279 | return -EINVAL; | 278 | return -EINVAL; |
280 | 279 | ||
281 | addr = scr_addr + scr_map[sc_reg] * 4; | ||
282 | *val = readl(scr_addr + scr_map[sc_reg] * 4); | 280 | *val = readl(scr_addr + scr_map[sc_reg] * 4); |
283 | 281 | ||
284 | /* this controller has stuck DIAG.N, ignore it */ | 282 | /* this controller has stuck DIAG.N, ignore it */ |
diff --git a/drivers/ata/sata_promise.c b/drivers/ata/sata_promise.c index 489c81768321..fb0dd87f8893 100644 --- a/drivers/ata/sata_promise.c +++ b/drivers/ata/sata_promise.c | |||
@@ -147,6 +147,10 @@ struct pdc_port_priv { | |||
147 | dma_addr_t pkt_dma; | 147 | dma_addr_t pkt_dma; |
148 | }; | 148 | }; |
149 | 149 | ||
150 | struct pdc_host_priv { | ||
151 | spinlock_t hard_reset_lock; | ||
152 | }; | ||
153 | |||
150 | static int pdc_sata_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val); | 154 | static int pdc_sata_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val); |
151 | static int pdc_sata_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val); | 155 | static int pdc_sata_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val); |
152 | static int pdc_ata_init_one(struct pci_dev *pdev, const struct pci_device_id *ent); | 156 | static int pdc_ata_init_one(struct pci_dev *pdev, const struct pci_device_id *ent); |
@@ -801,9 +805,10 @@ static void pdc_hard_reset_port(struct ata_port *ap) | |||
801 | void __iomem *host_mmio = ap->host->iomap[PDC_MMIO_BAR]; | 805 | void __iomem *host_mmio = ap->host->iomap[PDC_MMIO_BAR]; |
802 | void __iomem *pcictl_b1_mmio = host_mmio + PDC_PCI_CTL + 1; | 806 | void __iomem *pcictl_b1_mmio = host_mmio + PDC_PCI_CTL + 1; |
803 | unsigned int ata_no = pdc_ata_port_to_ata_no(ap); | 807 | unsigned int ata_no = pdc_ata_port_to_ata_no(ap); |
808 | struct pdc_host_priv *hpriv = ap->host->private_data; | ||
804 | u8 tmp; | 809 | u8 tmp; |
805 | 810 | ||
806 | spin_lock(&ap->host->lock); | 811 | spin_lock(&hpriv->hard_reset_lock); |
807 | 812 | ||
808 | tmp = readb(pcictl_b1_mmio); | 813 | tmp = readb(pcictl_b1_mmio); |
809 | tmp &= ~(0x10 << ata_no); | 814 | tmp &= ~(0x10 << ata_no); |
@@ -814,7 +819,7 @@ static void pdc_hard_reset_port(struct ata_port *ap) | |||
814 | writeb(tmp, pcictl_b1_mmio); | 819 | writeb(tmp, pcictl_b1_mmio); |
815 | readb(pcictl_b1_mmio); /* flush */ | 820 | readb(pcictl_b1_mmio); /* flush */ |
816 | 821 | ||
817 | spin_unlock(&ap->host->lock); | 822 | spin_unlock(&hpriv->hard_reset_lock); |
818 | } | 823 | } |
819 | 824 | ||
820 | static int pdc_sata_hardreset(struct ata_link *link, unsigned int *class, | 825 | static int pdc_sata_hardreset(struct ata_link *link, unsigned int *class, |
@@ -1182,6 +1187,7 @@ static int pdc_ata_init_one(struct pci_dev *pdev, | |||
1182 | const struct ata_port_info *pi = &pdc_port_info[ent->driver_data]; | 1187 | const struct ata_port_info *pi = &pdc_port_info[ent->driver_data]; |
1183 | const struct ata_port_info *ppi[PDC_MAX_PORTS]; | 1188 | const struct ata_port_info *ppi[PDC_MAX_PORTS]; |
1184 | struct ata_host *host; | 1189 | struct ata_host *host; |
1190 | struct pdc_host_priv *hpriv; | ||
1185 | void __iomem *host_mmio; | 1191 | void __iomem *host_mmio; |
1186 | int n_ports, i, rc; | 1192 | int n_ports, i, rc; |
1187 | int is_sataii_tx4; | 1193 | int is_sataii_tx4; |
@@ -1218,6 +1224,11 @@ static int pdc_ata_init_one(struct pci_dev *pdev, | |||
1218 | dev_err(&pdev->dev, "failed to allocate host\n"); | 1224 | dev_err(&pdev->dev, "failed to allocate host\n"); |
1219 | return -ENOMEM; | 1225 | return -ENOMEM; |
1220 | } | 1226 | } |
1227 | hpriv = devm_kzalloc(&pdev->dev, sizeof *hpriv, GFP_KERNEL); | ||
1228 | if (!hpriv) | ||
1229 | return -ENOMEM; | ||
1230 | spin_lock_init(&hpriv->hard_reset_lock); | ||
1231 | host->private_data = hpriv; | ||
1221 | host->iomap = pcim_iomap_table(pdev); | 1232 | host->iomap = pcim_iomap_table(pdev); |
1222 | 1233 | ||
1223 | is_sataii_tx4 = pdc_is_sataii_tx4(pi->flags); | 1234 | is_sataii_tx4 = pdc_is_sataii_tx4(pi->flags); |
diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c index a5f2a563a26a..59f0d630d634 100644 --- a/drivers/ata/sata_sil24.c +++ b/drivers/ata/sata_sil24.c | |||
@@ -506,8 +506,6 @@ static int sil24_scr_read(struct ata_link *link, unsigned sc_reg, u32 *val) | |||
506 | void __iomem *scr_addr = sil24_port_base(link->ap) + PORT_SCONTROL; | 506 | void __iomem *scr_addr = sil24_port_base(link->ap) + PORT_SCONTROL; |
507 | 507 | ||
508 | if (sc_reg < ARRAY_SIZE(sil24_scr_map)) { | 508 | if (sc_reg < ARRAY_SIZE(sil24_scr_map)) { |
509 | void __iomem *addr; | ||
510 | addr = scr_addr + sil24_scr_map[sc_reg] * 4; | ||
511 | *val = readl(scr_addr + sil24_scr_map[sc_reg] * 4); | 509 | *val = readl(scr_addr + sil24_scr_map[sc_reg] * 4); |
512 | return 0; | 510 | return 0; |
513 | } | 511 | } |
@@ -519,8 +517,6 @@ static int sil24_scr_write(struct ata_link *link, unsigned sc_reg, u32 val) | |||
519 | void __iomem *scr_addr = sil24_port_base(link->ap) + PORT_SCONTROL; | 517 | void __iomem *scr_addr = sil24_port_base(link->ap) + PORT_SCONTROL; |
520 | 518 | ||
521 | if (sc_reg < ARRAY_SIZE(sil24_scr_map)) { | 519 | if (sc_reg < ARRAY_SIZE(sil24_scr_map)) { |
522 | void __iomem *addr; | ||
523 | addr = scr_addr + sil24_scr_map[sc_reg] * 4; | ||
524 | writel(val, scr_addr + sil24_scr_map[sc_reg] * 4); | 520 | writel(val, scr_addr + sil24_scr_map[sc_reg] * 4); |
525 | return 0; | 521 | return 0; |
526 | } | 522 | } |
diff --git a/drivers/ata/sata_sx4.c b/drivers/ata/sata_sx4.c index 122605593166..7b7127a58f51 100644 --- a/drivers/ata/sata_sx4.c +++ b/drivers/ata/sata_sx4.c | |||
@@ -315,9 +315,8 @@ static int pdc_port_start(struct ata_port *ap) | |||
315 | return 0; | 315 | return 0; |
316 | } | 316 | } |
317 | 317 | ||
318 | static inline void pdc20621_ata_sg(struct ata_taskfile *tf, u8 *buf, | 318 | static inline void pdc20621_ata_sg(u8 *buf, unsigned int portno, |
319 | unsigned int portno, | 319 | unsigned int total_len) |
320 | unsigned int total_len) | ||
321 | { | 320 | { |
322 | u32 addr; | 321 | u32 addr; |
323 | unsigned int dw = PDC_DIMM_APKT_PRD >> 2; | 322 | unsigned int dw = PDC_DIMM_APKT_PRD >> 2; |
@@ -337,9 +336,8 @@ static inline void pdc20621_ata_sg(struct ata_taskfile *tf, u8 *buf, | |||
337 | buf32[dw], buf32[dw + 1]); | 336 | buf32[dw], buf32[dw + 1]); |
338 | } | 337 | } |
339 | 338 | ||
340 | static inline void pdc20621_host_sg(struct ata_taskfile *tf, u8 *buf, | 339 | static inline void pdc20621_host_sg(u8 *buf, unsigned int portno, |
341 | unsigned int portno, | 340 | unsigned int total_len) |
342 | unsigned int total_len) | ||
343 | { | 341 | { |
344 | u32 addr; | 342 | u32 addr; |
345 | unsigned int dw = PDC_DIMM_HPKT_PRD >> 2; | 343 | unsigned int dw = PDC_DIMM_HPKT_PRD >> 2; |
@@ -486,10 +484,10 @@ static void pdc20621_dma_prep(struct ata_queued_cmd *qc) | |||
486 | /* | 484 | /* |
487 | * Build ATA, host DMA packets | 485 | * Build ATA, host DMA packets |
488 | */ | 486 | */ |
489 | pdc20621_host_sg(&qc->tf, &pp->dimm_buf[0], portno, total_len); | 487 | pdc20621_host_sg(&pp->dimm_buf[0], portno, total_len); |
490 | pdc20621_host_pkt(&qc->tf, &pp->dimm_buf[0], portno); | 488 | pdc20621_host_pkt(&qc->tf, &pp->dimm_buf[0], portno); |
491 | 489 | ||
492 | pdc20621_ata_sg(&qc->tf, &pp->dimm_buf[0], portno, total_len); | 490 | pdc20621_ata_sg(&pp->dimm_buf[0], portno, total_len); |
493 | i = pdc20621_ata_pkt(&qc->tf, qc->dev->devno, &pp->dimm_buf[0], portno); | 491 | i = pdc20621_ata_pkt(&qc->tf, qc->dev->devno, &pp->dimm_buf[0], portno); |
494 | 492 | ||
495 | if (qc->tf.flags & ATA_TFLAG_LBA48) | 493 | if (qc->tf.flags & ATA_TFLAG_LBA48) |
diff --git a/include/linux/ata_platform.h b/include/linux/ata_platform.h index b856a2a590d9..fe9989636b62 100644 --- a/include/linux/ata_platform.h +++ b/include/linux/ata_platform.h | |||
@@ -22,8 +22,6 @@ extern int __devinit __pata_platform_probe(struct device *dev, | |||
22 | unsigned int ioport_shift, | 22 | unsigned int ioport_shift, |
23 | int __pio_mask); | 23 | int __pio_mask); |
24 | 24 | ||
25 | extern int __devexit __pata_platform_remove(struct device *dev); | ||
26 | |||
27 | /* | 25 | /* |
28 | * Marvell SATA private data | 26 | * Marvell SATA private data |
29 | */ | 27 | */ |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 77eeeda2b6e2..83ba0ab2c915 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -163,6 +163,7 @@ enum { | |||
163 | 163 | ||
164 | ATA_DFLAG_DA = (1 << 26), /* device supports Device Attention */ | 164 | ATA_DFLAG_DA = (1 << 26), /* device supports Device Attention */ |
165 | ATA_DFLAG_DEVSLP = (1 << 27), /* device supports Device Sleep */ | 165 | ATA_DFLAG_DEVSLP = (1 << 27), /* device supports Device Sleep */ |
166 | ATA_DFLAG_ACPI_DISABLED = (1 << 28), /* ACPI for the device is disabled */ | ||
166 | 167 | ||
167 | ATA_DEV_UNKNOWN = 0, /* unknown device */ | 168 | ATA_DEV_UNKNOWN = 0, /* unknown device */ |
168 | ATA_DEV_ATA = 1, /* ATA device */ | 169 | ATA_DEV_ATA = 1, /* ATA device */ |
@@ -1114,6 +1115,10 @@ extern int ata_pci_device_resume(struct pci_dev *pdev); | |||
1114 | #endif /* CONFIG_PM */ | 1115 | #endif /* CONFIG_PM */ |
1115 | #endif /* CONFIG_PCI */ | 1116 | #endif /* CONFIG_PCI */ |
1116 | 1117 | ||
1118 | struct platform_device; | ||
1119 | |||
1120 | extern int ata_platform_remove_one(struct platform_device *pdev); | ||
1121 | |||
1117 | /* | 1122 | /* |
1118 | * ACPI - drivers/ata/libata-acpi.c | 1123 | * ACPI - drivers/ata/libata-acpi.c |
1119 | */ | 1124 | */ |