Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1234745imm; Tue, 2 Oct 2018 05:10:29 -0700 (PDT) X-Google-Smtp-Source: ACcGV63Ly4B8O4XeYN9n77yNxzKAi68ezvZkTlTxBwpokhAD+V7K+/rAqqLepftabZtiA+SbdYpl X-Received: by 2002:a63:8a41:: with SMTP id y62-v6mr14208924pgd.420.1538482229657; Tue, 02 Oct 2018 05:10:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538482229; cv=none; d=google.com; s=arc-20160816; b=AM3oz2FRbQT0+wMQDR6lQmpCMnGczUsCRdbioU5k+wXyH6UZVBZ1tPgyo/MockILAY F9ZyvPq0GY20SpgsKjWEZl005FSMsIY2wOfl7QuWJtauscmKijSDslIoGtodHwFnJ6wq doyaIZjSfPVV2nu06fGCNeQJHHwr6KaMXZkjekZfxN4q6wb2tXHK6iN/8iR9UnUAx4A4 4+WlqvYdsaXW36eaGnlvXG4LZRncVZ5ZYoejTjV8ArIBL5hGb1eWySxYn5IFALiwAEvp sjwJd4K0roM4XQwwdn6q+V5f1LLGJjow0Mlb5VvpugoUV7Z1+PVjHKphLLK53EgPzE1M CppA== 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=D02BOUeNmAZSmoHDw+QoS+vMZJ4Gutd9QR9NrAPXEwc=; b=f4j2dKX3Ls1xBMAAo2L6MA+heO7xdhtxZ0xCvI3sKnrQ5H3Dyrew19Ay8M7oaq6I3L cfmU2O7AfuPi3hecMO8eA+J7ERAVvUkV+2uxksrIKvZWQzNqzc6WHbQp2ez0np4V+/zn uWQgdYrs+uRJ5KovOnDOWLjjop+npmwN9Te1MrBqIq/TkQtp36JnEdwY/Urdgg2UfUmw ryagHGiz5Z2n5d+XcVlt0jG60z5pcv8UBP0uJ/9AnA0COf0VK0FaXw+SrWZ2WCwSsD2S 8JqYJlYKsUfPVZCV+4Ghuwwr4WIOxul3eZY8KXU8l2Bi5mLEWHI83ga11zHJn2p7dFgU 3AlA== 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 y125-v6si14419155pgb.14.2018.10.02.05.10.12; Tue, 02 Oct 2018 05:10:29 -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 S1727775AbeJBSxG (ORCPT + 99 others); Tue, 2 Oct 2018 14:53:06 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:18708 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727580AbeJBSxE (ORCPT ); Tue, 2 Oct 2018 14:53:04 -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 w92C4H35012260; Tue, 2 Oct 2018 14:09:49 +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 2mv4mj179v-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 02 Oct 2018 14:09:49 +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 6F9B034; Tue, 2 Oct 2018 12:09:48 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas23.st.com [10.75.90.46]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 526022A3B; Tue, 2 Oct 2018 12:09:48 +0000 (GMT) Received: from SAFEX1HUBCAS22.st.com (10.75.90.93) by SAFEX1HUBCAS23.st.com (10.75.90.46) with Microsoft SMTP Server (TLS) id 14.3.361.1; Tue, 2 Oct 2018 14:09:48 +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; Tue, 2 Oct 2018 14:09:47 +0200 From: Ludovic Barre To: Ulf Hansson , Rob Herring CC: Maxime Coquelin , Alexandre Torgue , , Gerald Baeza , Loic Pallardy , , , , , , Ludovic Barre Subject: [PATCH V4 06/25] mmc: mmci: add get_next_data callback Date: Tue, 2 Oct 2018 14:09:08 +0200 Message-ID: <1538482167-13819-7-git-send-email-ludovic.Barre@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1538482167-13819-1-git-send-email-ludovic.Barre@st.com> References: <1538482167-13819-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-02_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 get_next_data callback to mmci_host_ops. Generic mmci_get_next_data factorizes next_cookie check and the host ops call. Signed-off-by: Ludovic Barre --- drivers/mmc/host/mmci.c | 16 ++++++++++------ drivers/mmc/host/mmci.h | 2 ++ drivers/mmc/host/mmci_qcom_dml.c | 1 + 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 7f66724..9236d4f 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -403,6 +403,14 @@ void mmci_unprep_data(struct mmci_host *host, struct mmc_data *data, data->host_cookie = 0; } +void mmci_get_next_data(struct mmci_host *host, struct mmc_data *data) +{ + WARN_ON(data->host_cookie && data->host_cookie != host->next_cookie); + + if (host->ops && host->ops->get_next_data) + host->ops->get_next_data(host, data); +} + static void mmci_request_end(struct mmci_host *host, struct mmc_request *mrq) { @@ -756,7 +764,7 @@ static int mmci_dma_start_data(struct mmci_host *host, unsigned int datactrl) return 0; } -static void mmci_get_next_data(struct mmci_host *host, struct mmc_data *data) +void mmci_dmae_get_next_data(struct mmci_host *host, struct mmc_data *data) { struct mmci_dmae_priv *dmae = host->dma_priv; struct mmci_dmae_next *next = &dmae->next_data; @@ -764,7 +772,6 @@ static void mmci_get_next_data(struct mmci_host *host, struct mmc_data *data) if (!host->use_dma) return; - WARN_ON(data->host_cookie && data->host_cookie != host->next_cookie); WARN_ON(!data->host_cookie && (next->desc || next->chan)); dmae->desc_current = next->desc; @@ -809,14 +816,11 @@ void mmci_dmae_unprep_data(struct mmci_host *host, static struct mmci_host_ops mmci_variant_ops = { .prep_data = mmci_dmae_prep_data, .unprep_data = mmci_dmae_unprep_data, + .get_next_data = mmci_dmae_get_next_data, .dma_setup = mmci_dmae_setup, }; #else /* Blank functions if the DMA engine is not available */ -static void mmci_get_next_data(struct mmci_host *host, struct mmc_data *data) -{ -} - static inline void mmci_dma_release(struct mmci_host *host) { } diff --git a/drivers/mmc/host/mmci.h b/drivers/mmc/host/mmci.h index e43be60..8d65d55 100644 --- a/drivers/mmc/host/mmci.h +++ b/drivers/mmc/host/mmci.h @@ -277,6 +277,7 @@ struct mmci_host_ops { bool next); void (*unprep_data)(struct mmci_host *host, struct mmc_data *data, int err); + void (*get_next_data)(struct mmci_host *host, struct mmc_data *data); int (*dma_setup)(struct mmci_host *host); }; @@ -336,5 +337,6 @@ int mmci_dmae_prep_data(struct mmci_host *host, struct mmc_data *data, bool next); void mmci_dmae_unprep_data(struct mmci_host *host, struct mmc_data *data, int err); +void mmci_dmae_get_next_data(struct mmci_host *host, struct mmc_data *data); int mmci_dmae_setup(struct mmci_host *host); diff --git a/drivers/mmc/host/mmci_qcom_dml.c b/drivers/mmc/host/mmci_qcom_dml.c index 9f60ac0..16ae40e 100644 --- a/drivers/mmc/host/mmci_qcom_dml.c +++ b/drivers/mmc/host/mmci_qcom_dml.c @@ -185,6 +185,7 @@ static int qcom_dma_setup(struct mmci_host *host) static struct mmci_host_ops qcom_variant_ops = { .prep_data = mmci_dmae_prep_data, .unprep_data = mmci_dmae_unprep_data, + .get_next_data = mmci_dmae_get_next_data, .dma_setup = qcom_dma_setup, }; -- 2.7.4