linux-kernelorg-stable/drivers/ata
Damien Le Moal 17e897a456 ata: libata-scsi: Improve CDL control
With ATA devices supporting the CDL feature, using CDL requires that the
feature be enabled with a SET FEATURES command. This command is issued
as the translated command for the MODE SELECT command issued by
scsi_cdl_enable() when the user enables CDL through the device
cdl_enable sysfs attribute.

Currently, ata_mselect_control_ata_feature() always translates a MODE
SELECT command for the ATA features subpage of the control mode page to
a SET FEATURES command to enable or disable CDL based on the cdl_ctrl
field. However, there is no need to issue the SET FEATURES command if:
1) The MODE SELECT command requests disabling CDL and CDL is already
   disabled.
2) The MODE SELECT command requests enabling CDL and CDL is already
   enabled.

Fix ata_mselect_control_ata_feature() to issue the SET FEATURES command
only when necessary. Since enabling CDL also implies a reset of the CDL
statistics log page, avoiding useless CDL enable operations also avoids
clearing the CDL statistics log.

Also add debug messages to clearly signal when CDL is being enabled or
disabled using a SET FEATURES command.

Fixes: df60f9c645 ("scsi: ata: libata: Add ATA feature control sub-page translation")
Cc: stable@vger.kernel.org
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Niklas Cassel <cassel@kernel.org>
Reviewed-by: Igor Pylypiv <ipylypiv@google.com>
2025-04-22 16:06:05 +09:00
..
pata_parport
Kconfig
Makefile
acard-ahci.c ata: ahci: Replace deprecated PCI functions 2024-10-30 16:07:36 -05:00
ahci.c ata: ahci: simplify init function 2025-03-19 17:27:58 +01:00
ahci.h ata changes for 6.15 2025-03-26 19:49:02 -07:00
ahci_brcm.c ahci: Introduce ahci_ignore_port() helper 2025-01-09 17:52:17 +09:00
ahci_ceva.c ahci: Introduce ahci_ignore_port() helper 2025-01-09 17:52:17 +09:00
ahci_da850.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
ahci_dm816.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
ahci_dwc.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
ahci_imx.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
ahci_mtk.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
ahci_mvebu.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
ahci_octeon.c
ahci_platform.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
ahci_qoriq.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
ahci_seattle.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
ahci_st.c ahci: st: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() 2025-01-15 15:21:27 +01:00
ahci_sunxi.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
ahci_tegra.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
ahci_xgene.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
ata_generic.c ata: Constify struct pci_device_id 2024-12-03 05:10:20 +01:00
ata_piix.c ata: Use always-managed version of pci_intx() 2025-01-18 14:38:49 -06:00
libahci.c ata changes for 6.15 2025-03-26 19:49:02 -07:00
libahci_platform.c ata: libahci_platform: Do not set mask_port_map when not needed 2025-02-10 11:54:38 +01:00
libata-acpi.c ata: Fix typos in the comment 2024-10-01 09:22:02 +02:00
libata-core.c ata changes for 6.15 2025-03-26 19:49:02 -07:00
libata-eh.c treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
libata-pata-timings.c
libata-pmp.c
libata-sata.c ata: libata-sata: Save all fields from sense data descriptor 2025-04-16 17:33:17 +09:00
libata-scsi.c ata: libata-scsi: Improve CDL control 2025-04-22 16:06:05 +09:00
libata-sff.c ata: libata-sff: Ensure that we cannot write outside the allocated buffer 2025-01-28 11:44:47 +01:00
libata-trace.c
libata-transport.c
libata-transport.h
libata-zpodd.c ata: libata-zpodd: convert timeouts to secs_to_jiffies() 2025-03-17 12:16:58 -07:00
libata.h
pata_acpi.c
pata_ali.c
pata_amd.c
pata_arasan_cf.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
pata_artop.c
pata_atiixp.c
pata_atp867x.c ata: Constify struct pci_device_id 2024-12-03 05:10:20 +01:00
pata_buddha.c
pata_cmd64x.c
pata_cmd640.c
pata_cs5520.c
pata_cs5530.c
pata_cs5535.c
pata_cs5536.c
pata_cypress.c
pata_efar.c
pata_ep93xx.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
pata_falcon.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
pata_ftide010.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
pata_gayle.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
pata_hpt3x2n.c
pata_hpt3x3.c
pata_hpt37x.c
pata_hpt366.c
pata_icside.c
pata_imx.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
pata_isapnp.c
pata_it821x.c
pata_it8213.c ata: Fix typos in the comment 2024-10-01 09:22:02 +02:00
pata_ixp4xx_cf.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
pata_jmicron.c
pata_legacy.c
pata_macio.c SCSI misc on 20250126 2025-01-26 16:12:44 -08:00
pata_marvell.c
pata_mpc52xx.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
pata_mpiix.c
pata_netcell.c
pata_ninja32.c
pata_ns87410.c
pata_ns87415.c
pata_octeon_cf.c ata: pata_octeon_cf: Switch to use hrtimer_setup() 2025-02-18 10:32:34 +01:00
pata_of_platform.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
pata_oldpiix.c ata: Fix typos in the comment 2024-10-01 09:22:02 +02:00
pata_opti.c
pata_optidma.c
pata_pcmcia.c
pata_pdc202xx_old.c
pata_pdc2027x.c
pata_piccolo.c ata: Constify struct pci_device_id 2024-12-03 05:10:20 +01:00
pata_platform.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
pata_pxa.c ata: pata_pxa: Fix potential NULL pointer dereference in pxa_ata_probe() 2025-04-08 12:36:03 +09:00
pata_radisys.c ata: Fix typos in the comment 2024-10-01 09:22:02 +02:00
pata_rb532_cf.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
pata_rdc.c ata: Use always-managed version of pci_intx() 2025-01-18 14:38:49 -06:00
pata_rz1000.c
pata_sc1200.c
pata_sch.c
pata_serverworks.c
pata_sil680.c
pata_sis.c
pata_sl82c105.c
pata_triflex.c
pata_via.c
pdc_adma.c
sata_dwc_460ex.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
sata_fsl.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
sata_gemini.c ata: sata_gemini: Remove remaining reset glue 2024-12-16 22:36:27 +09:00
sata_gemini.h ata: sata_gemini: Remove unused gemini_sata_reset_bridge() 2024-12-11 13:18:25 +09:00
sata_highbank.c ata: sata_highbank: fix OF node reference leak in highbank_initialize_phys() 2024-12-09 09:06:58 +09:00
sata_inic162x.c
sata_mv.c SCSI misc on 20250126 2025-01-26 16:12:44 -08:00
sata_nv.c SCSI misc on 20250126 2025-01-26 16:12:44 -08:00
sata_promise.c
sata_promise.h
sata_qstor.c
sata_rcar.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
sata_sil.c
sata_sil24.c SCSI misc on 20250126 2025-01-26 16:12:44 -08:00
sata_sis.c ata: Use always-managed version of pci_intx() 2025-01-18 14:38:49 -06:00
sata_svw.c
sata_sx4.c ata: sata_sx4: Add error handling in pdc20621_i2c_read() 2025-04-09 15:24:49 +09:00
sata_uli.c ata: Use always-managed version of pci_intx() 2025-01-18 14:38:49 -06:00
sata_via.c ata: sata_via: Use str_up_down() helper in vt6420_prereset() 2025-02-20 13:03:32 +01:00
sata_vsc.c ata: Use always-managed version of pci_intx() 2025-01-18 14:38:49 -06:00
sis.h