From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D30DAC001DB for ; Tue, 8 Aug 2023 08:04:42 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D1868854BD; Tue, 8 Aug 2023 10:04:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=foss.st.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=foss.st.com header.i=@foss.st.com header.b="u0Njc3if"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A036C8556F; Tue, 8 Aug 2023 10:04:39 +0200 (CEST) Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1C81F847D9 for ; Tue, 8 Aug 2023 10:04:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=prvs=6584f55051=etienne.carriere@foss.st.com Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 3781t9pR001572; Tue, 8 Aug 2023 10:04:34 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h= from:to:cc:subject:date:message-id:references:in-reply-to :content-type:content-transfer-encoding:mime-version; s= selector1; bh=Ex7D9VzryIY5O3qdyskZCk7V5SWF5NjaFxDaqFVpgyE=; b=u0 Njc3iflgWOADVvJ1snS/TiCBgoHjPOgdWDCyXvsfX6PWMcfquQZUaysDHrm+YWaf z7tWMLmlpJMTxDUCpiA5ELZUkM5/msxb1obyV+OGYpUnqGAgcl7QKFU5tiSX20VG 9RjdYARjWgDSa8AlbztO5iNoK4D9AZV5n+pK4TOEPk3KMA01baDnWDQXdGTrLJeK ohqGF0kWdlUNk6Yoncy0nXMFkhh4yEM7K69h1E9OxzYM3Sy7JA0tTXbgnQfQsXDM bfjnvDuIcWVVQm4XL6G1QU5487SWmae01bLB1ON5HREwGemDpLdaeTFIdQXg9PNd rrGvUI8Y8UyaHCQDjesA== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3sbcfc1qq0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Aug 2023 10:04:34 +0200 (MEST) Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 31941100063; Tue, 8 Aug 2023 10:04:33 +0200 (CEST) Received: from Webmail-eu.st.com (eqndag1node6.st.com [10.75.129.135]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 058442132E2; Tue, 8 Aug 2023 10:04:33 +0200 (CEST) Received: from EQNDAG1NODE4.st.com (10.75.129.133) by EQNDAG1NODE6.st.com (10.75.129.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Tue, 8 Aug 2023 10:04:32 +0200 Received: from EQNDAG1NODE4.st.com ([fe80::30c1:c210:3912:a726]) by EQNDAG1NODE4.st.com ([fe80::30c1:c210:3912:a726%2]) with mapi id 15.01.2507.021; Tue, 8 Aug 2023 10:04:32 +0200 From: Etienne CARRIERE - foss To: AKASHI Takahiro , Etienne CARRIERE CC: "trini@konsulko.com" , "sjg@chromium.org" , "u-boot@lists.denx.de" Subject: Re: [PATCH v2 01/12] scmi: refactor the code to hide a channel from devices Thread-Topic: [PATCH v2 01/12] scmi: refactor the code to hide a channel from devices Thread-Index: AQHZv+CyrnSGe00v2kqPBHCHA1F9zK/YN22AgAZUJYCAAY71Dg== Date: Tue, 8 Aug 2023 08:04:32 +0000 Message-ID: <48b47a047de44f99a5eabc2d167ac1f4@foss.st.com> References: <20230726083808.140780-1-takahiro.akashi@linaro.org> <20230726083808.140780-2-takahiro.akashi@linaro.org> , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.201.20.20] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-08-08_06,2023-08-03_01,2023-05-22_02 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Hello Akashi-san, > From: AKASHI Takahiro > Sent: Monday, August 7, 2023 12:03 PM >=20 > Hi Etienne, >=20 > On Thu, Aug 03, 2023 at 09:24:51AM +0000, Etienne CARRIERE wrote: > > Hello Takahiro-san, > > > > Sorry again for this late feedback. > > Testing the series against stm32mp135f-dk board which is using SCMI res= ources, I see the board fails to boot. > > > > > From: AKASHI Takahiro > > > To: trini@konsulko.com, sjg@chromium.org > > > Cc: etienne.carriere@st.com, u-boot@lists.denx.de, > > > AKASHI Takahiro > > > Subject: [PATCH v2 01/12] scmi: refactor the code to hide a channel f= rom devices > > > Date: Wed, 26 Jul 2023 17:37:57 +0900 [thread overview] > > > Message-ID: <20230726083808.140780-2-takahiro.akashi@linaro.org> (raw= ) > > > In-Reply-To: <20230726083808.140780-1-takahiro.akashi@linaro.org> > > > > > > The commit 85dc58289238 ("firmware: scmi: prepare uclass to pass chan= nel > > > reference") added an explicit parameter, channel, but it seems to mak= e > > > the code complex. > > > > > > Hiding this parameter will allow for adding a generic (protocol-agnos= tic) > > > helper function, i.e. for PROTOCOL_VERSION, in a later patch. > > > > > > Signed-off-by: AKASHI Takahiro > > > > > > --- > > > v2 > > > * new patch > > > --- > > > drivers/clk/clk_scmi.c | 27 ++------- > > > drivers/firmware/scmi/scmi_agent-uclass.c | 74 ++++++++++++++++++---= -- > > > drivers/power/regulator/scmi_regulator.c | 27 +++------ > > > drivers/reset/reset-scmi.c | 19 +----- > > > include/scmi_agent.h | 15 +++-- > > > 5 files changed, 86 insertions(+), 76 deletions(-) > > > > > > diff --git a/drivers/clk/clk_scmi.c b/drivers/clk/clk_scmi.c > > > index d172fed24c9d..34a49363a51a 100644 > > > --- a/drivers/clk/clk_scmi.c > > > +++ b/drivers/clk/clk_scmi.c > > > @@ -13,17 +13,8 @@ > > > #include > > > #include > > > > > > -/** > > > - * struct scmi_clk_priv - Private data for SCMI clocks > > > - * @channel: Reference to the SCMI channel to use > > > - */ > > > -struct scmi_clk_priv { > > > - struct scmi_channel *channel; > > > -}; > > > - > > > static int scmi_clk_get_num_clock(struct udevice *dev, size_t *num_c= locks) > > > { > > > - struct scmi_clk_priv *priv =3D dev_get_priv(dev); > > > struct scmi_clk_protocol_attr_out out; > > > struct scmi_msg msg =3D { > > > .protocol_id =3D SCMI_PROTOCOL_ID_CLOCK, > > > @@ -33,7 +24,7 @@ static int scmi_clk_get_num_clock(struct udevice *d= ev, size_t *num_clocks) > > > }; > > > int ret; > > > > > > - ret =3D devm_scmi_process_msg(dev, priv->channel, &msg); > > > + ret =3D devm_scmi_process_msg(dev, &msg); > > > if (ret) > > > return ret; > > > > > > @@ -44,7 +35,6 @@ static int scmi_clk_get_num_clock(struct udevice *d= ev, size_t *num_clocks) > > > > > > static int scmi_clk_get_attibute(struct udevice *dev, int clkid, cha= r **name) > > > { > > > - struct scmi_clk_priv *priv =3D dev_get_priv(dev); > > > struct scmi_clk_attribute_in in =3D { > > > .clock_id =3D clkid, > > > }; > > > @@ -59,7 +49,7 @@ static int scmi_clk_get_attibute(struct udevice *de= v, int clkid, char **name) > > > }; > > > int ret; > > > > > > - ret =3D devm_scmi_process_msg(dev, priv->channel, &msg); > > > + ret =3D devm_scmi_process_msg(dev, &msg); > > > if (ret) > > > return ret; > > > > > > @@ -70,7 +60,6 @@ static int scmi_clk_get_attibute(struct udevice *de= v, int clkid, char **name) > > > > > > static int scmi_clk_gate(struct clk *clk, int enable) > > > { > > > - struct scmi_clk_priv *priv =3D dev_get_priv(clk->dev); > > > struct scmi_clk_state_in in =3D { > > > .clock_id =3D clk->id, > > > .attributes =3D enable, > > > @@ -81,7 +70,7 @@ static int scmi_clk_gate(struct clk *clk, int enabl= e) > > > in, out); > > > int ret; > > > > > > - ret =3D devm_scmi_process_msg(clk->dev, priv->channel, &msg); > > > + ret =3D devm_scmi_process_msg(clk->dev, &msg); > > > if (ret) > > > return ret; > > > > > > @@ -100,7 +89,6 @@ static int scmi_clk_disable(struct clk *clk) > > > > > > static ulong scmi_clk_get_rate(struct clk *clk) > > > { > > > - struct scmi_clk_priv *priv =3D dev_get_priv(clk->dev); > > > struct scmi_clk_rate_get_in in =3D { > > > .clock_id =3D clk->id, > > > }; > > > @@ -110,7 +98,7 @@ static ulong scmi_clk_get_rate(struct clk *clk) > > > in, out); > > > int ret; > > > > > > - ret =3D devm_scmi_process_msg(clk->dev, priv->channel, &msg); > > > + ret =3D devm_scmi_process_msg(clk->dev, &msg); > > > if (ret < 0) > > > return ret; > > > > > > @@ -123,7 +111,6 @@ static ulong scmi_clk_get_rate(struct clk *clk) > > > > > > static ulong scmi_clk_set_rate(struct clk *clk, ulong rate) > > > { > > > - struct scmi_clk_priv *priv =3D dev_get_priv(clk->dev); > > > struct scmi_clk_rate_set_in in =3D { > > > .clock_id =3D clk->id, > > > .flags =3D SCMI_CLK_RATE_ROUND_CLOSEST, > > > @@ -136,7 +123,7 @@ static ulong scmi_clk_set_rate(struct clk *clk, u= long rate) > > > in, out); > > > int ret; > > > > > > - ret =3D devm_scmi_process_msg(clk->dev, priv->channel, &msg); > > > + ret =3D devm_scmi_process_msg(clk->dev, &msg); > > > if (ret < 0) > > > return ret; > > > > > > @@ -149,12 +136,11 @@ static ulong scmi_clk_set_rate(struct clk *clk,= ulong rate) > > > > > > static int scmi_clk_probe(struct udevice *dev) > > > { > > > - struct scmi_clk_priv *priv =3D dev_get_priv(dev); > > > struct clk *clk; > > > size_t num_clocks, i; > > > int ret; > > > > > > - ret =3D devm_scmi_of_get_channel(dev, &priv->channel); > > > + ret =3D devm_scmi_of_get_channel(dev); > > > if (ret) > > > return ret; > > > > > > @@ -205,5 +191,4 @@ U_BOOT_DRIVER(scmi_clock) =3D { > > > .id =3D UCLASS_CLK, > > > .ops =3D &scmi_clk_ops, > > > .probe =3D scmi_clk_probe, > > > - .priv_auto =3D sizeof(struct scmi_clk_priv *), > > > }; > > > diff --git a/drivers/firmware/scmi/scmi_agent-uclass.c b/drivers/firm= ware/scmi/scmi_agent-uclass.c > > > index 02de692d66f3..39cf15c88f75 100644 > > > --- a/drivers/firmware/scmi/scmi_agent-uclass.c > > > +++ b/drivers/firmware/scmi/scmi_agent-uclass.c > > > @@ -8,6 +8,7 @@ > > > #include > > > #include > > > #include > > > +#include > > > #include > > > #include > > > #include > > > @@ -129,43 +130,88 @@ static const struct scmi_agent_ops *transport_d= ev_ops(struct udevice *dev) > > > return (const struct scmi_agent_ops *)dev->driver->ops; > > > } > > > > > > -int devm_scmi_of_get_channel(struct udevice *dev, struct scmi_channe= l **channel) > > > +/** > > > + * scmi_of_get_channel() - Get SCMI channel handle > > > + * > > > + * @dev: SCMI agent device > > > + * @channel: Output reference to the SCMI channel upon success > > > + * > > > + * On return, @channel will be set. > > > + * Return 0 on success and a negative errno on failure > > > + */ > > > +static int scmi_of_get_channel(struct udevice *dev, struct scmi_chan= nel **channel) > > > +{ > > > + const struct scmi_agent_ops *ops; > > > + > > > + ops =3D transport_dev_ops(dev); > > > + if (ops->of_get_channel) > > > + return ops->of_get_channel(dev, channel); > > > + else > > > + return -EPROTONOSUPPORT; > > > +} > > > + > > > +int devm_scmi_of_get_channel(struct udevice *dev) > > > { > > > struct udevice *parent; > > > + struct scmi_agent_proto_priv *priv =3D dev_get_parent_priv(dev); > > > > This parent lookup does not match when CONFIG_CLK_CCF is enabled. When = so, > > the scmi clock device is on the clock itself but a child udevice of som= e > > udevice held by the common clock framework (CCF). > > Platforms from the stm32mp13 family do enable SCMI clock and CCF. >=20 > I tested my patch on sandbox, where CCF is also enabled, > and "ut dm scmi_clocks" is passed without any error. > So I'm not sure if the point you mentioned above is a root cause. Ok, i'll better investigate where stm32mp13 gets lost. and why sandbox passes wher I would expect it to fail. Best regards, etienne >=20 > -Takahiro Akashi >=20 > > It can propose a way to go, using find_scmi_transport_device() to provi= de > > the agent's 1st child private data as an output argument: > > //patch-start > > -static struct udevice *find_scmi_transport_device(struct udevice *dev) > > +static struct udevice * > > +find_scmi_transport_device(struct udevice *dev, > > + struct scmi_agent_proto_priv **priv) > > { > > struct udevice *parent =3D dev; > > + struct scmi_agent_proto_priv *parent_priv; > > > > do { > > + parent_priv =3D dev_get_parent_priv(parent); > > parent =3D dev_get_parent(parent); > > } while (parent && device_get_uclass_id(parent) !=3D UCLASS_SCM= I_AGENT); > > > > if (!parent) > > dev_err(dev, "Invalid SCMI device, agent not found\n"); > > + else if (priv) > > + *priv =3D parent_priv; > > > > return parent; > > } > > //end patch > > > > Tested OK on stm32mp13 with the remaining patch series applied (minor c= onflics). > > > > BR, > > etienne > > > > > > > + int ret; > > > > > > parent =3D find_scmi_transport_device(dev); > > > if (!parent) > > > return -ENODEV; > > > > > > - if (transport_dev_ops(parent)->of_get_channel) > > > - return transport_dev_ops(parent)->of_get_channel(parent, = channel); > > > + ret =3D scmi_of_get_channel(parent, &priv->channel); > > > + if (ret =3D=3D -EPROTONOSUPPORT) { > > > + /* Drivers without a get_channel operator don't need a ch= annel ref */ > > > + priv->channel =3D NULL; > > > > > > - /* Drivers without a get_channel operator don't need a channel re= f */ > > > - *channel =3D NULL; > > > + return 0; > > > + } > > > > > > - return 0; > > > + return ret; > > > } > > > > > > -int devm_scmi_process_msg(struct udevice *dev, struct scmi_channel *= channel, > > > - struct scmi_msg *msg) > > > +/** > > > + * scmi_process_msg() - Send and process an SCMI message > > > + * > > > + * Send a message to an SCMI server. > > > + * Caller sets scmi_msg::out_msg_sz to the output message buffer siz= e. > > > + * > > > + * @dev: SCMI agent device > > > + * @channel: Communication channel for the device > > > + * @msg: Message structure reference > > > + * > > > + * On return, scmi_msg::out_msg_sz stores the response payload size. > > > + * Return: 0 on success and a negative errno on failure > > > + */ > > > +static int scmi_process_msg(struct udevice *dev, struct scmi_channel= *channel, > > > + struct scmi_msg *msg) > > > { > > > const struct scmi_agent_ops *ops; > > > + > > > + ops =3D transport_dev_ops(dev); > > > + if (ops->process_msg) > > > + return ops->process_msg(dev, channel, msg); > > > + else > > > + return -EPROTONOSUPPORT; > > > +} > > > + > > > +int devm_scmi_process_msg(struct udevice *dev, struct scmi_msg *msg) > > > +{ > > > struct udevice *parent; > > > + struct scmi_agent_proto_priv *priv =3D dev_get_parent_priv(dev); > > > > > > parent =3D find_scmi_transport_device(dev); > > > if (!parent) > > > return -ENODEV; > > > > > > - ops =3D transport_dev_ops(parent); > > > - > > > - if (ops->process_msg) > > > - return ops->process_msg(parent, channel, msg); > > > - > > > - return -EPROTONOSUPPORT; > > > + return scmi_process_msg(parent, priv->channel, msg); > > > } > > > > > > UCLASS_DRIVER(scmi_agent) =3D { > > > .id =3D UCLASS_SCMI_AGENT, > > > .name =3D "scmi_agent", > > > .post_bind =3D scmi_bind_protocols, > > > + .per_device_plat_auto =3D sizeof(struct scmi_agent_priv), > > > > Typo: this added line belong to patch 04/12. > > > > Regards, > > Etienne > > > > > + .per_child_auto =3D sizeof(struct scmi_agent_proto_priv *), > > > }; > > > diff --git a/drivers/power/regulator/scmi_regulator.c b/drivers/power= /regulator/scmi_regulator.c > > > index 801148036ff6..08918b20872c 100644 > > > --- a/drivers/power/regulator/scmi_regulator.c > > > +++ b/drivers/power/regulator/scmi_regulator.c > > > @@ -25,18 +25,9 @@ struct scmi_regulator_platdata { > > > u32 domain_id; > > > }; > > > > > > -/** > > > - * struct scmi_regulator_priv - Private data for SCMI voltage regula= tor > > > - * @channel: Reference to the SCMI channel to use > > > - */ > > > -struct scmi_regulator_priv { > > > - struct scmi_channel *channel; > > > -}; > > > - > > > static int scmi_voltd_set_enable(struct udevice *dev, bool enable) > > > { > > > struct scmi_regulator_platdata *pdata =3D dev_get_plat(dev); > > > - struct scmi_regulator_priv *priv =3D dev_get_priv(dev); > > > struct scmi_voltd_config_set_in in =3D { > > > .domain_id =3D pdata->domain_id, > > > .config =3D enable ? SCMI_VOLTD_CONFIG_ON : SCMI_VOLTD_CO= NFIG_OFF, > > > @@ -47,7 +38,7 @@ static int scmi_voltd_set_enable(struct udevice *de= v, bool enable) > > > in, out); > > > int ret; > > > > > > - ret =3D devm_scmi_process_msg(dev, priv->channel, &msg); > > > + ret =3D devm_scmi_process_msg(dev, &msg); > > > if (ret) > > > return ret; > > > > > > @@ -57,7 +48,6 @@ static int scmi_voltd_set_enable(struct udevice *de= v, bool enable) > > > static int scmi_voltd_get_enable(struct udevice *dev) > > > { > > > struct scmi_regulator_platdata *pdata =3D dev_get_plat(dev); > > > - struct scmi_regulator_priv *priv =3D dev_get_priv(dev); > > > struct scmi_voltd_config_get_in in =3D { > > > .domain_id =3D pdata->domain_id, > > > }; > > > @@ -67,7 +57,7 @@ static int scmi_voltd_get_enable(struct udevice *de= v) > > > in, out); > > > int ret; > > > > > > - ret =3D devm_scmi_process_msg(dev, priv->channel, &msg); > > > + ret =3D devm_scmi_process_msg(dev, &msg); > > > if (ret < 0) > > > return ret; > > > > > > @@ -80,7 +70,6 @@ static int scmi_voltd_get_enable(struct udevice *de= v) > > > > > > static int scmi_voltd_set_voltage_level(struct udevice *dev, int uV) > > > { > > > - struct scmi_regulator_priv *priv =3D dev_get_priv(dev); > > > struct scmi_regulator_platdata *pdata =3D dev_get_plat(dev); > > > struct scmi_voltd_level_set_in in =3D { > > > .domain_id =3D pdata->domain_id, > > > @@ -92,7 +81,7 @@ static int scmi_voltd_set_voltage_level(struct udev= ice *dev, int uV) > > > in, out); > > > int ret; > > > > > > - ret =3D devm_scmi_process_msg(dev, priv->channel, &msg); > > > + ret =3D devm_scmi_process_msg(dev, &msg); > > > if (ret < 0) > > > return ret; > > > > > > @@ -101,7 +90,6 @@ static int scmi_voltd_set_voltage_level(struct ude= vice *dev, int uV) > > > > > > static int scmi_voltd_get_voltage_level(struct udevice *dev) > > > { > > > - struct scmi_regulator_priv *priv =3D dev_get_priv(dev); > > > struct scmi_regulator_platdata *pdata =3D dev_get_plat(dev); > > > struct scmi_voltd_level_get_in in =3D { > > > .domain_id =3D pdata->domain_id, > > > @@ -112,7 +100,7 @@ static int scmi_voltd_get_voltage_level(struct ud= evice *dev) > > > in, out); > > > int ret; > > > > > > - ret =3D devm_scmi_process_msg(dev, priv->channel, &msg); > > > + ret =3D devm_scmi_process_msg(dev, &msg); > > > if (ret < 0) > > > return ret; > > > > > > @@ -140,7 +128,6 @@ static int scmi_regulator_of_to_plat(struct udevi= ce *dev) > > > static int scmi_regulator_probe(struct udevice *dev) > > > { > > > struct scmi_regulator_platdata *pdata =3D dev_get_plat(dev); > > > - struct scmi_regulator_priv *priv =3D dev_get_priv(dev); > > > struct scmi_voltd_attr_in in =3D { 0 }; > > > struct scmi_voltd_attr_out out =3D { 0 }; > > > struct scmi_msg scmi_msg =3D { > > > @@ -153,14 +140,14 @@ static int scmi_regulator_probe(struct udevice = *dev) > > > }; > > > int ret; > > > > > > - ret =3D devm_scmi_of_get_channel(dev->parent, &priv->channel); > > > + ret =3D devm_scmi_of_get_channel(dev); > > > if (ret) > > > return ret; > > > > > > /* Check voltage domain is known from SCMI server */ > > > in.domain_id =3D pdata->domain_id; > > > > > > - ret =3D devm_scmi_process_msg(dev, priv->channel, &scmi_msg); > > > + ret =3D devm_scmi_process_msg(dev, &scmi_msg); > > > if (ret) { > > > dev_err(dev, "Failed to query voltage domain %u: %d\n", > > > pdata->domain_id, ret); > > > @@ -184,7 +171,6 @@ U_BOOT_DRIVER(scmi_regulator) =3D { > > > .probe =3D scmi_regulator_probe, > > > .of_to_plat =3D scmi_regulator_of_to_plat, > > > .plat_auto =3D sizeof(struct scmi_regulator_platdata), > > > - .priv_auto =3D sizeof(struct scmi_regulator_priv *), > > > }; > > > > > > static int scmi_regulator_bind(struct udevice *dev) > > > @@ -209,4 +195,5 @@ U_BOOT_DRIVER(scmi_voltage_domain) =3D { > > > .name =3D "scmi_voltage_domain", > > > .id =3D UCLASS_NOP, > > > .bind =3D scmi_regulator_bind, > > > + .per_child_auto =3D sizeof(struct scmi_agent_proto_priv *), > > > }; > > > diff --git a/drivers/reset/reset-scmi.c b/drivers/reset/reset-scmi.c > > > index 122556162ec3..b76711f0a8fb 100644 > > > --- a/drivers/reset/reset-scmi.c > > > +++ b/drivers/reset/reset-scmi.c > > > @@ -13,17 +13,8 @@ > > > #include > > > #include > > > > > > -/** > > > - * struct scmi_reset_priv - Private data for SCMI reset controller > > > - * @channel: Reference to the SCMI channel to use > > > - */ > > > -struct scmi_reset_priv { > > > - struct scmi_channel *channel; > > > -}; > > > - > > > static int scmi_reset_set_level(struct reset_ctl *rst, bool assert_n= ot_deassert) > > > { > > > - struct scmi_reset_priv *priv =3D dev_get_priv(rst->dev); > > > struct scmi_rd_reset_in in =3D { > > > .domain_id =3D rst->id, > > > .flags =3D assert_not_deassert ? SCMI_RD_RESET_FLAG_ASSER= T : 0, > > > @@ -35,7 +26,7 @@ static int scmi_reset_set_level(struct reset_ctl *r= st, bool assert_not_deassert) > > > in, out); > > > int ret; > > > > > > - ret =3D devm_scmi_process_msg(rst->dev, priv->channel, &msg); > > > + ret =3D devm_scmi_process_msg(rst->dev, &msg); > > > if (ret) > > > return ret; > > > > > > @@ -54,7 +45,6 @@ static int scmi_reset_deassert(struct reset_ctl *rs= t) > > > > > > static int scmi_reset_request(struct reset_ctl *rst) > > > { > > > - struct scmi_reset_priv *priv =3D dev_get_priv(rst->dev); > > > struct scmi_rd_attr_in in =3D { > > > .domain_id =3D rst->id, > > > }; > > > @@ -68,7 +58,7 @@ static int scmi_reset_request(struct reset_ctl *rst= ) > > > * We don't really care about the attribute, just check > > > * the reset domain exists. > > > */ > > > - ret =3D devm_scmi_process_msg(rst->dev, priv->channel, &msg); > > > + ret =3D devm_scmi_process_msg(rst->dev, &msg); > > > if (ret) > > > return ret; > > > > > > @@ -83,9 +73,7 @@ static const struct reset_ops scmi_reset_domain_ops= =3D { > > > > > > static int scmi_reset_probe(struct udevice *dev) > > > { > > > - struct scmi_reset_priv *priv =3D dev_get_priv(dev); > > > - > > > - return devm_scmi_of_get_channel(dev, &priv->channel); > > > + return devm_scmi_of_get_channel(dev); > > > } > > > > > > U_BOOT_DRIVER(scmi_reset_domain) =3D { > > > @@ -93,5 +81,4 @@ U_BOOT_DRIVER(scmi_reset_domain) =3D { > > > .id =3D UCLASS_RESET, > > > .ops =3D &scmi_reset_domain_ops, > > > .probe =3D scmi_reset_probe, > > > - .priv_auto =3D sizeof(struct scmi_reset_priv *), > > > }; > > > diff --git a/include/scmi_agent.h b/include/scmi_agent.h > > > index ee6286366df7..577892029ff8 100644 > > > --- a/include/scmi_agent.h > > > +++ b/include/scmi_agent.h > > > @@ -15,6 +15,14 @@ > > > struct udevice; > > > struct scmi_channel; > > > > > > +/** > > > + * struct scmi_agent_proto_priv - Private data in device for SCMI ag= ent > > > + * @channel: Reference to the SCMI channel to use > > > + */ > > > +struct scmi_agent_proto_priv { > > > + struct scmi_channel *channel; > > > +}; > > > + > > > /* > > > * struct scmi_msg - Context of a SCMI message sent and the response= received > > > * > > > @@ -49,10 +57,9 @@ struct scmi_msg { > > > * devm_scmi_of_get_channel() - Get SCMI channel handle from SCMI ag= ent DT node > > > * > > > * @dev: Device requesting a channel > > > - * @channel: Output reference to the SCMI channel upon success > > > * @return 0 on success and a negative errno on failure > > > */ > > > -int devm_scmi_of_get_channel(struct udevice *dev, struct scmi_channe= l **channel); > > > +int devm_scmi_of_get_channel(struct udevice *dev); > > > > > > /** > > > * devm_scmi_process_msg() - Send and process an SCMI message > > > @@ -62,12 +69,10 @@ int devm_scmi_of_get_channel(struct udevice *dev,= struct scmi_channel **channel) > > > * On return, scmi_msg::out_msg_sz stores the response payload size. > > > * > > > * @dev: SCMI device > > > - * @channel: Communication channel for the device > > > * @msg: Message structure reference > > > * Return: 0 on success and a negative errno on failure > > > */ > > > -int devm_scmi_process_msg(struct udevice *dev, struct scmi_channel *= channel, > > > - struct scmi_msg *msg); > > > +int devm_scmi_process_msg(struct udevice *dev, struct scmi_msg *msg)= ; > > > > > > /** > > > * scmi_to_linux_errno() - Convert an SCMI error code into a Linux e= rrno code > > > -- > > > 2.41.0 >=20