Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp9678911ybl; Thu, 26 Dec 2019 03:32:03 -0800 (PST) X-Google-Smtp-Source: APXvYqzjbzs6GNIEhwAK06YsdIZXJP9rDmoHuQDN5XjFAisudsCDutvTCoYgum0K8FujLS2+1SZF X-Received: by 2002:a05:6830:20cf:: with SMTP id z15mr50206811otq.277.1577359922943; Thu, 26 Dec 2019 03:32:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577359922; cv=none; d=google.com; s=arc-20160816; b=OVO/3QeT6ws0w2e37W4f0l3Vv+74mmFu+fDlpGxYaE/gKZ9im/T8CJiRrL4k+oidFg wi5Qyx1cL22bI0e7FKhmSmbdWOiLZcHaug1PzjbGnhSBfhFxI2BZ5WtDQtTMLBulF+jw Zx/T3Ve/5sUWGrOYOBNo4HVH6chs9CTbQDH5qP9gz5uLnaOg3zH0mhVZFMM1ZH0gJDUz 7SiTn2LkteCVRLG5u+HJEXFRjP/FsEdHX4nTCvV7skZH5m6bzsYxySMdsGDgF4/Tk9DK q67F7Q20m13kFXaHrb8VtcbIYp+RljsEc+7kHVhNlxtnK41e6abrfPM9yFPd3m4qGvlY GT9Q== 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=nVzp8rqaDTTY7sAFNAFLTve3VsfLdzj2ihK4V7/f3fA=; b=VZBuDmisi/HD/x+/OHwhNkvUvgd7takWL5pmKa3pow9WhSzQaLoXOK0tVHO3IGUYOy j17ABXfkaEBLdSLIR1/xTHFHsfwkk4Kox0HiD9Wiu7pHcKzhxlj1iLy8gFbgqfpIkt+a 7mOfJ9rU+ASkoO3lz3+/8w/NYYIYpFNK+F9koE0XkXm1eh5TtDTrYz++dBzGnNEELr4T eNxFXAM91dluCG9gulOB3u5yI0H/zQHKC26uOZQVNkCW9NiYKQmh+63VemH8uydEqCv+ jV7QT1aJl/KP7nbs57noHs/w46pE1CqIAGtvAFFkGg6YI2m5k3ptidLdcpw3mVvEA7Sy cH9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ER38NVUi; 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 y186si14536530oig.241.2019.12.26.03.31.51; Thu, 26 Dec 2019 03:32:02 -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=pass header.i=@gmail.com header.s=20161025 header.b=ER38NVUi; 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 S1726626AbfLZLaq (ORCPT + 99 others); Thu, 26 Dec 2019 06:30:46 -0500 Received: from mail-pj1-f65.google.com ([209.85.216.65]:51596 "EHLO mail-pj1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725954AbfLZLaq (ORCPT ); Thu, 26 Dec 2019 06:30:46 -0500 Received: by mail-pj1-f65.google.com with SMTP id j11so3237649pjs.1; Thu, 26 Dec 2019 03:30:45 -0800 (PST) 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=nVzp8rqaDTTY7sAFNAFLTve3VsfLdzj2ihK4V7/f3fA=; b=ER38NVUikj9LKkO+PKHphFVhTpPNZ5RTvBMVH0/YW9i62NS6/mZDGt4rJ/Y6MvuV1N rXbelOVjgErqyhsTRH473+kD2AjHsrt5TVMDFcNUOe3R63qdXt0YX3hnJMSQFvfKpoJg IFogqTshY0PrLDK/LUx9+0jEqZGshmemI20uTosGBWgRv2sOlVGxtw3G7I402AwfMp66 MpLGlF+LBeamdovN+8Jk4AJPLj+03GAL3sso/Kra67melCCn4TYY1cTpoEXUiwu13CKz MTnSSyU/wuXmanm8pX5RDfZC00TETsZ0DDUbDnzdaxy5GT5VQtyNxRPceRh23lkz4/k2 StGw== 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=nVzp8rqaDTTY7sAFNAFLTve3VsfLdzj2ihK4V7/f3fA=; b=PfswPEW1J7ZVbRnf4bcTpmVhJMYRnUjYY77n+MDc7RNlDAdg+SQFZNm+nUBWY5NS33 FBjeBE8Q5805+CDQUd1gP4Umfo0uVVLMUWuuJy65A5IOMZX38eQUF/aCeY+v7VAtV3dn pD5xO0I6l1bIi7NbwAw7O97S5vnW6R5lGov7+jPn9OCKiB7NjuPrgONirFeGMX31EaOD qFAZRL4FjdbiBfqwFD8/ipqPGLjbwse9qX/J/LtxGdHiryaK1bSvzldlaQDF6JcHFZSR X01HPpZa23E5Lpoi0MactnPLtSBo1ngCqX4PPrcvsK3bMIzjlfhxDScaRHLaFGP2arEa LgSw== X-Gm-Message-State: APjAAAXGqBmZ+VuCqDdloYpDvpeJamqKUovbx0QWz8/ynnI1jf1pjNHQ aBAohcpP5mgym4a1aEhIff220uzcGIA= X-Received: by 2002:a17:90a:ec10:: with SMTP id l16mr18384302pjy.19.1577359845458; Thu, 26 Dec 2019 03:30:45 -0800 (PST) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id y6sm33743287pgc.10.2019.12.26.03.30.42 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Dec 2019 03:30:45 -0800 (PST) From: Baolin Wang To: adrian.hunter@intel.com, ulf.hansson@linaro.org Cc: orsonzhai@gmail.com, zhang.lyra@gmail.com, arnd@arndb.de, linus.walleij@linaro.org, baolin.wang@linaro.org, baolin.wang7@gmail.com, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] mmc: host: sdhci-sprd: Implement the request_atomic() API Date: Thu, 26 Dec 2019 19:29:20 +0800 Message-Id: X-Mailer: git-send-email 1.7.9.5 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. Signed-off-by: Baolin Wang --- drivers/mmc/host/sdhci-sprd.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c index d346223..ae9acb8 100644 --- a/drivers/mmc/host/sdhci-sprd.c +++ b/drivers/mmc/host/sdhci-sprd.c @@ -426,6 +426,27 @@ static void sdhci_sprd_request(struct mmc_host *mmc, struct mmc_request *mrq) sdhci_request(mmc, mrq); } +static void sdhci_sprd_request_atomic(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); + + host->flags |= sprd_host->flags & SDHCI_AUTO_CMD23; + + /* + * From version 4.10 onward, ARGUMENT2 register is also as 32-bit + * block count register which doesn't support stuff bits of + * CMD23 argument on Spreadtrum's sd host controller. + */ + if (host->version >= SDHCI_SPEC_410 && + mrq->sbc && (mrq->sbc->arg & SDHCI_SPRD_ARG2_STUFF) && + (host->flags & SDHCI_AUTO_CMD23)) + host->flags &= ~SDHCI_AUTO_CMD23; + + 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 +582,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 +680,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.7.9.5