lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2493cf75-f78c-993a-01e6-8f89556973f0@ti.com>
Date:   Wed, 1 Mar 2023 21:50:14 +0530
From:   "Gole, Dhruva" <d-gole@...com>
To:     Daniel Lezcano <daniel.lezcano@...aro.org>, <rafael@...nel.org>
CC:     <linux-pm@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        Niklas Söderlund 
        <niklas.soderlund+renesas@...natech.se>,
        Mark Brown <broonie@...nel.org>,
        AngeloGioacchino Del Regno 
        <angelogioacchino.delregno@...labora.com>,
        Balsam CHIHI <bchihi@...libre.com>,
        Adam Ward <DLG-Adam.Ward.opensource@...renesas.com>,
        Baolin Wang <baolin.wang@...ux.alibaba.com>,
        Jernej Skrabec <jernej.skrabec@...il.com>,
        "Rafael J . Wysocki" <rafael.j.wysocki@...el.com>,
        Florian Fainelli <f.fainelli@...il.com>,
        Guillaume La Roque <glaroque@...libre.com>,
        Amit Kucheria <amitk@...nel.org>,
        Zhang Rui <rui.zhang@...el.com>,
        Miquel Raynal <miquel.raynal@...tlin.com>,
        Broadcom internal kernel review list 
        <bcm-kernel-feedback-list@...adcom.com>,
        Ray Jui <rjui@...adcom.com>,
        Scott Branden <sbranden@...adcom.com>,
        Markus Mayer <mmayer@...adcom.com>,
        Support Opensource <support.opensource@...semi.com>,
        Shawn Guo <shawnguo@...nel.org>,
        Sascha Hauer <s.hauer@...gutronix.de>,
        Pengutronix Kernel Team <kernel@...gutronix.de>,
        Fabio Estevam <festevam@...il.com>,
        NXP Linux Team <linux-imx@....com>,
        Thara Gopinath <thara.gopinath@...il.com>,
        Andy Gross <agross@...nel.org>,
        Bjorn Andersson <andersson@...nel.org>,
        Konrad Dybcio <konrad.dybcio@...aro.org>,
        Niklas Söderlund <niklas.soderlund@...natech.se>,
        Heiko Stuebner <heiko@...ech.de>,
        Bartlomiej Zolnierkiewicz <bzolnier@...il.com>,
        Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
        Alim Akhtar <alim.akhtar@...sung.com>,
        Orson Zhai <orsonzhai@...il.com>,
        Chunyan Zhang <zhang.lyra@...il.com>,
        Maxime Coquelin <mcoquelin.stm32@...il.com>,
        Alexandre Torgue <alexandre.torgue@...s.st.com>,
        Vasily Khoruzhick <anarsoul@...il.com>,
        Yangtao Li <tiny.windzz@...il.com>,
        Chen-Yu Tsai <wens@...e.org>,
        Samuel Holland <samuel@...lland.org>,
        Thierry Reding <thierry.reding@...il.com>,
        Jonathan Hunter <jonathanh@...dia.com>,
        Talel Shenhar <talel@...zon.com>,
        Eduardo Valentin <edubezval@...il.com>,
        Keerthy <j-keerthy@...com>,
        Kunihiko Hayashi <hayashi.kunihiko@...ionext.com>,
        Masami Hiramatsu <mhiramat@...nel.org>,
        Matthias Brugger <matthias.bgg@...il.com>,
        Stefan Wahren <stefan.wahren@...e.com>,
        ye xingchen <ye.xingchen@....com.cn>,
        Zheng Yongjun <zhengyongjun3@...wei.com>,
        Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
        Davidlohr Bueso <dave@...olabs.net>,
        Sumeet Pawnikar <sumeet.r.pawnikar@...el.com>,
        Kees Cook <keescook@...omium.org>,
        Shang XiaoJing <shangxiaojing@...wei.com>,
        Tim Zimmermann <tim@...ux4.de>,
        Yang Li <yang.lee@...ux.alibaba.com>,
        Jiang Jian <jiangjian@...rlc.com>,
        Daniel Golle <daniel@...rotopia.org>,
        Randy Dunlap <rdunlap@...radead.org>,
        Minghao Chi <chi.minghao@....com.cn>,
        Johan Hovold <johan+linaro@...nel.org>,
        Mikko Perttunen <mperttunen@...dia.com>,
        "open list:THERMAL DRIVER FOR AMLOGIC SOCS" 
        <linux-amlogic@...ts.infradead.org>,
        "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" 
        <linux-rpi-kernel@...ts.infradead.org>,
        "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" 
        <linux-arm-kernel@...ts.infradead.org>,
        "open list:QUALCOMM TSENS THERMAL DRIVER" 
        <linux-arm-msm@...r.kernel.org>,
        "open list:RENESAS R-CAR THERMAL DRIVERS" 
        <linux-renesas-soc@...r.kernel.org>,
        "open list:ARM/Rockchip SoC support" 
        <linux-rockchip@...ts.infradead.org>,
        "open list:SAMSUNG THERMAL DRIVER" 
        <linux-samsung-soc@...r.kernel.org>,
        "moderated list:ARM/STM32 ARCHITECTURE" 
        <linux-stm32@...md-mailman.stormreply.com>,
        "open list:ARM/Allwinner sunXi SoC support" 
        <linux-sunxi@...ts.linux.dev>,
        "open list:TEGRA ARCHITECTURE SUPPORT" <linux-tegra@...r.kernel.org>,
        "open list:TI BANDGAP AND THERMAL DRIVER" 
        <linux-omap@...r.kernel.org>,
        "moderated list:ARM/Mediatek SoC support" 
        <linux-mediatek@...ts.infradead.org>
Subject: Re: [PATCH v4 02/19] thermal/core: Use the thermal zone 'devdata'
 accessor in thermal located drivers


On 2/28/2023 4:52 PM, Daniel Lezcano wrote:
> The thermal zone device structure is exposed to the different drivers
> and obviously they access the internals while that should be
> restricted to the core thermal code.
>
> In order to self-encapsulate the thermal core code, we need to prevent
> the drivers accessing directly the thermal zone structure and provide
> accessor functions to deal with.
>
> Use the devdata accessor introduced in the previous patch.
>
> No functional changes intended.
>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@...aro.org>
> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@...natech.se> #R-Car
> Acked-by: Mark Brown <broonie@...nel.org>
> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com> #MediaTek auxadc and lvts
> Reviewed-by: Balsam CHIHI <bchihi@...libre.com> #Mediatek lvts
> Reviewed-by: Adam Ward <DLG-Adam.Ward.opensource@...renesas.com> #da9062
> Reviewed-by: Baolin Wang <baolin.wang@...ux.alibaba.com>  #spread
> Acked-by: Jernej Skrabec <jernej.skrabec@...il.com> #sun8i_thermal
> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> Acked-by: Florian Fainelli <f.fainelli@...il.com> #Broadcom
> ---
>  drivers/thermal/amlogic_thermal.c                   |  2 +-
>  drivers/thermal/armada_thermal.c                    |  4 ++--
>  drivers/thermal/broadcom/bcm2711_thermal.c          |  2 +-
>  drivers/thermal/broadcom/bcm2835_thermal.c          |  2 +-
>  drivers/thermal/broadcom/brcmstb_thermal.c          |  4 ++--
>  drivers/thermal/broadcom/ns-thermal.c               |  2 +-
>  drivers/thermal/broadcom/sr-thermal.c               |  2 +-
>  drivers/thermal/da9062-thermal.c                    |  2 +-
>  drivers/thermal/db8500_thermal.c                    |  2 +-
>  drivers/thermal/dove_thermal.c                      |  2 +-
>  drivers/thermal/hisi_thermal.c                      |  2 +-
>  drivers/thermal/imx8mm_thermal.c                    |  2 +-
>  drivers/thermal/imx_sc_thermal.c                    |  2 +-
>  drivers/thermal/imx_thermal.c                       |  6 +++---
>  .../thermal/intel/int340x_thermal/int3400_thermal.c |  2 +-
>  .../intel/int340x_thermal/int340x_thermal_zone.c    |  4 ++--
>  .../int340x_thermal/processor_thermal_device_pci.c  |  4 ++--
>  drivers/thermal/intel/intel_pch_thermal.c           |  2 +-
>  drivers/thermal/intel/intel_quark_dts_thermal.c     |  6 +++---
>  drivers/thermal/intel/intel_soc_dts_iosf.c          | 13 +++++--------
>  drivers/thermal/intel/x86_pkg_temp_thermal.c        |  4 ++--
>  drivers/thermal/k3_bandgap.c                        |  2 +-
>  drivers/thermal/k3_j72xx_bandgap.c                  |  2 +-
> [...]
>  
> diff --git a/drivers/thermal/k3_bandgap.c b/drivers/thermal/k3_bandgap.c
> index 22c9bcb899c3..b5cd2c85e0c3 100644
> --- a/drivers/thermal/k3_bandgap.c
> +++ b/drivers/thermal/k3_bandgap.c
> @@ -141,7 +141,7 @@ static int k3_bgp_read_temp(struct k3_thermal_data *devdata,
>  
>  static int k3_thermal_get_temp(struct thermal_zone_device *tz, int *temp)
>  {
> -	struct k3_thermal_data *data = tz->devdata;
> +	struct k3_thermal_data *data = thermal_zone_device_priv(tz);

Reviewed-by: Dhruva Gole <d-gole@...com>


>  	int ret = 0;
>  
>  	ret = k3_bgp_read_temp(data, temp);
> diff --git a/drivers/thermal/k3_j72xx_bandgap.c b/drivers/thermal/k3_j72xx_bandgap.c
> index 031ea1091909..5be1f09eeb2c 100644
> --- a/drivers/thermal/k3_j72xx_bandgap.c
> +++ b/drivers/thermal/k3_j72xx_bandgap.c
> @@ -248,7 +248,7 @@ static inline int k3_bgp_read_temp(struct k3_thermal_data *devdata,
>  /* Get temperature callback function for thermal zone */
>  static int k3_thermal_get_temp(struct thermal_zone_device *tz, int *temp)
>  {
> -	return k3_bgp_read_temp(tz->devdata, temp);
> +	return k3_bgp_read_temp(thermal_zone_device_priv(tz), temp);
>  }
>  
>  static const struct thermal_zone_device_ops k3_of_thermal_ops = {
> diff --git a/drivers/thermal/kirkwood_thermal.c b/drivers/thermal/kirkwood_thermal.c
> index bec7ec20e79d..92b3ce426b9d 100644
> --- a/drivers/thermal/kirkwood_thermal.c
> +++ b/drivers/thermal/kirkwood_thermal.c
> @@ -27,7 +27,7 @@ static int kirkwood_get_temp(struct thermal_zone_device *thermal,
>  			  int *temp)
>  {
>  	unsigned long reg;
> -	struct kirkwood_thermal_priv *priv = thermal->devdata;
> +	struct kirkwood_thermal_priv *priv = thermal_zone_device_priv(thermal);
>  
>  	reg = readl_relaxed(priv->sensor);
>  
> [...]

-- 
Regards,
Dhruva Gole <d-gole@...com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ