From patchwork Wed Mar 6 14:04:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 159749 Delivered-To: patches@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp6206029jad; Wed, 6 Mar 2019 06:05:04 -0800 (PST) X-Received: by 2002:a19:2c52:: with SMTP id s79mr4049060lfs.32.1551881104756; Wed, 06 Mar 2019 06:05:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551881104; cv=none; d=google.com; s=arc-20160816; b=x1ftmyDyC2B+sXLSy6aBFflvQ+fu6qmdzjYCR/jF7g+4zxlFJbiQAqFYT2iZ+wi2IB bOiGeWTvtzkXve9MyL79p1Aybjqc4iupvoKz0OtAKUwMpH4WmuRF1AOENteP+k8ykaQC HO846a7ahE3JGFFM1zo6Yh2Siw7391QD8m0E9TKY/e4/B+PIjy3cmo5s51fuqol1yDDQ oQnRt299LK6pmkK9CL3e4b9+ZfxNde4RR+NvUKKppH4xppQwEtcgtwRo1/tZxdrkG5Z6 anTNitS4jYwEXA/ymXWv3WvD5lC6wUiO8y7COeTmiRHo4qlOhURTD2GDsySXtu+VJOWV 3O0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=tlCKbtc89hKabNuZVImSO48JykyWQKwHDx3+KQ8Sj7Q=; b=C8vlSkRtC/UIhaWbe+Ir2MlGD9ot0+SVRTd3rRfI0NJocsOAOBsZDsqOJzXKOYgzNE QMTfANVd8ahDrta6POM/e56llhqUKrLaMhUpgnjBEeYdDkmOwaHouIZU6jxpIGwwyZW+ uyNpW9sdMKvMqKwRNQ6WT9cl/i9l0dt7HQIOph3UR8xAm/oSXrZuv7ebHW0whLwoOfZX 9FFMrfjrK39O/BlEyQi0Kvlo0Glwxx1jM4GXXSJiS83ltSIfFRozpSORoq818+oZiVqe EPX5yG9kMk8Qoi3S4vA7Q3y/7uEYRbsNW7QdVQLVDw32vEF/fQ0va4sEe20R/BgmNYqv 5Mig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vuREW4WW; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id j7sor546820lfb.15.2019.03.06.06.05.04 for (Google Transport Security); Wed, 06 Mar 2019 06:05:04 -0800 (PST) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vuREW4WW; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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; bh=tlCKbtc89hKabNuZVImSO48JykyWQKwHDx3+KQ8Sj7Q=; b=vuREW4WWOXmbiTtxtpOHH8V/JWTC+LGxPeWUW/aMAluDJ5JOi5+IRtz6CHPC9UbjMp xJOh+3HvwNAywaJsLtf363YqxO/PRcBxaaYBAMF2+pA90Ftvc79IRd8KYDhTOB95vQrY rtBCCWKHbhblhCehpVFDqB9PvQXzYWNU7wdhru4z9Gjhq0sNr9TVJtb7ve5XegHzQcFo q9tXt5nf7G5Z4m/cna9IUigyvQyKCr2WlGO8gfFkYWueg7oglJt0GBzh9LU7Kq1+baez ScIKbnmcxiAI1WbgG/eMcL0EWXW0BKrsoShBiQE4RhPl+wVckmi9QTTZ4gYc3XDqKCoU 9Z6A== 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; bh=tlCKbtc89hKabNuZVImSO48JykyWQKwHDx3+KQ8Sj7Q=; b=pXJTrKpUJT03ie3ADH9n4ufjCjn1+tfz+QfH1IDEGLGcbh+wWBrQ8Y/dQCflycpGVE 1qeWO4Svbl0VL+ljLD0mgLJ3NF9aZvB3H4406k+rATKqqeRLv2a4wI/LGPJXTdya5GnA nYZTq3YmmvBonuCH3ORrKnWeLH3VEdCwaWXNngtS4/z6kFSocUnDf74sKwR3a3aZcxl2 YcnPfQkKAuMSeZgWVm9Cz2GSXelq5yOd/VEeDUlfiX6TEN90x3hYUfN6qDvwfu1Mi9L/ qrCQEjia6blI7OsYtOGeFgN50jdp0fiogXyLBX+5H1+Dcvhga9qwJtGzK7wG7pmpA0Z5 YDxw== X-Gm-Message-State: APjAAAW4FjmZIB7Ewy/NiWZMxuEhAlZ3cjvLNO6ZJmv/d85KyuPuk4rK TWeWXXnU45HjOEIdA75+BYJr0+PP X-Google-Smtp-Source: APXvYqz1d8TudKxLGHrAAwFo2B3/LViUwnoNMpXd1Qb/AiDtOl9u+BAejR/hagpyqlgu0paFU/+f4w== X-Received: by 2002:a19:6554:: with SMTP id c20mr3947873lfj.15.1551881104221; Wed, 06 Mar 2019 06:05:04 -0800 (PST) Return-Path: Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id o12sm343734ljc.37.2019.03.06.06.05.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Mar 2019 06:05:03 -0800 (PST) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ludovic Barre Cc: Russell King , Linus Walleij , Ulf Hansson Subject: [PATCH 3/6] mmc: mmci: Re-work code starting DMA for the qcom variant Date: Wed, 6 Mar 2019 15:04:53 +0100 Message-Id: <20190306140456.28187-4-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190306140456.28187-1-ulf.hansson@linaro.org> References: <20190306140456.28187-1-ulf.hansson@linaro.org> Having mmci_dmae_start() to invoke the shared function, dml_start_xfer(), explicitly for the qcom variant isn't very nice. Let's clean up this code by moving the qcom specific parts into the qcom ->dma_start() callback and then drop dml_start_xfer() altogether. Signed-off-by: Ulf Hansson --- drivers/mmc/host/mmci.c | 4 ---- drivers/mmc/host/mmci_qcom_dml.c | 10 ++++++++-- drivers/mmc/host/mmci_qcom_dml.h | 4 ---- 3 files changed, 8 insertions(+), 10 deletions(-) -- 2.17.1 diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 387ff14587b8..3e5baafb0ce2 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -886,15 +886,11 @@ int mmci_dmae_prep_data(struct mmci_host *host, int mmci_dmae_start(struct mmci_host *host, unsigned int *datactrl) { struct mmci_dmae_priv *dmae = host->dma_priv; - struct mmc_data *data = host->data; host->dma_in_progress = true; dmaengine_submit(dmae->desc_current); dma_async_issue_pending(dmae->cur); - if (host->variant->qcom_dml) - dml_start_xfer(host, data); - *datactrl |= MCI_DPSM_DMAENABLE; return 0; diff --git a/drivers/mmc/host/mmci_qcom_dml.c b/drivers/mmc/host/mmci_qcom_dml.c index b942d4aeeb77..ccc1b1809e73 100644 --- a/drivers/mmc/host/mmci_qcom_dml.c +++ b/drivers/mmc/host/mmci_qcom_dml.c @@ -54,10 +54,15 @@ #define DML_OFFSET 0x800 -void dml_start_xfer(struct mmci_host *host, struct mmc_data *data) +static int qcom_dma_start(struct mmci_host *host, unsigned int *datactrl) { u32 config; void __iomem *base = host->base + DML_OFFSET; + struct mmc_data *data = host->data; + int ret = mmci_dmae_start(host, datactrl); + + if (ret) + return ret; if (data->flags & MMC_DATA_READ) { /* Read operation: configure DML for producer operation */ @@ -96,6 +101,7 @@ void dml_start_xfer(struct mmci_host *host, struct mmc_data *data) /* make sure the dml is configured before dma is triggered */ wmb(); + return 0; } static int of_get_dml_pipe_index(struct device_node *np, const char *name) @@ -188,7 +194,7 @@ static struct mmci_host_ops qcom_variant_ops = { .get_next_data = mmci_dmae_get_next_data, .dma_setup = qcom_dma_setup, .dma_release = mmci_dmae_release, - .dma_start = mmci_dmae_start, + .dma_start = qcom_dma_start, .dma_finalize = mmci_dmae_finalize, .dma_error = mmci_dmae_error, }; diff --git a/drivers/mmc/host/mmci_qcom_dml.h b/drivers/mmc/host/mmci_qcom_dml.h index fa16f6f4d4ad..7e87eb9c4238 100644 --- a/drivers/mmc/host/mmci_qcom_dml.h +++ b/drivers/mmc/host/mmci_qcom_dml.h @@ -17,14 +17,10 @@ #ifdef CONFIG_MMC_QCOM_DML void qcom_variant_init(struct mmci_host *host); -void dml_start_xfer(struct mmci_host *host, struct mmc_data *data); #else static inline void qcom_variant_init(struct mmci_host *host) { } -static inline void dml_start_xfer(struct mmci_host *host, struct mmc_data *data) -{ -} #endif /* CONFIG_MMC_QCOM_DML */ #endif /* __MMC_QCOM_DML_H__ */