Thread (4 messages) 4 messages, 2 authors, 2021-08-06

Re: [PATCH 1/2] mmc: sdio: Don't warn about vendor CIS tuples

From: Ulf Hansson <hidden>
Date: 2021-08-06 13:08:01

On Mon, 26 Jul 2021 at 18:37, Sean Anderson [off-list ref] wrote:
CIS tuples in the range 0x80-0x8F are reserved for vendors. Some devices
have tuples in this range which get warned about every boot. Since this
is normal behavior, don't print these tuples unless debug is enabled.

Unfortunately, we cannot use a variable for the format string since it
gets pasted by pr_*_ratelimited.

Signed-off-by: Sean Anderson <redacted>
Applied for next, thanks!

Kind regards
Uffe

quoted hunk ↗ jump to hunk
---

 drivers/mmc/core/sdio_cis.c | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/drivers/mmc/core/sdio_cis.c b/drivers/mmc/core/sdio_cis.c
index b23773583179..7518b27bcef2 100644
--- a/drivers/mmc/core/sdio_cis.c
+++ b/drivers/mmc/core/sdio_cis.c
@@ -330,13 +330,23 @@ static int sdio_read_cis(struct mmc_card *card, struct sdio_func *func)
                        prev = &this->next;

                        if (ret == -ENOENT) {
+
                                if (time_after(jiffies, timeout))
                                        break;
-                               /* warn about unknown tuples */
-                               pr_warn_ratelimited("%s: queuing unknown"
-                                      " CIS tuple 0x%02x (%u bytes)\n",
-                                      mmc_hostname(card->host),
-                                      tpl_code, tpl_link);
+
+#define FMT(type) "%s: queuing " type " CIS tuple 0x%02x (%u bytes)\n"
+                               /*
+                                * Tuples in this range are reserved for
+                                * vendors, so don't warn about them
+                                */
+                               if (tpl_code >= 0x80 && tpl_code <= 0x8f)
+                                       pr_debug_ratelimited(FMT("vendor"),
+                                               mmc_hostname(card->host),
+                                               tpl_code, tpl_link);
+                               else
+                                       pr_warn_ratelimited(FMT("unknown"),
+                                               mmc_hostname(card->host),
+                                               tpl_code, tpl_link);
                        }

                        /* keep on analyzing tuples */
--
2.25.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help