LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] thermal/drivers/int340x: limit Kconfig to 64-bit
@ 2021-11-08 11:13 Arnd Bergmann
  2021-11-08 11:22 ` Srinivas Pandruvada
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Arnd Bergmann @ 2021-11-08 11:13 UTC (permalink / raw)
  To: Rafael J. Wysocki, Daniel Lezcano, Srinivas Pandruvada
  Cc: Arnd Bergmann, Amit Kucheria, Zhang Rui, linux-pm, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

32-bit processors cannot generally access 64-bit MMIO registers
atomically, and it is unknown in which order the two halves of
this registers would need to be read:

drivers/thermal/intel/int340x_thermal/processor_thermal_mbox.c: In function 'send_mbox_cmd':
drivers/thermal/intel/int340x_thermal/processor_thermal_mbox.c:79:37: error: implicit declaration of function 'readq'; did you mean 'readl'? [-Werror=implicit-function-declaration]
   79 |                         *cmd_resp = readq((void __iomem *) (proc_priv->mmio_base + MBOX_OFFSET_DATA));
      |                                     ^~~~~
      |                                     readl

The driver already does not build for anything other than x86,
so limit it further to x86-64.

Fixes: aeb58c860dc5 ("thermal/drivers/int340x: processor_thermal: Suppot 64 bit RFIM responses")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/thermal/intel/int340x_thermal/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/thermal/intel/int340x_thermal/Kconfig b/drivers/thermal/intel/int340x_thermal/Kconfig
index 45c31f3d6054..5d046de96a5d 100644
--- a/drivers/thermal/intel/int340x_thermal/Kconfig
+++ b/drivers/thermal/intel/int340x_thermal/Kconfig
@@ -5,12 +5,12 @@
 
 config INT340X_THERMAL
 	tristate "ACPI INT340X thermal drivers"
-	depends on X86 && ACPI && PCI
+	depends on X86_64 && ACPI && PCI
 	select THERMAL_GOV_USER_SPACE
 	select ACPI_THERMAL_REL
 	select ACPI_FAN
 	select INTEL_SOC_DTS_IOSF_CORE
-	select PROC_THERMAL_MMIO_RAPL if X86_64 && POWERCAP
+	select PROC_THERMAL_MMIO_RAPL if POWERCAP
 	help
 	  Newer laptops and tablets that use ACPI may have thermal sensors and
 	  other devices with thermal control capabilities outside the core
-- 
2.29.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] thermal/drivers/int340x: limit Kconfig to 64-bit
  2021-11-08 11:13 [PATCH] thermal/drivers/int340x: limit Kconfig to 64-bit Arnd Bergmann
@ 2021-11-08 11:22 ` Srinivas Pandruvada
  2021-11-09  5:54 ` Randy Dunlap
  2021-11-16 19:17 ` Rafael J. Wysocki
  2 siblings, 0 replies; 4+ messages in thread
From: Srinivas Pandruvada @ 2021-11-08 11:22 UTC (permalink / raw)
  To: Arnd Bergmann, Rafael J. Wysocki, Daniel Lezcano
  Cc: Arnd Bergmann, Amit Kucheria, Zhang Rui, linux-pm, linux-kernel

On Mon, 2021-11-08 at 12:13 +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> 32-bit processors cannot generally access 64-bit MMIO registers
> atomically, and it is unknown in which order the two halves of
> this registers would need to be read:
> 
> drivers/thermal/intel/int340x_thermal/processor_thermal_mbox.c: In
> function 'send_mbox_cmd':
> drivers/thermal/intel/int340x_thermal/processor_thermal_mbox.c:79:37:
> error: implicit declaration of function 'readq'; did you mean
> 'readl'? [-Werror=implicit-function-declaration]
>    79 |                         *cmd_resp = readq((void __iomem *)
> (proc_priv->mmio_base + MBOX_OFFSET_DATA));
>       |                                     ^~~~~
>       |                                     readl
> 
> The driver already does not build for anything other than x86,
> so limit it further to x86-64.
> 
> Fixes: aeb58c860dc5 ("thermal/drivers/int340x: processor_thermal:
> Suppot 64 bit RFIM responses")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

> ---
>  drivers/thermal/intel/int340x_thermal/Kconfig | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/thermal/intel/int340x_thermal/Kconfig
> b/drivers/thermal/intel/int340x_thermal/Kconfig
> index 45c31f3d6054..5d046de96a5d 100644
> --- a/drivers/thermal/intel/int340x_thermal/Kconfig
> +++ b/drivers/thermal/intel/int340x_thermal/Kconfig
> @@ -5,12 +5,12 @@
>  
>  config INT340X_THERMAL
>         tristate "ACPI INT340X thermal drivers"
> -       depends on X86 && ACPI && PCI
> +       depends on X86_64 && ACPI && PCI
>         select THERMAL_GOV_USER_SPACE
>         select ACPI_THERMAL_REL
>         select ACPI_FAN
>         select INTEL_SOC_DTS_IOSF_CORE
> -       select PROC_THERMAL_MMIO_RAPL if X86_64 && POWERCAP
> +       select PROC_THERMAL_MMIO_RAPL if POWERCAP
>         help
>           Newer laptops and tablets that use ACPI may have thermal
> sensors and
>           other devices with thermal control capabilities outside the
> core



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] thermal/drivers/int340x: limit Kconfig to 64-bit
  2021-11-08 11:13 [PATCH] thermal/drivers/int340x: limit Kconfig to 64-bit Arnd Bergmann
  2021-11-08 11:22 ` Srinivas Pandruvada
@ 2021-11-09  5:54 ` Randy Dunlap
  2021-11-16 19:17 ` Rafael J. Wysocki
  2 siblings, 0 replies; 4+ messages in thread
From: Randy Dunlap @ 2021-11-09  5:54 UTC (permalink / raw)
  To: Arnd Bergmann, Rafael J. Wysocki, Daniel Lezcano, Srinivas Pandruvada
  Cc: Arnd Bergmann, Amit Kucheria, Zhang Rui, linux-pm, linux-kernel

On 11/8/21 3:13 AM, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> 32-bit processors cannot generally access 64-bit MMIO registers
> atomically, and it is unknown in which order the two halves of
> this registers would need to be read:
> 
> drivers/thermal/intel/int340x_thermal/processor_thermal_mbox.c: In function 'send_mbox_cmd':
> drivers/thermal/intel/int340x_thermal/processor_thermal_mbox.c:79:37: error: implicit declaration of function 'readq'; did you mean 'readl'? [-Werror=implicit-function-declaration]
>     79 |                         *cmd_resp = readq((void __iomem *) (proc_priv->mmio_base + MBOX_OFFSET_DATA));
>        |                                     ^~~~~
>        |                                     readl
> 
> The driver already does not build for anything other than x86,
> so limit it further to x86-64.
> 
> Fixes: aeb58c860dc5 ("thermal/drivers/int340x: processor_thermal: Suppot 64 bit RFIM responses")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>   drivers/thermal/intel/int340x_thermal/Kconfig | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/thermal/intel/int340x_thermal/Kconfig b/drivers/thermal/intel/int340x_thermal/Kconfig
> index 45c31f3d6054..5d046de96a5d 100644
> --- a/drivers/thermal/intel/int340x_thermal/Kconfig
> +++ b/drivers/thermal/intel/int340x_thermal/Kconfig
> @@ -5,12 +5,12 @@
>   
>   config INT340X_THERMAL
>   	tristate "ACPI INT340X thermal drivers"
> -	depends on X86 && ACPI && PCI
> +	depends on X86_64 && ACPI && PCI
>   	select THERMAL_GOV_USER_SPACE
>   	select ACPI_THERMAL_REL
>   	select ACPI_FAN
>   	select INTEL_SOC_DTS_IOSF_CORE
> -	select PROC_THERMAL_MMIO_RAPL if X86_64 && POWERCAP
> +	select PROC_THERMAL_MMIO_RAPL if POWERCAP
>   	help
>   	  Newer laptops and tablets that use ACPI may have thermal sensors and
>   	  other devices with thermal control capabilities outside the core
> 

Reviewed-by: Randy Dunlap <rdunlap@infradead.org>

Thanks.

-- 
~Randy

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] thermal/drivers/int340x: limit Kconfig to 64-bit
  2021-11-08 11:13 [PATCH] thermal/drivers/int340x: limit Kconfig to 64-bit Arnd Bergmann
  2021-11-08 11:22 ` Srinivas Pandruvada
  2021-11-09  5:54 ` Randy Dunlap
@ 2021-11-16 19:17 ` Rafael J. Wysocki
  2 siblings, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2021-11-16 19:17 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Rafael J. Wysocki, Daniel Lezcano, Srinivas Pandruvada,
	Arnd Bergmann, Amit Kucheria, Zhang Rui, Linux PM,
	Linux Kernel Mailing List

On Mon, Nov 8, 2021 at 12:13 PM Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> 32-bit processors cannot generally access 64-bit MMIO registers
> atomically, and it is unknown in which order the two halves of
> this registers would need to be read:
>
> drivers/thermal/intel/int340x_thermal/processor_thermal_mbox.c: In function 'send_mbox_cmd':
> drivers/thermal/intel/int340x_thermal/processor_thermal_mbox.c:79:37: error: implicit declaration of function 'readq'; did you mean 'readl'? [-Werror=implicit-function-declaration]
>    79 |                         *cmd_resp = readq((void __iomem *) (proc_priv->mmio_base + MBOX_OFFSET_DATA));
>       |                                     ^~~~~
>       |                                     readl
>
> The driver already does not build for anything other than x86,
> so limit it further to x86-64.
>
> Fixes: aeb58c860dc5 ("thermal/drivers/int340x: processor_thermal: Suppot 64 bit RFIM responses")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/thermal/intel/int340x_thermal/Kconfig | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/thermal/intel/int340x_thermal/Kconfig b/drivers/thermal/intel/int340x_thermal/Kconfig
> index 45c31f3d6054..5d046de96a5d 100644
> --- a/drivers/thermal/intel/int340x_thermal/Kconfig
> +++ b/drivers/thermal/intel/int340x_thermal/Kconfig
> @@ -5,12 +5,12 @@
>
>  config INT340X_THERMAL
>         tristate "ACPI INT340X thermal drivers"
> -       depends on X86 && ACPI && PCI
> +       depends on X86_64 && ACPI && PCI
>         select THERMAL_GOV_USER_SPACE
>         select ACPI_THERMAL_REL
>         select ACPI_FAN
>         select INTEL_SOC_DTS_IOSF_CORE
> -       select PROC_THERMAL_MMIO_RAPL if X86_64 && POWERCAP
> +       select PROC_THERMAL_MMIO_RAPL if POWERCAP
>         help
>           Newer laptops and tablets that use ACPI may have thermal sensors and
>           other devices with thermal control capabilities outside the core
> --

Applied as 5.16-rc2 material, thanks!

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-11-16 19:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-08 11:13 [PATCH] thermal/drivers/int340x: limit Kconfig to 64-bit Arnd Bergmann
2021-11-08 11:22 ` Srinivas Pandruvada
2021-11-09  5:54 ` Randy Dunlap
2021-11-16 19:17 ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).