* [PATCH v3] rt2x00: avoid introducing a USB dependency in the
@ 2017-01-31 11:44 Stanislaw Gruszka
2017-02-01 16:33 ` Felix Fietkau
0 siblings, 1 reply; 3+ messages in thread
From: Stanislaw Gruszka @ 2017-01-31 11:44 UTC (permalink / raw)
To: linux-wireless; +Cc: Helmut Schaa, Felix Fietkau, Vishal Thanki
As reported by Felix:
Though protected by an ifdef, introducing an usb symbol dependency in
the rt2x00lib module is a major inconvenience for distributions that
package kernel modules split into individual packages.
Get rid of this unnecessary dependency by calling the usb related
function from a more suitable place.
Cc: Vishal Thanki <vishalthanki@gmail.com>
Reported-by: Felix Fietkau <nbd@nbd.name>
Fixes: 8b4c0009313f ("rt2x00usb: Use usb anchor to manage URB")
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
v1 -> v2 do not break shutdown sequence
v2 -> v3 update patch to current kernel version
drivers/net/wireless/ralink/rt2x00/rt2x00dev.c | 23 ++++++++---------------
drivers/net/wireless/ralink/rt2x00/rt2x00usb.c | 5 +++++
2 files changed, 13 insertions(+), 15 deletions(-)
diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
index 8fcbc8d..4b08007 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
@@ -1436,21 +1436,6 @@ void rt2x00lib_remove_dev(struct rt2x00_dev *rt2x00dev)
cancel_work_sync(&rt2x00dev->intf_work);
cancel_delayed_work_sync(&rt2x00dev->autowakeup_work);
cancel_work_sync(&rt2x00dev->sleep_work);
-#if IS_ENABLED(CONFIG_RT2X00_LIB_USB)
- if (rt2x00_is_usb(rt2x00dev)) {
- usb_kill_anchored_urbs(rt2x00dev->anchor);
- hrtimer_cancel(&rt2x00dev->txstatus_timer);
- cancel_work_sync(&rt2x00dev->rxdone_work);
- cancel_work_sync(&rt2x00dev->txdone_work);
- }
-#endif
- if (rt2x00dev->workqueue)
- destroy_workqueue(rt2x00dev->workqueue);
-
- /*
- * Free the tx status fifo.
- */
- kfifo_free(&rt2x00dev->txstatus_fifo);
/*
* Kill the tx status tasklet.
@@ -1466,6 +1451,14 @@ void rt2x00lib_remove_dev(struct rt2x00_dev *rt2x00dev)
*/
rt2x00lib_uninitialize(rt2x00dev);
+ if (rt2x00dev->workqueue)
+ destroy_workqueue(rt2x00dev->workqueue);
+
+ /*
+ * Free the tx status fifo.
+ */
+ kfifo_free(&rt2x00dev->txstatus_fifo);
+
/*
* Free extra components
*/
diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c b/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c
index 838ca58..5a2bf9f 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c
@@ -744,6 +744,11 @@ void rt2x00usb_uninitialize(struct rt2x00_dev *rt2x00dev)
{
struct data_queue *queue;
+ usb_kill_anchored_urbs(rt2x00dev->anchor);
+ hrtimer_cancel(&rt2x00dev->txstatus_timer);
+ cancel_work_sync(&rt2x00dev->rxdone_work);
+ cancel_work_sync(&rt2x00dev->txdone_work);
+
queue_for_each(rt2x00dev, queue)
rt2x00usb_free_entries(queue);
}
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v3] rt2x00: avoid introducing a USB dependency in the
2017-01-31 11:44 [PATCH v3] rt2x00: avoid introducing a USB dependency in the Stanislaw Gruszka
@ 2017-02-01 16:33 ` Felix Fietkau
2017-02-02 9:56 ` Stanislaw Gruszka
0 siblings, 1 reply; 3+ messages in thread
From: Felix Fietkau @ 2017-02-01 16:33 UTC (permalink / raw)
To: Stanislaw Gruszka, linux-wireless; +Cc: Helmut Schaa, Vishal Thanki
On 2017-01-31 12:44, Stanislaw Gruszka wrote:
> As reported by Felix:
>
> Though protected by an ifdef, introducing an usb symbol dependency in
> the rt2x00lib module is a major inconvenience for distributions that
> package kernel modules split into individual packages.
>
> Get rid of this unnecessary dependency by calling the usb related
> function from a more suitable place.
>
> Cc: Vishal Thanki <vishalthanki@gmail.com>
> Reported-by: Felix Fietkau <nbd@nbd.name>
> Fixes: 8b4c0009313f ("rt2x00usb: Use usb anchor to manage URB")
> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
> ---
> v1 -> v2 do not break shutdown sequence
> v2 -> v3 update patch to current kernel version
What happened to the subject? It ends mid-sentence.
- Felix
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v3] rt2x00: avoid introducing a USB dependency in the
2017-02-01 16:33 ` Felix Fietkau
@ 2017-02-02 9:56 ` Stanislaw Gruszka
0 siblings, 0 replies; 3+ messages in thread
From: Stanislaw Gruszka @ 2017-02-02 9:56 UTC (permalink / raw)
To: Felix Fietkau; +Cc: linux-wireless, Helmut Schaa, Vishal Thanki
On Wed, Feb 01, 2017 at 05:33:38PM +0100, Felix Fietkau wrote:
> > v1 -> v2 do not break shutdown sequence
> > v2 -> v3 update patch to current kernel version
> What happened to the subject? It ends mid-sentence.
I somehow truncated it during rework, will post fixed one.
Thanks
Stanislaw
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-02-02 10:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-31 11:44 [PATCH v3] rt2x00: avoid introducing a USB dependency in the Stanislaw Gruszka
2017-02-01 16:33 ` Felix Fietkau
2017-02-02 9:56 ` Stanislaw Gruszka
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.