Latest OpenPic changes

Gabriel Paubert paubert at iram.es
Sat Feb 12 04:11:17 EST 2000




On Fri, 11 Feb 2000, Geert Uytterhoeven wrote:

>
> 	Hi Ben,
>
> After two days of hacking I finally found out what went wrong. Your changes to
> the OpenPIC code cause my machine to hang in openpic_enable_irq(). I added a
> timeout to the do { ... } while (...) loop:

Please use ISU[irq - open_pic_irq_offset] everywhere. You are not reading
the interrupt you are modifying probably. On the other hand I'm using a
completely different solution, and I don't read back when enabling the
IRQ. I can't see why you could need it, this will go to the bus sooner or
later, why wait one or several microseconds while the interrupts are being
acttually enabled in the controller ?



>
> void openpic_enable_irq(u_int irq)
> {
>         int timeout = 1000000;
>         check_arg_irq(irq);
>         openpic_clearfield(&ISU[irq - open_pic_irq_offset].Vector_Priority, OPENPIC_MASK);
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>         /* make sure mask gets to controller before we return to user */
>         do {
>                 mb(); /* sync is probably useless here */
>         } while(openpic_readfield(&OpenPIC->Source[irq].Vector_Priority,
				    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>                         OPENPIC_MASK) && --timeout);
>         if (!timeout)
>             printk("openpic_enable_irq %d timeout status 0x%08x\n", irq, openpic_readfield(&OpenPIC->Source[irq].Vector_Priority,OPENPIC_MASK));
> }
>

	Gabriel.


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc-dev mailing list