mirror-linux/drivers
Huang Ying 970c0899a4 cxl/port: Fix decoder initialization when nr_targets > interleave_ways
commit d6488fee66 upstream.

The decoder_populate_targets() helper walks all of the targets in a port
and makes sure they can be looked up in @target_map. Where @target_map
is a lookup table from target position to target id (corresponding to a
cxl_dport instance). However @target_map is only responsible for
conveying the active dport instances as indicated by interleave_ways.

When nr_targets > interleave_ways it results in
decoder_populate_targets() walking off the end of the valid entries in
@target_map. Given target_map is initialized to 0 it results in the
dport lookup failing if position 0 is not mapped to a dport with an id
of 0:

  cxl_port port3: Failed to populate active decoder targets
  cxl_port port3: Failed to add decoder
  cxl_port port3: Failed to add decoder3.0
  cxl_bus_probe: cxl_port port3: probe: -6

This bug also highlights that when the decoder's ->targets[] array is
written in cxl_port_setup_targets() it is missing a hold of the
targets_lock to synchronize against sysfs readers of the target list. A
fix for that is saved for a later patch.

Fixes: a5c2580216 ("cxl/bus: Populate the target list at decoder create")
Cc:  <stable@vger.kernel.org>
Signed-off-by: Huang, Ying <ying.huang@intel.com>
[djbw: rewrite the changelog, find the Fixes: tag]
Co-developed-by: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: Alison Schofield <alison.schofield@intel.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-01-25 15:27:44 -08:00
..
accessibility
acpi ACPI: extlog: Clear Extended Error Log status when RAS_CEC handled the error 2024-01-25 15:27:21 -08:00
amba
android binder: fix race between mmput() and do_exit() 2024-01-25 15:27:39 -08:00
ata scsi: sd: Fix system start for ATA devices 2023-12-08 08:51:14 +01:00
atm atm: solos-pci: Fix potential deadlock on &tx_queue_lock 2023-12-20 17:00:16 +01:00
auxdisplay auxdisplay: hd44780: move cursor home after clear display command 2023-12-08 08:51:16 +01:00
base mm/memory_hotplug: add missing mem_hotplug_lock 2024-01-10 17:10:33 +01:00
bcma
block null_blk: don't cap max_hw_sectors to BLK_DEF_MAX_SECTORS 2024-01-25 15:27:30 -08:00
bluetooth Bluetooth: btmtkuart: fix recv_buf() return value 2024-01-25 15:27:30 -08:00
bus bus: ti-sysc: Flush posted write only after srst_udelay 2024-01-01 12:39:07 +00:00
cdrom
char hwrng: geode - fix accessing registers 2023-11-20 11:52:04 +01:00
clk clk: si5341: fix an error code problem in si5341_output_clk_set_rate 2024-01-25 15:27:36 -08:00
clocksource clocksource/drivers/timer-ti-dm: Fix make W=n kerneldoc warnings 2024-01-25 15:27:39 -08:00
comedi
connector
counter
cpufreq cpufreq: scmi: process the result of devm_of_clk_add_hw_provider() 2024-01-25 15:27:20 -08:00
cpuidle
crypto crypto: sahara - do not resize req->src when doing hash operations 2024-01-25 15:27:23 -08:00
cxl cxl/port: Fix decoder initialization when nr_targets > interleave_ways 2024-01-25 15:27:44 -08:00
dax
dca
devfreq PM / devfreq: rockchip-dfi: Make pmu regmap mandatory 2023-11-20 11:51:54 +01:00
dio
dma dmaengine: stm32-dma: avoid bitfield overflow assertion 2023-12-20 17:00:25 +01:00
dma-buf dma-buf: fix check in dma_resv_add_fence 2023-12-08 08:51:15 +01:00
edac EDAC/thunderx: Fix possible out-of-bounds string access 2024-01-25 15:27:18 -08:00
eisa
extcon
firewire firewire: ohci: suppress unexpected system reboot in AMD Ryzen machines and ASM108x/VT630x PCIe cards 2024-01-10 17:10:35 +01:00
firmware firmware: meson_sm: populate platform devices from sm device tree data 2024-01-25 15:27:24 -08:00
fpga
fsi
gnss
gpio gpio: dwapb: mask/unmask IRQ when disable/enale it 2024-01-01 12:39:07 +00:00
gpu drm/amd: Enable PCIe PME from D3 2024-01-25 15:27:42 -08:00
greybus
hid HID: nintendo: Prevent divide-by-zero on code 2024-01-20 11:50:09 +01:00
hsi
hte hte: tegra: Fix missing error code in tegra_hte_test_probe() 2023-11-20 11:51:58 +01:00
hv
hwmon hwmon: (corsair-psu) Fix probe when built-in 2024-01-20 11:50:06 +01:00
hwspinlock
hwtracing coresight: etm4x: Fix width of CCITMIN field 2024-01-20 11:50:11 +01:00
i2c i2c: rk3x: fix potential spinlock recursion on poll 2024-01-20 11:50:09 +01:00
i3c i3c: master: svc: fix random hot join failure since timeout error 2023-11-28 17:07:17 +00:00
idle
iio iio: imu: adis16475: add spi_device_id table 2024-01-05 15:18:37 +01:00
infiniband IB/iser: Prevent invalidating wrong MR 2024-01-25 15:27:38 -08:00
input Input: atkbd - use ab83 as id when skipping the getid command 2024-01-25 15:27:39 -08:00
interconnect Revert "interconnect: qcom: sm8250: Enable sync_state" 2024-01-10 17:10:37 +01:00
iommu iommu/dma: Trace bounce buffer usage when mapping buffers 2024-01-25 15:27:43 -08:00
ipack
irqchip irqchip/stm32-exti: add missing DT IRQ flag translation 2023-11-08 14:10:57 +01:00
isdn
leds leds: ledtrig-tty: Free allocated ttyname buffer on deactivate 2024-01-20 11:50:11 +01:00
macintosh
mailbox
mcb mcb: fix error handling for different scenarios when parsing 2023-11-28 17:07:13 +00:00
md md/raid1: Use blk_opf_t for read and write operations 2024-01-25 15:27:43 -08:00
media media: dvb-frontends: m88ds3103: Fix a memory leak in an error handling path of m88ds3103_probe() 2024-01-25 15:27:35 -08:00
memory
memstick
message
mfd mfd: qcom-spmi-pmic: Fix revid implementation 2023-11-28 17:07:12 +00:00
misc accel/habanalabs: fix information leak in sec_attest_info() 2024-01-25 15:27:37 -08:00
mmc mmc: sdhci_omap: Fix TI SoC dependencies 2024-01-25 15:27:38 -08:00
most
mtd mtd: Fix gluebi NULL pointer dereference caused by ftl notifier 2024-01-25 15:27:21 -08:00
mux
net wifi: mwifiex: configure BSSID consistently when starting AP 2024-01-25 15:27:43 -08:00
nfc
ntb
nubus
nvdimm nd_btt: Make BTT lanes preemptible 2023-11-20 11:52:05 +01:00
nvme nvme: prevent potential spectre v1 gadget 2024-01-20 11:50:06 +01:00
nvmem nvmem: imx: correct nregs for i.MX6UL 2023-11-02 09:35:31 +01:00
of of: unittest: Fix of_count_phandle_with_args() expected value message 2024-01-25 15:27:38 -08:00
opp
parisc parisc/power: Fix power soft-off when running on qemu 2023-11-28 17:07:14 +00:00
parport parport: parport_serial: Add Brainboxes device IDs and geometry 2024-01-20 11:50:11 +01:00
pci PCI: Add ACS quirk for more Zhaoxin Root Ports 2024-01-20 11:50:11 +01:00
pcmcia pcmcia: ds: fix possible name leak in error path in pcmcia_device_add() 2023-11-20 11:52:13 +01:00
peci
perf perf: hisi: Fix use-after-free when register pmu fails 2023-11-20 11:52:01 +01:00
phy phy: mapphone-mdm6600: Fix pinctrl_pm handling for sleep pins 2023-10-25 12:03:16 +02:00
pinctrl pinctrl: cy8c95x0: Fix get_pincfg 2024-01-20 11:50:09 +01:00
platform platform/x86/intel/vsec: Fix xa_alloc memory leak 2024-01-25 15:27:20 -08:00
pnp
power power: supply: core: Use blocking_notifier_call_chain to avoid RCU complaint 2023-11-08 14:11:02 +01:00
powercap powercap: DTPM: Fix missing cpufreq_cpu_put() calls 2023-12-13 18:39:21 +01:00
pps
ps3
ptp ptp: annotate data-race around q->head and q->tail 2023-11-28 17:07:05 +00:00
pwm pwm: Fix out-of-bounds access in of_pwm_single_xlate() 2024-01-25 15:27:42 -08:00
rapidio
ras
regulator regulator: mt6358: Fail probe on unknown chip ID 2023-11-20 11:51:56 +01:00
remoteproc
reset reset: hisilicon: hi6220: fix Wvoid-pointer-to-enum-cast warning 2024-01-20 11:50:07 +01:00
rpmsg
rtc rtc: pcf85363: fix wrong mask/val parameters in regmap_update_bits call 2023-11-20 11:52:13 +01:00
s390 s390/scm: fix virtual vs physical address confusion 2024-01-20 11:50:08 +01:00
sbus
scsi scsi: mpi3mr: Block PEL Enable Command on Controller Reset and Unrecoverable State 2024-01-25 15:27:42 -08:00
sh
siox
slimbus
soc soc: qcom: llcc: Fix dis_cap_alloc and retain_on_pc configuration 2024-01-25 15:27:28 -08:00
soundwire soundwire: stream: fix NULL pointer dereference for multi_link 2023-12-20 17:00:25 +01:00
spi spi: sh-msiof: Enforce fixed DTDL for R-Car H3 2024-01-25 15:27:20 -08:00
spmi
ssb
staging media: rkvdec: Hook the (TRY_)DECODER_CMD stateless ioctls 2024-01-25 15:27:32 -08:00
target scsi: target: core: add missing file_{start,end}_write() 2024-01-25 15:27:42 -08:00
tc
tee tee: optee: Fix supplicant based device enumeration 2023-12-13 18:39:12 +01:00
thermal thermal: core: prevent potential string overflow 2023-11-20 11:51:54 +01:00
thunderbolt thunderbolt: Fix memory leak in margining_port_remove() 2024-01-01 12:39:08 +00:00
tty serial: omap: do not override settings for RS485 support 2024-01-25 15:27:41 -08:00
ufs scsi: ufs: core: Simplify power management during async scan 2024-01-25 15:27:42 -08:00
uio uio: Fix use-after-free in uio_open 2024-01-20 11:50:10 +01:00
usb usb: mon: Fix atomicity violation in mon_bin_vma_fault 2024-01-25 15:27:40 -08:00
vdpa vdpa/mlx5: preserve CVQ vringh index 2023-12-13 18:39:03 +01:00
vfio
vhost vhost-vdpa: fix use after free in vhost_vdpa_probe() 2023-11-28 17:07:04 +00:00
video fbdev: flush deferred IO before closing 2024-01-25 15:27:42 -08:00
virt virt: sevguest: Fix passing a stack buffer as a scatterlist target 2023-11-20 11:52:13 +01:00
virtio virtio_pci: fix the common cfg map size 2023-11-02 09:35:23 +01:00
vlynq
w1
watchdog watchdog: rti_wdt: Drop runtime pm reference count when watchdog is unused 2024-01-25 15:27:36 -08:00
xen xen: simplify evtchn_do_upcall() call maze 2023-12-08 08:51:20 +01:00
zorro
Kconfig
Makefile