* [PATCH 0/3] Pwrseq/serdev fixes
@ 2026-04-01 7:07 Manivannan Sadhasivam
2026-04-01 7:07 ` [PATCH 1/3] serdev: Add missing stubs for serdev APIs when CONFIG_SERIAL_DEV_BUS is not selected Manivannan Sadhasivam
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Manivannan Sadhasivam @ 2026-04-01 7:07 UTC (permalink / raw)
To: brgl, robh
Cc: linux-pci, linux-pm, linux-kernel, linux-serial, mani,
Manivannan Sadhasivam
Hi Bartosz,
This series fixes build issues reported by kernel test robot on the recently
merged M.2 Key E pwrseq series.
Patches 2 and 3 can be squashed with offending commits, while patch 1 should be
applied separately.
- Mani
Manivannan Sadhasivam (3):
serdev: Add missing stubs for serdev APIs when CONFIG_SERIAL_DEV_BUS
is not selected
serdev: Add CONFIG_SERIAL_DEV_BUS guard for
of_find_serdev_controller_by_node() API
power: sequencing: pcie-m2: Guard the helper functions making use of
PCI bus notifier
drivers/power/sequencing/pwrseq-pcie-m2.c | 9 +++++
include/linux/serdev.h | 46 +++++++++++++++++------
2 files changed, 43 insertions(+), 12 deletions(-)
--
2.51.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/3] serdev: Add missing stubs for serdev APIs when CONFIG_SERIAL_DEV_BUS is not selected
2026-04-01 7:07 [PATCH 0/3] Pwrseq/serdev fixes Manivannan Sadhasivam
@ 2026-04-01 7:07 ` Manivannan Sadhasivam
2026-04-01 7:07 ` [PATCH 2/3] serdev: Add CONFIG_SERIAL_DEV_BUS guard for of_find_serdev_controller_by_node() API Manivannan Sadhasivam
2026-04-01 7:07 ` [PATCH 3/3] power: sequencing: pcie-m2: Guard the helper functions making use of PCI bus notifier Manivannan Sadhasivam
2 siblings, 0 replies; 5+ messages in thread
From: Manivannan Sadhasivam @ 2026-04-01 7:07 UTC (permalink / raw)
To: brgl, robh
Cc: linux-pci, linux-pm, linux-kernel, linux-serial, mani,
Manivannan Sadhasivam, kernel test robot
Some of the serdev APIs are not guarded by CONFIG_SERIAL_DEV_BUS and also
missing the stubs when the symbol is not selected. This leads to the below
build errors:
drivers/power/sequencing/pwrseq-pcie-m2.o: in function `pwrseq_pcie_m2_remove_serdev':
>> pwrseq-pcie-m2.c:(.text+0x260): undefined reference to `serdev_device_remove'
powerpc64-linux-ld: drivers/power/sequencing/pwrseq-pcie-m2.o: in function `pwrseq_m2_pcie_notify':
>> powerpc64-linux-ld: pwrseq-pcie-m2.c:(.text+0x9c8): undefined reference to `serdev_device_alloc'
>> powerpc64-linux-ld: pwrseq-pcie-m2.c:(.text+0xc00): undefined reference to `serdev_device_add'
Fix these issues by adding the CONFIG_SERIAL_DEV_BUS guard to function
prototypes and stubs when the symbol is not selected.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202604011226.KGNn5974-lkp@intel.com/
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
---
include/linux/serdev.h | 42 ++++++++++++++++++++++++++++++++----------
1 file changed, 32 insertions(+), 10 deletions(-)
diff --git a/include/linux/serdev.h b/include/linux/serdev.h
index 188c0ba62d50..0de261a26284 100644
--- a/include/linux/serdev.h
+++ b/include/linux/serdev.h
@@ -156,16 +156,6 @@ static inline void serdev_controller_put(struct serdev_controller *ctrl)
put_device(&ctrl->dev);
}
-struct serdev_device *serdev_device_alloc(struct serdev_controller *);
-int serdev_device_add(struct serdev_device *);
-void serdev_device_remove(struct serdev_device *);
-
-struct serdev_controller *serdev_controller_alloc(struct device *host,
- struct device *parent,
- size_t size);
-int serdev_controller_add(struct serdev_controller *);
-void serdev_controller_remove(struct serdev_controller *);
-
static inline void serdev_controller_write_wakeup(struct serdev_controller *ctrl)
{
struct serdev_device *serdev = ctrl->serdev;
@@ -204,6 +194,16 @@ void serdev_device_write_wakeup(struct serdev_device *);
ssize_t serdev_device_write(struct serdev_device *, const u8 *, size_t, long);
void serdev_device_write_flush(struct serdev_device *);
+struct serdev_device *serdev_device_alloc(struct serdev_controller *);
+int serdev_device_add(struct serdev_device *);
+void serdev_device_remove(struct serdev_device *);
+
+struct serdev_controller *serdev_controller_alloc(struct device *host,
+ struct device *parent,
+ size_t size);
+int serdev_controller_add(struct serdev_controller *);
+void serdev_controller_remove(struct serdev_controller *);
+
/*
* serdev device driver functions
*/
@@ -264,6 +264,28 @@ static inline ssize_t serdev_device_write(struct serdev_device *sdev,
}
static inline void serdev_device_write_flush(struct serdev_device *sdev) {}
+static inline struct serdev_device *serdev_device_alloc(struct serdev_controller *)
+{
+ return NULL;
+}
+static inline int serdev_device_add(struct serdev_device *)
+{
+ return -ENODEV;
+}
+static inline void serdev_device_remove(struct serdev_device *) {}
+
+static inline struct serdev_controller *serdev_controller_alloc(struct device *host,
+ struct device *parent,
+ size_t size)
+{
+ return NULL;
+}
+static inline int serdev_controller_add(struct serdev_controller *)
+{
+ return -ENODEV;
+}
+static inline void serdev_controller_remove(struct serdev_controller *) {}
+
#define serdev_device_driver_register(x)
#define serdev_device_driver_unregister(x)
--
2.51.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/3] serdev: Add CONFIG_SERIAL_DEV_BUS guard for of_find_serdev_controller_by_node() API
2026-04-01 7:07 [PATCH 0/3] Pwrseq/serdev fixes Manivannan Sadhasivam
2026-04-01 7:07 ` [PATCH 1/3] serdev: Add missing stubs for serdev APIs when CONFIG_SERIAL_DEV_BUS is not selected Manivannan Sadhasivam
@ 2026-04-01 7:07 ` Manivannan Sadhasivam
2026-04-01 7:07 ` [PATCH 3/3] power: sequencing: pcie-m2: Guard the helper functions making use of PCI bus notifier Manivannan Sadhasivam
2 siblings, 0 replies; 5+ messages in thread
From: Manivannan Sadhasivam @ 2026-04-01 7:07 UTC (permalink / raw)
To: brgl, robh
Cc: linux-pci, linux-pm, linux-kernel, linux-serial, mani,
Manivannan Sadhasivam, kernel test robot
Currently, this API is only guarded by CONFIG_OF. But the function
definition is guarded by CONFIG_SERIAL_DEV_BUS symbol in the .c file. This
causes below build error if CONFIG_SERIAL_DEV_BUS is not selected but only
CONFIG_OF:
pwrseq-pcie-m2.c:(.text+0x924): undefined reference to `of_find_serdev_controller_by_node'
Fix this issue by adding the CONFIG_SERIAL_DEV_BUS guard to the function
prototype.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202604011226.KGNn5974-lkp@intel.com/
Fixes: a2b4814190af ("serdev: Add an API to find the serdev controller associated with the devicetree node")
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
---
include/linux/serdev.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/serdev.h b/include/linux/serdev.h
index 0de261a26284..58f000534bdb 100644
--- a/include/linux/serdev.h
+++ b/include/linux/serdev.h
@@ -356,13 +356,13 @@ static inline bool serdev_acpi_get_uart_resource(struct acpi_resource *ares,
}
#endif /* CONFIG_ACPI */
-#ifdef CONFIG_OF
+#if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_SERIAL_DEV_BUS)
struct serdev_controller *of_find_serdev_controller_by_node(struct device_node *node);
#else
static inline struct serdev_controller *of_find_serdev_controller_by_node(struct device_node *node)
{
return NULL;
}
-#endif /* CONFIG_OF */
+#endif /* CONFIG_OF && CONFIG_SERIAL_DEV_BUS */
#endif /*_LINUX_SERDEV_H */
--
2.51.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/3] power: sequencing: pcie-m2: Guard the helper functions making use of PCI bus notifier
2026-04-01 7:07 [PATCH 0/3] Pwrseq/serdev fixes Manivannan Sadhasivam
2026-04-01 7:07 ` [PATCH 1/3] serdev: Add missing stubs for serdev APIs when CONFIG_SERIAL_DEV_BUS is not selected Manivannan Sadhasivam
2026-04-01 7:07 ` [PATCH 2/3] serdev: Add CONFIG_SERIAL_DEV_BUS guard for of_find_serdev_controller_by_node() API Manivannan Sadhasivam
@ 2026-04-01 7:07 ` Manivannan Sadhasivam
2026-04-02 22:56 ` kernel test robot
2 siblings, 1 reply; 5+ messages in thread
From: Manivannan Sadhasivam @ 2026-04-01 7:07 UTC (permalink / raw)
To: brgl, robh
Cc: linux-pci, linux-pm, linux-kernel, linux-serial, mani,
Manivannan Sadhasivam, kernel test robot
The PCI bus notifier is only visible if CONFIG_PCI symbol is selected in
Kconfig. But this driver can be built without CONFIG_PCI due to
CONFIG_COMPILE_TEST, leading to below build error:
drivers/power/sequencing/pwrseq-pcie-m2.c: In function 'pwrseq_pcie_m2_free_resources':
>> drivers/power/sequencing/pwrseq-pcie-m2.c:185:34: error: 'pci_bus_type' undeclared (first use in this function); did you mean 'pci_pcie_type'?
185 | bus_unregister_notifier(&pci_bus_type, &ctx->nb);
| ^~~~~~~~~~~~
| pci_pcie_type
drivers/power/sequencing/pwrseq-pcie-m2.c:185:34: note: each undeclared identifier is reported only once for each function it appears in
drivers/power/sequencing/pwrseq-pcie-m2.c: In function 'pwrseq_pcie_m2_register_notifier':
drivers/power/sequencing/pwrseq-pcie-m2.c:340:54: error: 'pci_bus_type' undeclared (first use in this function); did you mean 'pci_pcie_type'?
340 | ret = bus_register_notifier(&pci_bus_type, &ctx->nb);
| ^~~~~~~~~~~~
| pci_pcie_type
So add guards to make sure that all these helper functions making use of
the PCI bus notifier are only compiled if CONFIG_PCI is selected.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202603180609.ucspJefN-lkp@intel.com
Fixes: 3f736aecbdc8 ("power: sequencing: pcie-m2: Create serdev device for WCN7850 bluetooth")
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
---
drivers/power/sequencing/pwrseq-pcie-m2.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/power/sequencing/pwrseq-pcie-m2.c b/drivers/power/sequencing/pwrseq-pcie-m2.c
index a75ca4fda2eb..d3102fea8d93 100644
--- a/drivers/power/sequencing/pwrseq-pcie-m2.c
+++ b/drivers/power/sequencing/pwrseq-pcie-m2.c
@@ -177,6 +177,7 @@ static int pwrseq_pcie_m2_match(struct pwrseq_device *pwrseq,
return PWRSEQ_NO_MATCH;
}
+#if IS_ENABLED(CONFIG_PCI)
static int pwrseq_m2_pcie_create_bt_node(struct pwrseq_pcie_m2_ctx *ctx,
struct device_node *parent)
{
@@ -374,6 +375,12 @@ static int pwrseq_pcie_m2_register_notifier(struct pwrseq_pcie_m2_ctx *ctx, stru
return 0;
}
+#else
+static int pwrseq_pcie_m2_register_notifier(struct pwrseq_pcie_m2_ctx *ctx, struct device *dev)
+{
+ return 0;
+}
+#endif /* CONFIG_PCI */
static int pwrseq_pcie_m2_probe(struct platform_device *pdev)
{
@@ -452,8 +459,10 @@ static void pwrseq_pcie_m2_remove(struct platform_device *pdev)
{
struct pwrseq_pcie_m2_ctx *ctx = platform_get_drvdata(pdev);
+#if IS_ENABLED(CONFIG_PCI)
bus_unregister_notifier(&pci_bus_type, &ctx->nb);
pwrseq_pcie_m2_remove_serdev(ctx);
+#endif
regulator_bulk_free(ctx->num_vregs, ctx->regs);
}
--
2.51.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 3/3] power: sequencing: pcie-m2: Guard the helper functions making use of PCI bus notifier
2026-04-01 7:07 ` [PATCH 3/3] power: sequencing: pcie-m2: Guard the helper functions making use of PCI bus notifier Manivannan Sadhasivam
@ 2026-04-02 22:56 ` kernel test robot
0 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2026-04-02 22:56 UTC (permalink / raw)
To: Manivannan Sadhasivam, brgl, robh
Cc: llvm, oe-kbuild-all, linux-pci, linux-pm, linux-kernel,
linux-serial, mani, Manivannan Sadhasivam, kernel test robot
Hi Manivannan,
kernel test robot noticed the following build warnings:
[auto build test WARNING on linux-next/master]
[also build test WARNING on linus/master v6.16-rc1]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Manivannan-Sadhasivam/serdev-Add-missing-stubs-for-serdev-APIs-when-CONFIG_SERIAL_DEV_BUS-is-not-selected/20260402-225703
base: linux-next/master
patch link: https://lore.kernel.org/r/20260401070735.107162-4-manivannan.sadhasivam%40oss.qualcomm.com
patch subject: [PATCH 3/3] power: sequencing: pcie-m2: Guard the helper functions making use of PCI bus notifier
config: x86_64-kexec (https://download.01.org/0day-ci/archive/20260403/202604030008.5exLAPFm-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260403/202604030008.5exLAPFm-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202604030008.5exLAPFm-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from drivers/tty/tty_port.c:20:
>> include/linux/serdev.h:268:83: warning: omitting the parameter name in a function definition is a C23 extension [-Wc23-extensions]
268 | static inline struct serdev_device *serdev_device_alloc(struct serdev_controller *)
| ^
include/linux/serdev.h:272:59: warning: omitting the parameter name in a function definition is a C23 extension [-Wc23-extensions]
272 | static inline int serdev_device_add(struct serdev_device *)
| ^
include/linux/serdev.h:276:63: warning: omitting the parameter name in a function definition is a C23 extension [-Wc23-extensions]
276 | static inline void serdev_device_remove(struct serdev_device *) {}
| ^
include/linux/serdev.h:284:67: warning: omitting the parameter name in a function definition is a C23 extension [-Wc23-extensions]
284 | static inline int serdev_controller_add(struct serdev_controller *)
| ^
include/linux/serdev.h:288:71: warning: omitting the parameter name in a function definition is a C23 extension [-Wc23-extensions]
288 | static inline void serdev_controller_remove(struct serdev_controller *) {}
| ^
5 warnings generated.
vim +268 include/linux/serdev.h
267
> 268 static inline struct serdev_device *serdev_device_alloc(struct serdev_controller *)
269 {
270 return NULL;
271 }
272 static inline int serdev_device_add(struct serdev_device *)
273 {
274 return -ENODEV;
275 }
276 static inline void serdev_device_remove(struct serdev_device *) {}
277
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-04-02 22:57 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-01 7:07 [PATCH 0/3] Pwrseq/serdev fixes Manivannan Sadhasivam
2026-04-01 7:07 ` [PATCH 1/3] serdev: Add missing stubs for serdev APIs when CONFIG_SERIAL_DEV_BUS is not selected Manivannan Sadhasivam
2026-04-01 7:07 ` [PATCH 2/3] serdev: Add CONFIG_SERIAL_DEV_BUS guard for of_find_serdev_controller_by_node() API Manivannan Sadhasivam
2026-04-01 7:07 ` [PATCH 3/3] power: sequencing: pcie-m2: Guard the helper functions making use of PCI bus notifier Manivannan Sadhasivam
2026-04-02 22:56 ` kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox