linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* 440GX interrupt
@ 2005-02-17 21:50 Barbier, Renaud (GE Infrastructure)
  2005-02-17 22:54 ` Eugene Surovegin
  0 siblings, 1 reply; 4+ messages in thread
From: Barbier, Renaud (GE Infrastructure) @ 2005-02-17 21:50 UTC (permalink / raw)
  To: linuxppc-embedded

I have a question regarding interrupt and irq locking.
I derived  (or copied from somehwere)a library (linux 2.4.26) for the =
440GX from ppc4xx_pic.c to take care of the last interrupt register =
(UIC2).
This a newbie question regarding get_irq/spin_lock
here is get_irq:
...
     bits =3D mfdcr(DCRN_UIC_MSR(UICBASE));
     if ((bits & 0x40000000) =3D=3D 0x40000000)
     {
        bits =3D mfdcr(DCRN_UIC_MSR(UIC0));
        irq =3D ( ffs(bits));
        irq =3D 32-irq;
	}
	...

my question is what guarantee that the code is executed atomically?

The reason I asked is that we have a driver that did the following in =
the ioctl call:

	disable_irq(26);
	/* do something */
	enable_irq(26);

as you noticed there is not any spin_lock.
Sometimes, this leads  get_irq to see UICBASE indicating an irq in UIC0 =
and
UIC0_MSR to return 0. hence you get irq 32 (MAL_SERR) and an infinite =
loop.

My current fix is to use irqsave/irqrestore in the driver which I think =
is the correct way to do (but I may be wrong please help).


However, I have a colleague (here is the human problem of my questions: =
him or me is the problem) that insists that I should do something in =
get_irq to have atomic execution.

can you share your view about get_irq and spin_lock?

If it is not the correct place to ask this question, let me know where =
to send it.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-02-18 15:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-17 21:50 440GX interrupt Barbier, Renaud (GE Infrastructure)
2005-02-17 22:54 ` Eugene Surovegin
2005-02-17 23:36   ` Eugene Surovegin
2005-02-18 15:56     ` Matt Porter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).