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: 4761241 Return-Path: X-Original-To: patchwork-linux-arm-msm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id ED92E9F383 for ; Fri, 22 Aug 2014 04:54:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 159B52017A for ; Fri, 22 Aug 2014 04:54:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3FA4620179 for ; Fri, 22 Aug 2014 04:54:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755835AbaHVEyu (ORCPT ); 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-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=0kgDY8LZi68sWBY3PHWUmhUCb3HaRnJ681MpkmhOXb8=; b=RkU4VNlJBeK1j7SrnJUKLULahnS46hihljX1g9Vh+H/mqfRyfvcPscYl7aL5q3soDZ 2Ah0hpd6Q2sagUojPjY/3o5cKblDYGFxwuafQJrYzgb1tw2osy+2G5UhhDupS6IRWREq ZcGEYDbqvCaO8C1wg8g9tLN6P37XfTGqqW6QfIhqIOZ4wh776oBvqrwe6NTGrOkJQj5w jA/1dztxiaXWti1mtLk2Oaqc4OweyuDkP5623gC3+X9bt2JJl9se7ioG37pWPl/rweQ3 PIrFqm8zndJcO9s+k/dWeQxfwq4ol2jn14Sa1+v823HJCUqGOLiB3Vvj/Jv/n6uzA0XP AaUw== X-Gm-Message-State: ALoCoQn9F6kL7jDO/dMXvVM+ev8GnIBGycTKlrHsG9ww8KcdeY2bXBv9XPWUBgtQWcVBxt6RhAER 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: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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);