From patchwork Fri Aug 22 04:54:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 35788 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f198.google.com (mail-pd0-f198.google.com [209.85.192.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1F60A2055D for ; Fri, 22 Aug 2014 04:54:54 +0000 (UTC) Received: by mail-pd0-f198.google.com with SMTP id fp1sf79907457pdb.1 for ; Thu, 21 Aug 2014 21:54:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=jBbmKprLNGiCMVag+UJ2ILn8ZkUMG2CZvxtZgD0odHk=; b=fARNhAjjN4AK6e9pNlAcUdDaH67H9zZwgtbaVc58VLlb5kVn57IfEnLg9g4K16hVuZ ei0GH9KZ6w4ME1SJRYVjDu1tHninBVFu00qyZHNKa/uNt728mDc7+IG3uNHAE7FjObsu qy4kJF4fIEmSGQRvx0RprRXgYoV43ocnqtwWiWDSaWopDEy0gWtNooCZgp1yGwiV4Cjt wjYtufOvM/ao8C5L5PGJsQO8pJPQiqjcu14OIjkEFgdp2oFxV7LOnTWh33v0HRAI85B0 apJ0uE7M91YE/pTKwWSxyIs8Jkfbo8m85lkbtY+32svaX8uWEg/x3LG1gWAK26jMr4Tq MXuw== X-Gm-Message-State: ALoCoQnykmJuMFunFHbIHDbV+s5VKQFpOTTlh7TjBFPWOC//dObq9xHwmc5LgspjB6oE3ACQnlTF X-Received: by 10.66.156.100 with SMTP id wd4mr2063707pab.31.1408683293398; Thu, 21 Aug 2014 21:54:53 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.93.34 with SMTP id c31ls1060776qge.92.gmail; Thu, 21 Aug 2014 21:54:53 -0700 (PDT) X-Received: by 10.53.12.225 with SMTP id et1mr1934625vdd.5.1408683293290; Thu, 21 Aug 2014 21:54:53 -0700 (PDT) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id id4si13105524vdb.100.2014.08.21.21.54.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 21 Aug 2014 21:54:53 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.173 as permitted sender) client-ip=209.85.220.173; Received: by mail-vc0-f173.google.com with SMTP id hy10so11728253vcb.4 for ; Thu, 21 Aug 2014 21:54:53 -0700 (PDT) X-Received: by 10.220.182.73 with SMTP id cb9mr2328786vcb.9.1408683293119; Thu, 21 Aug 2014 21:54:53 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.45.67 with SMTP id uj3csp191827vcb; Thu, 21 Aug 2014 21:54:52 -0700 (PDT) X-Received: by 10.70.129.162 with SMTP id nx2mr3299069pdb.73.1408683292076; Thu, 21 Aug 2014 21:54:52 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id mw10si3981230pdb.81.2014.08.21.21.54.51 for ; Thu, 21 Aug 2014 21:54:52 -0700 (PDT) Received-SPF: none (google.com: linux-arm-msm-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755835AbaHVEyu (ORCPT + 5 others); Fri, 22 Aug 2014 00:54:50 -0400 Received: from mail-pd0-f182.google.com ([209.85.192.182]:44110 "EHLO mail-pd0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755831AbaHVEyt (ORCPT ); Fri, 22 Aug 2014 00:54:49 -0400 Received: by mail-pd0-f182.google.com with SMTP id fp1so15164251pdb.41 for ; Thu, 21 Aug 2014 21:54:49 -0700 (PDT) X-Received: by 10.66.100.231 with SMTP id fb7mr1633323pab.147.1408683289107; Thu, 21 Aug 2014 21:54:49 -0700 (PDT) Received: from localhost.localdomain ([117.198.85.175]) by mx.google.com with ESMTPSA id q7sm41146668pdo.6.2014.08.21.21.54.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 21 Aug 2014 21:54:47 -0700 (PDT) From: Srinivas Kandagatla To: linux-mmc@vger.kernel.org Cc: Linus Walleij , Chris Ball , Ulf Hansson , Russell King , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH v3 1/3] mmc: mmci: Support any block sizes for ux500v2 and qcom variant Date: Fri, 22 Aug 2014 05:54:32 +0100 Message-Id: <1408683272-7984-1-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1408683219-7939-1-git-send-email-srinivas.kandagatla@linaro.org> References: <1408683219-7939-1-git-send-email-srinivas.kandagatla@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: srinivas.kandagatla@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.173 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Ulf Hansson For the ux500v2 variant of the PL18x block, any block sizes are supported. This will make it possible to decrease data overhead for SDIO transfers. This patch is based on Ulf Hansson patch http://www.spinics.net/lists/linux-mmc/msg12160.html Signed-off-by: Srinivas Kandagatla enabled this support on qcom variant. Signed-off-by: Ulf Hansson Signed-off-by: Linus Walleij --- drivers/mmc/host/mmci.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index c11cb05..533ad2b 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -77,6 +77,7 @@ static unsigned int fmax = 515633; * @qcom_fifo: enables qcom specific fifo pio read logic. * @reversed_irq_handling: handle data irq before cmd irq. * @qcom_dml: enables qcom specific dma glue for dma transfers. + * @any_blksize: true if block any sizes are supported */ struct variant_data { unsigned int clkreg; @@ -102,6 +103,7 @@ struct variant_data { bool qcom_fifo; bool reversed_irq_handling; bool qcom_dml; + bool any_blksize; }; static struct variant_data variant_arm = { @@ -194,6 +196,7 @@ static struct variant_data variant_ux500v2 = { .pwrreg_clkgate = true, .busy_detect = true, .pwrreg_nopower = true, + .any_blksize = true, }; static struct variant_data variant_qcom = { @@ -212,6 +215,7 @@ static struct variant_data variant_qcom = { .explicit_mclk_control = true, .qcom_fifo = true, .qcom_dml = true, + .any_blksize = true, }; static int mmci_card_busy(struct mmc_host *mmc) @@ -239,10 +243,11 @@ static int mmci_card_busy(struct mmc_host *mmc) static int mmci_validate_data(struct mmci_host *host, struct mmc_data *data) { + struct variant_data *variant = host->variant; + if (!data) return 0; - - if (!is_power_of_2(data->blksz)) { + if (!is_power_of_2(data->blksz) && !variant->any_blksize) { dev_err(mmc_dev(host->mmc), "unsupported block size (%d bytes)\n", data->blksz); return -EINVAL; @@ -796,7 +801,6 @@ static void mmci_start_data(struct mmci_host *host, struct mmc_data *data) writel(host->size, base + MMCIDATALENGTH); blksz_bits = ffs(data->blksz) - 1; - BUG_ON(1 << blksz_bits != data->blksz); if (variant->blksz_datactrl16) datactrl = MCI_DPSM_ENABLE | (data->blksz << 16);