From patchwork Fri Sep 6 03:52:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 173191 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp180042ilq; Thu, 5 Sep 2019 20:52:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqyngrP/6GkbL3x70gkjlDo0id9h+RFSzLQALQcj7IwWbkvtNdBoOV4vpBdr27OfavnfVkDN X-Received: by 2002:a62:834c:: with SMTP id h73mr8326747pfe.183.1567741977311; Thu, 05 Sep 2019 20:52:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567741977; cv=none; d=google.com; s=arc-20160816; b=pZblFsb5XCa4Vti7gBqa92uD/aVd8lMbeK1I7nU7eKCtk8VZY03yEiBrDAqDOi+/Ky I3/kJVaccluxiP/tTT8GmZ6aBLaNO6RnrOZ3j+cidwiPz11uHlO7xKcLfvQ6izNQ+Dvi kjl0pSSXIi6gaPJjURCRfstUWAYSLR5xpmvkqNDAokJlIulNkHTSq0VkJAdMcR8zlm9V 0WOgBLdD/eP3IAya/l2CuB0uuK4NAHc9UPXbz4VXTMLAYgKWqqc6Z8AJlSNNtth8n+hI ObSm+J7pNCTFKTAXnLzwDE0kauRY0QTijYXXJwa3dtLZDPAq9s7uY1FwiK0DGlVrx0AO zmHQ== 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=EBpVgRZKtjnDtjrwrB9mrGRM/gKC++RB5oNke1k5+K0=; b=hrrwBPfSWS/Xqya40nVVBG8SAl5TelPjtznXgX/2jdS65+8gCamtmzItD29hMz/t+K fFW1JBWDOLyN7Q6JOQOtJlKgxCA7YqkqDMbVW3MPOCsKfzVHpzVRJE+E7KZQr3kHnxQ0 RMD1tg/A6ueOF/6hDcDIySK4DpDEikpynmwKR5k8OYf0LrRMWNNVifJK+RRO/AbSaKFv NPZharWHrUi2q3q1VSINLr2uaK8d0CsOzYy8DPBWNkbKr/o4Loj3eUyYsnsSnXKRMtc3 u9EabFRXtDDZJ4bdqlvZLcwgEbzFpQlspxNzXWDHqvuHprQu3RO5HwA/Wsy4SmwFX16K VzOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WlFs3zRf; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k190si3359438pge.308.2019.09.05.20.52.57; Thu, 05 Sep 2019 20:52:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mmc-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=@linaro.org header.s=google header.b=WlFs3zRf; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392215AbfIFDwz (ORCPT + 5 others); Thu, 5 Sep 2019 23:52:55 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:45312 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392213AbfIFDwy (ORCPT ); Thu, 5 Sep 2019 23:52:54 -0400 Received: by mail-pf1-f195.google.com with SMTP id y72so3369600pfb.12 for ; Thu, 05 Sep 2019 20:52:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=EBpVgRZKtjnDtjrwrB9mrGRM/gKC++RB5oNke1k5+K0=; b=WlFs3zRfTQzKlu/iTvwfrRb3LuO9bpKb7bMRAP3fFRCTTBU+Kpu/QJmmZ2wV7wARkt ikgPokG0OUliflF0l2MBe+3TRb/midzsick+m+wP93enWtA/Ol0+RdyoH7u/3oT8rTJs WOhrOW+CZAKbT1i2Xx8LF1n4RbR12BrxQ/OPXBxqyHPEzukJPwXycPHN1FjkKTEqiFQE l4nuN02Ats9HX8x21emOXHkoOmAlhjwdKErjdpHYQl1M5rJrbt9i2IYm+vkzx51s1/N1 BO3QYiec+jkUxUM9/7YGWrHy9s0t1H6YSs0T7lerdoPRUpjp7JD4Wmo+wP6LIlZIyqYL 76Xw== 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=EBpVgRZKtjnDtjrwrB9mrGRM/gKC++RB5oNke1k5+K0=; b=dPj5YdfqNOyME7joqQneaM6uxNcPkkLKuDzSY386Hg9OZEUBg8KiUNrrYUi/Mb+cbS BA16C2ezrsUmxTT+NFDYajD2TXrxnQuFvmxBuXPk0b+pjfdELvdKFwQhBmjpaYwurv1r s/hvyqxS9td/E3CB6iCoRo3LWzb2WCwDBKrOKe2JV2U9HNh6JyIhxPmbH/KkT99xGFdJ TQob7cmDUvn5qagR25xCENb+lbnEBHiKwwlgCr+7RG6z05Q6r1iPHNkZcB19NkF7Pa9d HxAzjtquQPpfFSV+LYvZ2t08JPkyqGPRNzLlVpGQj21kH3Vb2srKvUIbHMIT10oMJd3Q l1+A== X-Gm-Message-State: APjAAAWkCb2MaNpevlvOfvqpPLGefGA1fwSSZFJdcK2XfCVvK4AVrQ7t y9Imjo/W54zravCWplhm/XCPzw== X-Received: by 2002:a17:90a:e397:: with SMTP id b23mr7339960pjz.140.1567741973694; Thu, 05 Sep 2019 20:52:53 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id j7sm4205770pfi.96.2019.09.05.20.52.49 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 05 Sep 2019 20:52:53 -0700 (PDT) From: Baolin Wang To: adrian.hunter@intel.com, ulf.hansson@linaro.org, riteshh@codeaurora.org, asutoshd@codeaurora.org Cc: orsonzhai@gmail.com, zhang.lyra@gmail.com, arnd@arndb.de, linus.walleij@linaro.org, vincent.guittot@linaro.org, baolin.wang@linaro.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/4] mmc: host: sdhci-sprd: Add virtual command queue support Date: Fri, 6 Sep 2019 11:52:01 +0800 Message-Id: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org Add virtual command queue support. Signed-off-by: Baolin Wang --- drivers/mmc/host/Kconfig | 1 + drivers/mmc/host/sdhci-sprd.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) -- 1.7.9.5 diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig index e2a12c3..851e947 100644 --- a/drivers/mmc/host/Kconfig +++ b/drivers/mmc/host/Kconfig @@ -619,6 +619,7 @@ config MMC_SDHCI_SPRD depends on ARCH_SPRD depends on MMC_SDHCI_PLTFM select MMC_SDHCI_IO_ACCESSORS + select MMC_VIRTUAL_CQHCI help This selects the SDIO Host Controller in Spreadtrum SoCs, this driver supports R11(IP version: R11P0). diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c index 19a2104..ff4886a3 100644 --- a/drivers/mmc/host/sdhci-sprd.c +++ b/drivers/mmc/host/sdhci-sprd.c @@ -19,6 +19,7 @@ #include #include "sdhci-pltfm.h" +#include "cqhci.h" /* SDHCI_ARGUMENT2 register high 16bit */ #define SDHCI_SPRD_ARG2_STUFF GENMASK(31, 16) @@ -515,6 +516,7 @@ static int sdhci_sprd_probe(struct platform_device *pdev) { struct sdhci_host *host; struct sdhci_sprd_host *sprd_host; + struct cqhci_host *cqv_host; struct clk *clk; int ret = 0; @@ -625,6 +627,17 @@ static int sdhci_sprd_probe(struct platform_device *pdev) sprd_host->flags = host->flags; + cqv_host = devm_kzalloc(&pdev->dev, + sizeof(*cqv_host), GFP_KERNEL); + if (!cqv_host) { + ret = -ENOMEM; + goto err_cleanup_host; + } + + ret = cqhci_virt_init(cqv_host, host->mmc); + if (ret) + goto err_cleanup_host; + ret = __sdhci_add_host(host); if (ret) goto err_cleanup_host; @@ -685,6 +698,7 @@ static int sdhci_sprd_runtime_suspend(struct device *dev) struct sdhci_host *host = dev_get_drvdata(dev); struct sdhci_sprd_host *sprd_host = TO_SPRD_HOST(host); + cqhci_virt_suspend(host->mmc); sdhci_runtime_suspend_host(host); clk_disable_unprepare(sprd_host->clk_sdio); @@ -713,6 +727,8 @@ static int sdhci_sprd_runtime_resume(struct device *dev) goto clk_disable; sdhci_runtime_resume_host(host, 1); + cqhci_virt_resume(host->mmc); + return 0; clk_disable: