Skip to content

Commit 06f6c4c

Browse files
author
Damien Le Moal
committed
ata: libata: add missing ata_identify_page_supported() calls
ata_dev_config_ncq_prio() and ata_dev_config_devslp() both access pages of the IDENTIFY DEVICE data log. Before calling ata_read_log_page(), make sure to check for the existence of the IDENTIFY DEVICE data log and of the log page accessed using ata_identify_page_supported(). This avoids useless error messages from ata_read_log_page() and failures with some LLDD scsi drivers using libsas. Reported-by: Nikolay <[email protected]> Cc: [email protected] # 5.15 Signed-off-by: Damien Le Moal <[email protected]> Tested-by: Matthew Perkowski <[email protected]>
1 parent 23ef63d commit 06f6c4c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/ata/libata-core.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2178,6 +2178,9 @@ static void ata_dev_config_ncq_prio(struct ata_device *dev)
21782178
struct ata_port *ap = dev->link->ap;
21792179
unsigned int err_mask;
21802180

2181+
if (!ata_identify_page_supported(dev, ATA_LOG_SATA_SETTINGS))
2182+
return;
2183+
21812184
err_mask = ata_read_log_page(dev,
21822185
ATA_LOG_IDENTIFY_DEVICE,
21832186
ATA_LOG_SATA_SETTINGS,
@@ -2454,7 +2457,8 @@ static void ata_dev_config_devslp(struct ata_device *dev)
24542457
* Check device sleep capability. Get DevSlp timing variables
24552458
* from SATA Settings page of Identify Device Data Log.
24562459
*/
2457-
if (!ata_id_has_devslp(dev->id))
2460+
if (!ata_id_has_devslp(dev->id) ||
2461+
!ata_identify_page_supported(dev, ATA_LOG_SATA_SETTINGS))
24582462
return;
24592463

24602464
err_mask = ata_read_log_page(dev,

0 commit comments

Comments
 (0)