]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
PCI: spear: Fix dw_pcie_cfg_read/write() usage
authorGabriele Paoloni <gabriele.paoloni@huawei.com>
Thu, 8 Oct 2015 19:27:38 +0000 (14:27 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 19 Feb 2016 22:28:27 +0000 (14:28 -0800)
commit1d9e01c3e770d03bd1be12f17c33d7e3e778c220
tree9fb730e242043c2fb30f5bcb735f1c4daf7bc352
parent5b33b092fd14b468a976cd9c7a560cccd23fe4a5
PCI: spear: Fix dw_pcie_cfg_read/write() usage

commit fa3b7cbab548b15da438b0cc13aa515f7f291f4d upstream.

The first argument of dw_pcie_cfg_read/write() is a 32-bit aligned address.
The second argument is the byte offset into a 32-bit word, and
dw_pcie_cfg_read/write() only look at the low two bits.

SPEAr13xx used dw_pcie_cfg_read() and dw_pcie_cfg_write() incorrectly: it
passed important address bits in the second argument, where they were
ignored.

Pass the complete 32-bit word address in the first argument and only the
2-bit offset into that word in the second argument.

Without this fix, SPEAr13xx host will never work with few buggy gen1 card
which connects with only gen1 host and also with any endpoint which would
generate a read request of more than 128 bytes.

[bhelgaas: changelog]
Reported-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Pratyush Anand <panand@redhat.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pci/host/pcie-spear13xx.c