linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libata: add kernel parameter to force ATA_HORKAGE_NO_DMA_LOG
@ 2021-08-14 13:47 Reimar Döffinger
  2021-08-15  8:18 ` Christoph Hellwig
  0 siblings, 1 reply; 30+ messages in thread
From: Reimar Döffinger @ 2021-08-14 13:47 UTC (permalink / raw)
  To: linux-ide, Jens Axboe

The ATA_CMD_READ_LOG_DMA_EXT can cause controller/device to
become unresponsive until the next power cycle.
This seems to particularly affect IDE to SATA adapters,
possibly in combination with certain SATA SSDs, though
there might be more/different cases.
Comment 5 of https://bugzilla.kernel.org/show_bug.cgi?id=195895
is an example.
Having an option to disable its use allows booting systems affected,
which besides being a useful workaround is also a necessary
step to allow gathering more debug info on these systems.
Existing workarounds like forcing PIO mode do not work
(in addition to the performance issues) because READ_LOG_DMA
is issued even if PIO mode is forced.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
---
 Documentation/admin-guide/kernel-parameters.txt | 2 ++
 drivers/ata/libata-core.c                       | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index bdb22006f713..191502e8fa74 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -2551,6 +2551,8 @@
 
 			* [no]ncqtrim: Turn off queued DSM TRIM.
 
+			* [no]dmalog: Turn off use of ATA_CMD_READ_LOG_DMA_EXT (0x47) command
+
 			* nohrst, nosrst, norst: suppress hard, soft
 			  and both resets.
 
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 61c762961ca8..7fb865333a38 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -6104,6 +6104,8 @@ static int __init ata_parse_force_one(char **cur,
 		{ "ncq",	.horkage_off	= ATA_HORKAGE_NONCQ },
 		{ "noncqtrim",	.horkage_on	= ATA_HORKAGE_NO_NCQ_TRIM },
 		{ "ncqtrim",	.horkage_off	= ATA_HORKAGE_NO_NCQ_TRIM },
+		{ "nodmalog",	.horkage_on	= ATA_HORKAGE_NO_DMA_LOG },
+		{ "dmalog",	.horkage_off	= ATA_HORKAGE_NO_DMA_LOG },
 		{ "dump_id",	.horkage_on	= ATA_HORKAGE_DUMP_ID },
 		{ "pio0",	.xfer_mask	= 1 << (ATA_SHIFT_PIO + 0) },
 		{ "pio1",	.xfer_mask	= 1 << (ATA_SHIFT_PIO + 1) },
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 30+ messages in thread
* [PATCH v5] Fixes to DMA state check
@ 2021-10-12  6:27 Reimar Döffinger
  2021-10-12  6:27 ` [PATCH 5/6] pata_optidma: fix checking of DMA state Reimar Döffinger
  0 siblings, 1 reply; 30+ messages in thread
From: Reimar Döffinger @ 2021-10-12  6:27 UTC (permalink / raw)
  To: Damien Le Moal, linux-ide, Jens Axboe, hch, Paul Menzel

Patch series to add ata_dma_enabled calls instead of incorrectly
checking dev->dma_mode != 0.
Only the first patch is confirmed to have caused real issues
that it indeed fixes, rest based purely on code review.

Changes v5:
Add stable Cc to first patch, which is confirmed to fix
issues seen by users.

Changes v4:
- split per file/driver
- added Signed-off-by and Tested-by lines, improved commit messages
Changes v3:
- found and updated more cases in pata_ali, pata_amd and pata_radisys.
Changes v2:
- removed initialization change for SATA. I got confused by the
  ping-pong between libata-eh and libata-core and thought SATA did not
  set up xfermode
- reviewed other cases that used dma_mode in boolean context and those
  seemed to need changing as well, so added them to patch.
  I did not see any places that would set dma_mode to 0 ever, so I
  do think they were all indeed wrong.



^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2021-10-12  6:33 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-14 13:47 [PATCH] libata: add kernel parameter to force ATA_HORKAGE_NO_DMA_LOG Reimar Döffinger
2021-08-15  8:18 ` Christoph Hellwig
2021-08-15 16:27   ` [PATCH] libata: Disable ATA_CMD_READ_LOG_DMA_EXT in problematic cases Reimar Döffinger
2021-08-16  0:10     ` Damien Le Moal
2021-08-16 17:15       ` Reimar Döffinger
2021-08-17 19:06         ` Reimar Döffinger
2021-08-18 22:49         ` Damien Le Moal
2021-08-16 17:26       ` Reimar Döffinger
2021-08-17  7:45         ` Damien Le Moal
2021-08-17 18:01           ` Reimar Döffinger
2021-08-17 19:03             ` [PATCH] libata: fix setting and checking of DMA state Reimar Döffinger
2021-08-18 23:30               ` Damien Le Moal
2021-08-19  8:13                 ` [PATCH] libata: fix " Reimar Döffinger
2021-08-19 12:56                   ` Reimar Döffinger
2021-09-27  8:56                   ` Paul Menzel
2021-09-27  9:10                     ` Reimar Döffinger
2021-09-27  9:15                       ` Damien Le Moal
2021-10-03 13:28                         ` [PATCH v4] Fixes to DMA state check Reimar Döffinger
2021-10-03 13:28                           ` [PATCH 1/6] libata: fix checking of DMA state Reimar Döffinger
2021-10-03 13:28                           ` [PATCH 2/6] libata-scsi: " Reimar Döffinger
2021-10-03 13:28                           ` [PATCH 3/6] pata_ali: " Reimar Döffinger
2021-10-03 13:28                           ` [PATCH 4/6] pata_amd: " Reimar Döffinger
2021-10-03 13:28                           ` [PATCH 5/6] pata_optidma: " Reimar Döffinger
2021-10-03 13:28                           ` [PATCH 6/6] pata_radisys: " Reimar Döffinger
2021-10-12  2:20                           ` [PATCH v4] Fixes to DMA state check Damien Le Moal
2021-10-12  6:30                             ` Reimar Döffinger
     [not found]                             ` <605EE991-5DA2-4A8D-9691-967D68D3AB51@gmx.de>
2021-10-12  6:32                               ` Damien Le Moal
2021-10-12  6:33                               ` Damien Le Moal
2021-08-15 16:34   ` [PATCH] libata: add kernel parameter to force ATA_HORKAGE_NO_DMA_LOG Reimar Döffinger
2021-10-12  6:27 [PATCH v5] Fixes to DMA state check Reimar Döffinger
2021-10-12  6:27 ` [PATCH 5/6] pata_optidma: fix checking of DMA state Reimar Döffinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).