[PATCH 7/7] Return TXed frames to mac80211.

Kalle Valo kvalo at qca.qualcomm.com
Wed May 29 06:37:43 EDT 2013


Pontus Fuchs <pontus.fuchs at gmail.com> writes:

> On 2013-05-28 17:28, Kalle Valo wrote:
>> Pontus Fuchs <pontus.fuchs at gmail.com> writes:
>>
>>> On TX done IRQ reap all transferred skbs.
>>>
>>> Signed-off-by: Pontus Fuchs <pontus.fuchs at gmail.com>
>>
>> [...]
>>
>>> @@ -512,11 +534,12 @@ int wcn36xx_dxe_tx(struct wcn36xx *wcn,
>>>   	ctl = ctl->next;
>>>   	ctl->skb = skb;
>>>   	desc = ctl->desc;
>>> +	BUG_ON(ctl->bd_cpu_addr);
>>
>> No BUG_ON() on wireless drivers, please. It just creates more problems
>> than solves.
>>
>> You could use WARN_ON_ONCE() or wcn36xx_warn(). I recommend the latter,
>> consumes less memory.
>
> This condition is fatal. If we had recovery/restart in place I would
> have triggered that.
>
> I can add a comment telling this, and if you have a strong opinion
> against using BUG_ON I can turn it into a WARN_ON instead?

I have a very strong opinion against BUG_ON() in wireless drivers :) You
can disable the driver etc, but there's no need to crash the entire
kernel. It's much more friendly to the user.

When spotting an error it's better to warn about it and bail out
cleanly.

-- 
Kalle Valo



More information about the wcn36xx mailing list