• Bjorn Andersson's avatar
    rpmsg: glink: Wait for intent, not just request ack · c05dfce0
    Bjorn Andersson authored
    In some implementations of the remote firmware, an intent request
    acknowledgment is sent when it's determined if the intent allocation
    will be fulfilled, but then the intent is queued after the
    acknowledgment.
    
    The result is that upon receiving a granted allocation request, the
    search for the newly allocated intent will fail and an additional
    request will be made. This will at best waste memory, but if the second
    request is rejected the transaction will be incorrectly rejected.
    
    Take the incoming intent into account in the wait to mitigate this
    problem.
    
    The above scenario can still happen, in the case that, on that same
    channel, an unrelated intent is delivered prior to the request
    acknowledgment and a separate process enters the send path and picks up
    the intent. Given that there's no relationship between the
    acknowledgment and the delivered (or to be delivered intent), there
    doesn't seem to be a solution to this problem.
    Signed-off-by: default avatarBjorn Andersson <quic_bjorande@quicinc.com>
    Reviewed-by: default avatarChris Lew <quic_clew@quicinc.com>
    [bjorn: Fixed spelling issues pointed out by checkpatch in commit message]
    Signed-off-by: default avatarBjorn Andersson <andersson@kernel.org>
    Link: https://lore.kernel.org/r/20230327144617.3134175-3-quic_bjorande@quicinc.com
    c05dfce0
qcom_glink_native.c 44.7 KB