[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAD=FV=Xxoo=HGhLad4pr=TKN7sWQ5Pzai=dGGvUUZe173DhLOA@mail.gmail.com>
Date: Thu, 19 Feb 2015 14:39:53 -0800
From: Doug Anderson <dianders@...omium.org>
To: Addy Ke <addy.ke@...k-chips.com>
Cc: Rob Herring <robh+dt@...nel.org>, Pawel Moll <pawel.moll@....com>,
Mark Rutland <mark.rutland@....com>,
Ian Campbell <ijc+devicetree@...lion.org.uk>,
Kumar Gala <galak@...eaurora.org>,
Randy Dunlap <rdunlap@...radead.org>,
Seungwon Jeon <tgih.jun@...sung.com>,
Jaehoon Chung <jh80.chung@...sung.com>,
Chris Ball <chris@...ntf.net>,
Ulf Hansson <ulf.hansson@...aro.org>,
Dinh Nguyen <dinguyen@...era.com>,
Heiko Stübner <heiko@...ech.de>,
Olof Johansson <olof@...om.net>,
Sonny Rao <sonnyrao@...omium.org>,
Alexandru Stan <amstan@...omium.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-mmc@...r.kernel.org" <linux-mmc@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"open list:ARM/Rockchip SoC..." <linux-rockchip@...ts.infradead.org>,
"zhenfu.fang" <zhenfu.fang@...k-chips.com>,
Eddie Cai <cf@...k-chips.com>, lintao <lintao@...k-chips.com>,
chenfen <chenfen@...k-chips.com>, zyf <zyf@...k-chips.com>,
Jianqun Xu <xjq@...k-chips.com>,
Tao Huang <huangtao@...k-chips.com>,
Chris <zyw@...k-chips.com>,
姚智情 <yzq@...k-chips.com>,
Han Jiang <hj@...k-chips.com>,
Kever Yang <kever.yang@...k-chips.com>,
zhangqing <zhangqing@...k-chips.com>,
Lin Huang <hl@...k-chips.com>,
Alim Akhtar <alim.akhtar@...il.com>,
Javier Martinez Canillas <javier.martinez@...labora.co.uk>
Subject: Re: [PATCH] mmc: dw_mmc: fix bug that cause mmc_test failture
Addy,
Your subject needs work. It should at least touch on what the bug
was. Please use a subject more like:
mmc: dw_mmc: fix mmc_test by not sending abort for DRTO / EBE errors
On Mon, Jan 26, 2015 at 4:04 AM, Addy Ke <addy.ke@...k-chips.com> wrote:
> The STOP command can terminate a data transfer between a memory card and
> mmc controller.
>
> As show in Synopsys DesignWare Cores Mobile Stroage Host Databook:
> Data timeout and Data end-bit error will terminate further data transfer
> by mmc controller. So we should not send abort command to terminate a
> data transfer again if we got DRTO and EBE interrupt.
OK, I see this in the section "Error Detection".
Looking at the section titled "Error Handling" in the version of the
databook I see it suggesting "STOP or ABORT" in the case of Data
Errors which might include "end bit not found". In another section
(the Card Interface Unit (CIU) section) it talks about the data end
bit error and suggests issuing the stop/abort command.
...that being said, it does appear that you're right that we don't
want to send an abort in the EBE case since it appears necessary to
fully fix mmc_test...
> After this patch, all mmc_test cases can pass on RK3288-Pink2 board.
I didn't find this to be the case. I asked Alexandru to
double-confirm for me and he agrees, it doesn't fix mmc_test.
Probably because your code is broken. See below.
> Signed-off-by: Addy Ke <addy.ke@...k-chips.com>
> ---
> drivers/mmc/host/dw_mmc.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index 4d2e3c2..4bd7df1 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -1520,7 +1520,10 @@ static void dw_mci_tasklet_func(unsigned long priv)
> if (test_and_clear_bit(EVENT_DATA_ERROR,
> &host->pending_events)) {
> dw_mci_stop_dma(host);
> - send_stop_abort(host, data);
> + if (data->stop ||
> + !(host->data_status & SDMMC_INT_DRTO) ||
> + !(host->data_status & SDMMC_INT_EBE))
> + send_stop_abort(host, data);
Your concept appears right, but your code is totally wrong. Let's
imagine that data->stop is NULL so your check matters. Now:
DRTO is set, EBE is set: you won't send stop abort
DRTO is set, EBE is _not_ set: you _will_ send stop aborft
DRTO is _not_ set, EBE is set: you _will_ send stop aborft
I can fix this with:
- !(host->data_status & SDMMC_INT_DRTO) ||
- !(host->data_status & SDMMC_INT_EBE))
+ !(host->data_status & (SDMMC_INT_DRTO |
+ SDMMC_INT_EBE)))
When I do that then mmc_test is working much better. Note that is
appears that both EBE and DRTO are necessary here. Can you please
respin? Please make sure to include Addy and Javier on your patch as
they may be able to do some extra testing.
-Doug
--
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