[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAPDyKFpHUWodb_j8pF-tGV9JRMBEEAgsS7gouJ0rQLsJuxkTdQ@mail.gmail.com>
Date: Mon, 28 Mar 2022 16:04:52 +0200
From: Ulf Hansson <ulf.hansson@...aro.org>
To: Yann Gautier <yann.gautier@...s.st.com>
Cc: Christophe Kerello <christophe.kerello@...s.st.com>,
Ludovic Barre <ludovic.barre@...s.st.com>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Philipp Zabel <p.zabel@...gutronix.de>,
Linus Walleij <linus.walleij@...aro.org>,
linux-mmc@...r.kernel.org,
linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] mmc: mmci: stm32: correctly check all elements of sg list
On Thu, 17 Mar 2022 at 12:19, Yann Gautier <yann.gautier@...s.st.com> wrote:
>
> 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")
>
> Signed-off-by: Yann Gautier <yann.gautier@...s.st.com>
This one, applied for fixes, thanks!
Kind regards
Uffe
> ---
> drivers/mmc/host/mmci_stm32_sdmmc.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> 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);
> --
> 2.25.1
>
Powered by blists - more mailing lists