[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-ide
Subject:    Re: [PATCH] libata: Disable ATA_CMD_READ_LOG_DMA_EXT in problematic cases.
From:       Damien Le Moal <Damien.LeMoal () wdc ! com>
Date:       2021-08-18 22:49:27
Message-ID: DM6PR04MB708177A70A91A19AD7F937F7E7FF9 () DM6PR04MB7081 ! namprd04 ! prod ! outlook ! com
[Download RAW message or body]

On 2021/08/17 2:15, Reimar Döffinger wrote:
> 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.
> Disable it by default on Crucial MX500 devices and all
> PATA controllers.
> Also add an option to set the workaround state, which might
> help with gathering more data on the exact devices/controllers
> affected, and speed up narrowing down the cause for users that
> are affect but not covered by the added quirks.
> 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.

Please drop the dot at the end of the patch title. Also, it would be good to be
more precise with this title. So may be something like:

libata: Disable ATA_CMD_READ_LOG_DMA_EXT use with PATA adapters

Also, please add a version number to the patch so that reviewers (and Jens) can
keep track:

[PATCH v2] libata: Disable ATA_CMD_READ_LOG_DMA_EXT use with PATA adapters

> 
> Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
> ---

And add the versions changelog here. Something like:

Changes from v1:
* Change 1
* change 2
* ...

> Documentation/admin-guide/kernel-parameters.txt |  2 ++
> drivers/ata/libata-core.c                       | 14 ++++++++++++++
> 2 files changed, 16 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..9934f6c465f4 100644
> --- a/drivers/ata/libata-core.c
> +++ b/drivers/ata/libata-core.c
> @@ -2399,6 +2399,9 @@ int ata_dev_configure(struct ata_device *dev)
> 
> 	/* set horkage */
> 	dev->horkage |= ata_dev_blacklisted(dev);
> +	/* Disable READ_LOG_DMA with PATA-SATA adapters, they seem likely to hang */

Remove "likely".

> +	if (!(ap->flags & ATA_FLAG_SATA))
> +		dev->horkage |= ATA_HORKAGE_NO_DMA_LOG;
> 	ata_force_horkage(dev);
> 
> 	if (dev->horkage & ATA_HORKAGE_DISABLE) {
> @@ -4000,6 +4003,15 @@ static const struct ata_blacklist_entry ata_device_blacklist \
> [] = {  { "WDC WD3000JD-*",		NULL,	ATA_HORKAGE_WD_BROKEN_LPM },
> 	{ "WDC WD3200JD-*",		NULL,	ATA_HORKAGE_WD_BROKEN_LPM },
> 
> +	/*
> +	 * Devices with observed READ_LOG_DMA issues - unclear if only
> +	 * specific firmware versions or only in combination with specific
> +	 * controllers.
> +	 * Specifically broken combinations reported
> +	 * CT1000MX500SSD4, M3CR020 with B350M-Mortar
> +	 * CT500MX500SSD4, M3CR023 with PATA-SATA adapter
> +	 */
> +	{ "Crucial_CT*MX500*",		NULL,	ATA_HORKAGE_NO_DMA_LOG },
> 	/* End Marker */
> 	{ }
> };
> @@ -6104,6 +6116,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) },
> 


-- 
Damien Le Moal
Western Digital Research
=


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic