From patchwork Fri Jun 16 12:45:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 105741 Delivered-To: patch@linaro.org Received: by 10.182.29.35 with SMTP id g3csp1258706obh; Fri, 16 Jun 2017 05:49:41 -0700 (PDT) X-Received: by 10.98.8.81 with SMTP id c78mr10956975pfd.213.1497617381294; Fri, 16 Jun 2017 05:49:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497617381; cv=none; d=google.com; s=arc-20160816; b=IskY3P9bam2eP1NPdGT7IeShvMLVWo6+DcMtB+69Wm6FX4LmNg9FdcQH5tzJkiGoAi pFc6BAaj2MZIENnxWG+026zdImJna4k5UQPZSpwvJJBVZ1g4BKEMfPBwI6UnfrQ3OfID c1s4DZ0NsqrR47My14zzkJilG480Cs53dlHDBCs3Ybnm15wQ8q0clhTzEpn+4dmofRfU z3/Oky6qs010dQ02IN79GSvLiy1Ln9+ElVYiihLXRjw+5W9sv21TR480sEbUyH/nzUiH Wi4u4qcO2Kx0EoEY9awP+jgPaI3Svn9TVU87RCN8Zeb5zgSmkk0o3zIpE/YBkmq0uiZt KUnw== 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:dkim-signature :arc-authentication-results; bh=riZg2/6rJlDw38G6o3N598bWT4FJ8P7Igf1SI7WZ3AQ=; b=wupZTR0BkX2WiXUjwgdyad9CPCcRd0cJvlgIIjMscvmxcgInrZymGML/rIsrlmlDr3 eFP5pp3LwjTpe9tu0eDXIbOVXfNL7v6HmSxjXGjV4QqbDWkPom58aDm6FrGKDQKJdbW5 ZS3u1+7qd6gf8Tb9NSMX4W4/1UBCxmTnv38SEk/vINHVdlQxkaLJ6tB/K5BqjygT4Um3 FFemILqNkKHf/AIlokV9wlrLcxOv+c4Tw5AJgiiu0enpFSfUBeLK/TZXbdUh33EFj4hE MlByywtFtyh7Lxn/Ne/ng732mWLryFK1/FeR4g5u6oH+7Rr2LuXiRMNcR94xThjPWyi5 06BA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.b=WGUFLipN; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f5si1883313pgk.495.2017.06.16.05.49.41; Fri, 16 Jun 2017 05:49:41 -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; dkim=pass header.i=@ti.com header.b=WGUFLipN; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753949AbdFPMtY (ORCPT + 25 others); Fri, 16 Jun 2017 08:49:24 -0400 Received: from fllnx209.ext.ti.com ([198.47.19.16]:38682 "EHLO fllnx209.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753797AbdFPMtV (ORCPT ); Fri, 16 Jun 2017 08:49:21 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllnx209.ext.ti.com (8.15.1/8.15.1) with ESMTP id v5GCko0F022399; Fri, 16 Jun 2017 07:46:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1497617210; bh=ekcyfLOdyO+P7+nDZb/2+LMhFQ4gDp/0qnuZkllZ7Yg=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=WGUFLipNZNddlrEw8hoXXJWSBmuX1faKIdsAbdZKLu8BFc4vOXaQf7b04cYXdZ/zs /daGs2uzhdHHlWDGpUTit7dxz7LKO7Ry21dp809bjyd84Ghf9+WMjaWxhgZKmi5g8M ahI4lc8DF6gwVp7ZdzI1GqS1CCDk8L4rrnnTfCog= Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id v5GCkjcY018576; Fri, 16 Jun 2017 07:46:45 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.294.0; Fri, 16 Jun 2017 07:46:44 -0500 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id v5GCjjBp000652; Fri, 16 Jun 2017 07:46:41 -0500 From: Kishon Vijay Abraham I To: Ulf Hansson , Rob Herring , Tony Lindgren , CC: Russell King , Ravikumar Kattekola , , , , , , Subject: [PATCH 13/16] mmc: host: omap_hsmmc: Remove *use_dma* member Date: Fri, 16 Jun 2017 18:15:41 +0530 Message-ID: <20170616124544.15046-14-kishon@ti.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170616124544.15046-1-kishon@ti.com> References: <20170616124544.15046-1-kishon@ti.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org omap_hsmmc doesn't support polled I/O. So remove *use_dma* which is always set to '1'. Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Sekhar Nori --- drivers/mmc/host/omap_hsmmc.c | 37 ++++++++++++++++--------------------- 1 file changed, 16 insertions(+), 21 deletions(-) -- 2.11.0 diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 0887da4f1ff6..f47bade0d6fe 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -238,7 +238,7 @@ struct omap_hsmmc_host { u32 capa; int irq; int wake_irq; - int use_dma, dma_ch; + int dma_ch; struct dma_chan *tx_chan; struct dma_chan *rx_chan; int response_busy; @@ -647,8 +647,8 @@ static void omap_hsmmc_enable_irq(struct omap_hsmmc_host *host, */ irq_mask &= ~(DCRC_EN | DEB_EN); - if (host->use_dma) - irq_mask &= ~(BRR_EN | BWR_EN); + /* BRR and BWR need not be enabled for DMA */ + irq_mask &= ~(BRR_EN | BWR_EN); /* Disable timeout for erases or when using software timeout */ if (cmd && (cmd->opcode == MMC_ERASE || host->data_timeout)) @@ -1001,8 +1001,7 @@ omap_hsmmc_start_command(struct omap_hsmmc_host *host, struct mmc_command *cmd, (cmd->opcode == MMC_SEND_TUNING_BLOCK_HS200)) cmdreg |= DP_SELECT | DDIR; - if (host->use_dma) - cmdreg |= DMAE; + cmdreg |= DMAE; host->req_in_progress = 1; host->last_cmd = cmd->opcode; @@ -1029,7 +1028,7 @@ static void omap_hsmmc_request_done(struct omap_hsmmc_host *host, struct mmc_req omap_hsmmc_disable_irq(host); /* Do not complete the request if DMA is still in progress */ - if (mrq->data && host->use_dma && dma_ch != -1) + if (mrq->data && dma_ch != -1) return; host->mrq = NULL; mmc_request_done(host->mmc, mrq); @@ -1116,7 +1115,7 @@ static void omap_hsmmc_dma_cleanup(struct omap_hsmmc_host *host, int errno) host->dma_ch = -1; spin_unlock_irqrestore(&host->irq_lock, flags); - if (host->use_dma && dma_ch != -1) { + if (dma_ch != -1) { struct dma_chan *chan = omap_hsmmc_get_dma_chan(host, host->data); dmaengine_terminate_all(chan); @@ -1634,12 +1633,10 @@ omap_hsmmc_prepare_data(struct omap_hsmmc_host *host, struct mmc_request *req) return 0; } - if (host->use_dma) { - ret = omap_hsmmc_setup_dma_transfer(host, req); - if (ret != 0) { - dev_err(mmc_dev(host->mmc), "MMC start dma failure\n"); - return ret; - } + ret = omap_hsmmc_setup_dma_transfer(host, req); + if (ret != 0) { + dev_err(mmc_dev(host->mmc), "MMC start dma failure\n"); + return ret; } return 0; } @@ -1650,7 +1647,7 @@ static void omap_hsmmc_post_req(struct mmc_host *mmc, struct mmc_request *mrq, struct omap_hsmmc_host *host = mmc_priv(mmc); struct mmc_data *data = mrq->data; - if (host->use_dma && data->host_cookie) { + if (data->host_cookie) { struct dma_chan *c = omap_hsmmc_get_dma_chan(host, data); dma_unmap_sg(c->device->dev, data->sg, data->sg_len, @@ -1662,19 +1659,18 @@ static void omap_hsmmc_post_req(struct mmc_host *mmc, struct mmc_request *mrq, static void omap_hsmmc_pre_req(struct mmc_host *mmc, struct mmc_request *mrq) { struct omap_hsmmc_host *host = mmc_priv(mmc); + struct dma_chan *c = NULL; if (mrq->data->host_cookie) { mrq->data->host_cookie = 0; return ; } - if (host->use_dma) { - struct dma_chan *c = omap_hsmmc_get_dma_chan(host, mrq->data); + c = omap_hsmmc_get_dma_chan(host, mrq->data); - if (omap_hsmmc_pre_dma_transfer(host, mrq->data, - &host->next_data, c)) - mrq->data->host_cookie = 0; - } + if (omap_hsmmc_pre_dma_transfer(host, mrq->data, + &host->next_data, c)) + mrq->data->host_cookie = 0; } /* @@ -2563,7 +2559,6 @@ static int omap_hsmmc_probe(struct platform_device *pdev) host->mmc = mmc; host->pdata = pdata; host->dev = &pdev->dev; - host->use_dma = 1; host->dma_ch = -1; host->irq = irq; host->mapbase = res->start + pdata->reg_offset;