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: <20220908123237.6hgd22o6koe5ulmm@blmsp>
Date:   Thu, 8 Sep 2022 14:32:37 +0200
From:   Markus Schneider-Pargmann <msp@...libre.com>
To:     Neil Armstrong <narmstrong@...libre.com>
Cc:     broonie@...nel.org, linux-spi@...r.kernel.org,
        linux-amlogic@...ts.infradead.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] spi: meson-spicc: do not rely on busy flag in pow2 clk
 ops

Hi Neil,

thanks for fixing.

On Thu, Sep 08, 2022 at 02:18:03PM +0200, Neil Armstrong wrote:
> Since [1], controller's busy flag isn't set anymore when the
> __spi_transfer_message_noqueue() is used instead of the
> __spi_pump_transfer_message() logic for spi_sync transfers.
> 
> Since the pow2 clock ops were limited to only be available when a
> transfer is ongoing (between prepare_transfer_hardware and
> unprepare_transfer_hardware callbacks), the only way to track this
> down is to check for the controller cur_msg.
> 
> [1] ae7d2346dc89 ("spi: Don't use the message queue if possible in spi_sync")
> 
> Fixes: 09992025dacd ("spi: meson-spicc: add local pow2 clock ops to preserve rate between messages")
> Fixes: ae7d2346dc89 ("spi: Don't use the message queue if possible in spi_sync")
> Reported-by: Markus Schneider-Pargmann <msp@...libre.com>
> Signed-off-by: Neil Armstrong <narmstrong@...libre.com>

Tested-by: Markus Schneider-Pargmann <msp@...libre.com>

Best,
Markus

> ---
>  drivers/spi/spi-meson-spicc.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/spi/spi-meson-spicc.c b/drivers/spi/spi-meson-spicc.c
> index e4cb52e1fe26..6974a1c947aa 100644
> --- a/drivers/spi/spi-meson-spicc.c
> +++ b/drivers/spi/spi-meson-spicc.c
> @@ -537,7 +537,7 @@ static unsigned long meson_spicc_pow2_recalc_rate(struct clk_hw *hw,
>  	struct clk_divider *divider = to_clk_divider(hw);
>  	struct meson_spicc_device *spicc = pow2_clk_to_spicc(divider);
>  
> -	if (!spicc->master->cur_msg || !spicc->master->busy)
> +	if (!spicc->master->cur_msg)
>  		return 0;
>  
>  	return clk_divider_ops.recalc_rate(hw, parent_rate);
> @@ -549,7 +549,7 @@ static int meson_spicc_pow2_determine_rate(struct clk_hw *hw,
>  	struct clk_divider *divider = to_clk_divider(hw);
>  	struct meson_spicc_device *spicc = pow2_clk_to_spicc(divider);
>  
> -	if (!spicc->master->cur_msg || !spicc->master->busy)
> +	if (!spicc->master->cur_msg)
>  		return -EINVAL;
>  
>  	return clk_divider_ops.determine_rate(hw, req);
> @@ -561,7 +561,7 @@ static int meson_spicc_pow2_set_rate(struct clk_hw *hw, unsigned long rate,
>  	struct clk_divider *divider = to_clk_divider(hw);
>  	struct meson_spicc_device *spicc = pow2_clk_to_spicc(divider);
>  
> -	if (!spicc->master->cur_msg || !spicc->master->busy)
> +	if (!spicc->master->cur_msg)
>  		return -EINVAL;
>  
>  	return clk_divider_ops.set_rate(hw, rate, parent_rate);
> -- 
> 2.25.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ