aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-acpi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/libata-acpi.c')
-rw-r--r--drivers/ata/libata-acpi.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c
index 960c6a7caa83..b0882cddfd4c 100644
--- a/drivers/ata/libata-acpi.c
+++ b/drivers/ata/libata-acpi.c
@@ -20,7 +20,7 @@
20 20
21#include <acpi/acpi_bus.h> 21#include <acpi/acpi_bus.h>
22 22
23static unsigned int ata_acpi_gtf_filter = ATA_ACPI_FILTER_DEFAULT; 23unsigned int ata_acpi_gtf_filter = ATA_ACPI_FILTER_DEFAULT;
24module_param_named(acpi_gtf_filter, ata_acpi_gtf_filter, int, 0644); 24module_param_named(acpi_gtf_filter, ata_acpi_gtf_filter, int, 0644);
25MODULE_PARM_DESC(acpi_gtf_filter, "filter mask for ACPI _GTF commands, set to filter out (0x1=set xfermode, 0x2=lock/freeze lock, 0x4=DIPM, 0x8=FPDMA non-zero offset, 0x10=FPDMA DMA Setup FIS auto-activate)"); 25MODULE_PARM_DESC(acpi_gtf_filter, "filter mask for ACPI _GTF commands, set to filter out (0x1=set xfermode, 0x2=lock/freeze lock, 0x4=DIPM, 0x8=FPDMA non-zero offset, 0x10=FPDMA DMA Setup FIS auto-activate)");
26 26
@@ -603,10 +603,11 @@ static void ata_acpi_gtf_to_tf(struct ata_device *dev,
603 tf->command = gtf->tf[6]; /* 0x1f7 */ 603 tf->command = gtf->tf[6]; /* 0x1f7 */
604} 604}
605 605
606static int ata_acpi_filter_tf(const struct ata_taskfile *tf, 606static int ata_acpi_filter_tf(struct ata_device *dev,
607 const struct ata_taskfile *tf,
607 const struct ata_taskfile *ptf) 608 const struct ata_taskfile *ptf)
608{ 609{
609 if (ata_acpi_gtf_filter & ATA_ACPI_FILTER_SETXFER) { 610 if (dev->gtf_filter & ATA_ACPI_FILTER_SETXFER) {
610 /* libata doesn't use ACPI to configure transfer mode. 611 /* libata doesn't use ACPI to configure transfer mode.
611 * It will only confuse device configuration. Skip. 612 * It will only confuse device configuration. Skip.
612 */ 613 */
@@ -615,7 +616,7 @@ static int ata_acpi_filter_tf(const struct ata_taskfile *tf,
615 return 1; 616 return 1;
616 } 617 }
617 618
618 if (ata_acpi_gtf_filter & ATA_ACPI_FILTER_LOCK) { 619 if (dev->gtf_filter & ATA_ACPI_FILTER_LOCK) {
619 /* BIOS writers, sorry but we don't wanna lock 620 /* BIOS writers, sorry but we don't wanna lock
620 * features unless the user explicitly said so. 621 * features unless the user explicitly said so.
621 */ 622 */
@@ -640,18 +641,18 @@ static int ata_acpi_filter_tf(const struct ata_taskfile *tf,
640 if (tf->command == ATA_CMD_SET_FEATURES && 641 if (tf->command == ATA_CMD_SET_FEATURES &&
641 tf->feature == SETFEATURES_SATA_ENABLE) { 642 tf->feature == SETFEATURES_SATA_ENABLE) {
642 /* inhibit enabling DIPM */ 643 /* inhibit enabling DIPM */
643 if (ata_acpi_gtf_filter & ATA_ACPI_FILTER_DIPM && 644 if (dev->gtf_filter & ATA_ACPI_FILTER_DIPM &&
644 tf->nsect == SATA_DIPM) 645 tf->nsect == SATA_DIPM)
645 return 1; 646 return 1;
646 647
647 /* inhibit FPDMA non-zero offset */ 648 /* inhibit FPDMA non-zero offset */
648 if (ata_acpi_gtf_filter & ATA_ACPI_FILTER_FPDMA_OFFSET && 649 if (dev->gtf_filter & ATA_ACPI_FILTER_FPDMA_OFFSET &&
649 (tf->nsect == SATA_FPDMA_OFFSET || 650 (tf->nsect == SATA_FPDMA_OFFSET ||
650 tf->nsect == SATA_FPDMA_IN_ORDER)) 651 tf->nsect == SATA_FPDMA_IN_ORDER))
651 return 1; 652 return 1;
652 653
653 /* inhibit FPDMA auto activation */ 654 /* inhibit FPDMA auto activation */
654 if (ata_acpi_gtf_filter & ATA_ACPI_FILTER_FPDMA_AA && 655 if (dev->gtf_filter & ATA_ACPI_FILTER_FPDMA_AA &&
655 tf->nsect == SATA_FPDMA_AA) 656 tf->nsect == SATA_FPDMA_AA)
656 return 1; 657 return 1;
657 } 658 }
@@ -705,7 +706,7 @@ static int ata_acpi_run_tf(struct ata_device *dev,
705 pptf = &ptf; 706 pptf = &ptf;
706 } 707 }
707 708
708 if (!ata_acpi_filter_tf(&tf, pptf)) { 709 if (!ata_acpi_filter_tf(dev, &tf, pptf)) {
709 rtf = tf; 710 rtf = tf;
710 err_mask = ata_exec_internal(dev, &rtf, NULL, 711 err_mask = ata_exec_internal(dev, &rtf, NULL,
711 DMA_NONE, NULL, 0, 0); 712 DMA_NONE, NULL, 0, 0);