[RFC PATCH 16/19] powerpc: wii: hollywood interrupt controller support

Segher Boessenkool segher at kernel.crashing.org
Wed Nov 25 08:54:20 EST 2009


> +config HLWD_PIC

Are vowels too expensive?  :-)

> +static void hlwd_pic_ack(unsigned int virq)
> +{
> +	int irq = virq_to_hw(virq);
> +	void __iomem *io_base = get_irq_chip_data(virq);
> +
> +	set_bit(irq, io_base + HW_BROADWAY_ICR);
> +}

Same issue as with Flipper here.

> +	__asm__ __volatile__("cntlzw %0,%1" : "=r"(irq) : "r"(irq_status));
> +	return irq_linear_revmap(h, 31 - irq);

And here.

> +static void __hlwd_quiesce(void __iomem *io_base)
> +{
> +	/* mask and ack all IRQs */
> +	out_be32(io_base + HW_BROADWAY_IMR, 0);
> +	out_be32(io_base + HW_BROADWAY_ICR, ~0);
> +}

I would write 0xffffffff instead, it's clearer and slightly
more robust.

> +void hlwd_pic_probe(void)
> +{
> +	struct irq_host *host;
> +	struct device_node *np;
> +	const u32 *interrupts;
> +	int cascade_virq;
> +
> +	for_each_compatible_node(np, NULL, "nintendo,hollywood-pic") {
> +		interrupts = of_get_property(np, "interrupts", NULL);
> +		if (interrupts) {
> +			host = hlwd_pic_init(np);
> +			BUG_ON(!host);
> +			cascade_virq = irq_of_parse_and_map(np, 0);
> +			set_irq_data(cascade_virq, host);
> +			set_irq_chained_handler(cascade_virq,
> +						hlwd_pic_irq_cascade);

break;  here?  You do not handle more than one hollywood-pic elsewhere
(which of course is fine).


Segher



More information about the Linuxppc-dev mailing list