2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-26 06:04:14 +08:00
linux-next/drivers/soc
Jon Hunter e8cf6616a3 soc/tegra: pmc: Protect public functions from potential race conditions
The PMC base address pointer is initialised during early boot so that
early platform code may used the PMC public functions. During the probe
of the PMC driver the base address pointer is mapped again and the initial
mapping is freed. This exposes a window where a device accessing the PMC
registers via one of the public functions, could race with the updating
of the pointer and lead to a invalid access. Furthermore, the only
protection between multiple devices attempting to access the PMC registers
is when setting the powergate state to on or off. None of the other public
functions that access the PMC registers are protected.

Use the existing mutex to protect paths that may race with regard to
accessing the PMC registers.

Note that functions tegra_io_rail_prepare()/poll() either return a
negative value on failure or zero on success. Therefore, it is not
necessary to check if the return value is less than zero and so only
test that the return value is not zero to test for failure. This
simplifies the error handling with the mutex locking in place.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2016-04-05 15:22:45 +02:00
..
bcm ARM: bcm2835: clarify RASPBERRYPI_FIRMWARE dependency 2015-12-31 23:44:17 +01:00
brcmstb soc: brcmstb: Add Bus Interface Unit control setup 2015-10-09 13:42:16 -07:00
dove soc: dove: add legacy support to PMU driver 2015-12-08 13:19:29 +01:00
fsl powerpc updates for 4.6 2016-03-19 15:38:41 -07:00
mediatek soc: mediatek: SCPSYS: Fix double enabling of regulators 2016-02-01 11:28:07 +01:00
qcom ARM: SoC fixes for v4.5 merge window 2016-01-22 17:26:00 -08:00
rockchip soc: rockchip: power-domain: fix err handle while probing 2016-02-02 22:18:31 +01:00
samsung drivers: soc: samsung: Enable COMPILE_TEST 2016-02-25 11:25:40 +09:00
sunxi drivers: soc: sunxi: Fix mask generation for SRAM mapping 2016-01-27 20:29:20 +01:00
tegra soc/tegra: pmc: Protect public functions from potential race conditions 2016-04-05 15:22:45 +02:00
ti soc: TI knav_qmss: fix dma_addr_t printing 2016-02-26 17:53:06 +01:00
versatile soc: versatile: add support for the PB11MPCore 2015-12-15 09:42:50 +01:00
Kconfig drivers: soc: Add support for Exynos PMU driver 2016-02-25 10:18:07 +09:00
Makefile drivers: soc: Add support for Exynos PMU driver 2016-02-25 10:18:07 +09:00