From patchwork Mon Jul 22 13:09:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 169390 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp7509198ilk; Mon, 22 Jul 2019 06:10:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqwsHfJK9wM3MEBDf/blZivmuVxhhur0FLj2eHjoF4f2uupoU1ieZDu9jjt5RuE3Crj58phE X-Received: by 2002:a17:90a:ff17:: with SMTP id ce23mr76780898pjb.47.1563801031936; Mon, 22 Jul 2019 06:10:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563801031; cv=none; d=google.com; s=arc-20160816; b=YFtRKFepI2kntpPyWJQgSnyhggAFKSXqWP/5BeA9EcDiQ6+Q89LSkI9rtQrusM0EP4 ShUoW9Yqh+AlKMIWl5pQiw5rnEuGOlucouTXRGsFMFPilCUoHKijkHM2sWZB7JqviipG MmUJwoqCL8D/EA+Dj4/77sTsPsHJBW+cCVLg+Q28QYc5QThgOQGSQZEp+5cNUytvYb21 5Kk7+9owQlmlDS7hA0Ur1mDivOD4GBYK1wqQQ3Os03sfD70cA/jiItY7885EfanFiDwN jzXu4HbPI2r8dE9w7y2sitqq/+Bn41EVDwEn5ac5URi2vKxuPwc4Hc+oUksuKGYAa6np h00A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=nK15mMz9psJ4xYNbb/viJ2eSjpHSRghs1AoPCx3Qibw=; b=d0eWxSn/8j/1TQe9BPVJ32H7rt0xU0WtYQ35XfeHjQeShxs6zGqF9DP+uwrlsG4R2y VSaH8OAmvdQQpn5sJX9GtZMhP/uopk1zwq4eTNluF95tuivJFQWHfBQRUQnvrsWQCXU1 imJ7xu18P/zBiB0pxkPB7ecvI7nT3pYNLjvnStUAKC/eCfdq8nytG2P8XokOdiYiG2WW 5wQgvfp5eqax8AcF0KYa3TUm2/5gL8DcRjpTz1Meb51oe8Dm0E8NSt2Ui0X6SML8r/vR Tj7TojuWnB/DhKovMqCcNms5dkoJYkVWW0JfXsuZnekZJYVWm1zIa5yVu9WcGadkLaNT xSvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KY1bnd4U; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z2si8370290pgv.417.2019.07.22.06.10.31; Mon, 22 Jul 2019 06:10:31 -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=@linaro.org header.s=google header.b=KY1bnd4U; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730455AbfGVNK3 (ORCPT + 29 others); Mon, 22 Jul 2019 09:10:29 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:43086 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730264AbfGVNK0 (ORCPT ); Mon, 22 Jul 2019 09:10:26 -0400 Received: by mail-pg1-f194.google.com with SMTP id f25so17631509pgv.10 for ; Mon, 22 Jul 2019 06:10:26 -0700 (PDT) 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 :in-reply-to:references; bh=nK15mMz9psJ4xYNbb/viJ2eSjpHSRghs1AoPCx3Qibw=; b=KY1bnd4Up1tXXPW2ZmnY4asvQ3zqGzy3u3b1KUBtemsy/00kmw7MuqyaQeqIKTwo9Y 71DSBIUgWn9dRmVialFx4Joe3zX5wJ3d6HasrDvAlfxWeltqtCqgo3qWTHcd38Tqgwec 0O3V3bS09p9DpBrbf1r6vLUM0Gj1uSr/P01k9rClYJIwmhLZrD9HqLIBnDN3VsIsVVr9 rMw0i9EVoiUHIQbpGJfm02M1gMj+Sa24Heh0UYaRRoV3q2ZuI5BuqfR0YE1q5mGxJlWX Z714pEfRJyiEtR6dq9EnC2Wl/g6fjwzXljrMMCca0NnDyp+iyt9CbMTkpw3XQn44z/1+ p+sA== 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:in-reply-to:references; bh=nK15mMz9psJ4xYNbb/viJ2eSjpHSRghs1AoPCx3Qibw=; b=e36bVjOlqtYL/kPuZ3UC87C+7euqTqdLzErxM1JshoYRGGiXo5uQY1Ejlb689ft4dn /UrEPg1QOLmLBbawueEsdMqSb8gJryClvDqsehQXb53sizwU8grwumxYkoMtuzHF8v8r C0nm47pad/3KpSHZAMQOgkwOtecRn83enWDMpG0z9Hm69cs7fYp2ot6mGxCNuF8myizW QMfodQ5g6clGF4uvIMufHmv96XTL7J++xxH+fK/Kk0u07TGk5N5VOlYqOXpPDT3xzz/8 VBzy9DCmwl3lZ4UsAwGC0gDcoEJFoey8nT8ezX8xODnQin17dpDo7hZUG8ybQFX7zosI fItQ== X-Gm-Message-State: APjAAAXBGEqO7s8OCmKw9fJ68FA82eFmraniaIxePzuT+ivOZYiVcn9F 3jfu1P2Wm1YVZmXJh0Vjsl/Uuw== X-Received: by 2002:a17:90a:37e9:: with SMTP id v96mr75508203pjb.10.1563801025887; Mon, 22 Jul 2019 06:10:25 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id p19sm47013192pfn.99.2019.07.22.06.10.22 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 22 Jul 2019 06:10:25 -0700 (PDT) From: Baolin Wang To: axboe@kernel.dk, adrian.hunter@intel.com, ulf.hansson@linaro.org Cc: zhang.lyra@gmail.com, orsonzhai@gmail.com, arnd@arndb.de, linus.walleij@linaro.org, baolin.wang@linaro.org, vincent.guittot@linaro.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org Subject: [RFC PATCH 5/7] mmc: host: sdhci: Remove redundant sg_count member of struct sdhci_host Date: Mon, 22 Jul 2019 21:09:40 +0800 Message-Id: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The mmc_data structure has a member to save the mapped sg count, so no need introduce a redundant sg_count of struct sdhci_host, remove it. This is also a preparation patch to support ADMA3 transfer mode. Signed-off-by: Baolin Wang --- drivers/mmc/host/sdhci.c | 12 +++++------- drivers/mmc/host/sdhci.h | 2 -- 2 files changed, 5 insertions(+), 9 deletions(-) -- 1.7.9.5 diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 5760b7c..9fec82f 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -696,7 +696,7 @@ static void sdhci_adma_mark_end(void *desc) } static void sdhci_adma_table_pre(struct sdhci_host *host, - struct mmc_data *data, int sg_count) + struct mmc_data *data) { struct scatterlist *sg; unsigned long flags; @@ -710,14 +710,12 @@ static void sdhci_adma_table_pre(struct sdhci_host *host, * We currently guess that it is LE. */ - host->sg_count = sg_count; - desc = host->adma_table; align = host->align_buffer; align_addr = host->align_addr; - for_each_sg(data->sg, sg, host->sg_count, i) { + for_each_sg(data->sg, sg, data->sg_count, i) { addr = sg_dma_address(sg); len = sg_dma_len(sg); @@ -788,7 +786,7 @@ static void sdhci_adma_table_post(struct sdhci_host *host, bool has_unaligned = false; /* Do a quick scan of the SG list for any unaligned mappings */ - for_each_sg(data->sg, sg, host->sg_count, i) + for_each_sg(data->sg, sg, data->sg_count, i) if (sg_dma_address(sg) & SDHCI_ADMA2_MASK) { has_unaligned = true; break; @@ -800,7 +798,7 @@ static void sdhci_adma_table_post(struct sdhci_host *host, align = host->align_buffer; - for_each_sg(data->sg, sg, host->sg_count, i) { + for_each_sg(data->sg, sg, data->sg_count, i) { if (sg_dma_address(sg) & SDHCI_ADMA2_MASK) { size = SDHCI_ADMA2_ALIGN - (sg_dma_address(sg) & SDHCI_ADMA2_MASK); @@ -1094,7 +1092,7 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_command *cmd) WARN_ON(1); host->flags &= ~SDHCI_REQ_USE_DMA; } else if (host->flags & SDHCI_USE_ADMA) { - sdhci_adma_table_pre(host, data, sg_cnt); + sdhci_adma_table_pre(host, data); sdhci_writel(host, host->adma_addr, SDHCI_ADMA_ADDRESS); if (host->flags & SDHCI_USE_64_BIT_DMA) diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index 010cc29..4548d9c 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -584,8 +584,6 @@ struct sdhci_host { struct sg_mapping_iter sg_miter; /* SG state for PIO */ unsigned int blocks; /* remaining PIO blocks */ - int sg_count; /* Mapped sg entries */ - void *adma_table; /* ADMA descriptor table */ void *align_buffer; /* Bounce buffer */ void *integr_table; /* ADMA3 intergrate descriptor table */