All of lore.kernel.org
 help / color / mirror / Atom feed
* FAILED: patch "[PATCH] mmc: mmci: stm32: correctly check all elements of sg list" failed to apply to 5.4-stable tree
@ 2022-04-11  7:33 gregkh
  2022-04-11  8:30 ` Yann Gautier
  0 siblings, 1 reply; 3+ messages in thread
From: gregkh @ 2022-04-11  7:33 UTC (permalink / raw)
  To: yann.gautier, ulf.hansson; +Cc: stable


The patch below does not apply to the 5.4-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 0d319dd5a27183b75d984e3dc495248e59f99334 Mon Sep 17 00:00:00 2001
From: Yann Gautier <yann.gautier@foss.st.com>
Date: Thu, 17 Mar 2022 12:19:43 +0100
Subject: [PATCH] mmc: mmci: stm32: correctly check all elements of sg list

Use sg and not data->sg when checking sg list elements. Else only the
first element alignment is checked.
The last element should be checked the same way, for_each_sg already set
sg to sg_next(sg).

Fixes: 46b723dd867d ("mmc: mmci: add stm32 sdmmc variant")
Cc: stable@vger.kernel.org
Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Link: https://lore.kernel.org/r/20220317111944.116148-2-yann.gautier@foss.st.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

diff --git a/drivers/mmc/host/mmci_stm32_sdmmc.c b/drivers/mmc/host/mmci_stm32_sdmmc.c
index 9c13f2c31365..4566d7fc9055 100644
--- a/drivers/mmc/host/mmci_stm32_sdmmc.c
+++ b/drivers/mmc/host/mmci_stm32_sdmmc.c
@@ -62,8 +62,8 @@ static int sdmmc_idma_validate_data(struct mmci_host *host,
 	 * excepted the last element which has no constraint on idmasize
 	 */
 	for_each_sg(data->sg, sg, data->sg_len - 1, i) {
-		if (!IS_ALIGNED(data->sg->offset, sizeof(u32)) ||
-		    !IS_ALIGNED(data->sg->length, SDMMC_IDMA_BURST)) {
+		if (!IS_ALIGNED(sg->offset, sizeof(u32)) ||
+		    !IS_ALIGNED(sg->length, SDMMC_IDMA_BURST)) {
 			dev_err(mmc_dev(host->mmc),
 				"unaligned scatterlist: ofst:%x length:%d\n",
 				data->sg->offset, data->sg->length);
@@ -71,7 +71,7 @@ static int sdmmc_idma_validate_data(struct mmci_host *host,
 		}
 	}
 
-	if (!IS_ALIGNED(data->sg->offset, sizeof(u32))) {
+	if (!IS_ALIGNED(sg->offset, sizeof(u32))) {
 		dev_err(mmc_dev(host->mmc),
 			"unaligned last scatterlist: ofst:%x length:%d\n",
 			data->sg->offset, data->sg->length);


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: FAILED: patch "[PATCH] mmc: mmci: stm32: correctly check all elements of sg list" failed to apply to 5.4-stable tree
  2022-04-11  7:33 FAILED: patch "[PATCH] mmc: mmci: stm32: correctly check all elements of sg list" failed to apply to 5.4-stable tree gregkh
@ 2022-04-11  8:30 ` Yann Gautier
  2022-04-11 13:30   ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Yann Gautier @ 2022-04-11  8:30 UTC (permalink / raw)
  To: gregkh, ulf.hansson; +Cc: stable

On 4/11/22 09:33, gregkh@linuxfoundation.org wrote:
> 
> The patch below does not apply to the 5.4-stable tree.
> If someone wants it applied there, or to any other stable or longterm
> tree, then please email the backport, including the original git commit
> id to <stable@vger.kernel.org>.
> 
> thanks,
> 
> greg k-h

Hi Greg,

The patch doesn't apply because the following one is not there:
127e6e98ca9b mmc: mmci_sdmmc: Replace sg_dma_xxx macros

Maybe it should have been a fix patch too.

Ulf, what is your opinion on that?


Best regards,
Yann

> 
> ------------------ original commit in Linus's tree ------------------
> 
>  From 0d319dd5a27183b75d984e3dc495248e59f99334 Mon Sep 17 00:00:00 2001
> From: Yann Gautier <yann.gautier@foss.st.com>
> Date: Thu, 17 Mar 2022 12:19:43 +0100
> Subject: [PATCH] mmc: mmci: stm32: correctly check all elements of sg list
> 
> Use sg and not data->sg when checking sg list elements. Else only the
> first element alignment is checked.
> The last element should be checked the same way, for_each_sg already set
> sg to sg_next(sg).
> 
> Fixes: 46b723dd867d ("mmc: mmci: add stm32 sdmmc variant")
> Cc: stable@vger.kernel.org
> Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
> Link: https://lore.kernel.org/r/20220317111944.116148-2-yann.gautier@foss.st.com
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> 
> diff --git a/drivers/mmc/host/mmci_stm32_sdmmc.c b/drivers/mmc/host/mmci_stm32_sdmmc.c
> index 9c13f2c31365..4566d7fc9055 100644
> --- a/drivers/mmc/host/mmci_stm32_sdmmc.c
> +++ b/drivers/mmc/host/mmci_stm32_sdmmc.c
> @@ -62,8 +62,8 @@ static int sdmmc_idma_validate_data(struct mmci_host *host,
>   	 * excepted the last element which has no constraint on idmasize
>   	 */
>   	for_each_sg(data->sg, sg, data->sg_len - 1, i) {
> -		if (!IS_ALIGNED(data->sg->offset, sizeof(u32)) ||
> -		    !IS_ALIGNED(data->sg->length, SDMMC_IDMA_BURST)) {
> +		if (!IS_ALIGNED(sg->offset, sizeof(u32)) ||
> +		    !IS_ALIGNED(sg->length, SDMMC_IDMA_BURST)) {
>   			dev_err(mmc_dev(host->mmc),
>   				"unaligned scatterlist: ofst:%x length:%d\n",
>   				data->sg->offset, data->sg->length);
> @@ -71,7 +71,7 @@ static int sdmmc_idma_validate_data(struct mmci_host *host,
>   		}
>   	}
>   
> -	if (!IS_ALIGNED(data->sg->offset, sizeof(u32))) {
> +	if (!IS_ALIGNED(sg->offset, sizeof(u32))) {
>   		dev_err(mmc_dev(host->mmc),
>   			"unaligned last scatterlist: ofst:%x length:%d\n",
>   			data->sg->offset, data->sg->length);
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: FAILED: patch "[PATCH] mmc: mmci: stm32: correctly check all elements of sg list" failed to apply to 5.4-stable tree
  2022-04-11  8:30 ` Yann Gautier
@ 2022-04-11 13:30   ` Greg KH
  0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2022-04-11 13:30 UTC (permalink / raw)
  To: Yann Gautier; +Cc: ulf.hansson, stable

On Mon, Apr 11, 2022 at 10:30:47AM +0200, Yann Gautier wrote:
> On 4/11/22 09:33, gregkh@linuxfoundation.org wrote:
> > 
> > The patch below does not apply to the 5.4-stable tree.
> > If someone wants it applied there, or to any other stable or longterm
> > tree, then please email the backport, including the original git commit
> > id to <stable@vger.kernel.org>.
> > 
> > thanks,
> > 
> > greg k-h
> 
> Hi Greg,
> 
> The patch doesn't apply because the following one is not there:
> 127e6e98ca9b mmc: mmci_sdmmc: Replace sg_dma_xxx macros
> 
> Maybe it should have been a fix patch too.

that works, thanks!

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-04-11 13:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-11  7:33 FAILED: patch "[PATCH] mmc: mmci: stm32: correctly check all elements of sg list" failed to apply to 5.4-stable tree gregkh
2022-04-11  8:30 ` Yann Gautier
2022-04-11 13:30   ` Greg KH

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.