2020-12-01 10:45:31

by Vinod Koul

[permalink] [raw]
Subject: Re: [PATCH 1/3] phy: ralink: phy-mt7621-pci: add include search path in Makefile

On 01-12-20, 11:16, Sergio Paracuellos wrote:
> This driver includes the following two files directly:
> - mt7621.h
> - ralink_regs.h
>
> Compilation for its related platform properly works because
> its real path is included in 'arch/mips/ralink/Platform' as
> cflags.
>
> This driver depends on RALINK but also is enabled for COMPILE_TEST
> where nothing about its platform is known and this directly
> included files are not found at all breaking compilation.
>
> Fix this problem adding include search path for ralink in
> ralink phy directory Makefile.
>
> Fixes: d87da32372a0 ("phy: ralink: Add PHY driver for MT7621 PCIe PHY")

Pls add reported-by sfr..

> Signed-off-by: Sergio Paracuellos <[email protected]>
> ---
> drivers/phy/ralink/Makefile | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/phy/ralink/Makefile b/drivers/phy/ralink/Makefile
> index cda2a4a7ca5e..c8f9adba0d82 100644
> --- a/drivers/phy/ralink/Makefile
> +++ b/drivers/phy/ralink/Makefile
> @@ -1,3 +1,6 @@
> # SPDX-License-Identifier: GPL-2.0-only
> +
> +ccflags-y += -I$(srctree)/arch/mips/include/asm/mach-ralink

Can we include <asm/mips/...> instead of using this?

> +
> obj-$(CONFIG_PHY_MT7621_PCI) += phy-mt7621-pci.o
> obj-$(CONFIG_PHY_RALINK_USB) += phy-ralink-usb.o
> --
> 2.25.1

--
~Vinod


2020-12-01 10:53:26

by Sergio Paracuellos

[permalink] [raw]
Subject: Re: [PATCH 1/3] phy: ralink: phy-mt7621-pci: add include search path in Makefile

Hi Vinod,

On Tue, Dec 1, 2020 at 11:42 AM Vinod Koul <[email protected]> wrote:
>
> On 01-12-20, 11:16, Sergio Paracuellos wrote:
> > This driver includes the following two files directly:
> > - mt7621.h
> > - ralink_regs.h
> >
> > Compilation for its related platform properly works because
> > its real path is included in 'arch/mips/ralink/Platform' as
> > cflags.
> >
> > This driver depends on RALINK but also is enabled for COMPILE_TEST
> > where nothing about its platform is known and this directly
> > included files are not found at all breaking compilation.
> >
> > Fix this problem adding include search path for ralink in
> > ralink phy directory Makefile.
> >
> > Fixes: d87da32372a0 ("phy: ralink: Add PHY driver for MT7621 PCIe PHY")
>
> Pls add reported-by sfr..

Ok, Will change this and send v2.

>
> > Signed-off-by: Sergio Paracuellos <[email protected]>
> > ---
> > drivers/phy/ralink/Makefile | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/phy/ralink/Makefile b/drivers/phy/ralink/Makefile
> > index cda2a4a7ca5e..c8f9adba0d82 100644
> > --- a/drivers/phy/ralink/Makefile
> > +++ b/drivers/phy/ralink/Makefile
> > @@ -1,3 +1,6 @@
> > # SPDX-License-Identifier: GPL-2.0-only
> > +
> > +ccflags-y += -I$(srctree)/arch/mips/include/asm/mach-ralink
>
> Can we include <asm/mips/...> instead of using this?

Doing that also fails because path for 'arch/mips/include' is not
added also because we are compiling in x86_64.
Looking into other drivers I see the way to avoid this kind of
platform specific stuff is adding related paths in
cflags. So I don't really know if there is another way.

>
> > +
> > obj-$(CONFIG_PHY_MT7621_PCI) += phy-mt7621-pci.o
> > obj-$(CONFIG_PHY_RALINK_USB) += phy-ralink-usb.o
> > --
> > 2.25.1
>
> --
> ~Vinod

Best regards,
Sergio Paracuellos

2020-12-01 22:35:39

by Vinod Koul

[permalink] [raw]
Subject: Re: [PATCH 1/3] phy: ralink: phy-mt7621-pci: add include search path in Makefile

On 01-12-20, 11:47, Sergio Paracuellos wrote:
> Hi Vinod,
>
> On Tue, Dec 1, 2020 at 11:42 AM Vinod Koul <[email protected]> wrote:
> >
> > On 01-12-20, 11:16, Sergio Paracuellos wrote:
> > > This driver includes the following two files directly:
> > > - mt7621.h
> > > - ralink_regs.h
> > >
> > > Compilation for its related platform properly works because
> > > its real path is included in 'arch/mips/ralink/Platform' as
> > > cflags.
> > >
> > > This driver depends on RALINK but also is enabled for COMPILE_TEST
> > > where nothing about its platform is known and this directly
> > > included files are not found at all breaking compilation.
> > >
> > > Fix this problem adding include search path for ralink in
> > > ralink phy directory Makefile.
> > >
> > > Fixes: d87da32372a0 ("phy: ralink: Add PHY driver for MT7621 PCIe PHY")
> >
> > Pls add reported-by sfr..
>
> Ok, Will change this and send v2.
>
> >
> > > Signed-off-by: Sergio Paracuellos <[email protected]>
> > > ---
> > > drivers/phy/ralink/Makefile | 3 +++
> > > 1 file changed, 3 insertions(+)
> > >
> > > diff --git a/drivers/phy/ralink/Makefile b/drivers/phy/ralink/Makefile
> > > index cda2a4a7ca5e..c8f9adba0d82 100644
> > > --- a/drivers/phy/ralink/Makefile
> > > +++ b/drivers/phy/ralink/Makefile
> > > @@ -1,3 +1,6 @@
> > > # SPDX-License-Identifier: GPL-2.0-only
> > > +
> > > +ccflags-y += -I$(srctree)/arch/mips/include/asm/mach-ralink
> >
> > Can we include <asm/mips/...> instead of using this?
>
> Doing that also fails because path for 'arch/mips/include' is not
> added also because we are compiling in x86_64.
> Looking into other drivers I see the way to avoid this kind of
> platform specific stuff is adding related paths in
> cflags. So I don't really know if there is another way.

Right, ideally these headers should have been in include/linux, but.. I
dont like this way, can we drop compile test..?

--
~Vinod