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] [day] [month] [year] [list]
Message-ID: <556456A1.7030401@arm.com>
Date:	Tue, 26 May 2015 12:18:57 +0100
From:	Sudeep Holla <sudeep.holla@....com>
To:	"Jon Medhurst (Tixy)" <tixy@...aro.org>
CC:	Sudeep Holla <sudeep.holla@....com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
	"linux-clk@...r.kernel.org" <linux-clk@...r.kernel.org>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>,
	Liviu Dudau <Liviu.Dudau@....com>,
	Lorenzo Pieralisi <Lorenzo.Pieralisi@....com>,
	Jassi Brar <jassisinghbrar@...il.com>
Subject: Re: [PATCH v2 2/5] firmware: add support for ARM System Control and
 Power Interface(SCPI) protocol



On 20/05/15 12:17, Jon Medhurst (Tixy) wrote:
> On Thu, 2015-05-14 at 16:42 +0100, Sudeep Holla wrote:
>> This patch adds support for System Control and Power Interface (SCPI)
>> Message Protocol used between the Application Cores(AP) and the System
>> Control Processor(SCP). The MHU peripheral provides a mechanism for
>> inter-processor communication between SCP's M3 processor and AP.
>>
>> SCP offers control and management of the core/cluster power states,
>> various power domain DVFS including the core/cluster, certain system
>> clocks configuration, thermal sensors and many others.
>>
>> This protocol driver provides interface for all the client drivers using
>> SCPI to make use of the features offered by the SCP.
>>
>> Signed-off-by: Sudeep Holla <sudeep.holla@....com>
>> CC: Jassi Brar <jassisinghbrar@...il.com>
>> Cc: Liviu Dudau <Liviu.Dudau@....com>
>> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@....com>
>> Cc: Jon Medhurst (Tixy) <tixy@...aro.org>
>> ---
>
> Sorry for the delay in looking at this. I have one nitpick below but
> anyway, here's a
>
> Reviewed-by: Jon Medhurst (Tixy) <tixy@...aro.org>
>

Thanks!

> [...]
>> +++ b/drivers/firmware/arm_scpi.c
> [...]
>> +static void scpi_process_cmd(struct scpi_chan *ch, u32 cmd)
>> +{
>> +	unsigned long flags;
>> +	struct scpi_xfer *t, *match = NULL;
>> +
>> +	spin_lock_irqsave(&ch->rx_lock, flags);
>> +	if (list_empty(&ch->rx_pending)) {
>> +		spin_unlock_irqrestore(&ch->rx_lock, flags);
>> +		return;
>> +	}
>> +
>> +	list_for_each_entry(t, &ch->rx_pending, node)
>> +		if (CMD_XTRACT_UNIQ(t->cmd) == CMD_XTRACT_UNIQ(cmd)) {
>> +			list_del(&t->node);
>> +			match = t;
>> +			break;
>> +		}
>> +	/* check if wait_for_completion is in progress or timed-out */
>> +	if (match && !completion_done(&match->done)) {
>> +		struct scpi_shared_mem *mem = ch->rx_payload;
>> +		int len = min(match->rx_len, CMD_SIZE(cmd));
>> +
>> +		match->status = le32_to_cpu(mem->status);
>> +		memcpy_fromio(match->rx_buf, mem->payload, len);
>> +		if (match->rx_len > len)
>
> rx_len is unsigned and len is signed and so I had to go refresh my
> memory from the C standard before I could convince myself that this if
> statement was OK. Might be clearer if len was unsigned, especially as
> it's the 'min' of two unsigned values.
>

Fixed locally for next version.

Regards,
Sudeep
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ