All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] macintosh: fix via-pmu and via-cuda build errors
@ 2022-04-07  2:37 ` Randy Dunlap
  0 siblings, 0 replies; 11+ messages in thread
From: Randy Dunlap @ 2022-04-07  2:37 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, kernel test robot, Kees Cook, Arnd Bergmann,
	Michael Ellerman, Finn Thain, Geert Uytterhoeven,
	Nathan Chancellor, Nick Desaulniers, Benjamin Herrenschmidt,
	linuxppc-dev

When CONFIG_INPUT=m, the input_*() family of functions is not
available to builtin drivers.

When CONFIG_RTC_CLASS is not set, rtc_tm_to_time64() is not defined.

Fix multiple build errors by making these Kconfig symbols required by
ADB_CUDA (RTC_CLASS) and ADB_PMU (RTC_CLASS and INPUT).

m68k-linux-ld: drivers/macintosh/via-pmu.o: in function `pmu_set_rtc_time':
drivers/macintosh/via-pmu.c:1758: undefined reference to `rtc_tm_to_time64'
m68k-linux-ld: drivers/macintosh/via-pmu-event.o: in function `input_report_key':
include/linux/input.h:425: undefined reference to `input_event'
m68k-linux-ld: drivers/macintosh/via-pmu-event.o: in function `input_report_switch':
include/linux/input.h:445: undefined reference to `input_event'
m68k-linux-ld: drivers/macintosh/via-pmu-event.o: in function `via_pmu_event_init':
drivers/macintosh/via-pmu-event.c:38: undefined reference to `input_allocate_device'
m68k-linux-ld: drivers/macintosh/via-pmu-event.c:53: undefined reference to `input_register_device'
m68k-linux-ld: drivers/macintosh/via-pmu-event.c:55: undefined reference to `input_free_device'
m68k-linux-ld: drivers/macintosh/via-cuda.o: in function `cuda_set_rtc_time':
drivers/macintosh/via-cuda.c:797: undefined reference to `rtc_tm_to_time64'

Fixes: 0792a2c8e0bb ("macintosh: Use common code to access RTC")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: kernel test robot <lkp@intel.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Finn Thain <fthain@linux-m68k.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linuxppc-dev@lists.ozlabs.org
---
This is a big hammer type of patch. We could possibly do (a) some
conditional code blocks for RTC_CLASS and (b) only build via-pmu-event
if CONFIG_INPUT=y if needed.

 drivers/macintosh/Kconfig |    3 +++
 1 file changed, 3 insertions(+)

--- a/drivers/macintosh/Kconfig
+++ b/drivers/macintosh/Kconfig
@@ -44,6 +44,7 @@ config ADB_IOP
 config ADB_CUDA
 	bool "Support for Cuda/Egret based Macs and PowerMacs"
 	depends on (ADB || PPC_PMAC) && !PPC_PMAC64
+	depends on RTC_CLASS
 	help
 	  This provides support for Cuda/Egret based Macintosh and
 	  Power Macintosh systems. This includes most m68k based Macs,
@@ -57,6 +58,8 @@ config ADB_CUDA
 config ADB_PMU
 	bool "Support for PMU based PowerMacs and PowerBooks"
 	depends on PPC_PMAC || MAC
+	depends on INPUT=y
+	depends on RTC_CLASS
 	help
 	  On PowerBooks, iBooks, and recent iMacs and Power Macintoshes, the
 	  PMU is an embedded microprocessor whose primary function is to

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

* [PATCH] macintosh: fix via-pmu and via-cuda build errors
@ 2022-04-07  2:37 ` Randy Dunlap
  0 siblings, 0 replies; 11+ messages in thread
From: Randy Dunlap @ 2022-04-07  2:37 UTC (permalink / raw)
  To: linux-kernel
  Cc: kernel test robot, Finn Thain, Randy Dunlap, Nick Desaulniers,
	Nathan Chancellor, Arnd Bergmann, Geert Uytterhoeven,
	linuxppc-dev, Kees Cook

When CONFIG_INPUT=m, the input_*() family of functions is not
available to builtin drivers.

When CONFIG_RTC_CLASS is not set, rtc_tm_to_time64() is not defined.

Fix multiple build errors by making these Kconfig symbols required by
ADB_CUDA (RTC_CLASS) and ADB_PMU (RTC_CLASS and INPUT).

m68k-linux-ld: drivers/macintosh/via-pmu.o: in function `pmu_set_rtc_time':
drivers/macintosh/via-pmu.c:1758: undefined reference to `rtc_tm_to_time64'
m68k-linux-ld: drivers/macintosh/via-pmu-event.o: in function `input_report_key':
include/linux/input.h:425: undefined reference to `input_event'
m68k-linux-ld: drivers/macintosh/via-pmu-event.o: in function `input_report_switch':
include/linux/input.h:445: undefined reference to `input_event'
m68k-linux-ld: drivers/macintosh/via-pmu-event.o: in function `via_pmu_event_init':
drivers/macintosh/via-pmu-event.c:38: undefined reference to `input_allocate_device'
m68k-linux-ld: drivers/macintosh/via-pmu-event.c:53: undefined reference to `input_register_device'
m68k-linux-ld: drivers/macintosh/via-pmu-event.c:55: undefined reference to `input_free_device'
m68k-linux-ld: drivers/macintosh/via-cuda.o: in function `cuda_set_rtc_time':
drivers/macintosh/via-cuda.c:797: undefined reference to `rtc_tm_to_time64'

Fixes: 0792a2c8e0bb ("macintosh: Use common code to access RTC")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: kernel test robot <lkp@intel.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Finn Thain <fthain@linux-m68k.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linuxppc-dev@lists.ozlabs.org
---
This is a big hammer type of patch. We could possibly do (a) some
conditional code blocks for RTC_CLASS and (b) only build via-pmu-event
if CONFIG_INPUT=y if needed.

 drivers/macintosh/Kconfig |    3 +++
 1 file changed, 3 insertions(+)

--- a/drivers/macintosh/Kconfig
+++ b/drivers/macintosh/Kconfig
@@ -44,6 +44,7 @@ config ADB_IOP
 config ADB_CUDA
 	bool "Support for Cuda/Egret based Macs and PowerMacs"
 	depends on (ADB || PPC_PMAC) && !PPC_PMAC64
+	depends on RTC_CLASS
 	help
 	  This provides support for Cuda/Egret based Macintosh and
 	  Power Macintosh systems. This includes most m68k based Macs,
@@ -57,6 +58,8 @@ config ADB_CUDA
 config ADB_PMU
 	bool "Support for PMU based PowerMacs and PowerBooks"
 	depends on PPC_PMAC || MAC
+	depends on INPUT=y
+	depends on RTC_CLASS
 	help
 	  On PowerBooks, iBooks, and recent iMacs and Power Macintoshes, the
 	  PMU is an embedded microprocessor whose primary function is to

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

* Re: [PATCH] macintosh: fix via-pmu and via-cuda build errors
  2022-04-07  2:37 ` Randy Dunlap
@ 2022-04-07  3:16   ` Randy Dunlap
  -1 siblings, 0 replies; 11+ messages in thread
From: Randy Dunlap @ 2022-04-07  3:16 UTC (permalink / raw)
  To: linux-kernel
  Cc: kernel test robot, Finn Thain, Nick Desaulniers,
	Nathan Chancellor, Geert Uytterhoeven, linuxppc-dev,
	Arnd Bergmann, Kees Cook



On 4/6/22 19:37, Randy Dunlap wrote:
> When CONFIG_INPUT=m, the input_*() family of functions is not
> available to builtin drivers.
> 
> When CONFIG_RTC_CLASS is not set, rtc_tm_to_time64() is not defined.
> 
> Fix multiple build errors by making these Kconfig symbols required by
> ADB_CUDA (RTC_CLASS) and ADB_PMU (RTC_CLASS and INPUT).

Ah yes, Finn has already fixed the INPUT problems here.

Maybe that patch hasn't been merged anywhere yet?

The RTC_CLASS problem is still present AFAICT.

> m68k-linux-ld: drivers/macintosh/via-pmu.o: in function `pmu_set_rtc_time':
> drivers/macintosh/via-pmu.c:1758: undefined reference to `rtc_tm_to_time64'
> m68k-linux-ld: drivers/macintosh/via-pmu-event.o: in function `input_report_key':
> include/linux/input.h:425: undefined reference to `input_event'
> m68k-linux-ld: drivers/macintosh/via-pmu-event.o: in function `input_report_switch':
> include/linux/input.h:445: undefined reference to `input_event'
> m68k-linux-ld: drivers/macintosh/via-pmu-event.o: in function `via_pmu_event_init':
> drivers/macintosh/via-pmu-event.c:38: undefined reference to `input_allocate_device'
> m68k-linux-ld: drivers/macintosh/via-pmu-event.c:53: undefined reference to `input_register_device'
> m68k-linux-ld: drivers/macintosh/via-pmu-event.c:55: undefined reference to `input_free_device'
> m68k-linux-ld: drivers/macintosh/via-cuda.o: in function `cuda_set_rtc_time':
> drivers/macintosh/via-cuda.c:797: undefined reference to `rtc_tm_to_time64'
> 
> Fixes: 0792a2c8e0bb ("macintosh: Use common code to access RTC")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Reported-by: kernel test robot <lkp@intel.com>
> Cc: Kees Cook <keescook@chromium.org>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: Finn Thain <fthain@linux-m68k.org>
> Cc: Geert Uytterhoeven <geert@linux-m68k.org>
> Cc: Nathan Chancellor <nathan@kernel.org>
> Cc: Nick Desaulniers <ndesaulniers@google.com>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: linuxppc-dev@lists.ozlabs.org
> ---
> This is a big hammer type of patch. We could possibly do (a) some
> conditional code blocks for RTC_CLASS and (b) only build via-pmu-event
> if CONFIG_INPUT=y if needed.
> 
>  drivers/macintosh/Kconfig |    3 +++
>  1 file changed, 3 insertions(+)
> 
> --- a/drivers/macintosh/Kconfig
> +++ b/drivers/macintosh/Kconfig
> @@ -44,6 +44,7 @@ config ADB_IOP
>  config ADB_CUDA
>  	bool "Support for Cuda/Egret based Macs and PowerMacs"
>  	depends on (ADB || PPC_PMAC) && !PPC_PMAC64
> +	depends on RTC_CLASS
>  	help
>  	  This provides support for Cuda/Egret based Macintosh and
>  	  Power Macintosh systems. This includes most m68k based Macs,
> @@ -57,6 +58,8 @@ config ADB_CUDA
>  config ADB_PMU
>  	bool "Support for PMU based PowerMacs and PowerBooks"
>  	depends on PPC_PMAC || MAC
> +	depends on INPUT=y
> +	depends on RTC_CLASS
>  	help
>  	  On PowerBooks, iBooks, and recent iMacs and Power Macintoshes, the
>  	  PMU is an embedded microprocessor whose primary function is to

-- 
~Randy

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

* Re: [PATCH] macintosh: fix via-pmu and via-cuda build errors
@ 2022-04-07  3:16   ` Randy Dunlap
  0 siblings, 0 replies; 11+ messages in thread
From: Randy Dunlap @ 2022-04-07  3:16 UTC (permalink / raw)
  To: linux-kernel
  Cc: kernel test robot, Kees Cook, Arnd Bergmann, Michael Ellerman,
	Finn Thain, Geert Uytterhoeven, Nathan Chancellor,
	Nick Desaulniers, Benjamin Herrenschmidt, linuxppc-dev



On 4/6/22 19:37, Randy Dunlap wrote:
> When CONFIG_INPUT=m, the input_*() family of functions is not
> available to builtin drivers.
> 
> When CONFIG_RTC_CLASS is not set, rtc_tm_to_time64() is not defined.
> 
> Fix multiple build errors by making these Kconfig symbols required by
> ADB_CUDA (RTC_CLASS) and ADB_PMU (RTC_CLASS and INPUT).

Ah yes, Finn has already fixed the INPUT problems here.

Maybe that patch hasn't been merged anywhere yet?

The RTC_CLASS problem is still present AFAICT.

> m68k-linux-ld: drivers/macintosh/via-pmu.o: in function `pmu_set_rtc_time':
> drivers/macintosh/via-pmu.c:1758: undefined reference to `rtc_tm_to_time64'
> m68k-linux-ld: drivers/macintosh/via-pmu-event.o: in function `input_report_key':
> include/linux/input.h:425: undefined reference to `input_event'
> m68k-linux-ld: drivers/macintosh/via-pmu-event.o: in function `input_report_switch':
> include/linux/input.h:445: undefined reference to `input_event'
> m68k-linux-ld: drivers/macintosh/via-pmu-event.o: in function `via_pmu_event_init':
> drivers/macintosh/via-pmu-event.c:38: undefined reference to `input_allocate_device'
> m68k-linux-ld: drivers/macintosh/via-pmu-event.c:53: undefined reference to `input_register_device'
> m68k-linux-ld: drivers/macintosh/via-pmu-event.c:55: undefined reference to `input_free_device'
> m68k-linux-ld: drivers/macintosh/via-cuda.o: in function `cuda_set_rtc_time':
> drivers/macintosh/via-cuda.c:797: undefined reference to `rtc_tm_to_time64'
> 
> Fixes: 0792a2c8e0bb ("macintosh: Use common code to access RTC")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Reported-by: kernel test robot <lkp@intel.com>
> Cc: Kees Cook <keescook@chromium.org>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: Finn Thain <fthain@linux-m68k.org>
> Cc: Geert Uytterhoeven <geert@linux-m68k.org>
> Cc: Nathan Chancellor <nathan@kernel.org>
> Cc: Nick Desaulniers <ndesaulniers@google.com>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: linuxppc-dev@lists.ozlabs.org
> ---
> This is a big hammer type of patch. We could possibly do (a) some
> conditional code blocks for RTC_CLASS and (b) only build via-pmu-event
> if CONFIG_INPUT=y if needed.
> 
>  drivers/macintosh/Kconfig |    3 +++
>  1 file changed, 3 insertions(+)
> 
> --- a/drivers/macintosh/Kconfig
> +++ b/drivers/macintosh/Kconfig
> @@ -44,6 +44,7 @@ config ADB_IOP
>  config ADB_CUDA
>  	bool "Support for Cuda/Egret based Macs and PowerMacs"
>  	depends on (ADB || PPC_PMAC) && !PPC_PMAC64
> +	depends on RTC_CLASS
>  	help
>  	  This provides support for Cuda/Egret based Macintosh and
>  	  Power Macintosh systems. This includes most m68k based Macs,
> @@ -57,6 +58,8 @@ config ADB_CUDA
>  config ADB_PMU
>  	bool "Support for PMU based PowerMacs and PowerBooks"
>  	depends on PPC_PMAC || MAC
> +	depends on INPUT=y
> +	depends on RTC_CLASS
>  	help
>  	  On PowerBooks, iBooks, and recent iMacs and Power Macintoshes, the
>  	  PMU is an embedded microprocessor whose primary function is to

-- 
~Randy

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

* Re: [PATCH] macintosh: fix via-pmu and via-cuda build errors
  2022-04-07  3:16   ` Randy Dunlap
  (?)
@ 2022-04-07  7:14   ` Christophe Leroy
  2022-04-07  7:41       ` Finn Thain
  -1 siblings, 1 reply; 11+ messages in thread
From: Christophe Leroy @ 2022-04-07  7:14 UTC (permalink / raw)
  To: Randy Dunlap, linux-kernel
  Cc: kernel test robot, Finn Thain, Nick Desaulniers,
	Nathan Chancellor, Geert Uytterhoeven, linuxppc-dev,
	Arnd Bergmann, Kees Cook



Le 07/04/2022 à 05:16, Randy Dunlap a écrit :
> 
> 
> On 4/6/22 19:37, Randy Dunlap wrote:
>> When CONFIG_INPUT=m, the input_*() family of functions is not
>> available to builtin drivers.
>>
>> When CONFIG_RTC_CLASS is not set, rtc_tm_to_time64() is not defined.
>>
>> Fix multiple build errors by making these Kconfig symbols required by
>> ADB_CUDA (RTC_CLASS) and ADB_PMU (RTC_CLASS and INPUT).
> 
> Ah yes, Finn has already fixed the INPUT problems here.

https://patchwork.ozlabs.org/project/linuxppc-dev/patch/d987663bbed18d7dbf106db6066a759040b4e57a.1647837028.git.fthain@linux-m68k.org/

> 
> Maybe that patch hasn't been merged anywhere yet?

The patch has comments, I guess we are waiting for a new version ?



> 
> The RTC_CLASS problem is still present AFAICT.
> 


Christophe

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

* Re: [PATCH] macintosh: fix via-pmu and via-cuda build errors
  2022-04-07  2:37 ` Randy Dunlap
@ 2022-04-07  7:22   ` Christophe Leroy
  -1 siblings, 0 replies; 11+ messages in thread
From: Christophe Leroy @ 2022-04-07  7:22 UTC (permalink / raw)
  To: Randy Dunlap, linux-kernel
  Cc: kernel test robot, Finn Thain, Nick Desaulniers,
	Nathan Chancellor, Arnd Bergmann, Geert Uytterhoeven,
	linuxppc-dev, Kees Cook



Le 07/04/2022 à 04:37, Randy Dunlap a écrit :
> When CONFIG_INPUT=m, the input_*() family of functions is not
> available to builtin drivers.
> 
> When CONFIG_RTC_CLASS is not set, rtc_tm_to_time64() is not defined.
> 
> Fix multiple build errors by making these Kconfig symbols required by
> ADB_CUDA (RTC_CLASS) and ADB_PMU (RTC_CLASS and INPUT).
> 
> m68k-linux-ld: drivers/macintosh/via-pmu.o: in function `pmu_set_rtc_time':
> drivers/macintosh/via-pmu.c:1758: undefined reference to `rtc_tm_to_time64'
> m68k-linux-ld: drivers/macintosh/via-pmu-event.o: in function `input_report_key':
> include/linux/input.h:425: undefined reference to `input_event'
> m68k-linux-ld: drivers/macintosh/via-pmu-event.o: in function `input_report_switch':
> include/linux/input.h:445: undefined reference to `input_event'
> m68k-linux-ld: drivers/macintosh/via-pmu-event.o: in function `via_pmu_event_init':
> drivers/macintosh/via-pmu-event.c:38: undefined reference to `input_allocate_device'
> m68k-linux-ld: drivers/macintosh/via-pmu-event.c:53: undefined reference to `input_register_device'
> m68k-linux-ld: drivers/macintosh/via-pmu-event.c:55: undefined reference to `input_free_device'
> m68k-linux-ld: drivers/macintosh/via-cuda.o: in function `cuda_set_rtc_time':
> drivers/macintosh/via-cuda.c:797: undefined reference to `rtc_tm_to_time64'
> 
> Fixes: 0792a2c8e0bb ("macintosh: Use common code to access RTC")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Reported-by: kernel test robot <lkp@intel.com>
> Cc: Kees Cook <keescook@chromium.org>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: Finn Thain <fthain@linux-m68k.org>
> Cc: Geert Uytterhoeven <geert@linux-m68k.org>
> Cc: Nathan Chancellor <nathan@kernel.org>
> Cc: Nick Desaulniers <ndesaulniers@google.com>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: linuxppc-dev@lists.ozlabs.org
> ---
> This is a big hammer type of patch. We could possibly do (a) some
> conditional code blocks for RTC_CLASS and (b) only build via-pmu-event
> if CONFIG_INPUT=y if needed.
> 
>   drivers/macintosh/Kconfig |    3 +++
>   1 file changed, 3 insertions(+)
> 
> --- a/drivers/macintosh/Kconfig
> +++ b/drivers/macintosh/Kconfig
> @@ -44,6 +44,7 @@ config ADB_IOP
>   config ADB_CUDA
>   	bool "Support for Cuda/Egret based Macs and PowerMacs"
>   	depends on (ADB || PPC_PMAC) && !PPC_PMAC64
> +	depends on RTC_CLASS

Shouldn't it be the other way round, ie 'select RTC_CLASS' ?


>   	help
>   	  This provides support for Cuda/Egret based Macintosh and
>   	  Power Macintosh systems. This includes most m68k based Macs,
> @@ -57,6 +58,8 @@ config ADB_CUDA
>   config ADB_PMU
>   	bool "Support for PMU based PowerMacs and PowerBooks"
>   	depends on PPC_PMAC || MAC
> +	depends on INPUT=y

As far as I remember that's not enough, it leads to some warnings, see 
the threads around Finn's patch.

> +	depends on RTC_CLASS

Shouldn't it be the other way round, ie 'select RTC_CLASS' ?

>   	help
>   	  On PowerBooks, iBooks, and recent iMacs and Power Macintoshes, the
>   	  PMU is an embedded microprocessor whose primary function is to

Christophe

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

* Re: [PATCH] macintosh: fix via-pmu and via-cuda build errors
@ 2022-04-07  7:22   ` Christophe Leroy
  0 siblings, 0 replies; 11+ messages in thread
From: Christophe Leroy @ 2022-04-07  7:22 UTC (permalink / raw)
  To: Randy Dunlap, linux-kernel
  Cc: kernel test robot, Arnd Bergmann, Nick Desaulniers,
	Nathan Chancellor, Geert Uytterhoeven, linuxppc-dev, Finn Thain,
	Kees Cook



Le 07/04/2022 à 04:37, Randy Dunlap a écrit :
> When CONFIG_INPUT=m, the input_*() family of functions is not
> available to builtin drivers.
> 
> When CONFIG_RTC_CLASS is not set, rtc_tm_to_time64() is not defined.
> 
> Fix multiple build errors by making these Kconfig symbols required by
> ADB_CUDA (RTC_CLASS) and ADB_PMU (RTC_CLASS and INPUT).
> 
> m68k-linux-ld: drivers/macintosh/via-pmu.o: in function `pmu_set_rtc_time':
> drivers/macintosh/via-pmu.c:1758: undefined reference to `rtc_tm_to_time64'
> m68k-linux-ld: drivers/macintosh/via-pmu-event.o: in function `input_report_key':
> include/linux/input.h:425: undefined reference to `input_event'
> m68k-linux-ld: drivers/macintosh/via-pmu-event.o: in function `input_report_switch':
> include/linux/input.h:445: undefined reference to `input_event'
> m68k-linux-ld: drivers/macintosh/via-pmu-event.o: in function `via_pmu_event_init':
> drivers/macintosh/via-pmu-event.c:38: undefined reference to `input_allocate_device'
> m68k-linux-ld: drivers/macintosh/via-pmu-event.c:53: undefined reference to `input_register_device'
> m68k-linux-ld: drivers/macintosh/via-pmu-event.c:55: undefined reference to `input_free_device'
> m68k-linux-ld: drivers/macintosh/via-cuda.o: in function `cuda_set_rtc_time':
> drivers/macintosh/via-cuda.c:797: undefined reference to `rtc_tm_to_time64'
> 
> Fixes: 0792a2c8e0bb ("macintosh: Use common code to access RTC")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Reported-by: kernel test robot <lkp@intel.com>
> Cc: Kees Cook <keescook@chromium.org>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: Finn Thain <fthain@linux-m68k.org>
> Cc: Geert Uytterhoeven <geert@linux-m68k.org>
> Cc: Nathan Chancellor <nathan@kernel.org>
> Cc: Nick Desaulniers <ndesaulniers@google.com>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: linuxppc-dev@lists.ozlabs.org
> ---
> This is a big hammer type of patch. We could possibly do (a) some
> conditional code blocks for RTC_CLASS and (b) only build via-pmu-event
> if CONFIG_INPUT=y if needed.
> 
>   drivers/macintosh/Kconfig |    3 +++
>   1 file changed, 3 insertions(+)
> 
> --- a/drivers/macintosh/Kconfig
> +++ b/drivers/macintosh/Kconfig
> @@ -44,6 +44,7 @@ config ADB_IOP
>   config ADB_CUDA
>   	bool "Support for Cuda/Egret based Macs and PowerMacs"
>   	depends on (ADB || PPC_PMAC) && !PPC_PMAC64
> +	depends on RTC_CLASS

Shouldn't it be the other way round, ie 'select RTC_CLASS' ?


>   	help
>   	  This provides support for Cuda/Egret based Macintosh and
>   	  Power Macintosh systems. This includes most m68k based Macs,
> @@ -57,6 +58,8 @@ config ADB_CUDA
>   config ADB_PMU
>   	bool "Support for PMU based PowerMacs and PowerBooks"
>   	depends on PPC_PMAC || MAC
> +	depends on INPUT=y

As far as I remember that's not enough, it leads to some warnings, see 
the threads around Finn's patch.

> +	depends on RTC_CLASS

Shouldn't it be the other way round, ie 'select RTC_CLASS' ?

>   	help
>   	  On PowerBooks, iBooks, and recent iMacs and Power Macintoshes, the
>   	  PMU is an embedded microprocessor whose primary function is to

Christophe

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

* Re: [PATCH] macintosh: fix via-pmu and via-cuda build errors
  2022-04-07  2:37 ` Randy Dunlap
@ 2022-04-07  7:31   ` Finn Thain
  -1 siblings, 0 replies; 11+ messages in thread
From: Finn Thain @ 2022-04-07  7:31 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: linux-kernel, kernel test robot, Kees Cook, Arnd Bergmann,
	Michael Ellerman, Geert Uytterhoeven, Nathan Chancellor,
	Nick Desaulniers, Benjamin Herrenschmidt, linuxppc-dev

On Wed, 6 Apr 2022, Randy Dunlap wrote:

> When CONFIG_RTC_CLASS is not set, rtc_tm_to_time64() is not defined.
> 
> ...
> 
> m68k-linux-ld: drivers/macintosh/via-pmu.o: in function `pmu_set_rtc_time':
> drivers/macintosh/via-pmu.c:1758: undefined reference to `rtc_tm_to_time64'
> m68k-linux-ld: drivers/macintosh/via-cuda.o: in function `cuda_set_rtc_time':
> drivers/macintosh/via-cuda.c:797: undefined reference to `rtc_tm_to_time64'
> 
> ...
> This is a big hammer type of patch. We could possibly do (a) some
> conditional code blocks for RTC_CLASS 

rtc_tm_to_time64() call sites also appear in several other files without 
conditionals:

arch/powerpc/kernel/time.c
arch/powerpc/platforms/8xx/m8xx_setup.c
arch/powerpc/platforms/maple/time.c
arch/powerpc/platforms/powermac/time.c

Why not use mktime64() instead? That seems to be a common pattern for this 
kind of thing (without needing conditional code).

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

* Re: [PATCH] macintosh: fix via-pmu and via-cuda build errors
@ 2022-04-07  7:31   ` Finn Thain
  0 siblings, 0 replies; 11+ messages in thread
From: Finn Thain @ 2022-04-07  7:31 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Kees Cook, Arnd Bergmann, Nick Desaulniers, linux-kernel,
	Nathan Chancellor, Geert Uytterhoeven, linuxppc-dev,
	kernel test robot

On Wed, 6 Apr 2022, Randy Dunlap wrote:

> When CONFIG_RTC_CLASS is not set, rtc_tm_to_time64() is not defined.
> 
> ...
> 
> m68k-linux-ld: drivers/macintosh/via-pmu.o: in function `pmu_set_rtc_time':
> drivers/macintosh/via-pmu.c:1758: undefined reference to `rtc_tm_to_time64'
> m68k-linux-ld: drivers/macintosh/via-cuda.o: in function `cuda_set_rtc_time':
> drivers/macintosh/via-cuda.c:797: undefined reference to `rtc_tm_to_time64'
> 
> ...
> This is a big hammer type of patch. We could possibly do (a) some
> conditional code blocks for RTC_CLASS 

rtc_tm_to_time64() call sites also appear in several other files without 
conditionals:

arch/powerpc/kernel/time.c
arch/powerpc/platforms/8xx/m8xx_setup.c
arch/powerpc/platforms/maple/time.c
arch/powerpc/platforms/powermac/time.c

Why not use mktime64() instead? That seems to be a common pattern for this 
kind of thing (without needing conditional code).

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

* Re: [PATCH] macintosh: fix via-pmu and via-cuda build errors
  2022-04-07  7:14   ` Christophe Leroy
@ 2022-04-07  7:41       ` Finn Thain
  0 siblings, 0 replies; 11+ messages in thread
From: Finn Thain @ 2022-04-07  7:41 UTC (permalink / raw)
  To: Christophe Leroy
  Cc: Randy Dunlap, linux-kernel, kernel test robot, Nick Desaulniers,
	Nathan Chancellor, Geert Uytterhoeven, linuxppc-dev,
	Arnd Bergmann, Kees Cook

[-- Attachment #1: Type: text/plain, Size: 906 bytes --]

On Thu, 7 Apr 2022, Christophe Leroy wrote:

> Le 07/04/2022 à 05:16, Randy Dunlap a écrit :
> > 
> > 
> > On 4/6/22 19:37, Randy Dunlap wrote:
> >> When CONFIG_INPUT=m, the input_*() family of functions is not
> >> available to builtin drivers.
> >>
> >> When CONFIG_RTC_CLASS is not set, rtc_tm_to_time64() is not defined.
> >>
> >> Fix multiple build errors by making these Kconfig symbols required by
> >> ADB_CUDA (RTC_CLASS) and ADB_PMU (RTC_CLASS and INPUT).
> > 
> > Ah yes, Finn has already fixed the INPUT problems here.
> 
> https://patchwork.ozlabs.org/project/linuxppc-dev/patch/d987663bbed18d7dbf106db6066a759040b4e57a.1647837028.git.fthain@linux-m68k.org/
> 
> > 
> > Maybe that patch hasn't been merged anywhere yet?
> 
> The patch has comments, I guess we are waiting for a new version ?
> 

I'll send a new version, though I expect it will attract comments too.

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

* Re: [PATCH] macintosh: fix via-pmu and via-cuda build errors
@ 2022-04-07  7:41       ` Finn Thain
  0 siblings, 0 replies; 11+ messages in thread
From: Finn Thain @ 2022-04-07  7:41 UTC (permalink / raw)
  To: Christophe Leroy
  Cc: kernel test robot, Arnd Bergmann, Randy Dunlap, Nick Desaulniers,
	linux-kernel, Nathan Chancellor, Geert Uytterhoeven,
	linuxppc-dev, Kees Cook

[-- Attachment #1: Type: text/plain, Size: 906 bytes --]

On Thu, 7 Apr 2022, Christophe Leroy wrote:

> Le 07/04/2022 à 05:16, Randy Dunlap a écrit :
> > 
> > 
> > On 4/6/22 19:37, Randy Dunlap wrote:
> >> When CONFIG_INPUT=m, the input_*() family of functions is not
> >> available to builtin drivers.
> >>
> >> When CONFIG_RTC_CLASS is not set, rtc_tm_to_time64() is not defined.
> >>
> >> Fix multiple build errors by making these Kconfig symbols required by
> >> ADB_CUDA (RTC_CLASS) and ADB_PMU (RTC_CLASS and INPUT).
> > 
> > Ah yes, Finn has already fixed the INPUT problems here.
> 
> https://patchwork.ozlabs.org/project/linuxppc-dev/patch/d987663bbed18d7dbf106db6066a759040b4e57a.1647837028.git.fthain@linux-m68k.org/
> 
> > 
> > Maybe that patch hasn't been merged anywhere yet?
> 
> The patch has comments, I guess we are waiting for a new version ?
> 

I'll send a new version, though I expect it will attract comments too.

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

end of thread, other threads:[~2022-04-07  7:42 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-07  2:37 [PATCH] macintosh: fix via-pmu and via-cuda build errors Randy Dunlap
2022-04-07  2:37 ` Randy Dunlap
2022-04-07  3:16 ` Randy Dunlap
2022-04-07  3:16   ` Randy Dunlap
2022-04-07  7:14   ` Christophe Leroy
2022-04-07  7:41     ` Finn Thain
2022-04-07  7:41       ` Finn Thain
2022-04-07  7:22 ` Christophe Leroy
2022-04-07  7:22   ` Christophe Leroy
2022-04-07  7:31 ` Finn Thain
2022-04-07  7:31   ` Finn Thain

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.