aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/ata/libata-core.c17
-rw-r--r--include/linux/libata.h6
2 files changed, 23 insertions, 0 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 5532a6564d05..1501d63db2cb 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -97,6 +97,10 @@ static int ata_ignore_hpa = 0;
97module_param_named(ignore_hpa, ata_ignore_hpa, int, 0644); 97module_param_named(ignore_hpa, ata_ignore_hpa, int, 0644);
98MODULE_PARM_DESC(ignore_hpa, "Ignore HPA limit (0=keep BIOS limits, 1=ignore limits, using full disk)"); 98MODULE_PARM_DESC(ignore_hpa, "Ignore HPA limit (0=keep BIOS limits, 1=ignore limits, using full disk)");
99 99
100static int libata_dma_mask = ATA_DMA_MASK_ATA|ATA_DMA_MASK_ATAPI|ATA_DMA_MASK_CFA;
101module_param_named(dma, libata_dma_mask, int, 0444);
102MODULE_PARM_DESC(dma, "DMA enable/disable (0x1==ATA, 0x2==ATAPI, 0x4==CF)");
103
100static int ata_probe_timeout = ATA_TMOUT_INTERNAL / HZ; 104static int ata_probe_timeout = ATA_TMOUT_INTERNAL / HZ;
101module_param(ata_probe_timeout, int, 0444); 105module_param(ata_probe_timeout, int, 0444);
102MODULE_PARM_DESC(ata_probe_timeout, "Set ATA probing timeout (seconds)"); 106MODULE_PARM_DESC(ata_probe_timeout, "Set ATA probing timeout (seconds)");
@@ -2917,14 +2921,27 @@ int ata_do_set_mode(struct ata_link *link, struct ata_device **r_failed_dev)
2917 /* step 1: calculate xfer_mask */ 2921 /* step 1: calculate xfer_mask */
2918 ata_link_for_each_dev(dev, link) { 2922 ata_link_for_each_dev(dev, link) {
2919 unsigned int pio_mask, dma_mask; 2923 unsigned int pio_mask, dma_mask;
2924 unsigned int mode_mask;
2920 2925
2921 if (!ata_dev_enabled(dev)) 2926 if (!ata_dev_enabled(dev))
2922 continue; 2927 continue;
2923 2928
2929 mode_mask = ATA_DMA_MASK_ATA;
2930 if (dev->class == ATA_DEV_ATAPI)
2931 mode_mask = ATA_DMA_MASK_ATAPI;
2932 else if (ata_id_is_cfa(dev->id))
2933 mode_mask = ATA_DMA_MASK_CFA;
2934
2924 ata_dev_xfermask(dev); 2935 ata_dev_xfermask(dev);
2925 2936
2926 pio_mask = ata_pack_xfermask(dev->pio_mask, 0, 0); 2937 pio_mask = ata_pack_xfermask(dev->pio_mask, 0, 0);
2927 dma_mask = ata_pack_xfermask(0, dev->mwdma_mask, dev->udma_mask); 2938 dma_mask = ata_pack_xfermask(0, dev->mwdma_mask, dev->udma_mask);
2939
2940 if (libata_dma_mask & mode_mask)
2941 dma_mask = ata_pack_xfermask(0, dev->mwdma_mask, dev->udma_mask);
2942 else
2943 dma_mask = 0;
2944
2928 dev->pio_mode = ata_xfer_mask2mode(pio_mask); 2945 dev->pio_mode = ata_xfer_mask2mode(pio_mask);
2929 dev->dma_mode = ata_xfer_mask2mode(dma_mask); 2946 dev->dma_mode = ata_xfer_mask2mode(dma_mask);
2930 2947
diff --git a/include/linux/libata.h b/include/linux/libata.h
index ca296a575c4a..84dfc23b9d31 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -331,6 +331,12 @@ enum {
331 ATA_HORKAGE_BROKEN_HPA = (1 << 4), /* Broken HPA */ 331 ATA_HORKAGE_BROKEN_HPA = (1 << 4), /* Broken HPA */
332 ATA_HORKAGE_SKIP_PM = (1 << 5), /* Skip PM operations */ 332 ATA_HORKAGE_SKIP_PM = (1 << 5), /* Skip PM operations */
333 ATA_HORKAGE_HPA_SIZE = (1 << 6), /* native size off by one */ 333 ATA_HORKAGE_HPA_SIZE = (1 << 6), /* native size off by one */
334
335 /* DMA mask for user DMA control: User visible values; DO NOT
336 renumber */
337 ATA_DMA_MASK_ATA = (1 << 0), /* DMA on ATA Disk */
338 ATA_DMA_MASK_ATAPI = (1 << 1), /* DMA on ATAPI */
339 ATA_DMA_MASK_CFA = (1 << 2), /* DMA on CF Card */
334}; 340};
335 341
336enum hsm_task_states { 342enum hsm_task_states {