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: 4761251 Return-Path: X-Original-To: patchwork-linux-mmc@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 B634D9F7CB for ; Fri, 22 Aug 2014 04:54:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E7A71201BA 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 15CBF201B4 for ; Fri, 22 Aug 2014 04:54:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755833AbaHVEyu (ORCPT ); Fri, 22 Aug 2014 00:54:50 -0400 Received: from mail-pd0-f169.google.com ([209.85.192.169]:43778 "EHLO mail-pd0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755830AbaHVEyt (ORCPT ); Fri, 22 Aug 2014 00:54:49 -0400 Received: by mail-pd0-f169.google.com with SMTP id y10so15068242pdj.0 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=hyd5a0lCt3VC8Ymdk/cnQuvhXVtyaa3AwW9kSezRpEgvvA/nLwQR9tnuptS12Bg+yu AbTHLYGsfxjssU/CxsWmPf8B0DYnzkwaV8yscw42J5rQxO1kGW4hd3mnWJRGN5jdnl7D RgVU5JXclaWER1Nu5cNmiqDF//Vby4Ywlj/jU0ClrAoCppmB62LS+j560jEFQZeLCfXr QASHbmj8b6lkzaxqBlI+/1s5j7CRaxToN2sWdZUjN1zSyTeJGvAP4rbiA4QSTCEFh+5n I0OuaG/vvFp2cwqqTn4vB0+ShIMoCYLSr/eXCG53vBLdjGRt8UAUwWpIeaRFwN5J4s7X goiw== X-Gm-Message-State: ALoCoQkxqtDL+NT9YxWAZprIrIB82aRo24881PBFtnaP1Mk8A/NDw8BjpFTXh6Em1sluy7QFY0Wf 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-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@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=unavailable 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);