Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp4443698ybc; Fri, 15 Nov 2019 04:52:48 -0800 (PST) X-Google-Smtp-Source: APXvYqw0tNuvJVPIvLiXV8QxrSi/J6YZ2ENGgY8DIsFSFTGcMaWr+kyiGdfnd4V316BxqHQZ9XYL X-Received: by 2002:a17:906:459:: with SMTP id e25mr658653eja.259.1573822368546; Fri, 15 Nov 2019 04:52:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573822368; cv=none; d=google.com; s=arc-20160816; b=svkG96/w3Lp2LRIm0RWqewMsgZsNzcGLdzFFIzLrqARukA2ixveOa/njgqjXTKliY7 vComhfOd4l0NHQclBje4ta3knnyjwpQ/DluNUNRPMCj9jw2WJopnluDbZ8ixSC85akIU AHJLzDe752kt+viuidaNQgSmpoKqAwkyQm8hIGmbW7J900Od8FkNcq4wJO6n+K9E6Yhd x22+dXbjIvgSl5Ufv5lS60TSCX6U/d5FHwYrrXglAvjo3FFHUIGp9TbHtyecPkmaOJl+ +MMcvX13YlwEkkw/DB5ebrG2d1+reqeFZdFJ7Zphi4NnED1dP8/I08skV4dw4oSccDba HeTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=MSBZUJ6N83/4qV9W3+Saz1SD+3gzRNMj1BU/Wmg8ZOw=; b=abIq+owzyiJ4j+ktusi74gyLM52L4lGOg4wjcasLHbx3/Tw9Swn4bp5ld851TQClfD n5RNm68EsVFwrNzZ9LgirOnAAK9pqH1xFB5vOm6vF9YYi+ubs1ZOOlGpg85FG4keKdzq OF3mHowIVqYACW7mJDFfUR7HubVXAuF+2s/lHPo21m31XlpjmMb4hp3gipAHwP5iVf2j ZEEakQaFNglQGwm422+zUsbnsA2JKjl9U5DEkLgL8wTKRogJaHtHntd2kOPJaUiuH32r ukV0XYdi2nJbaM2lCYm2d30/W3xOz17LbqyQENqBxGYGc3fxA1DeFFobFsnYEVoZBkkH ViTw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t21si6152855edi.123.2019.11.15.04.52.22; Fri, 15 Nov 2019 04:52:48 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727427AbfKOMv0 (ORCPT + 99 others); Fri, 15 Nov 2019 07:51:26 -0500 Received: from smtp1.de.adit-jv.com ([93.241.18.167]:34437 "EHLO smtp1.de.adit-jv.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727223AbfKOMv0 (ORCPT ); Fri, 15 Nov 2019 07:51:26 -0500 Received: from localhost (smtp1.de.adit-jv.com [127.0.0.1]) by smtp1.de.adit-jv.com (Postfix) with ESMTP id 384A23C04C0; Fri, 15 Nov 2019 13:51:22 +0100 (CET) Received: from smtp1.de.adit-jv.com ([127.0.0.1]) by localhost (smtp1.de.adit-jv.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7Xn7dduaxoJA; Fri, 15 Nov 2019 13:51:13 +0100 (CET) Received: from HI2EXCH01.adit-jv.com (hi2exch01.adit-jv.com [10.72.92.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by smtp1.de.adit-jv.com (Postfix) with ESMTPS id C73F53C009C; Fri, 15 Nov 2019 13:51:13 +0100 (CET) Received: from lxhi-065.adit-jv.com (10.72.93.66) by HI2EXCH01.adit-jv.com (10.72.92.24) with Microsoft SMTP Server (TLS) id 14.3.468.0; Fri, 15 Nov 2019 13:51:13 +0100 Date: Fri, 15 Nov 2019 13:51:09 +0100 From: Eugeniu Rosca To: Masahiro Yamada , Ulf Hansson CC: Eugeniu Rosca , Wolfram Sang , Wolfram Sang , Yoshihiro Shimoda , Niklas =?utf-8?Q?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 Subject: Re: [PATCH] mmc: renesas_sdhi_internal_dmac: Add MMC_CAP_ERASE to Gen3 SoCs Message-ID: <20191115125109.GA32576@lxhi-065.adit-jv.com> 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> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: X-Originating-IP: [10.72.93.66] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Yamada-san, On Fri, Nov 15, 2019 at 10:27:25AM +0100, Ulf Hansson wrote: > 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. Just for your information, following Ulf's suggestion, we are going to enable MMC_CAP_ERASE in the TMIO mmc core driver, affecting UniPhier SD/eMMC Host Controller. Hope to see your Ack/NAK on this in the upcoming patch. TIA. > > Kind regards > Uffe -- Best Regards, Eugeniu