From: Ritesh Harjani <riteshh@codeaurora.org>
To: ulf.hansson@linaro.org, linux-mmc@vger.kernel.org
Cc: adrian.hunter@intel.com, alex.lemberg@sandisk.com,
mateusz.nowak@intel.com, Yuliy.Izrailov@sandisk.com,
jh80.chung@samsung.com, dongas86@gmail.com,
asutoshd@codeaurora.org, zhangfei.gao@gmail.com,
sthumma@codeaurora.org, kdorfman@codeaurora.org,
david.griego@linaro.org, stummala@codeaurora.org,
venkatg@codeaurora.org,
Subhash Jadavani <subhashj@codeaurora.org>
Subject: [PATCH RFC 06/10] mmc: host: sdhci: don't set SDMA buffer boundary in ADMA mode
Date: Wed, 15 Jun 2016 18:31:10 +0530 [thread overview]
Message-ID: <1465995674-15816-7-git-send-email-riteshh@codeaurora.org> (raw)
In-Reply-To: <1465995674-15816-1-git-send-email-riteshh@codeaurora.org>
From: Subhash Jadavani <subhashj@codeaurora.org>
SDMA buffer boundary size parameter in block size register should only be
programmed if host controller DMA is operating in SDMA mode otherwise its
better not to set this parameter to avoid any side effect when DMA is
operating in ADMA mode operation.
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
[venkatg@codeaurora.org: fix trivial merge conflict]
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
---
drivers/mmc/host/sdhci.c | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 6bd3d17..ca38018 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -703,6 +703,17 @@ static void sdhci_set_timeout(struct sdhci_host *host, struct mmc_command *cmd)
}
}
+static void sdhci_set_blk_size_reg(struct sdhci_host *host, unsigned int blksz,
+ unsigned int sdma_boundary)
+{
+ if (host->flags & SDHCI_USE_ADMA)
+ sdhci_writew(host, SDHCI_MAKE_BLKSZ(0, blksz),
+ SDHCI_BLOCK_SIZE);
+ else
+ sdhci_writew(host, SDHCI_MAKE_BLKSZ(sdma_boundary, blksz),
+ SDHCI_BLOCK_SIZE);
+}
+
static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_command *cmd)
{
u8 ctrl;
@@ -835,8 +846,7 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_command *cmd)
sdhci_set_transfer_irqs(host);
/* Set the DMA boundary value and block size */
- sdhci_writew(host, SDHCI_MAKE_BLKSZ(SDHCI_DEFAULT_BOUNDARY_ARG,
- data->blksz), SDHCI_BLOCK_SIZE);
+ sdhci_set_blk_size_reg(host, data->blksz, SDHCI_DEFAULT_BOUNDARY_ARG);
sdhci_writew(host, data->blocks, SDHCI_BLOCK_COUNT);
}
@@ -1942,14 +1952,11 @@ static int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode)
*/
if (cmd.opcode == MMC_SEND_TUNING_BLOCK_HS200) {
if (mmc->ios.bus_width == MMC_BUS_WIDTH_8)
- sdhci_writew(host, SDHCI_MAKE_BLKSZ(7, 128),
- SDHCI_BLOCK_SIZE);
+ sdhci_set_blk_size_reg(host, 128, 7);
else if (mmc->ios.bus_width == MMC_BUS_WIDTH_4)
- sdhci_writew(host, SDHCI_MAKE_BLKSZ(7, 64),
- SDHCI_BLOCK_SIZE);
+ sdhci_set_blk_size_reg(host, 64, 7);
} else {
- sdhci_writew(host, SDHCI_MAKE_BLKSZ(7, 64),
- SDHCI_BLOCK_SIZE);
+ sdhci_set_blk_size_reg(host, 64, 7);
}
/*
--
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.
next prev parent reply other threads:[~2016-06-15 13:02 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-15 13:01 [PATCH RFC 00/10] mmc: Add HW Command Queuing Support Ritesh Harjani
2016-06-15 13:01 ` [PATCH RFC 01/10] mmc: core: Add support to read command queue parameters Ritesh Harjani
2016-06-16 8:12 ` Shawn Lin
2016-06-27 7:59 ` Ritesh Harjani
2016-06-15 13:01 ` [PATCH RFC 02/10] mmc: queue: initialization of command queue Ritesh Harjani
2016-06-16 8:55 ` Shawn Lin
2016-06-27 6:12 ` Ritesh Harjani
2016-06-15 13:01 ` [PATCH RFC 03/10] mmc: core: Add command queue initialzation support Ritesh Harjani
2016-06-16 9:01 ` Shawn Lin
2016-06-27 6:18 ` Ritesh Harjani
2016-06-15 13:01 ` [PATCH RFC 04/10] mmc: card: add read/write support in command queue mode Ritesh Harjani
2016-06-15 13:01 ` [PATCH RFC 05/10] mmc: core: add flush request support to command queue Ritesh Harjani
2016-06-15 13:01 ` Ritesh Harjani [this message]
2016-06-15 13:01 ` [PATCH RFC 07/10] mmc: cmdq: support for command queue enabled host Ritesh Harjani
2016-06-17 8:45 ` Shawn Lin
2016-06-27 6:43 ` Ritesh Harjani
2016-06-15 13:01 ` [PATCH RFC 08/10] mmc: core: Add halt support Ritesh Harjani
2016-06-15 13:01 ` [PATCH RFC 09/10] mmc: cmdq-host: add halt support to command queue host Ritesh Harjani
2016-06-17 8:51 ` Shawn Lin
2016-06-27 6:48 ` Ritesh Harjani
2016-06-15 13:01 ` [PATCH RFC 10/10] mmc: sdhci: add command queue support to sdhci Ritesh Harjani
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1465995674-15816-7-git-send-email-riteshh@codeaurora.org \
--to=riteshh@codeaurora.org \
--cc=Yuliy.Izrailov@sandisk.com \
--cc=adrian.hunter@intel.com \
--cc=alex.lemberg@sandisk.com \
--cc=asutoshd@codeaurora.org \
--cc=david.griego@linaro.org \
--cc=dongas86@gmail.com \
--cc=jh80.chung@samsung.com \
--cc=kdorfman@codeaurora.org \
--cc=linux-mmc@vger.kernel.org \
--cc=mateusz.nowak@intel.com \
--cc=sthumma@codeaurora.org \
--cc=stummala@codeaurora.org \
--cc=subhashj@codeaurora.org \
--cc=ulf.hansson@linaro.org \
--cc=venkatg@codeaurora.org \
--cc=zhangfei.gao@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox