2015-10-29 06:46:33

by Krishna Chaitanya

[permalink] [raw]
Subject: Undocumented Sleep Requirements for ieee80211_ops

Hi,

>From the documentation:(mac80211.h) For the ieee80211_ops
(un)assign_vif_chanctx, there is no mention of explicit sleep
requirements (allowed/disallwoed) for the callback.

>From a quick glance at the code calling the OP, looks like we can
sleep (mutexes are used). So how should we handle such OPS? is it ok
to sleep in the callback?

We have a requirement where we need to wait for channel programming to
be done, before we allow data packets and it might take a while.

--
Thanks,
Regards,
Chaitanya T K.


2015-10-30 09:37:27

by Johannes Berg

[permalink] [raw]
Subject: Re: Undocumented Sleep Requirements for ieee80211_ops

On Thu, 2015-10-29 at 12:16 +0530, Krishna Chaitanya wrote:
> Hi,
>
> From the documentation:(mac80211.h) For the ieee80211_ops
> (un)assign_vif_chanctx, there is no mention of explicit sleep
> requirements (allowed/disallwoed) for the callback.

Same goes for drv_switch_vif_chanctx().

> From a quick glance at the code calling the OP, looks like we can
> sleep (mutexes are used). So how should we handle such OPS? is it ok
> to sleep in the callback?
>

You can sleep, and I'd appreciate if you sent a patch to add
might_sleep() to the code and the appropriate documentation.

johannes

2015-10-30 10:11:46

by Krishna Chaitanya

[permalink] [raw]
Subject: Re: Undocumented Sleep Requirements for ieee80211_ops

On Fri, Oct 30, 2015 at 3:07 PM, Johannes Berg
<[email protected]> wrote:
> On Thu, 2015-10-29 at 12:16 +0530, Krishna Chaitanya wrote:
>> Hi,
>>
>> From the documentation:(mac80211.h) For the ieee80211_ops
>> (un)assign_vif_chanctx, there is no mention of explicit sleep
>> requirements (allowed/disallwoed) for the callback.
>
> Same goes for drv_switch_vif_chanctx().
Yes.
>
>> From a quick glance at the code calling the OP, looks like we can
>> sleep (mutexes are used). So how should we handle such OPS? is it ok
>> to sleep in the callback?
>>
>
> You can sleep, and I'd appreciate if you sent a patch to add
> might_sleep() to the code and the appropriate documentation.
Sure, will send a patch.