From: Thierry Reding <treding@nvidia.com>
To: Tony Lindgren <tony@atomide.com>
Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>,
Belisko Marek <marek.belisko@gmail.com>,
LKML <linux-kernel@vger.kernel.org>, <linux-omap@vger.kernel.org>,
"Dr. H. Nikolaus Schaller" <hns@goldelico.com>,
Laxman Dewangan <ldewangan@nvidia.com>,
Jon Hunter <jonathanh@nvidia.com>
Subject: Re: omap5 fixing palmas IRQ_TYPE_NONE warning leads to gpadc timeouts
Date: Mon, 26 Nov 2018 11:14:35 +0100 [thread overview]
Message-ID: <20181126101434.GB10878@ulmo> (raw)
In-Reply-To: <20181119171406.GQ53235@atomide.com>
[-- Attachment #1: Type: text/plain, Size: 3876 bytes --]
On Mon, Nov 19, 2018 at 09:14:06AM -0800, Tony Lindgren wrote:
> Hi,
>
> * Tony Lindgren <tony@atomide.com> [181119 16:19]:
> > * Peter Ujfalusi <peter.ujfalusi@ti.com> [181119 10:16]:
> > > On 2018-11-13 20:06, Tony Lindgren wrote:
> > > > Looks like the IRQ_TYPE_NONE issue still is there for omap5 and
> > > > should be fixed with IRQ_TYPE_HIGH.
> > > >
> > > > No idea about why palmas interrupts would stop working though,
> > > > Peter, do you have any ideas on this one?
> > >
> > > No, I don't.
> > > The INT polarity can be changed in Palmas.
> > > based on the pdata->irq_flags (queried via irqd_get_trigger_type())
> > > the code configures it:
> > >
> > > if (pdata->irq_flags & IRQ_TYPE_LEVEL_HIGH)
> > > reg = PALMAS_POLARITY_CTRL_INT_POLARITY;
> > > else
> > > reg = 0;
> > >
> > > and we pass the same irq_flags to the regmap_add_irq_chip()
> > > IRQ_TYPE_LEVEL_HIGH == IRQF_TRIGGER_HIGH == 0x00000004
> > >
> > > A change in DT should be enough, no need to patch palmas.c, imho.
> >
> > But it's not. I'm now wondering if wakeupgen is inverting the
> > polarity for this interrupt?
> >
> > GIC docs say this about SPI interrupts:
> >
> > "SPI is triggered on a rising edge or is active-HIGH level-sensitive."
> >
> > So when setting IRQ_TYPE_LEVEL_HIGH in dts, we still must not
> > invert the polarity in palmas while tegra needs to. So either
> > tegra114 hardware is inverting the polarity, or omap5 wakeupgen
> > is.
> >
> > Does the palmas trm say which way PALMAS_POLARITY_CTRL
> > triggers if PALMAS_POLARITY_CTRL_INT_POLARITY is set?
> >
> > Also note that dra7 is using a gpio for palmas interrupt.
>
> Well so commit 7e9d474954f4 ("ARM: tegra: Correct polarity for
> Tegra114 PMIC interrupt") states that tegra114 inverts the
> polarity of the PMIC interrupt. So adding Jon and Thierry to Cc.
>
> So it seems that commit df545d1cd01a ("mfd: palmas: Provide
> irq flags through DT/platform data") wrongly sets the
> PALMAS_POLARITY_CTRL_INT_POLARITY on IRQ_TYPE_LEVEL_HIGH
> while it should set it on IRQ_TYPE_LEVEL_LOW.
Oops, sorry, you seem to have come to pretty much the same conclusion as
I did. I think what we need to do is find a copy of the TRM and see what
exactly the right behaviour is. Or we need to find someone that can take
measurements of the PMIC interrupt pin.
I was unable to find a working link to a copy of the Palmas TRM. Laxman,
do you know of an internal location where we may have a copy?
> I think the fix needs to set the polarity using
> of_machine_is_compatible() and probably also add a new
> compatible to palmas.c for "ti,palmas-tegra114" to properly
> deal with the inverted interrupt. Or add a property for
> "interrupt-inverted". In any case, it seems that the
> of_machine_is_compatible() is also needed too to avoid
> breaking use with dtb files.
>
> Jon & Thierry, can you guys please check and confirm this?
I'm not sure we need to go to those lengths. As far as I'm concerned, if
it turns out that we've inverted the logic for Tegra114, that's a bug in
the DTS and we should fix it along with the driver to remove the double
negation. I don't think this would be causing any problems with existing
DTBs since, as far as I can tell, the TPS65913 is only used on Dalmore
(which was never publicly available) or Roth and TN7, neither of which I
think anyone ever ran upstream Linux on other than maybe Alex who added
the support. In all of the above cases, there is no problem updating the
DTB since it's all loaded either from eMMC or from an Android boot image
as far as I understand.
But again, I think we need to make sure to get this right, so we need to
find an authoritative source that tells us what exactly the polarity is,
so that we avoid revisiting this a few years down the road.
Thierry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2018-11-26 10:14 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-20 16:37 omap5 fixing palmas IRQ_TYPE_NONE warning leads to gpadc timeouts Belisko Marek
2018-07-03 8:45 ` Tony Lindgren
2018-07-03 18:31 ` Belisko Marek
2018-11-13 18:06 ` Tony Lindgren
2018-11-14 17:03 ` Tony Lindgren
2018-11-14 17:26 ` Tony Lindgren
2018-11-19 10:18 ` Peter Ujfalusi
2018-11-19 16:19 ` Tony Lindgren
2018-11-19 17:14 ` Tony Lindgren
2018-11-20 11:14 ` Jon Hunter
2018-11-23 16:48 ` Tony Lindgren
2018-11-26 9:36 ` Thierry Reding
2018-11-26 9:49 ` Peter Ujfalusi
2018-11-26 10:25 ` Thierry Reding
2018-11-26 19:32 ` Tony Lindgren
2018-11-26 20:17 ` Jon Hunter
2018-11-27 17:55 ` Tony Lindgren
2018-11-27 18:17 ` Tony Lindgren
2018-11-26 10:13 ` Jon Hunter
2018-11-20 12:22 ` Laxman Dewangan
2018-11-26 10:14 ` Thierry Reding [this message]
2018-11-26 19:14 ` Tony Lindgren
2018-11-26 19:19 ` Santosh Shilimkar
2018-11-27 18:03 ` Tony Lindgren
2018-11-20 7:36 ` Peter Ujfalusi
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=20181126101434.GB10878@ulmo \
--to=treding@nvidia.com \
--cc=hns@goldelico.com \
--cc=jonathanh@nvidia.com \
--cc=ldewangan@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=marek.belisko@gmail.com \
--cc=peter.ujfalusi@ti.com \
--cc=tony@atomide.com \
/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