mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] soc/tegra: fuse: Add clock error check in tegra_fuse_readl
@ 2019-08-28 11:18 Nagarjuna Kristam
  2019-09-02 10:45 ` Jon Hunter
  0 siblings, 1 reply; 3+ messages in thread
From: Nagarjuna Kristam @ 2019-08-28 11:18 UTC (permalink / raw)
  To: thierry.reding, jonathanh, kishon
  Cc: linux-tegra, linux-kernel, Nagarjuna Kristam

Tegra fuse clock handle is retrieved in tegra_fuse_probe().
tegra_fuse_readl() is exported symbol, which can be called from drivers
at any time. tegra_fuse_readl() enables fuse clock and reads corresponding
fuse register offset.

Calling tegra_fuse_readl() before tegra_fuse_probe(), will cause data
abort. Add DEFER_PROBE error check for fuse clock in tegra_fuse_readl(),
to avoid enabling of fuse clock, before clock is available.

Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com>
---
 drivers/soc/tegra/fuse/fuse-tegra.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soc/tegra/fuse/fuse-tegra.c b/drivers/soc/tegra/fuse/fuse-tegra.c
index 3eb44e6..21b39b7 100644
--- a/drivers/soc/tegra/fuse/fuse-tegra.c
+++ b/drivers/soc/tegra/fuse/fuse-tegra.c
@@ -186,7 +186,7 @@ u32 __init tegra_fuse_read_early(unsigned int offset)
 
 int tegra_fuse_readl(unsigned long offset, u32 *value)
 {
-	if (!fuse->read)
+	if (!fuse->read || (PTR_ERR(fuse->clk) == -EPROBE_DEFER))
 		return -EPROBE_DEFER;
 
 	*value = fuse->read(fuse, offset);
-- 
2.7.4


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

end of thread, other threads:[~2019-09-03  4:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-28 11:18 [PATCH] soc/tegra: fuse: Add clock error check in tegra_fuse_readl Nagarjuna Kristam
2019-09-02 10:45 ` Jon Hunter
2019-09-03  4:59   ` Nagarjuna Kristam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®