• Gabriele Paoloni's avatar
    PCI: spear: Fix dw_pcie_cfg_read/write() usage · fa3b7cba
    Gabriele Paoloni authored
    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: default avatarBjorn Helgaas <bhelgaas@google.com>
    Signed-off-by: default avatarPratyush Anand <panand@redhat.com>
    Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
    CC: stable@vger.kernel.org	# v3.17+
    fa3b7cba
pcie-spear13xx.c 10.5 KB