All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kai-Heng Feng <kai.heng.feng@canonical.com>
To: Mario.Limonciello@dell.com
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	benjamin.tissoires@redhat.com, hotwater438@tutanota.com,
	jikos@kernel.org, swboyd@chromium.org, bigeasy@linutronix.de,
	dtor@chromium.org, linux-input@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ELAN touchpad i2c_hid bugs fix
Date: Wed, 3 Apr 2019 17:24:37 +0800	[thread overview]
Message-ID: <3E46D2D1-EADC-4F77-8091-A36E648C4908@canonical.com> (raw)
In-Reply-To: <16218e1c23bb4cb6b0b739d561a707bc@ausx13mpc120.AMER.DELL.COM>

at 22:08, <Mario.Limonciello@dell.com> <Mario.Limonciello@dell.com> wrote:

>> -----Original Message-----
>> From: Kai Heng Feng <kai.heng.feng@canonical.com>
>> Sent: Monday, April 1, 2019 11:18 PM
>> To: Limonciello, Mario
>> Cc: Andy Shevchenko; hdegoede@redhat.com; benjamin.tissoires@redhat.com;
>> hotwater438@tutanota.com; jikos@kernel.org; swboyd@chromium.org;
>> bigeasy@linutronix.de; dtor@chromium.org; linux-input@vger.kernel.org;  
>> linux-
>> kernel@vger.kernel.org
>> Subject: Re: [PATCH] ELAN touchpad i2c_hid bugs fix
>>
>>
>> [EXTERNAL EMAIL]
>>
>>
>>
>>> On Apr 2, 2019, at 5:37 AM, <Mario.Limonciello@dell.com>
>>> <Mario.Limonciello@dell.com> wrote:
>>>
>>>> -----Original Message-----
>>>> From: Andy Shevchenko <andy.shevchenko@gmail.com>
>>>> Sent: Thursday, March 21, 2019 4:48 AM
>>>> To: Kai-Heng Feng; Limonciello, Mario
>>>> Cc: Hans de Goede; Benjamin Tissoires; hotwater438@tutanota.com; Jiri
>>>> Kosina;
>>>> Stephen Boyd; Sebastian Andrzej Siewior; Dmitry Torokhov; open list:HID
>>>> CORE
>>>> LAYER; lkml
>>>> Subject: Re: [PATCH] ELAN touchpad i2c_hid bugs fix
>>>>
>>>>
>>>> [EXTERNAL EMAIL]
>>>>
>>>> +Cc: Mario
>>>>
>>>> Mario, do you have any insights about the issue with touchpad on Dell
>>>> system described below?
>>>
>>> My apologies, this got lost while I was on vacation.
>>>
>>>> On Thu, Mar 21, 2019 at 6:08 AM Kai-Heng Feng
>>>> <kai.heng.feng@canonical.com> wrote:
>>>>> at 01:18, Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
>>>>>
>>>>>> On Wed, Mar 20, 2019 at 6:55 PM Kai-Heng Feng
>>>>>> <kai.heng.feng@canonical.com> wrote:
>>>>>>> at 23:39, Hans de Goede <hdegoede@redhat.com> wrote:
>>>>>>>> On 3/20/19 3:37 PM, Benjamin Tissoires wrote:
>>>>>>
>>>>>>>> Benjamin, what I find interesting here is that the BOGUS_IRQ quirk
>>>>>>>> is also used on Elan devices, I suspect that these Elan devices
>>>>>>>> likely also need the I2C_HID_QUIRK_FORCE_TRIGGER_FALLING quirk
>>>>>>>> and then they probably will no longer need the bogus IRQ flag,
>>>>>>>> if you know about bugreports with an acpidump for any of the devices
>>>>>>>> needing the bogus IRQ quirk, then I (or you) can check how the IRQ  
>>>>>>>> is
>>>>>>>> declared there, I suspect it will be declared as level-low, just  
>>>>>>>> like
>>>>>>>> with the laptop this patch was written for. And it probably need to
>>>>>>>> be edge-falling instead of level-low just like this case.
>>>>>>>
>>>>>>> First, I’ve already tried using IRQF_TRIGGER_FALLING, unfortunately  
>>>>>>> it
>>>>>>> doesn’t solve the issue for me.
>>>>>>>
>>>>>>> I talked to Elan once, and they confirm the correct IRQ trigger is
>>>>>>> level
>>>>>>> low. So forcing falling trigger may break other platforms.
>>>>>>
>>>>>> As far as I understood Vladislav the quirk he got from Elan as well.
>>>>>
>>>>> Ok, then this is really weird.
>>>>>
>>>>>>> Recently we found that Elan touchpad doesn’t like GpioInt() from its
>>>>>>> _CRS.
>>>>>>> Once the Interrupt() is used instead, the issue goes away.
>>>>>>
>>>>>> IIRC i2c core tries to get interrupt from Interrupt() resource and
>>>>>> then falls back to GpioInt().
>>>>>> See i2c_acpi_get_info() and i2c_device_probe().
>>>>>
>>>>> Here’s its ASL:
>>>>>
>>>>>     Scope (\_SB.PCI0.I2C4)
>>>>>     {
>>>>>         Device (TPD0)
>>>>>         {
>>>>>             Name (_ADR, One)  // _ADR: Address
>>>>>             Name (_HID, "DELL08AE")  // _HID: Hardware ID
>>>>>             Name (_CID, "PNP0C50" /* HID Protocol Device (I2C bus) */)  // _CID:
>>>> Compatible ID
>>>>>            Name (_UID, One)  // _UID: Unique ID
>>>>>             Name (_S0W, 0x04)  // _S0W: S0 Device Wake State
>>>>>             Name (SBFB, ResourceTemplate ()
>>>>>             {
>>>>>                 I2cSerialBusV2 (0x002C, ControllerInitiated, 0x00061A80,
>>>>>                     AddressingMode7Bit, "\\_SB.PCI0.I2C4",
>>>>>                     0x00, ResourceConsumer, , Exclusive,
>>>>>                     )
>>>>>             })
>>>>>             Name (SBFG, ResourceTemplate ()
>>>>>             {
>>>>>                 GpioInt (Level, ActiveLow, ExclusiveAndWake, PullUp, 0x0000,
>>>>>                     "\\_SB.GPO1", 0x00, ResourceConsumer, ,
>>>>>                     )
>>>>>                     {   // Pin list
>>>>>                         0x0012
>>>>>                     }
>>>>>             })
>>>>>             Name (SBFI, ResourceTemplate ()
>>>>>             {
>>>>>                 Interrupt (ResourceConsumer, Level, ActiveLow, ExclusiveAndWake, ,, )
>>>>>                 {
>>>>>                     0x0000003C,
>>>>>                 }
>>>>>             })
>>>>>             Method (_INI, 0, NotSerialized)  // _INI: Initialize
>>>>>             {
>>>>>             }
>>>>>             Method (_STA, 0, NotSerialized)  // _STA: Status
>>>>>             {
>>>>>                 If ((TCPD == One))
>>>>>                 {
>>>>>                     Return (0x0F)
>>>>>                 }
>>>>>
>>>>>                 Return (Zero)
>>>>>             }
>>>>>             Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
>>>>>             {
>>>>>                 If ((OSYS < 0x07DC))
>>>>>                 {
>>>>>                     Return (SBFI) /* \_SB_.PCI0.I2C4.TPD0.SBFI */
>>>>>                 }
>>>>>
>>>>>                 Return (ConcatenateResTemplate (SBFB, SBFG))
>>>>>             }
>>>>>             Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
>>>>>             {
>>>>>                 If ((Arg0 == ToUUID ("3cdff6f7-4267-4555-ad05-b30a3d8938de") /*
>> HID
>>>> I2C Device */))
>>>>>                {
>>>>>                     If ((Arg2 == Zero))
>>>>>                     {
>>>>>                         If ((Arg1 == One))
>>>>>                         {
>>>>>                             Return (Buffer (One)
>>>>>                             {
>>>>>                                  0x03                                             // .
>>>>>                             })
>>>>>                         }
>>>>>                         Else
>>>>>                         {
>>>>>                             Return (Buffer (One)
>>>>>                             {
>>>>>                                  0x00                                             // .
>>>>>                             })
>>>>>                         }
>>>>>                     }
>>>>>                     ElseIf ((Arg2 == One))
>>>>>                     {
>>>>>                         Return (0x20)
>>>>>                     }
>>>>>                     Else
>>>>>                     {
>>>>>                         Return (Buffer (One)
>>>>>                         {
>>>>>                              0x00                                             // .
>>>>>                         })
>>>>>                     }
>>>>>                 }
>>>>>                 ElseIf ((Arg0 == ToUUID ("ef87eb82-f951-46da-84ec-14871ac6f84b")))
>>>>>                 {
>>>>>                     If ((Arg2 == Zero))
>>>>>                     {
>>>>>                         If ((Arg1 == One))
>>>>>                         {
>>>>>                             Return (Buffer (One)
>>>>>                             {
>>>>>                                  0x03                                             // .
>>>>>                             })
>>>>>                         }
>>>>>                     }
>>>>>
>>>>>                     If ((Arg2 == One))
>>>>>                     {
>>>>>                         Return (ConcatenateResTemplate (SBFB, SBFG))
>>>>>                     }
>>>>>
>>>>>                     Return (Buffer (One)
>>>>>                     {
>>>>>                          0x00                                             // .
>>>>>                     })
>>>>>                 }
>>>>>                 }
>>>>>                 Else
>>>>>                 {
>>>>>                     Return (Buffer (One)
>>>>>                     {
>>>>>                          0x00                                             // .
>>>>>                     })
>>>>>                 }
>>>>>             }
>>>>>         }
>>>>>     }
>>>>>
>>>>> Change SBFG to SBFI in its _CRS can workaround the issue.
>>>>> Is ASL in this form possible to do the flow you described?
>>>>>
>>>>> Kai-Heng
>>>>>
>>>>>>> But I am not sure how to patch its DSDT/SSDT in i2c-hid.
>>>
>>> Is this pre-production HW?  If so, maybe this is a case that we should  
>>> talk
>>> about custom OSI string to run the ASL differently.
>>
>> Some are already shipped.
>>
>>
>>> The other option would be to create a new ASL method in FW and from Linux
>>> side a quirk that calls this new ASL method.
>>
>> Since this patch is for ASUS Laptop, I think a more generic solution from
>> driver layer is preferred.
>
> I thought this ASL was from Dell laptop.  The HID make it looks like it  
> at least.

Yes this ASL is from a Dell system.

>>>>>            Name (_HID, "DELL08AE")  // _HID: Hardware ID
>
> In general more generic solution from driver layer is preferred I agree.   
> You might
> need to check with ACPI guys to see if they have some ideas on situations  
> that
> GpioInt fail.

I’ve filed a bug here but we don’t find any proper solution:
https://bugzilla.kernel.org/show_bug.cgi?id=201311

Kai-Heng


  reply	other threads:[~2019-04-03  9:24 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <LaQHUFs--3-1@tutanota.com>
2019-03-20 14:37 ` [PATCH] ELAN touchpad i2c_hid bugs fix Benjamin Tissoires
2019-03-20 15:39   ` Hans de Goede
2019-03-20 16:53     ` Kai-Heng Feng
2019-03-20 17:18       ` Andy Shevchenko
2019-03-21  4:08         ` Kai-Heng Feng
2019-03-21  8:55           ` Andy Shevchenko
2019-03-21  9:28             ` Kai Heng Feng
2019-03-21  8:57           ` Hans de Goede
2019-03-21  9:48           ` Andy Shevchenko
2019-04-01 21:37             ` Mario.Limonciello
2019-04-01 21:37               ` Mario.Limonciello
2019-04-02  4:18               ` Kai Heng Feng
2019-04-02 14:08                 ` Mario.Limonciello
2019-04-02 14:08                   ` Mario.Limonciello
2019-04-03  9:24                   ` Kai-Heng Feng [this message]
2019-03-20 17:11   ` Andy Shevchenko
     [not found] ` <LaUpAlT--3-1@tutanota.com>
     [not found]   ` <LaeGPSe--3-1@tutanota.com>
2019-03-24 12:27     ` Hans de Goede
     [not found]       ` <LakgsCJ--3-1@tutanota.com>
2019-03-24 18:37         ` Hans de Goede
2019-03-24 19:10 Vladislav Dalechyn
2019-03-25  9:23 ` Benjamin Tissoires
2019-03-25 12:57 Vladislav Dalechyn
2019-03-25 16:02 ` Dmitry Torokhov
2019-03-25 16:38   ` Hans de Goede
2019-03-25 16:56     ` Dmitry Torokhov
     [not found]       ` <Laq4ykv--3-1@tutanota.com>
2019-03-25 18:30         ` Dmitry Torokhov
2019-03-29 12:18       ` Hans de Goede
2019-03-29 18:23         ` Dmitry Torokhov
2019-04-01 12:26           ` 廖崇榮
2019-04-01 12:26             ` 廖崇榮
     [not found]         ` <LbI7kio--3-1@tutanota.com>
2019-04-03 11:18           ` Hans de Goede
     [not found]             ` <LbZjy9p--3-1@tutanota.com>
2019-04-11 16:17               ` Kai-Heng Feng
     [not found]                 ` <LcKqhgD--3-1@tutanota.com>
2019-04-13  8:42                   ` Kai-Heng Feng
     [not found]                     ` <LcVmBjG--3-1@tutanota.com>
2019-04-15 11:42                       ` Hans de Goede
2019-04-16  3:59                         ` Kai-Heng Feng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3E46D2D1-EADC-4F77-8091-A36E648C4908@canonical.com \
    --to=kai.heng.feng@canonical.com \
    --cc=Mario.Limonciello@dell.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=bigeasy@linutronix.de \
    --cc=dtor@chromium.org \
    --cc=hdegoede@redhat.com \
    --cc=hotwater438@tutanota.com \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=swboyd@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.