Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp2509521ima; Sun, 3 Feb 2019 00:51:27 -0800 (PST) X-Google-Smtp-Source: ALg8bN4hIjyCih6iQ4XYcgPGVeGJ4LVXd4mW1SjWaFDmRC3BluAFJuJwicVlExe/imzM9I3OYR63 X-Received: by 2002:a17:902:503:: with SMTP id 3mr47384346plf.233.1549183887151; Sun, 03 Feb 2019 00:51:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549183887; cv=none; d=google.com; s=arc-20160816; b=cwGzKS+6khaf8XIDl/DIpmnOIfE4RdrIerHirjxuTUMECY3LrygQrRpjLv1tURwnzN A9mOQn9lvFBHkApySPFjezfEqTM31zpoVpuXSkosGs6ZnC54DqcC0n3rIppUZOpHN1/6 nPzIRR4pxLpeECuJb95vocXJtrGJzFUS2VqGHap9eCecCSG0ftd9pEpRjzbxjDNWph1R nCFtHqySfwOKm6p/AjQZDKthCu1SpmGt6qTHq52HbEZsSTZygk3QCecPHVVh8VX4vNcd cx9mh9TnPAPTLIcy4h2odeUMuDwHZG1RO4gdk7t5YqcEM1BJnmWKjYvTcSa7jYq62I8q NdVg== 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=CJYGstrncfPHSYmXWVHoSlR+08sJASlR13DxK1H/DmM=; b=raCT+1Df+9tAaDWKPgvyywXigeoZ2JBkPX/4uT/W58qEfkpCw6zD6V52TAi9tvONgt Sf1tX7j2euAL9bsUEP4R3Vx2wc2oMSuLFv1/D23OSuDq3NBIJZ7hLyW+HDIEoSZrhPR8 /WccDORxMt5UwK25CEnukxRk7kzTor+vxH8gp3fpVmjlwi7hMNoBQoEw6LZ2aeWobAts wK0FzDBOolVX4yIUzicd9JoM3bIaeI1dQ7sprNJbR3FqdUY8cGX/qGt5dgtVld4f+w1c nwXwKjHg7lVTPm2jTbofuezxUI9248KwaRH6L/ZTyhgNMBgSqAg/uL9Pedd8JpZguD3x Q+yQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=QwY2ClQN; 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 l94si259502plb.209.2019.02.03.00.51.11; Sun, 03 Feb 2019 00:51:27 -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=QwY2ClQN; 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 S1727623AbfBCIuw (ORCPT + 99 others); Sun, 3 Feb 2019 03:50:52 -0500 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:15409 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727025AbfBCIuw (ORCPT ); Sun, 3 Feb 2019 03:50:52 -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=1549183852; x=1580719852; h=from:to:cc:subject:date:message-id; bh=6c/3Naq/+s4XBGq5QNQtJjin63v2a5rmbaKk9XMLyKg=; b=QwY2ClQNSCWu8IwJ59wGh4bbJTL6C1tcoBiG/tzmUuKBkeNplDdmUVt5 LLGWfZ7dAJDZWUi8RpgWQ5lViLqqFD1dUc8Hl/BmYEod1xiM/DJDSbKzV 6WzWoRprNzODkY7sG6uLNpa4B08JownVVMwA/jelKeyp3HlhmHLaAuFZw eZn/z/5GHkxynhUS6HbALDTdt9c8ilR20TrhB81h63UkilBzWK1DTwqAR ADGj9CXfu+nCMLH0x3FSBhLkfBBBNBxnBhQ/Y9Y8EisoDbeTewExLe8JT uMjrxMwcAorjLvBf617qgW/UBsD3wwW10L5hTQ/ZUfeJiRk6ekhtOysdt A==; X-IronPort-AV: E=Sophos;i="5.56,555,1539619200"; d="scan'208";a="105387539" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 03 Feb 2019 16:50:51 +0800 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP; 03 Feb 2019 00:29:42 -0800 Received: from kfae422988.sdcorp.global.sandisk.com ([10.0.230.227]) by uls-op-cesaip01.wdc.com with ESMTP; 03 Feb 2019 00:50:48 -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 0/3] mmc: core: Add SD Discard support Date: Sun, 3 Feb 2019 10:50:25 +0200 Message-Id: <1549183828-17316-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 D 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. 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 | 6 +++++- drivers/mmc/core/mmc.c | 8 ++++++++ drivers/mmc/core/sd.c | 15 +++++++++++++++ include/linux/mmc/card.h | 4 ++++ include/linux/mmc/sd.h | 6 ++++++ 6 files changed, 41 insertions(+), 10 deletions(-) -- 1.9.1