remoteproc: stm32: Request IRQ with platform device
authorMathieu Poirier <mathieu.poirier@linaro.org>
Tue, 14 Jul 2020 20:04:36 +0000 (14:04 -0600)
committerBjorn Andersson <bjorn.andersson@linaro.org>
Sat, 18 Jul 2020 00:34:11 +0000 (17:34 -0700)
Request IRQ with platform device rather than remote proc in order to
call stm32_rproc_parse_dt() before rproc_alloc().  That way we can
know whether we need to synchronise with the MCU or not.

Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Reviewed-by: Loic Pallardy <loic.pallardy@st.com>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20200714200445.1427257-3-mathieu.poirier@linaro.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
drivers/remoteproc/stm32_rproc.c

index 2973ba2..c00f60d 100644 (file)
@@ -262,7 +262,8 @@ static int stm32_rproc_parse_fw(struct rproc *rproc, const struct firmware *fw)
 
 static irqreturn_t stm32_rproc_wdg(int irq, void *data)
 {
-       struct rproc *rproc = data;
+       struct platform_device *pdev = data;
+       struct rproc *rproc = platform_get_drvdata(pdev);
 
        rproc_report_crash(rproc, RPROC_WATCHDOG);
 
@@ -554,7 +555,7 @@ static int stm32_rproc_parse_dt(struct platform_device *pdev)
 
        if (irq > 0) {
                err = devm_request_irq(dev, irq, stm32_rproc_wdg, 0,
-                                      dev_name(dev), rproc);
+                                      dev_name(dev), pdev);
                if (err) {
                        dev_err(dev, "failed to request wdg irq\n");
                        return err;