From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1B3EC432C0 for ; Fri, 22 Nov 2019 12:14:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7DF302068F for ; Fri, 22 Nov 2019 12:14:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727479AbfKVMOX (ORCPT ); Fri, 22 Nov 2019 07:14:23 -0500 Received: from mga14.intel.com ([192.55.52.115]:50521 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726620AbfKVMOX (ORCPT ); Fri, 22 Nov 2019 07:14:23 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Nov 2019 04:14:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,229,1571727600"; d="scan'208";a="216354395" Received: from ahunter-desktop.fi.intel.com (HELO [10.237.72.70]) ([10.237.72.70]) by fmsmga001.fm.intel.com with ESMTP; 22 Nov 2019 04:14:18 -0800 Subject: Re: [PATCH v7 2/4] mmc: host: sdhci: Add request_done ops for struct sdhci_ops To: Baolin Wang , ulf.hansson@linaro.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 References: <2f16c4f2b98474b79584e0bf338ebb6fb4f6617d.1574073572.git.baolin.wang7@gmail.com> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: <8f5adf0c-bd92-db11-bea0-8856d49395f8@intel.com> Date: Fri, 22 Nov 2019 14:13:23 +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: <2f16c4f2b98474b79584e0bf338ebb6fb4f6617d.1574073572.git.baolin.wang7@gmail.com> 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 18/11/19 12:43 PM, Baolin Wang wrote: > From: Baolin Wang > > 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. > > Suggested-by: Adrian Hunter > Signed-off-by: Baolin Wang > Signed-off-by: Baolin Wang Acked-by: Adrian Hunter > --- > 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); > + else > + mmc_request_done(host->mmc, mrq); > > return false; > } > @@ -3157,7 +3160,12 @@ 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]) > + continue; > + > + if (host->ops->request_done) > + host->ops->request_done(host, mrqs_done[i]); > + else > mmc_request_done(host->mmc, mrqs_done[i]); > } > > diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h > index 0ed3e0e..d89cdb9 100644 > --- a/drivers/mmc/host/sdhci.h > +++ b/drivers/mmc/host/sdhci.h > @@ -644,6 +644,8 @@ struct sdhci_ops { > void (*voltage_switch)(struct sdhci_host *host); > void (*adma_write_desc)(struct sdhci_host *host, void **desc, > dma_addr_t addr, int len, unsigned int cmd); > + void (*request_done)(struct sdhci_host *host, > + struct mmc_request *mrq); > }; > > #ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS >