Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp3710244ybg; Mon, 28 Oct 2019 17:51:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqxK74oA1G4jqXztlO3Mj8BbYirUz02qq7iEBlKCEgtsu/AoYIxYKJgqfGb4Tb9uZgUvs188 X-Received: by 2002:a17:906:7d2:: with SMTP id m18mr717017ejc.94.1572310275754; Mon, 28 Oct 2019 17:51:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572310275; cv=none; d=google.com; s=arc-20160816; b=HFnflHFJTorsPg/XAC8eqcosLYKGcWLly23QcrabwlJBNP4IJl4pDVoHbffIIxxpKR ed/3HF1wqDQ0izZxe5zUqLyeP0spw5hdns0xAwZlEdIGo0I9CnC2YSjaOZq3ELbqA1hH 89huyzfSExRnsi2dXQ+3drDIvYCp3dJVlGqLifwuelDN7s8PtYRlgBrvXPEjaHpktf27 xLayjY4eVcJu5xkP3qid7opGppUqCGtxlZI9BkTtDg+77Y8bcKkZanzeGwfWOnEL1gCe gHQ/QNnlo5j920xqe6JfXxbEIRK3xTyJ3WeCtGslwWOcGv8TjN5lFL4DU8E82Jy/HTLF 0/+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature; bh=sJhXv+RSZzOsSYOJixMisy55xtTod89sHuqzMfjcn/8=; b=OIKirFj5WUTGAjR5xl40XL2OO3TUf+f8aKEnDaD5VPIVFjeZ5WFNf3iNwXjOgSxa9Q vNG6g4gG52zyK0vx8WaYARgGf6EZW4zB1UCzKywjH+NGQ0j5JMl3dbnu0fc5zqH0wcXv GxLV/8QBsrskuRaLZEeclwW7DpIcRM6Mn3Vj5ZmuWe30HMY7UPyLXP6sh6TOsguCv/Ji 9xk6CUE9qBlTzO4OpX4b+3/l+2W7YIVhPoVcjjU2ae8okC2fe5z92RIGf5dFBqfyZ+r2 MIVYSKBgOKhA7frl5lFw8KNstcDiFlSMiW87XvtCThXGnM9eSrrbV/FB/jpAoPAVW6cd E/6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=E2ktVfop; 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=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 p20si7284211ejj.394.2019.10.28.17.50.40; Mon, 28 Oct 2019 17:51:15 -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; dkim=pass header.i=@linaro.org header.s=google header.b=E2ktVfop; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387579AbfJ1Iid (ORCPT + 99 others); Mon, 28 Oct 2019 04:38:33 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:42925 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731611AbfJ1Iid (ORCPT ); Mon, 28 Oct 2019 04:38:33 -0400 Received: by mail-lj1-f193.google.com with SMTP id a21so10313288ljh.9 for ; Mon, 28 Oct 2019 01:38:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=sJhXv+RSZzOsSYOJixMisy55xtTod89sHuqzMfjcn/8=; b=E2ktVfopWlTdW+GF2hnC8gVeuKOxzoN+mGuqRzwgDsiIR61NWbbtMhHssxueI/P7cR 70+CDN1o2KfAkOXRO9DCcoIxrzWF00wBvnvQHPAtkIFfVhChRvWPfGiquyfHS3ZQe2xX SPhSzhsxp8yYjTOGxo7W4CTqMNJp2v/muWEg/HDoROaDbbSI91fPEIyQN4ZE5xGhThMV yxhQHK3Hrn7j8VO8NdTfRtr/bHYVx2nu1UyAfRSzdId24LwBhLNDPgghX4c5AJ/B72DL pdHWzhCFRFJdGOjR8ISlhw6EpX5DwKkOQ+ZuvbXAuDVRJZ4OScCbxBFNxfINv3HjaZma x8aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=sJhXv+RSZzOsSYOJixMisy55xtTod89sHuqzMfjcn/8=; b=esjEJjQpznDOqlp5Il7ouFN3bjsXSV1YKdBjvOBBWiGViYOcLf0pjuBF0BKAdqxtQS 6fKWqB3kM4CjswANolXZS+8bhUnLgJu5y3W0ZZn7+00a2hESQ4ttWU2MJxuhiwgWK1En f7PIlZ0TDrHxOw+OkPGJFgUNuUfgzi5L45n+p1aM6Xe17Uxzwh3qGOHAs0t03jItRK// IEpxfohESJ/2KVf+O5458n17AJfOPh9eWFoI6rOEHRBMcwOrichaNkYIat5vfebFw7V2 HLKB/hMavZR2x73Ky/TN992NboptQvH7jLstVWqJMhjUBhtJx03F0+5DDrMhuu45WCO9 WgCA== X-Gm-Message-State: APjAAAUzHmCeLuUnC92iC35ADAFyZesv4rnKbVRxWWMt612n86zIylT8 0ZG7SverUjNBo3PgDgqCkcPyiG08hgOFmxoj3J+nlA== X-Received: by 2002:a2e:9117:: with SMTP id m23mr11025548ljg.82.1572251911249; Mon, 28 Oct 2019 01:38:31 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac2:4296:0:0:0:0:0 with HTTP; Mon, 28 Oct 2019 01:38:30 -0700 (PDT) In-Reply-To: References: <487c2e45810c6dc6485638474136e375cb567807.1571722391.git.baolin.wang@linaro.org> <50696230-75f4-3de4-7424-c33d531ee159@intel.com> From: Baolin Wang Date: Mon, 28 Oct 2019 16:38:30 +0800 Message-ID: Subject: Re: [PATCH v4 2/3] mmc: host: sdhci: Add request_done ops for struct sdhci_ops To: Adrian Hunter Cc: Ulf Hansson , asutoshd@codeaurora.org, Orson Zhai , Chunyan Zhang , Arnd Bergmann , Linus Walleij , Vincent Guittot , baolin.wang7@gmail.com, linux-mmc , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 || ((host->flags & SDHCI_REQ_USE_DMA) && data && data->host_cookie == COOKIE_MAPPED); } -- Baolin Wang Best Regards