Subject: Re: For your edification...
To: None <port-macppc@netbsd.org>
From: Don Lee <donlee_ppc1@icompute.com>
List: port-macppc
Date: 02/14/2003 11:14:16
This thread is very interesting to me.  I have a Cyclades
multi-port serial card that drops interrupts when under
heavy load.  In trying to debug the driver, I have become
convinced that there is a race condition somewhere in the
netbsd-PPC low-level interrupt handling, but have been
unable to find it.

Don't give up on this....

-dgl-


At 6:09 PM -0800 2/13/03, Monroe Williams wrote:
>Delivered-To: port-macppc@netbsd.org
>Date: Thu, 13 Feb 2003 18:09:22 -0800
>Subject: Re: For your edification...
>From: Monroe Williams <monroe@pobox.com>
>To: Bill Studenmund <wrstuden@netbsd.org>
>CC: Cliff Neighbors <cliff@allegronetworks.com>, <port-macppc@netbsd.org>
>Sender: port-macppc-owner@netbsd.org
>
>on 2/13/03 5:03 PM, Bill Studenmund at wrstuden@netbsd.org wrote:
>
>> On Thu, 13 Feb 2003, Monroe Williams wrote:
>>
>>> on 2/13/03 2:31 PM, Cliff Neighbors at cliff@allegronetworks.com wrote:
>>>
>>>> this won't work unless all access to `ipending' also use lwarx/stwcx
>>>> otherwise you will not detect and avoid the race.
>>>
>>> That's what the code does.
>>
>> I think Cliff's comment was different. I think he was saying make sure
>> that all writes to this variable use this code. It does not good if one
>> (or most) writer does this while others don't.
>>
>> I think reads are fine, since I gather that ipending is an int, so it can
>> be read atomicly.
>
>Aha...
>
>I see that I had misread the section on lwarx/stwcx.  I didn't realize that
>normal stores to the reserved address didn't clear the reservation.  This
>fact isn't clearly called out in section 4.2.6 of the PowerPC Enviromnents
>book, although it can be inferred from a careful reading of the bulleted
>list of things that may clear a reservation.
>
>I was further confused by the fact that stores by any _other_ CPU or
>mechanism in the system would clear the reservation.
>
>Well, so much for that idea...
>
>Thanks all,
>-- monroe
>------------------------------------------------------------------------
>Monroe Williams                                         monroe@pobox.com