Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1320491

Re: [PATCH] genirq: fix trigger flags check for shared irqs

Path csiph.com!news.freedyn.net!aioe.org!gothmog.csi.it!bofh.it!news.nic.it!robomod
From Brian Starkey <brian.starkey@arm.com>
Newsgroups linux.kernel
Subject Re: [PATCH] genirq: fix trigger flags check for shared irqs
Date Thu, 28 Jan 2016 11:10:02 +0100
Message-ID <qVRGy-1R3-3@gated-at.bofh.it> (permalink)
References <qV9cu-2Od-19@gated-at.bofh.it> <qViIN-1ad-5@gated-at.bofh.it>
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii; format=flowed
Content-Disposition inline
User-Agent Mutt/1.5.21 (2010-09-15)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 43
Organization linux.* mail to news gateway
X-Original-Cc linux-kernel@vger.kernel.org, marc.zyngier@arm.com
X-Original-Date Thu, 28 Jan 2016 09:59:56 +0000
X-Original-Message-ID <20160128095955.GA12884@e106950-lin.cambridge.arm.com>
X-Original-References <96c068ece0f5d01fc85bdbd9e0798f68180eebb8.1453204950.git.brian.starkey@arm.com> <alpine.DEB.2.11.1601262142450.3886@nanos>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1320491

Show key headers only | View raw


Hi Thomas,

Thanks for taking a look at this.

On Tue, Jan 26, 2016 at 09:45:32PM +0100, Thomas Gleixner wrote:
>On Tue, 26 Jan 2016, Brian Starkey wrote:
>
>> For shared interrupts, if one requester passes in any IRQF_TRIGGER_*
>> flags whilst another doesn't, __setup_irq() can erroneously fail.
>>
>> The no-flags case should be treated as "already configured", so change
>> __setup_irq() to only check that the flags match if any have been
>> provided.
>
>What happens if that "already configured", i.e. the default setting, is
>conflicting with the newly requested interrupt?
>
>I rather prefer the failure than the resulting silent wreckage.
>

Yes, I agree that would be best avoided. It seems to me that this case
is actually handled a bit lower down:

	} else if (new->flags & IRQF_TRIGGER_MASK) {
		unsigned int nmsk = new->flags & IRQF_TRIGGER_MASK;
		unsigned int omsk = irq_settings_get_trigger_mask(desc);

		if (nmsk != omsk)
			/* hope the handler works with current  trigger mode */
			pr_warning("irq %d uses trigger mode %u; requested %u\n",
				   irq, nmsk, omsk);
	}

Perhaps that should be louder/fatal?

Best regards,

-Brian

>Thanks,
>
>	tglx
>

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] genirq: fix trigger flags check for shared irqs Brian Starkey <brian.starkey@arm.com> - 2016-01-26 11:40 +0100
  Re: [PATCH] genirq: fix trigger flags check for shared irqs Thomas Gleixner <tglx@linutronix.de> - 2016-01-26 21:50 +0100
    Re: [PATCH] genirq: fix trigger flags check for shared irqs Brian Starkey <brian.starkey@arm.com> - 2016-01-28 11:10 +0100
      Re: [PATCH] genirq: fix trigger flags check for shared irqs Thomas Gleixner <tglx@linutronix.de> - 2016-01-28 11:40 +0100
        Re: [PATCH] genirq: fix trigger flags check for shared irqs Brian Starkey <brian.starkey@arm.com> - 2016-01-28 12:20 +0100
          Re: [PATCH] genirq: fix trigger flags check for shared irqs Thomas Gleixner <tglx@linutronix.de> - 2016-01-28 13:00 +0100
            Re: [PATCH] genirq: fix trigger flags check for shared irqs Brian Starkey <brian.starkey@arm.com> - 2016-01-28 13:30 +0100
              Re: [PATCH] genirq: fix trigger flags check for shared irqs Thomas Gleixner <tglx@linutronix.de> - 2016-01-28 14:40 +0100
                Re: [PATCH] genirq: fix trigger flags check for shared irqs Brian Starkey <brian.starkey@arm.com> - 2016-02-08 12:10 +0100
            Re: [PATCH] genirq: fix trigger flags check for shared irqs Rob Herring <robh+dt@kernel.org> - 2016-01-28 17:00 +0100
              Re: [PATCH] genirq: fix trigger flags check for shared irqs Thomas Gleixner <tglx@linutronix.de> - 2016-01-28 21:10 +0100
                Re: [PATCH] genirq: fix trigger flags check for shared irqs Tomasz Figa <tomasz.figa@gmail.com> - 2016-01-29 05:20 +0100

csiph-web