• Rijo Thomas's avatar
    crypto: ccp - fix command queuing to TEE ring buffer · 00aa6e65
    Rijo Thomas authored
    Multiple threads or clients can submit a command to the TEE ring
    buffer. This patch helps to synchronize command submission to the
    ring.
    
    One thread shall write a command to a TEE ring buffer entry only if:
    
     - Trusted OS has notified that the TEE command for the given entry
       has been processed and driver has copied the TEE response into
       client buffer.
    
     - The command entry is empty and can be written into.
    
    After a command has been written to the TEE ring buffer, the global
    wptr (mutex protected) shall be incremented for use by next client.
    
    If PSP became unresponsive while processing TEE request from a
    client, then further command submission to queue will be disabled.
    
    Fixes: 33960acc (crypto: ccp - add TEE support for Raven Ridge)
    Reviewed-by: default avatarDevaraj Rangasamy <Devaraj.Rangasamy@amd.com>
    Signed-off-by: default avatarRijo Thomas <Rijo-john.Thomas@amd.com>
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    00aa6e65
tee-dev.c 8.56 KB