Bug 33822 - Wifi LED on Thinkpad X201 (iwlwifi) always blinking since 5ed540a
Summary: Wifi LED on Thinkpad X201 (iwlwifi) always blinking since 5ed540a
Status: CLOSED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: network-wireless (show other bugs)
Hardware: All Linux
: P1 low
Assignee: drivers_network-wireless@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-22 11:30 UTC by Björn Schließmann
Modified: 2011-06-01 12:54 UTC (History)
3 users (show)

See Also:
Kernel Version: 2.6.39-rc
Subsystem:
Regression: Yes
Bisected commit-id:


Attachments
led stay solid on when no traffic (1.94 KB, patch)
2011-04-25 14:40 UTC, wey-yi.w.guy
Details | Diff
remove blinking with no traffic (621 bytes, patch)
2011-04-25 16:33 UTC, Johannes Berg
Details | Diff
led stay solid on when no traffic (1.91 KB, patch)
2011-04-25 18:07 UTC, wey-yi.w.guy
Details | Diff

Description Björn Schließmann 2011-04-22 11:30:20 UTC
On my Thinkpad X201, since commit 5ed540aecc2aae92d5c97b9a9306a5bf88ad5574 ("iwlwifi: use mac80211 throughput trigger") the behaviour of the Wifi LED has changed in an annoying way.

Before, it blinked only if there was data traffic; otherwise it stayed on. After said commit, when joining a WLAN it is turned on and shortly after starts to blink. Then it never stops blinking (until leaving the network). And if there's data traffic it blinks even faster. This is /very/ distracting, and counterintuitive (blinking should only occur on traffic).
Comment 1 Björn Schließmann 2011-04-22 11:33:36 UTC
Forgot: The card is a "Intel Corporation Centrino Ultimate-N 6300 (rev 35)".
Comment 2 Björn Schließmann 2011-04-22 11:34:02 UTC
... using "iwlagn".
Comment 3 John W. Linville 2011-04-25 13:54:58 UTC
I suspect there may be more traffic on your network than you realize -- my LED barely blinks at all.  Still, I'll Cc some relevant people in case there is a problem.

Meanwhile, you can change the LED trigger to something else on your local box.  Just do something like this:

   echo phy0assoc > /sys/class/leds/phy0-led/trigger

For a list of other available triggers, you can do this:

   cat /sys/class/leds/phy0-led/trigger

I'll leave this open for now, just in case there is actually a problem with the throughput trigger.
Comment 4 wey-yi.w.guy 2011-04-25 14:40:18 UTC
Created attachment 55402 [details]
led stay solid on when no traffic

Could you try this patch which should stay solid on if no traffic.

the other method is passing module parameter when old the driver 
$sudo modprobe iwlagn led_mode=1

Thanks
Wey
Comment 5 Johannes Berg 2011-04-25 16:33:00 UTC
Created attachment 55412 [details]
remove blinking with no traffic

The attached patch will remove the blinking when there's _no_ traffic, but obviously it won't change anything if there's even a little bit of traffic.

I'll check the product documentation tomorrow, though I'm quite sure I checked when writing that patch and this behaviour is intentional. And the other fixes still stand, of course, you can change it in sysfs.
Comment 6 wey-yi.w.guy 2011-04-25 16:39:33 UTC
I am not sure you want to remove the entry from the table. I believe the product document has the following

/* Throughput		OFF time(ms)	ON time (ms)
 *	>300			25		25
 *	>200 to 300		40		40
 *	>100 to 200		55		55
 *	>70 to 100		65		65
 *	>50 to 70		75		75
 *	>20 to 50		85		85
 *	>10 to 20		95		95
 *	>5 to 10		110		110
 *	>1 to 5			130		130
 *	>0 to 1			167		167
 *	<=0					SOLID ON
 */

Thought?

Wey
Comment 7 Johannes Berg 2011-04-25 16:44:03 UTC
Right, ok, so in that case we should change the -1 to 0 like this:

-	{ .throughput = 0 * 1024 - 1, .blink_time = 334 },
+	{ .throughput = 0, .blink_time = 334 },
Comment 8 Johannes Berg 2011-04-25 16:44:59 UTC
FWIW, I like that behaviour better, but I was pretty sure it was intended to blink even with no throughput. But maybe I looked at an outdated document or misunderstood it.
Comment 9 wey-yi.w.guy 2011-04-25 16:48:17 UTC
yap, is works.
but I still think we need to define if its "-1" the led should be solid. I understand in mac80211, the default is 
on = 1
off = 0

but I still like to define and control it in the driver

Wey
Comment 10 Johannes Berg 2011-04-25 16:57:48 UTC
Don't think we should do it that way though, if anything we should check

if (off == 0)
   on = IWL_LED_ON;

or something like that rather than checking "on == 0" (since that will not be the case for other triggers)
Comment 11 wey-yi.w.guy 2011-04-25 17:13:34 UTC
it is what I already did in the patch I attach with some minor logic different.

ok, I can modify the patch, not fully agree remove the "-1" entry, but I guess it is ok.

Wey
Comment 12 wey-yi.w.guy 2011-04-25 18:07:14 UTC
Created attachment 55422 [details]
led stay solid on when no traffic

How this patch looks?

Wey
Comment 13 Johannes Berg 2011-04-25 19:16:15 UTC
Looks good to me. The different logic is better I think because then we don't need the -1 entry and it can handle other triggers (other than throughput trigger) better.
Comment 14 Björn Schließmann 2011-04-26 15:36:56 UTC
ad 3: Thanks for your concern, but I checked with wireshark ;) Thanks for the trigger tip, didn't try it yet though. (I had reverted said commit as a private short-time fix.)

ad 12: Applied this patch on top of mainline v2.6.39-rc4. LED "behaves well" again :) I'd call this bug fixed. Thanks for your efforts, guys.
Comment 15 Björn Schließmann 2011-05-04 21:18:26 UTC
Now that v2.6.39-rc6 is out, I happened to notice commit 1501b6764f0c363a9f1d72f9d422841f81f1bd8c ("iwlegacy: led stay solid on when no traffic"). It's almost the same patch as the one above, but changes

drivers/net/wireless/iwlegacy/iwl-led.c

instead of

drivers/net/wireless/iwlwifi/iwl-led.c

Is this a mistake, or intentional?
Comment 16 Björn Schließmann 2011-05-04 21:20:00 UTC
(Just to add, I haven't yet seen the patch from #12 being merged into mainline.)
Comment 17 wey-yi.w.guy 2011-05-04 23:43:47 UTC
drivers/net/wireless/iwlegacy/iwl-led.c for legacy devices(3945 & 4965)

drivers/net/wireless/iwlwifi/iwl-led.c for newer devices (5000 and after)

#12 is submit to -next already

Thanks
Wey
Comment 18 Björn Schließmann 2011-05-31 22:38:15 UTC
The patch is now included in linux-3.0-rc1; I'd consider this fixed. Thanks :)
Comment 19 wey-yi.w.guy 2011-05-31 22:52:17 UTC
Could you update the bug status and close it

Thanks
Wey

Note You need to log in before you can comment on or make changes to this bug.