Skip to content

Commit

Permalink
remoteproc: qcom: q6v5: shore up resource probe handling
Browse files Browse the repository at this point in the history
Commit d5269c4 ("remoteproc: qcom: q6v5: Propagate EPROBE_DEFER")
fixed up our probe code to handle -EPROBE_DEFER, but it ignored one of
our interrupts, and it also didn't really handle all the other error
codes you might get (e.g., with a bad DT definition). Handle those all
explicitly.

Fixes: d5269c4 ("remoteproc: qcom: q6v5: Propagate EPROBE_DEFER")
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
  • Loading branch information
Brian Norris authored and Bjorn Andersson committed Oct 10, 2018
1 parent 6e6b1ad commit 1e2517d
Showing 1 changed file with 36 additions and 8 deletions.
44 changes: 36 additions & 8 deletions drivers/remoteproc/qcom_q6v5.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,14 @@ int qcom_q6v5_init(struct qcom_q6v5 *q6v5, struct platform_device *pdev,
init_completion(&q6v5->stop_done);

q6v5->wdog_irq = platform_get_irq_byname(pdev, "wdog");
if (q6v5->wdog_irq < 0) {
if (q6v5->wdog_irq != -EPROBE_DEFER)
dev_err(&pdev->dev,
"failed to retrieve wdog IRQ: %d\n",
q6v5->wdog_irq);
return q6v5->wdog_irq;
}

ret = devm_request_threaded_irq(&pdev->dev, q6v5->wdog_irq,
NULL, q6v5_wdog_interrupt,
IRQF_TRIGGER_RISING | IRQF_ONESHOT,
Expand All @@ -197,8 +205,13 @@ int qcom_q6v5_init(struct qcom_q6v5 *q6v5, struct platform_device *pdev,
}

q6v5->fatal_irq = platform_get_irq_byname(pdev, "fatal");
if (q6v5->fatal_irq == -EPROBE_DEFER)
return -EPROBE_DEFER;
if (q6v5->fatal_irq < 0) {
if (q6v5->fatal_irq != -EPROBE_DEFER)
dev_err(&pdev->dev,
"failed to retrieve fatal IRQ: %d\n",
q6v5->fatal_irq);
return q6v5->fatal_irq;
}

ret = devm_request_threaded_irq(&pdev->dev, q6v5->fatal_irq,
NULL, q6v5_fatal_interrupt,
Expand All @@ -210,8 +223,13 @@ int qcom_q6v5_init(struct qcom_q6v5 *q6v5, struct platform_device *pdev,
}

q6v5->ready_irq = platform_get_irq_byname(pdev, "ready");
if (q6v5->ready_irq == -EPROBE_DEFER)
return -EPROBE_DEFER;
if (q6v5->ready_irq < 0) {
if (q6v5->ready_irq != -EPROBE_DEFER)
dev_err(&pdev->dev,
"failed to retrieve ready IRQ: %d\n",
q6v5->ready_irq);
return q6v5->ready_irq;
}

ret = devm_request_threaded_irq(&pdev->dev, q6v5->ready_irq,
NULL, q6v5_ready_interrupt,
Expand All @@ -223,8 +241,13 @@ int qcom_q6v5_init(struct qcom_q6v5 *q6v5, struct platform_device *pdev,
}

q6v5->handover_irq = platform_get_irq_byname(pdev, "handover");
if (q6v5->handover_irq == -EPROBE_DEFER)
return -EPROBE_DEFER;
if (q6v5->handover_irq < 0) {
if (q6v5->handover_irq != -EPROBE_DEFER)
dev_err(&pdev->dev,
"failed to retrieve handover IRQ: %d\n",
q6v5->handover_irq);
return q6v5->handover_irq;
}

ret = devm_request_threaded_irq(&pdev->dev, q6v5->handover_irq,
NULL, q6v5_handover_interrupt,
Expand All @@ -237,8 +260,13 @@ int qcom_q6v5_init(struct qcom_q6v5 *q6v5, struct platform_device *pdev,
disable_irq(q6v5->handover_irq);

q6v5->stop_irq = platform_get_irq_byname(pdev, "stop-ack");
if (q6v5->stop_irq == -EPROBE_DEFER)
return -EPROBE_DEFER;
if (q6v5->stop_irq < 0) {
if (q6v5->stop_irq != -EPROBE_DEFER)
dev_err(&pdev->dev,
"failed to retrieve stop-ack IRQ: %d\n",
q6v5->stop_irq);
return q6v5->stop_irq;
}

ret = devm_request_threaded_irq(&pdev->dev, q6v5->stop_irq,
NULL, q6v5_stop_interrupt,
Expand Down

0 comments on commit 1e2517d

Please sign in to comment.