• Suzuki K Poulose's avatar
    coresight: Handle build path error · 5014e904
    Suzuki K Poulose authored
    Enabling a component via sysfs (echo 1 > enable_source), would
    trigger building a path from the enabled sources to the sink.
    If there is an error in the process (e.g, sink not enabled or
    the device (CPU corresponding to ETM) is not online), we never report
    failure, except for leaving a message in the dmesg.
    
    Do proper error checking for the build path and return the error.
    
    Before:
     $ echo 0 > /sys/devices/system/cpu/cpu2/online
     $ echo 1 > /sys/devices/cs_etm/cpu2/enable_source
     $ echo $?
     0
    
    After:
     $ echo 0 > /sys/devices/system/cpu/cpu2/online
     $ echo 1 > /sys/devices/cs_etm/cpu2/enable_source
     -bash: echo: write error: No such device or address
    Signed-off-by: default avatarSuzuki K Poulose <suzuki.poulose@arm.com>
    Acked-by: default avatarMathieu Poirier <mathieu.poirier@linaro.org>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    5014e904
coresight.c 22.3 KB