diff options
author | Vincent Pelletier <plr.vincent@gmail.com> | 2013-05-21 16:30:58 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-01-09 15:24:23 -0500 |
commit | 3d097b15182906eaf121c48697ceda0ab9ddf55e (patch) | |
tree | 8ed02a0a359761578bac38e94c59a3265188f5aa | |
parent | 6dcccce8791fa72bff307f6c2506d323705102cd (diff) |
libata: Add atapi_dmadir force flag
commit 966fbe193f47c68e70a80ec9991098e88e7959cb upstream.
Some device require DMADIR to be enabled, but are not detected as such
by atapi_id_dmadir. One such example is "Asus Serillel 2"
SATA-host-to-PATA-device bridge: the bridge itself requires DMADIR,
even if the bridged device does not.
As atapi_dmadir module parameter can cause problems with some devices
(as per Tejun Heo's memory), enabling it globally may not be possible
depending on the hardware.
This patch adds atapi_dmadir in the form of a "force" horkage value,
allowing global, per-bus and per-device control.
Signed-off-by: Vincent Pelletier <plr.vincent@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | Documentation/kernel-parameters.txt | 2 | ||||
-rw-r--r-- | drivers/ata/libata-core.c | 3 | ||||
-rw-r--r-- | include/linux/libata.h | 1 |
3 files changed, 5 insertions, 1 deletions
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 2fe6e767b3d6..96401631523d 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -1456,6 +1456,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
1456 | 1456 | ||
1457 | * dump_id: dump IDENTIFY data. | 1457 | * dump_id: dump IDENTIFY data. |
1458 | 1458 | ||
1459 | * atapi_dmadir: Enable ATAPI DMADIR bridge support | ||
1460 | |||
1459 | If there are multiple matching configurations changing | 1461 | If there are multiple matching configurations changing |
1460 | the same attribute, the last one is used. | 1462 | the same attribute, the last one is used. |
1461 | 1463 | ||
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 011d12cdc102..d18ab9015e3e 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -2401,7 +2401,7 @@ int ata_dev_configure(struct ata_device *dev) | |||
2401 | cdb_intr_string = ", CDB intr"; | 2401 | cdb_intr_string = ", CDB intr"; |
2402 | } | 2402 | } |
2403 | 2403 | ||
2404 | if (atapi_dmadir || atapi_id_dmadir(dev->id)) { | 2404 | if (atapi_dmadir || (dev->horkage & ATA_HORKAGE_ATAPI_DMADIR) || atapi_id_dmadir(dev->id)) { |
2405 | dev->flags |= ATA_DFLAG_DMADIR; | 2405 | dev->flags |= ATA_DFLAG_DMADIR; |
2406 | dma_dir_string = ", DMADIR"; | 2406 | dma_dir_string = ", DMADIR"; |
2407 | } | 2407 | } |
@@ -6506,6 +6506,7 @@ static int __init ata_parse_force_one(char **cur, | |||
6506 | { "nosrst", .lflags = ATA_LFLAG_NO_SRST }, | 6506 | { "nosrst", .lflags = ATA_LFLAG_NO_SRST }, |
6507 | { "norst", .lflags = ATA_LFLAG_NO_HRST | ATA_LFLAG_NO_SRST }, | 6507 | { "norst", .lflags = ATA_LFLAG_NO_HRST | ATA_LFLAG_NO_SRST }, |
6508 | { "rstonce", .lflags = ATA_LFLAG_RST_ONCE }, | 6508 | { "rstonce", .lflags = ATA_LFLAG_RST_ONCE }, |
6509 | { "atapi_dmadir", .horkage_on = ATA_HORKAGE_ATAPI_DMADIR }, | ||
6509 | }; | 6510 | }; |
6510 | char *start = *cur, *p = *cur; | 6511 | char *start = *cur, *p = *cur; |
6511 | char *id, *val, *endp; | 6512 | char *id, *val, *endp; |
diff --git a/include/linux/libata.h b/include/linux/libata.h index eae7a053dc51..9a4c194ebc8a 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -399,6 +399,7 @@ enum { | |||
399 | ATA_HORKAGE_BROKEN_FPDMA_AA = (1 << 15), /* skip AA */ | 399 | ATA_HORKAGE_BROKEN_FPDMA_AA = (1 << 15), /* skip AA */ |
400 | ATA_HORKAGE_DUMP_ID = (1 << 16), /* dump IDENTIFY data */ | 400 | ATA_HORKAGE_DUMP_ID = (1 << 16), /* dump IDENTIFY data */ |
401 | ATA_HORKAGE_MAX_SEC_LBA48 = (1 << 17), /* Set max sects to 65535 */ | 401 | ATA_HORKAGE_MAX_SEC_LBA48 = (1 << 17), /* Set max sects to 65535 */ |
402 | ATA_HORKAGE_ATAPI_DMADIR = (1 << 18), /* device requires dmadir */ | ||
402 | 403 | ||
403 | /* DMA mask for user DMA control: User visible values; DO NOT | 404 | /* DMA mask for user DMA control: User visible values; DO NOT |
404 | renumber */ | 405 | renumber */ |