• James Clark's avatar
    coresight: Remove atomic type from refcnt · 4545b38e
    James Clark authored
    Refcnt is only ever accessed from either inside the coresight_mutex, or
    the device's spinlock, making the atomic type and atomic_dec_return()
    calls confusing and unnecessary. The only point of synchronisation
    outside of these two types of locks is already done with a compare and
    swap on 'mode', which a comment has been added for.
    
    There was one instance of refcnt being used outside of a lock in TPIU,
    but that can easily be fixed by making it the same as all the other
    devices and adding a spinlock. Potentially in the future all the
    refcounting and locking can be moved up into the core code, and all the
    mostly duplicate code from the individual devices can be removed.
    Signed-off-by: default avatarJames Clark <james.clark@arm.com>
    Link: https://lore.kernel.org/r/20240129154050.569566-8-james.clark@arm.comSigned-off-by: default avatarSuzuki K Poulose <suzuki.poulose@arm.com>
    4545b38e
coresight-tmc-etr.c 51.3 KB