All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Marc Zyngier <maz@kernel.org>
Cc: James Tai <james.tai@realtek.com>,
	Aleix Roca Nonell <kernelrocks@gmail.com>,
	linux-realtek-soc@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-arm-kernel@lists.infradead.org,
	Jason Cooper <jason@lakedaemon.net>
Subject: Re: [PATCH v4 2/8] irqchip: Add Realtek RTD1295 mux driver
Date: Wed, 20 Nov 2019 00:33:28 +0100	[thread overview]
Message-ID: <d7416bdb-e20a-42e1-daff-c61369f359fa@suse.de> (raw)
In-Reply-To: <20191119222956.23665e5d@why>

Am 19.11.19 um 23:29 schrieb Marc Zyngier:
> On Tue, 19 Nov 2019 21:56:48 +0100
> Andreas Färber <afaerber@suse.de> wrote:
>> Am 19.11.19 um 13:01 schrieb Marc Zyngier:
>>> On 2019-11-19 02:19, Andreas Färber wrote:  
>>>> +static void rtd1195_mux_enable_irq(struct irq_data *data)
>>>> +{
>>>> +    struct rtd1195_irq_mux_data *mux_data =
>>>> irq_data_get_irq_chip_data(data);
>>>> +    unsigned long flags;
>>>> +    u32 mask;
>>>> +
>>>> +    mask = mux_data->info->isr_to_int_en_mask[data->hwirq];
>>>> +    if (!mask)
>>>> +        return;  
>>>
>>> How can this happen? You've mapped the interrupt, so it exists.
>>> I can't see how you can decide to fail such enable.  
>>
>> The [UMSK_]ISR bits and the SCPU_INT_EN bits are not (all) the same.
>>
>> My ..._isr_to_scpu_int_en[] arrays have 32 entries for O(1) lookup, but
>> are sparsely populated. So there are circumstances such as WDOG_NMI as
>> well as reserved bits that we cannot enable.
> 
> But the you should have failed the map. The moment you allow the
> mapping to occur, you have accepted the contract that this interrupt is
> usable.
> 
>> This check should be
>> identical to v3; the equivalent mask check inside the interrupt handler
>> was extended with "mask &&" to do the same in this v4.
> 
> Spurious interrupts are a different matter. What I'm objecting to here
> is a simple question of logic, whether or not you are allowed to fail
> enabling an interrupt that you've otherwise allowed to be populated.

Then what are you suggesting instead? I don't see how my array map
lookup could fail other than returning a zero value, given its static
initialization. Check for a zero mask in rtd1195_mux_irq_domain_map()?
Then we wouldn't be able to use the mentioned WDOG_NMI. Add another
per-mux info field for which interrupts are valid to map?

Thanks,
Andreas

-- 
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer
HRB 36809 (AG Nürnberg)

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: "Andreas Färber" <afaerber@suse.de>
To: Marc Zyngier <maz@kernel.org>
Cc: linux-realtek-soc@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Aleix Roca Nonell <kernelrocks@gmail.com>,
	James Tai <james.tai@realtek.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Jason Cooper <jason@lakedaemon.net>
Subject: Re: [PATCH v4 2/8] irqchip: Add Realtek RTD1295 mux driver
Date: Wed, 20 Nov 2019 00:33:28 +0100	[thread overview]
Message-ID: <d7416bdb-e20a-42e1-daff-c61369f359fa@suse.de> (raw)
In-Reply-To: <20191119222956.23665e5d@why>

Am 19.11.19 um 23:29 schrieb Marc Zyngier:
> On Tue, 19 Nov 2019 21:56:48 +0100
> Andreas Färber <afaerber@suse.de> wrote:
>> Am 19.11.19 um 13:01 schrieb Marc Zyngier:
>>> On 2019-11-19 02:19, Andreas Färber wrote:  
>>>> +static void rtd1195_mux_enable_irq(struct irq_data *data)
>>>> +{
>>>> +    struct rtd1195_irq_mux_data *mux_data =
>>>> irq_data_get_irq_chip_data(data);
>>>> +    unsigned long flags;
>>>> +    u32 mask;
>>>> +
>>>> +    mask = mux_data->info->isr_to_int_en_mask[data->hwirq];
>>>> +    if (!mask)
>>>> +        return;  
>>>
>>> How can this happen? You've mapped the interrupt, so it exists.
>>> I can't see how you can decide to fail such enable.  
>>
>> The [UMSK_]ISR bits and the SCPU_INT_EN bits are not (all) the same.
>>
>> My ..._isr_to_scpu_int_en[] arrays have 32 entries for O(1) lookup, but
>> are sparsely populated. So there are circumstances such as WDOG_NMI as
>> well as reserved bits that we cannot enable.
> 
> But the you should have failed the map. The moment you allow the
> mapping to occur, you have accepted the contract that this interrupt is
> usable.
> 
>> This check should be
>> identical to v3; the equivalent mask check inside the interrupt handler
>> was extended with "mask &&" to do the same in this v4.
> 
> Spurious interrupts are a different matter. What I'm objecting to here
> is a simple question of logic, whether or not you are allowed to fail
> enabling an interrupt that you've otherwise allowed to be populated.

Then what are you suggesting instead? I don't see how my array map
lookup could fail other than returning a zero value, given its static
initialization. Check for a zero mask in rtd1195_mux_irq_domain_map()?
Then we wouldn't be able to use the mentioned WDOG_NMI. Add another
per-mux info field for which interrupts are valid to map?

Thanks,
Andreas

-- 
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer
HRB 36809 (AG Nürnberg)

  reply	other threads:[~2019-11-19 23:33 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-19  2:19 [PATCH v4 0/8] ARM: Realtek RTD1195/RTD1295/RTD1395 IRQ mux Andreas Färber
2019-11-19  2:19 ` Andreas Färber
2019-11-19  2:19 ` [PATCH v4 1/8] dt-bindings: interrupt-controller: Add Realtek RTD1195/RTD1295 mux Andreas Färber
2019-11-19  2:19   ` Andreas Färber
2019-11-19  2:19 ` [PATCH v4 2/8] irqchip: Add Realtek RTD1295 mux driver Andreas Färber
2019-11-19  2:19   ` Andreas Färber
2019-11-19 12:01   ` Marc Zyngier
2019-11-19 12:01     ` Marc Zyngier
2019-11-19 20:56     ` Andreas Färber
2019-11-19 20:56       ` Andreas Färber
2019-11-19 22:29       ` Marc Zyngier
2019-11-19 22:29         ` Marc Zyngier
2019-11-19 23:33         ` Andreas Färber [this message]
2019-11-19 23:33           ` Andreas Färber
2019-11-20 10:20           ` Marc Zyngier
2019-11-20 10:20             ` Marc Zyngier
2019-11-20 13:34             ` Andreas Färber
2019-11-20 13:34               ` Andreas Färber
2019-11-20 14:32               ` Marc Zyngier
2019-11-20 14:32                 ` Marc Zyngier
2019-11-19 23:25     ` Andreas Färber
2019-11-19 23:25       ` Andreas Färber
2019-11-20 10:18       ` Marc Zyngier
2019-11-20 10:18         ` Marc Zyngier
2019-11-20 12:12         ` Andreas Färber
2019-11-20 12:12           ` Andreas Färber
2019-11-20 12:23           ` Marc Zyngier
2019-11-20 12:23             ` Marc Zyngier
2019-11-19  2:19 ` [PATCH v4 3/8] arm64: dts: realtek: rtd129x: Add irq muxes and UART interrupts Andreas Färber
2019-11-19  2:19   ` Andreas Färber
2019-11-19  2:19 ` [PATCH v4 4/8] irqchip: rtd1195-mux: Add RTD1195 definitions Andreas Färber
2019-11-19  2:19   ` Andreas Färber
2019-11-19  2:19 ` [PATCH v4 5/8] ARM: dts: rtd1195: Add irq muxes and UART interrupts Andreas Färber
2019-11-19  2:19   ` Andreas Färber
2019-11-19  2:19 ` [PATCH v4 6/8] dt-bindings: interrupt-controller: rtd1195-mux: Add RTD1395 Andreas Färber
2019-11-19  2:19   ` Andreas Färber
2019-11-19  2:19 ` [PATCH v4 7/8] irqchip: rtd1195-mux: Add RTD1395 definitions Andreas Färber
2019-11-19  2:19   ` Andreas Färber
2019-11-19  2:19 ` [PATCH v4 8/8] arm64: dts: realtek: rtd139x: Add irq muxes and UART interrupts Andreas Färber
2019-11-19  2:19   ` Andreas Färber

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=d7416bdb-e20a-42e1-daff-c61369f359fa@suse.de \
    --to=afaerber@suse.de \
    --cc=james.tai@realtek.com \
    --cc=jason@lakedaemon.net \
    --cc=kernelrocks@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-realtek-soc@lists.infradead.org \
    --cc=maz@kernel.org \
    --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 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.