Re: Kernel modules: atomic GPIO access on PREEMPT_RT

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

 



On 29.06.2013 09:11, Matthias Klein wrote:

> What is the right way to access these registers for e.g
> setting a single bit of such a register to avoid
> read/modify/write problems ?
> Do I have to use some locking / atomic operations ?

If the hardware does not support you here with bit-banding
(some Cortex processors export single GPIO bits as separate
bytes but I don't think the i.MX537 does), yes, you have
to lock.

I'd say implement a general GPIO driver and use its
function for access.

https://www.kernel.org/doc/Documentation/gpio.txt
http://lxr.free-electrons.com/source/include/asm-generic/gpio.h#L52
http://lxr.free-electrons.com/source/drivers/gpio/gpio-cs5535.c#L93

Generally (several different modules accessing something that
does not have a single driver to implement it) I think the only
sane way is to implement the shared part in arch/arm/.../mach-*
and have all users depend on it.

-- 
                                            Stano

--
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