linux/drivers
Niklas Cassel 54603e8a88 ata: libata: disallow dev-initiated LPM transitions to unsupported states
commit 24e0e61db3 upstream.

In AHCI 1.3.1, the register description for CAP.SSC:
"When cleared to ‘0’, software must not allow the HBA to initiate
transitions to the Slumber state via agressive link power management nor
the PxCMD.ICC field in each port, and the PxSCTL.IPM field in each port
must be programmed to disallow device initiated Slumber requests."

In AHCI 1.3.1, the register description for CAP.PSC:
"When cleared to ‘0’, software must not allow the HBA to initiate
transitions to the Partial state via agressive link power management nor
the PxCMD.ICC field in each port, and the PxSCTL.IPM field in each port
must be programmed to disallow device initiated Partial requests."

Ensure that we always set the corresponding bits in PxSCTL.IPM, such that
a device is not allowed to initiate transitions to power states which are
unsupported by the HBA.

DevSleep is always initiated by the HBA, however, for completeness, set the
corresponding bit in PxSCTL.IPM such that agressive link power management
cannot transition to DevSleep if DevSleep is not supported.

sata_link_scr_lpm() is used by libahci, ata_piix and libata-pmp.
However, only libahci has the ability to read the CAP/CAP2 register to see
if these features are supported. Therefore, in order to not introduce any
regressions on ata_piix or libata-pmp, create flags that indicate that the
respective feature is NOT supported. This way, the behavior for ata_piix
and libata-pmp should remain unchanged.

This change is based on a patch originally submitted by Runa Guo-oc.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Fixes: 1152b2617a ("libata: implement sata_link_scr_lpm() and make ata_dev_set_feature() global")
Cc: stable@vger.kernel.org
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2023-09-23 11:10:02 +02:00
..
accessibility tty: fix possible null-ptr-defer in spk_ttyio_release 2023-01-24 07:22:46 +01:00
acpi ACPI: x86: s2idle: Catch multiple ACPI_TYPE_PACKAGE objects 2023-09-23 11:09:55 +02:00
amba amba: bus: fix refcount leak 2023-09-19 12:22:47 +02:00
android binder: fix memory leak in binder_init() 2023-08-16 18:21:59 +02:00
ata ata: libata: disallow dev-initiated LPM transitions to unsupported states 2023-09-23 11:10:02 +02:00
atm atm: idt77252: fix kmemleak when rmmod idt77252 2023-03-30 12:47:48 +02:00
auxdisplay auxdisplay: hd44780: Fix potential memory leak in hd44780_remove() 2023-03-11 13:57:22 +01:00
base driver core: test_async: fix an error code 2023-09-19 12:22:45 +02:00
bcma Driver core update for 5.15-rc1 2021-09-01 08:44:42 -07:00
block pcd: fix error codes in pcd_init_unit() 2023-09-19 12:23:04 +02:00
bluetooth Bluetooth: btusb: Do not call kfree_skb() under spin_lock_irqsave() 2023-09-19 12:22:34 +02:00
bus bus: ti-sysc: Configure uart quirks for k3 SoC 2023-09-23 11:09:57 +02:00
cdrom scsi: sr: cdrom: Move cdrom_read_cdda_bpc() into the sr driver 2021-07-30 22:13:09 -04:00
char tpm_tis: Resend command to recover from data transfer errors 2023-09-23 11:09:56 +02:00
clk clk: qcom: mss-sc7180: fix missing resume during probe 2023-09-19 12:22:56 +02:00
clocksource clocksource/drivers/cadence-ttc: Fix memory leak in ttc_timer_probe 2023-07-23 13:46:45 +02:00
comedi comedi: adv_pci1760: Fix PWM instruction handling 2023-01-24 07:22:45 +01:00
connector net/connector: Add const qualifier to cb_id 2020-12-16 11:06:49 -08:00
counter counter: 104-quad-8: Fix race condition between FLAG and CNTR reads 2023-04-26 13:51:55 +02:00
cpufreq cpufreq: brcmstb-avs-cpufreq: Fix -Warray-bounds bug 2023-09-19 12:22:52 +02:00
cpuidle powerpc/pseries: Rework lppaca_shared_proc() to avoid DEBUG_PREEMPT 2023-09-19 12:22:42 +02:00
crypto crypto: stm32 - fix loop iterating through scatterlist for DMA 2023-09-19 12:22:52 +02:00
cxl cxl/port: Hold port reference until decoder release 2022-07-12 16:34:58 +02:00
dax dax/kmem: Pass valid argument to memory_group_register_static 2023-07-23 13:47:17 +02:00
dca dca: Use PTR_ERR_OR_ZERO() to simplify code 2020-05-15 16:25:20 +02:00
devfreq PM / devfreq: Fix leak in devfreq_dev_release() 2023-09-19 12:22:50 +02:00
dio drivers: dio: fix possible memory leak in dio_init() 2022-12-31 13:14:27 +01:00
dma dmaengine: sh: rz-dmac: Fix destination and source data size setting 2023-09-19 12:23:01 +02:00
dma-buf dma-buf/sw_sync: Avoid recursive lock during fence signal 2023-08-30 16:18:21 +02:00
edac EDAC/igen6: Fix the issue of no error events 2023-09-19 12:22:40 +02:00
eisa EISA: use DEVICE_ATTR_RO() helper macro 2021-06-04 15:28:34 +02:00
extcon extcon: usbc-tusb320: Convert to i2c's .probe_new() 2023-07-23 13:47:31 +02:00
firewire firewire: net: fix use after free in fwnet_finish_incoming_packet() 2023-08-26 14:23:24 +02:00
firmware arm64: sdei: abort running SDEI handlers during crash 2023-09-19 12:22:52 +02:00
fpga fpga: bridge: fix kernel-doc parameter description 2023-05-11 23:00:31 +09:00
fsi fsi: aspeed: Reset master errors after CFAM reset 2023-09-19 12:22:46 +02:00
gnss treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
gpio gpio: mvebu: fix irq domain leak 2023-08-03 10:22:26 +02:00
gpu drm: gm12u320: Fix the timeout usage for usb_bulk_msg() 2023-09-23 11:10:01 +02:00
greybus greybus: svc: fix an error handling bug in gb_svc_hello() 2022-04-08 14:22:50 +02:00
hid HID: multitouch: Correct devm device reference for hidinput input_dev name 2023-09-19 12:22:48 +02:00
hsi HSI: omap_ssi_core: Fix error handling in ssi_init() 2022-12-31 13:14:32 +01:00
hv Drivers: hv: vmbus: Fix vmbus_wait_for_unload() to scan present CPUs 2023-06-28 10:29:42 +02:00
hwmon hwmon: (tmp513) Fix the channel number in tmp51x_is_visible() 2023-09-19 12:22:35 +02:00
hwspinlock hwspinlock: qcom: correct MMIO max register for newer SoCs 2022-11-16 09:58:13 +01:00
hwtracing coresight: tmc: Explicit type conversions to prevent integer overflow 2023-09-19 12:22:45 +02:00
i2c i2c: aspeed: Reset the i2c controller when timeout occurs 2023-09-23 11:10:02 +02:00
i3c i3c: master: svc: fix probe failure when no i3c device exist 2023-09-19 12:22:51 +02:00
idle intel_idle: Disable IBRS during long idle 2022-07-23 12:54:04 +02:00
iio iio: addac: stx104: Fix race condition when converting analog-to-digital 2023-08-26 14:23:27 +02:00
infiniband Revert "IB/isert: Fix incorrect release of isert connection" 2023-09-19 12:22:48 +02:00
input Input: tca6416-keypad - fix interrupt enable disbalance 2023-09-19 12:22:57 +02:00
interconnect interconnect: Fix locking for runpm vs reclaim 2023-09-23 11:09:59 +02:00
iommu iommu/vt-d: Fix to flush cache of PASID directory table 2023-09-19 12:22:46 +02:00
ipack ipack: ipoctal: fix module reference leak 2021-09-27 17:38:49 +02:00
irqchip irqchip/gic-v4.1: Properly lock VPEs when doing a directLPI invalidation 2023-08-03 10:22:45 +02:00
isdn mISDN: Update parameter type of dsp_cmx_send() 2023-08-16 18:22:01 +02:00
leds leds: trigger: tty: Do not use LED_ON/OFF constants, use led_blink_set_oneshot instead 2023-09-19 12:22:49 +02:00
macintosh macintosh: via-pmu-led: requires ATA to be set 2023-05-11 23:00:34 +09:00
mailbox mailbox: ti-msgmgr: Fill non-message tx data fields with 0x0 2023-07-23 13:47:28 +02:00
mcb mcb-pci: Reallocate memory region to avoid memory overlapping 2023-05-24 17:36:47 +01:00
md md/raid1: fix error: ISO C90 forbids mixed declarations 2023-09-23 11:10:01 +02:00
media media: pci: ipu3-cio2: Initialise timing struct to avoid a compiler warning 2023-09-23 11:09:59 +02:00
memory memory: brcmstb_dpfe: fix testing array offset after use 2023-07-23 13:47:03 +02:00
memstick memstick r592: make memstick_debug_get_tpc_name() static 2023-07-23 13:46:52 +02:00
message scsi: message: mptlan: Fix use after free bug in mptlan_remove() due to race condition 2023-05-24 17:36:45 +01:00
mfd mfd: pm8008: Fix module autoloading 2023-07-23 13:47:51 +02:00
misc misc: rtsx: judge ASPM Mode to set PETXCFG Reg 2023-08-16 18:21:59 +02:00
mmc mmc: sdhci-esdhc-imx: improve ESDHC_FLAG_ERR010450 2023-09-23 11:09:56 +02:00
most most: fix control-message timeouts 2021-11-18 19:16:08 +01:00
mtd mtd: rawnand: brcmnand: Fix ECC level field setting for v7.2 controller 2023-09-23 11:10:00 +02:00
mux mux: gpio: Simplify code by using dev_err_probe() 2021-04-02 16:28:53 +02:00
net wifi: mac80211_hwsim: drop short frames 2023-09-23 11:09:56 +02:00
nfc nfcsim.c: Fix error checking for debugfs_create_dir 2023-06-28 10:29:51 +02:00
ntb ntb: Fix calculation ntb_transport_tx_free_entry() 2023-09-19 12:22:51 +02:00
nubus nubus: Partially revert proc_create_single_data() conversion 2023-07-05 18:25:05 +01:00
nvdimm nvdimm: Fix badblocks clear off-by-one error 2022-07-07 17:53:24 +02:00
nvme nvme-rdma: fix potential unbalanced freeze & unfreeze 2023-08-16 18:22:03 +02:00
nvmem nvmem: rmem: Use NVMEM_DEVID_AUTO 2023-07-23 13:47:25 +02:00
of of: unittest: Fix overlay type in apply/revert check 2023-09-19 12:22:40 +02:00
opp OPP: Fix passing 0 to PTR_ERR in _opp_attach_genpd() 2023-09-19 12:22:31 +02:00
parisc parisc: led: Reduce CPU overhead for disk & lan LED computation 2023-09-19 12:22:55 +02:00
parport parport_pc: Avoid FIFO port location truncation 2022-11-26 09:24:36 +01:00
pci PCI: fu740: Set the number of MSI vectors 2023-09-23 11:09:58 +02:00
pcmcia pcmcia: rsrc_nonstatic: Fix memory leak in nonstatic_release_resource_db() 2023-08-26 14:23:24 +02:00
perf perf/imx_ddr: speed up overflow frequency of cycle 2023-09-23 11:09:55 +02:00
phy phy/rockchip: inno-hdmi: do not power on rk3328 post pll on reg write 2023-09-19 12:22:48 +02:00
pinctrl pinctrl: cherryview: fix address_space_handler() argument 2023-09-19 12:22:55 +02:00
platform platform/mellanox: mlxbf-pmc: Fix reading of unprogrammed events 2023-09-19 12:23:04 +02:00
pnp PNP: fix name memory leak in pnp_alloc_dev() 2022-12-31 13:14:02 +01:00
power power: supply: Fix logic checking if system is running from battery 2023-06-21 15:59:13 +02:00
powercap powercap: RAPL: Fix CONFIG_IOSF_MBI dependency 2023-07-23 13:46:46 +02:00
pps pps: clients: gpio: Propagate return value from pps_gpio_probe 2022-04-08 14:23:44 +02:00
ps3 powerpc/ps3: Warn on PS3 device errors 2021-06-10 21:44:58 +10:00
ptp ptp_qoriq: fix memory leak in probe() 2023-04-05 11:24:55 +02:00
pwm pwm: lpc32xx: Remove handling of PWM channels 2023-09-19 12:22:58 +02:00
rapidio rapidio: devices: fix missing put_device in mport_cdev_open 2022-12-31 13:14:05 +01:00
ras RAS/CEC: Correct ce_add_elem()'s returned values 2021-04-07 11:52:26 +02:00
regulator regulator: core: Streamline debugfs operations 2023-07-23 13:46:50 +02:00
remoteproc remoteproc: stm32_rproc: Add mutex protection for workqueue 2023-05-24 17:36:44 +01:00
reset reset: uniphier-glue: Fix possible null-ptr-deref 2023-02-01 08:27:04 +01:00
rpmsg rpmsg: glink: Add check for kstrdup 2023-09-19 12:22:48 +02:00
rtc rtc: ds1685: use EXPORT_SYMBOL_GPL for ds1685_rtc_poweroff 2023-09-06 21:28:37 +01:00
s390 s390/zcrypt: don't leak memory if dev_set_name() fails 2023-09-19 12:22:59 +02:00
sbus module: remove never implemented MODULE_SUPPORTED_DEVICE 2021-03-17 13:16:18 -07:00
scsi scsi: lpfc: Fix the NULL vs IS_ERR() bug for debugfs_create_file() 2023-09-23 11:10:01 +02:00
sh genirq: Add and use an irq_data_update_affinity helper 2023-03-11 13:57:31 +01:00
siox siox: fix possible memory leak in siox_device_add() 2022-11-26 09:24:36 +01:00
slimbus slimbus: stream: correct presence rate frequencies 2022-11-26 09:24:44 +01:00
soc soc: qcom: qmi_encdec: Restrict string length in decode 2023-09-19 12:22:56 +02:00
soundwire soundwire: fix enumeration completion 2023-08-11 15:14:00 +02:00
spi spi: tegra20-sflash: fix to check return value of platform_get_irq() in tegra_sflash_probe() 2023-09-19 12:22:32 +02:00
spmi spmi: Add a check for remove callback when removing a SPMI driver 2023-05-11 23:00:34 +09:00
ssb bus: Make remove callback return void 2021-07-21 11:53:42 +02:00
staging media: dvb: symbol fixup for dvb_attach() 2023-09-19 12:22:51 +02:00
target scsi: target: iscsi: Fix buffer overflow in lio_target_nacl_info_show() 2023-09-23 11:09:59 +02:00
tc The main MIPS changes for 5.6: 2020-01-31 11:28:31 -08:00
tee tee: amdtee: Add return_origin to 'struct tee_cmd_load_ta' 2023-06-14 11:13:06 +02:00
thermal thermal/drivers/sun8i: Fix some error handling paths in sun8i_ths_probe() 2023-07-23 13:46:46 +02:00
thunderbolt thunderbolt: Read retimer NVM authentication status prior tb_retimer_set_inbound_sbtx() 2023-08-26 14:23:24 +02:00
tty serial: cpm_uart: Avoid suspicious locking 2023-09-23 11:09:59 +02:00
uio uio: uio_dmem_genirq: Fix deadlock between irq config and handling 2022-12-31 13:14:27 +01:00
usb usb: ehci: add workaround for chipidea PORTSC.PEC bug 2023-09-23 11:09:59 +02:00
vdpa vduse: Use proper spinlock for IRQ injection 2023-08-26 14:23:30 +02:00
vfio vfio/type1: fix cap_migration information leak 2023-09-19 12:22:41 +02:00
vhost vhost_net: revert upend_idx only on retriable error 2023-06-28 10:29:53 +02:00
video backlight: gpio_backlight: Drop output GPIO direction check for initial power state 2023-09-19 12:22:57 +02:00
virt vboxguest: Do not use devm for irq 2022-08-25 11:40:33 +02:00
virtio virtio_ring: fix avail_wrap_counter in virtqueue_add_packed 2023-09-19 12:22:49 +02:00
visorbus visorbus: fix error return code in visorchipset_init() 2021-06-04 15:27:26 +02:00
vlynq bus: Make remove callback return void 2021-07-21 11:53:42 +02:00
vme vme: Fix error not catched in fake_init() 2022-12-31 13:14:30 +01:00
w1 w1: fix loop in w1_fini() 2023-07-23 13:47:20 +02:00
watchdog watchdog: intel-mid_wdt: add MODULE_ALIAS() to allow auto-load 2023-09-19 12:22:57 +02:00
xen xen/pvcalls-back: fix double frees with pvcalls_new_active_socket() 2023-05-30 13:55:32 +01:00
zorro zorro: Drop useless (and hardly used) .driver member in struct zorro_dev 2021-08-05 14:37:04 +02:00
Kconfig firmware: include drivers/firmware/Kconfig unconditionally 2021-10-07 16:51:26 +02:00
Makefile virtio: always enter drivers/virtio/ 2021-12-22 09:32:39 +01:00