net: qrtr: genpool: Change the order of IRQ registration
Previously, irq_setup was registered before irq_xfer in the init function. This can lead to an 'unbalanced IRQ' race condition error for the irq_xfer since irq_xfer was not being enabled when needed in the worker function. The fix switches the IRQ registration order, registering irq_xfer before irq_setup since data is expected in irq context only after the setup is done. Change-Id: I554fef12300fd2c2b2aebe13a86c5cd0dc10aac1 Signed-off-by: Sarannya S <quic_sarannya@quicinc.com>
This commit is contained in:
parent
9f82e4920c
commit
f7279bb8f1
1 changed files with 15 additions and 15 deletions
|
|
@ -1,5 +1,5 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/* Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. */
|
||||
/* Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved. */
|
||||
|
||||
#include <linux/genalloc.h>
|
||||
#include <linux/mailbox_client.h>
|
||||
|
|
@ -429,20 +429,6 @@ static int qrtr_genpool_irq_init(struct qrtr_genpool_dev *qdev)
|
|||
struct device *dev = qdev->dev;
|
||||
int irq, rc;
|
||||
|
||||
irq = of_irq_get(dev->of_node, IRQ_SETUP_IDX);
|
||||
if (irq < 0)
|
||||
return irq;
|
||||
|
||||
qdev->irq_setup = irq;
|
||||
snprintf(qdev->irq_setup_label, LABEL_SIZE, "%s-setup", qdev->label);
|
||||
rc = devm_request_irq(dev, qdev->irq_setup, qrtr_genpool_setup_intr, 0,
|
||||
qdev->irq_setup_label, qdev);
|
||||
if (rc) {
|
||||
dev_err(dev, "failed to request setup IRQ: %d\n", rc);
|
||||
return rc;
|
||||
}
|
||||
enable_irq_wake(qdev->irq_setup);
|
||||
|
||||
irq = of_irq_get(dev->of_node, IRQ_XFER_IDX);
|
||||
if (irq < 0)
|
||||
return irq;
|
||||
|
|
@ -457,6 +443,20 @@ static int qrtr_genpool_irq_init(struct qrtr_genpool_dev *qdev)
|
|||
}
|
||||
enable_irq_wake(qdev->irq_xfer);
|
||||
|
||||
irq = of_irq_get(dev->of_node, IRQ_SETUP_IDX);
|
||||
if (irq < 0)
|
||||
return irq;
|
||||
|
||||
qdev->irq_setup = irq;
|
||||
snprintf(qdev->irq_setup_label, LABEL_SIZE, "%s-setup", qdev->label);
|
||||
rc = devm_request_irq(dev, qdev->irq_setup, qrtr_genpool_setup_intr, 0,
|
||||
qdev->irq_setup_label, qdev);
|
||||
if (rc) {
|
||||
dev_err(dev, "failed to request setup IRQ: %d\n", rc);
|
||||
return rc;
|
||||
}
|
||||
enable_irq_wake(qdev->irq_setup);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue