Skip to content

Commit 39191ce

Browse files
jhovoldbroonie
authored andcommitted
ASoc: qcom: q6afe: fix bad guard conversion
A recent spinlock guard conversion used the wrong guard so that interrupts are no longer disabled while holding the port list lock. Based on a cursory look this appears to be safe currently, but it could cause a deadlock if one of these helpers are ever called in interrupt context. Fixes: 4b1edbb ("ASoC: qcom: q6afe: Use guard() for spin locks") Cc: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> Signed-off-by: Johan Hovold <johan@kernel.org> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> Link: https://patch.msgid.link/20251203105542.24765-2-johan@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 57d508b commit 39191ce

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

sound/soc/qcom/qdsp6/q6afe.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,7 @@ static struct q6afe_port *q6afe_find_port(struct q6afe *afe, int token)
947947
struct q6afe_port *p;
948948
struct q6afe_port *ret = NULL;
949949

950-
guard(spinlock)(&afe->port_list_lock);
950+
guard(spinlock_irqsave)(&afe->port_list_lock);
951951
list_for_each_entry(p, &afe->port_list, node)
952952
if (p->token == token) {
953953
ret = p;
@@ -1807,7 +1807,7 @@ struct q6afe_port *q6afe_port_get_from_id(struct device *dev, int id)
18071807
port->cfg_type = cfg_type;
18081808
kref_init(&port->refcount);
18091809

1810-
guard(spinlock)(&afe->port_list_lock);
1810+
guard(spinlock_irqsave)(&afe->port_list_lock);
18111811
list_add_tail(&port->node, &afe->port_list);
18121812

18131813
return port;

0 commit comments

Comments
 (0)