Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp242581ybv; Wed, 5 Feb 2020 04:52:57 -0800 (PST) X-Google-Smtp-Source: APXvYqyiRRGsNZyFqCDsEHkMRFCOtcZsiteJ8aLGbmU1AYOTcSsBcvom8b9ojobS/afxFOL4smx9 X-Received: by 2002:aca:bb54:: with SMTP id l81mr2568363oif.175.1580907177031; Wed, 05 Feb 2020 04:52:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580907177; cv=none; d=google.com; s=arc-20160816; b=kOc9BIAYlljOIQqACraUSn8umG3qB0ZxGU9PbI7gm4FdZd/mT1znBnUwqJa4D7leLO BGzNfwTapticAS5r88OAvpYqdOPLo3qAbl1rnN5MEWcqc0rqDt1lqZyseii3ye6QXr1W XaXOYiMWz/GvFhxuCYaAQBiTvH+gNGTGiJ+0oo7MXA9owrRcGRzxhNOCzzRswQc9QTe6 MUtAkGw/22hK2suisRTL0ifM9Zeh6ycXGOsa7ufy9lGUDM17jpYq+NnkXv8RoWzKVtAB M9BaxH2mvf2O3ypnAAisaOqTlL6Ax3hWijKHC8cdGAfxxJfU3coyLFzy6MO3l8cGD8mr qREA== 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=6hpkny8N/XZM7wZK5JpvEfe2AHXPpO8aqNteI1qybns=; b=uPX9Db0gSYLreQt7ZshRGd/BQBWABOEIjkpRJrGis9kIDg3ISSPkt4hVpEtL8kL7oM wYeoXmo4uPyJRt9CaaDBiRfuxlo476JE4iq/Q/XbR5Xku4SrUMFrdMWf9NF0FE6/J5Nk tNtb7kGsCAyu2CXvH7SzyX57SGHwvehoE1/QV2CbHpcxHPIs9h+lCJGrx0rkpX4/WASh ybOr6eIHT61ewQrzP3WRHkHR8kPaoYQqXvzKcEoyvvk02GRrc+JnQShK9uANGIK5dmR9 c43XhgblcIiV/BivQETtUWO1+ltWKeWrP4P4ObJy5MFBmUY23M/JkZI3f3eSOQlzRuHo ZE+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hJusQJKJ; 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 a5si13278496oti.22.2020.02.05.04.52.45; Wed, 05 Feb 2020 04:52:57 -0800 (PST) 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=hJusQJKJ; 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 S1728072AbgBEMv3 (ORCPT + 99 others); Wed, 5 Feb 2020 07:51:29 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:33402 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726308AbgBEMv2 (ORCPT ); Wed, 5 Feb 2020 07:51:28 -0500 Received: by mail-pf1-f194.google.com with SMTP id n7so1188210pfn.0; Wed, 05 Feb 2020 04:51:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=6hpkny8N/XZM7wZK5JpvEfe2AHXPpO8aqNteI1qybns=; b=hJusQJKJ3dMO68YWd/RkVmXquAcSQCouv+XJYUHwrjq+Ec5w/GLEVgFg/ymRr/W07j 1dDKHA4QuTspdrU82bamvjc8HNp76lvEvEH4OuaxAurErXqtCxF4NqBu7fSTKsz2HzR8 PnGbzgi+nw4onNaIVPb/H+RF9OHbaPihw6zMjrU8Umb1ujstnxbQsCxrnHWhG+XcG0mh SodEOQOxj+fAxFGA16q1NFzWrEBEmf2Ha61Q4vSMqLq12xJ9VG1y0nxUql0MmGbILeoI je0w7F8LWcO1Q0iOi8pC8zQgY8cdy/nWB9AeQywoQzCELmcIWFkyjHU+yeXYn3Zow+tc p/Bg== 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=6hpkny8N/XZM7wZK5JpvEfe2AHXPpO8aqNteI1qybns=; b=h/LYMNSUQM4rVpohzjdFTGpmg+xGjp6ceB1OLL34VMjNQnVO14PtpvYq7IugH8JOsN RgDldQSK0zOqb1CA+3Y6MmRI7hGWzyVkrkdr+dUep78D5dm2uXy7IENwhu/qlckFkMi7 0Kd1OCPy5prIhwx2XoURSEaJPJX5xJT1kiZbdWdQCZwZwkCV79e/1aOlpDDtF4TSvgi6 3uH2iacXKZ4p1tjg99MOupq7PUqQrc/fI1NcUX7zqUNfFehGII13yMRTM395Gw6sy+Vz mFAbQI9pL5yiQADgHmJj/tCr+KXrAqlsKfC8mklyHiHQAITZAX7GvXu/MObr3p3Q/ZTW ToGw== X-Gm-Message-State: APjAAAX4xT/ugvaAvX4kuvj0bj1zzwJFG+aYvNA9cv8K3rMzivGlU0OV 74Vogi+MDQRZx3BXWhdAUxw= X-Received: by 2002:a63:c14b:: with SMTP id p11mr13707443pgi.290.1580907087478; Wed, 05 Feb 2020 04:51:27 -0800 (PST) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id y127sm22864784pfg.22.2020.02.05.04.51.24 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 05 Feb 2020 04:51:27 -0800 (PST) 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, baolin.wang@linaro.org, baolin.wang7@gmail.com, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v8 3/5] mmc: host: sdhci: Add request_done ops for struct sdhci_ops Date: Wed, 5 Feb 2020 20:50:30 +0800 Message-Id: <825d6f7b69393b4bc11fc3175749d46a0a495496.1580894083.git.baolin.wang7@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 63db844..9761981 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -2944,7 +2944,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; } @@ -3372,7 +3375,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 a6a3ddc..3e95f74 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -654,6 +654,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 -- 1.7.9.5