lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <facd1c7c-d696-eae1-02e4-5a0c9285add0@st.com>
Date:   Wed, 14 Sep 2016 15:05:55 +0200
From:   Alexandre Torgue <alexandre.torgue@...com>
To:     Thomas Gleixner <tglx@...utronix.de>
CC:     Maxime Coquelin <mcoquelin.stm32@...il.com>,
        Jason Cooper <jason@...edaemon.net>,
        Marc Zyngier <marc.zyngier@....com>,
        Linus Walleij <linus.walleij@...aro.org>,
        Mark Rutland <mark.rutland@....com>,
        Rob Herring <robh+dt@...nel.org>, <linux-gpio@...r.kernel.org>,
        <arnd@...db.de>, <linux-arm-kernel@...ts.infradead.org>,
        <linux-kernel@...r.kernel.org>, <devicetree@...r.kernel.org>,
        Daniel Thompson <daniel.thompson@...aro.org>,
        <bruherrera@...il.com>, <lee.jones@...aro.org>
Subject: Re: [PATCH v5 2/9] drivers: irqchip: Add STM32 external interrupts
 support

Hi Thomas,

On 09/14/2016 11:19 AM, Thomas Gleixner wrote:
> On Tue, 13 Sep 2016, Alexandre Torgue wrote:
>> On 09/13/2016 05:21 PM, Thomas Gleixner wrote:
>>> On Fri, 9 Sep 2016, Alexandre TORGUE wrote:
>>>> +static void stm32_exti_free(struct irq_domain *d, unsigned int virq,
>>>> +			    unsigned int nr_irqs)
>>>> +{
>>>> +	struct irq_data *data = irq_get_irq_data(virq);
>>>> +
>>>> +	irq_gc_mask_clr_bit(data->parent_data);
>>>
>>> I have a hard time to understand this. The irq domain is not hierarchical.
>>
>> Actually, I wanted to test ".free" callback function of gpio_irq_domain in
>> STM32 pinctrl driver. To do that I modified gpio driver: just after getting
>> virq through gpio_to_irq, I called "irq_dispose_mapping(virq)".
>> I know it is dirty but I thought it was the only way to test.
>>
>> Doing that, I see that ".free" callback of gpio domain is called but as it is
>> hirerchical ".free" callback for parent domain (exti one) is also called. I
>> observed that virq was well unmapped, but not masked at exti level. It is for
>> this reason than I added "irq_gc_mask_clr_bit(data->parent_data);" which mask
>> interrupt at exti level.
>
> Aargh. I really misread the patch, but this is entirely non obvious and you
> should do:
>
>        struct irq_data *data = irq_domain_get_irq_data(d, virq);
>
>        irq_gc_mask_clr_bit(d);
>
> Then it is entirely clear that you mask the interrupt of _this_ (the exti)
> domain.

Ok, it's easier to understand like that.

>
> Now what really bugs me is that you do that at all. An interrupt which is
> freed must be masked already. Why is it unmasked in the first place?

Honestly I don't know. When "devm_free_irq" is called to release virq, 
there is no issue and interrupt is well masked. But, when I tried to use
"irq_dispose_mapping(virq)" I observed that .free is called (child and 
parent domain) but interrupt is not masked.

Regards

Alex

>
> Thanks,
>
> 	tglx
>



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ