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:   Thu, 02 Jan 2020 14:26:14 +0100
From:   Philipp Zabel <p.zabel@...gutronix.de>
To:     Sibi Sankar <sibis@...eaurora.org>, bjorn.andersson@...aro.org
Cc:     ohad@...ery.com, mark.rutland@....com,
        linux-arm-msm@...r.kernel.org, linux-remoteproc@...r.kernel.org,
        devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
        agross@...nel.org
Subject: Re: [PATCH v2 2/2] remoteproc: mss: q6v5-mss: Add modem support on
 SC7180

On Thu, 2019-12-19 at 11:15 +0530, Sibi Sankar wrote:
> Add the out of reset sequence support for modem sub-system on SC7180
> SoCs. It requires access to an additional halt nav register to put
> the modem back into reset.
> 
> Signed-off-by: Sibi Sankar <sibis@...eaurora.org>
> ---
>  drivers/remoteproc/qcom_q6v5_mss.c | 199 ++++++++++++++++++++++++++++-
>  1 file changed, 198 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
> index 164fc2a53ef11..51f451311f5fc 100644
> --- a/drivers/remoteproc/qcom_q6v5_mss.c
> +++ b/drivers/remoteproc/qcom_q6v5_mss.c
[...]
> @@ -396,6 +409,18 @@ static int q6v5_reset_assert(struct q6v5 *qproc)
>  		reset_control_assert(qproc->pdc_reset);
>  		ret = reset_control_reset(qproc->mss_restart);
>  		reset_control_deassert(qproc->pdc_reset);
> +	} else if (qproc->has_halt_nav) {
> +		/* SWAR using CONN_BOX_SPARE_0 for pipeline glitch issue */
> +		reset_control_assert(qproc->pdc_reset);
> +		regmap_update_bits(qproc->conn_map, qproc->conn_box,
> +				   BIT(0), BIT(0));
> +		regmap_update_bits(qproc->halt_nav_map, qproc->halt_nav,
> +				   NAV_AXI_HALTREQ_BIT, 0);
> +		reset_control_assert(qproc->mss_restart);
> +		reset_control_deassert(qproc->pdc_reset);
> +		regmap_update_bits(qproc->conn_map, qproc->conn_box,
> +				   BIT(0), 0);
> +		ret = reset_control_deassert(qproc->mss_restart);
>  	} else {
>  		ret = reset_control_assert(qproc->mss_restart);
>  	}

Without knowing anything about the hardware this does look a bit weird,
but I assume there is a good reason for every step.

Is the function name still describing its behaviour correctly, or would
it make sense to rename q6v5_reset_assert/deassert to something else?

[...]
> @@ -667,6 +742,39 @@ static void q6v5proc_halt_axi_port(struct q6v5 *qproc,
>  	regmap_write(halt_map, offset + AXI_HALTREQ_REG, 0);
>  }
>  
> +static void q6v5proc_halt_nav_axi_port(struct q6v5 *qproc,
> +				       struct regmap *halt_map,
> +				       u32 offset)
> +{
[...]
> +	/* Wait for halt ack*/
> +	timeout = jiffies + msecs_to_jiffies(HALT_ACK_TIMEOUT_MS);
> +	for (;;) {
> +		ret = regmap_read(halt_map, offset, &val);
> +		if (ret || (val & NAV_AXI_HALTACK_BIT) ||
> +		    time_after(jiffies, timeout))
> +			break;
> +
> +		udelay(5);
> +	}

This does look like a candidate for using regmap_read_poll_timeout().

regards
Philipp

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ