linux/drivers/pci
Blazej Kucman 5560a612c2 PCI: pciehp: Retain Power Indicator bits for userspace indicators
The sysfs "attention" file normally controls the Slot Control Attention
Indicator with 0 (off), 1 (on), 2 (blink) settings.

576243b3f9 ("PCI: pciehp: Allow exclusive userspace control of
indicators") added pciehp_set_raw_indicator_status() to allow userspace to
directly control all four bits in both the Attention Indicator and the
Power Indicator fields via the "attention" file.

This is used on Intel VMD bridges so utilities like "ledmon" can use sysfs
"attention" to control up to 16 indicators for NVMe device RAID status.

abaaac4845 ("PCI: hotplug: Use FIELD_GET/PREP()") broke this by masking
the sysfs data with PCI_EXP_SLTCTL_AIC, which discards the upper two bits
intended for the Power Indicator Control field (PCI_EXP_SLTCTL_PIC).

For NVMe devices behind an Intel VMD, ledmon settings that use the
PCI_EXP_SLTCTL_PIC bits, i.e., ATTENTION_REBUILD (0x5), ATTENTION_LOCATE
(0x7), ATTENTION_FAILURE (0xD), ATTENTION_OFF (0xF), no longer worked
correctly.

Mask with PCI_EXP_SLTCTL_AIC | PCI_EXP_SLTCTL_PIC to retain both the
Attention Indicator and the Power Indicator bits.

Fixes: abaaac4845 ("PCI: hotplug: Use FIELD_GET/PREP()")
Link: https://lore.kernel.org/r/20240722141440.7210-1-blazej.kucman@intel.com
Signed-off-by: Blazej Kucman <blazej.kucman@intel.com>
[bhelgaas: commit log]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: stable@vger.kernel.org	# v6.7+
2024-08-01 12:58:03 -05:00
..
controller Merge branch 'pci/misc' 2024-07-19 10:10:33 -05:00
endpoint Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
hotplug PCI: pciehp: Retain Power Indicator bits for userspace indicators 2024-08-01 12:58:03 -05:00
msi Switch ARM/ARM64 over to the modern per device MSI domains: 2024-07-22 14:02:19 -07:00
pcie Merge branch 'pci/misc' 2024-07-19 10:10:33 -05:00
pwrctl Kconfig: reduce the amount of power sequencing noise 2024-07-18 13:56:40 +02:00
switch PCI: switchtec: Make switchtec_class constant 2024-06-10 15:03:30 -05:00
access.c PCI: Revert the cfg_access_lock lockdep mechanism 2024-06-04 12:10:05 -05:00
ats.c PCI/ATS: Use FIELD_GET() 2023-10-24 16:55:45 -05:00
bus.c pci-v6.11-changes 2024-07-19 19:03:18 -07:00
devres.c PCI: Add managed pcim_iomap_range() 2024-07-11 16:20:15 -05:00
doe.c PCI/DOE: Support discovery version 2 2024-04-09 09:33:15 -05:00
ecam.c
host-bridge.c
iomap.c PCI: Document hybrid devres hazards 2024-07-10 04:20:01 +00:00
iov.c PCI: Use resource names in PCI log messages 2023-12-15 17:28:42 -06:00
irq.c PCI: Place interrupt related code into irq.c 2024-01-29 17:01:31 -06:00
Kconfig PCI/pwrctl: Add PCI power control core code 2024-06-12 13:20:56 +02:00
Makefile PCI/pwrctl: Add PCI power control core code 2024-06-12 13:20:56 +02:00
mmap.c PCI/sysfs: Compile pci-sysfs.c only if CONFIG_SYSFS=y 2024-03-05 16:08:43 -06:00
of_property.c PCI: of_property: Add interrupt-controller property in PCI device nodes 2024-07-08 17:40:30 -06:00
of.c pci-v6.11-changes 2024-07-19 19:03:18 -07:00
p2pdma.c PCI/P2PDMA: Fix a sleeping issue in a RCU read section 2024-02-08 15:31:43 -06:00
pci-acpi.c PCI: Move PRESERVE_BOOT_CONFIG _DSM evaluation to pci_register_host_bridge() 2024-06-03 16:13:38 -05:00
pci-bridge-emul.c
pci-bridge-emul.h
pci-driver.c driver core: have match() callback in struct bus_type take a const * 2024-07-03 15:16:54 +02:00
pci-label.c
pci-mid.c PCI/PM: Switch to new Intel CPU model defines 2024-06-11 17:08:14 -05:00
pci-pf-stub.c PCI: Add missing MODULE_DESCRIPTION() macros 2024-07-08 08:35:35 +00:00
pci-stub.c PCI: Add missing MODULE_DESCRIPTION() macros 2024-07-08 08:35:35 +00:00
pci-sysfs.c PCI/sysfs: Demacrofy pci_dev_resource_resize_attr(n) functions 2024-03-05 16:10:17 -06:00
pci.c PCI: Fix devres regression in pci_intx() 2024-08-01 12:56:06 -05:00
pci.h Merge branch 'pci/controller/rockchip' 2024-07-19 10:10:32 -05:00
probe.c pci-v6.11-changes 2024-07-19 19:03:18 -07:00
proc.c
quirks.c PCI: Add ACS quirk for Broadcom BCM5760X NIC 2024-05-28 11:13:28 -05:00
remove.c PCI/pwrctl: Create platform devices for child OF nodes of the port node 2024-06-12 13:20:56 +02:00
rom.c
search.c PCI: Add pci_get_base_class() helper 2023-09-28 16:49:44 -05:00
setup-bus.c PCI: Relax bridge window tail sizing rules 2024-06-12 14:51:30 -05:00
setup-res.c PCI: Use resource names in PCI log messages 2023-12-15 17:28:42 -06:00
slot.c PCI/sysfs: Constify struct kobj_type pci_slot_ktype 2023-02-16 12:00:25 -06:00
syscall.c PCI: Use consistent put_user() pointer types 2023-08-25 08:15:13 -05:00
vc.c PCI/VC: Use FIELD_GET() 2023-10-24 16:55:45 -05:00
vgaarb.c pci-v6.7-changes 2023-11-02 14:05:18 -10:00
vpd.c PCI/VPD: Add runtime power management to sysfs interface 2023-08-11 14:19:16 -05:00
xen-pcifront.c x86: always initialize xen-swiotlb when xen-pcifront is enabling 2023-07-31 17:54:27 +02:00