Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp440747imm; Fri, 21 Sep 2018 02:50:53 -0700 (PDT) X-Google-Smtp-Source: ANB0VdalxvJ781IguV3xQ/3fvT54GQ+5InmFSEtXDaY/AIELxKJXEWqDm9Y/BDcd43P2fv3zfrjg X-Received: by 2002:a17:902:7587:: with SMTP id j7-v6mr43961581pll.256.1537523453010; Fri, 21 Sep 2018 02:50:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537523452; cv=none; d=google.com; s=arc-20160816; b=vlIV640cYiV+HubVL4Tp1JpsYTHcfE5Fx0FSdKbFDqJLnw3RARIDItvqmroGnaUhLb sXpkyXcQ6yiYcEXR2sj7ldviER/H0W+aZ/wa+/SO+7qHnGR1qUdPgj7nkeyHlT49AjQK zsYnhzAXWjm5pYt+82D4DjKW1b63MrdjAdChQTFUPEi43xRuQjR8T9GFXHMeyU+WMHnS oupTBPB/PfV9xsVRzOI/2EQD3lai0+9SKx7rxgRQ4O8H0i+8gn15j1tnNp8IASGHcQIN 9BWINDFpMrB6DAQPiEVLaxH0Iq+ipAhCvyFw8Bz/PtttpThq4Q0CZ1kA12JV5V7L8ASe F6Ig== 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=BbWLn5xCf1VGjGf1MboqrnqHn0E/eMFraEK1SW3F6bk=; b=diwIDzen6i3zhmUFbHukMKkEf1ri6XQhqBbmTZx58s2pgoc5O/CigdlgjRUKjHM5Ol Z+h8b/dkgvDeCZ8Iz4SZwSGM7vnnDixCgSWEwCre41HTY61SyewD+1wj94OIdBBM2wlA 6hmFGslTpatDFzp0i1wL1A8NFnShHMaCNJ8dNe5QOZdOAA3Es/ZAlJ41D8iGxJnaPuO4 v88pI8pkSKf4QGdS80yYi2/Jf3y//eDAzD4P0svSWae7wlyBEIhQkR7cvEwLD4VVzo6E 24vmWxd1tQjQLY7Q87BaJl+/Uju18nNLmP2mo23sdCXva6yfdozpb+BAyPfz+97C1bcV KZcQ== 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 w16-v6si27671579pga.104.2018.09.21.02.50.37; Fri, 21 Sep 2018 02:50:52 -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 S2389694AbeIUPe5 (ORCPT + 99 others); Fri, 21 Sep 2018 11:34:57 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:43175 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2389434AbeIUPe4 (ORCPT ); Fri, 21 Sep 2018 11:34:56 -0400 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w8L9jK4N001508; Fri, 21 Sep 2018 11:46:36 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2mmkn0u88g-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 21 Sep 2018 11:46:36 +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 7CE9B3D; Fri, 21 Sep 2018 09:46:35 +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 0780D2AC3; Fri, 21 Sep 2018 09:46:35 +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; Fri, 21 Sep 2018 11:46:34 +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; Fri, 21 Sep 2018 11:46:34 +0200 From: Ludovic Barre To: Ulf Hansson , Rob Herring CC: Maxime Coquelin , Alexandre Torgue , , Gerald Baeza , Loic Pallardy , , , , , , Ludovic Barre Subject: [PATCH V2 05/27] mmc: mmci: move mmci next cookie to mci host Date: Fri, 21 Sep 2018 11:45:59 +0200 Message-ID: <1537523181-14578-6-git-send-email-ludovic.Barre@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1537523181-14578-1-git-send-email-ludovic.Barre@st.com> References: <1537523181-14578-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-09-21_04:,, 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 moves next cookie to mmci host structure to share same cookie management between all variants. Signed-off-by: Ludovic Barre --- drivers/mmc/host/mmci.c | 10 ++++------ drivers/mmc/host/mmci.h | 2 ++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 6de7c8d..43f2a1a 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -418,7 +418,6 @@ static void mmci_init_sg(struct mmci_host *host, struct mmc_data *data) struct mmci_dmae_next { struct dma_async_tx_descriptor *desc; struct dma_chan *chan; - s32 cookie; }; struct mmci_dmae_priv { @@ -449,7 +448,7 @@ static int mmci_dma_setup(struct mmci_host *host) "tx"); /* initialize pre request cookie */ - dmae->next_data.cookie = 1; + host->next_cookie = 1; /* * If only an RX channel is specified, the driver will @@ -716,7 +715,7 @@ static void mmci_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; - WARN_ON(data->host_cookie && data->host_cookie != next->cookie); + 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; @@ -728,9 +727,7 @@ static void mmci_get_next_data(struct mmci_host *host, struct mmc_data *data) static void mmci_pre_request(struct mmc_host *mmc, struct mmc_request *mrq) { struct mmci_host *host = mmc_priv(mmc); - struct mmci_dmae_priv *dmae = host->dma_priv; struct mmc_data *data = mrq->data; - struct mmci_dmae_next *nd = &dmae->next_data; if (!data) return; @@ -741,7 +738,8 @@ static void mmci_pre_request(struct mmc_host *mmc, struct mmc_request *mrq) return; if (!mmci_dma_prep_next(host, data)) - data->host_cookie = ++nd->cookie < 0 ? 1 : nd->cookie; + data->host_cookie = ++host->next_cookie < 0 ? + 1 : host->next_cookie; } static void mmci_post_request(struct mmc_host *mmc, struct mmc_request *mrq, diff --git a/drivers/mmc/host/mmci.h b/drivers/mmc/host/mmci.h index 1e9a45b..5bb1ce2 100644 --- a/drivers/mmc/host/mmci.h +++ b/drivers/mmc/host/mmci.h @@ -318,5 +318,7 @@ struct mmci_host { int (*get_rx_fifocnt)(struct mmci_host *h, u32 status, int remain); void *dma_priv; + + s32 next_cookie; }; -- 2.7.4