From: s.hauer@pengutronix.de (Sascha Hauer)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V5 0/5] soc: imx: add scu firmware api support
Date: Mon, 10 Sep 2018 09:03:49 +0200 [thread overview]
Message-ID: <20180910070348.gempczezq36ansgm@pengutronix.de> (raw)
In-Reply-To: <AM0PR04MB4211EB20F182FD13C8070CA880010@AM0PR04MB4211.eurprd04.prod.outlook.com>
On Thu, Sep 06, 2018 at 03:21:39AM +0000, A.s. Dong wrote:
> Hi Sasha,
>
> > -----Original Message-----
> > From: Sascha Hauer [mailto:s.hauer at pengutronix.de]
> > Sent: Monday, September 3, 2018 7:45 PM
> >
> > On Mon, Sep 03, 2018 at 08:57:36AM +0000, A.s. Dong wrote:
> > > Hi Sascha,
> > >
> > > > -----Original Message-----
> > > > From: A.s. Dong
> > > > Sent: Wednesday, August 29, 2018 4:35 PM
> > > > To: Sascha Hauer <s.hauer@pengutronix.de>
> > >
> > > [...]
> > >
> > > > > > The original point is to separate the SCU service API
> > > > > > implementation from the client drivers. Client drivers don't
> > > > > > have to know the internal details of the API implementation,
> > > > > > they just use the service API provided by SCU firmware. API
> > > > > > implementation and client users will be
> > > > > maintained independently.
> > > > >
> > > > > I would buy this argument if the 'API implementation' was more
> > > > > than a shim layer that directly translates between function
> > > > > arguments and a
> > > > message struct.
> > > > > With this you effectively can't change the API implementation
> > > > > without changing the API you provide to the client drivers.
> > > > >
> > > >
> > > > In reality, the API implementation could change without changing the
> > > > API prototype.
> > > > The API is defined in a more generic way and less possible to change.
> > > > But the internal implementation is allowed to change if the firmware
> > updates.
> > > > e.g. protocol params layout and size and etc.
> > > >
> > > > This way give us a clear separation between API internals and client
> > > > users which are more like to be maintained independently.
> > > > And it may also help if we want to support old firmware due to API
> > > > internal implementation changes. (And note that SCU firmware
> > > > supports many functions, distribute them into various drivers may
> > > > cause a bit mess. Some of them may get troubles on finding a proper
> > > > place to put.)
> >
> > Examples?
> >
>
> Take sc_misc_set_control as example which is widely used by various client drivers.
> Encoding message in driver may cause many duplicated code.
> Cscope tag: sc_misc_set_control
> # line filename / context / line
> 1 206 drivers/clk/imx/clk-divider-scu.c <<clk_divider3_scu_set_rate>>
> sci_err = sc_misc_set_control(ccm_ipc_handle, clk->rsrc_id,
You can still create a helper function for these calls. I was mainly
aiming for the oneshot usages of several other functions.
> > > >
> > > > So aren't those more valuable comparing to move SCU APIs into client
> > drivers?
> > > > And current kernel users (arm scpi/scmi, ti sci) already do like
> > > > this... why not i.MX?
> > > >
> > > > Sorry if I still not get your point.
> > > > Please help clarify a bit more if I missed something..
> > >
> > > Please let me know if you still believe moving SCU API implementation
> > > into each client driver is a more reasonable way to go, then i will do
> > > it as I trust your professionality.
> >
> > Yes, I still think that. I still think the 1:1 mapping between messages and
> > function calls is an unnecessary overhead.
> >
>
> Okay, let's do that way first if you still think it's proper.
> BTW, do you have any comment about the MU usage in Patch 2/5 ?
> [V5,2/5] soc: imx: add SC firmware IPC and APIs
> https://patchwork.kernel.org/patch/10570551/
The MU usage looks fine from a first glance.
The way you share a global scu handle with your clients still looks
ridiculous though.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2018-09-10 7:03 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-20 16:08 [PATCH V5 0/5] soc: imx: add scu firmware api support Dong Aisheng
2018-08-20 16:08 ` [PATCH V5 1/5] dt-bindings: arm: fsl: add scu binding doc Dong Aisheng
2018-08-20 18:11 ` Rob Herring
2018-08-21 3:00 ` A.s. Dong
2018-08-21 11:51 ` A.s. Dong
2018-08-24 9:36 ` Jassi Brar
2018-08-24 9:51 ` A.s. Dong
2018-08-20 16:08 ` [PATCH V5 2/5] soc: imx: add SC firmware IPC and APIs Dong Aisheng
2018-09-10 8:40 ` Sascha Hauer
2018-09-10 9:44 ` A.s. Dong
2018-09-10 12:11 ` Sascha Hauer
2018-09-11 10:38 ` A.s. Dong
2018-09-16 13:23 ` A.s. Dong
2018-09-18 6:22 ` Sascha Hauer
2018-09-18 7:54 ` A.s. Dong
2018-08-20 16:08 ` [PATCH V5 3/5] soc: imx: sc: add pm svc support Dong Aisheng
2018-08-20 16:08 ` [PATCH V5 4/5] soc: imx: sc: add pad " Dong Aisheng
2018-08-20 16:08 ` [PATCH V5 5/5] soc: imx: sc: add misc " Dong Aisheng
2018-08-20 16:31 ` [PATCH V5 0/5] soc: imx: add scu firmware api support A.s. Dong
2018-08-24 7:36 ` A.s. Dong
2018-08-24 9:54 ` Jassi Brar
2018-08-24 11:02 ` A.s. Dong
2018-08-27 8:33 ` Sascha Hauer
2018-08-27 9:59 ` A.s. Dong
2018-08-27 10:21 ` A.s. Dong
2018-08-28 6:21 ` Sascha Hauer
2018-08-28 8:53 ` A.s. Dong
2018-08-29 6:53 ` Sascha Hauer
2018-08-29 8:35 ` A.s. Dong
2018-09-03 8:57 ` A.s. Dong
2018-09-03 11:44 ` Sascha Hauer
2018-09-06 3:21 ` A.s. Dong
2018-09-10 7:03 ` Sascha Hauer [this message]
2018-09-10 7:53 ` A.s. Dong
2018-08-28 6:15 ` Sascha Hauer
2018-08-28 9:02 ` A.s. Dong
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=20180910070348.gempczezq36ansgm@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).