Linux ACPI
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Hans de Goede <hdegoede@redhat.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>,
	linux-acpi@vger.kernel.org, x86@kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC] Fix shared irq trigger-flags conflict when old irqaction uses IRQF_TRIGGER_NONE
Date: Fri, 14 Apr 2017 11:34:27 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.20.1704141129250.2327@nanos> (raw)
In-Reply-To: <1117548f-9b5a-111c-6657-79a6c30179de@redhat.com>

On Mon, 10 Apr 2017, Hans de Goede wrote:
> Where the new_action trigger_mask gets filled with the triger_mask
> from the irq_data, which is a further hint that looking at
> irqd_get_trigger_type(&desc->irq_data) rather then at
> (old->flags IRQF_TRIGGER_MASK) is probably the right fix.
> 
> Note btw that 4b357daed698 is (part of) what is breaking things for
> my use-case, I request the irq with IRQF_TRIGGER_NONE but
> 4b357daed698 modifies that before comparing the new trigger flags
> to the old.

The issue here is, that at the time of the first setup_irq() the trigger
type in irq_data is NONE. As a consequence the following is a NOOP:

     if (!new->trigger)
	new->flags |= get_type(irqdata);

Now the irq is started up for the first time and then the actual trigger
type gets established, but that's to late to fix up new->flags.

So yes, we should change the logic for the shared case to:

   if (old) {
      	    oldtype = get_type(irqdata);

	    if (oldtype != newtype)
	       	    goto mismatch;

That should cover all cases.

Thanks,

	tglx

      reply	other threads:[~2017-04-14  9:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-09 19:59 [RFC] Fix shared irq trigger-flags conflict when old irqaction uses IRQF_TRIGGER_NONE Hans de Goede
2017-04-10 10:13 ` Marc Zyngier
2017-04-10 11:04   ` Hans de Goede
2017-04-14  9:34     ` Thomas Gleixner [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=alpine.DEB.2.20.1704141129250.2327@nanos \
    --to=tglx@linutronix.de \
    --cc=hdegoede@redhat.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=x86@kernel.org \
    /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