From patchwork Mon Feb 10 22:54:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Puthikorn Voravootivat X-Patchwork-Id: 3623961 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DBE3ABF418 for ; Mon, 10 Feb 2014 22:55:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 43527201E9 for ; Mon, 10 Feb 2014 22:55:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 522092018E for ; Mon, 10 Feb 2014 22:55:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752291AbaBJWzF (ORCPT ); Mon, 10 Feb 2014 17:55:05 -0500 Received: from mail-vb0-f74.google.com ([209.85.212.74]:52815 "EHLO mail-vb0-f74.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752179AbaBJWzE (ORCPT ); Mon, 10 Feb 2014 17:55:04 -0500 Received: by mail-vb0-f74.google.com with SMTP id x14so887720vbb.5 for ; Mon, 10 Feb 2014 14:55:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=o7YWR8fRqiGQslHE9IWDVq/WJa31O6JxSiTsex49EDc=; b=dlmt6uCgW8OdMb5SLn6ksuj1hJzUXoBrkToWnmlAI+KxltjHLPPKYuhnp6q0W6dTnr 28D7uclnP3Pr6qZ6SkgWxeFfco1QXiMuRsqQwVIGu8zhWKndp9mA+HjX6c76ZnbJflew B5UrSAesgreeHi68rl2OHA9UrLJ3f11QmKQFjFWk+ZYXgX7YT8ir3gtmsuj/oZxxitxx upAz4qaJaOhMh8bLYAgxnjiWelFUusuSoXnPQg5SdcN/zR0eroP8CdTIQglizSNBnrI2 SUXbd5MleCAr2JEKaoqRi23rnFu7+e+64rWJOe3p0Rw8FnrvQ3s0RZmxZ8b4d5bpEaa6 A5qw== X-Gm-Message-State: ALoCoQnkoCCYMxF83SNi6/hIXNMOZfzpl1c20Xp3Uln34ywZecrBdc1veeJwS05lUl9q2OJYIfYTyDEGiHg0hbFaNT6aLVCAr/RyprC/AkBSiAqwhHAH/3uuPjp6iwZpauYdZSjRnMpAn+G4M1GMD6JcMyoSqWNdcy5VB9ZZ83scEKYgdw3bzl0APQgfx4Dm02jEyaVBDoiE6LT1HU3YqTa8ejHCZ/OR3Q== X-Received: by 10.236.88.49 with SMTP id z37mr4277809yhe.9.1392072903115; Mon, 10 Feb 2014 14:55:03 -0800 (PST) Received: from corp2gmr1-2.hot.corp.google.com (corp2gmr1-2.hot.corp.google.com [172.24.189.93]) by gmr-mx.google.com with ESMTPS id v64si2100308yhm.3.2014.02.10.14.55.03 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 10 Feb 2014 14:55:03 -0800 (PST) Received: from puthik.mtv.corp.google.com (puthik.mtv.corp.google.com [172.22.72.136]) by corp2gmr1-2.hot.corp.google.com (Postfix) with ESMTP id DAD195A4107; Mon, 10 Feb 2014 14:55:02 -0800 (PST) Received: by puthik.mtv.corp.google.com (Postfix, from userid 218808) id 7B76E201232; Mon, 10 Feb 2014 14:55:02 -0800 (PST) From: Puthikorn Voravootivat To: Chris Ball , Seungwon Jeon , Ulf Hansson Cc: MMC list , Gwendal Grignou , Grant Grundler , Puthikorn Voravootivat Subject: [PATCH v2] mmc: enable trim in eMMC device Date: Mon, 10 Feb 2014 14:54:51 -0800 Message-Id: <1392072891-21302-1-git-send-email-puthik@chromium.org> X-Mailer: git-send-email 1.9.0.rc1.175.g0b1dcb5 In-Reply-To: <1391798398-24634-1-git-send-email-puthik@chromium.org> References: <1391798398-24634-1-git-send-email-puthik@chromium.org> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Force all host to have erase capacity to enable trim or discard feature in supported eMMC device. Signed-off-by: Puthikorn Voravootivat --- V2 change: Instead of add MMC_CAP_ERASE just only for dw_mmc, this patch adds this capability to all host. drivers/mmc/core/host.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c index 49bc403..a21f590 100644 --- a/drivers/mmc/core/host.c +++ b/drivers/mmc/core/host.c @@ -521,6 +521,8 @@ int mmc_add_host(struct mmc_host *host) WARN_ON((host->caps & MMC_CAP_SDIO_IRQ) && !host->ops->enable_sdio_irq); + host->caps |= MMC_CAP_ERASE; + err = device_add(&host->class_dev); if (err) return err;