On 3/6/2025 5:29 PM, Jeff Hugo wrote: > From: Jeffrey Hugo <quic_jhugo@xxxxxxxxxxx> > > A client driver may use mhi_unprepare_from_transfer() to quiesce > incoming data during the client driver's tear down. The client driver > might also be processing data at the same time, resulting in a call to > mhi_queue_buf() which will invoke mhi_gen_tre(). If mhi_gen_tre() runs > after mhi_unprepare_from_transfer() has torn down the channel, a panic > will occur due to an invalid dereference leading to a page fault. > > This occurs because mhi_gen_tre() does not verify the channel state > after locking it. Fix this by having mhi_gen_tre() confirm the channel > state is valid, or return error to avoid accessing deinitialized data. > > Fixes: b89b6a863dd5 ("bus: mhi: host: Add spinlock to protect WP access when queueing TREs") > Signed-off-by: Jeffrey Hugo <quic_jhugo@xxxxxxxxxxx> > Signed-off-by: Jeff Hugo <jeff.hugo@xxxxxxxxxxxxxxxx> Reviewed-by: Youssef Samir <quic_yabdulra@xxxxxxxxxxx>