Search Linux Wireless

Re: [PATCH v2] net: rfkill: add generic gpio rfkill driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2011-05-12 at 11:23 -0700, Rhyland Klein wrote:

> > Are you sure starting out with UNSPECIFIED works? Then you'll always
> > change, but if the clock was enabled already you still enable it on the
> > first set_block() from rfkill, which still has the refcount problem, no?
> > It seems to me that the original state has to be passed in from the
> > platform?

> I thought about that. But I decided the clock that it is possible to
> have the clock used for the radio used for something else right? 

Sure.

> in
> which case, the driver will leave the clk in whatever state it initially
> finds it. I.e. if the clock is disabled, then it will enable it only
> once and work, if it is enabled, it will add a refcount (only once) and
> then work and disable it again only once. It never changes the refcount
> in either direction by more than 1, and this way the initial setting of
> the clock is irrelevant. The board files can simply initialize the block
> as off if that is the initial clk state they want.

The issue is that depending on how you boot, the first refcount change
might be +1 or it might be -1.

If rfkill decides that at the time of loading wifi should be off, then
the first change would be -1, and after that it would flip between 0 and
-1.

If, on the other hand, rfkill decides that at the time of loading the
driver wifi should be on, then the first change would be +1 and it'll
flip between 0 and +1.

This seems like it'll cause issues at some point, so I think you should
either allow the driver to set the initial state or hardcode one of
these possibilities (so at least it's predictable)

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux