From patchwork Wed May 30 15:25:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Damien_Th=C3=A9bault?= X-Patchwork-Id: 10439283 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CDFBE602CC for ; Wed, 30 May 2018 15:25:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BFEC328AAF for ; Wed, 30 May 2018 15:25:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B379528B60; Wed, 30 May 2018 15:25:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, FROM_EXCESS_BASE64, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C9AAB28AAF for ; Wed, 30 May 2018 15:25:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753825AbeE3PZ2 (ORCPT ); Wed, 30 May 2018 11:25:28 -0400 Received: from mail-eopbgr20062.outbound.protection.outlook.com ([40.107.2.62]:42977 "EHLO EUR02-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753824AbeE3PZ1 (ORCPT ); Wed, 30 May 2018 11:25:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vitec.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MRvMLrwNd9VKpcvkQKr3ylGo8SExR5jj9AwFyiApzLs=; b=jRatsKGYSt8MCvQXO8nR5SomBAkxHMl1dnWMUCdKQ6hY2yiVmFaqS5KSfXlg8/oGhXjgTh5A0RwO1qpzSEssKcSwVfiJUFDNwag/Nvi3yESn0dg/QN4tWFuyoaDp8q2NL6r6ywqVPQbRiqK0m/veal0m73EBC2//LfF1YQippyg= Received: from HE1PR05MB1436.eurprd05.prod.outlook.com (10.162.253.142) by HE1PR05MB3482.eurprd05.prod.outlook.com (10.170.244.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.797.11; Wed, 30 May 2018 15:25:22 +0000 Received: from HE1PR05MB1436.eurprd05.prod.outlook.com ([fe80::f5ce:5076:6c7a:dcee]) by HE1PR05MB1436.eurprd05.prod.outlook.com ([fe80::f5ce:5076:6c7a:dcee%13]) with mapi id 15.20.0797.015; Wed, 30 May 2018 15:25:22 +0000 From: =?utf-8?B?RGFtaWVuIFRow6liYXVsdA==?= To: "ulf.hansson@linaro.org" , "nico@fluxnic.net" CC: "linux-mmc@vger.kernel.org" Subject: [PATCH RESEND] mvsdio: Add ERASE caps Thread-Topic: [PATCH RESEND] mvsdio: Add ERASE caps Thread-Index: AQHT+CpsBKc3At33MEmYbPwZqCV8dQ== Date: Wed, 30 May 2018 15:25:21 +0000 Message-ID: <00ad6e33ca4270d9530ac6bd7e508af05e759a1c.camel@vitec.com> Accept-Language: en-US, fr-FR Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: Evolution 3.28.1 authentication-results: spf=none (sender IP is ) smtp.mailfrom=damien.thebault@vitec.com; x-originating-ip: [46.218.234.67] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; HE1PR05MB3482; 7:eDL8bGSWgZ105MjFNRyc6JLgvwfWvCHMx31QH/JQtpEX+X460DTo/wvzvnbRdlQZlXJnRDryyYDynt7G1oZNImr+TgaMoIRULVZgUOQ3/SQdGpakdRgg3nXVIKncnon0KIcUfZdzt/SJvdp5ewKKZSRcRZ/oA9QB3JLJWV687Cdeo9rbVKgzNp3S2ne2W/iKd5tbNivEtgFBaP7nHWyA1Z0Nf7oYs5DR73oQMEELESHVRX2BvFN9l6sv21WsyR9D; 20:/ks75Is9jyov0IOnpdA8Wr0dSuUmM5pwp6wZJfQ8kKdABYJDnppKvA2pLfljdlrWrIMaH6hcN450FIJRmT+xuoNHwFgqky8XFE6K4UpfQtUve8FtcviNKmRLkoXNAhrhjYHhOrtFQB7hDPy2KWGKMnSl3V6s/YyRbtz+oZfC9qdNTa1vGHkjf0g2wyTknoMxQnNQmUkHNUwjjCvm786oMOdwwGnfMuiz3+hYeqvkFHv3cVlfXkm8dZinU7wHQXB7 x-ms-exchange-antispam-srfa-diagnostics: SOS; x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:HE1PR05MB3482; x-ms-traffictypediagnostic: HE1PR05MB3482: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93001095)(3231254)(944501410)(52105095)(149027)(150027)(6041310)(20161123558120)(20161123564045)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:HE1PR05MB3482; BCL:0; PCL:0; RULEID:; SRVR:HE1PR05MB3482; x-forefront-prvs: 0688BF9B46 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(396003)(376002)(346002)(39380400002)(39840400004)(199004)(189003)(97736004)(3280700002)(66066001)(6486002)(8936002)(26005)(85182001)(186003)(8676002)(85202003)(105586002)(53936002)(486006)(6512007)(14454004)(6306002)(86362001)(106356001)(966005)(4326008)(68736007)(316002)(305945005)(110136005)(2900100001)(2906002)(7736002)(99286004)(6506007)(50226002)(478600001)(2616005)(476003)(102836004)(6436002)(5250100002)(25786009)(6116002)(3846002)(36756003)(3660700001)(2501003)(5660300001)(118296001)(81166006)(81156014)(99106002); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR05MB3482; H:HE1PR05MB1436.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: vitec.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: yiRcyF/jwEWI1CT3c65pFNukIoqqeD120eo83gOUaI+CK3+wK3erysNznRgOANbnPxDYXDIelm+YTxZQ2V3dYCAJ5ZUi4mfWLSU9r6ZJ9ZuqzWRZOJmf+rH+xPhaXPme/QGS4nwrbHu9h8yP8fCX/A+R3PcAg3j35QhX+mP/Gd2SQsymakNfwGJCMPA0M9s/ spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-ID: <2897783FEA6E2843A847F040F8041003@eurprd05.prod.outlook.com> MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 30b80832-4d5a-45b7-5773-08d5c6418f3f X-OriginatorOrg: vitec.com X-MS-Exchange-CrossTenant-Network-Message-Id: 30b80832-4d5a-45b7-5773-08d5c6418f3f X-MS-Exchange-CrossTenant-originalarrivaltime: 30 May 2018 15:25:21.9697 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 417d3214-b611-4fca-a1d5-e4446a9f50f4 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR05MB3482 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hello, I'm re-sending this as I did not get feedback the first time I sent this patch some time ago. I was trying to use ERASE with mvsdio and it did not have the capability. But the Marvell SDIO host controller does support sending ERASE commands. This is similar to the patch that Sascha Silbe sent a few years ago [1], but this one is based on the latest kernel sources. [1]: https://lkml.org/lkml/2011/3/17/297 The patch stays in the spirit of what have been done in other drivers like dw_mmc or sunxi-mmc, setting MMC_CAP_ERASE before calling mmc_of_parse(). This has been tested successfully with blkdiscard and blkdiscard -s on an eMMC card. Regards --- drivers/mmc/host/mvsdio.c | 5 +++++ 1 file changed, 5 insertions(+) -- 2.17.0 diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c index 210247b3d11a..0367f826a702 100644 --- a/drivers/mmc/host/mvsdio.c +++ b/drivers/mmc/host/mvsdio.c @@ -748,6 +748,11 @@ static int mvsd_probe(struct platform_device *pdev) mmc->max_seg_size = mmc->max_blk_size * mmc->max_blk_count; mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count; + /* + * Support MMC_CAP_ERASE, needed to use trim/discard/erase commands. + */ + mmc->caps |= MMC_CAP_ERASE; + host->base_clock = clk_get_rate(host->clk) / 2; ret = mmc_of_parse(mmc); if (ret < 0)