Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp698910img; Tue, 26 Feb 2019 07:11:22 -0800 (PST) X-Google-Smtp-Source: AHgI3IaI0WRCbWWNpHufaOBFvb+QsBRquAgPQIBkYYAe+fV+fEmaEZXY9xvR/aUp97+3S/mL+CRQ X-Received: by 2002:aa7:924e:: with SMTP id 14mr26815435pfp.30.1551193882839; Tue, 26 Feb 2019 07:11:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551193882; cv=none; d=google.com; s=arc-20160816; b=sCNO6uPO+rCZGs8qr4I/Xhu2rpgEpaDGFLcubBGWnEjeRwLVaRCASVD5bSnCAT5vtI SVQLztYB7k3S9+/RKRysZ+507ljh3YXPAnYD2iMXBXtk5cjTYZGOeVnXCBwrO0ndy4Xz lRaIDg+UIoJC4rX8qOY7CWsSjXTNK8GQEfEMmMtIGmEPwWzjstp7AN4cxqLBo9POe37Q CtUHmnQ55T7Ek+gsUBlpPvdYCd5DLrxWP0pRXTtLJJDZAFI0FdRMTBlCqFAXOWvCJD32 nLUSgXNbiq+wcA671cfFFtxDkBk7aZyBeDh7R7aXFwB9wXyljmsA0TbnWtRmOYL4LzGm kY7A== 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 :ironport-sdr:ironport-sdr:dkim-signature; bh=YPPCfmPK3olAQRK/mDOfPw2fTQciIE2Yei1BcOtU1A4=; b=KgPvLgZsqmhol7+aWsreqV5Bnk5EYqiWkq64XBESrJ6lO8RLBszAyE4bjiorI9ehd9 4oPj//6t1XMNOHVBjUu3bG36UgEUHeq3jCOztq71opJHcG8hSyzy4wueT7QpACkWhnMw 4Mmb32WsPt33oUrMPlpRsDcY/czfNEyIMLfklGR7BR07zn3891NIwg3vtEYqIdGXqWTk VP5jgULzFqQY1TyqL+9lK6u0OgL7/7XHMEKKg+95ZrIZ91+nx1W094k+/t4T7TXpwsPy oyGt3SO9oW2mWUrFkMk6qH0RcrgSW/zMEYuJIDT1y5ursTnyvnOIfgBBCrDEsNs8gGLg 6dlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=cklsu23B; 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 t5si12449448pgm.79.2019.02.26.07.11.07; Tue, 26 Feb 2019 07:11:22 -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=cklsu23B; 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 S1726766AbfBZPKg (ORCPT + 99 others); Tue, 26 Feb 2019 10:10:36 -0500 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:37173 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726245AbfBZPKg (ORCPT ); Tue, 26 Feb 2019 10:10:36 -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=1551193836; x=1582729836; h=from:to:cc:subject:date:message-id; bh=0wzQ1v2y1vObejlpEt3X3iB+iw201UjwSxrZASF8EUQ=; b=cklsu23BLhIXtI9iRlJM53U7cjGtGvOhQEOEwcmsykkd1Oim5Hg6bcYK oBRPNK0s6WuY/HAGPTK72rLo/WuBIZ4jfeL3suOa9YTmLZkPdMgI2hz5F AK2qJLGGb+rOd3BZuT09875+iwlTaVnf6+J/TdUgBKX3d2kIeYXspije3 0XwXyhh6bul2KDi0WfrTKWSMMogziXatiPqk7zKMTSRjLBvZnzfrTwoSl L7jonWkmPbT2nBo+Wz9cDTpjycGLuVozYGSi8RbYGi7KKgMkcFjS3g7U3 pnW+GeHa8EtyuvGxrr6S+GIpdiclDZcBdfBLWkUzgsO0jkH/OzXxE7Fg2 A==; X-IronPort-AV: E=Sophos;i="5.58,416,1544457600"; d="scan'208";a="103943145" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 26 Feb 2019 23:10:36 +0800 IronPort-SDR: 6l7HOTtck6GH5TbR+DOB2T6FAZZhjq4SDLWRB+/rdIu1N5fkgCa0ekE57Ne+QqddnCjPMmNUQ8 PZyBa6JYnXv4Io4KhsElOS/X3wtdpjCwCzyB/RrFf08PQ0zHTQW25vmlL1smEZ0Fj/+C0/uyAK xoz6CnrrTkV/RO0/p1S7PAX/g73Cu874cU83Cs3WGdNy5XRSAhL2fHw7cVCpeNmAWKkoQCUBBv /zL5I/vq5P/tUGH/Ug/CYO0AfyRc5c/CGs7aWOFAzLcGBJdErou7GbzYjboUIvcgQ32VVH0zCb tKbGCvaW74jVWTKTtbopIoYD Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 26 Feb 2019 06:48:48 -0800 IronPort-SDR: 6Bvrm3wjHCjsijQP+mlcHt6NqAc8nvTuV92FO6TZ8vxrn/OgtHxYX9h/lkNVvA1B+7Y5BdFzVR /O7RAlp1uUNSjf0Ob0GdOxb6RJrurUmx4KMYQCcE+vRRX2ZkX+dPYDaJo6ZEmoaL3JKveoLBsx J6+LU0YbwM4JtfiA7mlJ9zzn0b80pb011FWq42zHtvJ3ObvkWzwGJbOaFJEDtxtw+ctmHTJNFp rA7D94JQmeAmJ4Y/i+dP8byNdpSpc6iN2eyaZ1EVRekBUbNDgpS6ZMJVhBVwQxj10p1E7bgfZK fPU= Received: from kfae422988.sdcorp.global.sandisk.com ([10.0.230.227]) by uls-op-cesaip02.wdc.com with ESMTP; 26 Feb 2019 07:10:33 -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 v3 0/2] mmc: core: Add SD Discard support Date: Tue, 26 Feb 2019 17:10:23 +0200 Message-Id: <1551193825-31074-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. V2->v3: The first 2 patches in the series got accepted. Elaborate the changelog of some of the differences between discard and erase. Clean some inconsistency in arg checking in mmc_erase(). Add a patch to set the timeout for sd discard. 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 (2): mmc: core: Add discard support to sd mmc: core: Add sd discard timeout drivers/mmc/core/core.c | 15 +++++++++++---- drivers/mmc/core/sd.c | 10 +++++++++- include/linux/mmc/sd.h | 1 + 3 files changed, 21 insertions(+), 5 deletions(-) -- 1.9.1