devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@secretlab.ca>
To: Javier Martinez Canillas <javier.martinez@collabora.co.uk>,
	Rob Herring <robherring2@gmail.com>
Cc: Jon Hunter <jon-hunter@ti.com>,
	Stephen Warren <swarren@nvidia.com>,
	devicetree-discuss@lists.ozlabs.org,
	Rob Herring <rob.herring@calxeda.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-omap <linux-omap@vger.kernel.org>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/1] of/irq: store IRQ trigger/level in struct resource flags
Date: Thu, 06 Jun 2013 00:26:47 +0100	[thread overview]
Message-ID: <20130605232647.55C8B3E10E4@localhost> (raw)
In-Reply-To: <51634835.5010302@collabora.co.uk>

On Tue, 09 Apr 2013 00:44:05 +0200, Javier Martinez Canillas <javier.martinez@collabora.co.uk> wrote:
> On 04/09/2013 12:05 AM, Rob Herring wrote:
> > On 04/05/2013 02:48 AM, Javier Martinez Canillas wrote:
> >> This means that drivers that need the IRQ type/level flags defined in
> >> the DT won't be able to get it.
> > 
> > But the interrupt controllers that need the information should be able
> > to get to it via irqd_get_trigger_type. What problem exactly are you
> > trying to fix? What driver would use this?
> >
> 
> Yes but this is not about the interrupt controller wanting this information but
> a device driver that is using the IORESOURCE_IRQ struct resource that has the
> information about the virtual IRQ associated with a GPIO-IRQ.
> 
> The driver doesn't know neither care if its IRQ line is connected to a line of
> an real IRQ controller or to a GPIO controller that allows a GPIO line to be
> used as an IRQ.
> 
> > My understanding of the IORESOURCE_IRQ_xxx (and DMA) bits are they are
> > ISA specific and therefore should not be used on non-ISA buses.
> > 
> 
> Many TI OMAP2+ SoC based boards have an SMSC LAN911x/912x controller
> (drivers/net/ethernet/smsc/smsc911x.c) that is connected to the OMAP processor
> through its General-Purpose Memory Controller (GPMC) and this LAN driver obtain
> its IRQ and I/O address space from a struct resource IORESOURCE_IRQ and
> IORESOURCE_MEM respectively, that is filled by the DeviceTree core.
> 
> It does this:
> 
> irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
> irq_flags = irq_res->flags & IRQF_TRIGGER_MASK;
> 
> Since of_irq_to_resource() doesn't fill the trigger/level flags on the
> IORESOURCE_IRQ struct resource, irq_flags will always be 0 regarding the value
> specified on the second cell of the "interrupts" DT property.
> 
> A previous discussion about this can be found here [1].

I can't remember if there was ever a reason for not returning the IRQ
flags, but I don't have any major objection to doing so if drivers find
them useful. The one concern I do have however is if it will cause any
problems with drivers that expect flags == IORESOURCE_IRQ without any
additional flags. Any users doing that are buggy anyway, but I do want
to be careful about breakage.

I'll go over your patch and reply with comments.

g.


  reply	other threads:[~2013-06-05 23:26 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-05  7:48 [PATCH 1/1] of/irq: store IRQ trigger/level in struct resource flags Javier Martinez Canillas
2013-04-08 22:05 ` Rob Herring
2013-04-08 22:16   ` Stephen Warren
2013-04-08 22:56     ` Javier Martinez Canillas
2013-04-09  2:45       ` Rob Herring
2013-04-09  8:26         ` Javier Martinez Canillas
2013-04-09  8:28           ` Javier Martinez Canillas
2013-04-18 12:17         ` Javier Martinez Canillas
2013-04-08 22:44   ` Javier Martinez Canillas
2013-06-05 23:26     ` Grant Likely [this message]
2013-06-06  8:00       ` Javier Martinez Canillas
2013-06-06  8:50       ` Jean-Christophe PLAGNIOL-VILLARD
2013-06-06  9:13         ` Javier Martinez Canillas
2013-06-06  9:58         ` Tomasz Figa
2013-06-05 23:34 ` Grant Likely
2013-06-06  8:47   ` Javier Martinez Canillas

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=20130605232647.55C8B3E10E4@localhost \
    --to=grant.likely@secretlab.ca \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=javier.martinez@collabora.co.uk \
    --cc=jon-hunter@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=rob.herring@calxeda.com \
    --cc=robherring2@gmail.com \
    --cc=swarren@nvidia.com \
    --cc=tglx@linutronix.de \
    /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).