Received: by 2002:ac0:8c8e:0:0:0:0:0 with SMTP id r14csp504297ima; Wed, 6 Feb 2019 03:53:38 -0800 (PST) X-Google-Smtp-Source: AHgI3IZT+4NapvuttofmZomQsOy/DuAzZ0Y2h9dJ7CbL176FJKeSlgURFS8jqgKLP6yAJRPJtGnc X-Received: by 2002:aa7:8101:: with SMTP id b1mr3431432pfi.148.1549454018428; Wed, 06 Feb 2019 03:53:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549454018; cv=none; d=google.com; s=arc-20160816; b=L3aQqkF+8O2BhlXyv8+x7FYfCFRlj6Kig+8zEr4qGxa8G1oaUvMoTY/qUVvEVFo4fe LRkUDKfMGegp1qO4Qts1FI/lBNB4UFogXZONQ94VwMV3qK6QBR2gn9Sumdm9+O+eb3zC iQqxKjRcXPKP9z8vCCGK7gteAf3U2H0LMiLmPYHS9crKITo0yEDSpo6P0X5SDjsOUq9c ZACYJl0f332Nkb+QCjRafD1v8h1vdUnZoCjRvu8lVHWNT+odFGW9q3jPFyYOEtL2+ZVm /BTjoR9APf7iiO/3zkp84H6k1d4YUA1B8zYRMlV+yJKr3NulYP5nziOgF5cig1vQsvPr p2TQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=PnMgyYHJcAKF1C6hfequF4OWcswJJhyv25MhkDZssi4=; b=pXANO39joA8e/bVOGY4c/bTl1xPfVJiGY+lZFAYgo1y+NuXEnMN2I3kAvQnD2wQHMM U+Ha9jSTZPHUGMTHq33Syekpms6GbfphI185enaW6+buZbY5C4kWbWQJbR4SiV31da5v 7jrwwyxLM75ppVbGrD54uHVLanx8NAWOVrY4daq9t5vTf+4QPbzSUXHDDpIsKWwoANsH SDijrNDwJ8QI7Jwch0hkpWLQYDof4d9xvUjyYCwHJqlBu0veCHga9AGSaq01/FepwTau a2HT12XBsCeLzCstwevjkbx8XTJILt1AdLu/APKNMSPk15X6NQbRKOvWKmNsOhkhbj3y TsYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=ZZwa+5hP; 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=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g21si5644427plo.435.2019.02.06.03.52.54; Wed, 06 Feb 2019 03:53:38 -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=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=ZZwa+5hP; 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=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729857AbfBFL2l (ORCPT + 99 others); Wed, 6 Feb 2019 06:28:41 -0500 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:52535 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729778AbfBFL2k (ORCPT ); Wed, 6 Feb 2019 06:28:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1549452521; x=1580988521; h=from:to:cc:subject:date:message-id; bh=MD0RpfSJyPYnPMaLg3A2LN6EW2fPmTxLI420Z4nlS7A=; b=ZZwa+5hPCxEemMTHxwoLGP2/MRPOyjUTV8s/wAMQV08t+8UzTh15f5B+ sxMfmDC9SbkvUQ+4o/LT2RI2qlzJSKsDul3WcOiUwTgRbOgVIdrcLHyth Ni55Ung4JUPbxNRBT0e32VXCCnPWfq9gozb8t6x7n0AscpyB/X7uG/Wnd wMbmHHI+tmLokbgdWNCuo+tPY5OPCpZcGR8r9kMfkgpQnJBNGl+IZPPh/ MJW+ou6VDpiLQJMkJsQUSDsXuMezqXifH/490adS4P6B88XRUvpxiyyT8 n1S5cD6Q2lt0dVoGFg2FxhyPquZl2bPOIzMoyS3z/pj/+93mrNqPz2sRX A==; X-IronPort-AV: E=Sophos;i="5.56,564,1539619200"; d="scan'208";a="105601449" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 06 Feb 2019 19:28:40 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 06 Feb 2019 03:09:26 -0800 Received: from kfae422988.sdcorp.global.sandisk.com ([10.0.230.227]) by uls-op-cesaip02.wdc.com with ESMTP; 06 Feb 2019 03:28:37 -0800 From: Avri Altman To: Ulf Hansson , linux-mmc@vger.kernel.org Cc: Wolfram Sang , Adrian Hunter , Jaehoon Chung , Shawn Lin , Avi Shchislowski , Alex Lemberg , linux-kernel@vger.kernel.org, Avri Altman Subject: [PATCH v2 0/3] mmc: core: Add SD Discard support Date: Wed, 6 Feb 2019 13:28:04 +0200 Message-Id: <1549452487-17193-1-git-send-email-avri.altman@wdc.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org SD spec v5.1 adds discard support. The flows and commands matches those in eMMC, Which leaves to set the appropriate discard arg in CMD38 if DISCARD_SUPPORT (b313) is set in the SD_STATUS register. We set this arg on card init: not in mmc_init_erase as one might expect but arbitrarily once the card indicated its discard support. This is because unlike erase, it doesn't really involve any logic, and we want to avoid the unnecessary complication. V1->v2: In the first patch, assign the discard arg for SD cards as well to keep the code consistent. Rename "discard_arg" to "erase_arg", and elaborate the change log. Avri Altman (3): mmc: core: Calculate the discard arg only once mmc: core: Indicate SD specs higher than 4.0 mmc: core: Add discard support to sd drivers/mmc/core/block.c | 12 +++--------- drivers/mmc/core/core.c | 8 ++++++-- drivers/mmc/core/mmc.c | 8 ++++++++ drivers/mmc/core/sd.c | 15 +++++++++++++++ include/linux/mmc/card.h | 3 +++ include/linux/mmc/sd.h | 6 ++++++ 6 files changed, 41 insertions(+), 11 deletions(-) -- 1.9.1