Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3149017ybc; Thu, 14 Nov 2019 04:50:26 -0800 (PST) X-Google-Smtp-Source: APXvYqxdHot+vmmcMbWywxHU8ShmLgyuZvW+YqvLRBuk23sGzpA5YiKiIxkEAEz59m5lHzc8Trba X-Received: by 2002:a17:907:1114:: with SMTP id qu20mr8479667ejb.42.1573735826326; Thu, 14 Nov 2019 04:50:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573735826; cv=none; d=google.com; s=arc-20160816; b=qNvmnGQrYDtX54My2Q58owNaArg5b4uFptRVs+lLsJ0N/rb3uUL6PWyji8nFtj658J PAu5xuoV8MWeZLsoERXWrKk2SBOFYIYE/vIWVcxea/QkEJ2Csu/hwQo1ord+wo9k8RAq lwIOs+7IOPmPgPvQIp1lj849sXlJhABko1ZYMbCxS27J86xe3h1WtfBaqPnJO+XAw+GA K9EgTpYzxyVSJ0oqYfPJb8X0PyrpbEGFfcKlMBkvFgTXzpITS+5EkIJ7RkXzlfpDRU+i /wdsDX0jckx+H+cUxu5qdNXG1nA11HaYqYx22gjUdiuZt60r0JIcuLe6SL26562jCYjA pGOQ== 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=b1Q/m149A5PiemLfT6SquJYIvD0phNlImqR3A8L8/X0=; b=NMusyzvEdten8gsTSAhjIjFjrsLNlgo1fYdvnsLkaiuUQB2rOC/vyyjIYIwmDf+hh1 gpIr+uAnd8UouCLC4a08Espz/nPUUVnKRKlQ5UKpUdsZSgYRlo1hkTwhoClySZcwlIJA pvipfth+7mHh4e3c0oNNpmZegsU/BiIxvxlpc5fGngcM90q2WIF883BfRUS3kg9cEy/m NclO/sOVhuEzrgKDx8plsBoifOrmpo/sjm4Y8QlXHPjgKcyVDndcSnjnceSaKhjeA7g3 8/xufzlZWd20CN/P7+GnzRZriuZap5xk89dlCLNRd7jQVhTaPPoB7FpZkbPDjhNT7pCB lD3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oDQOBZJM; 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 d47si4396934ede.139.2019.11.14.04.50.01; Thu, 14 Nov 2019 04:50:26 -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=oDQOBZJM; 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 S1726482AbfKNMtT (ORCPT + 99 others); Thu, 14 Nov 2019 07:49:19 -0500 Received: from mail-vk1-f196.google.com ([209.85.221.196]:33051 "EHLO mail-vk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726179AbfKNMtT (ORCPT ); Thu, 14 Nov 2019 07:49:19 -0500 Received: by mail-vk1-f196.google.com with SMTP id b64so959777vkg.0 for ; Thu, 14 Nov 2019 04:49:18 -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=b1Q/m149A5PiemLfT6SquJYIvD0phNlImqR3A8L8/X0=; b=oDQOBZJMEqbwzWlmHcUKV9gnBv6LEuxHn1x4GtULF1fRydbf3dBCCVMd1Z5cWdSNjQ c1ZTfSEqLGcacYp4m6Xm4fNvVBRSarsr3C/Qo32kdAYLIvdZoIq8XnJjrKKL/EVY0hXh AG+WANyP6rcYS8fVx4CvjjYVZl9VEdZT1qBZZ8G9+s37MUakC7E2nqlmdemIT13yjDak 0uOxTYdCgIS9sR/eXC6qNR5EHvj0AFE6c7zco+xBwItSrqedQROlEYCqCE4gT1XvImup wNUFikPH3cdaqOScbjGf5gCbCledicHsIM/Zyn/bqFrDWLDWmBLqCqdwSUToAS7WCgl/ 8fPw== 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=b1Q/m149A5PiemLfT6SquJYIvD0phNlImqR3A8L8/X0=; b=OK7UEQimYQyFGpPD3HlQkZqBnujh30f+NOWxW7ii+ro6+1551LbTsCqrbvVPaGHj85 NlbOOw0vEZZGswKBZtPG0L3Dv1pgr8FcIhUb9Z9sXzU1bnpxnaekA7Ynuz1/UrLCehQ+ Ml/ehA4ed/hHeQe1HZrj/IAm5+W1//6uHX/lVIHMS3wwuZmOI6bF6vjxkx5Z41CjAR34 Ppcsv7cDh1t40CkOCBxcc7qkAmSoPQaqUBMjlRq36sOaBTX/lg9zQGQMVT+BJtz89XPJ 3D8w5/XOu060vCNjI7K3LinxyDuoTEHGzKt53YylVihqPT9x/bu5Gw3XMJKECS5FA2rp SizQ== X-Gm-Message-State: APjAAAWmwvjmSKkrfNFeRBWuyK1m8CVP+eL3WlAIZVy3kptYIk33d/Md 7S5i7SlXxAP2KaKmDwXbIc9NXY5kHNDxCW9ZE1MaYA== X-Received: by 2002:a1f:fe0a:: with SMTP id l10mr4953847vki.59.1573735757811; Thu, 14 Nov 2019 04:49:17 -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> In-Reply-To: <20191114113743.GA19656@vmlxhi-102.adit-jv.com> From: Ulf Hansson Date: Thu, 14 Nov 2019 13:48:41 +0100 Message-ID: Subject: Re: [PATCH] mmc: renesas_sdhi_internal_dmac: Add MMC_CAP_ERASE to Gen3 SoCs To: Eugeniu Rosca Cc: Wolfram Sang , 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 12:37, Eugeniu Rosca wrote: > > Hi everyone, > > On Thu, Nov 14, 2019 at 11:56:23AM +0100, Ulf Hansson wrote: > > On Tue, 12 Nov 2019 at 21:49, Wolfram Sang wrote: > > > > > > On Tue, Nov 12, 2019 at 02:48:08PM +0100, Eugeniu Rosca wrote: > > > > From: Harish Jenny K N > > > > > > > > Enable MMC_CAP_ERASE capability in the driver to allow > > > > erase/discard/trim requests. > > > > > > > > Suggested-by: Andrew Gabbasov > > > > Signed-off-by: Harish Jenny K N > > > > [erosca: Forward-port and test on v5.4-rc7 using H3ULCB-KF: > > > > "blkdiscard /dev/mmcblk0" passes with this patch applied > > > > and complains otherwise: > > > > "BLKDISCARD ioctl failed: Operation not supported"] > > > > Signed-off-by: Eugeniu Rosca > > > > > > Looks good to me. Just a generic question, probably more for Ulf: > > > > > > Why does this CAP_ERASE exist? As I understand, the driver only needs to > > > set the flag and no further handling is required. Why would a driver not > > > set this flag and not support erase/trim commands? > > > > I am working on removing the cap, altogether. Step by step, this is > > getting closer now. > > > > The main problem has been about busy detect timeouts, as an erase > > command may have a very long busy timeout. On the host side, they > > typically need to respect the cmd->busy_timeout for the request, and > > if it can't because of some HW limitation, it needs to set > > mmc->max_busy_timeout. > > FWIW we've discussed such concerns internally, based on past commits > which either disable [1-2] busy timeouts or increase their value [3]. > > To get a feeling if this is relevant for R-Car3, I've run blkdiscard on > a 64 GiB eMMC without noticing any issues on v5.4-rc7. Hopefully this > is sufficient as testing? 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. BTW, do you know what TMIO_STAT_CMD_BUSY actually is monitoring? 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? If you want to run a test that stretches the behaviour on the timeout path, I would rather use an SD-card (the older the better). For eMMCs the erase likely translates to a trim/discard, which is far more quicker than a real erase - as is what happens on an old SD card. > > > > > Once that is fixed for all, we can drop CAP_ERASE. > > > > Kind regards > > Uffe > > [1] 93caf8e69eac76 ("omap_hsmmc: add erase capability") > [2] b13d1f0f9ad64b ("mmc: omap: Add erase capability") > [3] ec30f11e821f2d ("mmc: rtsx_usb: Use the provided busy timeout from the mmc core") > > -- > Best Regards, > Eugeniu Kind regards Uffe