Re: Protection of critical section in PREEMPT_RT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jacky,

On Wed, 6 Feb 2013, Jacky Lam wrote:
> On Tue, Feb 5, 2013 at 6:05 PM, Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:
> > If all issues are resolved, move over to RT and enable the same debug
> > options. Run your code and if it still explodes, post code and kernel
> > dump so we can have a look instead of having this completely pointless
> > discussion over and over.
> >
> 
> I try to make an example to show the problem. Our hardware  use
> indirect method to access the SATA/USB controller internal registers,
> i.e CPU has a SATA/USB IO Addr register and a DATA register. In order
> to read from controller's internal register, I need to put the offset
> into IO Addr register and then read from the IO Data register. As this
> process cannot be interrupted, I need to put a spin_lock_irqsave to
> protect the code.

Right. That's the usual way to solve this.
 
> When driver code is reading the controller's registers and interrupt
> comes, interrupt handler (not the interrupt thread) need to clear the
> interrupt source first and return IRQ_WAKE_THREAD to wait for
> interrupt thread to actually handle the interrupt task. But in order
> to clear the interrupt source, I need to access the controller's
> internal registers. This is the problem I have now.

Do I understand you correct, that you use a threaded interrupt handler
already in the driver?

If yes, then RT is of course not force threading your primary
handler. In that case the protection of the indirect HW access must
use a raw_spinlock not a spinlock.

Thanks,

	tglx

 
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux