diff options
| -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-sff.c | 7 | ||||
| -rw-r--r-- | drivers/ata/pata_cs5536.c | 18 |
6 files changed, 56 insertions, 34 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-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); |
