This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CONFIG_HWSPINLOCK_OMAP for AM335x

Hi Team,

Does CONFIG_HWSPINLOCK_OMAP makes sense for am335x?

If yes, is it better for performance and which ARCH_OMAP4 or ARCH_OMAP5 should be used?

Thanks and regards,

Oleg

  • Hi Oleg,

    The CONFIG_HWSPINLOCK_OMAP flag is not activated in SDK6 and SDK7. OMAP4 introduces a Hardware Spinlock device, which provides hardware
    assistance for synchronization and mutual exclusion between heterogeneous processors and those not operating under a single, shared operating system
    (e.g. OMAP4 has dual Cortex-A9, dual Cortex-M3 and a C64x+ DSP).

    The intention of this hardware device is to allow remote processors, that have no alternative mechanism to accomplish synchronization and mutual
    exclusion operations, to share resources (such as memory and/or any other hardware resource).

    If you add hwspinlock the framework makes it possible for drivers to use those hwspinlock devices and stay platform-independent.

    But using a spinlock sometimes will waste a lot of CPU cycles if that function is called frequently.
    Since you'll be expecting to block while waiting for the interrupt, you shouldn't be using spinlocks to lock the hardware as you'll probably be holding the lock for a long time.

    For me for synchronization is better to use Semaphores, Mutex ( Or any other Locking Mechanisms) must be used when any of the resources(Memory/variable/piece of code) has the probability of getting shared among the kernel/user threads.

    BR
    Ivan