Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp701566img; Tue, 26 Feb 2019 07:13:45 -0800 (PST) X-Google-Smtp-Source: AHgI3Ibns0Zmv8piS3NFHcTqtQHQiLs8PE47G2ccMvUxt+bL2B+hVWBNuZAQFGVVZ6oRW35S0cow X-Received: by 2002:a62:bd13:: with SMTP id a19mr26297779pff.222.1551194025463; Tue, 26 Feb 2019 07:13:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551194025; cv=none; d=google.com; s=arc-20160816; b=dG2UjGoOPm/b8BNRn6LPhOfngsZpdUyxXmxhYFlKInJGGJQDPd9Cj4KgGkxmYteZeK fzcJ8wNSsMqk1m+Lep9Im5q0yCQf2+qS2oLQhkTSCTWKFb0qCS7feL/twzFZVKoRhYIu VJ9ixwzEhM9jBSrQD/PJz7eQTdFebil0/OioG+r2hcqgQ1unM0LlVRgaCn+/8eb+I9Xk LjX57keS4UbEwrr4E6FBPKF364MmYh9t4yzbYdjkF1G8+z26NT+yD3Zg1cf++mlE51Vq Z4vNB28ERGuC7RAirGNGGsQ5U/3I4Iq7JJqnSOEPdfx25dVLjcp5bjsJI4jzJdhoFsja lwuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:ironport-sdr:ironport-sdr:dkim-signature; bh=y1vDGJXxQ4G4DIUsovlQ+OWhfE6Wikdh3pd0nt5tx60=; b=J/BQW/fO4en/gGhbR5I8EAo1GrwilMhOcVUH0RKj5PnpEgX5XNpToygQj5Gs+9Dlae GNap4VhyUXR+LqjJ432k3Sen+GDa83Fq8ve4SWx0w8w8BBUQNYVN/X3X3SkVHl7Ykjqr Sysw+GCXorEPcLigauNPchJ927pZD6BasMvEyXamgD2VHaHU0WQCmSRT5jFF7bjnxxis Id+RNM39eManhOYC1bXd6IwAoAm01YI09QjNIZxV3TSqtLGDdUbd8kyddl8WqXJsNb6n jkU/bq0cFizcg4DPkU6+YUFMnafVrrJygB0U+Me6Wvu34kvrGGfgVhDiJMCiUVxKbodC E3NQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=JfmFVAuX; 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 y14si12057380pll.378.2019.02.26.07.13.30; Tue, 26 Feb 2019 07:13:45 -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=JfmFVAuX; 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 S1727695AbfBZPLT (ORCPT + 99 others); Tue, 26 Feb 2019 10:11:19 -0500 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:65488 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726965AbfBZPLT (ORCPT ); Tue, 26 Feb 2019 10:11:19 -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=1551193880; x=1582729880; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=Y6bN5OYca6nC87kBj0w2sl6iSVD3W+Bqink+e+Gyu/U=; b=JfmFVAuXUwr1z+0UGpQQqEX14p1pJMaIzZI5lREkpuVEXrBL9Lx77kzp PRuu73V86P8ekoermfY5X90iMprHFA8MPzHb656Zfjz5h4T1H4iWr+aze pMxRZO5xxSASvaO0flR9xLHZZUnVDRAGLmRMdW5r/vaCcvp5IqAIZgarL 2ULtWTu+LoDKGQ7gq7KmioY/PtiHsx6JBE3iHA3fCFDjIhXTqKVHuo2oI fRupqpNm4Bs6jWZBXIh/WzNs0P4kVTUMZc4VgchxVC1s6dVtMJEzVzz5r z2Lha7VflfYy1sRrqng8SVLOeJRDiJ3+BiMbKHzKee1LPdFc63aeQCUzc g==; X-IronPort-AV: E=Sophos;i="5.58,416,1544457600"; d="scan'208";a="102187797" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 26 Feb 2019 23:11:18 +0800 IronPort-SDR: 0V9E6SmB0emdqe8cf5EBn25TJvUyEEysAPNkoZ2s1Wp4bOquept2Cn3J86GdxzC4tjM4lpPu23 24CAaEvtrwzz97ML/ZdvTU8W6rfGEuiyyCEjbavciL5TCcvXuJfFGHEjU1xB5Q6yB429qRXm6H C1VS+usAOLX/4YrWmeSQKJ/O6OT32DvlzVFhxkZWzu4cc+alhkDu54WNik0Wx+im8+75uhYaj0 vWXrj1peogHAy1Tqy5sPHy/cFaVpUYQGXNzqW0lQkua4+ARKWsSPig1AEX8vINZ97IWgPRJoEm NumHAdNxPCJ/UnY8Fep7skiI Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 26 Feb 2019 06:49:24 -0800 IronPort-SDR: E/6td9UlJFFecuLvnSHytPEFSuIllZp6hfYmwoYOwd+5MoUjD8suFWQ86251p1GnsFsJHjYSZR 09rtzSNhIl6ZE7DQL7sN04ICrdXCs3MLEhXpTA427imhGb03wM2YMDap2DCS4X3AS1Ng3xBsaY XWOP+V9iPZv/K3y50SDkyxo44KvSJhygmjZrwU1n54MZ9JAX1b/g7orF2YH+u5xq8vEsicNq/y LUQwH31qWSFFiQeotrJn7pHHD9Sxkx6Pm5Iw3FPXO+Jf3eXqW8Jsx4dOrqqc3F4Nxw6ualnnf6 xqE= Received: from kfae422988.sdcorp.global.sandisk.com ([10.0.230.227]) by uls-op-cesaip02.wdc.com with ESMTP; 26 Feb 2019 07:11:09 -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 2/2] mmc: core: Add sd discard timeout Date: Tue, 26 Feb 2019 17:10:25 +0200 Message-Id: <1551193825-31074-3-git-send-email-avri.altman@wdc.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1551193825-31074-1-git-send-email-avri.altman@wdc.com> References: <1551193825-31074-1-git-send-email-avri.altman@wdc.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The busy timeout is 250msec per discard command. Signed-off-by: Avri Altman --- drivers/mmc/core/core.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index b7367ac..4979d4e 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -51,6 +51,7 @@ /* The max erase timeout, used when host->max_busy_timeout isn't specified */ #define MMC_ERASE_TIMEOUT_MS (60 * 1000) /* 60 s */ +#define SD_DISCARD_TIMEOUT_MS (250) static const unsigned freqs[] = { 400000, 300000, 200000, 100000 }; @@ -1619,6 +1620,12 @@ static unsigned int mmc_sd_erase_timeout(struct mmc_card *card, { unsigned int erase_timeout; + /* for DISCARD none of the below calculation applies. + * the busy timeout is 250msec per discard command. + */ + if (arg == SD_DISCARD_ARG) + return SD_DISCARD_TIMEOUT_MS; + if (card->ssr.erase_timeout) { /* Erase timeout specified in SD Status Register (SSR) */ erase_timeout = card->ssr.erase_timeout * qty + -- 1.9.1