From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Hans de Goede <hdegoede@redhat.com>,
Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
"russianneuromancer @ ya . ru" <russianneuromancer@ya.ru>,
Gregor Riepl <onitake@gmail.com>,
linux-input@vger.kernel.org,
Linus Walleij <linus.walleij@linaro.org>
Subject: Re: [PATCH v2] Input: silead - Do not try to directly access the GPIO when using ACPI pm
Date: Mon, 13 Feb 2017 13:00:49 +0200 [thread overview]
Message-ID: <1486983649.2133.453.camel@linux.intel.com> (raw)
In-Reply-To: <3f433773-27ba-8d07-3209-6df71d6d4b33@redhat.com>
On Sun, 2017-02-12 at 11:40 +0100, Hans de Goede wrote:
> Hi,
>
> On 10-02-17 12:52, Hans de Goede wrote:
> > Hi,
> >
> > On 02-02-17 14:12, Mika Westerberg wrote:
> > > On Thu, Feb 02, 2017 at 01:50:58PM +0100, Hans de Goede wrote:
> > > > Hi,
> > > >
> > > > On 02-02-17 13:32, Mika Westerberg wrote:
> > > > > On Thu, Feb 02, 2017 at 02:10:18PM +0200, Mika Westerberg
> > > > > wrote:
> > > > > > I do not have a copy of the patch in this thread but sounds
> > > > > > like
> > > > > > something that might work.
> > > > >
> > > > > Actually, I seem have a copy of that patch.
> > > > >
> > > > > So you are saying that the device has a power GPIO in ACPI
> > > > > _CRS but it
> > > > > should not be used for some reason?
> > > >
> > > > Method (_CRS, 0, NotSerialized) // _CRS:
> > > > Current Resource Setti
> > > > {
> > > > Name (WBUF, ResourceTemplate ()
> > > > {
> > > > I2cSerialBusV2 (0x0040,
> > > > ControllerInitiated, 0x00061A80,
> > > > AddressingMode7Bit,
> > > > "\\_SB.PCI0.I2C6",
> > > > 0x00, ResourceConsumer, , Exclusive,
> > > > )
> > > > GpioIo (Exclusive, PullDefault, 0x0000,
> > > > 0x0000, IoRestri
> > > > "\\_SB.GPO1", 0x00,
> > > > ResourceConsumer, ,
> > > > )
> > > > { // Pin list
> > > > 0x0019
> > > > }
> > > > GpioInt (Edge, ActiveHigh, Shared,
> > > > PullDefault, 0x0000,
> > > > "\\_SB.GPO1", 0x00,
> > > > ResourceConsumer, ,
> > > > )
> > > > { // Pin list
> > > > 0x0013
> > > > }
> > > > })
> > > > Return (WBUF) /*
> > > > \_SB_.PCI0.I2C6.TCS4._CRS.WBUF */
> > > > }
> > > >
> > > > The setting of the special bit in the gpio control register
> > > > leads to
> > > > drivers/pinctrl/intel/pinctrl-cherryview.c
> > > > chv_gpio_request_enable()
> > > > returning -EBUSY, which in return makes gpiod_get_optional
> > > > return -EBUSY for this pin, rather then NULL (as we would like).
> > >
> > > Actually what is wrong here is that your gpiod_get(dev, "power")
> > > falls
> > > back to use plain indexes and returns the first GPIO even though
> > > it
> > > should not as the driver specifically requests GPIO with name
> > > "power"
> > > and there is no _DSD.
> > >
> > > Andy (Cc'd) has a patch that tries to make the fallback mechanism
> > > more
> > > stricter which should in theory fix the problem as well. The patch
> > > series is here:
> > >
> > > https://bitbucket.org/andy-shev/linux/commits/338c0226b631b8b497d1
> > > 43070a301d8b8883c349?at=master
> >
> > Ok, that patches fixes the issues I was seeing with the silead
> > driver
> > on my cube iwork8 air cherrytrail tablet.
>
> But unfortunately it causes regressions for drivers which actually use
> gpiod_get_by_index, e.g. drivers/extcon/extcon-intel-int3496.c, which
> does:
>
> data->gpio_usb_id = devm_gpiod_get_index(dev, "id",
> INT3496_GPIO_USB_ID,
> GPIOD_IN);
>
> Where GPIOD_IN is 0, (it also gets gpios for index 1 and 2), I guess
> this driver can be fixed by replacing "id" with NULL, but the name
> gets used in things like /sys/kernel/debug/gpio and is actually
> useful there, so it looks like that patch from Andy needs some
> work so as to not see getting by index as an undesirable fallback
> while the driver is actually doing a request gpio by index.
Yes, this part is missed. We would like to introduce a flag for that to
encourage drivers to fix this mess by adding compatible lookup table.
--
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy
next prev parent reply other threads:[~2017-02-13 11:01 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-22 20:00 [PATCH v2] Input: silead - Do not try to directly access the GPIO when using ACPI pm Hans de Goede
2017-01-22 22:20 ` Dmitry Torokhov
2017-01-23 10:05 ` Hans de Goede
2017-02-01 17:42 ` Dmitry Torokhov
2017-02-02 10:41 ` Mika Westerberg
2017-02-02 11:57 ` Hans de Goede
2017-02-02 12:10 ` Mika Westerberg
2017-02-02 12:32 ` Mika Westerberg
2017-02-02 12:50 ` Hans de Goede
2017-02-02 13:12 ` Mika Westerberg
2017-02-02 13:27 ` Hans de Goede
2017-02-02 13:44 ` Mika Westerberg
2017-02-02 13:55 ` Hans de Goede
2017-02-02 14:18 ` Mika Westerberg
2017-02-02 14:24 ` Gregor Riepl
2017-03-14 10:21 ` Linus Walleij
2017-03-14 11:07 ` Hans de Goede
2017-03-14 13:09 ` Andy Shevchenko
2017-03-14 18:12 ` Gregor Riepl
2017-02-10 11:52 ` Hans de Goede
2017-02-10 13:02 ` Mika Westerberg
2017-02-12 10:40 ` Hans de Goede
2017-02-13 11:00 ` Andy Shevchenko [this message]
2017-02-22 15:52 ` Andy Shevchenko
2017-02-23 14:19 ` Hans de Goede
2017-03-02 11:38 ` Andy Shevchenko
2017-03-02 15:34 ` Hans de Goede
2017-03-03 14:57 ` Andy Shevchenko
2017-03-03 15:19 ` Hans de Goede
2017-03-03 15:23 ` Andy Shevchenko
2017-03-06 9:31 ` Hans de Goede
2017-03-07 11:51 ` Andy Shevchenko
2017-03-07 13:55 ` Hans de Goede
2017-03-08 9:08 ` Hans de Goede
2017-03-08 10:30 ` Andy Shevchenko
2017-03-08 11:27 ` Hans de Goede
2017-03-08 11:46 ` Andy Shevchenko
2017-03-08 17:01 ` Andy Shevchenko
2017-03-08 17:08 ` Hans de Goede
2017-03-08 17:14 ` Andy Shevchenko
2017-03-08 17:05 ` Hans de Goede
2017-03-08 18:25 ` Andy Shevchenko
2017-03-09 13:57 ` Hans de Goede
2017-03-09 14:03 ` Andy Shevchenko
2017-03-09 14:45 ` Hans de Goede
2017-03-09 15:03 ` Andy Shevchenko
2017-03-09 15:40 ` Hans de Goede
2017-03-09 18:48 ` Hans de Goede
2017-03-09 21:32 ` Dmitry Torokhov
2017-03-10 10:35 ` Mika Westerberg
2017-03-10 11:33 ` Andy Shevchenko
2017-03-10 11:58 ` Andy Shevchenko
2017-03-10 20:49 ` Hans de Goede
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=1486983649.2133.453.camel@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=dmitry.torokhov@gmail.com \
--cc=hdegoede@redhat.com \
--cc=linus.walleij@linaro.org \
--cc=linux-input@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=onitake@gmail.com \
--cc=russianneuromancer@ya.ru \
/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.