* [PATCH V2 0/2] remoteproc: imx: add start up delay
@ 2022-11-02 11:24 ` Peng Fan (OSS)
0 siblings, 0 replies; 14+ messages in thread
From: Peng Fan (OSS) @ 2022-11-02 11:24 UTC (permalink / raw)
To: andersson, mathieu.poirier, shawnguo, s.hauer, robh+dt,
krzysztof.kozlowski+dt
Cc: kernel, festevam, linux-imx, linux-remoteproc, linux-arm-kernel,
linux-kernel, devicetree, Peng Fan
From: Peng Fan <peng.fan@nxp.com>
V2:
Rebased on linux-next
V1:
https://lore.kernel.org/lkml/20220609123500.3492475-1-peng.fan@oss.nxp.com/
There is case that after remoteproc start remote processor[M4], the M4
runs slow and before M4 finish its own rpmsg framework initialization,
linux sends out vring kick message, then M4 firmware drops the kick
message. Some NXP released Cortex-M[x] images has such limitation that
it requires linux sends out vring kick message after M4 firmware finish
its rpmsg framework initialization.
The best case is to use a method to let M4 notify Linux that M4 has
finished initialization, but we could not patch released firmware,
then update driver to detect notification.
So add delay before linux send out vring kick message. It is not good to
use a fixed time delay in driver, so I choose to get that from device
tree.
Peng Fan (2):
dt-bindings: remoteproc: imx_rproc: add fsl,startup-delay-ms
remoteproc: imx_rproc: delay after kick remote processor
.../devicetree/bindings/remoteproc/fsl,imx-rproc.yaml | 4 ++++
drivers/remoteproc/imx_rproc.c | 9 +++++++++
2 files changed, 13 insertions(+)
--
2.37.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH V2 1/2] dt-bindings: remoteproc: imx_rproc: add fsl,startup-delay-ms
2022-11-02 11:24 ` Peng Fan (OSS)
@ 2022-11-02 11:24 ` Peng Fan (OSS)
-1 siblings, 0 replies; 14+ messages in thread
From: Peng Fan (OSS) @ 2022-11-02 11:24 UTC (permalink / raw)
To: andersson, mathieu.poirier, shawnguo, s.hauer, robh+dt,
krzysztof.kozlowski+dt
Cc: kernel, festevam, linux-imx, linux-remoteproc, linux-arm-kernel,
linux-kernel, devicetree, Peng Fan
From: Peng Fan <peng.fan@nxp.com>
add fsl,startup-delay-ms property indicating delay some time after just
kicks remote processor.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
.../devicetree/bindings/remoteproc/fsl,imx-rproc.yaml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml b/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml
index ad3b8d4ccd91..d99d3342ad52 100644
--- a/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml
+++ b/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml
@@ -76,6 +76,10 @@ properties:
This property is to specify the resource id of the remote processor in SoC
which supports SCFW
+ fsl,startup-delay-ms:
+ $ref: "/schemas/types.yaml#/definitions/uint32"
+ description: Startup time that remote processor ready for communication
+
required:
- compatible
--
2.37.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH V2 1/2] dt-bindings: remoteproc: imx_rproc: add fsl,startup-delay-ms
@ 2022-11-02 11:24 ` Peng Fan (OSS)
0 siblings, 0 replies; 14+ messages in thread
From: Peng Fan (OSS) @ 2022-11-02 11:24 UTC (permalink / raw)
To: andersson, mathieu.poirier, shawnguo, s.hauer, robh+dt,
krzysztof.kozlowski+dt
Cc: kernel, festevam, linux-imx, linux-remoteproc, linux-arm-kernel,
linux-kernel, devicetree, Peng Fan
From: Peng Fan <peng.fan@nxp.com>
add fsl,startup-delay-ms property indicating delay some time after just
kicks remote processor.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
.../devicetree/bindings/remoteproc/fsl,imx-rproc.yaml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml b/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml
index ad3b8d4ccd91..d99d3342ad52 100644
--- a/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml
+++ b/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml
@@ -76,6 +76,10 @@ properties:
This property is to specify the resource id of the remote processor in SoC
which supports SCFW
+ fsl,startup-delay-ms:
+ $ref: "/schemas/types.yaml#/definitions/uint32"
+ description: Startup time that remote processor ready for communication
+
required:
- compatible
--
2.37.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH V2 1/2] dt-bindings: remoteproc: imx_rproc: add fsl,startup-delay-ms
2022-11-02 11:24 ` Peng Fan (OSS)
@ 2022-11-02 19:01 ` Krzysztof Kozlowski
-1 siblings, 0 replies; 14+ messages in thread
From: Krzysztof Kozlowski @ 2022-11-02 19:01 UTC (permalink / raw)
To: Peng Fan (OSS),
andersson, mathieu.poirier, shawnguo, s.hauer, robh+dt,
krzysztof.kozlowski+dt
Cc: kernel, festevam, linux-imx, linux-remoteproc, linux-arm-kernel,
linux-kernel, devicetree, Peng Fan
On 02/11/2022 07:24, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
>
> add fsl,startup-delay-ms property indicating delay some time after just
> kicks remote processor.
Start sentences with capital letter.
>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
> .../devicetree/bindings/remoteproc/fsl,imx-rproc.yaml | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml b/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml
> index ad3b8d4ccd91..d99d3342ad52 100644
> --- a/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml
> +++ b/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml
> @@ -76,6 +76,10 @@ properties:
> This property is to specify the resource id of the remote processor in SoC
> which supports SCFW
>
> + fsl,startup-delay-ms:
> + $ref: "/schemas/types.yaml#/definitions/uint32"
Drop quotes.
> + description: Startup time that remote processor ready for communication
Looks quite hacky...
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH V2 1/2] dt-bindings: remoteproc: imx_rproc: add fsl,startup-delay-ms
@ 2022-11-02 19:01 ` Krzysztof Kozlowski
0 siblings, 0 replies; 14+ messages in thread
From: Krzysztof Kozlowski @ 2022-11-02 19:01 UTC (permalink / raw)
To: Peng Fan (OSS),
andersson, mathieu.poirier, shawnguo, s.hauer, robh+dt,
krzysztof.kozlowski+dt
Cc: kernel, festevam, linux-imx, linux-remoteproc, linux-arm-kernel,
linux-kernel, devicetree, Peng Fan
On 02/11/2022 07:24, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
>
> add fsl,startup-delay-ms property indicating delay some time after just
> kicks remote processor.
Start sentences with capital letter.
>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
> .../devicetree/bindings/remoteproc/fsl,imx-rproc.yaml | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml b/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml
> index ad3b8d4ccd91..d99d3342ad52 100644
> --- a/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml
> +++ b/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml
> @@ -76,6 +76,10 @@ properties:
> This property is to specify the resource id of the remote processor in SoC
> which supports SCFW
>
> + fsl,startup-delay-ms:
> + $ref: "/schemas/types.yaml#/definitions/uint32"
Drop quotes.
> + description: Startup time that remote processor ready for communication
Looks quite hacky...
Best regards,
Krzysztof
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH V2 2/2] remoteproc: imx_rproc: delay after kick remote processor
2022-11-02 11:24 ` Peng Fan (OSS)
@ 2022-11-02 11:24 ` Peng Fan (OSS)
-1 siblings, 0 replies; 14+ messages in thread
From: Peng Fan (OSS) @ 2022-11-02 11:24 UTC (permalink / raw)
To: andersson, mathieu.poirier, shawnguo, s.hauer, robh+dt,
krzysztof.kozlowski+dt
Cc: kernel, festevam, linux-imx, linux-remoteproc, linux-arm-kernel,
linux-kernel, devicetree, Peng Fan
From: Peng Fan <peng.fan@nxp.com>
There is case that after remoteproc start remote processor[M4], the M4
runs slow and before M4 finish its own rpmsg framework initialization,
linux sends out vring kick message, then M4 firmware drops the kick
message. Some NXP released Cortex-M[x] images has such limitation that
it requires linux sends out vring kick message after M4 firmware finish
its rpmsg framework initialization.
So add delay before linux send out vring kick message.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
drivers/remoteproc/imx_rproc.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c
index 9fc978e0393c..aa4e06f54f27 100644
--- a/drivers/remoteproc/imx_rproc.c
+++ b/drivers/remoteproc/imx_rproc.c
@@ -6,6 +6,7 @@
#include <dt-bindings/firmware/imx/rsrc.h>
#include <linux/arm-smccc.h>
#include <linux/clk.h>
+#include <linux/delay.h>
#include <linux/err.h>
#include <linux/firmware/imx/sci.h>
#include <linux/interrupt.h>
@@ -110,6 +111,7 @@ struct imx_rproc {
u32 core_index;
struct device **pd_dev;
struct device_link **pd_dev_link;
+ u32 startup_delay;
};
static const struct imx_rproc_att imx_rproc_att_imx93[] = {
@@ -382,6 +384,9 @@ static int imx_rproc_start(struct rproc *rproc)
if (ret)
dev_err(dev, "Failed to enable remote core!\n");
+ if (priv->startup_delay)
+ msleep_interruptible(priv->startup_delay);
+
return ret;
}
@@ -1087,6 +1092,10 @@ static int imx_rproc_probe(struct platform_device *pdev)
if (rproc->state != RPROC_DETACHED)
rproc->auto_boot = of_property_read_bool(np, "fsl,auto-boot");
+ ret = of_property_read_u32(np, "fsl,startup-delay-ms", &priv->startup_delay);
+ if (ret)
+ priv->startup_delay = 0;
+
ret = rproc_add(rproc);
if (ret) {
dev_err(dev, "rproc_add failed\n");
--
2.37.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH V2 2/2] remoteproc: imx_rproc: delay after kick remote processor
@ 2022-11-02 11:24 ` Peng Fan (OSS)
0 siblings, 0 replies; 14+ messages in thread
From: Peng Fan (OSS) @ 2022-11-02 11:24 UTC (permalink / raw)
To: andersson, mathieu.poirier, shawnguo, s.hauer, robh+dt,
krzysztof.kozlowski+dt
Cc: kernel, festevam, linux-imx, linux-remoteproc, linux-arm-kernel,
linux-kernel, devicetree, Peng Fan
From: Peng Fan <peng.fan@nxp.com>
There is case that after remoteproc start remote processor[M4], the M4
runs slow and before M4 finish its own rpmsg framework initialization,
linux sends out vring kick message, then M4 firmware drops the kick
message. Some NXP released Cortex-M[x] images has such limitation that
it requires linux sends out vring kick message after M4 firmware finish
its rpmsg framework initialization.
So add delay before linux send out vring kick message.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
drivers/remoteproc/imx_rproc.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c
index 9fc978e0393c..aa4e06f54f27 100644
--- a/drivers/remoteproc/imx_rproc.c
+++ b/drivers/remoteproc/imx_rproc.c
@@ -6,6 +6,7 @@
#include <dt-bindings/firmware/imx/rsrc.h>
#include <linux/arm-smccc.h>
#include <linux/clk.h>
+#include <linux/delay.h>
#include <linux/err.h>
#include <linux/firmware/imx/sci.h>
#include <linux/interrupt.h>
@@ -110,6 +111,7 @@ struct imx_rproc {
u32 core_index;
struct device **pd_dev;
struct device_link **pd_dev_link;
+ u32 startup_delay;
};
static const struct imx_rproc_att imx_rproc_att_imx93[] = {
@@ -382,6 +384,9 @@ static int imx_rproc_start(struct rproc *rproc)
if (ret)
dev_err(dev, "Failed to enable remote core!\n");
+ if (priv->startup_delay)
+ msleep_interruptible(priv->startup_delay);
+
return ret;
}
@@ -1087,6 +1092,10 @@ static int imx_rproc_probe(struct platform_device *pdev)
if (rproc->state != RPROC_DETACHED)
rproc->auto_boot = of_property_read_bool(np, "fsl,auto-boot");
+ ret = of_property_read_u32(np, "fsl,startup-delay-ms", &priv->startup_delay);
+ if (ret)
+ priv->startup_delay = 0;
+
ret = rproc_add(rproc);
if (ret) {
dev_err(dev, "rproc_add failed\n");
--
2.37.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH V2 0/2] remoteproc: imx: add start up delay
2022-11-02 11:24 ` Peng Fan (OSS)
@ 2022-11-02 17:29 ` Mathieu Poirier
-1 siblings, 0 replies; 14+ messages in thread
From: Mathieu Poirier @ 2022-11-02 17:29 UTC (permalink / raw)
To: Peng Fan (OSS)
Cc: andersson, shawnguo, s.hauer, robh+dt, krzysztof.kozlowski+dt,
kernel, festevam, linux-imx, linux-remoteproc, linux-arm-kernel,
linux-kernel, devicetree, Peng Fan
On Wed, 2 Nov 2022 at 05:23, Peng Fan (OSS) <peng.fan@oss.nxp.com> wrote:
>
> From: Peng Fan <peng.fan@nxp.com>
>
> V2:
> Rebased on linux-next
>
> V1:
> https://lore.kernel.org/lkml/20220609123500.3492475-1-peng.fan@oss.nxp.com/
>
> There is case that after remoteproc start remote processor[M4], the M4
> runs slow and before M4 finish its own rpmsg framework initialization,
> linux sends out vring kick message, then M4 firmware drops the kick
> message. Some NXP released Cortex-M[x] images has such limitation that
> it requires linux sends out vring kick message after M4 firmware finish
> its rpmsg framework initialization.
>
> The best case is to use a method to let M4 notify Linux that M4 has
> finished initialization, but we could not patch released firmware,
> then update driver to detect notification.
>
> So add delay before linux send out vring kick message. It is not good to
> use a fixed time delay in driver, so I choose to get that from device
> tree.
>
From where I stand this is a hack to hide the lack of motivation to
enact the real solution that is outlined above. I also wonder how
these problems were not caught during the testing phase. Either find
a way to upgrade your firmware or keep this in your internal tree.
> Peng Fan (2):
> dt-bindings: remoteproc: imx_rproc: add fsl,startup-delay-ms
> remoteproc: imx_rproc: delay after kick remote processor
>
> .../devicetree/bindings/remoteproc/fsl,imx-rproc.yaml | 4 ++++
> drivers/remoteproc/imx_rproc.c | 9 +++++++++
> 2 files changed, 13 insertions(+)
>
> --
> 2.37.1
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH V2 0/2] remoteproc: imx: add start up delay
@ 2022-11-02 17:29 ` Mathieu Poirier
0 siblings, 0 replies; 14+ messages in thread
From: Mathieu Poirier @ 2022-11-02 17:29 UTC (permalink / raw)
To: Peng Fan (OSS)
Cc: andersson, shawnguo, s.hauer, robh+dt, krzysztof.kozlowski+dt,
kernel, festevam, linux-imx, linux-remoteproc, linux-arm-kernel,
linux-kernel, devicetree, Peng Fan
On Wed, 2 Nov 2022 at 05:23, Peng Fan (OSS) <peng.fan@oss.nxp.com> wrote:
>
> From: Peng Fan <peng.fan@nxp.com>
>
> V2:
> Rebased on linux-next
>
> V1:
> https://lore.kernel.org/lkml/20220609123500.3492475-1-peng.fan@oss.nxp.com/
>
> There is case that after remoteproc start remote processor[M4], the M4
> runs slow and before M4 finish its own rpmsg framework initialization,
> linux sends out vring kick message, then M4 firmware drops the kick
> message. Some NXP released Cortex-M[x] images has such limitation that
> it requires linux sends out vring kick message after M4 firmware finish
> its rpmsg framework initialization.
>
> The best case is to use a method to let M4 notify Linux that M4 has
> finished initialization, but we could not patch released firmware,
> then update driver to detect notification.
>
> So add delay before linux send out vring kick message. It is not good to
> use a fixed time delay in driver, so I choose to get that from device
> tree.
>
From where I stand this is a hack to hide the lack of motivation to
enact the real solution that is outlined above. I also wonder how
these problems were not caught during the testing phase. Either find
a way to upgrade your firmware or keep this in your internal tree.
> Peng Fan (2):
> dt-bindings: remoteproc: imx_rproc: add fsl,startup-delay-ms
> remoteproc: imx_rproc: delay after kick remote processor
>
> .../devicetree/bindings/remoteproc/fsl,imx-rproc.yaml | 4 ++++
> drivers/remoteproc/imx_rproc.c | 9 +++++++++
> 2 files changed, 13 insertions(+)
>
> --
> 2.37.1
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 14+ messages in thread
* RE: [PATCH V2 0/2] remoteproc: imx: add start up delay
2022-11-02 17:29 ` Mathieu Poirier
@ 2022-11-03 5:08 ` Peng Fan
-1 siblings, 0 replies; 14+ messages in thread
From: Peng Fan @ 2022-11-03 5:08 UTC (permalink / raw)
To: Mathieu Poirier, Peng Fan (OSS)
Cc: andersson, shawnguo, s.hauer, robh+dt, krzysztof.kozlowski+dt,
kernel, festevam, dl-linux-imx, linux-remoteproc,
linux-arm-kernel, linux-kernel, devicetree
> Subject: Re: [PATCH V2 0/2] remoteproc: imx: add start up delay
>
> On Wed, 2 Nov 2022 at 05:23, Peng Fan (OSS) <peng.fan@oss.nxp.com>
> wrote:
> >
> > From: Peng Fan <peng.fan@nxp.com>
> >
> > V2:
> > Rebased on linux-next
> >
> > V1:
> >
> >
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore
> > .kernel.org%2Flkml%2F20220609123500.3492475-1-
> peng.fan%40oss.nxp.com%2
> >
> F&data=05%7C01%7Cpeng.fan%40nxp.com%7Cf14584bdef9349e744ca
> 08dabcf7
> >
> e1be%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C63803007007
> 2451509%7
> >
> CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJ
> BTiI6Ik1
> >
> haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Ck73gkOPpNVT
> kcZL8olCZP8B
> > %2BrIpZHV48uZBl2R8HdM%3D&reserved=0
> >
> > There is case that after remoteproc start remote processor[M4], the M4
> > runs slow and before M4 finish its own rpmsg framework initialization,
> > linux sends out vring kick message, then M4 firmware drops the kick
> > message. Some NXP released Cortex-M[x] images has such limitation that
> > it requires linux sends out vring kick message after M4 firmware
> > finish its rpmsg framework initialization.
> >
> > The best case is to use a method to let M4 notify Linux that M4 has
> > finished initialization, but we could not patch released firmware,
> > then update driver to detect notification.
> >
> > So add delay before linux send out vring kick message. It is not good
> > to use a fixed time delay in driver, so I choose to get that from
> > device tree.
> >
>
> From where I stand this is a hack to hide the lack of motivation to enact the
> real solution that is outlined above. I also wonder how these problems
> were not caught during the testing phase. Either find a way to upgrade your
> firmware or keep this in your internal tree.
In the beginning, i.mx not migrated to use remoteproc, i.MX release only support
uboot kick Cortex-M core and use downstream imx_rpmsg driver to
communicate with remote core. There is no runtime stop/start.
After migrated to remoteproc, we do see some issue, but old firmware was
there.
Thanks,
Peng.
>
> > Peng Fan (2):
> > dt-bindings: remoteproc: imx_rproc: add fsl,startup-delay-ms
> > remoteproc: imx_rproc: delay after kick remote processor
> >
> > .../devicetree/bindings/remoteproc/fsl,imx-rproc.yaml | 4 ++++
> > drivers/remoteproc/imx_rproc.c | 9 +++++++++
> > 2 files changed, 13 insertions(+)
> >
> > --
> > 2.37.1
> >
^ permalink raw reply [flat|nested] 14+ messages in thread
* RE: [PATCH V2 0/2] remoteproc: imx: add start up delay
@ 2022-11-03 5:08 ` Peng Fan
0 siblings, 0 replies; 14+ messages in thread
From: Peng Fan @ 2022-11-03 5:08 UTC (permalink / raw)
To: Mathieu Poirier, Peng Fan (OSS)
Cc: andersson, shawnguo, s.hauer, robh+dt, krzysztof.kozlowski+dt,
kernel, festevam, dl-linux-imx, linux-remoteproc,
linux-arm-kernel, linux-kernel, devicetree
> Subject: Re: [PATCH V2 0/2] remoteproc: imx: add start up delay
>
> On Wed, 2 Nov 2022 at 05:23, Peng Fan (OSS) <peng.fan@oss.nxp.com>
> wrote:
> >
> > From: Peng Fan <peng.fan@nxp.com>
> >
> > V2:
> > Rebased on linux-next
> >
> > V1:
> >
> >
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore
> > .kernel.org%2Flkml%2F20220609123500.3492475-1-
> peng.fan%40oss.nxp.com%2
> >
> F&data=05%7C01%7Cpeng.fan%40nxp.com%7Cf14584bdef9349e744ca
> 08dabcf7
> >
> e1be%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C63803007007
> 2451509%7
> >
> CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJ
> BTiI6Ik1
> >
> haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Ck73gkOPpNVT
> kcZL8olCZP8B
> > %2BrIpZHV48uZBl2R8HdM%3D&reserved=0
> >
> > There is case that after remoteproc start remote processor[M4], the M4
> > runs slow and before M4 finish its own rpmsg framework initialization,
> > linux sends out vring kick message, then M4 firmware drops the kick
> > message. Some NXP released Cortex-M[x] images has such limitation that
> > it requires linux sends out vring kick message after M4 firmware
> > finish its rpmsg framework initialization.
> >
> > The best case is to use a method to let M4 notify Linux that M4 has
> > finished initialization, but we could not patch released firmware,
> > then update driver to detect notification.
> >
> > So add delay before linux send out vring kick message. It is not good
> > to use a fixed time delay in driver, so I choose to get that from
> > device tree.
> >
>
> From where I stand this is a hack to hide the lack of motivation to enact the
> real solution that is outlined above. I also wonder how these problems
> were not caught during the testing phase. Either find a way to upgrade your
> firmware or keep this in your internal tree.
In the beginning, i.mx not migrated to use remoteproc, i.MX release only support
uboot kick Cortex-M core and use downstream imx_rpmsg driver to
communicate with remote core. There is no runtime stop/start.
After migrated to remoteproc, we do see some issue, but old firmware was
there.
Thanks,
Peng.
>
> > Peng Fan (2):
> > dt-bindings: remoteproc: imx_rproc: add fsl,startup-delay-ms
> > remoteproc: imx_rproc: delay after kick remote processor
> >
> > .../devicetree/bindings/remoteproc/fsl,imx-rproc.yaml | 4 ++++
> > drivers/remoteproc/imx_rproc.c | 9 +++++++++
> > 2 files changed, 13 insertions(+)
> >
> > --
> > 2.37.1
> >
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH V2 0/2] remoteproc: imx: add start up delay
2022-11-03 5:08 ` Peng Fan
@ 2022-11-04 15:33 ` Mathieu Poirier
-1 siblings, 0 replies; 14+ messages in thread
From: Mathieu Poirier @ 2022-11-04 15:33 UTC (permalink / raw)
To: Peng Fan
Cc: Peng Fan (OSS),
andersson, shawnguo, s.hauer, robh+dt, krzysztof.kozlowski+dt,
kernel, festevam, dl-linux-imx, linux-remoteproc,
linux-arm-kernel, linux-kernel, devicetree
On Thu, Nov 03, 2022 at 05:08:15AM +0000, Peng Fan wrote:
> > Subject: Re: [PATCH V2 0/2] remoteproc: imx: add start up delay
> >
> > On Wed, 2 Nov 2022 at 05:23, Peng Fan (OSS) <peng.fan@oss.nxp.com>
> > wrote:
> > >
> > > From: Peng Fan <peng.fan@nxp.com>
> > >
> > > V2:
> > > Rebased on linux-next
> > >
> > > V1:
> > >
> > >
> > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore
> > > .kernel.org%2Flkml%2F20220609123500.3492475-1-
> > peng.fan%40oss.nxp.com%2
> > >
> > F&data=05%7C01%7Cpeng.fan%40nxp.com%7Cf14584bdef9349e744ca
> > 08dabcf7
> > >
> > e1be%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C63803007007
> > 2451509%7
> > >
> > CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJ
> > BTiI6Ik1
> > >
> > haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Ck73gkOPpNVT
> > kcZL8olCZP8B
> > > %2BrIpZHV48uZBl2R8HdM%3D&reserved=0
> > >
> > > There is case that after remoteproc start remote processor[M4], the M4
> > > runs slow and before M4 finish its own rpmsg framework initialization,
> > > linux sends out vring kick message, then M4 firmware drops the kick
> > > message. Some NXP released Cortex-M[x] images has such limitation that
> > > it requires linux sends out vring kick message after M4 firmware
> > > finish its rpmsg framework initialization.
> > >
> > > The best case is to use a method to let M4 notify Linux that M4 has
> > > finished initialization, but we could not patch released firmware,
> > > then update driver to detect notification.
> > >
> > > So add delay before linux send out vring kick message. It is not good
> > > to use a fixed time delay in driver, so I choose to get that from
> > > device tree.
> > >
> >
> > From where I stand this is a hack to hide the lack of motivation to enact the
> > real solution that is outlined above. I also wonder how these problems
> > were not caught during the testing phase. Either find a way to upgrade your
> > firmware or keep this in your internal tree.
> In the beginning, i.mx not migrated to use remoteproc, i.MX release only support
> uboot kick Cortex-M core and use downstream imx_rpmsg driver to
> communicate with remote core. There is no runtime stop/start.
>
> After migrated to remoteproc, we do see some issue, but old firmware was
> there.
You could also attach() to that remote processor, if the HW supports it. But my
position remains the same - either find a way to work with this situation that
is not a hack or keep this patch in your internal tree.
>
> Thanks,
> Peng.
>
> >
> > > Peng Fan (2):
> > > dt-bindings: remoteproc: imx_rproc: add fsl,startup-delay-ms
> > > remoteproc: imx_rproc: delay after kick remote processor
> > >
> > > .../devicetree/bindings/remoteproc/fsl,imx-rproc.yaml | 4 ++++
> > > drivers/remoteproc/imx_rproc.c | 9 +++++++++
> > > 2 files changed, 13 insertions(+)
> > >
> > > --
> > > 2.37.1
> > >
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH V2 0/2] remoteproc: imx: add start up delay
@ 2022-11-04 15:33 ` Mathieu Poirier
0 siblings, 0 replies; 14+ messages in thread
From: Mathieu Poirier @ 2022-11-04 15:33 UTC (permalink / raw)
To: Peng Fan
Cc: Peng Fan (OSS),
andersson, shawnguo, s.hauer, robh+dt, krzysztof.kozlowski+dt,
kernel, festevam, dl-linux-imx, linux-remoteproc,
linux-arm-kernel, linux-kernel, devicetree
On Thu, Nov 03, 2022 at 05:08:15AM +0000, Peng Fan wrote:
> > Subject: Re: [PATCH V2 0/2] remoteproc: imx: add start up delay
> >
> > On Wed, 2 Nov 2022 at 05:23, Peng Fan (OSS) <peng.fan@oss.nxp.com>
> > wrote:
> > >
> > > From: Peng Fan <peng.fan@nxp.com>
> > >
> > > V2:
> > > Rebased on linux-next
> > >
> > > V1:
> > >
> > >
> > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore
> > > .kernel.org%2Flkml%2F20220609123500.3492475-1-
> > peng.fan%40oss.nxp.com%2
> > >
> > F&data=05%7C01%7Cpeng.fan%40nxp.com%7Cf14584bdef9349e744ca
> > 08dabcf7
> > >
> > e1be%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C63803007007
> > 2451509%7
> > >
> > CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJ
> > BTiI6Ik1
> > >
> > haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Ck73gkOPpNVT
> > kcZL8olCZP8B
> > > %2BrIpZHV48uZBl2R8HdM%3D&reserved=0
> > >
> > > There is case that after remoteproc start remote processor[M4], the M4
> > > runs slow and before M4 finish its own rpmsg framework initialization,
> > > linux sends out vring kick message, then M4 firmware drops the kick
> > > message. Some NXP released Cortex-M[x] images has such limitation that
> > > it requires linux sends out vring kick message after M4 firmware
> > > finish its rpmsg framework initialization.
> > >
> > > The best case is to use a method to let M4 notify Linux that M4 has
> > > finished initialization, but we could not patch released firmware,
> > > then update driver to detect notification.
> > >
> > > So add delay before linux send out vring kick message. It is not good
> > > to use a fixed time delay in driver, so I choose to get that from
> > > device tree.
> > >
> >
> > From where I stand this is a hack to hide the lack of motivation to enact the
> > real solution that is outlined above. I also wonder how these problems
> > were not caught during the testing phase. Either find a way to upgrade your
> > firmware or keep this in your internal tree.
> In the beginning, i.mx not migrated to use remoteproc, i.MX release only support
> uboot kick Cortex-M core and use downstream imx_rpmsg driver to
> communicate with remote core. There is no runtime stop/start.
>
> After migrated to remoteproc, we do see some issue, but old firmware was
> there.
You could also attach() to that remote processor, if the HW supports it. But my
position remains the same - either find a way to work with this situation that
is not a hack or keep this patch in your internal tree.
>
> Thanks,
> Peng.
>
> >
> > > Peng Fan (2):
> > > dt-bindings: remoteproc: imx_rproc: add fsl,startup-delay-ms
> > > remoteproc: imx_rproc: delay after kick remote processor
> > >
> > > .../devicetree/bindings/remoteproc/fsl,imx-rproc.yaml | 4 ++++
> > > drivers/remoteproc/imx_rproc.c | 9 +++++++++
> > > 2 files changed, 13 insertions(+)
> > >
> > > --
> > > 2.37.1
> > >
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 14+ messages in thread