Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5215289ybe; Mon, 9 Sep 2019 23:42:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqxAm/r/1p6iyK7tTX1fSqBPmBoHDY5qqpkBUNOZM12KnwtNrzthbcH+WzLonS2bxGRW81ec X-Received: by 2002:a50:c209:: with SMTP id n9mr28756713edf.215.1568097741160; Mon, 09 Sep 2019 23:42:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568097741; cv=none; d=google.com; s=arc-20160816; b=kSyZYTfnV3qoypkreFou3i3/4+9eUrrlRsNgBRB8XlK7gWF+rworLh7EFEPublaQXq eJcXZL0N1F+ZmyRJSSUFRBl8C2x2Y/lwJKmQtqzD5MIqixM+n+mo7nyNB3JU+Z20M/Xm ciVUbw49l+kY2ym0sc6Oj6WCwjiy+W1libix2sRx+vbR8d6S2pZWH1VbBdBBkR+Z7tTx yuCfgcfk254N+plKTsYaPzmJDYcr9ZhcqP55gX25YmzFYFlmluxR+EZEOQf7BKlf9HpX bYRfzG4K30uCm1m4KiRKVwCRBpGnIKi8IdRAAICAu/p2DrtSV1+4E03b6vZUne1VDphW cA+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject; bh=kq+Y26ZiZEM0Zldn0T146Ke7jwYkgDL4msYCrP0OzFE=; b=xafofx8NnomY01j0dRGVzQBryTtjfnHmx8pPOF658hlgFCu+ISgRiNqfrYux9MYi8Q al5/UdKkeOMqzHbv4mdudBdH3/oYvvN4foNMYqB3nOKwVF5xAngipm2UxGGlDkPbqCnC Sm9RvTlvAQFaXMytcn+WNjLD9y276XIh9OidU2piItFYIoRA7IROhNELlwT47BuuF6ns JKBQ40nl7gk9bp4xS/i1By6L6d2qkOV4q9dJAls+vFB5Zy3WbRZRRwC/jwBhxCvBsdVW ghv+fQ35Lj5qloi7PHSEf5Oqpi8SeRyGqhlBQ/g/U5LVRJ6UOBn4zSSVM5gQhhQU9REX /E7A== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v22si8635770ejx.54.2019.09.09.23.41.56; Mon, 09 Sep 2019 23:42:21 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404672AbfIIMEq (ORCPT + 99 others); Mon, 9 Sep 2019 08:04:46 -0400 Received: from mga02.intel.com ([134.134.136.20]:57866 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404215AbfIIMEq (ORCPT ); Mon, 9 Sep 2019 08:04:46 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Sep 2019 05:04:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,484,1559545200"; d="scan'208";a="383955125" Received: from ahunter-desktop.fi.intel.com (HELO [10.237.72.66]) ([10.237.72.66]) by fmsmga005.fm.intel.com with ESMTP; 09 Sep 2019 05:04:42 -0700 Subject: Re: [PATCH 4/4] mmc: host: sdhci: Add virtual command queue support To: Baolin Wang , 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, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org References: From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: <5594efd0-6076-bbb5-5aec-a6b3a21dd7ca@intel.com> Date: Mon, 9 Sep 2019 15:03:32 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/09/19 6:52 AM, Baolin Wang wrote: > Add cqhci_virt_finalize_request() to help to complete a request > from virtual command queue. > > Signed-off-by: Baolin Wang > --- > drivers/mmc/host/sdhci.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c > index 4e9ebc8..fb5983e 100644 > --- a/drivers/mmc/host/sdhci.c > +++ b/drivers/mmc/host/sdhci.c > @@ -32,6 +32,7 @@ > #include > > #include "sdhci.h" > +#include "cqhci.h" > > #define DRIVER_NAME "sdhci" > > @@ -2710,7 +2711,8 @@ static bool sdhci_request_done(struct sdhci_host *host) > > spin_unlock_irqrestore(&host->lock, flags); > > - mmc_request_done(host->mmc, mrq); > + if (!cqhci_virt_finalize_request(host->mmc, mrq)) > + mmc_request_done(host->mmc, mrq); Please add a sdhci_ops callback for request->done then: if (host->ops->request_done) host->ops->request_done(host, mrq); else mmc_request_done(host->mmc, mrq); > > return false; > } > @@ -3133,7 +3135,8 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id) > > /* Process mrqs ready for immediate completion */ > for (i = 0; i < SDHCI_MAX_MRQS; i++) { > - if (mrqs_done[i]) > + if (mrqs_done[i] && > + !cqhci_virt_finalize_request(host->mmc, mrqs_done[i])) sdhci does not support calling mmc->ops->request in interrupt context. So probably, you should avoid immediate completion. > mmc_request_done(host->mmc, mrqs_done[i]); > } > >