From patchwork Fri May 8 11:28:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 186322 Delivered-To: patches@linaro.org Received: by 2002:a92:8d81:0:0:0:0:0 with SMTP id w1csp4070895ill; Fri, 8 May 2020 04:28:58 -0700 (PDT) X-Received: by 2002:a2e:8549:: with SMTP id u9mr1322720ljj.24.1588937338196; Fri, 08 May 2020 04:28:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588937338; cv=none; d=google.com; s=arc-20160816; b=YzTwEhG3cKUryhZCNIFANnRsekI27miiXXZwsix0d0V/BMao9D1U157HsjZ1BwJxcr 4BIphQ+i9uFTJbHFnn6eOsRdZS+85kySzfm+5Jv0uEGbyqpS3HOOk2rpoSfiFdgGtAwv l0gnMai7450nRDkThk+5WzRymIvMgPkQGHmqWcoke5NxfRXtl1uDuXSI6oXunkZqjWXi PwKn6ijZrEc97F0i8MZUI5wmlL207CIEooe+zVWOgRauiH3xRbhkA4xwIN/8LDWxZ1Xm nHBkS/JFSlbVrTIhy/JKrfp4CIw4Mg6QF9qKdyM8JsQMB+XFJhTgdfCUSz2tI0t3yIqZ HJsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=MhxfN8SxWdzLn5dMAyqxuGTc1RgZ6rin/GDX/jd0f+0=; b=iPLzJn43T40f9qs5CnrySXi3RZmuMy6ItI0QwBTBUuTwfkxAlJWQIQk5UZN5Wgv8WK SoHesekDH3KJlS6n3CfdZv1veXsblVOAXECm1l4VTQ3TxjODTxp+SACLvsXzGTelcx/v GuVLyVwCqhu4RA54l9g5U8msBGrRu7FJfg2p3aYc7c1W9Yb8Ad4kEIDk0Y/ngBeKVy+g xaqfH1RYiEBuf06/h5oupGcWv2g+BhsH8ibm2IK0UcWtekNyirx5yV9x2YWVXWLahT9v Fjg40BAVXmX2me9CMd9LShkRtg3Wgire//ZSiDXkxPq0f16vFKPfXMBR9a2esHjijH+Z UxUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZKPX9yE3; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id u28sor898630ljo.48.2020.05.08.04.28.58 for (Google Transport Security); Fri, 08 May 2020 04:28:58 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZKPX9yE3; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=MhxfN8SxWdzLn5dMAyqxuGTc1RgZ6rin/GDX/jd0f+0=; b=ZKPX9yE36H2wtQ3VjloefuuUrYsUwjVrwfFJNGFGYkMyRjO8A3r4sWl2jcXsOP8AC9 UJ8zYFu1ghNGoeOnv7rJ3VpMEUe0IDQIhXVoQNAMQrz8W5AeVZVdQct/jgnQhlVAA13i 1DZaq7WmQgd02YIRU2/gJfRJS/swygeM4kc5sCsckkgPI1cg9KfJDrZozqW8Ej2U7ort rbG7NWJVwatVaPzNysjlKESiEEHyRoK7Pknb45QwHcH1y4oBXBkORgKQx6Y+y0GgSw7k fHwciFos1JnKf4by+Uxclv2WeeBavhfuu5Vq7YEGIUPynrF/mK0cQRZacNYHUNcg5ieT dXzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=MhxfN8SxWdzLn5dMAyqxuGTc1RgZ6rin/GDX/jd0f+0=; b=iTHJi0svFCPKU7aqJ2wUg61tZ/khzoCLVLrIEAyCGDsvwLa5b/k8ELgb3gOtIq/4UP q93bWUloNGxpEPiagRx07jYw9tQ5X5SyZRK8Eqb8GZPWc8MQxnUs8WufGcrWMgNaij/g YCJJ9fUxpzXU2cHR4bzIv6jAFvcSdAO+h6EejGUzMkoTIIvAy5+D4cOlHgwTuwosPBUn A9qni8trOapr/qc/5PeAEPOKjJ4G4xdn/fbghbnvt34amSlKotmSrCf8URa1a2/3T2dT VMBXePmN2F9EsQGC1V65ZCLxI1OnF4bI/pTTt1a0/wg0P66G5fKTxKlEbrVx4ruIByVq /7sw== X-Gm-Message-State: AOAM532JIq3OOoQ191bN+LUiLQysfVijJhQAOREAN+jWTfWBVP8VeP3p lbkqih48zs8cwnaDCfY7h1VHBSkj X-Google-Smtp-Source: ABdhPJxrj9Y0bYuPfk0zghwguTUWkRn2VVke2+xrpwKfhjTeNTsHgU2qDNR9RlJ/fhjWo8+xnMmkXA== X-Received: by 2002:a2e:80da:: with SMTP id r26mr1368925ljg.38.1588937337746; Fri, 08 May 2020 04:28:57 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-98-128-181-7.NA.cust.bahnhof.se. [98.128.181.7]) by smtp.gmail.com with ESMTPSA id w29sm1051292lfc.4.2020.05.08.04.28.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 May 2020 04:28:56 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson Cc: Adrian Hunter , Linus Walleij , Rui Miguel Silva , Greg Kroah-Hartman Subject: [PATCH 1/2] mmc: core: Enable erase/discard/trim support for all mmc hosts Date: Fri, 8 May 2020 13:28:53 +0200 Message-Id: <20200508112853.23525-1-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Step by step, mmc host drivers and the mmc core have been improved in regards to support erase/discard/trim operations. We have now reached a point when it no longer seems reasonable to use an opt-in approach to enable the functionality. Therefore, let's switch to make the operations always supported. Signed-off-by: Ulf Hansson --- drivers/mmc/core/core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -- 2.20.1 Reviewed-by: Linus Walleij diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 4c5de6d37ac7..8d2b808e9b58 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -1815,8 +1815,7 @@ int mmc_erase(struct mmc_card *card, unsigned int from, unsigned int nr, unsigned int rem, to = from + nr; int err; - if (!(card->host->caps & MMC_CAP_ERASE) || - !(card->csd.cmdclass & CCC_ERASE)) + if (!(card->csd.cmdclass & CCC_ERASE)) return -EOPNOTSUPP; if (!card->erase_size) @@ -1872,8 +1871,7 @@ EXPORT_SYMBOL(mmc_erase); int mmc_can_erase(struct mmc_card *card) { - if ((card->host->caps & MMC_CAP_ERASE) && - (card->csd.cmdclass & CCC_ERASE) && card->erase_size) + if (card->csd.cmdclass & CCC_ERASE && card->erase_size) return 1; return 0; }