diff mbox series

[1/2] mmc: meson-gx: make replace WARN_ONCE with dev_warn_once about scatterlist offset alignment

Message ID 20210426175559.3110575-1-narmstrong@baylibre.com
State New
Headers show
Series [1/2] mmc: meson-gx: make replace WARN_ONCE with dev_warn_once about scatterlist offset alignment | expand

Commit Message

Neil Armstrong April 26, 2021, 5:55 p.m. UTC
Some drivers like ath10k can sometimg give an sg buffer with an offset whose alignment
is not compatible with the Amlogic DMA descriptor engine requirements.

Simply replace with dev_warn_once() to inform user this should be fixed to avoid
degraded performance.

This should be ultimately fixed in ath10k, but since it's only a performance issue
the warning should be removed.

Fixes: 79ed05e329c3 ("mmc: meson-gx: add support for descriptor chain mode")
Reported-by: Christian Hewitt <christianshewitt@gmail.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
 drivers/mmc/host/meson-gx-mmc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Martin Blumenstingl April 27, 2021, 6:34 p.m. UTC | #1
Hi Neil,

On Mon, Apr 26, 2021 at 7:58 PM Neil Armstrong <narmstrong@baylibre.com> wrote:
>

> Some drivers like ath10k can sometimg give an sg buffer with an offset whose alignment

sometimg -> sometimes

> is not compatible with the Amlogic DMA descriptor engine requirements.

>

> Simply replace with dev_warn_once() to inform user this should be fixed to avoid

> degraded performance.

>

> This should be ultimately fixed in ath10k, but since it's only a performance issue

> the warning should be removed.

>

> Fixes: 79ed05e329c3 ("mmc: meson-gx: add support for descriptor chain mode")

> Reported-by: Christian Hewitt <christianshewitt@gmail.com>

> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>

Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Ulf Hansson May 11, 2021, 10:56 a.m. UTC | #2
On Mon, 26 Apr 2021 at 19:56, Neil Armstrong <narmstrong@baylibre.com> wrote:
>

> Some drivers like ath10k can sometimg give an sg buffer with an offset whose alignment

> is not compatible with the Amlogic DMA descriptor engine requirements.

>

> Simply replace with dev_warn_once() to inform user this should be fixed to avoid

> degraded performance.

>

> This should be ultimately fixed in ath10k, but since it's only a performance issue

> the warning should be removed.

>

> Fixes: 79ed05e329c3 ("mmc: meson-gx: add support for descriptor chain mode")

> Reported-by: Christian Hewitt <christianshewitt@gmail.com>

> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>


Applied for fixes and by adding a stable tag, thanks!

Kind regards
Uffe


> ---

>  drivers/mmc/host/meson-gx-mmc.c | 4 +++-

>  1 file changed, 3 insertions(+), 1 deletion(-)

>

> diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c

> index b8b771b643cc..1c61f0f24c09 100644

> --- a/drivers/mmc/host/meson-gx-mmc.c

> +++ b/drivers/mmc/host/meson-gx-mmc.c

> @@ -258,7 +258,9 @@ static void meson_mmc_get_transfer_mode(struct mmc_host *mmc,

>         for_each_sg(data->sg, sg, data->sg_len, i) {

>                 /* check for 8 byte alignment */

>                 if (sg->offset % 8) {

> -                       WARN_ONCE(1, "unaligned scatterlist buffer\n");

> +                       dev_warn_once(mmc_dev(mmc),

> +                                     "unaligned sg offset %u, disabling descriptor DMA for transfer\n",

> +                                     sg->offset);

>                         return;

>                 }

>         }

> --

> 2.25.1

>
diff mbox series

Patch

diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c
index b8b771b643cc..1c61f0f24c09 100644
--- a/drivers/mmc/host/meson-gx-mmc.c
+++ b/drivers/mmc/host/meson-gx-mmc.c
@@ -258,7 +258,9 @@  static void meson_mmc_get_transfer_mode(struct mmc_host *mmc,
 	for_each_sg(data->sg, sg, data->sg_len, i) {
 		/* check for 8 byte alignment */
 		if (sg->offset % 8) {
-			WARN_ONCE(1, "unaligned scatterlist buffer\n");
+			dev_warn_once(mmc_dev(mmc),
+				      "unaligned sg offset %u, disabling descriptor DMA for transfer\n",
+				      sg->offset);
 			return;
 		}
 	}