2021-02-10 10:51:45

by Stephen Rothwell

[permalink] [raw]
Subject: linux-next: build failure after merge of the driver-core tree

Hi all,

After merging the driver-core tree, today's linux-next build (sparc64
defconfig) failed like this:

drivers/of/property.o: In function `parse_interrupts':
property.c:(.text+0x14e0): undefined reference to `of_irq_parse_one'

Caused by commit

f265f06af194 ("of: property: Fix fw_devlink handling of interrupts/interrupts-extended")

CONFIG_OF_IRQ depends on !SPARC so of_irq_parse_one() needs a stub.
I have added the following patch for today.

From: Stephen Rothwell <[email protected]>
Date: Wed, 10 Feb 2021 21:27:56 +1100
Subject: [PATCH] of: irq: make a stub for of_irq_parse_one()

Signed-off-by: Stephen Rothwell <[email protected]>
---
include/linux/of_irq.h | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h
index e8b78139f78c..f898d838d201 100644
--- a/include/linux/of_irq.h
+++ b/include/linux/of_irq.h
@@ -33,8 +33,6 @@ static inline int of_irq_parse_oldworld(struct device_node *device, int index,
#endif /* CONFIG_PPC32 && CONFIG_PPC_PMAC */

extern int of_irq_parse_raw(const __be32 *addr, struct of_phandle_args *out_irq);
-extern int of_irq_parse_one(struct device_node *device, int index,
- struct of_phandle_args *out_irq);
extern unsigned int irq_create_of_mapping(struct of_phandle_args *irq_data);
extern int of_irq_to_resource(struct device_node *dev, int index,
struct resource *r);
@@ -42,6 +40,8 @@ extern int of_irq_to_resource(struct device_node *dev, int index,
extern void of_irq_init(const struct of_device_id *matches);

#ifdef CONFIG_OF_IRQ
+extern int of_irq_parse_one(struct device_node *device, int index,
+ struct of_phandle_args *out_irq);
extern int of_irq_count(struct device_node *dev);
extern int of_irq_get(struct device_node *dev, int index);
extern int of_irq_get_byname(struct device_node *dev, const char *name);
@@ -57,6 +57,11 @@ extern struct irq_domain *of_msi_map_get_device_domain(struct device *dev,
extern void of_msi_configure(struct device *dev, struct device_node *np);
u32 of_msi_map_id(struct device *dev, struct device_node *msi_np, u32 id_in);
#else
+static inline int of_irq_parse_one(struct device_node *device, int index,
+ struct of_phandle_args *out_irq)
+{
+ return 0;
+}
static inline int of_irq_count(struct device_node *dev)
{
return 0;
--
2.30.0

--
Cheers,
Stephen Rothwell


Attachments:
(No filename) (499.00 B)
OpenPGP digital signature

2021-02-10 18:36:26

by Greg KH

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the driver-core tree

On Wed, Feb 10, 2021 at 09:47:20PM +1100, Stephen Rothwell wrote:
> Hi all,
>
> After merging the driver-core tree, today's linux-next build (sparc64
> defconfig) failed like this:
>
> drivers/of/property.o: In function `parse_interrupts':
> property.c:(.text+0x14e0): undefined reference to `of_irq_parse_one'
>
> Caused by commit
>
> f265f06af194 ("of: property: Fix fw_devlink handling of interrupts/interrupts-extended")
>
> CONFIG_OF_IRQ depends on !SPARC so of_irq_parse_one() needs a stub.
> I have added the following patch for today.
>
> From: Stephen Rothwell <[email protected]>
> Date: Wed, 10 Feb 2021 21:27:56 +1100
> Subject: [PATCH] of: irq: make a stub for of_irq_parse_one()
>
> Signed-off-by: Stephen Rothwell <[email protected]>
> ---
> include/linux/of_irq.h | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)

Thanks for this, I'll go queue it up now.

greg k-h

2021-02-10 19:11:11

by Saravana Kannan

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the driver-core tree

On Wed, Feb 10, 2021 at 10:18 AM Greg KH <[email protected]> wrote:
>
> On Wed, Feb 10, 2021 at 09:47:20PM +1100, Stephen Rothwell wrote:
> > Hi all,
> >
> > After merging the driver-core tree, today's linux-next build (sparc64
> > defconfig) failed like this:
> >
> > drivers/of/property.o: In function `parse_interrupts':
> > property.c:(.text+0x14e0): undefined reference to `of_irq_parse_one'
> >
> > Caused by commit
> >
> > f265f06af194 ("of: property: Fix fw_devlink handling of interrupts/interrupts-extended")
> >
> > CONFIG_OF_IRQ depends on !SPARC so of_irq_parse_one() needs a stub.
> > I have added the following patch for today.
> >
> > From: Stephen Rothwell <[email protected]>
> > Date: Wed, 10 Feb 2021 21:27:56 +1100
> > Subject: [PATCH] of: irq: make a stub for of_irq_parse_one()
> >
> > Signed-off-by: Stephen Rothwell <[email protected]>
> > ---
> > include/linux/of_irq.h | 9 +++++++--
> > 1 file changed, 7 insertions(+), 2 deletions(-)

Thanks Stephen!

-Saravana

>
> Thanks for this, I'll go queue it up now.
>
> greg k-h

2021-02-10 19:19:44

by Saravana Kannan

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the driver-core tree

On Wed, Feb 10, 2021 at 11:06 AM Saravana Kannan <[email protected]> wrote:
>
> On Wed, Feb 10, 2021 at 10:18 AM Greg KH <[email protected]> wrote:
> >
> > On Wed, Feb 10, 2021 at 09:47:20PM +1100, Stephen Rothwell wrote:
> > > Hi all,
> > >
> > > After merging the driver-core tree, today's linux-next build (sparc64
> > > defconfig) failed like this:
> > >
> > > drivers/of/property.o: In function `parse_interrupts':
> > > property.c:(.text+0x14e0): undefined reference to `of_irq_parse_one'
> > >
> > > Caused by commit
> > >
> > > f265f06af194 ("of: property: Fix fw_devlink handling of interrupts/interrupts-extended")
> > >
> > > CONFIG_OF_IRQ depends on !SPARC so of_irq_parse_one() needs a stub.
> > > I have added the following patch for today.
> > >
> > > From: Stephen Rothwell <[email protected]>
> > > Date: Wed, 10 Feb 2021 21:27:56 +1100
> > > Subject: [PATCH] of: irq: make a stub for of_irq_parse_one()
> > >
> > > Signed-off-by: Stephen Rothwell <[email protected]>
> > > ---
> > > include/linux/of_irq.h | 9 +++++++--
> > > 1 file changed, 7 insertions(+), 2 deletions(-)
>
> Thanks Stephen!

Actually the stub needs to return an error. 0 indicates it found the interrupt.

-Saravana

2021-02-10 19:43:42

by Greg KH

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the driver-core tree

On Wed, Feb 10, 2021 at 11:17:16AM -0800, Saravana Kannan wrote:
> On Wed, Feb 10, 2021 at 11:06 AM Saravana Kannan <[email protected]> wrote:
> >
> > On Wed, Feb 10, 2021 at 10:18 AM Greg KH <[email protected]> wrote:
> > >
> > > On Wed, Feb 10, 2021 at 09:47:20PM +1100, Stephen Rothwell wrote:
> > > > Hi all,
> > > >
> > > > After merging the driver-core tree, today's linux-next build (sparc64
> > > > defconfig) failed like this:
> > > >
> > > > drivers/of/property.o: In function `parse_interrupts':
> > > > property.c:(.text+0x14e0): undefined reference to `of_irq_parse_one'
> > > >
> > > > Caused by commit
> > > >
> > > > f265f06af194 ("of: property: Fix fw_devlink handling of interrupts/interrupts-extended")
> > > >
> > > > CONFIG_OF_IRQ depends on !SPARC so of_irq_parse_one() needs a stub.
> > > > I have added the following patch for today.
> > > >
> > > > From: Stephen Rothwell <[email protected]>
> > > > Date: Wed, 10 Feb 2021 21:27:56 +1100
> > > > Subject: [PATCH] of: irq: make a stub for of_irq_parse_one()
> > > >
> > > > Signed-off-by: Stephen Rothwell <[email protected]>
> > > > ---
> > > > include/linux/of_irq.h | 9 +++++++--
> > > > 1 file changed, 7 insertions(+), 2 deletions(-)
> >
> > Thanks Stephen!
>
> Actually the stub needs to return an error. 0 indicates it found the interrupt.

Can you send a fix-up patch for this? This is now in my tree :(

thanks,

greg k-h

2021-02-10 20:18:28

by Rob Herring

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the driver-core tree

On Wed, Feb 10, 2021 at 1:17 PM Saravana Kannan <[email protected]> wrote:
>
> On Wed, Feb 10, 2021 at 11:06 AM Saravana Kannan <[email protected]> wrote:
> >
> > On Wed, Feb 10, 2021 at 10:18 AM Greg KH <[email protected]> wrote:
> > >
> > > On Wed, Feb 10, 2021 at 09:47:20PM +1100, Stephen Rothwell wrote:
> > > > Hi all,
> > > >
> > > > After merging the driver-core tree, today's linux-next build (sparc64
> > > > defconfig) failed like this:
> > > >
> > > > drivers/of/property.o: In function `parse_interrupts':
> > > > property.c:(.text+0x14e0): undefined reference to `of_irq_parse_one'
> > > >
> > > > Caused by commit
> > > >
> > > > f265f06af194 ("of: property: Fix fw_devlink handling of interrupts/interrupts-extended")
> > > >
> > > > CONFIG_OF_IRQ depends on !SPARC so of_irq_parse_one() needs a stub.

It's always Sparc!

> > > > I have added the following patch for today.
> > > >
> > > > From: Stephen Rothwell <[email protected]>
> > > > Date: Wed, 10 Feb 2021 21:27:56 +1100
> > > > Subject: [PATCH] of: irq: make a stub for of_irq_parse_one()
> > > >
> > > > Signed-off-by: Stephen Rothwell <[email protected]>
> > > > ---
> > > > include/linux/of_irq.h | 9 +++++++--
> > > > 1 file changed, 7 insertions(+), 2 deletions(-)
> >
> > Thanks Stephen!
>
> Actually the stub needs to return an error. 0 indicates it found the interrupt.

I have a slight preference if you could add an 'if
(!IS_ENABLED(CONFIG_OF_IRQ))' at the caller instead.

If you grep of_irq_parse_one, you'll see there's only a few users
which means it's on my hit list to make it private. Stub functions
give the impression 'use everywhere'.

Rob

2021-02-10 20:49:40

by Saravana Kannan

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the driver-core tree

On Wed, Feb 10, 2021 at 12:15 PM Rob Herring <[email protected]> wrote:
>
> On Wed, Feb 10, 2021 at 1:17 PM Saravana Kannan <[email protected]> wrote:
> >
> > On Wed, Feb 10, 2021 at 11:06 AM Saravana Kannan <[email protected]> wrote:
> > >
> > > On Wed, Feb 10, 2021 at 10:18 AM Greg KH <[email protected]> wrote:
> > > >
> > > > On Wed, Feb 10, 2021 at 09:47:20PM +1100, Stephen Rothwell wrote:
> > > > > Hi all,
> > > > >
> > > > > After merging the driver-core tree, today's linux-next build (sparc64
> > > > > defconfig) failed like this:
> > > > >
> > > > > drivers/of/property.o: In function `parse_interrupts':
> > > > > property.c:(.text+0x14e0): undefined reference to `of_irq_parse_one'
> > > > >
> > > > > Caused by commit
> > > > >
> > > > > f265f06af194 ("of: property: Fix fw_devlink handling of interrupts/interrupts-extended")
> > > > >
> > > > > CONFIG_OF_IRQ depends on !SPARC so of_irq_parse_one() needs a stub.
>
> It's always Sparc!
>
> > > > > I have added the following patch for today.
> > > > >
> > > > > From: Stephen Rothwell <[email protected]>
> > > > > Date: Wed, 10 Feb 2021 21:27:56 +1100
> > > > > Subject: [PATCH] of: irq: make a stub for of_irq_parse_one()
> > > > >
> > > > > Signed-off-by: Stephen Rothwell <[email protected]>
> > > > > ---
> > > > > include/linux/of_irq.h | 9 +++++++--
> > > > > 1 file changed, 7 insertions(+), 2 deletions(-)
> > >
> > > Thanks Stephen!
> >
> > Actually the stub needs to return an error. 0 indicates it found the interrupt.
>
> I have a slight preference if you could add an 'if
> (!IS_ENABLED(CONFIG_OF_IRQ))' at the caller instead.
>
> If you grep of_irq_parse_one, you'll see there's only a few users
> which means it's on my hit list to make it private. Stub functions
> give the impression 'use everywhere'.

I already sent out a fix :(

Will that check optimize out the code and not cause build errors? If
so, I can send out a patch later.

-Saravana

2021-02-10 21:01:28

by Rob Herring

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the driver-core tree

On Wed, Feb 10, 2021 at 2:44 PM Saravana Kannan <[email protected]> wrote:
>
> On Wed, Feb 10, 2021 at 12:15 PM Rob Herring <[email protected]> wrote:
> >
> > On Wed, Feb 10, 2021 at 1:17 PM Saravana Kannan <[email protected]> wrote:
> > >
> > > On Wed, Feb 10, 2021 at 11:06 AM Saravana Kannan <[email protected]> wrote:
> > > >
> > > > On Wed, Feb 10, 2021 at 10:18 AM Greg KH <[email protected]> wrote:
> > > > >
> > > > > On Wed, Feb 10, 2021 at 09:47:20PM +1100, Stephen Rothwell wrote:
> > > > > > Hi all,
> > > > > >
> > > > > > After merging the driver-core tree, today's linux-next build (sparc64
> > > > > > defconfig) failed like this:
> > > > > >
> > > > > > drivers/of/property.o: In function `parse_interrupts':
> > > > > > property.c:(.text+0x14e0): undefined reference to `of_irq_parse_one'
> > > > > >
> > > > > > Caused by commit
> > > > > >
> > > > > > f265f06af194 ("of: property: Fix fw_devlink handling of interrupts/interrupts-extended")
> > > > > >
> > > > > > CONFIG_OF_IRQ depends on !SPARC so of_irq_parse_one() needs a stub.
> >
> > It's always Sparc!
> >
> > > > > > I have added the following patch for today.
> > > > > >
> > > > > > From: Stephen Rothwell <[email protected]>
> > > > > > Date: Wed, 10 Feb 2021 21:27:56 +1100
> > > > > > Subject: [PATCH] of: irq: make a stub for of_irq_parse_one()
> > > > > >
> > > > > > Signed-off-by: Stephen Rothwell <[email protected]>
> > > > > > ---
> > > > > > include/linux/of_irq.h | 9 +++++++--
> > > > > > 1 file changed, 7 insertions(+), 2 deletions(-)
> > > >
> > > > Thanks Stephen!
> > >
> > > Actually the stub needs to return an error. 0 indicates it found the interrupt.
> >
> > I have a slight preference if you could add an 'if
> > (!IS_ENABLED(CONFIG_OF_IRQ))' at the caller instead.
> >
> > If you grep of_irq_parse_one, you'll see there's only a few users
> > which means it's on my hit list to make it private. Stub functions
> > give the impression 'use everywhere'.
>
> I already sent out a fix :(

Okay, it's fine. I misread Greg's mail.

> Will that check optimize out the code and not cause build errors? If
> so, I can send out a patch later.

Yes, it will not trigger link errors. You could still get compile
errors if say a struct member is ifdef'ed out.

Rob