linux/drivers/soc/tegra
Jon Hunter a83f1fc3f3 soc/tegra: pmc: Don't probe PMC if early initialisation fails
Commit 0259f522e0 ('soc/tegra: pmc: Restore base address on probe
failure') fixes an issue where the PMC base address pointer is not
restored on probe failure. However, this fix creates another problem
where if early initialisation of the PMC driver fails and an initial
mapping for the PMC address space is not created, then when the PMC
device is probed, the PMC base address pointer will not be valid and
this will cause a crash when tegra_pmc_init() is called and attempts
to access a register.

Although the PMC address space is mapped a 2nd time during the probe
and so this could be fixed by populating the base address pointer
earlier during the probe, this adds more complexity to the code.
Moreover, the PMC probe also assumes the the soc data pointer is also
initialised when the device is probed and if not will also lead to a
crash when calling tegra_pmc_init_tsense_reset(). Given that if the
early initialisation does fail then something bad has happen, it seems
acceptable to allow the PMC device probe to fail as well. Therefore, if
the PMC base address pointer or soc data pointer are not valid when
probing the PMC device, WARN and return an error.

Fixes: 0259f522e0 ('soc/tegra: pmc: Restore base address on probe failure')
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2016-06-30 12:23:27 +02:00
..
fuse soc/tegra: fuse: Add spare bit offset for Tegra210 2015-07-16 10:38:31 +02:00
common.c soc/tegra: Add Tegra210 support 2015-07-16 09:47:59 +02:00
Kconfig ARM: tegra: Remove redundant ARM_L1_CACHE_SHIFT_6 select 2016-04-12 17:09:28 +02:00
Makefile soc: tegra: Remove redundant $(CONFIG_ARCH_TEGRA) in Makefile 2015-08-13 16:17:40 +02:00
pmc.c soc/tegra: pmc: Don't probe PMC if early initialisation fails 2016-06-30 12:23:27 +02:00