• Stewart Smith's avatar
    powernv/opal-sensor: remove not needed lock · 95e1bc1d
    Stewart Smith authored
    Parallel sensor reads could run out of async tokens due to
    opal_get_sensor_data grabbing tokens but then doing the sensor
    read behind a mutex, essentially serializing the (possibly
    asynchronous and relatively slow) sensor read.
    
    It turns out that the mutex isn't needed at all, not only
    should the OPAL interface allow concurrent reads, the implementation
    is certainly safe for that, and if any sensor we were reading
    from somewhere isn't, doing the mutual exclusion in the kernel
    is the wrong place to do it, OPAL should be doing it for the kernel.
    
    So, remove the mutex.
    
    Additionally, we shouldn't be printing out an error when we don't
    get a token as the only way this should happen is if we've been
    interrupted in down_interruptible() on the semaphore.
    Reported-by: default avatarRobert Lippert <rlippert@google.com>
    Signed-off-by: default avatarStewart Smith <stewart@linux.vnet.ibm.com>
    Signed-off-by: default avatarCyril Bur <cyrilbur@gmail.com>
    Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
    95e1bc1d
opal-sensor.c 2.19 KB