From: Anson Huang <anson.huang@nxp.com> To: Leonard Crestez <leonard.crestez@nxp.com>, "shawnguo@kernel.org" <shawnguo@kernel.org>, Aisheng Dong <aisheng.dong@nxp.com> Cc: "s.hauer@pengutronix.de" <s.hauer@pengutronix.de>, "kernel@pengutronix.de" <kernel@pengutronix.de>, "festevam@gmail.com" <festevam@gmail.com>, "linux-arm-kernel@lists.infradead.org" <linux-arm-kernel@lists.infradead.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, dl-linux-imx <linux-imx@nxp.com> Subject: RE: [PATCH] firmware: imx: Skip return value check for some special SCU firmware APIs Date: Thu, 26 Sep 2019 00:34:58 +0000 [thread overview] Message-ID: <DB3PR0402MB391628462C06E3BD28E1AC60F5860@DB3PR0402MB3916.eurprd04.prod.outlook.com> (raw) In-Reply-To: <VI1PR04MB70232DEA67972332611480CAEE870@VI1PR04MB7023.eurprd04.prod.outlook.com> Hi, Leonard > On 25.09.2019 13:09, Anson Huang wrote: > > The SCU firmware does NOT always have return value stored in message > > header's function element even the API has response data, those > > special APIs are defined as void function in SCU firmware, so they > > should be treated as return success always. > > > > Signed-off-by: Anson Huang <Anson.Huang@nxp.com> > > --- > > - This patch is based on the patch of > > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatc > > > hwork.kernel.org%2Fpatch%2F11129553%2F&data=02%7C01%7Cleonar > d.cres > > > tez%40nxp.com%7Cc0ced6cd07f04023977008d741a07367%7C686ea1d3bc2b > 4c6fa92 > > > cd99c5c301635%7C0%7C0%7C637050029712216472&sdata=Ccq%2Fb2R > JdMqmnL7 > > VXrl8YhOlUwC7bWiUG%2BNmiw4OsSM%3D&reserved=0 > > --- > > drivers/firmware/imx/imx-scu.c | 34 > ++++++++++++++++++++++++++++++++-- > > 1 file changed, 32 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/firmware/imx/imx-scu.c > > b/drivers/firmware/imx/imx-scu.c index 869be7a..ced5b12 100644 > > --- a/drivers/firmware/imx/imx-scu.c > > +++ b/drivers/firmware/imx/imx-scu.c > > @@ -78,6 +78,11 @@ static int imx_sc_linux_errmap[IMX_SC_ERR_LAST] = > { > > -EIO, /* IMX_SC_ERR_FAIL */ > > }; > > > > +static const struct imx_sc_rpc_msg whitelist[] = { > > + { .svc = IMX_SC_RPC_SVC_MISC, .func = > IMX_SC_MISC_FUNC_UNIQUE_ID }, > > + { .svc = IMX_SC_RPC_SVC_MISC, .func = > > +IMX_SC_MISC_FUNC_GET_BUTTON_STATUS }, }; > > Until now this low level IPC code didn't treat any svc/func specially and this > seems good. > > The imx_scu_call_rpc function already has an have_resp argument and > callers are responsible to fill it. Can't we deal with this by adding an > additional err_ret flag passed by the caller? Can you make it more detail? The have_resp is a bool, so where to add the flag? The caller ONLY passes imx_sc_ipc, imx_sc_rpc_msg and have_resp, ONLY imx_sc_ipc can add a flag, is it what you meant? imx_scu_call_rpc(struct imx_sc_ipc *sc_ipc, void *msg, bool have_resp) > > We can add wrapper functions to avoid tree-wide changes for all callers. I agree, maybe we can add a new imx_scu_call_rpc function for those special APIs? The new API will be ONLY for those APIs with response but without return value check, then other callers will NOT be impacted, what do you think? Thanks, Anson
WARNING: multiple messages have this Message-ID (diff)
From: Anson Huang <anson.huang@nxp.com> To: Leonard Crestez <leonard.crestez@nxp.com>, "shawnguo@kernel.org" <shawnguo@kernel.org>, Aisheng Dong <aisheng.dong@nxp.com> Cc: "s.hauer@pengutronix.de" <s.hauer@pengutronix.de>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, dl-linux-imx <linux-imx@nxp.com>, "kernel@pengutronix.de" <kernel@pengutronix.de>, "festevam@gmail.com" <festevam@gmail.com>, "linux-arm-kernel@lists.infradead.org" <linux-arm-kernel@lists.infradead.org> Subject: RE: [PATCH] firmware: imx: Skip return value check for some special SCU firmware APIs Date: Thu, 26 Sep 2019 00:34:58 +0000 [thread overview] Message-ID: <DB3PR0402MB391628462C06E3BD28E1AC60F5860@DB3PR0402MB3916.eurprd04.prod.outlook.com> (raw) In-Reply-To: <VI1PR04MB70232DEA67972332611480CAEE870@VI1PR04MB7023.eurprd04.prod.outlook.com> Hi, Leonard > On 25.09.2019 13:09, Anson Huang wrote: > > The SCU firmware does NOT always have return value stored in message > > header's function element even the API has response data, those > > special APIs are defined as void function in SCU firmware, so they > > should be treated as return success always. > > > > Signed-off-by: Anson Huang <Anson.Huang@nxp.com> > > --- > > - This patch is based on the patch of > > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatc > > > hwork.kernel.org%2Fpatch%2F11129553%2F&data=02%7C01%7Cleonar > d.cres > > > tez%40nxp.com%7Cc0ced6cd07f04023977008d741a07367%7C686ea1d3bc2b > 4c6fa92 > > > cd99c5c301635%7C0%7C0%7C637050029712216472&sdata=Ccq%2Fb2R > JdMqmnL7 > > VXrl8YhOlUwC7bWiUG%2BNmiw4OsSM%3D&reserved=0 > > --- > > drivers/firmware/imx/imx-scu.c | 34 > ++++++++++++++++++++++++++++++++-- > > 1 file changed, 32 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/firmware/imx/imx-scu.c > > b/drivers/firmware/imx/imx-scu.c index 869be7a..ced5b12 100644 > > --- a/drivers/firmware/imx/imx-scu.c > > +++ b/drivers/firmware/imx/imx-scu.c > > @@ -78,6 +78,11 @@ static int imx_sc_linux_errmap[IMX_SC_ERR_LAST] = > { > > -EIO, /* IMX_SC_ERR_FAIL */ > > }; > > > > +static const struct imx_sc_rpc_msg whitelist[] = { > > + { .svc = IMX_SC_RPC_SVC_MISC, .func = > IMX_SC_MISC_FUNC_UNIQUE_ID }, > > + { .svc = IMX_SC_RPC_SVC_MISC, .func = > > +IMX_SC_MISC_FUNC_GET_BUTTON_STATUS }, }; > > Until now this low level IPC code didn't treat any svc/func specially and this > seems good. > > The imx_scu_call_rpc function already has an have_resp argument and > callers are responsible to fill it. Can't we deal with this by adding an > additional err_ret flag passed by the caller? Can you make it more detail? The have_resp is a bool, so where to add the flag? The caller ONLY passes imx_sc_ipc, imx_sc_rpc_msg and have_resp, ONLY imx_sc_ipc can add a flag, is it what you meant? imx_scu_call_rpc(struct imx_sc_ipc *sc_ipc, void *msg, bool have_resp) > > We can add wrapper functions to avoid tree-wide changes for all callers. I agree, maybe we can add a new imx_scu_call_rpc function for those special APIs? The new API will be ONLY for those APIs with response but without return value check, then other callers will NOT be impacted, what do you think? Thanks, Anson _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-09-26 0:35 UTC|newest] Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-09-25 10:07 [PATCH] firmware: imx: Skip return value check for some special SCU firmware APIs Anson Huang 2019-09-25 10:07 ` Anson Huang 2019-09-25 13:13 ` Leonard Crestez 2019-09-25 13:13 ` Leonard Crestez 2019-09-26 0:34 ` Anson Huang [this message] 2019-09-26 0:34 ` Anson Huang 2019-09-26 7:59 ` Marco Felsch 2019-09-26 7:59 ` Marco Felsch 2019-09-26 8:03 ` Anson Huang 2019-09-26 8:03 ` Anson Huang 2019-09-26 10:05 ` Marco Felsch 2019-09-26 10:05 ` Marco Felsch 2019-09-26 13:25 ` Leonard Crestez 2019-09-26 13:25 ` Leonard Crestez 2019-09-27 1:20 ` Anson Huang 2019-09-27 1:20 ` Anson Huang 2019-09-27 9:06 ` Marco Felsch 2019-09-27 9:06 ` Marco Felsch 2019-09-27 9:27 ` Anson Huang 2019-09-27 9:27 ` Anson Huang 2019-09-27 11:22 ` Leonard Crestez 2019-09-27 11:22 ` Leonard Crestez 2019-09-29 1:12 ` Anson Huang 2019-09-29 1:12 ` Anson Huang 2019-09-27 11:16 ` Leonard Crestez 2019-09-27 11:16 ` Leonard Crestez 2019-09-30 7:28 ` Leonard Crestez 2019-09-30 7:28 ` Leonard Crestez 2019-09-30 7:42 ` Anson Huang 2019-09-30 7:42 ` Anson Huang 2019-09-30 7:54 ` Anson Huang 2019-09-30 7:54 ` Anson Huang 2019-09-30 8:14 ` Marco Felsch 2019-09-30 8:14 ` Marco Felsch 2019-09-30 8:32 ` Anson Huang 2019-09-30 8:32 ` Anson Huang 2019-09-30 10:02 ` Marco Felsch 2019-09-30 10:02 ` Marco Felsch 2019-10-07 1:21 ` Anson Huang 2019-10-07 1:21 ` Anson Huang 2019-10-07 8:07 ` Marco Felsch 2019-10-07 8:07 ` Marco Felsch
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=DB3PR0402MB391628462C06E3BD28E1AC60F5860@DB3PR0402MB3916.eurprd04.prod.outlook.com \ --to=anson.huang@nxp.com \ --cc=aisheng.dong@nxp.com \ --cc=festevam@gmail.com \ --cc=kernel@pengutronix.de \ --cc=leonard.crestez@nxp.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-imx@nxp.com \ --cc=linux-kernel@vger.kernel.org \ --cc=s.hauer@pengutronix.de \ --cc=shawnguo@kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.