Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp536966yba; Fri, 3 May 2019 06:31:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqyLHNCv1RetaxdS3eHkkl86UVaCYSo+ynfgMjdJ5f4V4O49OWlqpmiXamsklc6jp3yBLrwu X-Received: by 2002:a62:1d94:: with SMTP id d142mr10816171pfd.83.1556890300129; Fri, 03 May 2019 06:31:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556890300; cv=none; d=google.com; s=arc-20160816; b=m6woBZdfeY/pnE2pkKemAMDb/NiI9kwAEaWQoeyB5Bwmx1Jgeq2hATlVcEfKUnUPcC oz+nTw+GhraqrQJSaQwoa7O2RJYxMADH7yXW9CXRAnrM/0vR8FwpiVkL/rPjTfb5bMC2 OyeVVH005ax3guR46kxnkV4yyvWZA6ni+Fko1KCwI/aUXlfAFrUREuuvKBaTcPnZlJdw BSorzwBMnX/aPAAn+okEX0IoBBRDpcVbHrwi19CkWoLJ+KPvCNKpI7g/7CBNkVZArU+5 QWsmREvD0Qs4hbcKzs0SQuHy6P5/zcDFpWjLYk9bTDcPIEuHLziRnVuC+NJD+2tQwcjY bphA== 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=GEzlUuM/Jwfv3VSJhIT2L6SyOU5GgzPaBEeFYcaGzrM=; b=A/DyVxKecAHXxMkyWCS+Nk9ACVGddzHHwjqwZYo3NtPOmULuAGgH1oXTtT88wvuZ++ sMRLaHh546Rf758aai2TvNJv3pk++MJiCDcSQXaywiJQ3y7LvTSqlz0hFH26jkp5hfov 6qPnFdzAfW6akCoSnneyWkEFyBRLA66ZjqEg6ltkEiKgqSZ2vkjKR4PKmAldon9YQFti nMhGhppF+kk8fXR0C8OmaaK3EfbrEb8SHaPhY6tkH+QKkD2cuCQlfCZYBLel7blPPGiT u3dGT51MC7wbwLIevijS/ZURB/ThHVjfjQuwb56oB7yzI/mg4LROpedADP/M+E8gMcCh 5n2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O7rIyByj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id b3si2518435plc.106.2019.05.03.06.31.24; Fri, 03 May 2019 06:31:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O7rIyByj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1727960AbfECN3y (ORCPT + 99 others); Fri, 3 May 2019 09:29:54 -0400 Received: from mail-vs1-f68.google.com ([209.85.217.68]:41667 "EHLO mail-vs1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727943AbfECN3w (ORCPT ); Fri, 3 May 2019 09:29:52 -0400 Received: by mail-vs1-f68.google.com with SMTP id g187so3570159vsc.8 for ; Fri, 03 May 2019 06:29:51 -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=GEzlUuM/Jwfv3VSJhIT2L6SyOU5GgzPaBEeFYcaGzrM=; b=O7rIyByj0jiAE4VnV24ZNn4Y1ylqkbfa1D8NaLihBPvQ6hc0TJ2Yiy69ux3icHlntZ OCoH1ySYRhckrmy+z0+u6WAjbTpS0gkWASmQrpvYQgV/WpkxcJajl0m0eEXXnR6El4qO zp9xSCHg2saZNiLmfNcuKvOI+3RH2fSU/GIakpBrVvCM90SOEC5Uu3Atgw7fatqZKTz+ TbcUVhgAnKl+cp2XqrMVvd24D00wH5XOCIw/MaSWcFvEHbdiaDUmvIzmeVFLqFXhD5jm hNpu+BGi6tZULhQWflurRJiLW6GXpCEhr9PuyqeHVKcpiM0CCsFcKfvBSN1tTnWLtZgo 2nFw== 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=GEzlUuM/Jwfv3VSJhIT2L6SyOU5GgzPaBEeFYcaGzrM=; b=bZkhcatesvVy/8UA3y9kqLiDROZNgskxvch0gM57TqfuEGUpkaN8ckb9NcAXrH4zbR MhupdNGK/Agj1SHMIL+1zAV/8MJTb4sLM8QM4Rv+nyE7uuxSrSOCqQJt3BBY9c3OCKDh wh5sCCkNZtvX8g00KfCV9c4TNMjEaIXQrrakHOHAnSz98fmN3BUuCcgy3cxlmQZCQqCc Pn4Urs2LGau1JoJy0IYKk5bZTTkyokpE5b4+bJa/bw0CZZ2ezAuyrkY0mLaMfzLvC7fX 2CETlOIcN7tRs2leVrSe49DKNFqYBc7DeJkhX6vlrKGYIilNM4e+rRS5X+Rs57uC3y0I P9JQ== X-Gm-Message-State: APjAAAVOINRBR/9KkxgGN751AI/JEfH/cw2gZLn0fe/oJ9vYcIEclLwS HcJ80UGZtN1qGjsxmDPGpcJ0N5ShlXiwuRBHkPAMUQ== X-Received: by 2002:a67:b44d:: with SMTP id c13mr5650144vsm.165.1556890191428; Fri, 03 May 2019 06:29:51 -0700 (PDT) MIME-Version: 1.0 References: <1556264798-18540-1-git-send-email-ludovic.Barre@st.com> <74b91eb4-e5a3-38b2-f732-29cdd058eb6a@st.com> In-Reply-To: <74b91eb4-e5a3-38b2-f732-29cdd058eb6a@st.com> From: Ulf Hansson Date: Fri, 3 May 2019 15:29:15 +0200 Message-ID: Subject: Re: [PATCH V2 0/5] mmc: mmci: add busy detect for stm32 sdmmc variant To: Ludovic BARRE Cc: Rob Herring , Srinivas Kandagatla , Maxime Coquelin , Alexandre Torgue , Linux ARM , Linux Kernel Mailing List , DTML , "linux-mmc@vger.kernel.org" , linux-stm32@st-md-mailman.stormreply.com 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 Tue, 30 Apr 2019 at 14:06, Ludovic BARRE wrote: > > > > On 4/30/19 1:13 PM, Ulf Hansson wrote: > > On Fri, 26 Apr 2019 at 09:46, Ludovic Barre wrote: > >> > >> From: Ludovic Barre > >> > >> This patch series adds busy detect for stm32 sdmmc variant. > >> Some adaptations are required: > >> -Avoid to check and poll busy status when is not expected. > >> -Clear busy status bit if busy_detect_flag and busy_detect_mask are > >> different. > >> -Add hardware busy timeout with MMCIDATATIMER register. > >> > >> V2: > >> -mmci_cmd_irq cleanup in separate patch. > >> -simplify the busy_detect_flag exclude > >> -replace sdmmc specific comment in > >> "mmc: mmci: avoid fake busy polling in mmci_irq" > >> to focus on common behavior > >> > >> Ludovic Barre (5): > >> mmc: mmci: cleanup mmci_cmd_irq for busy detect feature > >> mmc: mmci: avoid fake busy polling in mmci_irq > >> mmc: mmci: fix clear of busy detect status > >> mmc: mmci: add hardware busy timeout feature > >> mmc: mmci: add busy detect for stm32 sdmmc variant > >> > >> drivers/mmc/host/mmci.c | 61 ++++++++++++++++++++++++++++++++++++++----------- > >> drivers/mmc/host/mmci.h | 3 +++ > >> 2 files changed, 51 insertions(+), 13 deletions(-) > >> > >> -- > >> 2.7.4 > >> > > > > Ludovic, just wanted to let you know that I am reviewing and testing > > this series. > > > > However, while running some tests on Ux500 for validating the busy > > detection code, even without your series applied, I encounter some odd > > behaviors. I am looking into the problem to understand better and will > > let you know as soon as I have some more data to share. > > Oops, don't hesitate to share your status, if I could help. Thanks! Good and bad news here, then. I now understand what is going on - and there is certainly room for improvements here, but more importantly the actual mmci busy detection works as expected. When it comes to improvements, the main issue I have found is how we treat DATA WRITES. In many cases we simply don't use the HW busy detection at all, but instead rely on the mmc core to send CMD13 in a loop to poll. Well, then if the polling would have consisted of a couple of CMD13s that wouldn't be an issue, but my observations is rather that the numbers of CMD13 sent to poll is in the range or hundreds/thousands - per each WRITE request! I am going to send a patch (or two) that improves the behavior. It might even involve changing parts in core layer, not sure how the end result will look like yet. In any case, I have applied patch 1 and patch2 for next, as the tests turned out well at my side. I also took the liberty of updating some of the comments/changelogs, please have look and tell if there is something you want to change. I will continue with the rest of series next week. Kind regards Uffe