From patchwork Tue Oct 29 05:43:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 177982 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp4376156ill; Mon, 28 Oct 2019 22:44:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqycnM8SsPTAvSkYJzNkmKxB/2sER5f9XMpm7gKPc+oe2eLyLC2A3dPCMCzw9pRMlkl9fqZm X-Received: by 2002:a50:91f6:: with SMTP id h51mr23290815eda.99.1572327862674; Mon, 28 Oct 2019 22:44:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572327862; cv=none; d=google.com; s=arc-20160816; b=cEtZ5U7FdvLTL10WRBBTixNacd9FJ/U56vbynCA0mx9wwaYdz28QfArMree5OvEIeS RWa1UweJPibE8rzPmQ+t267L8J6T/JrLOUbB3mXO6ppzUv3MV8jy7a+bVvpt2QGMc0w2 EYSzOhQLn+yyBWGGNj6gDu0WGqdwBDZWyGFMDASNRrgaNs8lpxj8DgUs4jWMopPL4aCt KoxiSOEVW7viVhbw2CrRHXHwXwHe4ilHANUxrMabJz425LZPqAGeygWC4xbwOAbbO9X+ 5QLSQ4lVLDpEVOD50F7coCz581Lxpsaj+1XH0q/+IkqNQTRAg9WHpoVt06e0gir35Hsx qpyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=ILB8a88XETD+WUMe0JJMqsMts/FAHmPFp1FBBYuuKZE=; b=O4dJrcUKYl3IWa7+TeFnHVDSmb6/jMHuBs8XYlyPqZM3izFVXqc7k9Rmti0vCOvDO8 Coh4E9a2g2R+Rusa12TgdpNzl1vhQyGOqlmA3HrKARtBSdE1D6rsrAUTvZPaJ3QVpS7+ LMHgd5FgFixM1zMbf1MCYLn/CygI0EaNpcsn6Cvt1MiemI+GQ6tBOjx2iFPYOZMAw9AR vdxXief56O40OSvHKGP+NwDLDum5IpA45QcfetXxnlzhMVGlipwRsgzkKlrnC6ZB/Cym ITm2X1winSpByjSWWXJT/qndTYmoD/+fkWLQ90XjIUdoyjckjujtok1he4aTaO2CcC1M UVfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gmuv+cyr; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-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 h3si8659870edd.54.2019.10.28.22.44.22; Mon, 28 Oct 2019 22:44:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mmc-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=gmuv+cyr; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-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 S1732141AbfJ2FoV (ORCPT + 5 others); Tue, 29 Oct 2019 01:44:21 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:38693 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732103AbfJ2FoV (ORCPT ); Tue, 29 Oct 2019 01:44:21 -0400 Received: by mail-pf1-f194.google.com with SMTP id c13so8735608pfp.5 for ; Mon, 28 Oct 2019 22:44:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=ILB8a88XETD+WUMe0JJMqsMts/FAHmPFp1FBBYuuKZE=; b=gmuv+cyr7iHWELt6YHpGGTGNrHr/dSHU9vseTrEDPPehaRYVKqTt12YSkaQPzUpXq8 44+HvgIGJjd1BkTc0S/DKdleOZJ54mGsJK2dM1a1Fk5K0jfNOWLHQzNKe4iJnuVsr555 bnvFspkeCwM92tzJVGBV/M66crEo5mN+6MJ96Q4VhbofCEfXXYbz/bgzbMoo0bMWPGSP UO/KHyK5aadFe1VjRIfLnekNaW9j3tq5JClHAWTCVMZbBmSQM3Dkp7XaNeRmu3fEcSNC taTNxGVCKrpg6PEvzUrGkoX6Nf2sHFTsQriiGQKngj4wI8ZBSyTwFO7/Sctgf2jCvkhM roZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=ILB8a88XETD+WUMe0JJMqsMts/FAHmPFp1FBBYuuKZE=; b=Za7CdpMdyAxb1jDj30qmcVtNm7Cyp25+tBtiVuomKzfx8T71L85n/28Du0fTjCDfq+ 0DafNFVpN+bgWdcyhqJYiCWY6DvNW1ciKtj8f5p4mpOAivfheTpFfwDmeoDFWGAkMMfw pkAE1LSXNLLi246MY44s4WbgZQXuNZalKW6LtrwzRIJ4hqyBAzrsQ484LUko7Zxswi8I p8ZhFYsRU8wYY4wDFuux8asqH4Y2LVM7EGJWB3uT8U7ZGq0Qe9DmureMhsdse0tbSnkb q4nJSHm1CC0G6sS1QfW1hnmK2FTELIttLrbfqXmNE0nLkiSwRc3HD85yAQmvOMfU69AD 7ldA== X-Gm-Message-State: APjAAAUCOWtoyaxj1ORyNZtjiJ+2x8YXiQpf0rhvaWauXtjbbwldvO7G pIsboNjNTlB5hsymBkySVqPYvQ== X-Received: by 2002:a17:90a:a416:: with SMTP id y22mr4000686pjp.74.1572327860555; Mon, 28 Oct 2019 22:44:20 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id j25sm12026231pfi.113.2019.10.28.22.44.16 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 28 Oct 2019 22:44:19 -0700 (PDT) From: Baolin Wang To: adrian.hunter@intel.com, 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, baolin.wang7@gmail.com, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 2/4] mmc: host: sdhci: Add request_done ops for struct sdhci_ops Date: Tue, 29 Oct 2019 13:43:20 +0800 Message-Id: <94603120e6431f0ce35af78935bfe7dddda4850b.1572326519.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org 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 --- drivers/mmc/host/sdhci.c | 12 ++++++++++-- drivers/mmc/host/sdhci.h | 2 ++ 2 files changed, 12 insertions(+), 2 deletions(-) -- 1.7.9.5 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