lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 8 Mar 2021 05:50:30 +0000
From:   Sudeep Holla <sudeep.holla@....com>
To:     Cristian Marussi <cristian.marussi@....com>
Cc:     linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        lukasz.luba@....com, james.quinlan@...adcom.com,
        Jonathan.Cameron@...wei.com, f.fainelli@...il.com,
        etienne.carriere@...aro.org, thara.gopinath@...aro.org,
        vincent.guittot@...aro.org, souvik.chakravarty@....com
Subject: Re: [PATCH v6 02/37] firmware: arm_scmi: introduce protocol handle
 definitions

On Tue, Feb 02, 2021 at 10:15:20PM +0000, Cristian Marussi wrote:
> Add basic protocol handles definitions and private data helpers support.
> 
> A protocol handle identifies a protocol instance initialized against a
> specific handle; it embeds all the references to the core SCMI xfer methods
> that will be needed by a protocol implementation to build and send its own
> protocol specific messages using common core methods.
> 
> As such, in the interface, a protocol handle will be passed down from the
> core to the protocol specific initialization callback at init time.
> 
> Anyway at this point only definitions are introduced, all protocols
> initialization code and SCMI drivers probing is still based on the old
> interface, so no functional change.
> 
> Signed-off-by: Cristian Marussi <cristian.marussi@....com>
> ---
>  drivers/firmware/arm_scmi/common.h | 59 ++++++++++++++++++++++++++++++
>  drivers/firmware/arm_scmi/driver.c | 45 +++++++++++++++++++++++
>  2 files changed, 104 insertions(+)
> 

[...]

> diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
> index ed94efbecd61..2328a468bbd1 100644
> --- a/drivers/firmware/arm_scmi/driver.c
> +++ b/drivers/firmware/arm_scmi/driver.c

[...]

>  /**
>   * scmi_get_protocol_instance  - Protocol initialization helper.
>   * @handle: A reference to the SCMI platform instance.
> @@ -588,6 +629,10 @@ scmi_get_protocol_instance(struct scmi_handle *handle, u8 protocol_id)
>  
>  		pi->gid = gid;
>  		pi->proto = proto;
> +		pi->handle = handle;
> +		pi->ph.dev = handle->dev;
> +		pi->ph.set_priv = scmi_set_protocol_priv;
> +		pi->ph.get_priv = scmi_get_protocol_priv;


Sorry missed this in earlier patch. Not a must, but I prefer if you can move
all these initialisation into separate functions so that scmi_get_protocol_instance
can be simplified to read.

if (pi)
	increment refcount
else
	scmi_get_protocol
	alloc and init protocol instance
	register events

How about some thing like above ?

--
Regards,
Sudeep

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ