Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp4253266ybc; Fri, 15 Nov 2019 01:22:31 -0800 (PST) X-Google-Smtp-Source: APXvYqz0qpsrFKDeH/eL6qIKzoZZd9lz/J6GkAUfXWJ0W2Ag0qeNTsr4L//NI0/gqY38OoDN7cY+ X-Received: by 2002:a17:906:4dc8:: with SMTP id f8mr12235439ejw.62.1573809751297; Fri, 15 Nov 2019 01:22:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573809751; cv=none; d=google.com; s=arc-20160816; b=mA0HowDVjeGJ41FcW6Iv2YYmTlSU4I/bkkrWjyJQXUh5ICBier7xPJWpySkWc2Ajx4 kPF5BOzTMgtW5TApB+RhooKribkEUaWID9qiUAON5+Bd+eltrHbjsJMfe71mM+5jgwYV L2TArZzi3S1dKYUh07dPiPgWy5mFaSf5ha9uykyIYLaKMK6P8Ri9inxi7zeTqLUnosWa yqnTlkOeilHv1q8bKh+osh2soHRKIuS1t6n4K85R/cWECodV2NeuVHdl7MjsaMOXzFZV 7uyx54eYo40AIqYjPyQbKLY6nWAme9MwdWouXXOpMNrHE1oh0qcwJmuTNYPW8jevJvvE Dvzw== 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=iq9uxDFFl/7R3Enfz7ThtyPFSTWSzvQY67xCc3VRtUg=; b=KsCgyoF+++xW5uv5+PbXoDOUJAXCkpbi6AvJS0ii5FUgesdpAA4tJrd+VxgP3ywwAW cJEhm2YGh1Z7fMueNtnJNVG4h8X7cFS0B+G2Ugfnl7IbORkW9HYHNKg77JtV7ii2bU5m LDKdEkiqB97ptzpLHPB27DvgMqfUxzeSixYP6guc9pD+7AsEzEpfLSOKcOvaojOROVDa FmYYlpoCKzWkwXiLInRAX4EZB1khLpZ4ruixNPihBBDxeGSamu6EiJ2Tk+iYQ5OX7OS4 Dymhh+hwotSZR/soqgoz+lerVqcENBzvxYjR5cHsi0nBKIb2Rb+PpHbsc3DGX6IbgJFm NKXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="S/998+wZ"; 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 jt21si4993133ejb.390.2019.11.15.01.22.06; Fri, 15 Nov 2019 01:22:31 -0800 (PST) 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="S/998+wZ"; 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 S1727116AbfKOJUS (ORCPT + 99 others); Fri, 15 Nov 2019 04:20:18 -0500 Received: from mail-vk1-f194.google.com ([209.85.221.194]:44811 "EHLO mail-vk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727048AbfKOJUR (ORCPT ); Fri, 15 Nov 2019 04:20:17 -0500 Received: by mail-vk1-f194.google.com with SMTP id z19so250214vkb.11 for ; Fri, 15 Nov 2019 01:20:17 -0800 (PST) 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=iq9uxDFFl/7R3Enfz7ThtyPFSTWSzvQY67xCc3VRtUg=; b=S/998+wZ1h0OvX9wPzQw6FItUWJUooke2YKgZHsySOGgG7sH+n4ZTj912GvMu0yhqz tn7x3k0Vy5itxaSs+VkNf3fUHWdi2YsOGHeYKQgZqZxyywLV+ADDNaIVH+nGpdzS6o0K xHRBmJWbc1v2chKnSbhPsIGhQZu/9Bl1xwQwH8sAjyGWiGL+PkNgal/JBeqR9o11UcD2 mJJOTH6FWITSUWsHYsYZSsFVG3C4thpRFlVzcAo0oyqZi77IkirWUTONpbU80PPMxVc3 V5NOijHMIT3PB5qXL4qBHAvvY7HIvp6Sx1FTwZA7z0goWBg2CT2in4jOwlOVqUXRtsfh Qt/A== 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=iq9uxDFFl/7R3Enfz7ThtyPFSTWSzvQY67xCc3VRtUg=; b=AkkKMgqcvb0XvS6hmN7X+pWq8Ce3SaaFYQ+CVUEHhbo/XY9xoaJJyTVPPowJ+fC5tD ujiSVyC5ATKZmhhdnP2+26WCv+XI0va+dyBVAPc7ypJQXthnjbTFFhFJv427vyO8Db00 cDbDCpmzqslM6MvOjC0lamT03TOmQQSS/aKa653KJSWFVk3JYzH+rqP9LeMLINrlC3Lz I4+Zd3Ug1gWW0eUgnUOOalG3HFpV6nPs2A1KfKYDaJGFMKXhC3sYKHU1XMGmbllkj7Gz AL7ZmWUMzA/4jWSaqNzpZj3Fmau/N1D8O9mIoPzJrnhhY/G1i1itLrRgxDzBKBRpNNxJ 6QFA== X-Gm-Message-State: APjAAAXjWCR3t3SmJxhyf3gON4L0n0jtS/dB80Nth3Qldiloxv3Q1oKI zbjcxoKGi2/x2+uc4s1o7VyPi89G2IthSyhtenKnyA== X-Received: by 2002:ac5:cd47:: with SMTP id n7mr324617vkm.101.1573809616652; Fri, 15 Nov 2019 01:20:16 -0800 (PST) MIME-Version: 1.0 References: <20191112134808.23546-1-erosca@de.adit-jv.com> <20191112204952.GA2976@kunai> <20191114113743.GA19656@vmlxhi-102.adit-jv.com> <20191114201514.GA3058@kunai> In-Reply-To: <20191114201514.GA3058@kunai> From: Ulf Hansson Date: Fri, 15 Nov 2019 10:19:40 +0100 Message-ID: Subject: Re: [PATCH] mmc: renesas_sdhi_internal_dmac: Add MMC_CAP_ERASE to Gen3 SoCs To: Wolfram Sang Cc: Eugeniu Rosca , Wolfram Sang , Yoshihiro Shimoda , =?UTF-8?Q?Niklas_S=C3=B6derlund?= , Geert Uytterhoeven , Simon Horman , "linux-mmc@vger.kernel.org" , Linux Kernel Mailing List , Linux-Renesas , Eugeniu Rosca , Harish Jenny K N , Andrew Gabbasov 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 Thu, 14 Nov 2019 at 21:15, Wolfram Sang wrote: > > Hi Ulf, > > thanks again for the heads up. > > > Let's first take a step back, because I don't know how the HW busy > > detection works for your controller. > > > > I have noticed there is TMIO_STAT_CMD_BUSY bit being set for some > > variants, which seems to cause renesas_sdhi_wait_idle() to loop for a > > pre-defined number of loops/timeout. This looks scary, but I can't > > tell if it's really a problem. > > That should be okay. The datasheet mentions that some registers can only > be accessed when either CBSY or SCLKDIVEN bits signal non-busyness. > renesas_sdhi_wait_idle() is for that. > > > BTW, do you know what TMIO_STAT_CMD_BUSY actually is monitoring? > > 0: A command sequence has been completed. > 1: A command sequence is being executed. Alright, thanks for clarifying! > > > I have also noticed that MMC_CAP_WAIT_WHILE_BUSY isn't set for any of > > the renesas/tmio variant hosts. Is that simply because the HW doesn't > > support this? Or because implementation is missing? > > Good thing we use public development. I recalled we discussed this > before but I needed a search engine to find it again: > > https://patchwork.kernel.org/patch/8114821/ > > Summary: The HW (at least since Gen2) has HW support for busy timeout > detection but I never came around to implement it (and even forgot about > it :( ). So, we still use a workqueue for it. I had a vague memory about this discussion as well, thanks for giving the pointers to it. I think using a workqueue for scheduling a reset work with a timeout of 5 s, as in your case. However, as a heads up, if/when implementing support for busy detection and adding MMC_CAP_WAIT_WHILE_BUSY, needs to update that timeout according to cmd->busy_timeout, which is provided by the core. Kind regards Uffe