All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mt76: fix building without CONFIG_MT76x0U
@ 2018-09-26 12:51 Arnd Bergmann
  2018-09-26 14:06 ` Stanislaw Gruszka
  2018-09-27 15:22 ` kbuild test robot
  0 siblings, 2 replies; 6+ messages in thread
From: Arnd Bergmann @ 2018-09-26 12:51 UTC (permalink / raw)
  To: Kalle Valo, Stanislaw Gruszka, Felix Fietkau, Lorenzo Bianconi
  Cc: Arnd Bergmann, David S. Miller, linux-wireless, netdev, linux-kernel

The recent rework of the mt76 driver caused build failures in
configurations that leave the mt76x0u support disabled:

ERROR: "mt76u_mcu_deinit" [drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0-common.ko] undefined!
ERROR: "mt76x02u_set_txinfo" [drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0-common.ko] undefined!
ERROR: "mt76u_queues_deinit" [drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0-common.ko] undefined!
ERROR: "mt76u_stop_stat_wk" [drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0-common.ko] undefined!

The mt76x0_push_txwi()/mt76x0_tx_prepare_skb()/mt76x0_cleanup() functions
that cause some of these are only called from the usb portion, and can
be hidden in an #ifdef in this case.

mt76u_stop_stat_wk() is called mt76x0_mac_stop(), which is in turn
shared between multiple callers. Calling it only when the USB driver
is enabled avoids the link error but it is not clear to me whether this
can be called from a context where it would not do the right thing.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/net/wireless/mediatek/mt76/mt76x0/init.c | 5 ++++-
 drivers/net/wireless/mediatek/mt76/mt76x0/tx.c   | 4 ++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/init.c b/drivers/net/wireless/mediatek/mt76/mt76x0/init.c
index 3a88be267daf..9d0f0e1bf07a 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x0/init.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x0/init.c
@@ -377,7 +377,8 @@ void mt76x0_mac_stop(struct mt76x0_dev *dev)
 {
 	cancel_delayed_work_sync(&dev->cal_work);
 	cancel_delayed_work_sync(&dev->mac_work);
-	mt76u_stop_stat_wk(&dev->mt76);
+	if (IS_ENABLED(CONFIG_MT76x0U))
+		mt76u_stop_stat_wk(&dev->mt76);
 	mt76x0_mac_stop_hw(dev);
 }
 EXPORT_SYMBOL_GPL(mt76x0_mac_stop);
@@ -457,6 +458,7 @@ int mt76x0_init_hardware(struct mt76x0_dev *dev)
 }
 EXPORT_SYMBOL_GPL(mt76x0_init_hardware);
 
+#ifdef CONFIG_MT76x0U
 void mt76x0_cleanup(struct mt76x0_dev *dev)
 {
 	clear_bit(MT76_STATE_INITIALIZED, &dev->mt76.state);
@@ -465,6 +467,7 @@ void mt76x0_cleanup(struct mt76x0_dev *dev)
 	mt76u_mcu_deinit(&dev->mt76);
 }
 EXPORT_SYMBOL_GPL(mt76x0_cleanup);
+#endif
 
 struct mt76x0_dev *
 mt76x0_alloc_device(struct device *pdev, const struct mt76_driver_ops *drv_ops)
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/tx.c b/drivers/net/wireless/mediatek/mt76/mt76x0/tx.c
index c6d8ba01feb1..2d3c20e82ce1 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x0/tx.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x0/tx.c
@@ -17,6 +17,7 @@
 #include "../mt76x02_util.h"
 #include "../mt76x02_usb.h"
 
+#ifdef CONFIG_MT76x0U
 static struct mt76x02_txwi *
 mt76x0_push_txwi(struct mt76x0_dev *dev, struct sk_buff *skb,
 		  struct ieee80211_sta *sta, struct mt76_wcid *wcid,
@@ -53,6 +54,7 @@ mt76x0_push_txwi(struct mt76x0_dev *dev, struct sk_buff *skb,
 
 	return txwi;
 }
+#endif
 
 void mt76x0_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control,
 	       struct sk_buff *skb)
@@ -82,6 +84,7 @@ void mt76x0_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control,
 	mt76_tx(&dev->mt76, control->sta, wcid, skb);
 }
 
+#ifdef CONFIG_MT76x0U
 int mt76x0_tx_prepare_skb(struct mt76_dev *mdev, void *data,
 			  struct sk_buff *skb, struct mt76_queue *q,
 			  struct mt76_wcid *wcid, struct ieee80211_sta *sta,
@@ -97,6 +100,7 @@ int mt76x0_tx_prepare_skb(struct mt76_dev *mdev, void *data,
 	return mt76x02u_set_txinfo(skb, wcid, q2ep(q->hw_idx));
 }
 EXPORT_SYMBOL_GPL(mt76x0_tx_prepare_skb);
+#endif
 
 void mt76x0_queue_rx_skb(struct mt76_dev *mdev, enum mt76_rxq_id q,
 			 struct sk_buff *skb)
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] mt76: fix building without CONFIG_MT76x0U
  2018-09-26 12:51 [PATCH] mt76: fix building without CONFIG_MT76x0U Arnd Bergmann
@ 2018-09-26 14:06 ` Stanislaw Gruszka
  2018-09-26 15:43   ` Arnd Bergmann
  2018-09-26 15:48     ` Lorenzo Bianconi
  2018-09-27 15:22 ` kbuild test robot
  1 sibling, 2 replies; 6+ messages in thread
From: Stanislaw Gruszka @ 2018-09-26 14:06 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Kalle Valo, Felix Fietkau, Lorenzo Bianconi, David S. Miller,
	linux-wireless, netdev, linux-kernel

On Wed, Sep 26, 2018 at 02:51:59PM +0200, Arnd Bergmann wrote:
> The recent rework of the mt76 driver caused build failures in
> configurations that leave the mt76x0u support disabled:
> 
> ERROR: "mt76u_mcu_deinit" [drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0-common.ko] undefined!
> ERROR: "mt76x02u_set_txinfo" [drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0-common.ko] undefined!
> ERROR: "mt76u_queues_deinit" [drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0-common.ko] undefined!
> ERROR: "mt76u_stop_stat_wk" [drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0-common.ko] undefined!
> 
> The mt76x0_push_txwi()/mt76x0_tx_prepare_skb()/mt76x0_cleanup() functions
> that cause some of these are only called from the usb portion, and can
> be hidden in an #ifdef in this case.
> 
> mt76u_stop_stat_wk() is called mt76x0_mac_stop(), which is in turn
> shared between multiple callers. Calling it only when the USB driver
> is enabled avoids the link error but it is not clear to me whether this
> can be called from a context where it would not do the right thing.

I think there not yet posted Lorenzo patches that fix this build
problem.

Regards
Stanislaw


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mt76: fix building without CONFIG_MT76x0U
  2018-09-26 14:06 ` Stanislaw Gruszka
@ 2018-09-26 15:43   ` Arnd Bergmann
  2018-09-26 15:48     ` Lorenzo Bianconi
  1 sibling, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2018-09-26 15:43 UTC (permalink / raw)
  To: Stanislaw Gruszka
  Cc: Kalle Valo, Felix Fietkau, Lorenzo Bianconi, David Miller,
	linux-wireless, Networking, Linux Kernel Mailing List

On Wed, Sep 26, 2018 at 4:06 PM Stanislaw Gruszka <sgruszka@redhat.com> wrote:
>
> On Wed, Sep 26, 2018 at 02:51:59PM +0200, Arnd Bergmann wrote:
> > The recent rework of the mt76 driver caused build failures in
> > configurations that leave the mt76x0u support disabled:
> >
> > ERROR: "mt76u_mcu_deinit" [drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0-common.ko] undefined!
> > ERROR: "mt76x02u_set_txinfo" [drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0-common.ko] undefined!
> > ERROR: "mt76u_queues_deinit" [drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0-common.ko] undefined!
> > ERROR: "mt76u_stop_stat_wk" [drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0-common.ko] undefined!
> >
> > The mt76x0_push_txwi()/mt76x0_tx_prepare_skb()/mt76x0_cleanup() functions
> > that cause some of these are only called from the usb portion, and can
> > be hidden in an #ifdef in this case.
> >
> > mt76u_stop_stat_wk() is called mt76x0_mac_stop(), which is in turn
> > shared between multiple callers. Calling it only when the USB driver
> > is enabled avoids the link error but it is not clear to me whether this
> > can be called from a context where it would not do the right thing.
>
> I think there not yet posted Lorenzo patches that fix this build
> problem.

Ok, good. I assume that is a better fix than mine then. I also noticed
another problem that my patch does not address, but won't send a follow
up patch for that.

Please just ignore this version.

        Arnd

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mt76: fix building without CONFIG_MT76x0U
@ 2018-09-26 15:48     ` Lorenzo Bianconi
  0 siblings, 0 replies; 6+ messages in thread
From: Lorenzo Bianconi @ 2018-09-26 15:48 UTC (permalink / raw)
  To: Stanislaw Gruszka
  Cc: Arnd Bergmann, Kalle Valo, Felix Fietkau, David S. Miller,
	linux-wireless, netdev, linux-kernel

> On Wed, Sep 26, 2018 at 02:51:59PM +0200, Arnd Bergmann wrote:
> > The recent rework of the mt76 driver caused build failures in
> > configurations that leave the mt76x0u support disabled:
> > 
> > ERROR: "mt76u_mcu_deinit" [drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0-common.ko] undefined!
> > ERROR: "mt76x02u_set_txinfo" [drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0-common.ko] undefined!
> > ERROR: "mt76u_queues_deinit" [drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0-common.ko] undefined!
> > ERROR: "mt76u_stop_stat_wk" [drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0-common.ko] undefined!
> > 
> 
> I think there not yet posted Lorenzo patches that fix this build
> problem.

Hi Arnd,

adding mt76x0e hw initialization I have already fixed
mt76u_mcu_deinit, mt76u_queues_deinit and mt76u_stop_stat_wk
(I have not posted the patchset yet, I will send it later today
or tomorrow). mt76x02u_set_txinfo needs to be fixed since
I have not worked on mt76x0e tx path yet, but it is on my
ToDo list.

Regards,
Lorenzo

> 
> Regards
> Stanislaw
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mt76: fix building without CONFIG_MT76x0U
@ 2018-09-26 15:48     ` Lorenzo Bianconi
  0 siblings, 0 replies; 6+ messages in thread
From: Lorenzo Bianconi @ 2018-09-26 15:48 UTC (permalink / raw)
  To: Stanislaw Gruszka
  Cc: Arnd Bergmann, Kalle Valo, Felix Fietkau, David S. Miller,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

> On Wed, Sep 26, 2018 at 02:51:59PM +0200, Arnd Bergmann wrote:
> > The recent rework of the mt76 driver caused build failures in
> > configurations that leave the mt76x0u support disabled:
> > 
> > ERROR: "mt76u_mcu_deinit" [drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0-common.ko] undefined!
> > ERROR: "mt76x02u_set_txinfo" [drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0-common.ko] undefined!
> > ERROR: "mt76u_queues_deinit" [drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0-common.ko] undefined!
> > ERROR: "mt76u_stop_stat_wk" [drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0-common.ko] undefined!
> > 
> 
> I think there not yet posted Lorenzo patches that fix this build
> problem.

Hi Arnd,

adding mt76x0e hw initialization I have already fixed
mt76u_mcu_deinit, mt76u_queues_deinit and mt76u_stop_stat_wk
(I have not posted the patchset yet, I will send it later today
or tomorrow). mt76x02u_set_txinfo needs to be fixed since
I have not worked on mt76x0e tx path yet, but it is on my
ToDo list.

Regards,
Lorenzo

> 
> Regards
> Stanislaw
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mt76: fix building without CONFIG_MT76x0U
  2018-09-26 12:51 [PATCH] mt76: fix building without CONFIG_MT76x0U Arnd Bergmann
  2018-09-26 14:06 ` Stanislaw Gruszka
@ 2018-09-27 15:22 ` kbuild test robot
  1 sibling, 0 replies; 6+ messages in thread
From: kbuild test robot @ 2018-09-27 15:22 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: kbuild-all, Kalle Valo, Stanislaw Gruszka, Felix Fietkau,
	Lorenzo Bianconi, Arnd Bergmann, David S. Miller, linux-wireless,
	netdev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1068 bytes --]

Hi Arnd,

I love your patch! Yet something to improve:

[auto build test ERROR on wireless-drivers-next/master]
[also build test ERROR on next-20180926]
[cannot apply to v4.19-rc5]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Arnd-Bergmann/mt76-fix-building-without-CONFIG_MT76x0U/20180927-101346
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git master
config: i386-allmodconfig (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

>> ERROR: "mt76x0_tx_prepare_skb" [drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0u.ko] undefined!
>> ERROR: "mt76x0_cleanup" [drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0u.ko] undefined!

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 65149 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-09-27 15:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-26 12:51 [PATCH] mt76: fix building without CONFIG_MT76x0U Arnd Bergmann
2018-09-26 14:06 ` Stanislaw Gruszka
2018-09-26 15:43   ` Arnd Bergmann
2018-09-26 15:48   ` Lorenzo Bianconi
2018-09-26 15:48     ` Lorenzo Bianconi
2018-09-27 15:22 ` kbuild test robot

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.