All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Brian Starkey <brian.starkey@arm.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Marc Zyngier <marc.zyngier@arm.com>,
	Tomasz Figa <tomasz.figa@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	Frank Rowand <frowand.list@gmail.com>,
	Grant Likely <grant.likely@linaro.org>,
	devicetree@vger.kernel.org
Subject: Re: [PATCH] genirq: fix trigger flags check for shared irqs
Date: Thu, 28 Jan 2016 12:49:37 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.11.1601281238110.3886@nanos> (raw)
In-Reply-To: <20160128111041.GB12884@e106950-lin.cambridge.arm.com>

On Thu, 28 Jan 2016, Brian Starkey wrote:
> I've got a few devices on the same interrupt line. One driver does

Just for the record: When will hardware folks finally understand that shared
interrupt lines are a nightmare?

> something along these lines:
> 
> 	res = platform_get_resource(dev, IORESOURCE_IRQ, 0);
> 	flags = (res->flags & IRQF_TRIGGER_MASK) | IRQF_SHARED;
> 	request_irq(res->start, handler, flags, "name", dev);
> 
> This seems pretty reasonable. The problem is since 4a43d686fe33:
>    of/irq: Pass trigger type in IRQ resource flags[1]
> the trigger type information from device-tree is in res->flags.
> 
> So when the other drivers don't pass in any flags, they fail the check
> in __setup_irq().
> 
> Changing the former driver to remove the flags doesn't seem right, and
> adding flags to the latter would imply adding flags to _every_ driver,
> which is an awful lot to change - and I'm not sure it would be possible
> and/or effective in all cases.

So that commit does:

   r->flags = IORESOURCE_IRQ | irqd_get_trigger_type(irq_get_irq_data(irq));

which reads the current setting of the interrupt line.

Now we pass exactly that to request_irq(). So first irq_of_parse_and_map()
configures the interrupt type when mapping it and then hands in the same type
information when requesting the irq.

I have no idea what the purpose of this is and the changelog of that commit is
completely useless, sigh!

I've cc'ed the author and the device tree folks. Perhaps are they able to
explain what this commit tries to 'fix'.

Thanks,

	tglx

  reply	other threads:[~2016-01-28 11:50 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-26 10:31 [PATCH] genirq: fix trigger flags check for shared irqs Brian Starkey
2016-01-26 20:45 ` Thomas Gleixner
2016-01-28  9:59   ` Brian Starkey
2016-01-28 10:29     ` Thomas Gleixner
2016-01-28 11:10       ` Brian Starkey
2016-01-28 11:49         ` Thomas Gleixner [this message]
2016-01-28 12:22           ` Brian Starkey
2016-01-28 12:22             ` Brian Starkey
2016-01-28 13:37             ` Thomas Gleixner
2016-01-28 13:37               ` Thomas Gleixner
2016-02-08 11:02               ` Brian Starkey
2016-02-08 11:02                 ` Brian Starkey
2016-01-28 15:58           ` Rob Herring
2016-01-28 15:58             ` Rob Herring
2016-01-28 20:06             ` Thomas Gleixner
2016-01-29  4:17               ` Tomasz Figa
2016-01-29  4:17                 ` Tomasz Figa

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=alpine.DEB.2.11.1601281238110.3886@nanos \
    --to=tglx@linutronix.de \
    --cc=brian.starkey@arm.com \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=grant.likely@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=tomasz.figa@gmail.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 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.