2019-10-11 16:38:56

by zhong jiang

[permalink] [raw]
Subject: [PATCH RESEND v2] staging: wfx: fix an undefined reference error when CONFIG_MMC=m

I hit the following error when compile the kernel.

drivers/staging/wfx/main.o: In function `wfx_core_init':
/home/z00352263/linux-next/linux-next/drivers/staging/wfx/main.c:488: undefined reference to `sdio_register_driver'
drivers/staging/wfx/main.o: In function `wfx_core_exit':
/home/z00352263/linux-next/linux-next/drivers/staging/wfx/main.c:496: undefined reference to `sdio_unregister_driver'
drivers/staging/wfx/main.o:(.debug_addr+0x1a8): undefined reference to `sdio_register_driver'
drivers/staging/wfx/main.o:(.debug_addr+0x6f0): undefined reference to `sdio_unregister_driver'

Signed-off-by: zhong jiang <[email protected]>
---
drivers/staging/wfx/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wfx/Makefile b/drivers/staging/wfx/Makefile
index 0d9c1ed..77d68b7 100644
--- a/drivers/staging/wfx/Makefile
+++ b/drivers/staging/wfx/Makefile
@@ -19,6 +19,6 @@ wfx-y := \
sta.o \
debug.o
wfx-$(CONFIG_SPI) += bus_spi.o
-wfx-$(subst m,y,$(CONFIG_MMC)) += bus_sdio.o
+wfx-$(CONFIG_MMC) += bus_sdio.o

obj-$(CONFIG_WFX) += wfx.o
--
1.7.12.4


2019-10-11 16:59:31

by Jérôme Pouiller

[permalink] [raw]
Subject: Re: [PATCH RESEND v2] staging: wfx: fix an undefined reference error when CONFIG_MMC=m

On Friday 11 October 2019 18:38:17 CEST zhong jiang wrote:
> I hit the following error when compile the kernel.
>
> drivers/staging/wfx/main.o: In function `wfx_core_init':
> /home/z00352263/linux-next/linux-next/drivers/staging/wfx/main.c:488: undefined reference to `sdio_register_driver'
> drivers/staging/wfx/main.o: In function `wfx_core_exit':
> /home/z00352263/linux-next/linux-next/drivers/staging/wfx/main.c:496: undefined reference to `sdio_unregister_driver'
> drivers/staging/wfx/main.o:(.debug_addr+0x1a8): undefined reference to `sdio_register_driver'
> drivers/staging/wfx/main.o:(.debug_addr+0x6f0): undefined reference to `sdio_unregister_driver'

For information, I cannot reproduce your issue (it does not mean that
the issue does not exist). In add, if you obtain undefined references,
it should only happen when CONFIG_MMC is not defined.

Can you check that your Modules.symvers is up-to-date (by running a
'make modules') ?


--
J?r?me Pouiller

2019-10-11 17:04:07

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH RESEND v2] staging: wfx: fix an undefined reference error when CONFIG_MMC=m

On Sat, Oct 12, 2019 at 12:34:07AM +0800, zhong jiang wrote:
> I hit the following error when compile the kernel.
>
> drivers/staging/wfx/main.o: In function `wfx_core_init':
> /home/z00352263/linux-next/linux-next/drivers/staging/wfx/main.c:488: undefined reference to `sdio_register_driver'
> drivers/staging/wfx/main.o: In function `wfx_core_exit':
> /home/z00352263/linux-next/linux-next/drivers/staging/wfx/main.c:496: undefined reference to `sdio_unregister_driver'
> drivers/staging/wfx/main.o:(.debug_addr+0x1a8): undefined reference to `sdio_register_driver'
> drivers/staging/wfx/main.o:(.debug_addr+0x6f0): undefined reference to `sdio_unregister_driver'
>
> Signed-off-by: zhong jiang <[email protected]>
> ---
> drivers/staging/wfx/Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

What changed from v1? Always put that below the --- line.

v3 please?

thanks,

greg k-h

2019-10-12 02:50:18

by zhong jiang

[permalink] [raw]
Subject: Re: [PATCH RESEND v2] staging: wfx: fix an undefined reference error when CONFIG_MMC=m

On 2019/10/12 0:57, Jerome Pouiller wrote:
> On Friday 11 October 2019 18:38:17 CEST zhong jiang wrote:
>> I hit the following error when compile the kernel.
>>
>> drivers/staging/wfx/main.o: In function `wfx_core_init':
>> /home/z00352263/linux-next/linux-next/drivers/staging/wfx/main.c:488: undefined reference to `sdio_register_driver'
>> drivers/staging/wfx/main.o: In function `wfx_core_exit':
>> /home/z00352263/linux-next/linux-next/drivers/staging/wfx/main.c:496: undefined reference to `sdio_unregister_driver'
>> drivers/staging/wfx/main.o:(.debug_addr+0x1a8): undefined reference to `sdio_register_driver'
>> drivers/staging/wfx/main.o:(.debug_addr+0x6f0): undefined reference to `sdio_unregister_driver'
> For information, I cannot reproduce your issue (it does not mean that
> the issue does not exist). In add, if you obtain undefined references,
> it should only happen when CONFIG_MMC is not defined.
I attach the config, you can test it and reproduce the issue.

Thanks,
zhogn jiang
> Can you check that your Modules.symvers is up-to-date (by running a
> 'make modules') ?
>
>


Attachments:
config.txt (137.60 kB)

2019-10-12 02:52:20

by zhong jiang

[permalink] [raw]
Subject: Re: [PATCH RESEND v2] staging: wfx: fix an undefined reference error when CONFIG_MMC=m

On 2019/10/12 1:03, Greg KH wrote:
> On Sat, Oct 12, 2019 at 12:34:07AM +0800, zhong jiang wrote:
>> I hit the following error when compile the kernel.
>>
>> drivers/staging/wfx/main.o: In function `wfx_core_init':
>> /home/z00352263/linux-next/linux-next/drivers/staging/wfx/main.c:488: undefined reference to `sdio_register_driver'
>> drivers/staging/wfx/main.o: In function `wfx_core_exit':
>> /home/z00352263/linux-next/linux-next/drivers/staging/wfx/main.c:496: undefined reference to `sdio_unregister_driver'
>> drivers/staging/wfx/main.o:(.debug_addr+0x1a8): undefined reference to `sdio_register_driver'
>> drivers/staging/wfx/main.o:(.debug_addr+0x6f0): undefined reference to `sdio_unregister_driver'
>>
>> Signed-off-by: zhong jiang <[email protected]>
>> ---
>> drivers/staging/wfx/Makefile | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
> What changed from v1? Always put that below the --- line.
>
> v3 please?
Fine, I will repost in v3. Thanks,

Sincerely,
zhong jiang
> thanks,
>
> greg k-h
>
> .
>


2019-10-14 09:54:41

by Jérôme Pouiller

[permalink] [raw]
Subject: Re: [PATCH RESEND v2] staging: wfx: fix an undefined reference error when CONFIG_MMC=m

On Saturday 12 October 2019 04:48:55 CEST zhong jiang wrote:
> On 2019/10/12 0:57, Jerome Pouiller wrote:
> > On Friday 11 October 2019 18:38:17 CEST zhong jiang wrote:
> >> I hit the following error when compile the kernel.
> >>
> >> drivers/staging/wfx/main.o: In function `wfx_core_init':
> >> /home/z00352263/linux-next/linux-next/drivers/staging/wfx/main.c:488: undefined reference to `sdio_register_driver'
> >> drivers/staging/wfx/main.o: In function `wfx_core_exit':
> >> /home/z00352263/linux-next/linux-next/drivers/staging/wfx/main.c:496: undefined reference to `sdio_unregister_driver'
> >> drivers/staging/wfx/main.o:(.debug_addr+0x1a8): undefined reference to `sdio_register_driver'
> >> drivers/staging/wfx/main.o:(.debug_addr+0x6f0): undefined reference to `sdio_unregister_driver'
> > For information, I cannot reproduce your issue (it does not mean that
> > the issue does not exist). In add, if you obtain undefined references,
> > it should only happen when CONFIG_MMC is not defined.
> I attach the config, you can test it and reproduce the issue.
>
> Thanks,
> zhogn jiang
> > Can you check that your Modules.symvers is up-to-date (by running a
> > 'make modules') ?
Hello Zhong,

Now, I see the problem. It happens when CONFIG_MMC=m and CONFIG_WFX=y
(if CONFIG_WFX=m, it works).

I think the easiest way to solve problem is to disallow CONFIG_WFX=y if
CONFIG_MMC=m.

This solution impacts users who want to use SPI bus with configuration:
CONFIG_WFX=y + CONFIG_SPI=y + CONFIG_MMC=m. However, I think this is a
twisted case. So, I think it won't be missed.

I think that patch below do the right thing:

-----8<----------8<----------------------8<-----------------

diff --git i/drivers/staging/wfx/Kconfig w/drivers/staging/wfx/Kconfig
index 9b8a1c7a9e90..833f3b05b6b4 100644
--- i/drivers/staging/wfx/Kconfig
+++ w/drivers/staging/wfx/Kconfig
@@ -1,7 +1,7 @@
config WFX
tristate "Silicon Labs wireless chips WF200 and further"
depends on MAC80211
- depends on (SPI || MMC)
+ depends on (MMC=m && m) || MMC=y || (SPI && MMC!=m)
help
This is a driver for Silicons Labs WFxxx series (WF200 and further)
chipsets. This chip can be found on SPI or SDIO buses.


--
J?r?me Pouiller

2019-10-14 10:09:47

by Jérôme Pouiller

[permalink] [raw]
Subject: Re: [PATCH RESEND v2] staging: wfx: fix an undefined reference error when CONFIG_MMC=m

On Monday 14 October 2019 11:53:19 CEST J?r?me Pouiller wrote:
[...]
> Hello Zhong,
>
> Now, I see the problem. It happens when CONFIG_MMC=m and CONFIG_WFX=y
> (if CONFIG_WFX=m, it works).
>
> I think the easiest way to solve problem is to disallow CONFIG_WFX=y if
> CONFIG_MMC=m.
>
> This solution impacts users who want to use SPI bus with configuration:
> CONFIG_WFX=y + CONFIG_SPI=y + CONFIG_MMC=m. However, I think this is a
> twisted case. So, I think it won't be missed.
>
> I think that patch below do the right thing:
>
> -----8<----------8<----------------------8<-----------------
>
> diff --git i/drivers/staging/wfx/Kconfig w/drivers/staging/wfx/Kconfig
> index 9b8a1c7a9e90..833f3b05b6b4 100644
> --- i/drivers/staging/wfx/Kconfig
> +++ w/drivers/staging/wfx/Kconfig
> @@ -1,7 +1,7 @@
> config WFX
> tristate "Silicon Labs wireless chips WF200 and further"
> depends on MAC80211
> - depends on (SPI || MMC)
> + depends on (MMC=m && m) || MMC=y || (SPI && MMC!=m)
> help
> This is a driver for Silicons Labs WFxxx series (WF200 and further)
> chipsets. This chip can be found on SPI or SDIO buses.
>
>
>

An alternative (more understandable?):

diff --git i/drivers/staging/wfx/Kconfig w/drivers/staging/wfx/Kconfig
index 9b8a1c7a9e90..83ee4d0ca8c6 100644
--- i/drivers/staging/wfx/Kconfig
+++ w/drivers/staging/wfx/Kconfig
@@ -1,6 +1,7 @@
config WFX
tristate "Silicon Labs wireless chips WF200 and further"
depends on MAC80211
+ depends on MMC || !MMC # do not allow WFX=y if MMC=m
depends on (SPI || MMC)
help
This is a driver for Silicons Labs WFxxx series (WF200 and further)


--
J?r?me Pouiller

2019-10-14 11:20:39

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH RESEND v2] staging: wfx: fix an undefined reference error when CONFIG_MMC=m

On Mon, Oct 14, 2019 at 10:06:25AM +0000, Jerome Pouiller wrote:
> On Monday 14 October 2019 11:53:19 CEST J?r?me Pouiller wrote:
> [...]
> > Hello Zhong,
> >
> > Now, I see the problem. It happens when CONFIG_MMC=m and CONFIG_WFX=y
> > (if CONFIG_WFX=m, it works).
> >
> > I think the easiest way to solve problem is to disallow CONFIG_WFX=y if
> > CONFIG_MMC=m.
> >
> > This solution impacts users who want to use SPI bus with configuration:
> > CONFIG_WFX=y + CONFIG_SPI=y + CONFIG_MMC=m. However, I think this is a
> > twisted case. So, I think it won't be missed.
> >
> > I think that patch below do the right thing:
> >
> > -----8<----------8<----------------------8<-----------------
> >
> > diff --git i/drivers/staging/wfx/Kconfig w/drivers/staging/wfx/Kconfig
> > index 9b8a1c7a9e90..833f3b05b6b4 100644
> > --- i/drivers/staging/wfx/Kconfig
> > +++ w/drivers/staging/wfx/Kconfig
> > @@ -1,7 +1,7 @@
> > config WFX
> > tristate "Silicon Labs wireless chips WF200 and further"
> > depends on MAC80211
> > - depends on (SPI || MMC)
> > + depends on (MMC=m && m) || MMC=y || (SPI && MMC!=m)
> > help
> > This is a driver for Silicons Labs WFxxx series (WF200 and further)
> > chipsets. This chip can be found on SPI or SDIO buses.
> >
> >
> >
>
> An alternative (more understandable?):
>
> diff --git i/drivers/staging/wfx/Kconfig w/drivers/staging/wfx/Kconfig
> index 9b8a1c7a9e90..83ee4d0ca8c6 100644
> --- i/drivers/staging/wfx/Kconfig
> +++ w/drivers/staging/wfx/Kconfig
> @@ -1,6 +1,7 @@
> config WFX
> tristate "Silicon Labs wireless chips WF200 and further"
> depends on MAC80211
> + depends on MMC || !MMC # do not allow WFX=y if MMC=m
> depends on (SPI || MMC)
> help
> This is a driver for Silicons Labs WFxxx series (WF200 and further)

Yes, this is much easier to understand.

thanks,

greg k-h

2019-10-14 16:17:20

by zhong jiang

[permalink] [raw]
Subject: Re: [PATCH RESEND v2] staging: wfx: fix an undefined reference error when CONFIG_MMC=m

On 2019/10/14 18:06, Jerome Pouiller wrote:
> On Monday 14 October 2019 11:53:19 CEST J?r?me Pouiller wrote:
> [...]
>> Hello Zhong,
>>
>> Now, I see the problem. It happens when CONFIG_MMC=m and CONFIG_WFX=y
>> (if CONFIG_WFX=m, it works).
>>
>> I think the easiest way to solve problem is to disallow CONFIG_WFX=y if
>> CONFIG_MMC=m.
>>
>> This solution impacts users who want to use SPI bus with configuration:
>> CONFIG_WFX=y + CONFIG_SPI=y + CONFIG_MMC=m. However, I think this is a
>> twisted case. So, I think it won't be missed.
>>
>> I think that patch below do the right thing:
>>
>> -----8<----------8<----------------------8<-----------------
>>
>> diff --git i/drivers/staging/wfx/Kconfig w/drivers/staging/wfx/Kconfig
>> index 9b8a1c7a9e90..833f3b05b6b4 100644
>> --- i/drivers/staging/wfx/Kconfig
>> +++ w/drivers/staging/wfx/Kconfig
>> @@ -1,7 +1,7 @@
>> config WFX
>> tristate "Silicon Labs wireless chips WF200 and further"
>> depends on MAC80211
>> - depends on (SPI || MMC)
>> + depends on (MMC=m && m) || MMC=y || (SPI && MMC!=m)
>> help
>> This is a driver for Silicons Labs WFxxx series (WF200 and further)
>> chipsets. This chip can be found on SPI or SDIO buses.
>>
>>
>>
> An alternative (more understandable?):
>
> diff --git i/drivers/staging/wfx/Kconfig w/drivers/staging/wfx/Kconfig
> index 9b8a1c7a9e90..83ee4d0ca8c6 100644
> --- i/drivers/staging/wfx/Kconfig
> +++ w/drivers/staging/wfx/Kconfig
> @@ -1,6 +1,7 @@
> config WFX
> tristate "Silicon Labs wireless chips WF200 and further"
> depends on MAC80211
> + depends on MMC || !MMC # do not allow WFX=y if MMC=m
> depends on (SPI || MMC)
> help
> This is a driver for Silicons Labs WFxxx series (WF200 and further)
>
>
It's better and clear. Thanks

sincerely,
zhong jiang

2019-10-18 06:08:49

by zhong jiang

[permalink] [raw]
Subject: Re: [PATCH RESEND v2] staging: wfx: fix an undefined reference error when CONFIG_MMC=m

On 2019/10/14 18:06, Jerome Pouiller wrote:
> On Monday 14 October 2019 11:53:19 CEST J?r?me Pouiller wrote:
> [...]
>> Hello Zhong,
>>
>> Now, I see the problem. It happens when CONFIG_MMC=m and CONFIG_WFX=y
>> (if CONFIG_WFX=m, it works).
>>
>> I think the easiest way to solve problem is to disallow CONFIG_WFX=y if
>> CONFIG_MMC=m.
>>
>> This solution impacts users who want to use SPI bus with configuration:
>> CONFIG_WFX=y + CONFIG_SPI=y + CONFIG_MMC=m. However, I think this is a
>> twisted case. So, I think it won't be missed.
>>
>> I think that patch below do the right thing:
>>
>> -----8<----------8<----------------------8<-----------------
>>
>> diff --git i/drivers/staging/wfx/Kconfig w/drivers/staging/wfx/Kconfig
>> index 9b8a1c7a9e90..833f3b05b6b4 100644
>> --- i/drivers/staging/wfx/Kconfig
>> +++ w/drivers/staging/wfx/Kconfig
>> @@ -1,7 +1,7 @@
>> config WFX
>> tristate "Silicon Labs wireless chips WF200 and further"
>> depends on MAC80211
>> - depends on (SPI || MMC)
>> + depends on (MMC=m && m) || MMC=y || (SPI && MMC!=m)
>> help
>> This is a driver for Silicons Labs WFxxx series (WF200 and further)
>> chipsets. This chip can be found on SPI or SDIO buses.
>>
>>
>>
> An alternative (more understandable?):
>
> diff --git i/drivers/staging/wfx/Kconfig w/drivers/staging/wfx/Kconfig
> index 9b8a1c7a9e90..83ee4d0ca8c6 100644
> --- i/drivers/staging/wfx/Kconfig
> +++ w/drivers/staging/wfx/Kconfig
> @@ -1,6 +1,7 @@
> config WFX
> tristate "Silicon Labs wireless chips WF200 and further"
> depends on MAC80211
> + depends on MMC || !MMC # do not allow WFX=y if MMC=m
> depends on (SPI || MMC)
> help
> This is a driver for Silicons Labs WFxxx series (WF200 and further)
>
>
Hi, Jerome

It's better to understandable.
Could you send the patch or want to repost by me?

Thanks,
zhong jiang