Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp177788ybb; Fri, 3 Apr 2020 00:08:00 -0700 (PDT) X-Google-Smtp-Source: APiQypKTrndi865RywXQZLI7ZFYwjdQ5eIO1fc51VzU5lZBtPNHgg9aEObXrBlBVi+k42QsIYDi2 X-Received: by 2002:a05:6830:104c:: with SMTP id b12mr4871202otp.121.1585897680086; Fri, 03 Apr 2020 00:08:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585897680; cv=none; d=google.com; s=arc-20160816; b=NSMZwKrEB0Hk9QJCbFujn9MFiIepjQ6MOXLY3p5+/ipm9kJkgRMc+eLmBgb3OxZoAP 51nSxeBYYq74g36KPlvOjVSDeoBY0WvnRzRErGYslotaTDyshpRNo+wtj9KHwRK2Aswb iRZnO4/krzRJcP6Ca58fi+kkv7CajnIrIvH7dTPSDctKpyXnFr2qgVbl1pzjXJ6dS967 +KhsBN3aPcX9ZS2giy6aDliHFRuljU1uE3FloCLOeglZ69IDbiVOHvsMV9ND77d/xeJl 8Xw66LiU2buXbp2QIJrMzhOg6OQ8AWJvOj13PVxTU2fmLFPMKpGSrBbxPsDFcRnGWLpH H7ww== 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:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=X5441Jy2VbGV6dbzgZxForefu3q50NuP2ovt+obRsE4=; b=f9RpBI7ZmHBU7n7g1QNdgTUsc29vwMZQ11Xe+t4yjOVvVMI1W78ADX+ROaqYtRxzuM S+dze8aDAZ/cgmqrpwxKbUlQcnh9WWwfBBHESKgQ5SBoEo7trTBvu37NNjTM4NJ0snSX zBYkNxKSffFT4/7QxlRGorUdD36gjbugQUbKqfjt4Y2w7oZZhUEv3D5MEqkxSc3wOwUK yaU8HEsJpaOKtFIZc5NQAs9CE4f4dLAdX4fQg2k4JogEbVuXjXioqH4888GG0wsy/+EQ 2dlRlpUDGGKZP/iw2X7ltInmerp6ztI2DisCsxfutSO+I2oEzBQP5GFV2T186sclMCZB oW6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KdqsOxJj; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d125si3412734oif.236.2020.04.03.00.07.46; Fri, 03 Apr 2020 00:08:00 -0700 (PDT) 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=pass header.i=@gmail.com header.s=20161025 header.b=KdqsOxJj; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389802AbgDCHFw (ORCPT + 99 others); Fri, 3 Apr 2020 03:05:52 -0400 Received: from mail-pj1-f67.google.com ([209.85.216.67]:53357 "EHLO mail-pj1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388472AbgDCHFv (ORCPT ); Fri, 3 Apr 2020 03:05:51 -0400 Received: by mail-pj1-f67.google.com with SMTP id l36so2609823pjb.3; Fri, 03 Apr 2020 00:05:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=X5441Jy2VbGV6dbzgZxForefu3q50NuP2ovt+obRsE4=; b=KdqsOxJj3jIJF8lvmWFsOWJuT3iH0IM4CfLsCNIkcwxFSzinWd8uE3DN7BpJq3d3dN IAq7WUozAuBW9Peboj/muqESeRUcFALD9rl6eT7/iR5M2VMbEQRHIIvvcBrw8tDXSTQI RcPpfTiS8YmXuFR9oYnxvINs1yiuGWa6z7YKilGNEWbYKqDf8rLcSQUK6O5d6z4fTrTn Bdjxo49wflcMvAfa2J2qGe24WHEWHLz8UL1+Wi4+ZdN5F16kS9rtIwoK+me/pjwOP6JH +w9jjhQ5NYAEvOXG573xY3NL/TP55I/mJ6CSnaT+PcrG6JmBbw+Y9ECCVTjxJ4ywjqNf pZ4w== 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:in-reply-to :references:in-reply-to:references; bh=X5441Jy2VbGV6dbzgZxForefu3q50NuP2ovt+obRsE4=; b=O1fdNSxCMjJIHtvZkpVaeBFdODKj0xi5TdzOy7HNY02OnyskeGOrWnOh/0JvuM+NlO NN+xuueSBI//fEOmAYhvLvWcLNaSwPiE6nc4dqjnxRYDbCrZN6GyfKAhyEefIwGNkQ0g Azm8tjZm12B4NJ3PJaFAQhv4YGxTHh2mqkM0/nMV+DEUlLUut+32gDotdlBuOsZgxpWR AdDZ3CZFs8UpN7IlidlYLNZpGfVKC89RcS7UPpC4yuCs8zczhEtLB9slsOIN0CjUzhRf lAzLzAaEh6EoVjONony1g1JpTqxbeLpdsWbHSs4EhyPsXmYFtNfaJilfO93P3Kd2MBNn VkPw== X-Gm-Message-State: AGi0PuawP4WotobUgrfecBAHR9yIfLZe+d6iHv93mJSruzepwdUjB4LG XcJst8ZrDetgDA4bow8d9rI= X-Received: by 2002:a17:902:8e84:: with SMTP id bg4mr6390446plb.11.1585897551311; Fri, 03 Apr 2020 00:05:51 -0700 (PDT) Received: from sh03840pcu.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id u18sm5138701pfl.40.2020.04.03.00.05.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 03 Apr 2020 00:05:50 -0700 (PDT) From: Baolin Wang To: adrian.hunter@intel.com, ulf.hansson@linaro.org Cc: orsonzhai@gmail.com, zhang.lyra@gmail.com, baolin.wang7@gmail.com, arnd@arndb.de, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 3/3] mmc: host: sdhci-sprd: Implement the request_atomic() API Date: Fri, 3 Apr 2020 15:05:28 +0800 Message-Id: X-Mailer: git-send-email 1.9.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Implement the request_atomic() API for nonremovable cards, that means we can submit next request in the irq hard handler context to reduce latency. Moreover factor out the AUTO CMD23 checking into a separate function to reduce duplicate code. Signed-off-by: Baolin Wang --- drivers/mmc/host/sdhci-sprd.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c index 2ab42c5..bc7a8cb 100644 --- a/drivers/mmc/host/sdhci-sprd.c +++ b/drivers/mmc/host/sdhci-sprd.c @@ -406,7 +406,8 @@ static void sdhci_sprd_request_done(struct sdhci_host *host, .request_done = sdhci_sprd_request_done, }; -static void sdhci_sprd_request(struct mmc_host *mmc, struct mmc_request *mrq) +static void sdhci_sprd_check_auto_cmd23(struct mmc_host *mmc, + struct mmc_request *mrq) { struct sdhci_host *host = mmc_priv(mmc); struct sdhci_sprd_host *sprd_host = TO_SPRD_HOST(host); @@ -422,10 +423,23 @@ static void sdhci_sprd_request(struct mmc_host *mmc, struct mmc_request *mrq) mrq->sbc && (mrq->sbc->arg & SDHCI_SPRD_ARG2_STUFF) && (host->flags & SDHCI_AUTO_CMD23)) host->flags &= ~SDHCI_AUTO_CMD23; +} + +static void sdhci_sprd_request(struct mmc_host *mmc, struct mmc_request *mrq) +{ + sdhci_sprd_check_auto_cmd23(mmc, mrq); sdhci_request(mmc, mrq); } +static int sdhci_sprd_request_atomic(struct mmc_host *mmc, + struct mmc_request *mrq) +{ + sdhci_sprd_check_auto_cmd23(mmc, mrq); + + return sdhci_request_atomic(mmc, mrq); +} + static int sdhci_sprd_voltage_switch(struct mmc_host *mmc, struct mmc_ios *ios) { struct sdhci_host *host = mmc_priv(mmc); @@ -561,6 +575,11 @@ static int sdhci_sprd_probe(struct platform_device *pdev) if (ret) goto pltfm_free; + if (!mmc_card_is_removable(host->mmc)) + host->mmc_host_ops.request_atomic = sdhci_sprd_request_atomic; + else + host->always_defer_done = true; + sprd_host = TO_SPRD_HOST(host); sdhci_sprd_phy_param_parse(sprd_host, pdev->dev.of_node); @@ -654,8 +673,6 @@ static int sdhci_sprd_probe(struct platform_device *pdev) if (ret) goto err_cleanup_host; - host->always_defer_done = true; - ret = __sdhci_add_host(host); if (ret) goto err_cleanup_host; -- 1.9.1