Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit cff38c32 authored by Konstantin Dorfman's avatar Konstantin Dorfman Committed by Gerrit - the friendly Code Review server
Browse files

soc:qcom:spcom: free not consumed packet on rx timeout



Every SPU to hlos spcom data packet should be consumed by userspace
read() context. When spcomlib read() system call exits on timeout,
a packet arrived later will be stuck till next read() context arrives.

This change fixes this by removing not used packet from channel table
in following cases:
 - user character device is closed (no packet expected)
 - packet receive from SPU, by assumption, that the next read()
   belongs to different session

There is sequence number maintained for each spcom session per channel.
It is stored in a channel context and changed as follows:
 - initialized on channel creation and channel destroy
 - incremented by client side, before send new request to spcom server
 - no changes on spcom_device_open/spcom_device_release
 - incremented when timeout on spcom_rx() in order to drop later

txn_id of incoming server response is used to validate that incoming
packet has same sequence number as expected by client channel context.

Also added logic to support detection of communication
role (client/server):
 - for server: first packet is incoming from SPU
 - for client: first packet is send to SPU


Change-Id: Ied52fd6fa41255db817f1aabc2f4acf2616ee75c
Signed-off-by: default avatarKonstantin Dorfman <kdorfman@codeaurora.org>
parent ec0348d9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment