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

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

 



On 20-08-31 12:18:27, Hans de Goede wrote:
> Hi,
> 
> On 8/31/20 10:21 AM, Marius Iacob wrote:
> > On 20-08-31 09:36:24, Hans de Goede wrote:
> > > Hi,
> > > 
> > > On 8/30/20 11:17 PM, Marius Iacob wrote:
> > > > On 20-08-24 22:23:41, Hans de Goede wrote:
> > > > > 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 ?
> > > > 
> > > > Yes, modprobe: ERROR: could not insert 'i8042': No such device, and there's no trace of i8042 in lsmod output.
> > > > 
> > > > > 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.
> > > > 
> > > > i8042 is doing a full init in its module_init. I've bypassed the PNP controller check and it fail while trying to talk to the controller:
> > > > 	i8042: PNP detection disabled
> > > > 	i8042: Can't read CTR while initializing i8042
> > > > 	i8042: probe of i8042 failed with error -5
> > > > I'm guessing it's module_init should look like asus-wmi's: a message saying it's loaded and return 0; but I don't have enough kernel development experience to do this modification.
> > > 
> > > I haven't looked at the code (yet) but going by your description the trick would be to keep the PnP
> > > check in the module_init function and instead of -ENODEV just return 0 when the check fails so that
> > > the rest of the init function gets skipped.
> > > 
> > > You probably want to check module_exit in this case to see if that is safe to run with the
> > > rest of module_init skipped.
> > > 
> > > Let me know if you need more help with this, I believe that fixing this should be pretty easy.
> > 
> > Unfortunately the PNP check is 2 layers deeper from module_init and it's expected to return 0 for success for the rest of the init procedure to continue (so that it's not that straightforward). The module seems to be built with a full init procedure on load in mind. I've looked at the code for quite a bit and it seems that it's a bit of patch to write, and most of the places the i8042 code is used (in other modules) expects the module to be not just loaded but fully initialized. So this should be a consideration also.
> 
> Please give the attached patch a try, I believe that this should fix the i8042 issue.
> 
> Once you have let me know that this works I'll replace the:
> 
> Reported-by: Marius Iacob <themariusus@xxxxxxxxx>
> 
> By:
> 
> Reported-and-tested-by: Marius Iacob <themariusus@xxxxxxxxx>
> 
> And submit the patch upstream. Note the input subsys
> maintainers seems to be a bit slow to respond lately,
> so I'm not sure how fast we can get this reviewed / merged.
> 
> Anyways first lets test it and see if it helps :)

The patch works as intended. I also tried it on a system that has PS/2 controller and the module works as intended on that system too.

Regards,
Marius




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

  Powered by Linux