lkml.org 
[lkml]   [2021]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.11 522/775] PCI: cadence: Fix DMA range mapping early return error
    Date
    From: Krzysztof Wilczyński <kw@linux.com>

    [ Upstream commit 1002573ee33efef0988a9a546c075a9fa37d2498 ]

    Function cdns_pcie_host_map_dma_ranges() iterates over a PCIe host bridge
    DMA ranges using the resource_list_for_each_entry() iterator, returning an
    error if cdns_pcie_host_bar_config() fails.

    49e427e6bdd1 ("Merge branch 'pci/host-probe-refactor'") botched a merge so
    it *always* returned after the first DMA range, even if no error occurred.

    Fix the error checking so we return early only when an error occurs.

    [bhelgaas: commit log]
    Fixes: 49e427e6bdd1 ("Merge branch 'pci/host-probe-refactor'")
    Link: https://lore.kernel.org/r/20210216205935.3112661-1-kw@linux.com
    Signed-off-by: Krzysztof Wilczyński <kw@linux.com>
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/pci/controller/cadence/pcie-cadence-host.c | 5 +++--
    1 file changed, 3 insertions(+), 2 deletions(-)

    diff --git a/drivers/pci/controller/cadence/pcie-cadence-host.c b/drivers/pci/controller/cadence/pcie-cadence-host.c
    index 811c1cb2e8deb..1cb7cfc75d6e4 100644
    --- a/drivers/pci/controller/cadence/pcie-cadence-host.c
    +++ b/drivers/pci/controller/cadence/pcie-cadence-host.c
    @@ -321,9 +321,10 @@ static int cdns_pcie_host_map_dma_ranges(struct cdns_pcie_rc *rc)

    resource_list_for_each_entry(entry, &bridge->dma_ranges) {
    err = cdns_pcie_host_bar_config(rc, entry);
    - if (err)
    + if (err) {
    dev_err(dev, "Fail to configure IB using dma-ranges\n");
    - return err;
    + return err;
    + }
    }

    return 0;
    --
    2.27.0


    \
     
     \ /
      Last update: 2021-03-02 05:40    [W:2.038 / U:0.128 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site