<html><body>
<p><tt>Paul Mackerras &lt;paulus@samba.org&gt; wrote on 05/15/2008 06:02:03 PM:<br>
<br>
&gt; Corey J Ashford writes:<br>
&gt; <br>
&gt; &gt; Thanks for the feedback. &nbsp;I don't believe I need a separate flag, because<br>
&gt; &gt; the PMU interrupt (via the PMAO bit) will still be pending when interrupts<br>
&gt; &gt; are hard enabled again, and the handler will be reentered automatically.<br>
&gt; <br>
&gt; If that were the case then we wouldn't have had the problem with<br>
&gt; losing PMU interrupts that meant we had to change the PMU interrupt<br>
&gt; handler from a MASKABLE_EXCEPTION to a STD_EXCEPTION. &nbsp;This was in<br>
&gt; commit 449d846dbcbf61bdf7d50a923e4791102168c292.<br>
&gt; <br>
&gt; My understanding is that the PMU only requests an interrupt when PMAO<br>
&gt; goes from 0 to 1 (i.e. it's edge-triggered). &nbsp;If the CPU takes the<br>
&gt; interrupt and then sets MSR.EE again (e.g. by returning from the<br>
&gt; interrupt handler), and PMAO has not been reset to 0, then I don't<br>
&gt; think the PMU requests another interrupt at that point.<br>
&gt; <br>
</tt><br>
<tt>I went back and looked through my notes, and found that the problem with looping in the interrupt handler I had a couple of months ago was not with PMAO not being cleared, but because there were unused counters (PMC5 and/or PMC6) were not zeroed out in the interrupt handler and so they continued to count past 0x80000000, causing PMAO to become asserted on every count. &nbsp;This was on POWER5+, and so the behavior may be different on other chips. &nbsp;I do find it a little odd that it would set PMAO on every count past 0x80000000, instead of just on the transition from 0x7fffffff to 0x80000000.</tt><br>
<br>
<tt>In any case, I do need to save the fact that an interrupt occurred and to reassert the interrupt in local_irq_restore (it appears to be the case that raw_local_irq_restore for POWER is new in 2.6.26. &nbsp;I'm working on 2.6.25 at the moment)</tt><br>
<br>
<tt>Thanks for your reply, as it could have taken me a long time to find this problem otherwise.</tt><br>
<br>
<tt>- Corey</tt><br>
<br>
<tt>Corey Ashford<br>
Software Engineer<br>
IBM Linux Technology Center, Linux Toolchain<br>
Beaverton, OR <br>
503-578-3507 <br>
cjashfor@us.ibm.com<br>
</tt></body></html>