* [PATCH] pds_core: fix linking without CONFIG_DEBUG_FS
@ 2023-05-01 15:06 Arnd Bergmann
2023-05-01 15:41 ` Simon Horman
2023-05-01 22:35 ` Jakub Kicinski
0 siblings, 2 replies; 5+ messages in thread
From: Arnd Bergmann @ 2023-05-01 15:06 UTC (permalink / raw)
To: Shannon Nelson, Brett Creeley, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni
Cc: Arnd Bergmann, netdev, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
The debugfs.o file is only built when the fs is enabled:
main.c:(.text+0x47c): undefined reference to `pdsc_debugfs_del_dev'
main.c:(.text+0x8dc): undefined reference to `pdsc_debugfs_add_dev'
main.c:(.exit.text+0x14): undefined reference to `pdsc_debugfs_destroy'
main.c:(.init.text+0x8): undefined reference to `pdsc_debugfs_create'
dev.c:(.text+0x988): undefined reference to `pdsc_debugfs_add_ident'
core.c:(.text+0x6b0): undefined reference to `pdsc_debugfs_del_qcq'
core.c:(.text+0x998): undefined reference to `pdsc_debugfs_add_qcq'
core.c:(.text+0xf0c): undefined reference to `pdsc_debugfs_add_viftype'
Add dummy helper functions for these interfaces.
Fixes: 55435ea7729a ("pds_core: initial framework for pds_core PF driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/net/ethernet/amd/pds_core/core.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/net/ethernet/amd/pds_core/core.h b/drivers/net/ethernet/amd/pds_core/core.h
index e545fafc4819..2cc430403e9c 100644
--- a/drivers/net/ethernet/amd/pds_core/core.h
+++ b/drivers/net/ethernet/amd/pds_core/core.h
@@ -261,6 +261,7 @@ int pdsc_dl_enable_validate(struct devlink *dl, u32 id,
void __iomem *pdsc_map_dbpage(struct pdsc *pdsc, int page_num);
+#ifdef CONFIG_DEBUG_FS
void pdsc_debugfs_create(void);
void pdsc_debugfs_destroy(void);
void pdsc_debugfs_add_dev(struct pdsc *pdsc);
@@ -270,6 +271,17 @@ void pdsc_debugfs_add_viftype(struct pdsc *pdsc);
void pdsc_debugfs_add_irqs(struct pdsc *pdsc);
void pdsc_debugfs_add_qcq(struct pdsc *pdsc, struct pdsc_qcq *qcq);
void pdsc_debugfs_del_qcq(struct pdsc_qcq *qcq);
+#else
+static inline void pdsc_debugfs_create(void) {}
+static inline void pdsc_debugfs_destroy(void) {}
+static inline void pdsc_debugfs_add_dev(struct pdsc *pdsc) {}
+static inline void pdsc_debugfs_del_dev(struct pdsc *pdsc) {}
+static inline void pdsc_debugfs_add_ident(struct pdsc *pdsc) {}
+static inline void pdsc_debugfs_add_viftype(struct pdsc *pdsc) {}
+static inline void pdsc_debugfs_add_irqs(struct pdsc *pdsc) {}
+static inline void pdsc_debugfs_add_qcq(struct pdsc *pdsc, struct pdsc_qcq *qcq) {}
+static inline void pdsc_debugfs_del_qcq(struct pdsc_qcq *qcq) {}
+#endif
int pdsc_err_to_errno(enum pds_core_status_code code);
bool pdsc_is_fw_running(struct pdsc *pdsc);
--
2.39.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] pds_core: fix linking without CONFIG_DEBUG_FS
2023-05-01 15:06 [PATCH] pds_core: fix linking without CONFIG_DEBUG_FS Arnd Bergmann
@ 2023-05-01 15:41 ` Simon Horman
2023-05-01 19:34 ` Arnd Bergmann
2023-05-01 22:35 ` Jakub Kicinski
1 sibling, 1 reply; 5+ messages in thread
From: Simon Horman @ 2023-05-01 15:41 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Shannon Nelson, Brett Creeley, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Arnd Bergmann, netdev, linux-kernel
On Mon, May 01, 2023 at 05:06:14PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> The debugfs.o file is only built when the fs is enabled:
>
> main.c:(.text+0x47c): undefined reference to `pdsc_debugfs_del_dev'
> main.c:(.text+0x8dc): undefined reference to `pdsc_debugfs_add_dev'
> main.c:(.exit.text+0x14): undefined reference to `pdsc_debugfs_destroy'
> main.c:(.init.text+0x8): undefined reference to `pdsc_debugfs_create'
> dev.c:(.text+0x988): undefined reference to `pdsc_debugfs_add_ident'
> core.c:(.text+0x6b0): undefined reference to `pdsc_debugfs_del_qcq'
> core.c:(.text+0x998): undefined reference to `pdsc_debugfs_add_qcq'
> core.c:(.text+0xf0c): undefined reference to `pdsc_debugfs_add_viftype'
>
> Add dummy helper functions for these interfaces.
>
> Fixes: 55435ea7729a ("pds_core: initial framework for pds_core PF driver")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Thanks Arnd,
this looks good to me.
Reviewed-by: Simon Horman <simon.horman@corigine.com>
While exercising this I noticed that building pds_core fails
if either CONFIG_AUXILIARY_BUS or NET_DEVLINK are not enabled.
I think the solution is for PFS_CORE to select both CONFIG_AUXILIARY_BUS
and NET_DEVLINK.
I am wondering if this is on anyone's radar.
If not I'll send a patch.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] pds_core: fix linking without CONFIG_DEBUG_FS
2023-05-01 15:41 ` Simon Horman
@ 2023-05-01 19:34 ` Arnd Bergmann
0 siblings, 0 replies; 5+ messages in thread
From: Arnd Bergmann @ 2023-05-01 19:34 UTC (permalink / raw)
To: Simon Horman, Arnd Bergmann
Cc: Shannon Nelson, Brett Creeley, David S . Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Netdev, linux-kernel, Conor Dooley,
Philipp Zabel
On Mon, May 1, 2023, at 17:41, Simon Horman wrote:
> On Mon, May 01, 2023 at 05:06:14PM +0200, Arnd Bergmann wrote:
>
> While exercising this I noticed that building pds_core fails
> if either CONFIG_AUXILIARY_BUS or NET_DEVLINK are not enabled.
>
> I think the solution is for PFS_CORE to select both CONFIG_AUXILIARY_BUS
> and NET_DEVLINK.
Makes sense. I just double-checked the other uses of these symbols
to see if they should be 'select' or 'depends on', and you are
right that selecting them is the correct solution.
There are two instances of 'depends on CONFIG_AUXILIARY_BUS'
in drivers/reset that both should be 'select' as well, since
this is not a user-visible symbol.
Arnd
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] pds_core: fix linking without CONFIG_DEBUG_FS
2023-05-01 15:06 [PATCH] pds_core: fix linking without CONFIG_DEBUG_FS Arnd Bergmann
2023-05-01 15:41 ` Simon Horman
@ 2023-05-01 22:35 ` Jakub Kicinski
2023-05-02 4:01 ` Shannon Nelson
1 sibling, 1 reply; 5+ messages in thread
From: Jakub Kicinski @ 2023-05-01 22:35 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Shannon Nelson, Brett Creeley, David S. Miller, Eric Dumazet,
Paolo Abeni, Arnd Bergmann, netdev, linux-kernel
On Mon, 1 May 2023 17:06:14 +0200 Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> The debugfs.o file is only built when the fs is enabled:
>
> main.c:(.text+0x47c): undefined reference to `pdsc_debugfs_del_dev'
> main.c:(.text+0x8dc): undefined reference to `pdsc_debugfs_add_dev'
> main.c:(.exit.text+0x14): undefined reference to `pdsc_debugfs_destroy'
> main.c:(.init.text+0x8): undefined reference to `pdsc_debugfs_create'
> dev.c:(.text+0x988): undefined reference to `pdsc_debugfs_add_ident'
> core.c:(.text+0x6b0): undefined reference to `pdsc_debugfs_del_qcq'
> core.c:(.text+0x998): undefined reference to `pdsc_debugfs_add_qcq'
> core.c:(.text+0xf0c): undefined reference to `pdsc_debugfs_add_viftype'
>
> Add dummy helper functions for these interfaces.
Debugfs should wrap itself. Doesn't this work:
diff --git a/drivers/net/ethernet/amd/pds_core/Makefile b/drivers/net/ethernet/amd/pds_core/Makefile
index 0abc33ce826c..54d1d5b375ce 100644
--- a/drivers/net/ethernet/amd/pds_core/Makefile
+++ b/drivers/net/ethernet/amd/pds_core/Makefile
@@ -9,6 +9,5 @@ pds_core-y := main.o \
dev.o \
adminq.o \
core.o \
- fw.o
-
-pds_core-$(CONFIG_DEBUG_FS) += debugfs.o
+ fw.o \
+ debugfs.o
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] pds_core: fix linking without CONFIG_DEBUG_FS
2023-05-01 22:35 ` Jakub Kicinski
@ 2023-05-02 4:01 ` Shannon Nelson
0 siblings, 0 replies; 5+ messages in thread
From: Shannon Nelson @ 2023-05-02 4:01 UTC (permalink / raw)
To: Jakub Kicinski, Arnd Bergmann
Cc: Brett Creeley, David S. Miller, Eric Dumazet, Paolo Abeni,
Arnd Bergmann, netdev, linux-kernel
On 5/1/23 3:35 PM, Jakub Kicinski wrote:
> On Mon, 1 May 2023 17:06:14 +0200 Arnd Bergmann wrote:
>> From: Arnd Bergmann <arnd@arndb.de>
>>
>> The debugfs.o file is only built when the fs is enabled:
>>
>> main.c:(.text+0x47c): undefined reference to `pdsc_debugfs_del_dev'
>> main.c:(.text+0x8dc): undefined reference to `pdsc_debugfs_add_dev'
>> main.c:(.exit.text+0x14): undefined reference to `pdsc_debugfs_destroy'
>> main.c:(.init.text+0x8): undefined reference to `pdsc_debugfs_create'
>> dev.c:(.text+0x988): undefined reference to `pdsc_debugfs_add_ident'
>> core.c:(.text+0x6b0): undefined reference to `pdsc_debugfs_del_qcq'
>> core.c:(.text+0x998): undefined reference to `pdsc_debugfs_add_qcq'
>> core.c:(.text+0xf0c): undefined reference to `pdsc_debugfs_add_viftype'
>>
>> Add dummy helper functions for these interfaces.
>
> Debugfs should wrap itself. Doesn't this work:
>
> diff --git a/drivers/net/ethernet/amd/pds_core/Makefile b/drivers/net/ethernet/amd/pds_core/Makefile
> index 0abc33ce826c..54d1d5b375ce 100644
> --- a/drivers/net/ethernet/amd/pds_core/Makefile
> +++ b/drivers/net/ethernet/amd/pds_core/Makefile
> @@ -9,6 +9,5 @@ pds_core-y := main.o \
> dev.o \
> adminq.o \
> core.o \
> - fw.o
> -
> -pds_core-$(CONFIG_DEBUG_FS) += debugfs.o
> + fw.o \
> + debugfs.o
Yes, that should do it, and should have been done in the rest of the
change that I made after Leon suggested removing the dummy functions
that I originally had there [0].
Tomorrow when I'm back from vacation I can do a couple of follow-up
patches for this and for the other config tags that Simon pointed out.
sln
[0] https://lore.kernel.org/netdev/20230409112645.GS14869@unreal/
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-05-02 4:01 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-01 15:06 [PATCH] pds_core: fix linking without CONFIG_DEBUG_FS Arnd Bergmann
2023-05-01 15:41 ` Simon Horman
2023-05-01 19:34 ` Arnd Bergmann
2023-05-01 22:35 ` Jakub Kicinski
2023-05-02 4:01 ` Shannon Nelson
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.