You are not logged in.

#1 2023-06-04 09:31:06

encomiastical
Member
Registered: 2023-06-03
Posts: 6

Kernel not recognizing amd_sfh sensors

Hi!
I recently installed Arch 6.3.5 on my HP Envy x360 15 ey0xxx with an AMD Ryzen chipset. I am using Gnome 44.1 on Wayland and want to use iio-sensor-proxy 3.4-1 to autorotate the screen. At first, autorotation wasn't even working on Windows 11, and I had to install the HP F.12 Bios update. After installing this update, it worked on Windows.

Unfortunately, on Linux, when starting iio-sensor-proxy via

$ systemctl start iio-sensor-proxy

and looking at

$ systemctl status iio-sensor-proxy
○ iio-sensor-proxy.service - IIO Sensor Proxy service
     Loaded: loaded (/usr/lib/systemd/system/iio-sensor-proxy.service; static)
     Active: inactive (dead)

Jun 04 10:36:31 MCP systemd[1]: Starting IIO Sensor Proxy service...
Jun 04 10:36:31 MCP systemd[1]: Started IIO Sensor Proxy service.
Jun 04 10:36:31 MCP systemd[1]: iio-sensor-proxy.service: Deactivated successfully.

It seems like it does not really start ("Deactivated successfully."?!). Running it manually:

$ sudo /usr/lib/iio-sensor-proxy -v

** (iio-sensor-proxy:3576): DEBUG: 10:37:22.196: Starting iio-sensor-proxy version 3.4
(iio-sensor-proxy:3576): GLib-GIO-DEBUG: 10:37:22.197: Using cross-namespace EXTERNAL authentication (this will deadlock if server is GDBus < 2.73.3)
** (iio-sensor-proxy:3576): DEBUG: 10:37:22.211: No sensors or missing kernel drivers for the sensors

Tells me that there are no sensors detected. I have a very limited understanding of how iio works (ie. I know literally nothing), but after an extensive dialogue with chatgpt, it seems to me that any iio devices that get recognized by the kernel should be listed in /sys/bus/iio/devices. Unfortunately, upon startup, the /sys/bus/iio folder doesn't even exist.

lsmod | grep industrialio

does not return anything. So it seems that industrialio wasn't loaded?

Loading industrialio manually via

$ sudo modprobe industrialio

creates the /sys/bus/iio folder, but /sys/bus/iio/devices is still empty.

My first question is: Why does the /sys/bus/iio folder not exist on startup? Why does industrialio not get loaded? I am using a more or less completely fresh arch install (save two custom modules to fix the sound of my Envy x360, a fork of this fork: https://github.com/OGrigorios/hp-15-ew0xxx-snd-fix ).

After some research, it seems to me that all the iio sensors of my device run through something called amd_sfh (AMD Sensor Fusion Hub). Apparently, Linux added support drivers for this from 5.11 onwards ( https://linuxreviews.org/Sensor_Fusion_ … Linux_5.11 ). lsmod shows that something along these lines gets loaded:

$ sudo lsmod | grep amd_sfh
amd_sfh                53248  0

My second question is therefore: Why doesn't it work, if Linux added the drivers long ago? All the similar questions I could find online date back to 2020 and point to the upcoming patch, so it seems to me that I am currently the only person experiencing this issue (after said patch). How could I troubleshoot further?

I am very sorry if my questions are a testimony to my complete ignorance regarding these matters, I really did try my best to understand, but this whole topic seems overwhelmingly complex. I would really appreciate it if someone could explain (or point me to a accessible resource) what actually is supposed to happen (ie. what the amd_sfh module does, how it interacts with industrialio, how I could verify that things are broken, etc...).



Best Regards!

Offline

#2 2023-06-04 11:29:29

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 12,203

Re: Kernel not recognizing amd_sfh sensors

The output of usr/bin/monitor-sensor may be helpful.

Also the accelerometer on the HP envy x360 seems to be troublesome on linux .
iio-sensor-proxy upstream bugreport: https://gitlab.freedesktop.org/hadess/i … issues/334
kernel bug report : https://bugzilla.kernel.org/show_bug.cgi?id=212615

Welcome to archlinux forums


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#3 2023-06-04 16:03:22

encomiastical
Member
Registered: 2023-06-03
Posts: 6

Re: Kernel not recognizing amd_sfh sensors

Hi Lone_Wolf,
Thank you for your response! The output of monitor sensor is just

$ sudo /usr/bin/monitor-sensor 
    Waiting for iio-sensor-proxy to appear

since, in my interpretation, iio-sensor-proxy is not active, since it did not find any sensors.

The cases you linked are different from my case, since for them, their kernel actually detects the hardware (in case of the kernel bug report see for example the line "/sys/bus/iio/devices/iio:device0 accel_3d-dev0").
I am very confused by this fact, and would like to find out why that is, ie. why does my kernel not detect my hardware, when it obviously does for other people?

Offline

#4 2023-06-05 10:18:33

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 12,203

Re: Kernel not recognizing amd_sfh sensors

Without more info it's only possible to speculate .

Exact type & model  of the laptop ? which firmware version ?

Please post full output of lspci -knn , as well as dmesg and journalctl -b from most recent boot (run the latter 2 with root rights).

Some of those outputs will be large, consider using  a pastebin service to upload them sonewhere.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#5 2023-06-05 12:30:15

encomiastical
Member
Registered: 2023-06-03
Posts: 6

Re: Kernel not recognizing amd_sfh sensors

My model is "HP ENVY x360 Convert 15-ey0753ng" with AMD Ryzen 5 5625U chip. The firmware version is "F.12-04".
For the outputs see:
lspci: https://0x0.st/HbUx.txt
dmesg: https://0x0.st/HbUg.txt
journalctl: https://0x0.st/HbUY.txt

Thanks for trying to help!!

Offline

#6 2023-06-05 17:33:29

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 2,022
Website

Re: Kernel not recognizing amd_sfh sensors

What does

# modprobe pcie_mp2_amd

yield?


macro_rules! yolo { { $($tokens:tt)* } => { unsafe { $($tokens)* } }; }

Offline

#7 2023-06-05 20:59:19

encomiastical
Member
Registered: 2023-06-03
Posts: 6

Re: Kernel not recognizing amd_sfh sensors

Hi schard!

The command yields:

$ sudo modprobe pcie_mp2_amd
modprobe: FATAL: Module pcie_mp2_amd not found in directory /lib/modules/6.3.5-arch1-1

Offline

#8 2023-06-10 20:43:31

encomiastical
Member
Registered: 2023-06-03
Posts: 6

Re: Kernel not recognizing amd_sfh sensors

Today I finally found some time to do some research on this. Obviously, on a first glance, it is not good when this module is missing. I therefore googled "pcie_mp2_amd", and mostly found this post: https://bbs.archlinux.org/viewtopic.php?id=252815 by you schard. It seems you had a similar problem as I do, but back in 2020. In the thread, your lsmod listed 2 modules: amd_sfhtp_hid & amd_mp2_pcie, which I do not have. I do however have the module amd_sfh, as mentioned in my original post. It seems to me, that this module should provide the same functionality as your two modules, looking at the source:  https://github.com/torvalds/linux/blob/ … md-sfh-hid . Furthermore, the Kconfig explicitly mentions that the compiled module will be called amd_sfh. My theory is that upon release in October 2020, the 2 modules were bundled, and you, in your post from February 2020, were using an old version. This already caused confusion elsewhere: https://forums.debian.net/viewtopic.php?t=153396 . My theory is also mentioned in one of the responses there.

I am however pretty sure that my amd_sfh should provide the necessary functionality, comparing the lspci outputs from you:

04:00.7 Non-VGA unclassified device [0000]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2/Renoir Sensor Fusion Hub [1022:15e4]
	Subsystem: Hewlett-Packard Company Raven/Raven2/Renoir Sensor Fusion Hub [103c:8496]
	Kernel driver in use: pcie_mp2_amd
	Kernel modules: amd_mp2_pcie

from me (I am sorry I did not grep the whole thing in my original post):

04:00.7 Signal processing controller [1180]: Advanced Micro Devices, Inc. [AMD] Sensor Fusion Hub [1022:15e4]
	Subsystem: Hewlett-Packard Company Sensor Fusion Hub [103c:8a31]
	Kernel modules: amd_sfh

and from this person: https://ubuntuforums.org/showthread.php?t=2476878 , who seems to have the same problem as me:

03:00.7 Signal processing controller [1180]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2/Renoir Sensor Fusion Hub [1022:15e4]
    Subsystem: Advanced Micro Devices, Inc. [AMD] Raven/Raven2/Renoir Sensor Fusion Hub [1022:15e4]
    Kernel driver in use: pcie_mp2_amd
    Kernel modules: amd_sfh

Note that in my case, it does not mention the line: "Kernel driver in use: pcie_mp2_amd". I do not know why that is.

Regarding your post, it seems that your problem has been fixed (https://bbs.archlinux.org/viewtopic.php?id=254821 "Update 2021-01-25")? I tried to manually set the sensor_mask as mentioned in the github you linked in the update post, but that did not change anything.

It seems like you spent quite some time exploring this topic. Do you have any idea how I could continue troubleshooting? It does seem like there are other people who have the same problem (see the linked ubuntu and debian forums), but nobody was able to solve it yet.


Best regards!

Offline

#9 2023-06-10 21:33:47

seth
Member
Registered: 2012-09-03
Posts: 53,548

Re: Kernel not recognizing amd_sfh sensors

Jun 05 14:22:07 MCP kernel: pcie_mp2_amd 0000:04:00.7: Failed to discover, sensors not enabled is 0
Jun 05 14:22:07 MCP kernel: pcie_mp2_amd: probe of 0000:04:00.7 failed with error -95

https://www.spinics.net/lists/stable/msg657957.html
https://github.com/torvalds/linux/commi … 0d8b99554b

The sensor doesn't respond.
Since you're dual-booting, see the 3rd link below. Mandatory.
Disable it (it's NOT the BIOS setting!) and reboot windows and linux twice for voodo reasons.

Offline

#10 2023-06-27 16:30:30

encomiastical
Member
Registered: 2023-06-03
Posts: 6

Re: Kernel not recognizing amd_sfh sensors

Hi!
Unfortunately, I am currently very much occupied with my studies, and did not find the time to follow through on this issue. I apologize for not responding earlier, but I am also unsure that I will be any faster in the coming weeks.
I am a bit confused as to where your answer points seth. You provided 2 links, which seem to be about separate issues involving the sfh? (At least to my naive, inexperienced eyes).
Regarding the first link, I do not think that I am experiencing Kernel oopses, so I am not sure how this applies?
Regarding the second link, it seems to me that it is not about the actual issue, but just about fixing extended resume times that are indirectly caused by the issue?
My knowledge about the inner working of kernel drivers is non-existent, so I really don't know what to make of these links, I am sorry.

I followed the instructions in the 3rd link and disabled fast startup, but that did not fix the issue. But the wiki entry mentions:
"The procedure of disabling Fast Startup is described in the tutorials for Windows 8, Windows 10 and Windows 11. In any case if you disable a setting, make sure to disable the setting and then shut down Windows, before installing Linux; note that rebooting is not sufficient. ".
I did not yet try to reinstall my Arch. Maybe I will find the time to try this some weeks down the road and provide an update.

Best.

Offline

#11 2023-06-27 16:44:04

seth
Member
Registered: 2012-09-03
Posts: 53,548

Re: Kernel not recognizing amd_sfh sensors

You won't have to re-install arch, but re-boot both systems twice for voodoo reasons is a good idea.

The links illustrate when the warning was introduced and why and that actually no sensor is enabled and because amd_sfh_wait_for_response that it doesn't respond, causing me to worry about the dual boot condition, not more.

Offline

Board footer

Powered by FluxBB