Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3502196imm; Mon, 8 Oct 2018 05:12:58 -0700 (PDT) X-Google-Smtp-Source: ACcGV61uh184vP0v/ix21ePjmU8SmSKI1pceBXKNMuafuoeeMcAkGNGHjYjDg8HYzHhq5axHX4VD X-Received: by 2002:a17:902:2b84:: with SMTP id l4-v6mr24122693plb.265.1539000778624; Mon, 08 Oct 2018 05:12:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539000778; cv=none; d=google.com; s=arc-20160816; b=HJkG03SqkLBCSOAL3Cs//nPxIw0DTSFYq1y/KlkDh1R4MlErllzycNlj7ztonHG05Z 0AtuppNbAACmExVJKLegngLFrrBHO6EIOQtfdwSFXENFcD26tZmGNlnfl75xFGICH0Nq TFcIfBwYZZtm9WCVvVrPfS8PrSoBv9Run7qZ43wpZpkmqGsNyOgqfftIz0H5wfqsxb4V Am6zCNYXCNIsJubXZx9NZxJ1NRcYOLNJ2pkp2U5dVN5jKZ2W9y7JIWsOhJxqwK/C8QW9 BDXKsjrlIM7y0wmLL3SNscALWwrFXVbNGLuMffPbqpPTbz7OLzF98IHgeJiVwkzVFYOC JEiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=tfGZsjQKs9ESJ4ReB6+a7Tp7Ice1yq5Z+V+j+oMsJLo=; b=SIuhgpqXcgfBCPeM083aZFu3rQLhunp9ruKw4ETYqSUha8RJxlQGAft4BbPycfrG32 awVfwT6n43oqQW+wwBFvVm4JVi1sZ3IcaJshXGagZUWn+8FzZRtb3bA40WpIJc4OgijS zGT/jQVAbVr+YWmqHuRGldd5xLyQ1H9Hdl5ELwSmkBY15tlyPaRRR7GWelmXx+/vrd1e z2B45hdY4hGPi5GVZDqzrVomiA19ox0hraS86POOc2p7uOtpYKFmCdi0f1RTl+J1snhm h1FvkO10etepH8zoN/RI+5p8BQnYA8vJH0HD8S7e4ItMQszLVvdB37ZF0u0ZFe8+oWfj jquQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q10-v6si20239626pli.202.2018.10.08.05.12.43; Mon, 08 Oct 2018 05:12:58 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727585AbeJHTWU (ORCPT + 99 others); Mon, 8 Oct 2018 15:22:20 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:2106 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726006AbeJHTWT (ORCPT ); Mon, 8 Oct 2018 15:22:19 -0400 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w98C46i5018791; Mon, 8 Oct 2018 14:09:40 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2n01heht4t-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 08 Oct 2018 14:09:40 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 27C7046; Mon, 8 Oct 2018 12:09:39 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas21.st.com [10.75.90.44]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id A9F942D0C; Mon, 8 Oct 2018 12:09:38 +0000 (GMT) Received: from SAFEX1HUBCAS22.st.com (10.75.90.93) by SAFEX1HUBCAS21.st.com (10.75.90.44) with Microsoft SMTP Server (TLS) id 14.3.361.1; Mon, 8 Oct 2018 14:09:38 +0200 Received: from lmecxl0923.lme.st.com (10.48.0.237) by Webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.361.1; Mon, 8 Oct 2018 14:09:38 +0200 From: Ludovic Barre To: Ulf Hansson , Rob Herring CC: , Maxime Coquelin , Alexandre Torgue , , , , , , Ludovic Barre Subject: [PATCH V6 07/23] mmc: mmci: add dma_finalize callback Date: Mon, 8 Oct 2018 14:08:39 +0200 Message-ID: <1539000535-13261-8-git-send-email-ludovic.Barre@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1539000535-13261-1-git-send-email-ludovic.Barre@st.com> References: <1539000535-13261-1-git-send-email-ludovic.Barre@st.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.48.0.237] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-10-08_03:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ludovic Barre This patch adds dma_finalize callback at mmci_host_ops to allow to call specific variant. Signed-off-by: Ludovic Barre --- drivers/mmc/host/mmci.c | 19 ++++++++++++------- drivers/mmc/host/mmci.h | 3 ++- drivers/mmc/host/mmci_qcom_dml.c | 1 + 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 72584f4..4570042 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -460,6 +460,15 @@ int mmci_dma_start(struct mmci_host *host, unsigned int datactrl) return 0; } +void mmci_dma_finalize(struct mmci_host *host, struct mmc_data *data) +{ + if (!host->use_dma) + return; + + if (host->ops && host->ops->dma_finalize) + host->ops->dma_finalize(host, data); +} + static void mmci_request_end(struct mmci_host *host, struct mmc_request *mrq) { @@ -641,13 +650,13 @@ static void mmci_dma_data_error(struct mmci_host *host) mmci_dma_unmap(host, host->data); } -static void mmci_dma_finalize(struct mmci_host *host, struct mmc_data *data) +void mmci_dmae_finalize(struct mmci_host *host, struct mmc_data *data) { struct mmci_dmae_priv *dmae = host->dma_priv; u32 status; int i; - if (!host->use_dma || !dma_inprogress(host)) + if (!dma_inprogress(host)) return; /* Wait up to 1ms for the DMA to complete */ @@ -844,6 +853,7 @@ static struct mmci_host_ops mmci_variant_ops = { .dma_setup = mmci_dmae_setup, .dma_release = mmci_dmae_release, .dma_start = mmci_dmae_start, + .dma_finalize = mmci_dmae_finalize, }; void mmci_variant_init(struct mmci_host *host) @@ -852,11 +862,6 @@ void mmci_variant_init(struct mmci_host *host) } #else /* Blank functions if the DMA engine is not available */ -static inline void mmci_dma_finalize(struct mmci_host *host, - struct mmc_data *data) -{ -} - static inline void mmci_dma_data_error(struct mmci_host *host) { } diff --git a/drivers/mmc/host/mmci.h b/drivers/mmc/host/mmci.h index 7bca597..8c1493b 100644 --- a/drivers/mmc/host/mmci.h +++ b/drivers/mmc/host/mmci.h @@ -281,6 +281,7 @@ struct mmci_host_ops { int (*dma_setup)(struct mmci_host *host); void (*dma_release)(struct mmci_host *host); int (*dma_start)(struct mmci_host *host, unsigned int *datactrl); + void (*dma_finalize)(struct mmci_host *host, struct mmc_data *data); }; struct mmci_host { @@ -341,4 +342,4 @@ void mmci_dmae_get_next_data(struct mmci_host *host, struct mmc_data *data); int mmci_dmae_setup(struct mmci_host *host); void mmci_dmae_release(struct mmci_host *host); int mmci_dmae_start(struct mmci_host *host, unsigned int *datactrl); - +void mmci_dmae_finalize(struct mmci_host *host, struct mmc_data *data); diff --git a/drivers/mmc/host/mmci_qcom_dml.c b/drivers/mmc/host/mmci_qcom_dml.c index 66af406..c2ef73f 100644 --- a/drivers/mmc/host/mmci_qcom_dml.c +++ b/drivers/mmc/host/mmci_qcom_dml.c @@ -190,6 +190,7 @@ static struct mmci_host_ops qcom_variant_ops = { .dma_setup = qcom_dma_setup, .dma_release = mmci_dmae_release, .dma_start = mmci_dmae_start, + .dma_finalize = mmci_dmae_finalize, }; void qcom_variant_init(struct mmci_host *host) -- 2.7.4