jwrdegoede / rtl8189ES_linux

77 stars 90 forks source link

card regulator is not turned off if iface is down #82

Open akemnade opened 2 years ago

akemnade commented 2 years ago

The sdio card is not properly unpowered when device is down. Expectation would be that regulator is powered down when iface isis down. Removing the module helps.

pmos-shine3:/sys/bus/platform/devices/2198000.mmc/supplier:regulator:regulator.2# ifconfig wlan0 up
pmos-shine3:/sys/bus/platform/devices/2198000.mmc/supplier:regulator:regulator.2# cat supplier/state 
enabled
pmos-shine3:/sys/bus/platform/devices/2198000.mmc/supplier:regulator:regulator.2# ifconfig wlan0 down
pmos-shine3:/sys/bus/platform/devices/2198000.mmc/supplier:regulator:regulator.2# cat supplier/state 
enabled
pmos-shine3:/sys/bus/platform/devices/2198000.mmc/supplier:regulator:regulator.2# rmmod 8189fs
pmos-shine3:/sys/bus/platform/devices/2198000.mmc/supplier:regulator:regulator.2# cat supplier/state 
disabled

Seen on Kobo Clara HD, dtb: imx6sll-kobo-clarahd.dtb (relevant parts are in mainline) module information: commit: 71500c28164369800041d1716ac513457179ce93

It was compiled using

        make O="$_outdir" ARCH="$_carch" CC="${CC:-gcc}" \
                KBUILD_BUILD_VERSION="$(( pkgrel + 1 ))-postmarketOS" \
                CONFIG_RTW_SDIO_PM_KEEP_POWER=n \
                -C "$_rtl8189fs_dir" KSRC="$builddir"
Icenowy commented 2 years ago

Sorry but this is never an intended behavior to power down the full card when interface is down, because this state means the card is ready to work at any time.

akemnade commented 2 years ago

well, other sdio wifi drivers have that behavior. They power down the card completely, in such cases. Also the card does not power down completely if I do some rfkill block. Do you really think the only option the userspace should have to power down the card completely is to remove the driver?!