]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
firmware: tegra: Defer BPMP probe if shared memory not available
authorJon Hunter <jonathanh@nvidia.com>
Wed, 20 May 2020 15:12:06 +0000 (16:12 +0100)
committerThierry Reding <treding@nvidia.com>
Fri, 22 May 2020 12:57:14 +0000 (14:57 +0200)
Since commit 93d2e4322aa7 ("of: platform: Batch fwnode parsing when
adding all top level devices") was added, the probing of the Tegra
SRAM device has occurred later in the boot sequence, after the BPMP
has been probed. The BPMP uses sections of the SRAM for shared memory
and if the BPMP is probed before the SRAM then it fails to probe and
never tries again. This is causing a boot failure on Tegra186 and
Tegra194. Fix this by allowing the probe of the BPMP to be deferred if
the SRAM is not available yet.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/firmware/tegra/bpmp-tegra186.c

index ea308751635f82d6945b8dfda24b347fec62fe14..63ab21d89c2c420f14f6f5ed0b180cdca3908b66 100644 (file)
@@ -176,7 +176,7 @@ static int tegra186_bpmp_init(struct tegra_bpmp *bpmp)
        priv->tx.pool = of_gen_pool_get(bpmp->dev->of_node, "shmem", 0);
        if (!priv->tx.pool) {
                dev_err(bpmp->dev, "TX shmem pool not found\n");
-               return -ENOMEM;
+               return -EPROBE_DEFER;
        }
 
        priv->tx.virt = gen_pool_dma_alloc(priv->tx.pool, 4096, &priv->tx.phys);
@@ -188,7 +188,7 @@ static int tegra186_bpmp_init(struct tegra_bpmp *bpmp)
        priv->rx.pool = of_gen_pool_get(bpmp->dev->of_node, "shmem", 1);
        if (!priv->rx.pool) {
                dev_err(bpmp->dev, "RX shmem pool not found\n");
-               err = -ENOMEM;
+               err = -EPROBE_DEFER;
                goto free_tx;
        }