34e78804 | 09-Jul-2024 |
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> |
thermal/drivers/broadcom: Fix race between removal and clock disable
[ Upstream commit e90c369cc2ffcf7145a46448de101f715a1f5584 ]
During the probe, driver enables clocks necessary to access registe
thermal/drivers/broadcom: Fix race between removal and clock disable
[ Upstream commit e90c369cc2ffcf7145a46448de101f715a1f5584 ]
During the probe, driver enables clocks necessary to access registers (in get_temp()) and then registers thermal zone with managed-resources (devm) interface. Removal of device is not done in reversed order, because: 1. Clock will be disabled in driver remove() callback - thermal zone is still registered and accessible to users, 2. devm interface will unregister thermal zone.
This leaves short window between (1) and (2) for accessing the get_temp() callback with disabled clock.
Fix this by enabling clock also via devm-interface, so entire cleanup path will be in proper, reversed order.
Fixes: 8454c8c09c77 ("thermal/drivers/bcm2835: Remove buggy call to thermal_of_zone_unregister") Cc: stable@vger.kernel.org Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20240709-thermal-probe-v1-1-241644e2b6e0@linaro.org Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
show more ...
|
fb6ce327 | 09-Aug-2023 |
Andrei Coardos <aboutphysycs@gmail.com> |
thermal/drivers/broadcom/brcstb_thermal: Removed unneeded platform_set_drvdata()
This function call was found to be unnecessary as there is no equivalent platform_get_drvdata() call to access the pr
thermal/drivers/broadcom/brcstb_thermal: Removed unneeded platform_set_drvdata()
This function call was found to be unnecessary as there is no equivalent platform_get_drvdata() call to access the private data of the driver. Also, the private data is defined in this driver, so there is no risk of it being accessed outside of this driver file.
Signed-off-by: Andrei Coardos <aboutphysycs@gmail.com> Reviewed-by: Alexandru Ardelean <alex@shruggie.ro> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20230809154813.16033-1-aboutphysycs@gmail.com
show more ...
|
1c73c3be | 10-Aug-2023 |
Andrei Coardos <aboutphysycs@gmail.com> |
thermal/drivers/broadcom/sr-thermal: Removed call to platform_set_drvdata()
This function call was found to be unnecessary as there is no equivalent platform_get_drvdata() call to access the private
thermal/drivers/broadcom/sr-thermal: Removed call to platform_set_drvdata()
This function call was found to be unnecessary as there is no equivalent platform_get_drvdata() call to access the private data of the driver. Also, the private data is defined in this driver, so there is no risk of it being accessed outside of this driver file.
Signed-off-by: Andrei Coardos <aboutphysycs@gmail.com> Reviewed-by: Alexandru Ardelean <alex@shruggie.ro> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20230810111330.3248-1-aboutphysycs@gmail.com
show more ...
|
142887ec | 18-Jan-2023 |
ye xingchen <ye.xingchen@zte.com.cn> |
thermal/drivers/bcm2835: Use devm_platform_get_and_ioremap_resource()
Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this i
thermal/drivers/bcm2835: Use devm_platform_get_and_ioremap_resource()
Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does.
Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Link: https://lore.kernel.org/r/202301181636223863583@zte.com.cn Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
show more ...
|
5fdd4e31 | 14-Jan-2020 |
Florian Fainelli <f.fainelli@gmail.com> |
thermal: brcmstb_thermal: Register different ops per process
Since we do not have interrupts on BCM7216, we cannot have trip point crossing, the thermal subsystem expects us to provide a NULL set_tr
thermal: brcmstb_thermal: Register different ops per process
Since we do not have interrupts on BCM7216, we cannot have trip point crossing, the thermal subsystem expects us to provide a NULL set_trips operation in that case, so make it possible to provide per-process thermal_zone_of_device_ops
Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20200114190607.29339-7-f.fainelli@gmail.com
show more ...
|
eaf7a88d | 14-Jan-2020 |
Florian Fainelli <f.fainelli@gmail.com> |
thermal: brcmstb_thermal: Restructure interrupt registration
If we are successful grabbing the interrupt resource, then register an interrupt handler, this makes it easier to support the interrupt a
thermal: brcmstb_thermal: Restructure interrupt registration
If we are successful grabbing the interrupt resource, then register an interrupt handler, this makes it easier to support the interrupt as being optional, which is it for 7216.
Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20200114190607.29339-6-f.fainelli@gmail.com
show more ...
|
c9a50613 | 14-Jan-2020 |
Florian Fainelli <f.fainelli@gmail.com> |
thermal: brcmstb_thermal: Add 16nm process thermal parameters
Match the 7216 compatible string in order to derive the correct 16nm process thermal parameters to obtain correct readings.
Reviewed-by
thermal: brcmstb_thermal: Add 16nm process thermal parameters
Match the 7216 compatible string in order to derive the correct 16nm process thermal parameters to obtain correct readings.
Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20200114190607.29339-5-f.fainelli@gmail.com
show more ...
|
8bcda325 | 14-Jan-2020 |
Florian Fainelli <f.fainelli@gmail.com> |
thermal: brcmstb_thermal: Prepare to support a different process
The driver is currently assuming that it is operating with a 28nm process chip, which has a specific formula to convert temperature t
thermal: brcmstb_thermal: Prepare to support a different process
The driver is currently assuming that it is operating with a 28nm process chip, which has a specific formula to convert temperature to a code and vice versa. Update the code to support providing two key values: offset and multiplier to derive the correct formulas.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20200114190607.29339-3-f.fainelli@gmail.com
show more ...
|
e1ff6fc2 | 14-Jan-2020 |
Florian Fainelli <f.fainelli@gmail.com> |
thermal: brcmstb_thermal: Do not use DT coefficients
At the time the brcmstb_thermal driver and its binding were merged, the DT binding did not make the coefficients properties a mandatory one, ther
thermal: brcmstb_thermal: Do not use DT coefficients
At the time the brcmstb_thermal driver and its binding were merged, the DT binding did not make the coefficients properties a mandatory one, therefore all users of the brcmstb_thermal driver out there have a non functional implementation with zero coefficients. Even if these properties were provided, the formula used for computation is incorrect.
The coefficients are entirely process specific (right now, only 28nm is supported) and not board or SoC specific, it is therefore appropriate to hard code them in the driver given the compatibility string we are probed with which has to be updated whenever a new process is introduced.
We remove the existing coefficients definition since subsequent patches are going to add support for a new process and will introduce new coefficients as well.
Fixes: 9e03cf1b2dd5 ("thermal: add brcmstb AVS TMON driver") Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20200114190607.29339-2-f.fainelli@gmail.com
show more ...
|