[rt2x00-users] [PATCH] Move TX/RX work into dedicated workqueue

Ivo Van Doorn ivdoorn at gmail.com
Wed Jan 26 20:20:55 EST 2011


Hi,

> On Mon, Jan 24, 2011 at 04:14:04PM +0100, Ivo van Doorn wrote:
>> diff --git a/drivers/net/wireless/rt2x00/rt2x00link.c b/drivers/net/wireless/rt2x00/rt2x00link.c
>> index bfda60e..c975b0a 100644
>> --- a/drivers/net/wireless/rt2x00/rt2x00link.c
>> +++ b/drivers/net/wireless/rt2x00/rt2x00link.c
>> @@ -417,7 +417,8 @@ void rt2x00link_start_watchdog(struct rt2x00_dev *rt2x00dev)
>>           !test_bit(DRIVER_SUPPORT_WATCHDOG, &rt2x00dev->flags))
>>               return;
>>
>> -     schedule_delayed_work(&link->watchdog_work, WATCHDOG_INTERVAL);
>> +     ieee80211_queue_delayed_work(rt2x00dev->hw,
>> +                                  &link->watchdog_work, WATCHDOG_INTERVAL);
>>  }
>>
>>  void rt2x00link_stop_watchdog(struct rt2x00_dev *rt2x00dev)
>> @@ -441,7 +442,9 @@ static void rt2x00link_watchdog(struct work_struct *work)
>>       rt2x00dev->ops->lib->watchdog(rt2x00dev);
>>
>>       if (test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags))
>> -             schedule_delayed_work(&link->watchdog_work, WATCHDOG_INTERVAL);
>> +             ieee80211_queue_delayed_work(rt2x00dev->hw,
>> +                                          &link->watchdog_work,
>> +                                          WATCHDOG_INTERVAL);
>>  }
>>
>>  void rt2x00link_register(struct rt2x00_dev *rt2x00dev)
>
> Doesn't this mean the watchdog cannot run while we are blocked
> in the flush callback waiting for the queue to become empty?

Thats true. But that doesn't matter, because the actions which
the watchdog wants to do during problems, is the same as what
flush() is doing. (In fact the watchdog will trigger flush for DMA problems).

> I think it would be better if the watchdog would use the same
> workqueue as the RX/TX work.

No, because then you have the "queue %d failed to flush" errors when
the watchdog invoked the flush.

Ivo



More information about the users mailing list