sd8686: Can't query deepsleep mode while associated

Bug #217883 reported by Tony Espy
6
Affects Status Importance Assigned to Milestone
Moblin Kernel
Fix Released
Low
Feng Tang

Bug Description

During power consumption testing we determined that the only way to reduce power consumption of the Wi-Fi card while un-associated was to put the adapter into "Deep Sleep" mode via a driver-specific ioctl.

We found that the radiooff doesn't have the same effect on power consumption.

So, while trying to modify the Hal backend scripts to control the Wi-Fi power via "iwpriv wlan0 deepsleep X", I noticed that not only does the code disallow setting the mode while associated, it also disallows querying the current setting. This is partially due to the fact that instead of creating a separate "getdeepsleep" ioctl, the value '2' is used with "deepsleep" to return the current value.

In wlan_wext.c : wlan_deepsleep_ioctl(), the code is guarded with:

if (Adapter->MediaConnectStatus == WlanMediaStateConnected) {
    PRINTM(MSG, "Cannot enter Deep Sleep mode in connected state.\n");
    return -EINVAL;
}

I'll attach a patch later this afternoon. The above code should only come into play if the value passed to the ioctl is 0 or 1.

Tags: intel ume
Revision history for this message
Zhao Fan (fan-zhao) wrote :

Feng, pls. have a look at this bug.

Changed in moblin-kernel:
assignee: nobody → feng-tang
importance: Undecided → Low
Revision history for this message
Feng Tang (feng-tang) wrote :

I knew this before that the Wi-Fi can't go into deep-sleep mode when it is associated.

But as the code come from Marvell, and I don't think it's really a bug. PM script may need dis-associate it before use the iwpriv command

Revision history for this message
Feng Tang (feng-tang) wrote :

Hi Tony,

Which irc channel are you using mostly, on #moblin or #ubuntu-mobile? Chatting on irc may be a good way to discuss some of the problems.

Revision history for this message
Tony Espy (awe) wrote :

Just because the code comes from Marvell, doesn't mean it's "bug-free". ;)-

First, the fact that you need to call a set-style private ioctl with the value "3" to get the status of "deepsleep" is bogus, but there's clearly no technical reason to prevent the query from happening whether the adapter's associated or not.

I ran into this as I'm currently attempting to add Hal Killswitch support for the sd8686 card. The Killswitch interface has two methods, SetPower and GetPower which are used to toggle and query the power state of a radio interface ( eg. WWAN, WLAN, BT ). I think it's perfectly fine to prevent SetPower from toggling the power while "connected", however the fact that you can't query the state directly without first querying NetworkManager, wpa_supplicant, or driver to check the association state is just plain silly.

I will attach a patch later this afternoon. I've had trouble trying to clone the moblin 2.6.24 tree recently, so I haven't been able to generate the diff against the current patch.

I can usually be found on the #ubuntu-mobile IRC channel if you'd like to discuss further.

Also, I think that there needs to be further discussion about the future of the sd868x drivers, perhaps first just between Intel and Canonical, and hopefully once we're on the same page, with Marvell as well.

Revision history for this message
Feng Tang (feng-tang) wrote :

I agree, no code can be bug-free

And if you only want the power state query to go on, I am fine with it. :)

alek du (alek-du)
Changed in moblin-kernel:
status: New → Triaged
Feng Tang (feng-tang)
Changed in moblin-kernel:
milestone: none → m11
Revision history for this message
Tony Espy (awe) wrote :

Changed status and importance based on yesterday's triage meeting. I still need to attach my patch.

Changed in acton:
importance: Undecided → High
status: New → Fix Committed
Steve Magoun (smagoun)
Changed in acton:
milestone: none → beta2
Revision history for this message
Tony Espy (awe) wrote :
Revision history for this message
Feng Tang (feng-tang) wrote :

Integrated Tony's patch to moblin 2.6.24 git. Will back port to 2.6.22 if needed and no bug reported

Changed in moblin-kernel:
status: Triaged → Fix Committed
Revision history for this message
Tony Espy (awe) wrote :

Released in beta1.5

Changed in acton:
status: Fix Committed → Fix Released
Zhao Fan (fan-zhao)
Changed in moblin-kernel:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.