linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libata: add horkage for missing Identify Device log
@ 2021-11-08 23:57 Damien Le Moal
  2021-11-09  8:54 ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Damien Le Moal @ 2021-11-08 23:57 UTC (permalink / raw)
  To: linux-ide

ACS defines the ATA Identify Device Data log as mandatory. A warning
message currently signals to the user if a device does not report
supporting this log page in the log directory page. However, it is
useless to constantly access the log directory and warn about this lack
of support once we have discovered that the device does not support
this mandatory log page.

Introduce the horkage flag ATA_HORKAGE_NO_ID_DEV_LOG to mark a device as
lacking support for the Identify Device Data log page. Set this flag
when ata_log_supported() returns false in ata_identify_page_supported().
The warning is printed only once on device scan and the log directory
not accessed again to test for Identify Device Data log page support.

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
---
 drivers/ata/libata-core.c | 4 ++++
 include/linux/libata.h    | 1 +
 2 files changed, 5 insertions(+)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 3018ca84a3d8..de1eff94c76d 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -2052,8 +2052,12 @@ static bool ata_identify_page_supported(struct ata_device *dev, u8 page)
 	struct ata_port *ap = dev->link->ap;
 	unsigned int err, i;
 
+	if (dev->horkage & ATA_HORKAGE_NO_ID_DEV_LOG)
+		return false;
+
 	if (!ata_log_supported(dev, ATA_LOG_IDENTIFY_DEVICE)) {
 		ata_dev_warn(dev, "ATA Identify Device Log not supported\n");
+		dev->horkage |= ATA_HORKAGE_NO_ID_DEV_LOG;
 		return false;
 	}
 
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 5331557316e8..2a8404b26083 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -427,6 +427,7 @@ enum {
 	ATA_HORKAGE_MAX_SEC_1024 = (1 << 25),	/* Limit max sects to 1024 */
 	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 */
 
 	 /* DMA mask for user DMA control: User visible values; DO NOT
 	    renumber */
-- 
2.31.1


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

* Re: [PATCH] libata: add horkage for missing Identify Device log
  2021-11-08 23:57 [PATCH] libata: add horkage for missing Identify Device log Damien Le Moal
@ 2021-11-09  8:54 ` Christoph Hellwig
  2021-11-10  6:17   ` Damien Le Moal
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2021-11-09  8:54 UTC (permalink / raw)
  To: Damien Le Moal; +Cc: linux-ide

On Tue, Nov 09, 2021 at 08:57:23AM +0900, Damien Le Moal wrote:
> ACS defines the ATA Identify Device Data log as mandatory. A warning
> message currently signals to the user if a device does not report
> supporting this log page in the log directory page. However, it is
> useless to constantly access the log directory and warn about this lack
> of support once we have discovered that the device does not support
> this mandatory log page.
> 
> Introduce the horkage flag ATA_HORKAGE_NO_ID_DEV_LOG to mark a device as
> lacking support for the Identify Device Data log page. Set this flag
> when ata_log_supported() returns false in ata_identify_page_supported().
> The warning is printed only once on device scan and the log directory
> not accessed again to test for Identify Device Data log page support.

Should we also just set it by default for older devices?  I'd need to
look up when it was introduced, but I think it is a somewhat recent
addition.

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

* Re: [PATCH] libata: add horkage for missing Identify Device log
  2021-11-09  8:54 ` Christoph Hellwig
@ 2021-11-10  6:17   ` Damien Le Moal
  2021-11-10  7:53     ` Damien Le Moal
  0 siblings, 1 reply; 4+ messages in thread
From: Damien Le Moal @ 2021-11-10  6:17 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: linux-ide

On 2021/11/09 17:54, Christoph Hellwig wrote:
> On Tue, Nov 09, 2021 at 08:57:23AM +0900, Damien Le Moal wrote:
>> ACS defines the ATA Identify Device Data log as mandatory. A warning
>> message currently signals to the user if a device does not report
>> supporting this log page in the log directory page. However, it is
>> useless to constantly access the log directory and warn about this lack
>> of support once we have discovered that the device does not support
>> this mandatory log page.
>>
>> Introduce the horkage flag ATA_HORKAGE_NO_ID_DEV_LOG to mark a device as
>> lacking support for the Identify Device Data log page. Set this flag
>> when ata_log_supported() returns false in ata_identify_page_supported().
>> The warning is printed only once on device scan and the log directory
>> not accessed again to test for Identify Device Data log page support.
> 
> Should we also just set it by default for older devices?  I'd need to
> look up when it was introduced, but I think it is a somewhat recent
> addition.

It is marked as mandatory at least since ACS-3.
Need to check before that. Will do.



-- 
Damien Le Moal
Western Digital Research

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

* Re: [PATCH] libata: add horkage for missing Identify Device log
  2021-11-10  6:17   ` Damien Le Moal
@ 2021-11-10  7:53     ` Damien Le Moal
  0 siblings, 0 replies; 4+ messages in thread
From: Damien Le Moal @ 2021-11-10  7:53 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: linux-ide

On 2021/11/10 15:17, Damien Le Moal wrote:
> On 2021/11/09 17:54, Christoph Hellwig wrote:
>> On Tue, Nov 09, 2021 at 08:57:23AM +0900, Damien Le Moal wrote:
>>> ACS defines the ATA Identify Device Data log as mandatory. A warning
>>> message currently signals to the user if a device does not report
>>> supporting this log page in the log directory page. However, it is
>>> useless to constantly access the log directory and warn about this lack
>>> of support once we have discovered that the device does not support
>>> this mandatory log page.
>>>
>>> Introduce the horkage flag ATA_HORKAGE_NO_ID_DEV_LOG to mark a device as
>>> lacking support for the Identify Device Data log page. Set this flag
>>> when ata_log_supported() returns false in ata_identify_page_supported().
>>> The warning is printed only once on device scan and the log directory
>>> not accessed again to test for Identify Device Data log page support.
>>
>> Should we also just set it by default for older devices?  I'd need to
>> look up when it was introduced, but I think it is a somewhat recent
>> addition.
> 
> It is marked as mandatory at least since ACS-3.
> Need to check before that. Will do.

I checked: The IDENTIFY DEVICE data log was introduced as mandatory in ACS-3
(ATA version 10 in IDENTIFY word 80). This log is not defined in ACS-2 and
earlier specs (ATA version 9 and before), but I see plenty of ATA-9 drives that
have this log implemented.

So I think the patch is OK and only needs the warning being conditional on ATA
version being equal to or higher than 10.

Sending v2.

-- 
Damien Le Moal
Western Digital Research

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

end of thread, other threads:[~2021-11-10  7:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-08 23:57 [PATCH] libata: add horkage for missing Identify Device log Damien Le Moal
2021-11-09  8:54 ` Christoph Hellwig
2021-11-10  6:17   ` Damien Le Moal
2021-11-10  7:53     ` Damien Le Moal

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).