All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Leonard Göhrs" <l.goehrs@pengutronix.de>
To: Valentin Caron <valentin.caron@foss.st.com>,
	Mark Brown <broonie@kernel.org>, Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Alain Volmat <alain.volmat@foss.st.com>
Cc: linux-spi@vger.kernel.org, devicetree@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/4] spi: stm32: renaming of spi_master into spi_controller
Date: Wed, 16 Aug 2023 17:07:58 +0200	[thread overview]
Message-ID: <41c33633-a6ca-4eb4-91ba-f2cd43600e93@pengutronix.de> (raw)
In-Reply-To: <20230615075815.310261-2-valentin.caron@foss.st.com>

Hello,

On 15.06.23 09:58, Valentin Caron wrote:
> From: Alain Volmat <alain.volmat@foss.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@foss.st.com>
> Signed-off-by: Valentin Caron <valentin.caron@foss.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/

WARNING: multiple messages have this Message-ID (diff)
From: "Leonard Göhrs" <l.goehrs@pengutronix.de>
To: Valentin Caron <valentin.caron@foss.st.com>,
	Mark Brown <broonie@kernel.org>, Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Alain Volmat <alain.volmat@foss.st.com>
Cc: linux-spi@vger.kernel.org, devicetree@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/4] spi: stm32: renaming of spi_master into spi_controller
Date: Wed, 16 Aug 2023 17:07:58 +0200	[thread overview]
Message-ID: <41c33633-a6ca-4eb4-91ba-f2cd43600e93@pengutronix.de> (raw)
In-Reply-To: <20230615075815.310261-2-valentin.caron@foss.st.com>

Hello,

On 15.06.23 09:58, Valentin Caron wrote:
> From: Alain Volmat <alain.volmat@foss.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@foss.st.com>
> Signed-off-by: Valentin Caron <valentin.caron@foss.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/

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2023-08-16 15:09 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-15  7:58 [PATCH v3 0/4] spi: stm32: add spi device mode Valentin Caron
2023-06-15  7:58 ` Valentin Caron
2023-06-15  7:58 ` [PATCH v3 1/4] spi: stm32: renaming of spi_master into spi_controller Valentin Caron
2023-06-15  7:58   ` Valentin Caron
2023-08-16 15:07   ` Leonard Göhrs [this message]
2023-08-16 15:07     ` Leonard Göhrs
2023-06-15  7:58 ` [PATCH v3 2/4] spi: stm32: use dmaengine_terminate_{a}sync instead of _all Valentin Caron
2023-06-15  7:58   ` Valentin Caron
2023-06-15  7:58 ` [PATCH v3 3/4] dt-bindings: spi: stm32: disable spi-slave property for stm32f4-f7 Valentin Caron
2023-06-15  7:58   ` Valentin Caron
2023-06-15 13:36   ` Krzysztof Kozlowski
2023-06-15 13:36     ` Krzysztof Kozlowski
2023-06-15 17:38     ` Valentin CARON
2023-06-15 17:38       ` Valentin CARON
2023-06-15 17:40       ` Mark Brown
2023-06-15 17:40         ` Mark Brown
2023-06-15 20:20       ` Krzysztof Kozlowski
2023-06-15 20:20         ` Krzysztof Kozlowski
2023-06-15  7:58 ` [PATCH v3 4/4] spi: stm32: introduction of stm32h7 SPI device mode support Valentin Caron
2023-06-15  7:58   ` Valentin Caron
2023-06-15 13:15 ` [PATCH v3 0/4] spi: stm32: add spi device mode Mark Brown
2023-06-15 13:15   ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41c33633-a6ca-4eb4-91ba-f2cd43600e93@pengutronix.de \
    --to=l.goehrs@pengutronix.de \
    --cc=alain.volmat@foss.st.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=robh+dt@kernel.org \
    --cc=valentin.caron@foss.st.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.