diff options
author | Thierry Reding <treding@nvidia.com> | 2017-06-26 17:23:27 +0200 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2017-12-13 12:43:31 +0100 |
commit | da943840bcd2b490788d73c60ac4368fb7fc7229 (patch) | |
tree | 96840d5c444477e313974c6bd4f20f7d00db89c5 | |
parent | 1f1607dbd9f6efc22f06e16fc11675dd6323aaab (diff) | |
download | op-kernel-dev-da943840bcd2b490788d73c60ac4368fb7fc7229.zip op-kernel-dev-da943840bcd2b490788d73c60ac4368fb7fc7229.tar.gz |
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>
-rw-r--r-- | drivers/soc/tegra/fuse/fuse-tegra30.c | 3 |
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 497eb04..257e254 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); } |