[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdab4OT_Yzoijgdc7RFBapN8rrN56LYGLeO1vMjb=bu4Mg@mail.gmail.com>
Date: Tue, 13 May 2014 09:29:04 +0200
From: Linus Walleij <linus.walleij@...aro.org>
To: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
Cc: Russell King <linux@....linux.org.uk>,
"linux-mmc@...r.kernel.org" <linux-mmc@...r.kernel.org>,
Chris Ball <chris@...ntf.net>,
Ulf Hansson <ulf.hansson@...aro.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
agross@...cinc.com,
"linux-arm-msm@...r.kernel.org" <linux-arm-msm@...r.kernel.org>
Subject: Re: [PATCH v1 06/11] mmc: mmci: Qcomm: Add 3 clock cycle delay after
register write
On Tue, Apr 29, 2014 at 10:20 AM, <srinivas.kandagatla@...aro.org> wrote:
> From: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
>
> Most of the Qcomm SD card controller registers must be updated to the MCLK
> domain so subsequent writes to registers will be ignored until 3 clock cycles
> have passed.
>
> This patch adds a 3 clock cycle delay required after writing to controller
> registers on Qualcomm SOCs. Without this delay all the register writes are not
> successfull, resulting in not detecting cards.
>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
Sounds like someone decided to clock the internal state machine
in the MMCI using MCLK instead of PCLK :-(
A bit nasty if this ends up in the fastpath (irq) though. Which it
invariably does, right?
> + /*
> + * On QCom SD card controller, registers must be updated to the
> + * MCLK domain so subsequent writes to this register will be ignored
> + * for 3 clk cycles.
> + */
> + if (host->hw_designer == AMBA_VENDOR_QCOM)
> + udelay(1 + ((3 * USEC_PER_SEC)/host->mclk));
Add a new field in vendor data instead, and use DIV_ROUND_UP():
static struct variant_data variant_qcom = {
.mclk_delayed_writes = true,
(...)
if (host->vendor->mclk_delayed_writes)
udelay(DIV_ROUND_UP((3 * USEC_PER_SEC), host->mclk));
You get the idea.
Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists