# cannot enable power saving on wireless card

## Adel Ahmed

I'm trying to turn on power saving for my wireless card(realtek8723BE):

localhost ~ # iwconfig wlan0 power off

Error for wireless request "Set Power Management" (8B2C) :

    SET failed on device wlan0 ; Operation not supported.

localhost ~ # iwconfig wlan0 power on

Error for wireless request "Set Power Management" (8B2C) :

    SET failed on device wlan0 ; Operation not supported.

also I cannot seem to find wlan0 when I build the modules in the kernel, the card works when its modules are modularized.

localhost ~ # lspci -s 04:00.0 -vvv

04:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8723BE PCIe Wireless Network Adapter

	Subsystem: Lenovo Device b728

	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-

	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-

	Latency: 0, Cache Line Size: 64 bytes

	Interrupt: pin A routed to IRQ 18

	Region 0: I/O ports at 4000 [size=256]

	Region 2: Memory at f0100000 (64-bit, non-prefetchable) [size=16K]

	Capabilities: [40] Power Management version 3

		Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0+,D1+,D2+,D3hot+,D3cold+)

		Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-

	Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+

		Address: 0000000000000000  Data: 0000

	Capabilities: [70] Express (v2) Endpoint, MSI 00

		DevCap:	MaxPayload 128 bytes, PhantFunc 0, Latency L0s <4us, L1 <64us

			ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset-

		DevCtl:	Report errors: Correctable- Non-Fatal- Fatal- Unsupported-

			RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop-

			MaxPayload 128 bytes, MaxReadReq 512 bytes

		DevSta:	CorrErr+ UncorrErr- FatalErr- UnsuppReq+ AuxPwr+ TransPend-

		LnkCap:	Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Latency L0 <512ns, L1 <64us

			ClockPM+ Surprise- LLActRep- BwNot-

		LnkCtl:	ASPM L1 Enabled; RCB 64 bytes Disabled- Retrain- CommClk+

			ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-

		LnkSta:	Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-

		DevCap2: Completion Timeout: Not Supported, TimeoutDis+, LTR+, OBFF Via message/WAKE#

		DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis+, LTR+, OBFF Disabled

		LnkCtl2: Target Link Speed: 2.5GT/s, EnterCompliance- SpeedDis-

			 Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS-

			 Compliance De-emphasis: -6dB

		LnkSta2: Current De-emphasis Level: -6dB, EqualizationComplete-, EqualizationPhase1-

			 EqualizationPhase2-, EqualizationPhase3-, LinkEqualizationRequest-

	Capabilities: [100 v2] Advanced Error Reporting

		UESta:	DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-

		UEMsk:	DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-

		UESvrt:	DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-

		CESta:	RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+

		CEMsk:	RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+

		AERCap:	First Error Pointer: 00, GenCap+ CGenEn- ChkCap+ ChkEn-

	Capabilities: [140 v1] Device Serial Number 00-23-b7-fe-ff-4c-e0-00

	Capabilities: [150 v1] Latency Tolerance Reporting

		Max snoop latency: 3145728ns

		Max no snoop latency: 3145728ns

	Capabilities: [158 v1] #1e

	Kernel driver in use: rtl8723be

	Kernel modules: rtl8723be

thanks

----------

## apieum

 *blakdeath wrote:*   

> I'm trying to turn on power saving for my wireless card(realtek8723BE):
> 
> localhost ~ # iwconfig wlan0 power off
> 
> Error for wireless request "Set Power Management" (8B2C) :
> ...

 

try iw:

```
iw dev wlan0 set power_save on
```

 *blakdeath wrote:*   

> 
> 
> also I cannot seem to find wlan0 when I build the modules in the kernel, the card works when its modules are modularized.
> 
> 

 

Have you removed predictable network interface names from systemd/udev ? I'm surprised you have wlan0 instead of wlp4s0

May this be the source of this problem ?

----------

## Adel Ahmed

localhost ~ # iw dev wlan0 set power_save on

command failed: Operation not supported (-95)

and I cannot find any NICs at all, except for eth0 and lo of course, so I don't think the network name rules are doing anything here

thanks

----------

## apieum

Hi and happy new year.

Can you show the result of:

```
$ modinfo rtl8723be
```

and in case informations about your card/network given by dmesg and journalctl.

I can't find if power management is well supported for your card on linux, but I found itt can be buggy (like here https://wiki.archlinux.org/index.php/Wireless_network_configuration#rtl8723be) and sometimes in these cases kernel developpers decide to remove the feature.

The bios of some lenovo is capable to deactivate pcie power management, this cost nothing to check.

Also firmware seems quite buggy, there is a recent update you can try (if not already updated within modinfo output version).

Source file is here:

http://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/commit/?id=be225d6c10d72733a183d8712b89078f4141873f

----------

## Adel Ahmed

localhost ~ # modinfo rtl8723be

filename:       /lib/modules/3.16.5-gentoo/kernel/drivers/net/wireless/rtlwifi/rtl8723be/rtl8723be.ko

firmware:       rtlwifi/rtl8723befw.bin

description:    Realtek 8723BE 802.11n PCI wireless

license:        GPL

author:         Realtek WlanFAE	<wlanfae@realtek.com>

author:         PageHe	<page_he@realsil.com.cn>

alias:          pci:v000010ECd0000B723sv*sd*bc*sc*i*

depends:        rtlwifi,rtl8723-common,rtl_pci,btcoexist

intree:         Y

vermagic:       3.16.5-gentoo SMP preempt mod_unload 

parm:           swlps:bool

parm:           swenc:using hardware crypto (default 0 [hardware])

 (bool)

parm:           ips:using no link power save (default 1 is open)

 (bool)

parm:           fwlps:using linked fw control power save (default 1 is open)

 (bool)

parm:           msi:Set to 1 to use MSI interrupts mode (default 0)

 (bool)

parm:           debug:Set debug level (0-5) (default 0) (int)

I've tried changing the values in the power saving parameters, same result, same power drain(as reported by powertop

I've also checked the bios, nothing about powersaving

I'd rather update only when I have to, so I'll save that for last

thanks

----------

## Adel Ahmed

well, that link solved my other networking problem, no buffer space available(icmp)

disabling fwlps as stated in the link has fixed this problem. thanks alot for that.

----------

## apieum

I guess power management is managed by hardware and you'll not be able to control it.

You need to set ips parameter to 0 and swlps to 1.

Notes:

msi should probably set to 1 too but it's not in power management scope

For icmp, I guess your card support static SM power save.

You can check with "iw phy0 info"

----------

## Adel Ahmed

I now have:

Module: rtl8723be

Parameter: debug --> 0

Parameter: fwlps --> N

Parameter: ips --> N

Parameter: msi --> N

Parameter: swenc --> N

Parameter: swlps --> Y

but:

 localhost ~ # iw dev wlan0 set power_save on

command failed: Operation not supported (-95)

localhost ~ #  iwconfig wlan0 power off 

Error for wireless request "Set Power Management" (8B2C) :

    SET failed on device wlan0 ; Operation not supported.

the msi bit is interesting, I have been trying to understand this part, how does the NIC interrupt the CPU without MSI, and why is it better to enable msi?

I foudn this under capabilities:

Static SM Power Save, but what do you mean by for icmp?

thanks alot, I really appreciate your assistance

----------

## apieum

Sorry I've not seen you answered (browser cache).

 *blakdeath wrote:*   

> 
> 
> the msi bit is interesting, I have been trying to understand this part, how does the NIC interrupt the CPU without MSI, and why is it better to enable msi?
> 
> I foudn this under capabilities:
> ...

 

I don't know, it's out of my skills, I've just supposed that. (maybe look at http://www.vocal.com/networking/ieee-802-11n/ about power saving)

I had the same problem on another card, changing some settings like (ips and fwlps) fixed it.

I have no solution, hope you'll find.

In case you don't know, there is also systool from sys-fs/sysfsutils ($ systool -v -m rtl8723be) which can provide informations, and the parameter debug which may help you to figure out what's going on.

----------

## Adel Ahmed

thanks alot, I appreciate your help

----------

## apieum

You're welcome.  :Smile: 

You should try last firmware. (I suspect icmp errors comes from a firmware bug with power management)

As shown  here your card firmware was updated the 09/13 and the last linux-firmware package in gentoo is 20140902.

You can enable linux-firmware 20141009 with accept keywords.

good luck.

----------

## Adel Ahmed

time to upgrade I guess

----------

