From patchwork Mon Nov 11 07:33:58 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: 179056 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp6294110ilf; Sun, 10 Nov 2019 23:35:22 -0800 (PST) X-Google-Smtp-Source: APXvYqw0EHJWgyA8Se2qAEmHYxr28/Kl0IDsjdddotJv/ZdwTuqudfnIm9ybEx0C30eeUQAZPioB X-Received: by 2002:a05:6402:1049:: with SMTP id e9mr24685908edu.91.1573457722194; Sun, 10 Nov 2019 23:35:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573457722; cv=none; d=google.com; s=arc-20160816; b=fNg+a9joyYvjs3lH2qlfYbP6NBuOIzCuUFj4mdziTTFwVR1d5ABtnvj8qBzjdUVcEH 4Ko8dPjbw4NtxjkH+UwFHCcDcZUWoHZowfPcPME6bfCK/aCYkWqO3oJEFOxv3ymtdC4W SAhAiBx4W7q9SVVmW6cZa1GF3v0EuerLxD/SFT0Tibde+VaTtf5V2iJiL33DVf6muXeN yHdIqjyh5SIlzQz/kYxBiqLifzcjXo7nEc3IPNXlDTGn4J7DDxUj6Lpk2qieKHgMpvZ1 piQ4JKTOM91iD0MJqFZWqDAAgf8L8kUK6wkfkf6whaq4Te2zkv9RmpRKH8ihkclTIVzB I7JQ== 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=L75LLFA1KQhrKc/173gwPJX9HYgrUqTio1mUq03bMYNm6s+uT766jyAadsUmNk1JfL +ZLAzmajqNsMNd0E97tB2QnkU60N44K6bygE8hKFJoY5JRe3aKaVgfItfsqCXL/eI9Nw HE44S3g+CCATv3BQXrddAIKn/AU+83lfy5pvXro69gQJtP+eamT1OAWhIu1Et5yU6Avj ouzwiGUC5yldgFS9MXFTr16espOdTopB9R5u3TRN0UqrRvgioqKxyznbXDqL9gTftDRy dPKvGsxzD05LydVPmm+HHYIrhZldpnb+eNlhwHW3F07GjmTSZ1uDyIpc2Pc4NMqtPSfo w3jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=avMpbdpT; 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=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 f13si9369704ejt.61.2019.11.10.23.35.22; Sun, 10 Nov 2019 23:35:22 -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=@linaro.org header.s=google header.b=avMpbdpT; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727012AbfKKHfU (ORCPT + 26 others); Mon, 11 Nov 2019 02:35:20 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:36037 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726805AbfKKHfT (ORCPT ); Mon, 11 Nov 2019 02:35:19 -0500 Received: by mail-pg1-f193.google.com with SMTP id k13so8934566pgh.3 for ; Sun, 10 Nov 2019 23:35:19 -0800 (PST) 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=avMpbdpTTxTcZgMNsmHJriqYfjzppWrWU4fDAsp8ZdHzgQeCtuy8ra7ZPMS668QTzR cWJbYzjfn6TIqK5gseB7rSCq7pWrcV3K3E28XL1UdekndfoR4ZtB0IFBnxgTfI7xZqNe UcXlNCSIcb0waslZC2IAkZG/qgGlbz+Vq5taKIWhn2Y+RmX5g7Q+OH/NolpLeLLmC2z4 H7MYHVj0XUS6/LlHrHEkRMZW2fWj5gMEOVbSPkTx4yjpO2dHcYxd4YGThqaEg9MhnDUr 7+gh/Qba7laBgtfDeB9IcyI2hFYOhpzGuYpgyo1FD7qAbh8QaWMSCqYf+qkx1szCBpUK o4Kg== 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=WmPKSfsModdrh/RnGOD9kOyTpDzVKmS/8HtN+IHmmRd/iU2M7QKW6cwQ3furLXCXHQ qPq7n5lQNBYSjU1a2Ml+ytErAp8FsrVAqLfC35+lQxYzg1wSvzGP8lPUG5JQv8HWE89R Y26cCazfFV94B6xCWzVtI2VPVGpNocMk4/VjqrdPezLPbPo2ukNIrQnqWGRcliL51tGQ vz1N3Ja6ohV5gOQzCdN+EqKE+kNIDvaEb2NgncP9HTk7ufowNtVxbSfD9lmv4Sjc5kcQ L7U2bxI1Qma/Tjq35wRloNUPGwEkqdm8uHoBLPqzi7QqMmYyFGEwXoBuIndwJ58GBO/Z LrnA== X-Gm-Message-State: APjAAAUxUaTxqz0n+py/PJiYoiwYfyt2G8zq3ZKvL99A/oUF/7I5xj4h SxpKCZgS/c2rdIrHb3M3xlGPow== X-Received: by 2002:a62:e316:: with SMTP id g22mr28062398pfh.19.1573457718675; Sun, 10 Nov 2019 23:35:18 -0800 (PST) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id c184sm17345285pfc.159.2019.11.10.23.35.15 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 10 Nov 2019 23:35:17 -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, vincent.guittot@linaro.org, baolin.wang@linaro.org, baolin.wang7@gmail.com, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 2/4] mmc: host: sdhci: Add request_done ops for struct sdhci_ops Date: Mon, 11 Nov 2019 15:33:58 +0800 Message-Id: <94603120e6431f0ce35af78935bfe7dddda4850b.1573456284.git.baolin.wang@linaro.org> 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 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