diff options
Diffstat (limited to 'drivers/ata')
-rw-r--r-- | drivers/ata/Kconfig | 22 | ||||
-rw-r--r-- | drivers/ata/Makefile | 2 | ||||
-rw-r--r-- | drivers/ata/libata-core.c | 24 | ||||
-rw-r--r-- | drivers/ata/libata-eh.c | 17 | ||||
-rw-r--r-- | drivers/ata/libata-scsi.c | 19 | ||||
-rw-r--r-- | drivers/ata/libata-sff.c | 7 | ||||
-rw-r--r-- | drivers/ata/pata_cs5536.c | 18 | ||||
-rw-r--r-- | drivers/ata/sata_via.c | 9 |
8 files changed, 70 insertions, 48 deletions
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig index 11ec911016c6..36e2319264bd 100644 --- a/drivers/ata/Kconfig +++ b/drivers/ata/Kconfig | |||
@@ -128,16 +128,6 @@ config PDC_ADMA | |||
128 | 128 | ||
129 | If unsure, say N. | 129 | If unsure, say N. |
130 | 130 | ||
131 | config PATA_MPC52xx | ||
132 | tristate "Freescale MPC52xx SoC internal IDE" | ||
133 | depends on PPC_MPC52xx && PPC_BESTCOMM | ||
134 | select PPC_BESTCOMM_ATA | ||
135 | help | ||
136 | This option enables support for integrated IDE controller | ||
137 | of the Freescale MPC52xx SoC. | ||
138 | |||
139 | If unsure, say N. | ||
140 | |||
141 | config PATA_OCTEON_CF | 131 | config PATA_OCTEON_CF |
142 | tristate "OCTEON Boot Bus Compact Flash support" | 132 | tristate "OCTEON Boot Bus Compact Flash support" |
143 | depends on CPU_CAVIUM_OCTEON | 133 | depends on CPU_CAVIUM_OCTEON |
@@ -366,7 +356,7 @@ config PATA_CS5535 | |||
366 | 356 | ||
367 | config PATA_CS5536 | 357 | config PATA_CS5536 |
368 | tristate "CS5536 PATA support" | 358 | tristate "CS5536 PATA support" |
369 | depends on PCI && X86 && !X86_64 | 359 | depends on PCI |
370 | help | 360 | help |
371 | This option enables support for the AMD CS5536 | 361 | This option enables support for the AMD CS5536 |
372 | companion chip used with the Geode LX processor family. | 362 | companion chip used with the Geode LX processor family. |
@@ -491,6 +481,16 @@ config PATA_MARVELL | |||
491 | 481 | ||
492 | If unsure, say N. | 482 | If unsure, say N. |
493 | 483 | ||
484 | config PATA_MPC52xx | ||
485 | tristate "Freescale MPC52xx SoC internal IDE" | ||
486 | depends on PPC_MPC52xx && PPC_BESTCOMM | ||
487 | select PPC_BESTCOMM_ATA | ||
488 | help | ||
489 | This option enables support for integrated IDE controller | ||
490 | of the Freescale MPC52xx SoC. | ||
491 | |||
492 | If unsure, say N. | ||
493 | |||
494 | config PATA_NETCELL | 494 | config PATA_NETCELL |
495 | tristate "NETCELL Revolution RAID support" | 495 | tristate "NETCELL Revolution RAID support" |
496 | depends on PCI | 496 | depends on PCI |
diff --git a/drivers/ata/Makefile b/drivers/ata/Makefile index c501af5b12b9..2b67c900a459 100644 --- a/drivers/ata/Makefile +++ b/drivers/ata/Makefile | |||
@@ -11,7 +11,6 @@ obj-$(CONFIG_SATA_DWC) += sata_dwc_460ex.o | |||
11 | 11 | ||
12 | # SFF w/ custom DMA | 12 | # SFF w/ custom DMA |
13 | obj-$(CONFIG_PDC_ADMA) += pdc_adma.o | 13 | obj-$(CONFIG_PDC_ADMA) += pdc_adma.o |
14 | obj-$(CONFIG_PATA_MPC52xx) += pata_mpc52xx.o | ||
15 | obj-$(CONFIG_PATA_OCTEON_CF) += pata_octeon_cf.o | 14 | obj-$(CONFIG_PATA_OCTEON_CF) += pata_octeon_cf.o |
16 | obj-$(CONFIG_SATA_QSTOR) += sata_qstor.o | 15 | obj-$(CONFIG_SATA_QSTOR) += sata_qstor.o |
17 | obj-$(CONFIG_SATA_SX4) += sata_sx4.o | 16 | obj-$(CONFIG_SATA_SX4) += sata_sx4.o |
@@ -52,6 +51,7 @@ obj-$(CONFIG_PATA_IT821X) += pata_it821x.o | |||
52 | obj-$(CONFIG_PATA_JMICRON) += pata_jmicron.o | 51 | obj-$(CONFIG_PATA_JMICRON) += pata_jmicron.o |
53 | obj-$(CONFIG_PATA_MACIO) += pata_macio.o | 52 | obj-$(CONFIG_PATA_MACIO) += pata_macio.o |
54 | obj-$(CONFIG_PATA_MARVELL) += pata_marvell.o | 53 | obj-$(CONFIG_PATA_MARVELL) += pata_marvell.o |
54 | obj-$(CONFIG_PATA_MPC52xx) += pata_mpc52xx.o | ||
55 | obj-$(CONFIG_PATA_NETCELL) += pata_netcell.o | 55 | obj-$(CONFIG_PATA_NETCELL) += pata_netcell.o |
56 | obj-$(CONFIG_PATA_NINJA32) += pata_ninja32.o | 56 | obj-$(CONFIG_PATA_NINJA32) += pata_ninja32.o |
57 | obj-$(CONFIG_PATA_NS87415) += pata_ns87415.o | 57 | obj-$(CONFIG_PATA_NS87415) += pata_ns87415.o |
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 7f77c67d267c..f23d6d46b95b 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -4807,9 +4807,6 @@ static void ata_verify_xfer(struct ata_queued_cmd *qc) | |||
4807 | { | 4807 | { |
4808 | struct ata_device *dev = qc->dev; | 4808 | struct ata_device *dev = qc->dev; |
4809 | 4809 | ||
4810 | if (ata_tag_internal(qc->tag)) | ||
4811 | return; | ||
4812 | |||
4813 | if (ata_is_nodata(qc->tf.protocol)) | 4810 | if (ata_is_nodata(qc->tf.protocol)) |
4814 | return; | 4811 | return; |
4815 | 4812 | ||
@@ -4858,14 +4855,23 @@ void ata_qc_complete(struct ata_queued_cmd *qc) | |||
4858 | if (unlikely(qc->err_mask)) | 4855 | if (unlikely(qc->err_mask)) |
4859 | qc->flags |= ATA_QCFLAG_FAILED; | 4856 | qc->flags |= ATA_QCFLAG_FAILED; |
4860 | 4857 | ||
4861 | if (unlikely(qc->flags & ATA_QCFLAG_FAILED)) { | 4858 | /* |
4862 | /* always fill result TF for failed qc */ | 4859 | * Finish internal commands without any further processing |
4860 | * and always with the result TF filled. | ||
4861 | */ | ||
4862 | if (unlikely(ata_tag_internal(qc->tag))) { | ||
4863 | fill_result_tf(qc); | 4863 | fill_result_tf(qc); |
4864 | __ata_qc_complete(qc); | ||
4865 | return; | ||
4866 | } | ||
4864 | 4867 | ||
4865 | if (!ata_tag_internal(qc->tag)) | 4868 | /* |
4866 | ata_qc_schedule_eh(qc); | 4869 | * Non-internal qc has failed. Fill the result TF and |
4867 | else | 4870 | * summon EH. |
4868 | __ata_qc_complete(qc); | 4871 | */ |
4872 | if (unlikely(qc->flags & ATA_QCFLAG_FAILED)) { | ||
4873 | fill_result_tf(qc); | ||
4874 | ata_qc_schedule_eh(qc); | ||
4869 | return; | 4875 | return; |
4870 | } | 4876 | } |
4871 | 4877 | ||
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 5e590504f3aa..17a637877d03 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c | |||
@@ -3275,6 +3275,7 @@ static int ata_eh_set_lpm(struct ata_link *link, enum ata_lpm_policy policy, | |||
3275 | struct ata_port *ap = ata_is_host_link(link) ? link->ap : NULL; | 3275 | struct ata_port *ap = ata_is_host_link(link) ? link->ap : NULL; |
3276 | struct ata_eh_context *ehc = &link->eh_context; | 3276 | struct ata_eh_context *ehc = &link->eh_context; |
3277 | struct ata_device *dev, *link_dev = NULL, *lpm_dev = NULL; | 3277 | struct ata_device *dev, *link_dev = NULL, *lpm_dev = NULL; |
3278 | enum ata_lpm_policy old_policy = link->lpm_policy; | ||
3278 | unsigned int hints = ATA_LPM_EMPTY | ATA_LPM_HIPM; | 3279 | unsigned int hints = ATA_LPM_EMPTY | ATA_LPM_HIPM; |
3279 | unsigned int err_mask; | 3280 | unsigned int err_mask; |
3280 | int rc; | 3281 | int rc; |
@@ -3338,6 +3339,14 @@ static int ata_eh_set_lpm(struct ata_link *link, enum ata_lpm_policy policy, | |||
3338 | goto fail; | 3339 | goto fail; |
3339 | } | 3340 | } |
3340 | 3341 | ||
3342 | /* | ||
3343 | * Low level driver acked the transition. Issue DIPM command | ||
3344 | * with the new policy set. | ||
3345 | */ | ||
3346 | link->lpm_policy = policy; | ||
3347 | if (ap && ap->slave_link) | ||
3348 | ap->slave_link->lpm_policy = policy; | ||
3349 | |||
3341 | /* host config updated, enable DIPM if transitioning to MIN_POWER */ | 3350 | /* host config updated, enable DIPM if transitioning to MIN_POWER */ |
3342 | ata_for_each_dev(dev, link, ENABLED) { | 3351 | ata_for_each_dev(dev, link, ENABLED) { |
3343 | if (policy == ATA_LPM_MIN_POWER && ata_id_has_dipm(dev->id)) { | 3352 | if (policy == ATA_LPM_MIN_POWER && ata_id_has_dipm(dev->id)) { |
@@ -3353,12 +3362,14 @@ static int ata_eh_set_lpm(struct ata_link *link, enum ata_lpm_policy policy, | |||
3353 | } | 3362 | } |
3354 | } | 3363 | } |
3355 | 3364 | ||
3356 | link->lpm_policy = policy; | ||
3357 | if (ap && ap->slave_link) | ||
3358 | ap->slave_link->lpm_policy = policy; | ||
3359 | return 0; | 3365 | return 0; |
3360 | 3366 | ||
3361 | fail: | 3367 | fail: |
3368 | /* restore the old policy */ | ||
3369 | link->lpm_policy = old_policy; | ||
3370 | if (ap && ap->slave_link) | ||
3371 | ap->slave_link->lpm_policy = old_policy; | ||
3372 | |||
3362 | /* if no device or only one more chance is left, disable LPM */ | 3373 | /* if no device or only one more chance is left, disable LPM */ |
3363 | if (!dev || ehc->tries[dev->devno] <= 2) { | 3374 | if (!dev || ehc->tries[dev->devno] <= 2) { |
3364 | ata_link_printk(link, KERN_WARNING, | 3375 | ata_link_printk(link, KERN_WARNING, |
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 3f91c01c217f..66aa4bee80a6 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -3166,8 +3166,8 @@ static inline int __ata_scsi_queuecmd(struct scsi_cmnd *scmd, | |||
3166 | 3166 | ||
3167 | /** | 3167 | /** |
3168 | * ata_scsi_queuecmd - Issue SCSI cdb to libata-managed device | 3168 | * ata_scsi_queuecmd - Issue SCSI cdb to libata-managed device |
3169 | * @shost: SCSI host of command to be sent | ||
3169 | * @cmd: SCSI command to be sent | 3170 | * @cmd: SCSI command to be sent |
3170 | * @done: Completion function, called when command is complete | ||
3171 | * | 3171 | * |
3172 | * In some cases, this function translates SCSI commands into | 3172 | * In some cases, this function translates SCSI commands into |
3173 | * ATA taskfiles, and queues the taskfiles to be sent to | 3173 | * ATA taskfiles, and queues the taskfiles to be sent to |
@@ -3177,37 +3177,36 @@ static inline int __ata_scsi_queuecmd(struct scsi_cmnd *scmd, | |||
3177 | * ATA and ATAPI devices appearing as SCSI devices. | 3177 | * ATA and ATAPI devices appearing as SCSI devices. |
3178 | * | 3178 | * |
3179 | * LOCKING: | 3179 | * LOCKING: |
3180 | * Releases scsi-layer-held lock, and obtains host lock. | 3180 | * ATA host lock |
3181 | * | 3181 | * |
3182 | * RETURNS: | 3182 | * RETURNS: |
3183 | * Return value from __ata_scsi_queuecmd() if @cmd can be queued, | 3183 | * Return value from __ata_scsi_queuecmd() if @cmd can be queued, |
3184 | * 0 otherwise. | 3184 | * 0 otherwise. |
3185 | */ | 3185 | */ |
3186 | int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) | 3186 | int ata_scsi_queuecmd(struct Scsi_Host *shost, struct scsi_cmnd *cmd) |
3187 | { | 3187 | { |
3188 | struct ata_port *ap; | 3188 | struct ata_port *ap; |
3189 | struct ata_device *dev; | 3189 | struct ata_device *dev; |
3190 | struct scsi_device *scsidev = cmd->device; | 3190 | struct scsi_device *scsidev = cmd->device; |
3191 | struct Scsi_Host *shost = scsidev->host; | ||
3192 | int rc = 0; | 3191 | int rc = 0; |
3192 | unsigned long irq_flags; | ||
3193 | 3193 | ||
3194 | ap = ata_shost_to_port(shost); | 3194 | ap = ata_shost_to_port(shost); |
3195 | 3195 | ||
3196 | spin_unlock(shost->host_lock); | 3196 | spin_lock_irqsave(ap->lock, irq_flags); |
3197 | spin_lock(ap->lock); | ||
3198 | 3197 | ||
3199 | ata_scsi_dump_cdb(ap, cmd); | 3198 | ata_scsi_dump_cdb(ap, cmd); |
3200 | 3199 | ||
3201 | dev = ata_scsi_find_dev(ap, scsidev); | 3200 | dev = ata_scsi_find_dev(ap, scsidev); |
3202 | if (likely(dev)) | 3201 | if (likely(dev)) |
3203 | rc = __ata_scsi_queuecmd(cmd, done, dev); | 3202 | rc = __ata_scsi_queuecmd(cmd, cmd->scsi_done, dev); |
3204 | else { | 3203 | else { |
3205 | cmd->result = (DID_BAD_TARGET << 16); | 3204 | cmd->result = (DID_BAD_TARGET << 16); |
3206 | done(cmd); | 3205 | cmd->scsi_done(cmd); |
3207 | } | 3206 | } |
3208 | 3207 | ||
3209 | spin_unlock(ap->lock); | 3208 | spin_unlock_irqrestore(ap->lock, irq_flags); |
3210 | spin_lock(shost->host_lock); | 3209 | |
3211 | return rc; | 3210 | return rc; |
3212 | } | 3211 | } |
3213 | 3212 | ||
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c index d05387d1e14b..484697fef386 100644 --- a/drivers/ata/libata-sff.c +++ b/drivers/ata/libata-sff.c | |||
@@ -1532,11 +1532,10 @@ static unsigned int __ata_sff_port_intr(struct ata_port *ap, | |||
1532 | if (!(qc->dev->flags & ATA_DFLAG_CDB_INTR)) | 1532 | if (!(qc->dev->flags & ATA_DFLAG_CDB_INTR)) |
1533 | return ata_sff_idle_irq(ap); | 1533 | return ata_sff_idle_irq(ap); |
1534 | break; | 1534 | break; |
1535 | case HSM_ST: | 1535 | case HSM_ST_IDLE: |
1536 | case HSM_ST_LAST: | ||
1537 | break; | ||
1538 | default: | ||
1539 | return ata_sff_idle_irq(ap); | 1536 | return ata_sff_idle_irq(ap); |
1537 | default: | ||
1538 | break; | ||
1540 | } | 1539 | } |
1541 | 1540 | ||
1542 | /* check main status, clearing INTRQ if needed */ | 1541 | /* check main status, clearing INTRQ if needed */ |
diff --git a/drivers/ata/pata_cs5536.c b/drivers/ata/pata_cs5536.c index 21ee23f89e88..a6e6c963b6ae 100644 --- a/drivers/ata/pata_cs5536.c +++ b/drivers/ata/pata_cs5536.c | |||
@@ -37,10 +37,20 @@ | |||
37 | #include <linux/delay.h> | 37 | #include <linux/delay.h> |
38 | #include <linux/libata.h> | 38 | #include <linux/libata.h> |
39 | #include <scsi/scsi_host.h> | 39 | #include <scsi/scsi_host.h> |
40 | |||
41 | #ifdef CONFIG_X86_32 | ||
40 | #include <asm/msr.h> | 42 | #include <asm/msr.h> |
43 | static int use_msr; | ||
44 | module_param_named(msr, use_msr, int, 0644); | ||
45 | MODULE_PARM_DESC(msr, "Force using MSR to configure IDE function (Default: 0)"); | ||
46 | #else | ||
47 | #define rdmsr(x, y, z) do { } while (0) | ||
48 | #define wrmsr(x, y, z) do { } while (0) | ||
49 | #define use_msr 0 | ||
50 | #endif | ||
41 | 51 | ||
42 | #define DRV_NAME "pata_cs5536" | 52 | #define DRV_NAME "pata_cs5536" |
43 | #define DRV_VERSION "0.0.7" | 53 | #define DRV_VERSION "0.0.8" |
44 | 54 | ||
45 | enum { | 55 | enum { |
46 | CFG = 0, | 56 | CFG = 0, |
@@ -75,8 +85,6 @@ enum { | |||
75 | IDE_ETC_NODMA = 0x03, | 85 | IDE_ETC_NODMA = 0x03, |
76 | }; | 86 | }; |
77 | 87 | ||
78 | static int use_msr; | ||
79 | |||
80 | static const u32 msr_reg[4] = { | 88 | static const u32 msr_reg[4] = { |
81 | MSR_IDE_CFG, MSR_IDE_DTC, MSR_IDE_CAST, MSR_IDE_ETC, | 89 | MSR_IDE_CFG, MSR_IDE_DTC, MSR_IDE_CAST, MSR_IDE_ETC, |
82 | }; | 90 | }; |
@@ -88,7 +96,7 @@ static const u8 pci_reg[4] = { | |||
88 | static inline int cs5536_read(struct pci_dev *pdev, int reg, u32 *val) | 96 | static inline int cs5536_read(struct pci_dev *pdev, int reg, u32 *val) |
89 | { | 97 | { |
90 | if (unlikely(use_msr)) { | 98 | if (unlikely(use_msr)) { |
91 | u32 dummy; | 99 | u32 dummy __maybe_unused; |
92 | 100 | ||
93 | rdmsr(msr_reg[reg], *val, dummy); | 101 | rdmsr(msr_reg[reg], *val, dummy); |
94 | return 0; | 102 | return 0; |
@@ -294,8 +302,6 @@ MODULE_DESCRIPTION("low-level driver for the CS5536 IDE controller"); | |||
294 | MODULE_LICENSE("GPL"); | 302 | MODULE_LICENSE("GPL"); |
295 | MODULE_DEVICE_TABLE(pci, cs5536); | 303 | MODULE_DEVICE_TABLE(pci, cs5536); |
296 | MODULE_VERSION(DRV_VERSION); | 304 | MODULE_VERSION(DRV_VERSION); |
297 | module_param_named(msr, use_msr, int, 0644); | ||
298 | MODULE_PARM_DESC(msr, "Force using MSR to configure IDE function (Default: 0)"); | ||
299 | 305 | ||
300 | module_init(cs5536_init); | 306 | module_init(cs5536_init); |
301 | module_exit(cs5536_exit); | 307 | module_exit(cs5536_exit); |
diff --git a/drivers/ata/sata_via.c b/drivers/ata/sata_via.c index c21589986c69..8b677bbf2d37 100644 --- a/drivers/ata/sata_via.c +++ b/drivers/ata/sata_via.c | |||
@@ -538,7 +538,7 @@ static int vt8251_prepare_host(struct pci_dev *pdev, struct ata_host **r_host) | |||
538 | return 0; | 538 | return 0; |
539 | } | 539 | } |
540 | 540 | ||
541 | static void svia_configure(struct pci_dev *pdev) | 541 | static void svia_configure(struct pci_dev *pdev, int board_id) |
542 | { | 542 | { |
543 | u8 tmp8; | 543 | u8 tmp8; |
544 | 544 | ||
@@ -577,7 +577,7 @@ static void svia_configure(struct pci_dev *pdev) | |||
577 | } | 577 | } |
578 | 578 | ||
579 | /* | 579 | /* |
580 | * vt6421 has problems talking to some drives. The following | 580 | * vt6420/1 has problems talking to some drives. The following |
581 | * is the fix from Joseph Chan <JosephChan@via.com.tw>. | 581 | * is the fix from Joseph Chan <JosephChan@via.com.tw>. |
582 | * | 582 | * |
583 | * When host issues HOLD, device may send up to 20DW of data | 583 | * When host issues HOLD, device may send up to 20DW of data |
@@ -596,8 +596,9 @@ static void svia_configure(struct pci_dev *pdev) | |||
596 | * | 596 | * |
597 | * https://bugzilla.kernel.org/show_bug.cgi?id=15173 | 597 | * https://bugzilla.kernel.org/show_bug.cgi?id=15173 |
598 | * http://article.gmane.org/gmane.linux.ide/46352 | 598 | * http://article.gmane.org/gmane.linux.ide/46352 |
599 | * http://thread.gmane.org/gmane.linux.kernel/1062139 | ||
599 | */ | 600 | */ |
600 | if (pdev->device == 0x3249) { | 601 | if (board_id == vt6420 || board_id == vt6421) { |
601 | pci_read_config_byte(pdev, 0x52, &tmp8); | 602 | pci_read_config_byte(pdev, 0x52, &tmp8); |
602 | tmp8 |= 1 << 2; | 603 | tmp8 |= 1 << 2; |
603 | pci_write_config_byte(pdev, 0x52, tmp8); | 604 | pci_write_config_byte(pdev, 0x52, tmp8); |
@@ -652,7 +653,7 @@ static int svia_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
652 | if (rc) | 653 | if (rc) |
653 | return rc; | 654 | return rc; |
654 | 655 | ||
655 | svia_configure(pdev); | 656 | svia_configure(pdev, board_id); |
656 | 657 | ||
657 | pci_set_master(pdev); | 658 | pci_set_master(pdev); |
658 | return ata_host_activate(host, pdev->irq, ata_bmdma_interrupt, | 659 | return ata_host_activate(host, pdev->irq, ata_bmdma_interrupt, |