Commit 4b5e37b8 authored by Sean Anderson's avatar Sean Anderson Committed by Ulf Hansson
Browse files

mmc: sdio: Don't warn about vendor CIS tuples



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: default avatarSean Anderson <sean.anderson@seco.com>
Link: https://lore.kernel.org/r/20210726163654.1110969-1-sean.anderson@seco.com


Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 60885bfb
Loading
Loading
Loading
Loading
+15 −5
Original line number Diff line number Diff line
@@ -330,11 +330,21 @@ 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",

#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);
			}