mirror of
https://github.com/torvalds/linux.git
synced 2026-08-02 05:12:01 +02:00
rpmsg: glink: Use irqsave/irqrestore spin locks
The glink rx done function can be called from both soft irq and hard irq context. To avoid any potential deadlock scenarios, use the irq save and restore variants of the spin locks. Change-Id: Id85367226a16db1c0e44f8e00c7b7f74f4c8b8fd Signed-off-by: Chris Lew <quic_clew@quicinc.com>
This commit is contained in:
parent
28149075f5
commit
d19561af42
|
|
@ -642,6 +642,7 @@ static void qcom_glink_rx_done(struct qcom_glink *glink,
|
|||
struct glink_channel *channel,
|
||||
struct glink_core_rx_intent *intent)
|
||||
{
|
||||
unsigned long flags;
|
||||
int ret = -EAGAIN;
|
||||
|
||||
/* We don't send RX_DONE to intentless systems */
|
||||
|
|
@ -653,13 +654,13 @@ static void qcom_glink_rx_done(struct qcom_glink *glink,
|
|||
|
||||
/* Take it off the tree of receive intents */
|
||||
if (!intent->reuse) {
|
||||
spin_lock(&channel->intent_lock);
|
||||
spin_lock_irqsave(&channel->intent_lock, flags);
|
||||
idr_remove(&channel->liids, intent->id);
|
||||
spin_unlock(&channel->intent_lock);
|
||||
spin_unlock_irqrestore(&channel->intent_lock, flags);
|
||||
}
|
||||
|
||||
/* Schedule the sending of a rx_done indication */
|
||||
spin_lock(&channel->intent_lock);
|
||||
spin_lock_irqsave(&channel->intent_lock, flags);
|
||||
if (list_empty(&channel->done_intents))
|
||||
ret = __qcom_glink_rx_done(glink, channel, intent, false);
|
||||
|
||||
|
|
@ -667,7 +668,7 @@ static void qcom_glink_rx_done(struct qcom_glink *glink,
|
|||
list_add_tail(&intent->node, &channel->done_intents);
|
||||
kthread_queue_work(&glink->kworker, &channel->intent_work);
|
||||
}
|
||||
spin_unlock(&channel->intent_lock);
|
||||
spin_unlock_irqrestore(&channel->intent_lock, flags);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user