projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1f1607d
)
soc/tegra: fuse: Warn if accessing unmapped registers
author
Thierry Reding
<treding@nvidia.com>
Mon, 26 Jun 2017 15:23:27 +0000
(17:23 +0200)
committer
Thierry Reding
<treding@nvidia.com>
Wed, 13 Dec 2017 11:43:31 +0000
(12:43 +0100)
If the FUSE registers are accessed but the region is not mapped, warn
and return 0. This potentially catches hard to diagnose bugs because the
accesses happen before any kernel log output.
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/soc/tegra/fuse/fuse-tegra30.c
patch
|
blob
|
history
diff --git
a/drivers/soc/tegra/fuse/fuse-tegra30.c
b/drivers/soc/tegra/fuse/fuse-tegra30.c
index 497eb044095fe249c9875e117ff47017b247b624..257e254c6137f806e6cf77112184ce4796bf0257 100644
(file)
--- a/
drivers/soc/tegra/fuse/fuse-tegra30.c
+++ b/
drivers/soc/tegra/fuse/fuse-tegra30.c
@@
-50,6
+50,9
@@
defined(CONFIG_ARCH_TEGRA_186_SOC)
static u32 tegra30_fuse_read_early(struct tegra_fuse *fuse, unsigned int offset)
{
+ if (WARN_ON(!fuse->base))
+ return 0;
+
return readl_relaxed(fuse->base + FUSE_BEGIN + offset);
}