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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <41c33633-a6ca-4eb4-91ba-f2cd43600e93@pengutronix.de>
Date:   Wed, 16 Aug 2023 17:07:58 +0200
From:   Leonard Göhrs <l.goehrs@...gutronix.de>
To:     Valentin Caron <valentin.caron@...s.st.com>,
        Mark Brown <broonie@...nel.org>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Conor Dooley <conor+dt@...nel.org>,
        Alexandre Torgue <alexandre.torgue@...s.st.com>,
        Alain Volmat <alain.volmat@...s.st.com>
Cc:     linux-spi@...r.kernel.org, devicetree@...r.kernel.org,
        linux-stm32@...md-mailman.stormreply.com,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 1/4] spi: stm32: renaming of spi_master into
 spi_controller

Hello,

On 15.06.23 09:58, Valentin Caron wrote:
> From: Alain Volmat <alain.volmat@...s.st.com>
> 
> Preparing introduction of SPI device, rename the spi_master structure
> into spi_controller. This doesn't have any functional impact since
> spi_master was already a macro for spi_controller.
> Referring now to ctrl instead of master since the spi_controller
> structure might not be used as a master controller only.
> 
> Signed-off-by: Alain Volmat <alain.volmat@...s.st.com>
> Signed-off-by: Valentin Caron <valentin.caron@...s.st.com>
> ---
>   drivers/spi/spi-stm32.c | 154 ++++++++++++++++++++--------------------
>   1 file changed, 77 insertions(+), 77 deletions(-)
> 
> diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c
> index d6598e4116bd..5d9439ae1c09 100644
> --- a/drivers/spi/spi-stm32.c
> +++ b/drivers/spi/spi-stm32.c

<snip>

> @@ -939,13 +939,13 @@ static irqreturn_t stm32h7_spi_irq_thread(int irq, void *dev_id)
>   
>   /**
>    * stm32_spi_prepare_msg - set up the controller to transfer a single message
> - * @master: controller master interface
> + * @ctrl: controller interface
>    * @msg: pointer to spi message
>    */
> -static int stm32_spi_prepare_msg(struct spi_master *master,
> +static int stm32_spi_prepare_msg(struct spi_controller *ctrl,
>   				 struct spi_message *msg)
>   {
> -	struct stm32_spi *spi = spi_master_get_devdata(master);
> +	struct stm32_spi *spi = spi_controller_get_devdata(ctrl);
>   	struct spi_device *spi_dev = msg->spi;
>   	struct device_node *np = spi_dev->dev.of_node;
>   	unsigned long flags;
> @@ -984,9 +984,9 @@ static int stm32_spi_prepare_msg(struct spi_master *master,
>   	if (spi->cfg->set_number_of_data) {
>   		int ret;
>   
> -		ret = spi_split_transfers_maxwords(master, msg,
> -						   STM32H7_SPI_TSIZE_MAX,
> -						   GFP_KERNEL | GFP_DMA);
> +		ret = spi_split_transfers_maxsize(ctrl, msg,
> +						  STM32H7_SPI_TSIZE_MAX,
> +						  GFP_KERNEL | GFP_DMA);
>   		if (ret)
>   			return ret;
>   	}

<snip>

this patch introduces a regression when transmitting large SPI transfers with
a word size != 8 bits. The regression is caused by effectively reverting commit
1e4929112507f ("spi: stm32: split large transfers based on word size instead of
bytes") by changing the call to spi_split_transfers_maxwords() back to
spi_split_transfers_maxsize().

I've sent a patch[1] that fixes this regression by changing the …_maxsize()
call back to …_maxwords().

[1]: https://lore.kernel.org/all/20230816145237.3159817-1-l.goehrs@pengutronix.de/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ