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: <79b34c45-023b-2df4-26f4-e151e74a46ac@arm.com>
Date:   Mon, 29 Apr 2019 09:47:55 +0100
From:   Marc Zyngier <marc.zyngier@....com>
To:     Lokesh Vutla <lokeshvutla@...com>,
        Santosh Shilimkar <ssantosh@...nel.org>,
        Rob Herring <robh+dt@...nel.org>, Nishanth Menon <nm@...com>,
        tglx@...utronix.de, jason@...edaemon.net
Cc:     Linux ARM Mailing List <linux-arm-kernel@...ts.infradead.org>,
        linux-kernel@...r.kernel.org, Tero Kristo <t-kristo@...com>,
        Sekhar Nori <nsekhar@...com>, Tony Lindgren <tony@...mide.com>,
        linus.walleij@...aro.org, Peter Ujfalusi <peter.ujfalusi@...com>,
        Grygorii Strashko <grygorii.strashko@...com>,
        Device Tree Mailing List <devicetree@...r.kernel.org>
Subject: Re: [PATCH v7 11/14] irqchip: ti-sci-inta: Add support for Interrupt
 Aggregator driver

On 23/04/2019 11:00, Lokesh Vutla wrote:
> Hi Marc,

[...]

>> +/**
>> + * ti_sci_inta_set_type() - Update the trigger type of the irq.
>> + * @data:	Pointer to corresponding irq_data
>> + * @type:	Trigger type as specified by user
>> + *
>> + * Note: This updates the handle_irq callback for level msi.
>> + *
>> + * Return 0 if all went well else appropriate error.
>> + */
>> +static int ti_sci_inta_set_type(struct irq_data *data, unsigned int type)
>> +{
>> +	struct irq_desc *desc = irq_to_desc(data->irq);
>> +
>> +	/*
>> +	 * .alloc default sets handle_edge_irq. But if the user specifies
>> +	 * that IRQ is level MSI, then update the handle to handle_level_irq
>> +	 */
>> +	if (type & IRQF_TRIGGER_HIGH)
>> +		desc->handle_irq = handle_level_irq;
>> +
>> +	return 0;
> 
> 
> Returning error value is causing request_irq to fail, so still returning 0. Do
> you suggest any other method to handle this?

But that is the very point, isn't it? If you pass the wrong triggering
type to request_irq, it *must* fail. What you should have is something like:

switch (type & IRQ_TYPE_SENSE_MASK) {
case IRQF_TRIGGER_HIGH:
	desc->handle_irq = handle_level_irq;
	return 0;
case IRQ_TYPE_EDGE_RISING:
	return 0;
default:
	return -EINVAL;
}

(adjust as necessary).

What's wrong with this?

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ