lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <22d4c0e2-18db-4a04-8584-755407d33a5a@basealt.ru>
Date:   Thu, 11 Mar 2021 14:29:08 +0300
From:   Nikolai Kostrigin <nickel@...ealt.ru>
To:     jingle <jingle.wu@....com.tw>
Cc:     stable@...r.kernel.org,
        'Dmitry Torokhov' <dmitry.torokhov@...il.com>,
        kernel@...gutronix.de, linux-input@...r.kernel.org,
        Uwe Kleine-König <u.kleine-koenig@...gutronix.de>,
        lkml <linux-kernel@...r.kernel.org>,
        Benjamin Tissoires <benjamin.tissoires@...hat.com>
Subject: Re: elan_i2c: failed to read report data: -71

Hi!

05.03.2021 22:18, Uwe Kleine-König пишет:
> On Thu, Mar 04, 2021 at 11:49:59AM +0300, Nikolai Kostrigin wrote:
>> Hi,
>>
>> 04.03.2021 09:59, Uwe Kleine-König пишет:
>>> Hello,
>>>
>>> On Wed, Mar 03, 2021 at 05:53:37PM -0800, 'Dmitry Torokhov' wrote:
>>>> On Wed, Mar 03, 2021 at 09:03:30PM +0100, Uwe Kleine-König wrote:
>>>>> On Wed, Mar 03, 2021 at 07:32:23PM +0100, Uwe Kleine-König wrote:
>>>>>> On Wed, Mar 03, 2021 at 11:13:21AM +0800, jingle wrote:
>>>>>>> Please updates this patchs.
>>>>>>>
>>>>>>> https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git/commit/?h=next&id=056115daede8d01f71732bc7d778fb85acee8eb6
>>>>>>>
>>>>>>> https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git/commit/?h=next&id=e4c9062717feda88900b566463228d1c4910af6d
>>>>>>
>>>>>> The first was one of the two patches I already tried, but the latter
>>>>>> indeed fixes my problem \o/.
>>>>>>
>>>>>> @Dmitry: If you don't consider your tree stable, feel free to add a
>>>>>>
>>>>>> 	Tested-by: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
>>>>>>
>>>>>> to e4c9062717feda88900b566463228d1c4910af6d.
>>>>>
>>>>> Do you consider this patch for stable? I'd like to see it in Debian's
>>>>> 5.10 kernel and I guess I'm not the only one who would benefit from such
>>>>> a backport.
>>>>
>>>> When I was applying the patches I did not realize that there was already
>>>> hardware in the wild that needed it. The patches are now in mainline, so
>>>> I can no longer adjust the tags, but I will not object if you propose
>>>> them for stable.
>>>
>>> I want to propose to backport commit
>>>
>>> e4c9062717fe ("Input: elantech - fix protocol errors for some trackpoints in SMBus mode")
>>>
>>> to the active stable kernels. This commit repairs the track point and
>>> the touch pad buttons on a Lenovo Thinkpad E15 here. Without this change
>>> I don't get any events apart from an error message for each button press
>>> or move of the track point in the kernel log. (Also the error message is
>>> the same for all buttons and the track point, so I cannot create a new
>>> input event driver in userspace that emulates the right event depending
>>> on the error message :-)
>>>
>>> At least to 5.10.x it applies cleanly, I didn't try the older stable
>>> branches.
>>>
>>> Best regards and thanks
>>> Uwe
>>>
>>
>> I'd like to propose to backport [1] also as it was checked along with
>> previously proposed patch and fixes Elan Trackpoint operation on
>> Thinkpad L13.
>>
>> Both patches apply cleanly to 5.10.17 in my case.
>>
>> I also tried to apply to 5.4.x, but failed.
>>
>> [1] 056115daede8 Input: elan_i2c - add new trackpoint report type 0x5F
>>
>> Additional info is available here:
>>
>> https://lore.kernel.org/linux-input/fe31f6f8-6e38-2ed6-8548-6fa271bf36e9@basealt.ru/T/#m514047f2c5e7e2ec4ed9658782f14221ed7598fc
> 
> FTR: I tested 5.10 + e4c9062717fe ("Input: elantech - fix protocol
> errors for some trackpoints in SMBus mode") now and in this setup the
> touchpad is still broken. I assume that in combination with 056115daede8
> it will work. The working setup I tested was 5.10 + c7f0169e3bd2 +
> 056115daede8 + e4c9062717fe and I assume c7f0169e3bd2 isn't relevant.
> 
> Best regards
> Uwe
> 
> 

Now when both patches (056115daede8 + e4c9062717fe) are in stable since
5.10.22 trackpoint works just fine on TP L13 after computer boot.

But there is one more thing to add:

when resuming from hibernation mode trackpoint loses the workaround and
continue to send long packets (please refer to attached log).
This happens because the device was powered off and during wake-up the
code from 'psmouse' containing packet type switch was not run.

drivers/input/mouse/elantech.c:
if (elantech_change_report_id(psmouse)) {
                        psmouse_info(psmouse,
                                     "Trackpoint report is broken,
forcing standard PS/2 protocol\n");
                        return -ENODEV;
                }

Power management is handled by elan_i2c driver.

drivers/input/mouse/elan_i2c_core.c:

[...]
static SIMPLE_DEV_PM_OPS(elan_pm_ops, elan_suspend, elan_resume);
[...]

Resume from suspend is not affected since, I guess, the initial setup is
preserved in powered state.

The quick workaround is to reload either psmouse or i2c_i801 driver.
This restores operation.

So I'd like to kindly ask Jingle Wu to introduce execution of
elantech_change_report_id() during hibernation resume if this possible
paying attention to psmouse and elan_i2c drivers architecture.

Thank you.

-- 
Best regards,
Nikolai Kostrigin

View attachment "dmesg_elan_i2c_EPROTO_after_pm-hibernate.log" of type "text/x-log" (107033 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ