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]
Date:	Mon, 27 Jun 2011 11:57:46 +0200
From:	Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To:	Benjamin Herrenschmidt <benh@...nel.crashing.org>
CC:	Grant Likely <grant.likely@...retlab.ca>,
	devicetree-discuss@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
	Andres Salomon <dilinger@...ued.net>,
	Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [RFC PATCH] irq: add irq_domain translation infrastructure

Benjamin Herrenschmidt wrote:
> On Mon, 2011-06-27 at 11:00 +0200, Sebastian Andrzej Siewior wrote:
>> * Grant Likely | 2011-05-26 00:54:38 [-0600]:
>>
>>> diff --git a/arch/x86/kernel/devicetree.c b/arch/x86/kernel/devicetree.c
>>> index 39645b6..9891cd4 100644
>>> --- a/arch/x86/kernel/devicetree.c
>>> +++ b/arch/x86/kernel/devicetree.c
>>> @@ -371,36 +321,49 @@ static struct of_ioapic_type of_ioapic_type[] =
>>> 	},
>>> };
>>>
>>> -static int ioapic_xlate(struct irq_domain *id, const u32 *intspec, u32 intsize,
>>> -			u32 *out_hwirq, u32 *out_type)
>>> +static int ioapic_dt_translate(struct irq_domain *domain,
>>> +				struct device_node *controller,
>>> +				const u32 *intspec, u32 intsize,
>>> +				irq_hw_number_t *out_hwirq, u32 *out_type)
>>> {
>>> -	struct mp_ioapic_gsi *gsi_cfg;
>>> 	struct io_apic_irq_attr attr;
>>> 	struct of_ioapic_type *it;
>>> 	u32 line, idx, type;
>>> +	int rc;
>>>
>>> -	if (intsize < 2)
>>> +	if (controller != domain->of_node)
>>> 		return -EINVAL;
>> Is there a reason not havining the (controller != domain->of_node) check
>> in irq_create_of_mapping()?
> 
> Not all domains are associated with a single OF node.
> 
> Take xics, where there can be quite a few "source controllers" which act
> as device-tree interrupt parents but there's a single global domain.

I see. No, actually I don't. xics is pseries where I don't see the .dts. 
So you are saying that we have one irq_domain but 2+ different
interrupt-parents nodes?

How do you distinguish then between two different controllers lets say
xics and a gpio based controller? This implementation calls ->dt_translate
until one controller returns 0 which looks like brute force.

xics_host_xlate() returns always zero so you would have to go for
the compatible and check it.
Every device has an interrupt-parent node. Shouldn't the code call exact 
this irq controller xlate function instead of trying them all?

>  
> Cheers,
> Ben.
> 
Sebastian

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ