All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ata: libata-core: Introduce ATA_HORKAGE_NO_LOG_DIR horkage
@ 2022-02-03  9:41 Anton Lundin
  2022-02-04  7:51 ` Damien Le Moal
  0 siblings, 1 reply; 2+ messages in thread
From: Anton Lundin @ 2022-02-03  9:41 UTC (permalink / raw)
  To: linux-ide; +Cc: Anton Lundin, stable, Damien Le Moal

06f6c4c6c3e8 ("ata: libata: add missing ata_identify_page_supported() calls")
introduced additional calls to ata_identify_page_supported(), thus also
adding indirectly accesses to the device log directory log page through
ata_log_supported(). Reading this log page causes SATADOM-ML 3ME devices
to lock up.

Introduce the horkage flag ATA_HORKAGE_NO_LOG_DIR to prevent accesses to
the log directory in ata_log_supported() and add a blacklist entry
with this flag for "SATADOM-ML 3ME" devices.

Fixes: 636f6e2af4fb ("libata: add horkage for missing Identify Device log")
Cc: stable@vger.kernel.org # v5.10+
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
---
 drivers/ata/libata-core.c | 10 ++++++++++
 include/linux/libata.h    |  1 +
 2 files changed, 11 insertions(+)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 67f88027680a..e1b1dd215267 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -2007,6 +2007,9 @@ static bool ata_log_supported(struct ata_device *dev, u8 log)
 {
 	struct ata_port *ap = dev->link->ap;
 
+	if (dev->horkage & ATA_HORKAGE_NO_LOG_DIR)
+		return false;
+
 	if (ata_read_log_page(dev, ATA_LOG_DIRECTORY, 0, ap->sector_buf, 1))
 		return false;
 	return get_unaligned_le16(&ap->sector_buf[log * 2]) ? true : false;
@@ -4073,6 +4076,13 @@ 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 },
 
+	/*
+	 * This sata dom device goes on a walkabout when the ATA_LOG_DIRECTORY
+	 * log page is accessed. Ensure we never ask for this log page with
+	 * these devices.
+	 */
+	{ "SATADOM-ML 3ME",		NULL,	ATA_HORKAGE_NO_LOG_DIR },
+
 	/* End Marker */
 	{ }
 };
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 605756f645be..7f99b4d78822 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -380,6 +380,7 @@ enum {
 	ATA_HORKAGE_MAX_TRIM_128M = (1 << 26),	/* Limit max trim size to 128M */
 	ATA_HORKAGE_NO_NCQ_ON_ATI = (1 << 27),	/* Disable NCQ on ATI chipset */
 	ATA_HORKAGE_NO_ID_DEV_LOG = (1 << 28),	/* Identify device log missing */
+	ATA_HORKAGE_NO_LOG_DIR	= (1 << 29),	/* Do not read log directory */
 
 	 /* DMA mask for user DMA control: User visible values; DO NOT
 	    renumber */
-- 
2.30.2


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

* Re: [PATCH] ata: libata-core: Introduce ATA_HORKAGE_NO_LOG_DIR horkage
  2022-02-03  9:41 [PATCH] ata: libata-core: Introduce ATA_HORKAGE_NO_LOG_DIR horkage Anton Lundin
@ 2022-02-04  7:51 ` Damien Le Moal
  0 siblings, 0 replies; 2+ messages in thread
From: Damien Le Moal @ 2022-02-04  7:51 UTC (permalink / raw)
  To: Anton Lundin, linux-ide; +Cc: stable

On 2/3/22 18:41, Anton Lundin wrote:
> 06f6c4c6c3e8 ("ata: libata: add missing ata_identify_page_supported() calls")
> introduced additional calls to ata_identify_page_supported(), thus also
> adding indirectly accesses to the device log directory log page through
> ata_log_supported(). Reading this log page causes SATADOM-ML 3ME devices
> to lock up.
> 
> Introduce the horkage flag ATA_HORKAGE_NO_LOG_DIR to prevent accesses to
> the log directory in ata_log_supported() and add a blacklist entry
> with this flag for "SATADOM-ML 3ME" devices.
> 
> Fixes: 636f6e2af4fb ("libata: add horkage for missing Identify Device log")
> Cc: stable@vger.kernel.org # v5.10+
> Signed-off-by: Anton Lundin <glance@acc.umu.se>
> Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>

Applied to for-5.17-fixes. Thanks !


-- 
Damien Le Moal
Western Digital Research

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

end of thread, other threads:[~2022-02-04  7:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-03  9:41 [PATCH] ata: libata-core: Introduce ATA_HORKAGE_NO_LOG_DIR horkage Anton Lundin
2022-02-04  7:51 ` Damien Le Moal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.