Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: maxime.ripard@free-electrons.com (Maxime Ripard)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] mmc: sunxi: mask all Response Timeout error messages
Date: Mon, 6 Mar 2017 16:53:13 +0100	[thread overview]
Message-ID: <20170306155313.nqxnhtsl4o5yrv33@lukather> (raw)
In-Reply-To: <1597991488796361@web24m.yandex.ru>

On Mon, Mar 06, 2017 at 06:32:41PM +0800, Icenowy Zheng wrote:
> 06.03.2017, 18:04, "Maxime Ripard" <maxime.ripard@free-electrons.com>:
> > Hi,
> >
> > On Mon, Mar 06, 2017 at 12:45:35AM +0800, Icenowy Zheng wrote:
> >> ?Response Timeout is very usual: it will happen when trying to run some
> >> ?commands that do not belong to the card; it will happen when some SDIO
> >> ?card transfer beyond its SDIO bandwidth; and when the MMC controller is
> >> ?set to poll the card with "broken-cd" property (the Lichee Pi series of
> >> ?boards do this), it will flood to the console and make the console
> >> ?unusable.
> >>
> >> ?Mask all response-timeout-only error messages, only show it when another
> >> ?error happens.
> >>
> >> ?Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
> >> ?---
> >> ??drivers/mmc/host/sunxi-mmc.c | 13 +++++++++----
> >> ??1 file changed, 9 insertions(+), 4 deletions(-)
> >>
> >> ?diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c
> >> ?index 6ffcd2838272..7828e1f57cf0 100644
> >> ?--- a/drivers/mmc/host/sunxi-mmc.c
> >> ?+++ b/drivers/mmc/host/sunxi-mmc.c
> >> ?@@ -483,10 +483,15 @@ static void sunxi_mmc_dump_errinfo(struct sunxi_mmc_host *host)
> >> ??????????struct mmc_command *cmd = host->mrq->cmd;
> >> ??????????struct mmc_data *data = host->mrq->data;
> >>
> >> ?- /* For some cmds timeout is normal with sd/mmc cards */
> >> ?- if ((host->int_sum & SDXC_INTERRUPT_ERROR_BIT) ==
> >> ?- SDXC_RESP_TIMEOUT && (cmd->opcode == SD_IO_SEND_OP_COND ||
> >> ?- cmd->opcode == SD_IO_RW_DIRECT))
> >> ?+ /*
> >> ?+ * Reading timeout is usually normal, especially when doing
> >> ?+ * card-polling with "broken-cd" in device tree.
> >> ?+ * If do not mask it, the RTO error message will flood the console
> >> ?+ * and even hide useful error messages.
> >> ?+ *
> >> ?+ * Some SDIO commands will also normally timeout with non-SDIO cards.
> >> ?+ */
> >> ?+ if ((host->int_sum & SDXC_INTERRUPT_ERROR_BIT) == SDXC_RESP_TIMEOUT)
> >
> > We really shouldn't silence legit errors.
> >
> > The actual problem here is that we log them as error, we could
> > probably reduce it to debug.
> 
> Even if it's reduced to debug, it will still flush dmesg buffers.

No, it will not even be compiled by default.

> Or make it only visible when "debug" parameter is present in kernel
> cmdline?

debug messages are visible in dmesg only if DEBUG is defined, which is
only happening if CONFIG_MMC_DEBUG is set. This won't affect the
general case in any way.

And it is output only if loglevel is set higher than 7.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170306/f0cd5a6a/attachment-0001.sig>

  reply	other threads:[~2017-03-06 15:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-05 16:45 [PATCH] mmc: sunxi: mask all Response Timeout error messages Icenowy Zheng
2017-03-06 10:04 ` Maxime Ripard
2017-03-06 10:32   ` Icenowy Zheng
2017-03-06 15:53     ` Maxime Ripard [this message]
2017-03-06 17:28       ` Icenowy Zheng
2017-03-07 10:10         ` Maxime Ripard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170306155313.nqxnhtsl4o5yrv33@lukather \
    --to=maxime.ripard@free-electrons.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox