From: Felipe Balbi <balbi@ti.com>
To: Kevin Hilman <khilman@ti.com>
Cc: "Poddar, Sourav" <sourav.poddar@ti.com>,
"DebBarma, Tarun Kanti" <tarun.kanti@ti.com>,
lo <linux-omap@vger.kernel.org>,
Santosh Shilimkar <santosh.shilimkar@ti.com>,
Benoit Cousson <b-cousson@ti.com>,
linux-kernel@vger.kernel.org, Felipe Balbi <balbi@ti.com>
Subject: Re: [GPIO] Crashed when not using
Date: Tue, 31 Jul 2012 09:43:51 +0300 [thread overview]
Message-ID: <20120731064350.GD6004@arwen.pp.htv.fi> (raw)
In-Reply-To: <87fw89gf4w.fsf@ti.com>
[-- Attachment #1: Type: text/plain, Size: 2017 bytes --]
Hi,
On Mon, Jul 30, 2012 at 01:36:47PM -0700, Kevin Hilman wrote:
<little trimming>
> >>> The device tree data for acquiring the above GPIO interrupt line looks
> >>> like this.
> >>>
> >>> +++ linux-omap-storage/arch/arm/boot/dts/omap5-evm.dts 2012-07-30
> >>> 14:11:08.931694001 +0530
> >>> @@ -42,7 +42,8 @@
> >>> tsl2771@39 {
> >>> compatible = "taos,tsl2771";
> >>> reg = <0x39>;
> >>> + interrupt-parent = <&gpio5>;
> >>> + interrupts = <21>; /* gpio line 149 */
> >>> };
> >>> };
> >>>
> >>> Note: using "gpio_request_one" in the driver solves the issue.
> >>> Is using this api in the driver required?
> >>> Any pointer on the above crash?
> >>
> > Hi Tarun,
> >> Any user/client driver of GPIO is supposed to go through
> >> gpio_request() API so that module clock
> >> is enabled correctly. Overriding of APIs would put the power
> >> management state machine in jeopardy.
> >> --
> > I tried putting "pm_runtime_get_sync" in gpio_irq_type api where the kernel
> > is crashing and the crash is no longer observed. So indeed, its about
> > enabling clocks.
> >
> > One doubt: Can't we put runtime apis in "gpio_irq_type" and eliminate
> > the use of
> > "gpio_request_one"??
>
> No.
>
> You must use the GPIO requiest/free APIs to tell the GPIO core that
> the GPIO line is in use.
>
> Why do you want to avoid using gpio_request/gpio_free?
Then how do we differentiate from a driver perspective if e.g.
client->irq (for I2C client drivers) refers to a pin on a GPIO
controller or a real interrupt when running with DT ?
Having something like:
#interrupt-parent = &<gpio5>;
interrupts = <21>;
would already give me the correct IRQ number from the driver, now how do
we differentiate the interrupt parents ? There's no way to do that from
a driver perspective, so DT core has to either do it, or provide means
for drivers to detect it themselves.
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
prev parent reply other threads:[~2012-07-31 6:47 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-30 8:43 Poddar, Sourav
2012-07-30 9:34 ` DebBarma, Tarun Kanti
2012-07-30 11:15 ` Poddar, Sourav
2012-07-30 20:36 ` Kevin Hilman
2012-07-30 22:37 ` Shilimkar, Santosh
2012-07-31 4:53 ` Poddar, Sourav
2012-07-31 6:52 ` Felipe Balbi
2012-07-31 12:32 ` Shilimkar, Santosh
2012-07-31 12:32 ` Felipe Balbi
2012-07-31 12:56 ` Poddar, Sourav
2012-08-06 5:46 ` Shilimkar, Santosh
2012-07-31 6:43 ` Felipe Balbi [this message]
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=20120731064350.GD6004@arwen.pp.htv.fi \
--to=balbi@ti.com \
--cc=b-cousson@ti.com \
--cc=khilman@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=santosh.shilimkar@ti.com \
--cc=sourav.poddar@ti.com \
--cc=tarun.kanti@ti.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
Powered by JetHome