• Cyril Bur's avatar
    powerpc/opal: Rework the opal-async interface · 86cd6d98
    Cyril Bur authored
    Future work will add an opal_async_wait_response_interruptible()
    which will call wait_event_interruptible(). This work requires extra
    token state to be tracked as wait_event_interruptible() can return and
    the caller could release the token before OPAL responds.
    
    Currently token state is tracked with two bitfields which are 64 bits
    big but may not need to be as OPAL informs Linux how many async tokens
    there are. It also uses an array indexed by token to store response
    messages for each token.
    
    The bitfields make it difficult to add more state and also provide a
    hard maximum as to how many tokens there can be - it is possible that
    OPAL will inform Linux that there are more than 64 tokens.
    
    Rather than add a bitfield to track the extra state, rework the
    internals slightly.
    Signed-off-by: default avatarCyril Bur <cyrilbur@gmail.com>
    [mpe: Fix __opal_async_get_token() when no tokens are free]
    Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
    86cd6d98
opal-async.c 5 KB