diff mbox series

[2/2] firmware: imx: MU IRQ group number should be 7

Message ID 1587683231-18468-2-git-send-email-Anson.Huang@nxp.com (mailing list archive)
State New, archived
Headers show
Series [1/2] firmware: imx: make sure MU irq can wake up system from suspend mode | expand

Commit Message

Anson Huang April 23, 2020, 11:07 p.m. UTC
The MU IRQ group number should be 7 instead of 4.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
 drivers/firmware/imx/imx-scu-irq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Aisheng Dong April 24, 2020, 2:32 a.m. UTC | #1
> From: Anson Huang <Anson.Huang@nxp.com>
> Sent: Friday, April 24, 2020 7:07 AM
> 
> The MU IRQ group number should be 7 instead of 4.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>

Are we using others IRQ group?
If not, this change may slow down the irq handling speed.

Regards
Aisheng

> ---
>  drivers/firmware/imx/imx-scu-irq.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/firmware/imx/imx-scu-irq.c
> b/drivers/firmware/imx/imx-scu-irq.c
> index d9dcc20..66fef88 100644
> --- a/drivers/firmware/imx/imx-scu-irq.c
> +++ b/drivers/firmware/imx/imx-scu-irq.c
> @@ -14,7 +14,7 @@
> 
>  #define IMX_SC_IRQ_FUNC_ENABLE	1
>  #define IMX_SC_IRQ_FUNC_STATUS	2
> -#define IMX_SC_IRQ_NUM_GROUP	4
> +#define IMX_SC_IRQ_NUM_GROUP	7
> 
>  static u32 mu_resource_id;
> 
> --
> 2.7.4
Anson Huang April 24, 2020, 2:36 a.m. UTC | #2
> -----Original Message-----
> From: Aisheng Dong <aisheng.dong@nxp.com>
> Sent: 2020年4月24日 10:33
> To: Anson Huang <anson.huang@nxp.com>; shawnguo@kernel.org;
> s.hauer@pengutronix.de; kernel@pengutronix.de; festevam@gmail.com;
> ben.dooks@codethink.co.uk; linux-arm-kernel@lists.infradead.org;
> linux-kernel@vger.kernel.org
> Cc: dl-linux-imx <linux-imx@nxp.com>
> Subject: RE: [PATCH 2/2] firmware: imx: MU IRQ group number should be 7
> 
> > From: Anson Huang <Anson.Huang@nxp.com>
> > Sent: Friday, April 24, 2020 7:07 AM
> >
> > The MU IRQ group number should be 7 instead of 4.
> >
> > Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> 
> Are we using others IRQ group?
> If not, this change may slow down the irq handling speed.

The irq handling is using work queue, NOT in ISR, so the speed is NOT that sensitive.
The scu group irq driver should provide full functions, as other drivers using it may enable
the group they want.

Anson
Aisheng Dong April 24, 2020, 2:51 a.m. UTC | #3
> From: Anson Huang <anson.huang@nxp.com>
> Sent: Friday, April 24, 2020 10:36 AM
> 
> > -----Original Message-----
> > From: Aisheng Dong <aisheng.dong@nxp.com>
> > Sent: 2020年4月24日 10:33
> > To: Anson Huang <anson.huang@nxp.com>; shawnguo@kernel.org;
> > s.hauer@pengutronix.de; kernel@pengutronix.de; festevam@gmail.com;
> > ben.dooks@codethink.co.uk; linux-arm-kernel@lists.infradead.org;
> > linux-kernel@vger.kernel.org
> > Cc: dl-linux-imx <linux-imx@nxp.com>
> > Subject: RE: [PATCH 2/2] firmware: imx: MU IRQ group number should be
> > 7
> >
> > > From: Anson Huang <Anson.Huang@nxp.com>
> > > Sent: Friday, April 24, 2020 7:07 AM
> > >
> > > The MU IRQ group number should be 7 instead of 4.
> > >
> > > Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> >
> > Are we using others IRQ group?
> > If not, this change may slow down the irq handling speed.
> 
> The irq handling is using work queue, NOT in ISR, so the speed is NOT that
> sensitive.

SCU IPC is shared by the whole system, each SCU transfer takes about 10~20 us.
Here you may waste 30~60us if not really used.

> The scu group irq driver should provide full functions, as other drivers using it
> may enable the group they want.

Below are extra GROUPs you're going to add:
#define SC_IRQ_GROUP_SYSCTR     4U   /*!< System counter interrupts */
#define SC_IRQ_GROUP_REBOOTED   5U   /*!< Partition reboot complete */
#define SC_IRQ_GROUP_REBOOT     6U   /*!< Partition reboot starting */
Are we really going to use it? It seems I also didn't see any users in downstream tree.

Some functions provided by SCFW may not really used by Linux.
I think I's better to add them when we really need them, otherwise we benefit nothing
But wasting CPU mips.

Regards
Aisheng

> 
> Anson
Anson Huang April 24, 2020, 2:53 a.m. UTC | #4
> Subject: RE: [PATCH 2/2] firmware: imx: MU IRQ group number should be 7
> 
> > From: Anson Huang <anson.huang@nxp.com>
> > Sent: Friday, April 24, 2020 10:36 AM
> >
> > > -----Original Message-----
> > > From: Aisheng Dong <aisheng.dong@nxp.com>
> > > Sent: 2020年4月24日 10:33
> > > To: Anson Huang <anson.huang@nxp.com>; shawnguo@kernel.org;
> > > s.hauer@pengutronix.de; kernel@pengutronix.de; festevam@gmail.com;
> > > ben.dooks@codethink.co.uk; linux-arm-kernel@lists.infradead.org;
> > > linux-kernel@vger.kernel.org
> > > Cc: dl-linux-imx <linux-imx@nxp.com>
> > > Subject: RE: [PATCH 2/2] firmware: imx: MU IRQ group number should
> > > be
> > > 7
> > >
> > > > From: Anson Huang <Anson.Huang@nxp.com>
> > > > Sent: Friday, April 24, 2020 7:07 AM
> > > >
> > > > The MU IRQ group number should be 7 instead of 4.
> > > >
> > > > Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> > >
> > > Are we using others IRQ group?
> > > If not, this change may slow down the irq handling speed.
> >
> > The irq handling is using work queue, NOT in ISR, so the speed is NOT
> > that sensitive.
> 
> SCU IPC is shared by the whole system, each SCU transfer takes about 10~20
> us.
> Here you may waste 30~60us if not really used.
> 
> > The scu group irq driver should provide full functions, as other
> > drivers using it may enable the group they want.
> 
> Below are extra GROUPs you're going to add:
> #define SC_IRQ_GROUP_SYSCTR     4U   /*!< System counter interrupts */
> #define SC_IRQ_GROUP_REBOOTED   5U   /*!< Partition reboot complete
> */
> #define SC_IRQ_GROUP_REBOOT     6U   /*!< Partition reboot starting */
> Are we really going to use it? It seems I also didn't see any users in
> downstream tree.
> 
> Some functions provided by SCFW may not really used by Linux.
> I think I's better to add them when we really need them, otherwise we benefit
> nothing But wasting CPU mips.

I don't agree this, if SCFW NOT support it, it should fix from SCFW. This is aligned with our
internal tree.

Anson
Aisheng Dong April 24, 2020, 3:15 a.m. UTC | #5
> From: Anson Huang <anson.huang@nxp.com>
> Sent: Friday, April 24, 2020 10:54 AM
> 
> > Subject: RE: [PATCH 2/2] firmware: imx: MU IRQ group number should be
> > 7
> >
> > > From: Anson Huang <anson.huang@nxp.com>
> > > Sent: Friday, April 24, 2020 10:36 AM
> > >
> > > > -----Original Message-----
> > > > From: Aisheng Dong <aisheng.dong@nxp.com>
> > > > Sent: 2020年4月24日 10:33
> > > > To: Anson Huang <anson.huang@nxp.com>; shawnguo@kernel.org;
> > > > s.hauer@pengutronix.de; kernel@pengutronix.de; festevam@gmail.com;
> > > > ben.dooks@codethink.co.uk; linux-arm-kernel@lists.infradead.org;
> > > > linux-kernel@vger.kernel.org
> > > > Cc: dl-linux-imx <linux-imx@nxp.com>
> > > > Subject: RE: [PATCH 2/2] firmware: imx: MU IRQ group number should
> > > > be
> > > > 7
> > > >
> > > > > From: Anson Huang <Anson.Huang@nxp.com>
> > > > > Sent: Friday, April 24, 2020 7:07 AM
> > > > >
> > > > > The MU IRQ group number should be 7 instead of 4.
> > > > >
> > > > > Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> > > >
> > > > Are we using others IRQ group?
> > > > If not, this change may slow down the irq handling speed.
> > >
> > > The irq handling is using work queue, NOT in ISR, so the speed is
> > > NOT that sensitive.
> >
> > SCU IPC is shared by the whole system, each SCU transfer takes about
> > 10~20 us.
> > Here you may waste 30~60us if not really used.
> >
> > > The scu group irq driver should provide full functions, as other
> > > drivers using it may enable the group they want.
> >
> > Below are extra GROUPs you're going to add:
> > #define SC_IRQ_GROUP_SYSCTR     4U   /*!< System counter interrupts */
> > #define SC_IRQ_GROUP_REBOOTED   5U   /*!< Partition reboot complete
> > */
> > #define SC_IRQ_GROUP_REBOOT     6U   /*!< Partition reboot starting */
> > Are we really going to use it? It seems I also didn't see any users in
> > downstream tree.
> >
> > Some functions provided by SCFW may not really used by Linux.
> > I think I's better to add them when we really need them, otherwise we
> > benefit nothing But wasting CPU mips.
> 
> I don't agree this, if SCFW NOT support it, it should fix from SCFW. This is aligned
> with our internal tree.

Hmm, internal tree does not decide upstream tree. That's a lesson we've already learned
for many years.

For example, we only upstream SCU API really used by Linux.
Not all of them as we simply did for local 4.19 release.

Regards
Aisheng

> 
> Anson
diff mbox series

Patch

diff --git a/drivers/firmware/imx/imx-scu-irq.c b/drivers/firmware/imx/imx-scu-irq.c
index d9dcc20..66fef88 100644
--- a/drivers/firmware/imx/imx-scu-irq.c
+++ b/drivers/firmware/imx/imx-scu-irq.c
@@ -14,7 +14,7 @@ 
 
 #define IMX_SC_IRQ_FUNC_ENABLE	1
 #define IMX_SC_IRQ_FUNC_STATUS	2
-#define IMX_SC_IRQ_NUM_GROUP	4
+#define IMX_SC_IRQ_NUM_GROUP	7
 
 static u32 mu_resource_id;