Linux wireless drivers development
 help / color / mirror / Atom feed
* cfg80211 rfkill interface
@ 2011-01-10 19:33 Arend Van Spriel
  2011-01-10 19:45 ` Johannes Berg
  0 siblings, 1 reply; 5+ messages in thread
From: Arend Van Spriel @ 2011-01-10 19:33 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless@vger.kernel.org

Hi Johannes,

I am looking into implementing rfkill into our brcm80211 open-source driver. Our driver detects disable switch by an interrupt, but switching back does not give an interrupt. For the latter I wanted to use the rfkill_poll callback and wiphy_rfkill_start_polling. However, I tried a wiphy_rfkill_stop_polling in the rfkill_poll callback when rf is unblocked, and this resulted in a system hang. So I moved the wiphy_rfkill_stop_polling to the start callback. Does that make sense or is there another way you would recommend?

Gr. AvS

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

* Re: cfg80211 rfkill interface
  2011-01-10 19:33 cfg80211 rfkill interface Arend Van Spriel
@ 2011-01-10 19:45 ` Johannes Berg
  2011-01-14 14:54   ` Arend Van Spriel
  0 siblings, 1 reply; 5+ messages in thread
From: Johannes Berg @ 2011-01-10 19:45 UTC (permalink / raw)
  To: Arend Van Spriel; +Cc: linux-wireless@vger.kernel.org

Hi Arend,

> I am looking into implementing rfkill into our brcm80211 open-source
> driver. Our driver detects disable switch by an interrupt, but
> switching back does not give an interrupt. 

Interesting, but I guess it makes some sense.

> For the latter I wanted to use the rfkill_poll callback and
> wiphy_rfkill_start_polling.

Right, makes sense.

> However, I tried a wiphy_rfkill_stop_polling in the rfkill_poll
> callback when rf is unblocked, and this resulted in a system hang. 

Yeah, I'm not surprised. start_polling will work from anywhere, but
stop_polling needs to actually completely sync the poll stop so it can't
be done from within the poll or from within any rfkill callbacks.

> So I moved the wiphy_rfkill_stop_polling to the start callback. Does
> that make sense or is there another way you would recommend?

I think that makes sense.

However, where do you start polling? You have to poll even if the device
is not start()ed, I guess?

johannes


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

* RE: cfg80211 rfkill interface
  2011-01-10 19:45 ` Johannes Berg
@ 2011-01-14 14:54   ` Arend Van Spriel
  2011-01-14 14:57     ` Johannes Berg
  0 siblings, 1 reply; 5+ messages in thread
From: Arend Van Spriel @ 2011-01-14 14:54 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless@vger.kernel.org

Hi Johannes,

Thanks for you thoughts on this. Especially the last remark was reason for me to verify several usage scenarios. I ran into a issue with unloading the driver module while it was in blocked rfkill state and polling was active. Turns out the call to ieee80211_unregister_hw takes a loooong time before it returns and dmesg shows message from unregister_netdevice which seems related about refcount not being zero. This is only observed in this scenario. Any suggestion on how to handle this?

Gr. AvS

|-----Original Message-----
|From: Johannes Berg [mailto:johannes@sipsolutions.net]
|Sent: Monday, January 10, 2011 8:45 PM
|To: Arend Van Spriel
|Cc: linux-wireless@vger.kernel.org
|Subject: Re: cfg80211 rfkill interface
|
|Hi Arend,
|
|> I am looking into implementing rfkill into our brcm80211 open-source
|> driver. Our driver detects disable switch by an interrupt, but
|> switching back does not give an interrupt.
|
|Interesting, but I guess it makes some sense.
|
|> For the latter I wanted to use the rfkill_poll callback and
|> wiphy_rfkill_start_polling.
|
|Right, makes sense.
|
|> However, I tried a wiphy_rfkill_stop_polling in the rfkill_poll
|> callback when rf is unblocked, and this resulted in a system hang.
|
|Yeah, I'm not surprised. start_polling will work from anywhere, but
|stop_polling needs to actually completely sync the poll stop so it can't
|be done from within the poll or from within any rfkill callbacks.
|
|> So I moved the wiphy_rfkill_stop_polling to the start callback. Does
|> that make sense or is there another way you would recommend?
|
|I think that makes sense.
|
|However, where do you start polling? You have to poll even if the device
|is not start()ed, I guess?
|
|johannes
|



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

* RE: cfg80211 rfkill interface
  2011-01-14 14:54   ` Arend Van Spriel
@ 2011-01-14 14:57     ` Johannes Berg
  2011-01-14 15:05       ` Arend Van Spriel
  0 siblings, 1 reply; 5+ messages in thread
From: Johannes Berg @ 2011-01-14 14:57 UTC (permalink / raw)
  To: Arend Van Spriel; +Cc: linux-wireless@vger.kernel.org

On Fri, 2011-01-14 at 06:54 -0800, Arend Van Spriel wrote:

> Thanks for you thoughts on this. Especially the last remark was reason
> for me to verify several usage scenarios. I ran into a issue with
> unloading the driver module while it was in blocked rfkill state and
> polling was active. Turns out the call to ieee80211_unregister_hw
> takes a loooong time before it returns and dmesg shows message from
> unregister_netdevice which seems related about refcount not being
> zero. This is only observed in this scenario. Any suggestion on how to
> handle this?

No, I can see no reason for this to happen?? rfkill doesn't take a
netdev refcount.

johannes


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

* RE: cfg80211 rfkill interface
  2011-01-14 14:57     ` Johannes Berg
@ 2011-01-14 15:05       ` Arend Van Spriel
  0 siblings, 0 replies; 5+ messages in thread
From: Arend Van Spriel @ 2011-01-14 15:05 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless@vger.kernel.org

Thanks for quick response. I will have to dig in deeper, than.

Gr. AvS
________________________________________
From: Johannes Berg [johannes@sipsolutions.net]
Sent: Friday, January 14, 2011 3:57 PM
To: Arend Van Spriel
Cc: linux-wireless@vger.kernel.org
Subject: RE: cfg80211 rfkill interface

On Fri, 2011-01-14 at 06:54 -0800, Arend Van Spriel wrote:

> Thanks for you thoughts on this. Especially the last remark was reason
> for me to verify several usage scenarios. I ran into a issue with
> unloading the driver module while it was in blocked rfkill state and
> polling was active. Turns out the call to ieee80211_unregister_hw
> takes a loooong time before it returns and dmesg shows message from
> unregister_netdevice which seems related about refcount not being
> zero. This is only observed in this scenario. Any suggestion on how to
> handle this?

No, I can see no reason for this to happen?? rfkill doesn't take a
netdev refcount.

johannes




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

end of thread, other threads:[~2011-01-14 15:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-10 19:33 cfg80211 rfkill interface Arend Van Spriel
2011-01-10 19:45 ` Johannes Berg
2011-01-14 14:54   ` Arend Van Spriel
2011-01-14 14:57     ` Johannes Berg
2011-01-14 15:05       ` Arend Van Spriel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox