Skip to contentSkip to conversation

rt2x00: LED classes

DISCUSSION Ivo van Doorn 1 participant 2 messages Mar 21, 2008 – Mar 24, 2008

lore
Share & tools
lore
#0 lore raw

Hi,

Some time ago I introduced LED classes to rt2x00. For the USB drivers this has prooven to be tricky since LED triggers are called in non-sleepable context and USB drivers do need some sleep for register access.

As a workaround I introduced the in_atomic() check which prints an error and skips the call. I am now reading a discussion about in_atomic() on the netdev mailinglist, and drivers are urged to remove the usage as much as possible.

I must admit that I don't know if LED triggers work in non-sleepable context by design or if it depends on the calling trigger....

For rt2x00 there are now 2 options, either find the trigger that is calling rt2x00 in non-sleepable context and fix it or drop the LED class feature for USB drivers.

Has anybody recently tested the LED class option with rt2500usb or rt73usb? And if so, do the following lines appear in the log:
Ignoring LED brightness command for led
If so, please post all those error messages so the problem can be tracked down.

Otherwise I will start with either disabling LED handling completely or create a large workaround which still uses LED classes but works without LED triggers. Depending on the amount of code, the LED triggers for PCI drivers will also be sacrificed to keep the code as simple as possible.

Ivo

#1 lore raw

Hi,

Quoted 3 lines

I must admit that I don't know if LED triggers work in non-sleepable context by design or if it depends on the calling trigger....

On inspection of led_trigger_event() it seems to grab a read_lock before calling the driver.
This means that USB drivers cannot use LED triggers.

I will see if I can simulate the behavior differently where LED classes are still used but rt2x00 implements its own version of LED triggers. Most likely this will result in rt2x00 not be using the triggers provided by mac80211 for any of the drivers.

For the time being LED support for rt2500usb and rt73usb will be disabled with CONFIG_BROKEN. A better solution will hopefully be ready for 2.6.27.

Ivo