BeardOverflow / msi-ec

GNU General Public License v2.0
145 stars 45 forks source link

No exported files found after recommended dkms-install. And classic method is skipping BTF generation. (OS: Fedora 39 with Gnome 45) #113

Closed SrivastavaHarsh closed 5 months ago

SrivastavaHarsh commented 6 months ago

Laptop model

MSI BRAVO 15 B5DD (Ryzen 7 5800H with Radeon RX5500M)

EC firmware version

cat: /sys/devices/platform/msi-ec/fw_version: No such file or directory

Description

Outut when using the recommended method to install is as follows:

dkms --version >> /dev/null
mkdir -p /usr/src/msi_ec-0.08
cp /home/demid/Downloads/msi-ec/dkms.conf /usr/src/msi_ec-0.08
cp /home/demid/Downloads/msi-ec/Makefile /usr/src/msi_ec-0.08
cp /home/demid/Downloads/msi-ec/msi-ec.c /usr/src/msi_ec-0.08
cp /home/demid/Downloads/msi-ec/ec_memory_configuration.h /usr/src/msi_ec-0.08
sed -e "s/@CFLGS@//" \
    -e "s/@VERSION@/0.08/" \
    -i /usr/src/msi_ec-0.08/dkms.conf
dkms add msi_ec/0.08
Creating symlink /var/lib/dkms/msi_ec/0.08/source -> /usr/src/msi_ec-0.08
dkms build msi_ec/0.08
Sign command: /lib/modules/6.7.10-200.fc39.x86_64/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub
Building module:
Cleaning build area...
Building module(s)...
Signing module /var/lib/dkms/msi_ec/0.08/build/msi-ec.ko
Cleaning build area...
dkms install msi_ec/0.08
msi-ec.ko.xz:
Running module version sanity check.
 - Original module
   - Found /lib/modules/6.7.10-200.fc39.x86_64/extra/msi-ec.ko.xz
   - Storing in /var/lib/dkms/msi_ec/original_module/6.7.10-200.fc39.x86_64/x86_64/
   - Archiving for uninstallation purposes
 - Installation
   - Installing to /lib/modules/6.7.10-200.fc39.x86_64/extra/
depmod....
echo msi-ec > /etc/modules-load.d/msi-ec.conf

But no files are being exported to /sys/devices/platform/ after install.

When using another (classic) method mentioned, make exits with the following output:

warning: the compiler differs from the one used to build the kernel
  The kernel was built by: gcc (GCC) 13.2.1 20231205 (Red Hat 13.2.1-6)
  You are using:           gcc (GCC) 13.2.1 20240316 (Red Hat 13.2.1-7)
  CC [M]  /home/demid/Downloads/msi-ec/msi-ec.o
  MODPOST /home/demid/Downloads/msi-ec/Module.symvers
  CC [M]  /home/demid/Downloads/msi-ec/msi-ec.mod.o
  LD [M]  /home/demid/Downloads/msi-ec/msi-ec.ko
  BTF [M] /home/demid/Downloads/msi-ec/msi-ec.ko
Skipping BTF generation for /home/demid/Downloads/msi-ec/msi-ec.ko due to unavailability of vmlinux
make[1]: Leaving directory '/usr/src/kernels/6.7.10-200.fc39.x86_64'

Also, the output of modinfo msi-ec is :


version:        0.08
description:    MSI Embedded Controller
author:         Nikita Kravets <teackot@gmail.com>
author:         Aakash Singh <mail@singhaakash.dev>
author:         Jose Angel Pastrana <japp0005@red.ujaen.es>
license:        GPL
rhelversion:    9.99
srcversion:     F6B93808402F2F64E3678B9
depends:        
retpoline:      Y
name:           msi_ec
vermagic:       6.7.10-200.fc39.x86_64 SMP preempt mod_unload 
sig_id:         PKCS#7
signer:         DKMS module signing key
sig_key:        56:E6:CE:68:AF:CB:F5:AC:E7:6E:89:27:40:B7:CE:06:70:E7:12:3B
sig_hashalgo:   sha512
signature:      6C:AD:14:D6:90:6A:EE:11:05:AC:26:B3:B0:97:52:51:0F:58:49:68:
        06:8F:53:D6:DB:40:6A:38:78:73:4C:1A:14:7D:51:D3:10:2D:CE:CB:
        13:83:E5:B8:2B:22:22:A4:53:A5:84:97:2F:37:DF:0C:95:08:1B:FE:
        C5:41:E4:9D:AB:85:DF:46:73:58:09:DF:89:2E:9E:A5:FB:CE:13:2B:
        B9:81:F4:AF:55:74:46:CF:3A:64:BF:24:89:ED:DE:47:26:6A:2A:A7:
        69:0F:94:9B:D4:1C:B0:65:EA:5D:CB:45:40:8F:27:E1:61:29:1E:5E:
        8D:2C:54:07:4E:CC:9E:12:00:9E:04:97:F1:4B:C2:7F:C4:D6:08:B0:
        54:AE:4C:D7:49:90:06:79:75:09:6A:05:8A:41:3B:B4:FB:2D:AC:DA:
        01:44:BD:9F:E5:64:A7:D1:61:90:CF:9D:A1:2B:76:63:A9:C0:6B:70:
        E0:8C:D6:1E:CF:C3:D8:6D:78:BB:80:19:0E:73:05:C8:18:CB:7E:E8:
        3A:76:26:CA:C1:22:E6:67:85:5D:D2:93:40:52:70:5D:4C:AD:57:4E:
        19:69:42:EE:C4:5D:CF:61:94:03:0F:46:2E:3F:18:5A:65:98:AE:EE:
        F1:10:60:BD:39:A0:F1:0A:DD:DA:62:E0:88:1A:C8:EE
parm:           firmware:Load a configuration for a specified firmware version (charp)
parm:           debug:Load the driver in the debug mode, exporting the debug attributes (bool)```
glpnk commented 6 months ago

After installation with DKMS you need to manually load driver or reboot.

SrivastavaHarsh commented 6 months ago

I had rebooted the device but that didn't help. I found no msi-ec folder inside /sys/devices/platform. Also, executing dkms status command gives msi_ec/0.08, 6.7.10-200.fc39.x86_64, x86_64: installed (original_module exists) as output. And, ls /lib/modules doesn't show any msi_ec file or folder.

glpnk commented 6 months ago

dkms reported that you have installed git version of this module. Try to load it manually

sudo modprobe msi-ec debug=true

Also, look like your model is not supported yet. Please load module in debug mode and share EC dump

You can check dmesg for errors

SrivastavaHarsh commented 6 months ago

Running sudo modprobe -v msi-ec debug=true gave no output. Running dmesg | grep msi gave the following output:

[    8.196661] msi_ec: loading out-of-tree module taints kernel.
[    8.196666] msi_ec: module verification failed: signature and/or required key missing - tainting kernel
[    8.199263] msi_ec: Your firmware version is not supported!
[    8.944225] msi_ec: Your firmware version is not supported!
[    9.163881] msi_ec: Your firmware version is not supported!
[    9.234499] msi_ec: Your firmware version is not supported!
[ 1088.250587] msi_ec: module_init

Also running make load-debug outputs:

insmod msi-ec.ko debug=1
insmod: ERROR: could not insert module msi-ec.ko: Operation not permitted
make: *** [Makefile:24: load-debug] Error 1

I cannot figure out how to get EC dump. Running fw_version,ec_dump,ec_get and ec_set gives command-not-found error.

Note: The multimedia control, volume control, mic and camera switch, touchpad switch, keyboard backlight control, brightness control and fan control keys are working out-of-the-box. Led indicator for fn-lock and num-lock is also working but led indicatorsfor mute and disabling mic are not working. Enabling/disabling camera works but doesn't show any notification. I don't know if this info is of any use or not.

glpnk commented 5 months ago

Maybe issue with module signing. Do you entered sudo before make load-debug? You can make EC dump different way.

Check is ec_sys is loaded

lsmod | grep ec_sys

If not, load it.

sudo modprobe ec_sys

Then hexdump it and share in new issue

sudo hexdump /sys/kernel/debug/ec/ec0/io -C
SrivastavaHarsh commented 5 months ago

Thanks a lot for support 👍 I have switched to arch linux. After installing from AUR, the signature issue went away. The firmware of my device is indeed not supported yet. I was able to find ec dump by the method you suggested and have made a new firmware request issue for my device.