Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp3716926ybg; Mon, 28 Oct 2019 18:00:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqxKRBMhsv7QvvyaqpGgluvOYdE81CtOEggx+UuBvMQbAiDFM+/sdCOPQ/dvM95V+lDOrYKR X-Received: by 2002:a50:a227:: with SMTP id 36mr22480160edl.262.1572310829017; Mon, 28 Oct 2019 18:00:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572310829; cv=none; d=google.com; s=arc-20160816; b=XKik8lZVyC5gWrLoSdSxlSNRdiNQzLjKU31/xQn7ag1ec1BzXcccIvpvV8XNs7ngfA Nt+D6qDxU9l1BNlfst5mHOqhlV1wrziwe0MbrZGbzzmuv82jNZtsdY6dv9wrwVpYGdDY UpFF2qNk4Qe0XfeluOw9ZNd7kljJAfZE3LmKjW7GUNoiU2R6xtZ75Q7kEABWJRgtxW93 gr/QVo0yDEa3SJIn6R33fosJ3Qbf3cjmoBAM8ir4K9YcKGk9eCE8E8HWvoRl30TlREVI +rCLxVu7j4fxG40ctxgkFcZ6CC+2RU+yE4aVM4AqTpaAcC6XdlPkqBGQV9dUNq/xv5BU Oj9Q== 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=y5GQvCWqselsWQBd4xW7/3HvEws2FIqrv9MY1yrvWFo=; b=DWrSR9Tt/mTm1vSP5POq+jQ3QT8vCNiV1e1MJdveH40qAd5+hCZvoxvK3aEnpmqzrM 7nPAkpIRpgEXtMJq432fb+QQJjtGi9ss6waLRc7RtVyjUPjfjhKDRshIFZ6ncJo9vU9P kPFtDIaHly2+Vbd8k3XkqZtVA8C1iWFjzX4hQ11/ShrDbzHoT+JoUOMYmAFsbxDTBb4R dQVToPlORoU4mF/cGgBLGolXvuzcQVnIbVjCbGSXXTTKL9JokVEEZvI9Bz70uM+NnuUJ 2zOwWnvR+jg2JA/nSWitJAUVkECvRcWFLNj7WSYkRoGFWlBHHs/6cV/xOJtVezWkAQ24 LkNg== 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 h56si9149096edh.363.2019.10.28.18.00.04; Mon, 28 Oct 2019 18:00:29 -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 S2387805AbfJ1JLV (ORCPT + 99 others); Mon, 28 Oct 2019 05:11:21 -0400 Received: from mga14.intel.com ([192.55.52.115]:41383 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728769AbfJ1JLU (ORCPT ); Mon, 28 Oct 2019 05:11:20 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Oct 2019 02:11:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,239,1569308400"; d="scan'208";a="198026515" Received: from ahunter-desktop.fi.intel.com (HELO [10.237.72.55]) ([10.237.72.55]) by fmsmga008.fm.intel.com with ESMTP; 28 Oct 2019 02:11:17 -0700 Subject: Re: [PATCH v4 2/3] mmc: host: sdhci: Add request_done ops for struct sdhci_ops To: Baolin Wang Cc: Ulf Hansson , asutoshd@codeaurora.org, Orson Zhai , Chunyan Zhang , Arnd Bergmann , Linus Walleij , Vincent Guittot , baolin.wang7@gmail.com, linux-mmc , LKML References: <487c2e45810c6dc6485638474136e375cb567807.1571722391.git.baolin.wang@linaro.org> <50696230-75f4-3de4-7424-c33d531ee159@intel.com> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: <60aabcc6-9def-1472-0e1f-3fec391ef1cd@intel.com> Date: Mon, 28 Oct 2019 11:10:13 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.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 28/10/19 10:38 AM, Baolin Wang wrote: > On Mon, 28 Oct 2019 at 16:27, Baolin Wang wrote: >> >> Hi Adrian, >> >> On Mon, 28 Oct 2019 at 16:20, Adrian Hunter wrote: >>> >>> On 22/10/19 8:58 AM, Baolin Wang wrote: >>>> Add request_done ops for struct sdhci_ops as a preparation in case some >>>> host controllers have different method to complete one request, such as >>>> supporting request completion of MMC software queue. >>>> >>>> Signed-off-by: Baolin Wang >>>> --- >>>> drivers/mmc/host/sdhci.c | 12 ++++++++++-- >>>> drivers/mmc/host/sdhci.h | 2 ++ >>>> 2 files changed, 12 insertions(+), 2 deletions(-) >>>> >>>> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c >>>> index b056400..850241f 100644 >>>> --- a/drivers/mmc/host/sdhci.c >>>> +++ b/drivers/mmc/host/sdhci.c >>>> @@ -2729,7 +2729,10 @@ static bool sdhci_request_done(struct sdhci_host *host) >>>> >>>> spin_unlock_irqrestore(&host->lock, flags); >>>> >>>> - mmc_request_done(host->mmc, mrq); >>>> + if (host->ops->request_done) >>>> + host->ops->request_done(host, mrq); >>> >>> For hsq, couldn't this result in sdhci_request() being called interrupt >>> context here. >> >> Right, now it did not support. >> >>> >>> To prevent that you would need to add a condition to sdhci_defer_done() so >>> it always defers when using hsq. >> >> Yes, but now the condition can be matched in sdhci_defer_done() when >> using hsq. So no need to worry that the sdhci_request() will be called >> in interrupt >> context in this patch set. Thanks. >> > > Wait, sorry, I realized some drivers may not select the > SDHCI_REQ_USE_DMA flag in sdhci_defer_done() when using hsq. OK, So > how about below changes? > > diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c > index 850241f..6c7a396 100644 > --- a/drivers/mmc/host/sdhci.c > +++ b/drivers/mmc/host/sdhci.c > @@ -3035,7 +3035,7 @@ static inline bool sdhci_defer_done(struct > sdhci_host *host, > { > struct mmc_data *data = mrq->data; > > - return host->pending_reset || > + return IS_ENABLED(CONFIG_MMC_HSQ) || host->pending_reset || Just because it is configured does not mean it is used. How about adding a variable host->always_defer_done and set it in sdhci_sprd_probe(). > ((host->flags & SDHCI_REQ_USE_DMA) && data && > data->host_cookie == COOKIE_MAPPED); > } >