Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp4241713ybf; Tue, 3 Mar 2020 23:43:16 -0800 (PST) X-Google-Smtp-Source: ADFU+vuAbnlolOLC1ksIyX7AXkU5oukzo3izqu6lCoBNNZHaM23NjobOCZb0az519itHhEv1qwNx X-Received: by 2002:a05:6830:1d7a:: with SMTP id l26mr1324576oti.138.1583307796667; Tue, 03 Mar 2020 23:43:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583307796; cv=none; d=google.com; s=arc-20160816; b=KOVpc4wxjKLgKW1SgBZkU7MTpuozvwjR2r45gt7hEWK5QgJI15qpVjtJXLW7OG1ItI WWqCnq0Bifc4WdT5sApWUnNF3jh2TdjK2TKhkaLrVakc/vKvNMx8YuCaPHB96Zc3dn22 npbWhCfSNRi1XPgU5TCU06vXheLU30Yh9pxBjtMRcsgKYdgpG0hPHakrtr+cpFLOPuHq iEnX6AlzqQojGn32BaJIbxK2BZNusZWsq0Ci5iNe97I8+Hbhm8FrFkkvjehQDC9I0Owz LWahAFOLyLq5CTbnOELhzrbeSPpxYNu6JqftRzj7+hJH46B4Zx4ps92xa9+c71xIqBQl o/2w== 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=it3guJ5dFp5vGJJ3WdR2QDpXIeH4iEb/WDqIOW8QOj0=; b=V8s9YH7kob/DA4lSIB5bXPDQM5X3hcxxM8v7lwa1ud0yJVSfRVHFOHrCThKctkVLkw 6F2fsVqJuO4YNg4DejK1qZPjGHSUaxfsE17n6WGjq5y4YcJvmo+hcg7T9HuN+KcGp2wv aWDrlSY2X9sVKuT78eNJvjkUdNqPaBs+SLYX6HXfTqlydglcIMNG7syAMiPqoJELZToR 1tG/LJSjVm+gncx3uW8uikNjY6RWkbLkdr9EAvV1ousPUGIb4AyXK8pR9aOg2De4mDrb kW9D4MBWBHlkci9dCubhdONRi/yGF07+HiuyutS679K/U6jjthp3SfQCLLWLLVHfVn2a UJxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ufYK1K9o; 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 w9si3989otp.323.2020.03.03.23.43.05; Tue, 03 Mar 2020 23:43:16 -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=ufYK1K9o; 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 S1728721AbgCDHma (ORCPT + 99 others); Wed, 4 Mar 2020 02:42:30 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:45368 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728486AbgCDHm2 (ORCPT ); Wed, 4 Mar 2020 02:42:28 -0500 Received: by mail-pl1-f196.google.com with SMTP id b22so637262pls.12; Tue, 03 Mar 2020 23:42:27 -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=it3guJ5dFp5vGJJ3WdR2QDpXIeH4iEb/WDqIOW8QOj0=; b=ufYK1K9oUVpy0N8n3AGnWbbBrGDrUFdeomjPqOQrBkg6aoyOStFwe6InacQZgqfiqh SHVji1MA71YoofKWTDY9aqI3wH62mQRozrA9NPbBF9Gu3oyN+j3uEmGgnLH5O24DXUf9 Xt0/dj+VN6Qw7HbM7BCDZkb9g1cxgZ1ZJAbvUt3kTUPCr4/+OILKrg66zPcygV+yvYje u4tTbLOM3gs0g9nrvb6sJJ9zMj67e9ccqbr1Ut16JSgtTpVFW6HgAS0F1A1zpqyyBjMj 9zfR/pb+Q1S6I9jTjdY9pjvrDvr7yFexH8gn5ZY4MzDaoQtfUoFHcMAu2FyQO9SJfRHT P1eA== 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=it3guJ5dFp5vGJJ3WdR2QDpXIeH4iEb/WDqIOW8QOj0=; b=rcnlzHcIx1U4glKYljOk1FWq/4FlKN4kH7Ej7Epnx3Jb1Hswfb3q0yqK2I7x9xhuDG in1nweiAwYV24uRNXI7gHtdQO0vAWHUmukF8Y7sn/GGi3ItrXIV1fbQ3cXj2zeJQ5L0l 82ZZwHYJ27Onx6iolvob71iyi8DdMbZMObRo+l7dJlIpjA+tdydgOHtfZwBQJmYGuUxW 54YOZVJ9MwNLiJn+JTuzMrS2/Kd5+y+bpQDzDxbMZ7Knyf3PdMM7n+9AQnLBCWbyvKr/ B0jLpfz85drOjf7pQSiBsuBlxhs6tmRcDUi9Yb9hL0XEw/h0JA8AZ+BnKVa2nGN369JF qmIQ== X-Gm-Message-State: ANhLgQ33QBuxCQXwP+PJ4cHIjy8Gwn080OpjdAywBgeG6g4yMu9rRAbo o2mihn+bf49RcmVgGCsLjuI= X-Received: by 2002:a17:90a:fc88:: with SMTP id ci8mr1842230pjb.193.1583307747064; Tue, 03 Mar 2020 23:42:27 -0800 (PST) Received: from sh03840pcu.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id k24sm24097374pgm.61.2020.03.03.23.42.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 03 Mar 2020 23:42:26 -0800 (PST) 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: [RESEND PATCH 2/3] mmc: host: sdhci-sprd: Implement the request_atomic() API Date: Wed, 4 Mar 2020 15:42:01 +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. 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 2ab42c5..bddf0f3 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.9.1