Git Product home page Git Product logo

Comments (15)

kitakar5525 avatar kitakar5525 commented on July 23, 2024 1

Unfortunately, even when we disabled the power_save, the mwifiex firmware still crashes on Surface 3 on heavy traffic or long idle.

Disabling ASPM L1 state can avoid this issue: https://github.com/linux-surface/linux-surface/wiki/Known-Issues-and-FAQ#mwifiex-module-crashing


Usually on Linux, disabling L1 state breaks S0ix (thus higher power consumption on suspend) but interestingly on chromeos, not break S0ix. So, once you disabled L1 state, you don't have to re-enable the L1 state for suspend, unlike what the wiki says.

from brunch.

sebanc avatar sebanc commented on July 23, 2024 1

@kitakar5525 Thanks a lot for your help once again !

@GayDingo Could you run the below commands in cros shell, reboot and see if it improves wifi stability:

sudo mkdir -p /var/brunch/bootscripts
echo "echo 0 > /sys/bus/pci/drivers/mwifiex_pcie/0000:0?:00.0/link/l1_aspm" | sudo tee /var/brunch/bootscripts/mwifiex.sh
sudo chmod 0755 /var/brunch/bootscripts/mwifiex.sh

from brunch.

sebanc avatar sebanc commented on July 23, 2024

Hi,

The mentioned patch is directly included at kernel level, could you please attach 2 "dmesg" to this issue (one obtained just after boot, one just after a wifi crash) ?

Thanks.

from brunch.

GayDingo avatar GayDingo commented on July 23, 2024

it's happened a few times but i havent been able to reproduce it in a while. I'll keep the issue open until it triggers again.

from brunch.

GayDingo avatar GayDingo commented on July 23, 2024

Got it!

dmesg_aftercrash.txt
dmesg_afterboot.txt

from brunch.

kitakar5525 avatar kitakar5525 commented on July 23, 2024

and what is worse, we can't control ASPM via sysfs until v5.5 series. We can only use the script method written in the wiki on v4.19 series kernel.

from brunch.

GayDingo avatar GayDingo commented on July 23, 2024

@kitakar5525 Thanks a lot for your help once again !

@GayDingo Could you run the below commands in cros shell, reboot and see if it improves wifi stability:

sudo mkdir -p /var/brunch/bootscripts
echo "echo 0 > /sys/bus/pci/drivers/mwifiex_pcie/0000:0?:00.0/link/l1_aspm" | sudo tee /var/brunch/bootscripts/mwifiex.sh
sudo chmod 0755 /var/brunch/bootscripts/mwifiex.sh

i have ran these. I'll report back in a week to see how things go. Thank you.

from brunch.

sebanc avatar sebanc commented on July 23, 2024

@GayDingo apparently the fix I posted will not work with kernel 4.19, i will try to find something else.

@kitakar5525 Sorry, just saw your comment, would completely disabling pcie aspm by adding to the kernel command line "pcie_aspm=off" work ? Is the impact on battery life noticeable ?

from brunch.

GayDingo avatar GayDingo commented on July 23, 2024

@GayDingo apparently the fix I posted will not work with kernel 4.19, i will try to find something else.

@kitakar5525 Sorry, just saw your comment, would completely disabling pcie aspm by adding to the kernel command line "pcie_aspm=off" work ? Is the impact on battery life noticeable ?

yep, i was about to post that the wifi ended up crashing again, thanks for the help, however.

Also, i will mention mine is the LTE model, i'll test cellular once i get the chance to for y'all. Take care!

EDIT: Also, I have updated to v81 Rammus with the latest testing 4.19 kernel

from brunch.

kitakar5525 avatar kitakar5525 commented on July 23, 2024

@GayDingo

Here is the script I use to disable L1 state: aspm-disable-L1-wifi-S3.txt
EDIT: Updated (added some more comment for clarity): aspm-disable-L1-wifi-S3.txt
(rename it from .txt to .sh and execute with sudo. e.g. sudo bash aspm-disable-L1-wifi-S3.sh)

(redistributing script from https://wireless.wiki.kernel.org/en/users/documentation/aspm#enabling_aspm_with_enable_aspm with modification to disable L1 state for Surface 3 wifi to avoid firmware crashing, following the permission notice)

Hmm. I need to update the wiki in linux-surface later for clarity and copyright, including

  • add the direct link to the script (which I posted here)
  • add the link to the wireless.wiki.kernel.org that distributes the original script

from brunch.

kitakar5525 avatar kitakar5525 commented on July 23, 2024

@sebanc

  • I tried with kernel command line pcie_aspm=off but according to lspci[1], ASPM seems to be actually not disabled (?) I might be misunderstanding
  • If I understand correctly, adding kernel command line pcie_aspm.policy=performance (or runtime: echo performance | sudo tee /sys/module/pcie_aspm/parameters/policy) has the same effect as pcie_aspm=off. And as expected, it broke S0ix. So, we usually don't want to to use pcie_aspm.policy=performance (and also pcie_aspm=off if I assume that it also has the same effect as pcie_aspm.policy=performance).

[1] You can show ASPM states by like this: sudo lspci -nnvvv | grep -iE '^..:..\..|aspm'

linux-surface are trying to avoid firmware crashing at kernel level but as I mentioned before, disabling L1 state usually breaks S0ix. So, we should ensure that L1 gets re-enabled before suspend...

I'm curious why pcie_aspm.policy=performance breaks S0ix but not break S0ix when I use the script (aspm-disable-L1-wifi-S3.sh) on chromeos. Using the script on Linux breaks S0ix anyway.

from brunch.

sebanc avatar sebanc commented on July 23, 2024

@kitakar5525 Thanks a lot again for your support again ! I am getting tired of the mwifiex driver issues, I think I will disable aspm in the mwifiex driver in my next release even if it means breaking S0ix.

from brunch.

kitakar5525 avatar kitakar5525 commented on July 23, 2024

@GayDingo ah, you need to run that script on every boot or you can automate executing the script by copying that script into /var/brunch/bootscripts then adding executable permission.
For example:

sudo mkdir -p /var/brunch/bootscripts
sudo cp aspm-disable-L1-wifi-S3.sh /var/brunch/bootscripts/
sudo chmod 0755 /var/brunch/bootscripts/aspm-disable-L1-wifi-S3.sh

@sebanc
Hmm. I'll let you know when some progress is made in this issue. I think just adding that script just works for now hopefully without breaking S0ix on chromeos, though.

from brunch.

sebanc avatar sebanc commented on July 23, 2024

Hi, I disabled aspm for the mwifiex driver in the new testing release, could you see if you still have this issue ?

from brunch.

sebanc avatar sebanc commented on July 23, 2024

I believe this issue is fixed so I will close it, don't hesitate to re-open it if needed

from brunch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.