Re: device driver race conditions problems (kernel 2.4)
From: Pete Zaitcev (OTID1) (ot16a6ca05878e44c0_at_comcast.net)
Date: 08/28/04
- Next message: Pete Zaitcev (OTID1): "Re: zero copy network driver"
- Previous message: Paulo Garcia: "device driver race conditions problems (kernel 2.4)"
- In reply to: Paulo Garcia: "device driver race conditions problems (kernel 2.4)"
- Next in thread: Paulo Garcia: "Re: device driver race conditions problems (kernel 2.4)"
- Reply: Paulo Garcia: "Re: device driver race conditions problems (kernel 2.4)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 27 Aug 2004 19:35:32 -0700
On Fri, 27 Aug 2004 13:14:52 -0700, Paulo Garcia wrote:
> My driver must be able to manage more than one card using the same ISR
> and putting all signals into the same sbuffer. My approach is to use
> just one inode file (/dev/vbe1_s) to send data of all cards.
Why have you decided to do it this way?
> My ISR calls *spin_lock_irqsave* to avoid one interrupt interrupts
> another one of another card.
>
> The problem is when I put more than one card into PC, I have
> experienced some hangs. [...]
The code snippet below cannot work right, because the user context
part is not interlocked with the interrupt processing. It has no
calls to spin_lock_irqsave at all.
However, if it did, it would be tricky. You cannot call copy_to_user
while under lock, or you lock up. So, you would need to flip pointers
under lock to extract a buffer, then copy it out.
As for the lockup itself, the fragment does not tell us enough
to guess what may be wrong. My money is on improper interrupt
deactivation, causing a storm on level-triggered interrupt.
The deactivation sequence was omitted from the fragment.
If you need real help, you will have to do better than this
and perhaps post real code.
-- Pete
- Next message: Pete Zaitcev (OTID1): "Re: zero copy network driver"
- Previous message: Paulo Garcia: "device driver race conditions problems (kernel 2.4)"
- In reply to: Paulo Garcia: "device driver race conditions problems (kernel 2.4)"
- Next in thread: Paulo Garcia: "Re: device driver race conditions problems (kernel 2.4)"
- Reply: Paulo Garcia: "Re: device driver race conditions problems (kernel 2.4)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|