How to use linear mapping without DT?

ludovic.desroches ludovic.desroches at atmel.com
Mon Jun 18 08:10:24 EDT 2012


Le 06/16/2012 04:35 AM, Shawn Guo a écrit :
> On Fri, Jun 15, 2012 at 06:32:29PM +0200, ludovic.desroches wrote:
>> I've seen your patch series and I am wondering what is the
>> difference between these two solutions:
>> - not using nr_irqs: you will have NR_IRQS_LEGACY irqdescs allocated
>> and you will allocate the irqdescs for your controller just after by
>> calling irq_alloc_descs so you will have to manage the
>> NR_IRQS_LEGACY offset.
>> - using nr_irqs: you will have all your irqdescs allocated and won't
>> have to manage the NR_IRQS_LEGACY offset.
>>
> First of all, NR_IRQS_LEGACY shifting is a good thing we are actually
> looking for because we want to reserve virq number 0 for no-interrupt
> case. [1]

I don't think it's an issue for legacy domain since virq number 0 is 
ignored.

>
> Secondly, with .nr_irqs approach, you will have to somehow maintain
> irq_base for each irqchip, which is needed when adding legacy domain.
> Calling irq_alloc_descs will just return you the irq_base.
>
> Lastly, irq_alloc_descs approach can save irqdesc than .nr_irq in some
> cases, where not all the irqchips get instantiated for every single
> boot.  That's said, .nr_irqs has to be set the possible maximum numbers
> for the machine, while some irqchips, e.g. peripheral/device inside
> ones, are not always instantiated.  irq_alloc_descs approach will save
> irqdescs for such cases.

Of course it makes sense.

Thanks for these explanations. I'll correct my patches to use the 
NR_IRQS_LEGACY shifting instead of using nr_irqs.

Regards

Ludovic





More information about the linux-arm-kernel mailing list