Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp3386543ybg; Mon, 28 Oct 2019 12:00:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqzDIME8YvBOZTH4ccOigvulHqjhk+ZJlUs+6SUDkA0WqPA7CC+nAPPSsH4oRDjNt8aUsYeY X-Received: by 2002:a17:906:d214:: with SMTP id w20mr17891120ejz.68.1572289233419; Mon, 28 Oct 2019 12:00:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572289233; cv=none; d=google.com; s=arc-20160816; b=l6EifWugqP6BzJkSvzLBqREGJ2PuPRZdwbZvmYSf+HrugJeJfFeA2/iCnnHNqh55wO lAXxR8dogjb3KwfEM0LuUt9K1FMxB4k/kbpINziLURyv6IQedzFo1ISFxFsway84QMiH fdfNZZZbyMfn79pjjg9UqEgQRw9JZcrUAbVFGDB4W/A1Pd0UcsJy5oD0SHNYFYikZBH+ B+GOSpi+6WKg05N72qdXF7lrV6S6yZvWksmmdghbA9Cy7U24duNK7r8yYJd9+BVHRRRl J0sqVwb9Fwl3SWakEbhDWDTKJZVIZSQ/UAXh3m9c820SBAAqJgkZp5Yn5HGF+uv6BdVX 6Elg== 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 :in-reply-to:references:mime-version:dkim-signature; bh=OT9vPn7ycGD7jBjGQjG9ZHBs+GjEiewGN8zg5+tO7oY=; b=FWoo8ilR32foLQr30qhpFCmhYIANYh6qqiW9vLNJFmeIfFUtNgiEVdh38t1Aj2p7ID NJ+2WCN5vG/gQV3ng6ueYn4K0TiOqLJ8mRYjAJdnNcUE/9cK282BCKGh2dxSu1ypVJ0l Yq1HmJzM49+fZCaIsiUedubrIXF0poSnrVKqiXeNU4WEju7cZUPB4lL0GCGi4xnXy7JD cE/8eV6ZnFJ03tHsGY35csjtqzdLv7MTK6FNaDrgiRuopUxQKytUDHyBcJZcFrsvf/mF C5mr9OVmY4H/45862mN2qgAvNi2WOL4kI+XQEkkKJB09QmB9fNOkkS0zGfdaEnIM8Ex+ aZgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lmWK048t; 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 f13si8317947eda.288.2019.10.28.12.00.08; Mon, 28 Oct 2019 12:00:33 -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=@gmail.com header.s=20161025 header.b=lmWK048t; 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 S2387863AbfJ1JPn (ORCPT + 99 others); Mon, 28 Oct 2019 05:15:43 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:34642 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727664AbfJ1JPn (ORCPT ); Mon, 28 Oct 2019 05:15:43 -0400 Received: by mail-qk1-f193.google.com with SMTP id c25so1573884qkk.1; Mon, 28 Oct 2019 02:15:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OT9vPn7ycGD7jBjGQjG9ZHBs+GjEiewGN8zg5+tO7oY=; b=lmWK048tWPiLv2pOVdnF9PqCQUVr4N5gJNqTaqBojtv+qbIOpKBtZZTTJFEeYMcAmd dwl7iI66sosJV6h5tmEmdVyIKvIEQ01QFD4om9+g/x8aL3V5+OjhqBoza6KfaYYYHoqo /Hd+CnQs2s09wwBkm+QK8mfpVbw89LE2MtT0YZoyftLIuJC6K4yLgpq6/M66aBg9/9Lo qt1QjIhvUng/xxUPzsT+b3FnIfxKIUAN3JyfoMeDddX79n0WZBNAwiolZ509Okk7UyLz WeXpXgStdF198MTF2pI21AUtcIKQCZMrIdpVQQWc8JYBg7fq1IZq8nExtF1VlDpBtX8y ngzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OT9vPn7ycGD7jBjGQjG9ZHBs+GjEiewGN8zg5+tO7oY=; b=I9e2Xniq6Jh1CZg+giWPa4TiFiEexi8yoWBzsBTK9P1DGVZDUhAW/HtvsiZiUsesPr Ig76sIuVLcwNbjmhAhtcn9QQ8RSb+hp36Xju9Roniqh3KsZyZFbiBWjUgNGktgQd32C0 utencHxEiXyFz0i6b0OxHmFo+aUykxEmTh2OTh1f+wpxT/lrISMqsamLXLLw7BAmBqt6 PXAP4T9/qvmy+ZjalAJqzdAgNghOg4A4pr/83KNkTPm+KIU5F4YjgoVy4kVK4P/YL4TX trZCNMvf5nj8iJtl9AUDdvLcyyRGlAKUVe64pPOdrKeTSR+INjU/VJ6k7/m0Fha4daKf hDEw== X-Gm-Message-State: APjAAAVX5lmTkgb860wubmWAWRzoGgfWRR+BtHPRz7JOV3whu5k/gFqa x5pomIGsailffKS9hg8So3tPPnTXPdX7ICZRpSk= X-Received: by 2002:a37:ab04:: with SMTP id u4mr15165699qke.114.1572254142067; Mon, 28 Oct 2019 02:15:42 -0700 (PDT) MIME-Version: 1.0 References: <487c2e45810c6dc6485638474136e375cb567807.1571722391.git.baolin.wang@linaro.org> <50696230-75f4-3de4-7424-c33d531ee159@intel.com> <60aabcc6-9def-1472-0e1f-3fec391ef1cd@intel.com> In-Reply-To: <60aabcc6-9def-1472-0e1f-3fec391ef1cd@intel.com> From: Baolin Wang Date: Mon, 28 Oct 2019 17:15: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: Baolin Wang , Ulf Hansson , asutoshd@codeaurora.org, Orson Zhai , Chunyan Zhang , Arnd Bergmann , Linus Walleij , Vincent Guittot , 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, Oct 28, 2019 at 5:11 PM Adrian Hunter wrote: > > 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(). Sure, sounds reasonable to me. Thanks.