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]
Message-ID: <20260119113326.00005902@huawei.com>
Date: Mon, 19 Jan 2026 11:33:26 +0000
From: Jonathan Cameron <jonathan.cameron@...wei.com>
To: Cristian Marussi <cristian.marussi@....com>
CC: <linux-kernel@...r.kernel.org>, <linux-arm-kernel@...ts.infradead.org>,
	<arm-scmi@...r.kernel.org>, <linux-fsdevel@...r.kernel.org>,
	<sudeep.holla@....com>, <james.quinlan@...adcom.com>, <f.fainelli@...il.com>,
	<vincent.guittot@...aro.org>, <etienne.carriere@...com>,
	<peng.fan@....nxp.com>, <michal.simek@....com>, <dan.carpenter@...aro.org>,
	<d-gole@...com>, <elif.topuz@....com>, <lukasz.luba@....com>,
	<philip.radford@....com>, <souvik.chakravarty@....com>
Subject: Re: [PATCH v2 03/17] firmware: arm_scmi: Allow protocols to
 register for notifications

On Wed, 14 Jan 2026 11:46:07 +0000
Cristian Marussi <cristian.marussi@....com> wrote:

> Allow protocols themselves to register for their own notifications and

and provide their own notifier callbacks.

> providing their own notifier callbacks. While at that, allow for a protocol
> to register events with compilation-time unknown report/event sizes: such
> events will use the maximum transport size.

I'm not keen on the 'while at that' part of the patch. In an ideal
world that's a separate patch.

One other comment inline.

Jonathan
p.s. You get to my review victim whilst I run a particularly annoying
bisection on the other screen (completely unrelated!) :)

> 
> Signed-off-by: Cristian Marussi <cristian.marussi@....com>
> ---
> v1-->v2
>  - Fixed multiline comment format
> ---
>  drivers/firmware/arm_scmi/common.h    |  4 ++++
>  drivers/firmware/arm_scmi/driver.c    | 12 ++++++++++++
>  drivers/firmware/arm_scmi/notify.c    | 28 ++++++++++++++++++++-------
>  drivers/firmware/arm_scmi/notify.h    |  8 ++++++--
>  drivers/firmware/arm_scmi/protocols.h |  6 ++++++
>  5 files changed, 49 insertions(+), 9 deletions(-)
> 


> diff --git a/drivers/firmware/arm_scmi/notify.c b/drivers/firmware/arm_scmi/notify.c
> index 78e9e27dc9ec..e84b4dbefe82 100644
> --- a/drivers/firmware/arm_scmi/notify.c
> +++ b/drivers/firmware/arm_scmi/notify.c


> @@ -779,8 +787,13 @@ int scmi_register_protocol_events(const struct scmi_handle *handle, u8 proto_id,
>  	}
>  
>  	evt = ee->evts;
> -	for (i = 0; i < ee->num_events; i++)
> +	for (i = 0; i < ee->num_events; i++) {
> +		if (evt[i].max_payld_sz == 0) {
> +			payld_sz = max_msg_sz;
> +			break;
> +		}
>  		payld_sz = max_t(size_t, payld_sz, evt[i].max_payld_sz);

Everything here seems to already be a size_t.  It is rare that we actually need max_t over
max, and definitely not when all the types match.
		payld_sz = max(payl_sz, evt[i].max_payld_sz);

> +	}
>  	payld_sz += sizeof(struct scmi_event_header);


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ