Bug 207431

Summary: AMD-SFH detected but not working
Product: Drivers Reporter: Laurence Bonat (laurence.bonat)
Component: I2CAssignee: Drivers/I2C virtual user (drivers-i2c)
Status: RESOLVED DUPLICATE    
Severity: normal CC: laurence.bonat, mario.limonciello, nehal-bakulchandra.shah
Priority: P1    
Hardware: x86-64   
OS: Linux   
Kernel Version: 5.6.6 patches[SFH-Add-Support-for-AMD-Sensor-Fusion-Hub, 0001-ACPI-platform-Add-SMB0001-HID-to-forbidden_id_list] Subsystem:
Regression: No Bisected commit-id:
Attachments: dmesg
dmesg output of laptop

Description Laurence Bonat 2020-04-25 09:47:49 UTC
Created attachment 288723 [details]
dmesg

Hi everyone, 
First bug reporting. Last two weeks I've been tinkering around with some builds of the latest stable release of the kernel, adding AMD-SFH patches to the kernel to see if it works.

It seems that the driver module is correctly loaded and detects the sensor, but after that, it fails to load it correctly returning error -22. It seems that hp_accel is not supported by the driver?

Here the dmseg error I receive:

[    3.510309] hp_accel: laptop model unknown, using default axes configuration
[    3.528138] lis3lv02d: unknown sensor type 0x0
[    3.528148] hp_accel: probe of HPQ6007:00 failed with error -22

And the lspci -knn of the device:

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

It seems to be related to this bug https://bugzilla.kernel.org/show_bug.cgi?id=199715#c19, which hasn't been updated in a while.
Comment 1 Mario Limonciello (AMD) 2021-05-11 16:55:52 UTC
The drivers for SFH have been merged into mainline as of 5.11, and in 5.12 there are some other fixes.  Can you take a look at a more modern kernel and see if you still have problems with it?
Comment 2 Laurence Bonat 2021-05-12 12:35:07 UTC
(In reply to mario.limonciello from comment #1)
> The drivers for SFH have been merged into mainline as of 5.11, and in 5.12
> there are some other fixes.  Can you take a look at a more modern kernel and
> see if you still have problems with it?

Hi Mario,

I quickly tried the new kernel 5.11 and it seems to detect the accelerometer correctly, but when i try the command monitor-sensor, it doesn't detect the changes in device orientation:
(monitor-sensor output)

    Waiting for iio-sensor-proxy to appear
+++ iio-sensor-proxy appeared
=== Has accelerometer (orientation: undefined)
=== No ambient light sensor
=== No proximity sensor

(dmesg line, no errors)
[    0.974789] pcie_mp2_amd 0000:04:00.7: enabling device (0000 -> 0002)


Later I will try with the new 5.12 kernel, but from what I have seen the module seems to not have been made for the new Renoir CPU'S, so it doesn't detect the right hardware configuration.

Let me know if you need more information, I will try to answer as soon as I can
Comment 3 Nehal Shah 2021-08-12 18:29:57 UTC
Hi
Latest kernel has Renior support . Can you check with that ?
Comment 4 Laurence Bonat 2021-08-12 20:36:57 UTC
Hi, 
I tried to use kernel 5.13.10 and still the issue isn't fixed. I still get the same errors, I can detect the sensor, but it cannot give me the orientation(orientation:undefined). Can you tell me if you need more specific information? Because it would be very cool to have the rotation on these laptops...

monitor-sensor output:

    Waiting for iio-sensor-proxy to appear
+++ iio-sensor-proxy appeared
=== Has accelerometer (orientation: undefined)
=== No ambient light sensor
=== No proximity sensor

dmesg line:
[    0.969315] pcie_mp2_amd 0000:04:00.7: enabling device (0000 -> 0002)

Thank you for the response, I will wait for further indications.
Comment 5 Nehal Shah 2021-08-13 00:00:35 UTC
Hi

Changes specific to RN are from 5.14-rc1 onwards. Can you check with 5.14.rc3?

Nehal
Comment 6 Laurence Bonat 2021-08-13 10:01:21 UTC
Created attachment 298315 [details]
dmesg output of laptop

Hi, 
I tried with Kernel 5.14.rc5 and still got the same issues. Some more details.

lspci -knn output:
04:00.7 Signal processing controller [1180]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2/Renoir Sensor Fusion Hub [1022:15e4]
        Subsystem: Hewlett-Packard Company Raven/Raven2/Renoir Sensor Fusion Hub [103c:876e]
        Kernel driver in use: pcie_mp2_amd
        Kernel modules: amd_sfh

I add the integral dmesg file, in hope that it will help find the problem. Relevant lines are the following: 
[    0.311473] pci 0000:04:00.7: [1022:15e4] type 00 class 0x118000
[    0.311485] pci 0000:04:00.7: reg 0x18: [mem 0xd0000000-0xd00fffff]
[    0.311493] pci 0000:04:00.7: reg 0x24: [mem 0xd04cc000-0xd04cdfff]
[    0.311499] pci 0000:04:00.7: enabling Extended Tags
[    0.627467] pci 0000:04:00.7: Adding to iommu group 5
[    0.923943] pcie_mp2_amd 0000:04:00.7: enabling device (0000 -> 0002)

It still seems that it doesn't recognize the sensor for the Renoir Cpu's. 
If you need some other detailed logs please tell me, I am more than happy to help. 

Laurence
Comment 7 Nehal Shah 2021-08-13 10:55:11 UTC
Can you please tell us the system details?

- Laptop model
-Bios version
Comment 8 Laurence Bonat 2021-08-13 12:08:43 UTC
Hi,
the system details are as following: 
HP x360 Envy 13-ay0285ng With AMD ryzen 7 4700u and 16GB of Ram.
BIOS revision F.18

If you need to test something, I would like to help if I can. 

Laurence
Comment 9 Nehal Shah 2021-08-14 06:02:34 UTC
Hi

Thanks for the update

this seems to be duplicate of 

https://bugzilla.kernel.org/show_bug.cgi?id=212615


and we are looking into that.

Nehal
Comment 10 Mario Limonciello (AMD) 2022-07-09 13:56:45 UTC

*** This bug has been marked as a duplicate of bug 212615 ***