Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp571683ybj; Thu, 7 May 2020 02:32:22 -0700 (PDT) X-Google-Smtp-Source: APiQypJ0cMh6KDVxzxSrCg36Uy9E5hY2A/ezUWsO605gan2id88d5n+MkyZZ2ZB86qho/3XGb1yl X-Received: by 2002:a17:906:f1d2:: with SMTP id gx18mr11760974ejb.24.1588843941889; Thu, 07 May 2020 02:32:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588843941; cv=none; d=google.com; s=arc-20160816; b=WVw0BKstBd7QdUt6If22ESILkCpbb6+5cNWT3QEzS+90aG7YtOHZBqB6WIsljJyKYZ YIz9A5apfivsjWfy2nyFvEb8S7tgLylS45s2M1+dRrVRmzO0tH3aromGlKXOdtq5zNKn 6qwhLPY2d1GCfzHzYGI/86PwhkHcP48FebfcpAmuM34jS6EvTYZ/O7jLs0aeKuUrpPzm hrzd7+79qqOdor071jnDFbUO/6cweaNCq64fNVklshAWjNBp7Z5vMRiQAleD5pSYyex/ AOWr75Pai2KxDvV2eg7ehTTMQjE1E2bDrfIW2GFYfwdJ8Aea3EzGfwVQVwFe/AzA6suP fdVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=viH1iV0igem6dG1osD5lXSFto5UeKQo6I/r6j41w2Kg=; b=y72kw65cB53dTft4U42CVYYlzRksjqjUhF8YhRDEgk1fE4Y+Of8OTxg/uau6zZIvrA cY+wHlriehS6b4ZH3ZsQW/3443QeQtKG6D1SIbStCPdINaIS2tTDW4mLH6MMIu3l2hYb TNpjbRfLVQYPVHD8hC83rokL4DB9MAX7jTX8SX9ZS+g2bMRVPrmzHLJu05Z49ZEDXf1j oLjkjNQ4quRFoaiOlKr0kBzJrX/2K78WLOgE6asWjDqB2EcSgLA6wFNf0KL1iv6rYKoR EqPZ8ElY2tQ9C44eYmVhk5zXnt0kUurioF/Dne0xQ0oXdxPqBEf8DY1Ho++YtnISjmpt JteA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kI+WeYFE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f16si469269edr.583.2020.05.07.02.31.58; Thu, 07 May 2020 02:32:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kI+WeYFE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726558AbgEGJ35 (ORCPT + 99 others); Thu, 7 May 2020 05:29:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725923AbgEGJ34 (ORCPT ); Thu, 7 May 2020 05:29:56 -0400 Received: from mail-vs1-xe41.google.com (mail-vs1-xe41.google.com [IPv6:2607:f8b0:4864:20::e41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 846D9C061A10 for ; Thu, 7 May 2020 02:29:56 -0700 (PDT) Received: by mail-vs1-xe41.google.com with SMTP id g2so2952038vsb.4 for ; Thu, 07 May 2020 02:29:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=viH1iV0igem6dG1osD5lXSFto5UeKQo6I/r6j41w2Kg=; b=kI+WeYFEEA9jLoKV2d3E7dwUyyonlIPIl242k9750XKo5ORe4klWfuAV7grrUmx0pe 81oSbWvf2JRpXrMDhtyaIzsMHzryrCqE0t4iOTWk45BvIr2QwotvhUUNbfqfE0msdui8 A/+Tx3vLGOvtTPE1kWGs//HDeaZI2xem+qIyqcHHUztTiprouVP8b8AuR5o78AMr89UA HQzNycaDph+I3X8/VRavIrGj+mUVMK/JPdIhTI7VAtbK0NComAh/lF/6zjRcrVSpW9xG GFPpsYWE/TH2D45e4L0+VhUZX/H6aNF9Tc8iOkF1hmV0MpGcaJAkoIVvTpDm7sSAnW/t gQDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=viH1iV0igem6dG1osD5lXSFto5UeKQo6I/r6j41w2Kg=; b=TokIjTX/+3sfsbqyBVqIJ+vaGVJeRnmuuBeEhzfD1S1nDlLNyTVP6+zdFNtROAG21U X9e1xgaA7IBF+FtW8+F4gIf0OP4D7jsEl2AcfpDd3GV+gNmBLbB5EOZK8Cka/9yaRa2d FIHMUCoyHMo9NWPqCx0g8Nq0B97n5Cj2sKx9Gn6LxBXrzvk6ptGvnyncbF13dn4zLeSP X44qDYiqppoTmCDrmDrgbxL+PbRoR83eg1fvjwFgn04Hmk/7yD+6wfkVJU7rpow0EPSB NTY/V9cfttZHm3b9wGyeYIgIeFA1Lm6ra9v5/Sx0rNZL0p73DciPwuwz5dFz+BsznGzG tUhw== X-Gm-Message-State: AGi0PuaEh/QTarwbpaD1Je7FLHO29Bjs28PZYiKpULhskXOx2otCA4Kb RoiqyazXwB9EN5UdU21Gxp2hVfG2d8+C5KnfAiJPFg== X-Received: by 2002:a67:ee0d:: with SMTP id f13mr11495244vsp.191.1588843795661; Thu, 07 May 2020 02:29:55 -0700 (PDT) MIME-Version: 1.0 References: <20200503222805.2668941-1-martin.blumenstingl@googlemail.com> In-Reply-To: <20200503222805.2668941-1-martin.blumenstingl@googlemail.com> From: Ulf Hansson Date: Thu, 7 May 2020 11:29:19 +0200 Message-ID: Subject: Re: [PATCH] mmc: meson-mx-sdio: trigger a soft reset after a timeout or CRC error To: Martin Blumenstingl Cc: "open list:ARM/Amlogic Meson..." , "linux-mmc@vger.kernel.org" , Linux ARM , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 4 May 2020 at 00:28, Martin Blumenstingl wrote: > > The vendor driver (from the 3.10 kernel) triggers a soft reset every > time before starting a new command. While this fixes a problem where > SDIO cards are not detected at all (because all commands simply > timed out) this hurts SD card read performance a bit (in my tests > between 10% to 20%). > > Trigger a soft reset after we got a CRC error or if the previous command > timed out (just like the vendor driver from the same 3.10 kernel for the > newer SDHC controller IP does). This fixes detection of SDIO cards and > doesn't hurt SD card read performance at the same time. > > With this patch the initialization of an RTL8723BS SDIO card looks like > this: > req done (CMD52): -110: 00000000 00000000 00000000 00000000 > clock 400000Hz busmode 2 powermode 2 cs 1 Vdd 21 width 1 timing 0 > starting CMD0 arg 00000000 flags 000000c0 > req done (CMD0): 0: 00000000 00000000 00000000 00000000 > clock 400000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 1 timing 0 > starting CMD8 arg 000001aa flags 000002f5 > req done (CMD8): -110: 00000000 00000000 00000000 00000000 > starting CMD5 arg 00000000 flags 000002e1 > req done (CMD5): 0: 90ff0000 00000000 00000000 00000000 > starting CMD5 arg 00200000 flags 000002e1 > req done (CMD5): 0: 90ff0000 00000000 00000000 00000000 > starting CMD3 arg 00000000 flags 00000075 > req done (CMD3): 0: 00010000 00000000 00000000 00000000 > starting CMD7 arg 00010000 flags 00000015 > req done (CMD7): 0: 00001e00 00000000 00000000 00000000 > starting CMD52 arg 00000000 flags 00000195 > req done (CMD52): 0: 00001032 00000000 00000000 00000000 > [... more CMD52 omitted ...] > clock 400000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 1 timing 2 > clock 50000000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 1 timing 2 > starting CMD52 arg 00000e00 flags 00000195 > req done (CMD52): 0: 00001000 00000000 00000000 00000000 > starting CMD52 arg 80000e02 flags 00000195 > req done (CMD52): 0: 00001002 00000000 00000000 00000000 > clock 50000000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 4 timing 2 > starting CMD52 arg 00020000 flags 00000195 > req done (CMD52): 0: 00001007 00000000 00000000 00000000 > [... more CMD52 omitted ...] > new high speed SDIO card at address 0001 > > Fixes: ed80a13bb4c4c9 ("mmc: meson-mx-sdio: Add a driver for the Amlogic Meson8 and Meson8b SoCs") > Signed-off-by: Martin Blumenstingl > --- > Ulf, I consider this non-critical because as long as the meson-mx-sdhc > driver is not merged we only have one MMC driver for these platforms. > I don't know anybody to prefer SDIO wifi over SD card access, so this > can go into -next (in my option at least). > Alright, applied for next, thanks! Kind regards Uffe > > drivers/mmc/host/meson-mx-sdio.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/mmc/host/meson-mx-sdio.c b/drivers/mmc/host/meson-mx-sdio.c > index 2e58743d83bb..3813b544f571 100644 > --- a/drivers/mmc/host/meson-mx-sdio.c > +++ b/drivers/mmc/host/meson-mx-sdio.c > @@ -246,6 +246,9 @@ static void meson_mx_mmc_request_done(struct meson_mx_mmc_host *host) > > mrq = host->mrq; > > + if (host->cmd->error) > + meson_mx_mmc_soft_reset(host); > + > host->mrq = NULL; > host->cmd = NULL; > > -- > 2.26.2 >