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>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAKdAkRQxh=mG7eMxCCWHRE09brpDY5MYdqsCeOT3TOmw3woS2A@mail.gmail.com>
Date:	Thu, 24 Mar 2016 10:41:16 -0700
From:	Dmitry Torokhov <dmitry.torokhov@...il.com>
To:	Mika Westerberg <mika.westerberg@...ux.intel.com>
Cc:	Linus Walleij <linus.walleij@...aro.org>,
	Alexandre Courbot <gnurou@...il.com>,
	"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
	"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
	lkml <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] gpio / ACPI: ignore GpioInt() GPIOs when requesting GPIO_OUT_*

On Thu, Mar 24, 2016 at 7:01 AM, Mika Westerberg
<mika.westerberg@...ux.intel.com> wrote:
> On Wed, Mar 23, 2016 at 03:58:31PM -0700, Dmitry Torokhov wrote:
>> From: Dmitry Torokhov <dtor@...omium.org>
>>
>> When firmware does not use _DSD properties that allow properly name GPIO
>> resources, the kernel falls back on parsing _CRS resources, and will
>> return entries described as GpioInt() as general purpose GPIOs even
>> though they are meant to be used simply as interrupt sources for the
>> device:
>>
>> Device (ETSA)
>> {
>>       Name (_HID, "ELAN0001")
>>       ...
>>
>>       Method(_CRS, 0x0, NotSerialized)
>>       {
>>               Name(BUF0,ResourceTemplate ()
>>               {
>>                       I2CSerialBus(
>>                               0x10,                     /* SlaveAddress */
>>                               ControllerInitiated,      /* SlaveMode */
>>                               400000,                   /* ConnectionSpeed */
>>                               AddressingMode7Bit,       /* AddressingMode */
>>                               "\\_SB.I2C1",             /* ResourceSource */
>>                       )
>>                       GpioInt (Edge, ActiveLow, ExclusiveAndWake, PullNone,,
>>                                "\\_SB.GPSW") { BOARD_TOUCH_GPIO_INDEX }
>>               } )
>>               Return (BUF0)
>>       }
>> ...
>> }
>>
>> This gives troubles with drivers such as Elan Touchscreen driver
>> (elants_i2c) that uses devm_gpio_get to look up "reset" GPIO line and
>> decide whether the driver is responsible for powering up and resetting
>> the device or firmware is. In the above case the lookup succeeds, we map
>> GPIO as output and later fail to request client->irq interrupt that is
>> mapped to the same GPIO.
>>
>> Let's ignore resources described as GpioInt() when requesting output
>> GPIO (but allow them when requesting GPIOD_ASIS or GPIOD_IN as some
>> drivers - i2c-hid - do request GPIO as input and then map it to
>> interrupt with gpiod_to_irq).
>
> You could mention here that we only ignore GpioInt() resources in
> fallback case.

I thought I did that (in the first paragraph). Let me try to reword
better and resend.

>
>> BUG=chrome-os-partner:51154
>> TEST=Boot Cyan, verify touchscreen work
>>
>> Change-Id: Id20c730b937dce8a4135d2b64c8d798372d20e82
>
> This is not needed for mainline patches :)

Ugh, sorry, I forgot to cut this stuff out...

>
>> Signed-off-by: Dmitry Torokhov <dtor@...omium.org>
>
> Acked-by: Mika Westerberg <mika.westerberg@...ux.intel.com>

Thanks.

-- 
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ