android_kernel_samsung_sm8650/drivers/pci
Jianjun Wang 69f0bebe91 PCI: mediatek-gen3: Fix translation window size calculation
[ Upstream commit 9ccc1318cf4bd90601f221268e42c3374703d681 ]

When using the fls() helper, the translation table should be a power of
two; otherwise, the resulting value will not be correct.

For example, given fls(0x3e00000) - 1 = 25, the PCIe translation window
size will be set to 0x2000000 instead of the expected size 0x3e00000.

Fix the translation window by splitting the MMIO space into multiple tables
if its size is not a power of two.

[kwilczynski: commit log]
Link: https://lore.kernel.org/linux-pci/20231023081423.18559-1-jianjun.wang@mediatek.com
Fixes: d3bf75b579 ("PCI: mediatek-gen3: Add MediaTek Gen3 driver for MT8192")
Signed-off-by: Jianjun Wang <jianjun.wang@mediatek.com>
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-01-25 15:27:48 -08:00
..
controller PCI: mediatek-gen3: Fix translation window size calculation 2024-01-25 15:27:48 -08:00
endpoint PCI: epf-test: Fix DMA transfer completion detection 2023-07-23 13:49:36 +02:00
hotplug Revert "PCI: acpiphp: Reassign resources on bridge if necessary" 2023-12-20 17:00:20 +01:00
msi
pcie Revert "PCI/ASPM: Remove pcie_aspm_pm_state_change()" 2024-01-10 17:10:20 +01:00
switch PCI: switchtec: Return -EFAULT for copy_to_user() errors 2023-03-10 09:33:31 +01:00
access.c PCI: Add locking to RMW PCI Express Capability Register accessors 2023-09-13 09:42:46 +02:00
ats.c
bus.c PCI: s390: Fix use-after-free of PCI resources with per-function hotplug 2023-03-22 13:33:45 +01:00
doe.c PCI/DOE: Fix destroy_work_on_stack() race 2023-09-13 09:42:45 +02:00
ecam.c
host-bridge.c
iov.c PCI/IOV: Enlarge virtfn sysfs name buffer 2023-03-10 09:33:31 +01:00
irq.c PCI: Check for alloc failure in pci_request_irq() 2022-12-31 13:32:33 +01:00
Kconfig
Makefile
mmap.c
of.c
p2pdma.c
pci-acpi.c PCI/sysfs: Protect driver's D3cold preference from user space 2023-11-28 17:07:08 +00:00
pci-bridge-emul.c
pci-bridge-emul.h
pci-driver.c PCI: Unify delay handling for reset and resume 2023-03-10 09:34:30 +01:00
pci-label.c
pci-mid.c
pci-pf-stub.c
pci-stub.c
pci-sysfs.c PCI/sysfs: Protect driver's D3cold preference from user space 2023-11-28 17:07:08 +00:00
pci.c Revert "PCI/ASPM: Remove pcie_aspm_pm_state_change()" 2024-01-10 17:10:20 +01:00
pci.h Revert "PCI/ASPM: Remove pcie_aspm_pm_state_change()" 2024-01-10 17:10:20 +01:00
probe.c PCI: Do error check on own line to split long "if" conditions 2023-11-28 17:07:00 +00:00
proc.c
quirks.c PCI: Add ACS quirk for more Zhaoxin Root Ports 2024-01-20 11:50:11 +01:00
remove.c
rom.c
search.c
setup-bus.c PCI: Distribute available resources for root buses, too 2023-03-11 13:55:38 +01:00
setup-irq.c
setup-res.c
slot.c
syscall.c
vc.c
vgaarb.c
vpd.c
xen-pcifront.c