Re: [asus-nb-wmi] i8042 optional dependecy?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On 8/24/20 9:00 PM, Marius Iacob wrote:
On 20-08-24 12:02:12, Hans de Goede wrote:
Hi,

On 8/24/20 10:25 AM, Andy Shevchenko wrote:
On Sun, Aug 23, 2020 at 08:58:35PM +0300, Marius Iacob wrote:

I have an ASUS T103HAF and while trying to load asus-nb-wmi module it fails because it has i8042 as dependecy and that module does not load on my device.

Can you be more specific, why that module is not loaded?

Yes that would be my first question too, have you tried passing "i8042.reset=1" and/or "i8042.nomux=1" on the
kernel cmdline? Typically passing "i8042.nomux=1" fixes all kinda i8042 issues.


I'm sorry, forgot to mention, because my device is a 2-in-1 it uses a detachable keyboard/touchpad and is connected by USB interface. So when trying to load i8042 module (also tried reset/nomux) it always says in dmesg "i8042: PNP: No PS/2 controller found." I'm guessing there is no PS/2 controller on this device...

Ah I see, and I guess that after the "i8042: PNP: No PS/2 controller found." message (which is fine) the module fails to load, right ?

That really is a bug in the i8042 code, if a module is providing symbols to another module it should never exit with an error from
its module_init function.

I guess most people do not have this problem because in the typical distro config the i8042 driver is built into the kernel.

I see that i8042 is used in asus-nb-wmi for a quirk, so it's not necessary all the time. How can I make it an optional dependecy?

include/linux/i8042.h

Contains a stub for i8042_install_filter() for when CONFIG_SERIO_I8042 is not enabled, so you can build
your own kernel with that option unset. But we really ought to come up with a better fix which will also
work for standard distro kernels, see above.

I've built a asus-nb-wmi module without i8042 references and it works. I had to add "BATC" for battery RSOC (my battery is named BATC). And yes, I also have tried to make the module work for my device around the i8042 dependecy, tried to add IS_REACHABLE(CONFIG_SERIO_I8042) in .c and imply SERIO_I8042 in Kconfig, but it didn't work, so I don't think I was on the right track. I have little experience with kernel development and I figured asking some more experienced people was a better idea.
Thanks for your reply. If you have any ideas I'm more than happy to try/code them out and submit a patch if/when it works.

If I understand things correctly (see above) then the right fix for the I8042 driver issue is to patch
its module_init function to return with 0 instead of -ENODEV (I guess) when it hits the code path with the
"i8042: PNP: No PS/2 controller found." message.

Let me know if you need any help with that.

As for the "I had to add "BATC" for battery RSOC (my battery is named BATC)" bit I'm missing some
context there / not entirely following you, but lets first tackle the i8042 thing and then look
at that other issue later.

Regards,

Hans




[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux