All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cxl: fix CONFIG_FW_LOADER dependency
@ 2023-07-03 11:29 Arnd Bergmann
  2023-07-05 15:54 ` Dave Jiang
  2023-07-06 10:50 ` Xiao Yang
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2023-07-03 11:29 UTC (permalink / raw)
  To: Alison Schofield, Vishal Verma, Ira Weiny, Ben Widawsky,
	Dan Williams, Jonathan Cameron, Dave Jiang
  Cc: Arnd Bergmann, Randy Dunlap, linux-cxl, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

When FW_LOADER is disabled, cxl fails to link:

arm-linux-gnueabi-ld: drivers/cxl/core/memdev.o: in function `cxl_memdev_setup_fw_upload':
memdev.c:(.text+0x90e): undefined reference to `firmware_upload_register'
memdev.c:(.text+0x93c): undefined reference to `firmware_upload_unregister'

In order to use the firmware_upload_register() function, both FW_LOADER
and FW_UPLOAD have to be enabled, which is a bit confusing. In addition,
the dependency is on the wrong symbol, as the caller is part of the
cxl_core.ko module, not the cxl_mem.ko module.

Fixes: 9521875bbe005 ("cxl: add a firmware update mechanism using the sysfs firmware loader")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/cxl/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/cxl/Kconfig b/drivers/cxl/Kconfig
index fcbf8295fde37..8ea1d340e4385 100644
--- a/drivers/cxl/Kconfig
+++ b/drivers/cxl/Kconfig
@@ -2,6 +2,8 @@
 menuconfig CXL_BUS
 	tristate "CXL (Compute Express Link) Devices Support"
 	depends on PCI
+	select FW_LOADER
+	select FW_UPLOAD
 	select PCI_DOE
 	help
 	  CXL is a bus that is electrically compatible with PCI Express, but
@@ -82,7 +84,6 @@ config CXL_PMEM
 config CXL_MEM
 	tristate "CXL: Memory Expansion"
 	depends on CXL_PCI
-	select FW_UPLOAD
 	default CXL_BUS
 	help
 	  The CXL.mem protocol allows a device to act as a provider of "System
-- 
2.39.2


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

* Re: [PATCH] cxl: fix CONFIG_FW_LOADER dependency
  2023-07-03 11:29 [PATCH] cxl: fix CONFIG_FW_LOADER dependency Arnd Bergmann
@ 2023-07-05 15:54 ` Dave Jiang
  2023-07-06 10:50 ` Xiao Yang
  1 sibling, 0 replies; 3+ messages in thread
From: Dave Jiang @ 2023-07-05 15:54 UTC (permalink / raw)
  To: Arnd Bergmann, Alison Schofield, Vishal Verma, Ira Weiny,
	Ben Widawsky, Dan Williams, Jonathan Cameron
  Cc: Arnd Bergmann, Randy Dunlap, linux-cxl, linux-kernel



On 7/3/23 04:29, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> When FW_LOADER is disabled, cxl fails to link:
> 
> arm-linux-gnueabi-ld: drivers/cxl/core/memdev.o: in function `cxl_memdev_setup_fw_upload':
> memdev.c:(.text+0x90e): undefined reference to `firmware_upload_register'
> memdev.c:(.text+0x93c): undefined reference to `firmware_upload_unregister'
> 
> In order to use the firmware_upload_register() function, both FW_LOADER
> and FW_UPLOAD have to be enabled, which is a bit confusing. In addition,
> the dependency is on the wrong symbol, as the caller is part of the
> cxl_core.ko module, not the cxl_mem.ko module.
> 
> Fixes: 9521875bbe005 ("cxl: add a firmware update mechanism using the sysfs firmware loader")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Dave Jiang <dave.jiang@intel.com>

> ---
>   drivers/cxl/Kconfig | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/cxl/Kconfig b/drivers/cxl/Kconfig
> index fcbf8295fde37..8ea1d340e4385 100644
> --- a/drivers/cxl/Kconfig
> +++ b/drivers/cxl/Kconfig
> @@ -2,6 +2,8 @@
>   menuconfig CXL_BUS
>   	tristate "CXL (Compute Express Link) Devices Support"
>   	depends on PCI
> +	select FW_LOADER
> +	select FW_UPLOAD
>   	select PCI_DOE
>   	help
>   	  CXL is a bus that is electrically compatible with PCI Express, but
> @@ -82,7 +84,6 @@ config CXL_PMEM
>   config CXL_MEM
>   	tristate "CXL: Memory Expansion"
>   	depends on CXL_PCI
> -	select FW_UPLOAD
>   	default CXL_BUS
>   	help
>   	  The CXL.mem protocol allows a device to act as a provider of "System

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

* Re: [PATCH] cxl: fix CONFIG_FW_LOADER dependency
  2023-07-03 11:29 [PATCH] cxl: fix CONFIG_FW_LOADER dependency Arnd Bergmann
  2023-07-05 15:54 ` Dave Jiang
@ 2023-07-06 10:50 ` Xiao Yang
  1 sibling, 0 replies; 3+ messages in thread
From: Xiao Yang @ 2023-07-06 10:50 UTC (permalink / raw)
  To: Arnd Bergmann, Alison Schofield, Vishal Verma, Ira Weiny,
	Ben Widawsky, Dan Williams, Jonathan Cameron, Dave Jiang
  Cc: Arnd Bergmann, Randy Dunlap, linux-cxl, linux-kernel

On 2023/7/3 19:29, Arnd Bergmann wrote:
> From: Arnd Bergmann<arnd@arndb.de>
> 
> When FW_LOADER is disabled, cxl fails to link:
> 
> arm-linux-gnueabi-ld: drivers/cxl/core/memdev.o: in function `cxl_memdev_setup_fw_upload':
> memdev.c:(.text+0x90e): undefined reference to `firmware_upload_register'
> memdev.c:(.text+0x93c): undefined reference to `firmware_upload_unregister'
> 
> In order to use the firmware_upload_register() function, both FW_LOADER
> and FW_UPLOAD have to be enabled, which is a bit confusing. In addition,
> the dependency is on the wrong symbol, as the caller is part of the
> cxl_core.ko module, not the cxl_mem.ko module.
> 
> Fixes: 9521875bbe005 ("cxl: add a firmware update mechanism using the sysfs firmware loader")
> Signed-off-by: Arnd Bergmann<arnd@arndb.de>

Hi Arnd,

It makes sense.

Reviewed-by: Xiao Yang <yangx.jy@fujitsu.com>

Best Regards,
Xiao Yang

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

end of thread, other threads:[~2023-07-06 10:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-03 11:29 [PATCH] cxl: fix CONFIG_FW_LOADER dependency Arnd Bergmann
2023-07-05 15:54 ` Dave Jiang
2023-07-06 10:50 ` Xiao Yang

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.