Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5626726ybv; Tue, 11 Feb 2020 20:14:53 -0800 (PST) X-Google-Smtp-Source: APXvYqz+kS2IkUEFZghzGGxp3q3teWnRQ4SaAnSB0IFb7oi8pF6mMeTRW5N1wMg8rJWiriQURBIK X-Received: by 2002:a54:4816:: with SMTP id j22mr5024356oij.179.1581480893479; Tue, 11 Feb 2020 20:14:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581480893; cv=none; d=google.com; s=arc-20160816; b=v6da61Ac3JU4JDhsfAD2mjl6GpJpDG2kZ9juFVdKRFFS2Ix7gcElkpbfXpsiSRj9qr tPPJKTK2W9bYZzFT7VDSUjzxCfJkQaR2jzZA+0CXrlELeA8+CvCV97L2IeaWCpRt+j4o KHTjAYtJ2MmmxmdcH0mEhwK2a664vkQKputzXEAcqeA8PiJrqE5Et6n3lTmNnr4yBWZt mCT8iZoKOXTFsubBzYTJxNuqcFc53mT/soLIfyyncTh0rcwi9/G9rhtlWMTLfzOdlM/r dfh7HUarCDvIkVVAdx4nx3QsKTT/1OMcaCGKNopcWQGew8ymMTMxzfC1InJArYe6f91O gFyg== 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=iqDk5Ol4czJdu1oSCKOAHnpnBvPPT47XsPdef4OM1JgfqnGqUEiMGtVB8lKtfhUq0V DPIxCoMTSiztOY/HLOvvycfiRCvbml3lzch9ME/QahU3yjXJPScudAzQzi3YMxYWkED0 inq9bIDX1XtdvOEznBn7rA2R8yD7w4L1TbhkXnKKPKP8AZ852/StUbu+cGetH2UWSngY wn9b3yi4naKB8px+lJ0tr04R9b1U3fl2stCeqz/fD3iT2X4Hv1Si3KcWrHlIeJ4M+Pju 0wqGNjt/C3o5u/6v2lTJUTAzb1Q5ECZkVjCI5/mTza6d46DJKCRpnAVAQkM3Y6Bd3W5I SULw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fGje1dO0; 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 f9si3275502oti.44.2020.02.11.20.14.41; Tue, 11 Feb 2020 20:14:53 -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=fGje1dO0; 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 S1728028AbgBLEOO (ORCPT + 99 others); Tue, 11 Feb 2020 23:14:14 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:44943 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727602AbgBLEON (ORCPT ); Tue, 11 Feb 2020 23:14:13 -0500 Received: by mail-pf1-f193.google.com with SMTP id y5so536964pfb.11; Tue, 11 Feb 2020 20:14:13 -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=fGje1dO07f1Gt0n6q7nS8B4mwwcgFuXTqw8LyAV5iardHQoQ5ZIWVotTNdrS2r2bfT kExfRqJ/nKgvbZDO2llJ5FPXLel9NzbVXk3mob1qc+j9z8vYbAlCQYY3T27JvnwtCssz fvhjNgkRFxtk0hh1RVc1Ek69KU6KnDdJi+U4+MNQHimldNUQ7ddVbl9B7AvEAB/3/1rk JGEfbGNj9yjA4f5NsUhkWX6RvCpnrKiNSEcdM8Me8YKXRyUYeAIa3ZoxqQEBh7ey47Gh miBwKZk2fjbDwAvDHg6A9F6lL+ihtA4JVY/NTT5x+uxu3N7h4Hctz8aLwG/6RwkHZlfr tKhg== 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=D9qgcWNNIUDlgEVaClu10Me3QKW17wrEkcvNjIbM0yxhd1EyOSuJnNnjlWrOXf/WRk iy8n45TUdlkh1U3ABzY6w5+dJdro4g3UheYW34KL42JlI0iMWz1g1xI3WkZGeIZh1v6U TWQxTZm+bxOmQOxlLxI1qdcUUYeNKvhgB/m2mb2rgPl9hA+lbnBwk2u65JLYhxoJKCFv VqGj9lAevfCSmCQFFc1p36NFwO/WyZVopEKTG1qiNDzdFrahOprWNaPsAMdjKyAvPH4H t31MLBHLw/t8xxy0pMyZvQ6EjLk/f8yKS0tvlP2oDoN1YCGe6LfP8qGbhZbUevQhncqW eZwg== X-Gm-Message-State: APjAAAXQnQm05n9bUe7NJbJPc7yX9464m4GBJaGovGIOKmoPFBa4qwh+ 8Th1g7EqOtWa7BNyIgt+c8A= X-Received: by 2002:aa7:9f90:: with SMTP id z16mr9989008pfr.161.1581480852743; Tue, 11 Feb 2020 20:14:12 -0800 (PST) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id q66sm6424762pfq.27.2020.02.11.20.14.09 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 11 Feb 2020 20:14:12 -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 v9 3/5] mmc: host: sdhci: Add request_done ops for struct sdhci_ops Date: Wed, 12 Feb 2020 12:12:58 +0800 Message-Id: <1539c801c8bbdbcd1d86f8c2dab375f5803c765a.1581478568.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