Skip to contentSkip to conversation

mmc: meson-gx: remove useless warning about scatterlist size alignment in block mode

PATCH In review Neil Armstrong 2 participants 3 messages Apr 14, 2021 – Apr 16, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: meson-gx: remove useless warning about scatterlist size alignment in block mode

Since commit e085b51c74cc ("mmc: meson-gx: check for scatterlist size alignment in block mode"), support for SDIO SD_IO_RW_EXTENDED transferts are properly filtered but some driver like brcmfmac still gives a block sg buffer size not aligned with SDIO block, triggerring a warning even if the transfer works in degraded mode.

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

Fixes e085b51c74cc ("mmc: meson-gx: check for scatterlist size alignment in block mode")
---
 drivers/mmc/host/meson-gx-mmc.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/mmc/host/meson-gx-mmc.c +1 -4
index eb6c02bc4a02..6bc151045843 100644
@@ -246,11 +246,8 @@ static void meson_mmc_get_transfer_mode(struct mmc_host *mmc,
 		 * size, otherwise chain mode could not be used.
 		 */
 		for_each_sg(data->sg, sg, data->sg_len, i) {
-			if (sg->length % data->blksz) {
-				WARN_ONCE(1, "unaligned sg len %u blksize %u\n",
-					  sg->length, data->blksz);
+			if (sg->length % data->blksz)
 				return;
-			}
 		}
 	}
 
Signature · 1 line
2.25.1
#1 lore raw
Quoted 21 lines · Neil Armstrong

Since commit e085b51c74cc ("mmc: meson-gx: check for scatterlist size alignment in block mode"), support for SDIO SD_IO_RW_EXTENDED transferts are properly filtered but some driver like brcmfmac still gives a block sg buffer size not aligned with SDIO block, triggerring a warning even if the transfer works in degraded mode.

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

Fixes e085b51c74cc ("mmc: meson-gx: check for scatterlist size alignment in block mode")
---
 drivers/mmc/host/meson-gx-mmc.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/mmc/host/meson-gx-mmc.c +0 -0
index eb6c02bc4a02..6bc151045843 100644

drivers/mmc/host/meson-gx-mmc.c static void meson_mmc_get_transfer_mode(struct mmc_host *mmc, · line 251

Quoted 6 lines
drivers/mmc/host/meson-gx-mmc.c +0 -3
@@ -246,11 +246,8 @@ static void meson_mmc_get_transfer_mode(struct mmc_host *mmc,
                 * size, otherwise chain mode could not be used.
                 */
                for_each_sg(data->sg, sg, data->sg_len, i) {
-                       if (sg->length % data->blksz) {
-                               WARN_ONCE(1, "unaligned sg len %u blksize %u\n",
-                                         sg->length, data->blksz);

Rather than removing this warning, perhaps an option could be to use dev_warn_once() instead?

drivers/mmc/host/meson-gx-mmc.c static void meson_mmc_get_transfer_mode(struct mmc_host *mmc, · line 253

Quoted 6 lines
drivers/mmc/host/meson-gx-mmc.c +1 -1
+                       if (sg->length % data->blksz)
                                return;
-                       }
                }
        }
 

Kind regards
Uffe

#2 lore raw
Quoted 17 lines · Ulf Hansson
Quoted 16 lines · Neil Armstrong

Since commit e085b51c74cc ("mmc: meson-gx: check for scatterlist size alignment in block mode"), support for SDIO SD_IO_RW_EXTENDED transferts are properly filtered but some driver like brcmfmac still gives a block sg buffer size not aligned with SDIO block, triggerring a warning even if the transfer works in degraded mode.

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

Fixes e085b51c74cc ("mmc: meson-gx: check for scatterlist size alignment in block mode")
---
 drivers/mmc/host/meson-gx-mmc.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
Quoted 14 lines

drivers/mmc/host/meson-gx-mmc.c static void meson_mmc_get_transfer_mode(struct mmc_host *mmc, · line 251

Quoted 11 lines
drivers/mmc/host/meson-gx-mmc.c +0 -3
index eb6c02bc4a02..6bc151045843 100644
@@ -246,11 +246,8 @@ static void meson_mmc_get_transfer_mode(struct mmc_host *mmc,
                 * size, otherwise chain mode could not be used.
                 */
                for_each_sg(data->sg, sg, data->sg_len, i) {
-                       if (sg->length % data->blksz) {
-                               WARN_ONCE(1, "unaligned sg len %u blksize %u\n",
-                                         sg->length, data->blksz);

Rather than removing this warning, perhaps an option could be to use dev_warn_once() instead?

Yep, I'll re-spin.

Neil

Quoted 11 lines

drivers/mmc/host/meson-gx-mmc.c static void meson_mmc_get_transfer_mode(struct mmc_host *mmc, · line 253

Quoted 7 lines
drivers/mmc/host/meson-gx-mmc.c +1 -1
+                       if (sg->length % data->blksz)
                                return;
-                       }
                }
        }
 

Kind regards
Uffe