Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp4260494ybc; Fri, 15 Nov 2019 01:32:21 -0800 (PST) X-Google-Smtp-Source: APXvYqxhpmN93r/NReA+4RRsQwckWvzLqOtT+sDSZPust1q4Xwmsm8Ok9I+QhCYCZU1QB60oPZRU X-Received: by 2002:a17:906:7e08:: with SMTP id e8mr12722607ejr.199.1573810341202; Fri, 15 Nov 2019 01:32:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573810341; cv=none; d=google.com; s=arc-20160816; b=ufA/Anf5O9UoXeEBYPLDbDABcfXH1hKyccRBjvnv0V7BE456GeykiqsxqMfRH23iMX dE+ZzmFcBs6jr2EH54Aje6gRqWmysSgUlIzj66q7BQ0z2wtEyWe7gW9CUAtFyKRpEdYD DK3vfgnJVgWHQzWs/tB7Q0h+w7JNktobpLv3BsN6w8+OG82Fwi+gfuxSHdMmnmx0LXwX cF6mdKjvZ1RMmyDq9dv2wDZ/jBzLVYb3asn2ssWQmCZOWawAedpem1B1BneLsaXnEcCa PHW1pNHjKbmebkVS2PRma9VCmxvSqDc/xzHZVRloIfdxvUtGDATNqx5LEspjd7W6ikdb mHgA== 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=SxLLly/NDlRCS30fS9KIwQ6+KObnKWcAwfTZ0ZVdfoc=; b=hyA13HmB7HQVDf4teJxQrVgfVmt0GY/CkDr6zm0uUqlRDqC2yubsqpk6BLA8lbOfLS 2aooFExT4FLGOrKd09f7xegldtTQgf0Nok8JMDaWZqX00dMhiT4QbeVW7bB9XPwPAaEX QuHctFbKyh2NUD9wCbGtFhnP5L/yQJdv+xhzLSncXcGiJeYqIJQmTHU15Ih1hiY/vJpq M6ndwIJw0sX4uAvmdMY2TZd5GSixMSj/bxhzohCc6rpjcPgDLkw7ITC/KkRUvkHkvPGh +qZRNoX411V/S7EOJmZEdrfKuDCRovfyRXjBgqhig3cjyZciXsw/cX1qYF/k75JmOP5T n2kQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="s/vJKlHv"; 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 c10si5964736eda.284.2019.11.15.01.31.56; Fri, 15 Nov 2019 01:32:21 -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/vJKlHv"; 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 S1727020AbfKOJ2D (ORCPT + 99 others); Fri, 15 Nov 2019 04:28:03 -0500 Received: from mail-ua1-f65.google.com ([209.85.222.65]:38725 "EHLO mail-ua1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727002AbfKOJ2D (ORCPT ); Fri, 15 Nov 2019 04:28:03 -0500 Received: by mail-ua1-f65.google.com with SMTP id u99so2810987uau.5 for ; Fri, 15 Nov 2019 01:28:02 -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=SxLLly/NDlRCS30fS9KIwQ6+KObnKWcAwfTZ0ZVdfoc=; b=s/vJKlHvRVRbLxSM9gw7Z2Ss/5b9KpGP8+dQXRh9GElgkA11nMKbvRg4sn5hIwKg5J VgQ3YiwM4S/MkTcME3YnZEKO9/Id0BVpWUbRzj+PU1ymRr71oGfDpXlkapBIGVRxogFy VxNx/LwqgSddqip8zTm59kZisunqqLVNGvcjlmRHh2GwnQ0Gp240oPLOO0seM1t0cDs9 PKtGK5trxHgct46123f7/LFPkMAH+y/nesq0Lo/4cqlA8COgWAKQEW6LiUJgwWUHcIL/ mFfqQUpqGvN3B3+sPfx4U0AibuqCcFX4FmR1hfIBztD9Sx8qVWE+4nsuIyJ8hdxVK3Xn zZww== 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=SxLLly/NDlRCS30fS9KIwQ6+KObnKWcAwfTZ0ZVdfoc=; b=uOLlX16yhcB6426ZPqjAktmDoF14sKjuIfsGwMr5+Y2sxgAl7eiJVhXgtUwOAFcPc7 1aq2GnFhBDkHe63+i1L76CV9w5CyoMVZ9AW2LfM8uj0ZGNDyyPagYpitjdP8BkqEagw9 6lexkk/RssKvwup2rvZRgIKMqJTWfKXkQsBg8zGQ0qmWRBsQqet8/r9xkQpoygqZBote mH9lqOMXonmzLk0VSLxWgbepNcHauCnpLopJYFqUSlZ9H6j5n4TFf5ennO5AWlgmWEEi TK5Pug6gOQt0OhlT6hqsYEwoLP+JdCvcJu238ufbfE9/mBqhvxbyHF3nhL/6ed8VXONC Jh3w== X-Gm-Message-State: APjAAAXEFXkEPQ+2kMcdaAMbSznT4XiH5/lX95OnEPCi2mZ9/oyPm9ij /Jvk0ujyTtCUn7nTs/xM9rL2CPcDIceLyV3Kl+ghUw== X-Received: by 2002:ab0:2042:: with SMTP id g2mr8284571ual.19.1573810081741; Fri, 15 Nov 2019 01:28:01 -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> <20191114220744.GA17678@vmlxhi-102.adit-jv.com> In-Reply-To: <20191114220744.GA17678@vmlxhi-102.adit-jv.com> From: Ulf Hansson Date: Fri, 15 Nov 2019 10:27:25 +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 23:07, Eugeniu Rosca wrote: > > Hi Ulf, > > On Thu, Nov 14, 2019 at 01:48:41PM +0100, Ulf Hansson wrote: > > [..] > > > > 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? > > Hopefully Wolfram just addressed that? > > > 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. > > Running 'blkdiscard' with different SD cards on H3ULCB, I don't see any > signs of misbehavior: > > root@rcar-gen3:~# blkdiscard -V > blkdiscard from util-linux 2.32.1 > > root@rcar-gen3:~# lsblk > NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT > mmcblk0 179:0 0 59.2G 0 disk > mmcblk0boot0 179:8 0 4M 1 disk > mmcblk0boot1 179:16 0 4M 1 disk > mmcblk1 179:24 0 30G 0 disk > > # Erasing 32 GiB uSD Card > root@rcar-gen3:~# time blkdiscard -v /dev/mmcblk1 > /dev/mmcblk1: Discarded 32227983360 bytes from the offset 0 > > real 0m1.198s > user 0m0.001s > sys 0m0.122s > > # Erasing 64 GiB eMMC > root@rcar-gen3:~# time blkdiscard -v /dev/mmcblk0 > /dev/mmcblk0: Discarded 63585648640 bytes from the offset 0 > > real 0m8.703s > user 0m0.002s > sys 0m1.909s > > I guess that by decreasing below erase sizes, I could further increase > the execution time, but these sysfs properties are read-only: > > cat /sys/devices/platform/soc/ee100000.sd/mmc_host/mmc1/mmc1:59b4/preferred_erase_size > 4194304 > cat /sys/devices/platform/soc/ee100000.sd/mmc_host/mmc1/mmc1:59b4/erase_size > 512 > This test and due to the discussions with Wolfram and you in this thread, I would actually suggest that you enable MMC_CAP_ERASE for all tmio variants, rather than just for this particular one. In other words, set the cap in tmio_mmc_host_probe() should be fine, as it seems none of the tmio variants supports HW busy detection at this point. Kind regards Uffe