[linux-dvb] [PATCH 1/3] Fix a problem during the access to the IER and ISR registers of the SA7146

Oliver Endriss o.endriss at gmx.de
Tue Oct 31 06:35:39 CET 2006


e9hack wrote:
> Hi,
> 
> it exist some macros to access the IER and ISR registers of the SAA7146. This macros are using a read and a write
> operation and this macros are executed inside of the interrupt handler of the SAA7146 and outside of it. It exist a
> reentrant problem. The interrupt handler may intercept the execution of such a macro and may also access the IER and/or
> ISR registers. The access to the IER and ISR register must be protect by a locking primitive. The attached patch does
> fix this problem.
> 
> The patch does not fix the stradis driver. This driver has the same problem.

Now I found some time to look at your patch:

> Protect the access to the IER/ISR register of the SAA7146 by the device spinlock.

Imho it is not necessary to protect write operations to the ISR because
it is a single write-only operation.

SAA7146_IER_DISABLE/SAA7146_IER_ENABLE must be protected by a spinlock
because it is a read-modify-write operation.

So your patch could be replaced by the attached one.

What do you think?

Oliver

-- 
--------------------------------------------------------
VDR Remote Plugin 0.3.8 available at
http://www.escape-edv.de/endriss/vdr/
--------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: saa7146_ier_spinlock.diff
Type: text/x-diff
Size: 1199 bytes
Desc: not available
Url : http://www.linuxtv.org/pipermail/linux-dvb/attachments/20061031/75d2b61d/saa7146_ier_spinlock.bin


More information about the linux-dvb mailing list