summaryrefslogtreecommitdiff
path: root/drivers/soc/tegra
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2017-06-26 18:23:27 +0300
committerThierry Reding <treding@nvidia.com>2017-12-13 14:43:31 +0300
commitda943840bcd2b490788d73c60ac4368fb7fc7229 (patch)
tree96840d5c444477e313974c6bd4f20f7d00db89c5 /drivers/soc/tegra
parent1f1607dbd9f6efc22f06e16fc11675dd6323aaab (diff)
downloadlinux-da943840bcd2b490788d73c60ac4368fb7fc7229.tar.xz
soc/tegra: fuse: Warn if accessing unmapped registers
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>
Diffstat (limited to 'drivers/soc/tegra')
-rw-r--r--drivers/soc/tegra/fuse/fuse-tegra30.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/soc/tegra/fuse/fuse-tegra30.c b/drivers/soc/tegra/fuse/fuse-tegra30.c
index 497eb044095f..257e254c6137 100644
--- 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);
}