lkml.org 
[lkml]   [2019]   [Sep]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH] firmware: imx: Skip return value check for some special SCU firmware APIs
Date
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&amp;data=02%7C01%7Cleonar
> d.cres
> >
> tez%40nxp.com%7Cc0ced6cd07f04023977008d741a07367%7C686ea1d3bc2b
> 4c6fa92
> >
> cd99c5c301635%7C0%7C0%7C637050029712216472&amp;sdata=Ccq%2Fb2R
> JdMqmnL7
> > VXrl8YhOlUwC7bWiUG%2BNmiw4OsSM%3D&amp;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

\
 
 \ /
  Last update: 2019-09-26 02:35    [W:0.125 / U:0.820 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site