Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp4500947ybc; Fri, 15 Nov 2019 05:46:47 -0800 (PST) X-Google-Smtp-Source: APXvYqz8zoUZlUYCDWrk4s/mDyDOCId/YUDb6LDOxVcdd4PvadI+6t98rNKyQzbIiQ7xzmKuf3QB X-Received: by 2002:a17:906:11cf:: with SMTP id o15mr1096568eja.208.1573825607399; Fri, 15 Nov 2019 05:46:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573825607; cv=none; d=google.com; s=arc-20160816; b=koIHYtYoAxxRc4giw+vLbkfHPj7QvSQBMryo0IOG/3YVB4xi9mQctGjyO4ur19vIvZ JuH1Yts/EO7GXOAD3e9QgwiYIVSRUeBdXgKAA6wro12k4UT4FPKuNjeqmpOxw5h+gqXp VyGW7evCW8jNvktNqbYOHrmnU5hUhN/NC6fvcHAUUxmos/GFdGAMA40hcvldO0DU7Brs J6LyvmZxi1o+v2Jiz9yZO3gdUuleeqwxsqpQmORrVEZs2nuVrXNaZM+YJJPfgOf8Gxrx syLWoTvAKEOMWHvhzJirOezUrxqrOdq7d6F5rCkcsFSFYhIHdtEV0ftWPkmau5ejy9Zy Ue4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=MNpsUhYR7jlzK9YCJmHwtm5ZjLtgG11pCizycfy7Y3I=; b=N6f4kocyPnnOGx/6f1YV7FZnuGmANd3pUUhWFgIYZjdkn/ayLXs3NbbXcZyNUZNEvi FmE6alz2I8sYMX1lkk2dwU5eEPh3o8m8cH2Kr+nwFtnQp/r8RRp7x3SUr9+KLPHragzH I1CQUK/des9rKOiCLu7UZfRpv61Sl46xv/aXAquFCBHBFxkFEk9qs/l527GPVEv3n2OW ck6TGRMcJG2dULLaBsieOsZ6d5pbu8tcFF62IsJGGOGOXEUNzffX/93GWRDbxPRIqEq9 lp8Ww/obIDH+1T+vjB6SBj4LiC1e8CaxltX9HJOCYrKkmTUKfcbLD1Gm4qhDSEjt8nHm vI2g== 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 ck4si5716151ejb.29.2019.11.15.05.46.22; Fri, 15 Nov 2019 05:46:47 -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 S1727605AbfKONpO (ORCPT + 99 others); Fri, 15 Nov 2019 08:45:14 -0500 Received: from smtp1.de.adit-jv.com ([93.241.18.167]:34869 "EHLO smtp1.de.adit-jv.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727314AbfKONpO (ORCPT ); Fri, 15 Nov 2019 08:45:14 -0500 Received: from localhost (smtp1.de.adit-jv.com [127.0.0.1]) by smtp1.de.adit-jv.com (Postfix) with ESMTP id 170023C04C0; Fri, 15 Nov 2019 14:45:12 +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 THX1Eimu0o5R; Fri, 15 Nov 2019 14:45:06 +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 64DC13C009C; Fri, 15 Nov 2019 14:45:06 +0100 (CET) Received: from vmlxhi-102.adit-jv.com (10.72.93.184) by HI2EXCH01.adit-jv.com (10.72.92.24) with Microsoft SMTP Server (TLS) id 14.3.468.0; Fri, 15 Nov 2019 14:45:06 +0100 From: Eugeniu Rosca To: Ulf Hansson , Wolfram Sang , Masahiro Yamada CC: , , , Eugeniu Rosca , Eugeniu Rosca , Andrew Gabbasov , Harish Jenny K N Subject: [PATCH v2] mmc: tmio: Add MMC_CAP_ERASE to allow erase/discard/trim requests Date: Fri, 15 Nov 2019 14:44:30 +0100 Message-ID: <20191115134430.12621-1-erosca@de.adit-jv.com> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.72.93.184] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Isolated initially to renesas_sdhi_internal_dmac [1], Ulf suggested adding MMC_CAP_ERASE to the TMIO mmc core: On Fri, Nov 15, 2019 at 10:27:25AM +0100, Ulf Hansson wrote: -- snip -- 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. -- snip -- Testing on R-Car H3ULCB-KF doesn't reveal any issues (v5.4-rc7): root@rcar-gen3:~# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT mmcblk0 179:0 0 59.2G 0 disk <--- eMMC mmcblk0boot0 179:8 0 4M 1 disk mmcblk0boot1 179:16 0 4M 1 disk mmcblk1 179:24 0 30G 0 disk <--- SD card root@rcar-gen3:~# time blkdiscard /dev/mmcblk0 real 0m8.659s user 0m0.001s sys 0m1.920s root@rcar-gen3:~# time blkdiscard /dev/mmcblk1 real 0m1.176s user 0m0.001s sys 0m0.124s [1] https://lore.kernel.org/linux-renesas-soc/20191112134808.23546-1-erosca@de.adit-jv.com/ Cc: Wolfram Sang Cc: Masahiro Yamada Cc: Andrew Gabbasov Originally-by: Harish Jenny K N Suggested-by: Ulf Hansson Signed-off-by: Eugeniu Rosca --- drivers/mmc/host/tmio_mmc_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/host/tmio_mmc_core.c b/drivers/mmc/host/tmio_mmc_core.c index 9b6e1001e77c..dec5a99f52cf 100644 --- a/drivers/mmc/host/tmio_mmc_core.c +++ b/drivers/mmc/host/tmio_mmc_core.c @@ -1184,7 +1184,7 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host) if (ret == -EPROBE_DEFER) return ret; - mmc->caps |= MMC_CAP_4_BIT_DATA | pdata->capabilities; + mmc->caps |= MMC_CAP_ERASE | MMC_CAP_4_BIT_DATA | pdata->capabilities; mmc->caps2 |= pdata->capabilities2; mmc->max_segs = pdata->max_segs ? : 32; mmc->max_blk_size = TMIO_MAX_BLK_SIZE; -- 2.24.0