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:   Tue, 13 Aug 2019 09:34:37 -0500
From:   Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
To:     Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
        vkoul@...nel.org, broonie@...nel.org
Cc:     devicetree@...r.kernel.org, alsa-devel@...a-project.org,
        bgoswami@...eaurora.org, linux-kernel@...r.kernel.org,
        plai@...eaurora.org, lgirdwood@...il.com, robh+dt@...nel.org,
        spapothi@...eaurora.org
Subject: Re: [PATCH v2 1/5] soundwire: Add compute_params callback

On 8/13/19 3:35 AM, Srinivas Kandagatla wrote:
> From: Vinod Koul <vkoul@...nel.org>
> 
> This callback allows masters to compute the bus parameters required.

This looks like a partial use of the patch ('soundwire: Add Intel 
resource management algorithm')? see comments below

> 
> Signed-off-by: Vinod Koul <vkoul@...nel.org>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
> ---
>   drivers/soundwire/stream.c    | 10 ++++++++++
>   include/linux/soundwire/sdw.h |  2 ++
>   2 files changed, 12 insertions(+)
> 
> diff --git a/drivers/soundwire/stream.c b/drivers/soundwire/stream.c
> index a0476755a459..60bc2fe42928 100644
> --- a/drivers/soundwire/stream.c
> +++ b/drivers/soundwire/stream.c
> @@ -1483,6 +1483,16 @@ static int _sdw_prepare_stream(struct sdw_stream_runtime *stream)
>   		bus->params.bandwidth += m_rt->stream->params.rate *
>   			m_rt->ch_count * m_rt->stream->params.bps;
>   
> +		/* Compute params */
> +		if (bus->compute_params) {
> +			ret = bus->compute_params(bus);
> +			if (ret < 0) {
> +				dev_err(bus->dev, "Compute params failed: %d",
> +					ret);
> +				return ret;
> +			}
> +		}
> +

This would need to be duplicated for deprepare (as was done in the Intel 
patch).

>   		/* Program params */
>   		ret = sdw_program_params(bus);
>   		if (ret < 0) {
> diff --git a/include/linux/soundwire/sdw.h b/include/linux/soundwire/sdw.h
> index bea46bd8b6ce..aac68e879fae 100644
> --- a/include/linux/soundwire/sdw.h
> +++ b/include/linux/soundwire/sdw.h
> @@ -718,6 +718,7 @@ struct sdw_master_ops {
>    * Bit set implies used number, bit clear implies unused number.
>    * @bus_lock: bus lock
>    * @msg_lock: message lock
> + * @compute_params: points to Bus resource management implementation
>    * @ops: Master callback ops
>    * @port_ops: Master port callback ops
>    * @params: Current bus parameters
> @@ -739,6 +740,7 @@ struct sdw_bus {
>   	DECLARE_BITMAP(assigned, SDW_MAX_DEVICES);
>   	struct mutex bus_lock;
>   	struct mutex msg_lock;
> +	int (*compute_params)(struct sdw_bus *bus);

not sure I understand how it's set? We have a default in the Intel patch.

>   	const struct sdw_master_ops *ops;
>   	const struct sdw_master_port_ops *port_ops;
>   	struct sdw_bus_params params;
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ