summaryrefslogtreecommitdiff
path: root/scripts/stackusage
diff options
context:
space:
mode:
authorNiklas Cassel <cassel@kernel.org>2024-12-13 15:33:02 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-02-17 10:05:21 +0100
commit36786d1a45c6306e34af4c99fec828b346c133de (patch)
treeb70f35c1e91b317be87da9d7000cb2c273ff136c /scripts/stackusage
parent3d17a4bbf257f8533f3c0d024cf15cf83d209e27 (diff)
downloadlinux-36786d1a45c6306e34af4c99fec828b346c133de.tar.gz
linux-36786d1a45c6306e34af4c99fec828b346c133de.tar.bz2
linux-36786d1a45c6306e34af4c99fec828b346c133de.zip
PCI: dwc: ep: Write BAR_MASK before iATU registers in pci_epc_set_bar()
commit 33a6938e0c3373f2d11f92d098f337668cd64fdd upstream. The "DesignWare Cores PCI Express Controller Register Descriptions, Version 4.60a", section "1.21.70 IATU_LWR_TARGET_ADDR_OFF_INBOUND_i", fields LWR_TARGET_RW and LWR_TARGET_HW both state that: "Field size depends on log2(BAR_MASK+1) in BAR match mode." I.e. only the upper bits are writable, and the number of writable bits is dependent on the configured BAR_MASK. If we do not write the BAR_MASK before writing the iATU registers, we are relying the reset value of the BAR_MASK being larger than the requested BAR size (which is supplied in the struct pci_epf_bar which is passed to pci_epc_set_bar()). The reset value of the BAR_MASK is SoC dependent. Thus, if the struct pci_epf_bar requests a BAR size that is larger than the reset value of the BAR_MASK, the iATU will try to write to read-only bits, which will cause the iATU to end up redirecting to a physical address that is different from the address that was intended. Thus, we should always write the iATU registers after writing the BAR_MASK. Fixes: f8aed6ec624f ("PCI: dwc: designware: Add EP mode support") Link: https://lore.kernel.org/r/20241213143301.4158431-9-cassel@kernel.org Signed-off-by: Niklas Cassel <cassel@kernel.org> Signed-off-by: Krzysztof WilczyƄski <kwilczynski@kernel.org> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'scripts/stackusage')
0 files changed, 0 insertions, 0 deletions