linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mason <slash.tmp@free.fr>
To: Marc Zyngier <marc.zyngier@arm.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Jason Cooper <jason@lakedaemon.net>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Thibaud Cornic <thibaud_cornic@sigmadesigns.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v6] irqchip: Add support for tango interrupt router
Date: Mon, 21 Aug 2017 18:13:07 +0200	[thread overview]
Message-ID: <a6e1fe03-56a4-0db9-ca1c-36d09936a140@free.fr> (raw)
In-Reply-To: <21670cea-beaf-8a41-84fb-f3c892527b0e@free.fr>

On 20/08/2017 19:22, Mason wrote:

> On 07/08/2017 14:47, Marc Zyngier wrote:
> 
>> On 01/08/17 17:56, Mason wrote:
>>
>>> +static int tango_set_type(struct irq_data *data, uint flow_type)
>>> +{
>>> +	return 0;
>>
>> What does this mean? Either you can do a set-type (and you do it), or
>> you cannot, and you fail. At least you check that what you're asked to
>> do matches the configuration.
> 
> IIRC, __irq_set_trigger() barfed when I did it differently.

The way the problem manifests is that /proc/interrupts cannot
determine the trigger types.

(I think the issue might be deeper than this cosmetic aspect.)

# cat /proc/interrupts
           CPU0       CPU1       CPU2       CPU3
 40:       1832        333       2378        471     GIC-0  29 Edge      twd
 41:        487          0          0          0    mapper   1 Edge      serial
 44:         50          0          0          0    mapper  38 Edge      eth0
 51:          3          0          0          0    mapper  37 Edge      phy_interrupt

(1 and 38 are actually level interrupts.)

	ret = sprintf(buf, "%s\n",
		      irqd_is_level_type(&desc->irq_data) ? "level" : "edge");


__irq_set_trigger() is a no-op when irq_set_type is not implemented.

But if the callback returns 0, then __irq_set_trigger() eventually calls

		irqd_clear(&desc->irq_data, IRQD_TRIGGER_MASK);
		irqd_set(&desc->irq_data, flags);


Should I be calling irqd_get_trigger_type() myself earlier,
perhaps in the domain alloc function?

That's what drivers/irqchip/irq-pic32-evic.c seems to do.

The comment seems to state otherwise though:
/*
 * Must only be called inside irq_chip.irq_set_type() functions.
 */
static inline void irqd_set_trigger_type(struct irq_data *d, u32 type)


Regards.

  reply	other threads:[~2017-08-21 16:13 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-06 13:42 [RFC PATCH v1] irqchip: Add support for tango interrupt router Mason
2017-06-06 15:52 ` Thomas Petazzoni
2017-07-11 15:56   ` Mason
2017-07-12 16:39     ` [RFC PATCH v2] " Mason
2017-07-15 13:06       ` Mason
2017-07-15 23:46         ` Mason
2017-07-17 15:36           ` [RFC PATCH v3] " Mason
2017-07-17 21:22             ` Mason
2017-07-18 14:21               ` [PATCH v4] " Mason
2017-07-25 15:26                 ` [PATCH v5] " Mason
2017-08-01 16:56                   ` [PATCH v6] " Mason
2017-08-07 12:47                     ` Marc Zyngier
2017-08-20 17:22                       ` Mason
2017-08-21 16:13                         ` Mason [this message]
2017-08-23 10:58                         ` Marc Zyngier
2017-08-23 15:45                           ` Mason
2017-08-28 13:58                           ` [PATCH v7] irqchip: Add support for tango interrupt mapper Mason

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=a6e1fe03-56a4-0db9-ca1c-36d09936a140@free.fr \
    --to=slash.tmp@free.fr \
    --cc=jason@lakedaemon.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=mark.rutland@arm.com \
    --cc=tglx@linutronix.de \
    --cc=thibaud_cornic@sigmadesigns.com \
    --cc=thomas.petazzoni@free-electrons.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;
as well as URLs for NNTP newsgroup(s).