From: Jonathan Cameron <jic23@kernel.org>
To: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
linux-iio@vger.kernel.org, Hartmut Knaack <knaack.h@gmx.de>,
Lars-Peter Clausen <lars@metafoo.de>,
Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
Linus Walleij <linus.walleij@linaro.org>,
linux-acpi@vger.kernel.org, linux-gpio@vger.kernel.org
Subject: Re: [PATCH v3 1/5] iio: proximity: sx9500: Assign interrupt from GpioIo()
Date: Sat, 25 Nov 2017 14:28:39 +0000 [thread overview]
Message-ID: <20171125142839.07d13031@archlinux> (raw)
In-Reply-To: <20171120103027.GA22431@lahna.fi.intel.com>
On Mon, 20 Nov 2017 12:30:27 +0200
Mika Westerberg <mika.westerberg@linux.intel.com> wrote:
> On Sun, Nov 19, 2017 at 03:24:11PM +0000, Jonathan Cameron wrote:
> > On Mon, 6 Nov 2017 11:35:56 +0200
> > Mika Westerberg <mika.westerberg@linux.intel.com> wrote:
> >
> > > On Sat, Nov 04, 2017 at 03:11:19AM +0000, Jonathan Cameron wrote:
> > > > On Fri, 3 Nov 2017 15:03:36 +0200
> > > > Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
> > > >
> > > > > The commit 0f0796509c07
> > > > >
> > > > > ("iio: remove gpio interrupt probing from drivers that use a single
> > > > > interrupt")
> > > > >
> > > > > removed custom IRQ assignment for the drivers which are enumerated via
> > > > > ACPI or OF. Unfortunately, some ACPI tables have IRQ line defined as
> > > > > GpioIo() resource and thus automatic IRQ allocation will fail.
> > > >
> > > > I'll ask the obvious question - is this allowed under the ACPI spec?
> > >
> > > Yes, it is perfectly fine.
> >
> > I'm unconvinced...
> >
> > >
> > > > > Partially revert the commit 0f0796509c07 to restore original
> > > > > behaviour.
> > > > >
> > > > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > > >
> > > > I really don't like scattering fixes for broken ACPI tables through
> > > > drivers... Is there really no better solution to this?
> > >
> > > This is not about broken ACPI tables. We just currently have
> > > "convenience" stuff in the kernel that translates trivial things like a
> > > single ACPI GpioInt() resource directly to a device interrupt. If the
> > > table has multiple GpioInt()s or uses GpioIo() then it is up to the
> > > driver to handle device specific details.
> >
> > I agree on the multiple cases needing hanlding.
> > What bothers me is that there is no guarantee at all that a GpioIo
> > can even do an interrupt.
> >
> > (table 6.2.17 in the 6.1 spec for example makes it clear that we are
> > in a mess) If it is a gpioio lots of the interrupt specific stuff
> > cannot be supplied (all the stuff in byte 7)
> >
> > So as I read the ACPI specification any interrupt specified as GpioIO
> > is simply broken.
>
> Well, it is the same with DT if you just declare GPIOs as in "xxx-gpios"
> but still use them to trigger interrupts.
>
> Normally you would use GpioInt in ACPI case but sometimes there might
> actually be need to use the GPIO as input/output without interrupts. I
> remember there was some I2C connected touchpanel that required some
> magic to be done when it was put to low power states. In those cases
> GpioIo is more correct IMHO.
>
> It is also possible that the BIOS people just messed this up.
>
> > > > On patches like this best to pull in ACPI and GPIO on the cc list.
> > > >
> > > > Also cc'd Mika who made the original change to support gpioint.
> > >
> > > The patch looks fine to me,
> > >
> > > Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> >
> > I'll probably take it anyway to support the platforms doing this particular
> > piece of fun as doubtlessly the chance of fixing the firmware is next
> > to nothing...
>
> Thanks!
Not sure I actually replied to say I had applied this one to the fixes-togreg
branch of iio.git. I certainly hadn't marked it as such locally and
just tried to apply it again ;)
Thanks,
Jonathan
next prev parent reply other threads:[~2017-11-25 14:28 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20171103130340.42459-1-andriy.shevchenko@linux.intel.com>
2017-11-04 3:11 ` [PATCH v3 1/5] iio: proximity: sx9500: Assign interrupt from GpioIo() Jonathan Cameron
2017-11-04 10:43 ` Linus Walleij
[not found] ` <20171104031119.00006e56-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2017-11-06 9:35 ` Mika Westerberg
2017-11-19 15:24 ` Jonathan Cameron
2017-11-20 10:30 ` Mika Westerberg
2017-11-25 14:28 ` Jonathan Cameron [this message]
[not found] ` <20171103130340.42459-2-andriy.shevchenko@linux.intel.com>
[not found] ` <20171103130340.42459-2-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2017-11-04 3:14 ` [PATCH v3 2/5] iio: proximity: sx9500: Add GPIO ACPI mapping table Jonathan Cameron
2017-11-19 15:29 ` Jonathan Cameron
2017-11-25 14:24 ` Jonathan Cameron
2017-11-27 15:08 ` Andy Shevchenko
[not found] ` <1511795292.25007.454.camel-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2017-12-01 10:04 ` Linus Walleij
2017-12-01 12:36 ` Andy Shevchenko
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=20171125142839.07d13031@archlinux \
--to=jic23@kernel.org \
--cc=Jonathan.Cameron@huawei.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linus.walleij@linaro.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=pmeerw@pmeerw.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).