linux/drivers/ata
Niklas Cassel 4539005b91 Revert "ata: libata-scsi: Honor the D_SENSE bit for CK_COND=1 and no error"
commit fa0db8e568 upstream.

This reverts commit 28ab976911.

Sense data can be in either fixed format or descriptor format.

SAT-6 revision 1, "10.4.6 Control mode page", defines the D_SENSE bit:
"The SATL shall support this bit as defined in SPC-5 with the following
exception: if the D_ SENSE bit is set to zero (i.e., fixed format sense
data), then the SATL should return fixed format sense data for ATA
PASS-THROUGH commands."

The libata SATL has always kept D_SENSE set to zero by default. (It is
however possible to change the value using a MODE SELECT SG_IO command.)

Failed ATA PASS-THROUGH commands correctly respected the D_SENSE bit,
however, successful ATA PASS-THROUGH commands incorrectly returned the
sense data in descriptor format (regardless of the D_SENSE bit).

Commit 28ab976911 ("ata: libata-scsi: Honor the D_SENSE bit for
CK_COND=1 and no error") fixed this bug for successful ATA PASS-THROUGH
commands.

However, after commit 28ab976911 ("ata: libata-scsi: Honor the D_SENSE
bit for CK_COND=1 and no error"), there were bug reports that hdparm,
hddtemp, and udisks were no longer working as expected.

These applications incorrectly assume the returned sense data is in
descriptor format, without even looking at the RESPONSE CODE field in the
returned sense data (to see which format the returned sense data is in).

Considering that there will be broken versions of these applications around
roughly forever, we are stuck with being bug compatible with older kernels.

Cc: stable@vger.kernel.org # 4.19+
Reported-by: Stephan Eisvogel <eisvogel@seitics.de>
Reported-by: Christian Heusel <christian@heusel.eu>
Closes: https://lore.kernel.org/linux-ide/0bf3f2f0-0fc6-4ba5-a420-c0874ef82d64@heusel.eu/
Fixes: 28ab976911 ("ata: libata-scsi: Honor the D_SENSE bit for CK_COND=1 and no error")
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Link: https://lore.kernel.org/r/20240813131900.1285842-2-cassel@kernel.org
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-08-19 06:00:07 +02:00
..
acard-ahci.c ata: add/use ata_taskfile::{error|status} fields 2022-02-20 09:06:05 +09:00
ahci_brcm.c ata: ahci_brcm: Fix compilation warning 2022-10-18 08:01:57 +09:00
ahci_ceva.c ata: ahci_ceva: fix error handling for Xilinx GT PHY support 2024-03-01 13:26:36 +01:00
ahci_da850.c ata: libahci_platform: Convert to using devm bulk clocks API 2022-09-17 01:39:22 +09:00
ahci_dm816.c ata: libahci_platform: Convert to using devm bulk clocks API 2022-09-17 01:39:22 +09:00
ahci_dwc.c ata: ahci-dwc: Add Baikal-T1 AHCI SATA interface support 2022-09-17 01:40:31 +09:00
ahci_imx.c ata: ahci_imx: Fix compilation warning 2022-10-18 08:02:14 +09:00
ahci_mtk.c ata: libahci_platform: Parse ports-implemented property in resources getter 2022-09-17 01:39:30 +09:00
ahci_mvebu.c Char/Misc and other driver updates for 5.18-rc1 2022-03-28 12:27:35 -07:00
ahci_octeon.c ata: Drop commas after OF match table sentinels 2022-03-07 11:49:10 +09:00
ahci_platform.c ata: ahci: Add DWC AHCI SATA controller support 2022-09-17 01:40:15 +09:00
ahci_qoriq.c ata: ahci_qoriq: Fix compilation warning 2022-10-18 08:02:14 +09:00
ahci_seattle.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 235 2019-06-19 17:09:07 +02:00
ahci_st.c ata: ahci_st: Fix compilation warning 2022-10-17 22:01:57 +09:00
ahci_sunxi.c ata: Drop commas after OF match table sentinels 2022-03-07 11:49:10 +09:00
ahci_tegra.c ata: ahci_tegra: call tegra_powergate_power_off only when PM domain is not present 2021-04-11 20:35:08 -06:00
ahci_xgene.c ata: ahci_xgene: Fix compilation warning 2022-10-18 08:02:14 +09:00
ahci.c ata: ahci: Clean up sysfs file on error 2024-07-05 09:31:59 +02:00
ahci.h ahci: add 43-bit DMA address quirk for ASMedia ASM1061 controllers 2024-03-01 13:26:26 +01:00
ata_generic.c ata: ata_generic: Fix misspelling of 'ata_generic_init_one()' 2021-03-30 20:21:26 -06:00
ata_piix.c ata: libata: make ata_host_suspend() *void* 2022-02-19 11:18:35 +09:00
Kconfig ata: pata_cs5535: Don't build on UML 2023-02-01 08:34:34 +01:00
libahci_platform.c ata: libahci_platform: ahci_platform_find_clk: oops, NULL pointer 2022-12-07 08:36:37 +09:00
libahci.c ata: libahci: clear pending interrupt status 2023-09-23 11:11:12 +02:00
libata-acpi.c ata: make transfer mode masks *unsigned int* 2022-06-17 16:35:02 +09:00
libata-core.c ata: libata-core: Fix double free on error 2024-07-05 09:31:59 +02:00
libata-eh.c scsi: sd: Fix TCG OPAL unlock on system resume 2024-04-03 15:19:51 +02:00
libata-pata-timings.c ata: separate PATA timings code from libata-core.c 2020-03-26 10:28:19 -06:00
libata-pmp.c ata: libata: add tracepoints for ATA error handling 2022-01-05 19:33:01 +09:00
libata-sata.c ata: libata: disallow dev-initiated LPM transitions to unsupported states 2023-09-23 11:11:12 +02:00
libata-scsi.c Revert "ata: libata-scsi: Honor the D_SENSE bit for CK_COND=1 and no error" 2024-08-19 06:00:07 +02:00
libata-sff.c ata: libata-sff: Fix double word in comments 2022-09-16 23:24:06 +09:00
libata-trace.c ata: libata-sff: tracepoints for HSM state machine 2022-01-05 19:33:01 +09:00
libata-transport.c ata: libata-core: Do not register PM operations for SAS ports 2023-10-06 14:57:05 +02:00
libata-transport.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
libata-zpodd.c libata: zpodd: Fix small read overflow in zpodd_get_mech_type() 2019-07-29 16:00:14 -06:00
libata.h ata: libata-scsi: Disable scsi device manage_system_start_stop 2023-10-19 23:08:50 +02:00
Makefile ata: ahci: Add DWC AHCI SATA controller support 2022-09-17 01:40:15 +09:00
pata_acpi.c ata: make transfer mode masks *unsigned int* 2022-06-17 16:35:02 +09:00
pata_ali.c ata: make transfer mode masks *unsigned int* 2022-06-17 16:35:02 +09:00
pata_amd.c ata: make transfer mode masks *unsigned int* 2022-06-17 16:35:02 +09:00
pata_arasan_cf.c ata: pata_arasan_cf: Use dev_err_probe() instead dev_err() in data_xfer() 2023-09-13 09:42:23 +02:00
pata_artop.c ata: pata_artop: use *switch* in atp8xx_fixup() 2022-02-19 11:18:42 +09:00
pata_atiixp.c ata: pata_atiixp: make static read-only arrays const 2022-01-31 09:58:32 +09:00
pata_atp867x.c ata: pata_atp867x: convert printk() calls 2022-01-05 19:33:02 +09:00
pata_bk3710.c pata_bk3710: clarify license version and use SPDX header 2018-03-01 13:59:03 -08:00
pata_buddha.c ata/pata_buddha: Probe via modalias instead of initcall 2019-08-23 06:58:50 -06:00
pata_cmd64x.c ata: pata_cmd64x: convert printk() calls 2022-01-05 19:33:03 +09:00
pata_cmd640.c ata: pata_cmd640: convert printk() calls 2022-01-05 19:33:02 +09:00
pata_cs5520.c ata: libata: make ata_host_suspend() *void* 2022-02-19 11:18:35 +09:00
pata_cs5530.c ata: pata_cs5530: Avoid overwriting initialised field in 'cs5530_sht' 2021-06-16 06:50:25 -06:00
pata_cs5535.c ata: pata_cs5535: Fix W=1 warnings 2022-06-30 08:21:43 +09:00
pata_cs5536.c ata: pata_cs5536: convert printk() calls 2022-01-05 19:33:03 +09:00
pata_cypress.c ata: pata_cypress: convert printk() calls 2022-01-05 19:33:03 +09:00
pata_efar.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
pata_ep93xx.c ata: add/use ata_taskfile::{error|status} fields 2022-02-20 09:06:05 +09:00
pata_falcon.c ata: pata_falcon: fix IO base selection for Q40 2023-09-19 12:28:05 +02:00
pata_ftide010.c ata: pata_ftide010: Add missing MODULE_DESCRIPTION 2023-09-19 12:28:05 +02:00
pata_gayle.c ata: add Amiga Gayle PATA controller driver 2018-03-19 07:41:36 -07:00
pata_hpt3x2n.c ata: make transfer mode masks *unsigned int* 2022-06-17 16:35:02 +09:00
pata_hpt3x3.c libata: switch remaining drivers to use dma_set_mask_and_coherent 2019-08-26 13:58:59 -06:00
pata_hpt37x.c ata: make transfer mode masks *unsigned int* 2022-06-17 16:35:02 +09:00
pata_hpt366.c ata: make transfer mode masks *unsigned int* 2022-06-17 16:35:02 +09:00
pata_icside.c ata: Avoid comma separated statements 2021-01-31 08:05:46 -07:00
pata_imx.c ata: libata: make ata_host_suspend() *void* 2022-02-19 11:18:35 +09:00
pata_isapnp.c ata: pata_isapnp: Add missing error check for devm_ioport_map() 2023-12-03 07:32:07 +01:00
pata_it821x.c ata: fix read_id() ata port operation interface 2022-01-14 15:17:16 +09:00
pata_it8213.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
pata_ixp4xx_cf.c ata: Drop commas after OF match table sentinels 2022-03-07 11:49:10 +09:00
pata_jmicron.c ata: pata_jmicron: Fix incorrectly documented function parameter 2021-03-12 07:28:31 -07:00
pata_legacy.c ata: pata_legacy: make legacy_exit() work again 2024-06-16 13:41:33 +02:00
pata_macio.c ata: pata_macio: Remove unneeded word in comments 2022-09-16 23:24:06 +09:00
pata_marvell.c ata: pata_marvell: Check the 'bmdma_addr' beforing reading 2022-04-22 08:45:06 +09:00
pata_mpc52xx.c powerpc/mpc5xxx: Switch mpc5xxx_get_bus_frequency() to use fwnode 2022-06-22 12:51:49 +10:00
pata_mpiix.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
pata_netcell.c ata: fix read_id() ata port operation interface 2022-01-14 15:17:16 +09:00
pata_ninja32.c libata: switch remaining drivers to use dma_set_mask_and_coherent 2019-08-26 13:58:59 -06:00
pata_ns87410.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 18 2019-05-21 11:28:46 +02:00
pata_ns87415.c ata: pata_ns87415: mark ns87560_tf_read static 2023-08-03 10:24:07 +02:00
pata_octeon_cf.c ata: pata_octeon_cf: Fix refcount leak in octeon_cf_probe 2022-06-06 09:52:17 +09:00
pata_of_platform.c ata: Drop commas after OF match table sentinels 2022-03-07 11:49:10 +09:00
pata_oldpiix.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
pata_opti.c ata: pata_opti: Fix spelling issue of 'val' in 'opti_write_reg()' 2021-03-30 20:21:26 -06:00
pata_optidma.c pata_optidma: fix checking of DMA state 2021-10-12 17:46:59 +09:00
pata_palmld.c ata: palmld: fix return value check in palmld_pata_probe() 2022-10-31 20:28:05 +09:00
pata_pcmcia.c pata_pcmia: add SanDisk High (>8G) CF card to supported list 2020-01-29 20:54:51 -07:00
pata_pdc202xx_old.c ata: pata_pdc202xx_old: make static read-only array pio_timing const 2022-01-31 09:58:32 +09:00
pata_pdc2027x.c ata: make transfer mode masks *unsigned int* 2022-06-17 16:35:02 +09:00
pata_piccolo.c ata: pata_piccolo: 'ata_tosh_init()' is misnamed in its header 2021-03-30 20:21:25 -06:00
pata_platform.c ata: pata_platform: Make use of platform_get_mem_or_io() 2022-01-31 09:58:31 +09:00
pata_pxa.c ata: pata_pxa: Use platform_get_irq() to get the interrupt 2022-03-10 11:17:59 +09:00
pata_radisys.c pata_radisys: fix checking of DMA state 2021-10-12 17:47:02 +09:00
pata_rb532_cf.c ata: rb532_cf: remove redundant codes 2021-06-24 18:49:01 -06:00
pata_rdc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 18 2019-05-21 11:28:46 +02:00
pata_rz1000.c ata: pata_rz1000: convert printk() calls 2022-01-05 19:33:03 +09:00
pata_samsung_cf.c ata: add/use ata_taskfile::{error|status} fields 2022-02-20 09:06:05 +09:00
pata_sc1200.c ata: pata_sc1200: sc1200_sht'Avoid overwriting initialised field in ' 2021-06-16 06:50:25 -06:00
pata_sch.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 300 2019-06-05 17:37:00 +02:00
pata_serverworks.c ata: make transfer mode masks *unsigned int* 2022-06-17 16:35:02 +09:00
pata_sil680.c ata: pata_sil680: fix result type of sil680_sel{dev|reg}() 2022-04-13 12:42:51 +09:00
pata_sis.c ata: make transfer mode masks *unsigned int* 2022-06-17 16:35:02 +09:00
pata_sl82c105.c ata: pata_sl82c105: Fix potential doc-rot 2021-03-30 20:21:25 -06:00
pata_triflex.c ata: libata: make ata_host_suspend() *void* 2022-02-19 11:18:35 +09:00
pata_via.c ata: make transfer mode masks *unsigned int* 2022-06-17 16:35:02 +09:00
pdc_adma.c ata: pdc_adma: Drop pointless VPRINTK() calls and remove disabled NCQ debugging 2022-01-05 19:33:01 +09:00
sata_dwc_460ex.c ata: sata_dwc_460ex: Fix crash due to OOB write 2022-04-04 09:56:34 +09:00
sata_fsl.c ata changes for 5.18-rc1 2022-03-23 14:35:59 -07:00
sata_gemini.c ata: sata_gemini: Check clk_enable() result 2024-05-17 11:56:05 +02:00
sata_gemini.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sata_highbank.c ata: Drop commas after OF match table sentinels 2022-03-07 11:49:10 +09:00
sata_inic162x.c ata: add/use ata_taskfile::{error|status} fields 2022-02-20 09:06:05 +09:00
sata_mv.c ata: sata_mv: Fix PCI device ID table declaration compilation warning 2024-04-10 16:28:31 +02:00
sata_nv.c ata: sata_nv: drop pointless VPRINTK() calls and convert remaining ones 2022-01-05 19:33:02 +09:00
sata_promise.c ata: sata_promise: Drop pointless VPRINTK() calls and convert the remaining ones 2022-01-05 19:33:01 +09:00
sata_promise.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 18 2019-05-21 11:28:46 +02:00
sata_qstor.c ata: sata_qstor: Drop pointless VPRINTK() calls 2022-01-05 19:33:02 +09:00
sata_rcar.c ata: sata_rcar: Fix compilation warning 2022-10-18 08:01:45 +09:00
sata_sil24.c ata: libata: add reset tracepoints 2022-01-04 20:00:57 +09:00
sata_sil.c ata: sata_sil: Drop pointless VPRINTK() calls 2022-01-05 19:33:02 +09:00
sata_sis.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 18 2019-05-21 11:28:46 +02:00
sata_svw.c ata: add/use ata_taskfile::{error|status} fields 2022-02-20 09:06:05 +09:00
sata_sx4.c ata: sata_sx4: fix pdc20621_get_from_dimm() on 64-bit 2024-04-10 16:28:31 +02:00
sata_uli.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 18 2019-05-21 11:28:46 +02:00
sata_via.c libata: switch remaining drivers to use dma_set_mask_and_coherent 2019-08-26 13:58:59 -06:00
sata_vsc.c ata: add/use ata_taskfile::{error|status} fields 2022-02-20 09:06:05 +09:00
sis.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00