diff mbox series

[2/2] ata: libata-scsi: Fix ata_msense_control() CDL page reporting

Message ID 20240923133949.286295-3-dlemoal@kernel.org
State New
Headers show
Series CDL related fixes | expand

Commit Message

Damien Le Moal Sept. 23, 2024, 1:39 p.m. UTC
When the user requests the ALL_SUB_MPAGES mode sense page,
ata_msense_control() adds the CDL_T2A_SUB_MPAGE twice instead of adding
the CDL_T2A_SUB_MPAGE and CDL_T2B_SUB_MPAGE pages information. Correct
the second call to ata_msense_control_spgt2() to report the
CDL_T2B_SUB_MPAGE page.

Fixes: 673b2fe6ff1d ("scsi: ata: libata-scsi: Add support for CDL pages mode sense")
Cc: stable@vger.kernel.org
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
---
 drivers/ata/libata-scsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Hannes Reinecke Sept. 24, 2024, 6:44 a.m. UTC | #1
On 9/23/24 15:39, Damien Le Moal wrote:
> When the user requests the ALL_SUB_MPAGES mode sense page,
> ata_msense_control() adds the CDL_T2A_SUB_MPAGE twice instead of adding
> the CDL_T2A_SUB_MPAGE and CDL_T2B_SUB_MPAGE pages information. Correct
> the second call to ata_msense_control_spgt2() to report the
> CDL_T2B_SUB_MPAGE page.
> 
> Fixes: 673b2fe6ff1d ("scsi: ata: libata-scsi: Add support for CDL pages mode sense")
> Cc: stable@vger.kernel.org
> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
> ---
>   drivers/ata/libata-scsi.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
> index 97c84b0ec472..ea7d365fb7a9 100644
> --- a/drivers/ata/libata-scsi.c
> +++ b/drivers/ata/libata-scsi.c
> @@ -2350,7 +2350,7 @@ static unsigned int ata_msense_control(struct ata_device *dev, u8 *buf,
>   	case ALL_SUB_MPAGES:
>   		n = ata_msense_control_spg0(dev, buf, changeable);
>   		n += ata_msense_control_spgt2(dev, buf + n, CDL_T2A_SUB_MPAGE);
> -		n += ata_msense_control_spgt2(dev, buf + n, CDL_T2A_SUB_MPAGE);
> +		n += ata_msense_control_spgt2(dev, buf + n, CDL_T2B_SUB_MPAGE);
>   		n += ata_msense_control_ata_feature(dev, buf + n);
>   		return n;
>   	default:
Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
diff mbox series

Patch

diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 97c84b0ec472..ea7d365fb7a9 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -2350,7 +2350,7 @@  static unsigned int ata_msense_control(struct ata_device *dev, u8 *buf,
 	case ALL_SUB_MPAGES:
 		n = ata_msense_control_spg0(dev, buf, changeable);
 		n += ata_msense_control_spgt2(dev, buf + n, CDL_T2A_SUB_MPAGE);
-		n += ata_msense_control_spgt2(dev, buf + n, CDL_T2A_SUB_MPAGE);
+		n += ata_msense_control_spgt2(dev, buf + n, CDL_T2B_SUB_MPAGE);
 		n += ata_msense_control_ata_feature(dev, buf + n);
 		return n;
 	default: