From patchwork Tue Oct 22 05:58:56 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: 177144 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp4388253ill; Mon, 21 Oct 2019 22:59:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqwTopF5MgeCPCyiosusy0HmZU0/ac6ykc0c6BWclLhnr9PDKIj2mMAHc6btqdRBc9JTHuam X-Received: by 2002:a17:906:1505:: with SMTP id b5mr26160152ejd.195.1571723990051; Mon, 21 Oct 2019 22:59:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571723990; cv=none; d=google.com; s=arc-20160816; b=CzKtrSPEAW40IOutHmT0un2VWerQ1sPEErVPDsRByxdYqnBz2dacTJ8O0F6GDqYPu7 NhPreAmF7VggXbwTU0l9xZInNa5kXIQVDerFt8xpWOdDx0Kwnh/7Tvnn+mrJYyuHx7rW Pt92y5LZrU0cwtQli47TzM/tb9KAG7i5HxDiUR8iz0u5OHhpsPyZwQ/b/gms30R9TfLQ QYSFC0+GGUNwxWGE2mMKX6Xj9GUrRh0Vf1XKXnfdo03KIU7XSpO8E10HptvcSpZQab9K +0N1rKGgLZh3syOpj1qemgHrKAmlst/V82aA0MkXOGP3YH40SA2K27X3DBRvTSSCR/It 57Gg== 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=Q+dD7SDiYlVD6Sc0bdXrYVpCbKQT7CpksShngsf10n4=; b=YfVkr19v5FzhjfdV5FA03Z4iz/2HFRcO1YswNGQ7K8X/pYioooSfydKGwarENpswXx x/mBwcCDG4ZmJONsERWaG6Ozoj69pN9pQeMxOU9G03pI495dWpALgK8YEUIw+OP8kmBr fWFXGu2oOFnhRyU+BOJD4I2IgOClpaY1mP5oI3HHwsVIrkH8TjKuNbm8siTcLelDUyAb OjT7aXw8C47cC0aTPeNN4BBK9PDej9MgwqPaysr/oQydfwLE2dD7IpYplCRP7xP8DL0d Ujc3BLjA3O9g5umc9qYDf7KIJJKvT5RJ2OcXCKynEtNnNuZjDUcZffQMV55trKKc5Zq7 2nbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jzHW8+vI; 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 f6si4283591edb.431.2019.10.21.22.59.48; Mon, 21 Oct 2019 22:59:50 -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=jzHW8+vI; 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 S1731062AbfJVF7q (ORCPT + 5 others); Tue, 22 Oct 2019 01:59:46 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:46550 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731061AbfJVF7q (ORCPT ); Tue, 22 Oct 2019 01:59:46 -0400 Received: by mail-pg1-f196.google.com with SMTP id e15so9248384pgu.13 for ; Mon, 21 Oct 2019 22:59:45 -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=Q+dD7SDiYlVD6Sc0bdXrYVpCbKQT7CpksShngsf10n4=; b=jzHW8+vI149qZcAXl1BLh2d+7rAiaEf9Xsk0ubikjui60VmrzoYYeviqFT9nGhoNBV DFcjnknB1Yr6EiMvXFKQBPJwDG78HAl2Hs2UL76QRE0O5Fn0sKnJKO8mFXX0BTu7X2sA 2EGMVMi3OKTTut6Z3KKELGJ/UhSIXu5aZeWzf6/maX+4mWezfiVUvJYxZDkkFzajFiyh QHjgK1XJNzHDw1xKeHJ8QjvCL5Qmn3382s8jl7uTEcKunf04VAfqM130s0y2Un/VVfxZ iQDT6ORcSeMA+m1LKNJM1yqy9zg+kKcBqAjr77lOT6B4Q8NbXBVjd2gOEaeWYcFUQ738 WPLw== 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=Q+dD7SDiYlVD6Sc0bdXrYVpCbKQT7CpksShngsf10n4=; b=RQeCDTYfGz0hqK2rUsiDLav/F1KRXlSDV+zRhrdSbAtNtLvZg1okKHXEolDUbvRwZV VAhxCMntjZJuAMltsZTvn4rHt2JPxx26qyI4y4d0N4chgyGD1zu0csTIOUdukTwbi7kN EE/EMBrhYWJEsAKqdUyvn/Ki4sSbYR3xnQGAVgm8LLxnLAkPK5mAxHd7IhVf3gLEFTfQ pLFhVMSzTkKuzK626F3TsjYAjTCAuDd+bbfmz6FJMK0hF0Gu+5MIp/eJuKSzqf1jVUkD te5tWr2awfJmt8yfww5iYClnLqAeaXZsOwcVYBtzJg6tyPw3vnDmtqnnPYfYHEs8FxFb qTUw== X-Gm-Message-State: APjAAAXvmlJoqHj4qsjg2EKxlFQ58E99TryaaNcd7ePMXh8jc3knZyjO 6V5iqOyaBkmamMVGX+w3flCI2A== X-Received: by 2002:aa7:980c:: with SMTP id e12mr713579pfl.165.1571723985443; Mon, 21 Oct 2019 22:59:45 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id g35sm16568061pgg.42.2019.10.21.22.59.41 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 21 Oct 2019 22:59:44 -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 v4 2/3] mmc: host: sdhci: Add request_done ops for struct sdhci_ops Date: Tue, 22 Oct 2019 13:58:56 +0800 Message-Id: <487c2e45810c6dc6485638474136e375cb567807.1571722391.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. 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