All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] memory: tegra: Correct driver probe order
@ 2018-05-26 14:20 Dmitry Osipenko
  2018-07-10 12:41 ` Dmitry Osipenko
  2018-07-10 15:30 ` Thierry Reding
  0 siblings, 2 replies; 3+ messages in thread
From: Dmitry Osipenko @ 2018-05-26 14:20 UTC (permalink / raw)
  To: Thierry Reding; +Cc: linux-tegra, linux-kernel

The Reset Controller should be registered in the end of probe, otherwise
Memory Controller device goes away if IRQ requesting fails and the Reset
Controller stays registered. To avoid having to unwind the MC probing in
a case of SMMU probe failure, let's simply print the error message without
failing the MC probe. This allows us to just move the Reset Controller
registering before the SMMU registration, reducing code churning. Also
let's not fail MC probe in a case of Reset Controller registration failure
as it doesn't prevent the MC driver to work.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 drivers/memory/tegra/mc.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/drivers/memory/tegra/mc.c b/drivers/memory/tegra/mc.c
index 22ec959db7d3..8ef95e34b5c7 100644
--- a/drivers/memory/tegra/mc.c
+++ b/drivers/memory/tegra/mc.c
@@ -692,13 +692,6 @@ static int tegra_mc_probe(struct platform_device *pdev)
 		return err;
 	}
 
-	err = tegra_mc_reset_setup(mc);
-	if (err < 0) {
-		dev_err(&pdev->dev, "failed to register reset controller: %d\n",
-			err);
-		return err;
-	}
-
 	mc->irq = platform_get_irq(pdev, 0);
 	if (mc->irq < 0) {
 		dev_err(&pdev->dev, "interrupt not specified\n");
@@ -717,13 +710,16 @@ static int tegra_mc_probe(struct platform_device *pdev)
 		return err;
 	}
 
+	err = tegra_mc_reset_setup(mc);
+	if (err < 0)
+		dev_err(&pdev->dev, "failed to register reset controller: %d\n",
+			err);
+
 	if (IS_ENABLED(CONFIG_TEGRA_IOMMU_SMMU)) {
 		mc->smmu = tegra_smmu_probe(&pdev->dev, mc->soc->smmu, mc);
-		if (IS_ERR(mc->smmu)) {
+		if (IS_ERR(mc->smmu))
 			dev_err(&pdev->dev, "failed to probe SMMU: %ld\n",
 				PTR_ERR(mc->smmu));
-			return PTR_ERR(mc->smmu);
-		}
 	}
 
 	return 0;
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v1] memory: tegra: Correct driver probe order
  2018-05-26 14:20 [PATCH v1] memory: tegra: Correct driver probe order Dmitry Osipenko
@ 2018-07-10 12:41 ` Dmitry Osipenko
  2018-07-10 15:30 ` Thierry Reding
  1 sibling, 0 replies; 3+ messages in thread
From: Dmitry Osipenko @ 2018-07-10 12:41 UTC (permalink / raw)
  To: Thierry Reding; +Cc: linux-tegra, linux-kernel

On Saturday, 26 May 2018 17:20:35 MSK Dmitry Osipenko wrote:
> The Reset Controller should be registered in the end of probe, otherwise
> Memory Controller device goes away if IRQ requesting fails and the Reset
> Controller stays registered. To avoid having to unwind the MC probing in
> a case of SMMU probe failure, let's simply print the error message without
> failing the MC probe. This allows us to just move the Reset Controller
> registering before the SMMU registration, reducing code churning. Also
> let's not fail MC probe in a case of Reset Controller registration failure
> as it doesn't prevent the MC driver to work.
> 
> Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
> ---

Thierry, this patch should be good to go.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1] memory: tegra: Correct driver probe order
  2018-05-26 14:20 [PATCH v1] memory: tegra: Correct driver probe order Dmitry Osipenko
  2018-07-10 12:41 ` Dmitry Osipenko
@ 2018-07-10 15:30 ` Thierry Reding
  1 sibling, 0 replies; 3+ messages in thread
From: Thierry Reding @ 2018-07-10 15:30 UTC (permalink / raw)
  To: Dmitry Osipenko; +Cc: linux-tegra, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 846 bytes --]

On Sat, May 26, 2018 at 05:20:35PM +0300, Dmitry Osipenko wrote:
> The Reset Controller should be registered in the end of probe, otherwise
> Memory Controller device goes away if IRQ requesting fails and the Reset
> Controller stays registered. To avoid having to unwind the MC probing in
> a case of SMMU probe failure, let's simply print the error message without
> failing the MC probe. This allows us to just move the Reset Controller
> registering before the SMMU registration, reducing code churning. Also
> let's not fail MC probe in a case of Reset Controller registration failure
> as it doesn't prevent the MC driver to work.
> 
> Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
> ---
>  drivers/memory/tegra/mc.c | 16 ++++++----------
>  1 file changed, 6 insertions(+), 10 deletions(-)

Applied, thanks.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-07-10 15:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-26 14:20 [PATCH v1] memory: tegra: Correct driver probe order Dmitry Osipenko
2018-07-10 12:41 ` Dmitry Osipenko
2018-07-10 15:30 ` Thierry Reding

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.