This is a note to let you know that I've just added the patch titled ata: libata: add missing ata_identify_page_supported() calls to the 5.15-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: ata-libata-add-missing-ata_identify_page_supported-calls.patch and it can be found in the queue-5.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 06f6c4c6c3e8354dceddd77bd58f9a7a84c67246 Mon Sep 17 00:00:00 2001 From: Damien Le Moal <damien.lemoal@xxxxxxxxxxxxxxxxxx> Date: Mon, 15 Nov 2021 12:47:26 +0900 Subject: ata: libata: add missing ata_identify_page_supported() calls From: Damien Le Moal <damien.lemoal@xxxxxxxxxxxxxxxxxx> commit 06f6c4c6c3e8354dceddd77bd58f9a7a84c67246 upstream. 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 <knv418@xxxxxxxxx> Cc: stable@xxxxxxxxxx # 5.15 Signed-off-by: Damien Le Moal <damien.lemoal@xxxxxxxxxxxxxxxxxx> Tested-by: Matthew Perkowski <mgperkow@xxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/ata/libata-core.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -2167,6 +2167,9 @@ static void ata_dev_config_ncq_prio(stru struct ata_port *ap = dev->link->ap; unsigned int err_mask; + if (!ata_identify_page_supported(dev, ATA_LOG_SATA_SETTINGS)) + return; + err_mask = ata_read_log_page(dev, ATA_LOG_IDENTIFY_DEVICE, ATA_LOG_SATA_SETTINGS, @@ -2443,7 +2446,8 @@ static void ata_dev_config_devslp(struct * Check device sleep capability. Get DevSlp timing variables * from SATA Settings page of Identify Device Data Log. */ - if (!ata_id_has_devslp(dev->id)) + if (!ata_id_has_devslp(dev->id) || + !ata_identify_page_supported(dev, ATA_LOG_SATA_SETTINGS)) return; err_mask = ata_read_log_page(dev, Patches currently in stable-queue which might be from damien.lemoal@xxxxxxxxxxxxxxxxxx are queue-5.15/ata-libata-improve-ata_read_log_page-error-message.patch queue-5.15/ata-libata-add-missing-ata_identify_page_supported-calls.patch