Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753426Ab3CRKVi (ORCPT ); Mon, 18 Mar 2013 06:21:38 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:28328 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752356Ab3CRKVf (ORCPT ); Mon, 18 Mar 2013 06:21:35 -0400 X-AuditID: cbfee691-b7f5f6d000002fda-0f-5146eaadc0ff Message-id: <5146EAB0.1030705@samsung.com> Date: Mon, 18 Mar 2013 19:21:36 +0900 From: Jaehoon Chung User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130221 Thunderbird/17.0.3 MIME-version: 1.0 To: Doug Anderson Cc: Chris Ball , Will Newton , Seungwon Jeon , Bing Zhao , Jaehoon Chung , Ashok Nagarajan , Paul Stewart , Olof Johansson , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] RFC: mmc: dw_mmc: Always go to STATE_DATA_BUSY from STATE_DATA_ERROR References: <1363382956-14557-1-git-send-email-dianders@chromium.org> In-reply-to: <1363382956-14557-1-git-send-email-dianders@chromium.org> Content-type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrNIsWRmVeSWpSXmKPExsVy+t8zbd21r9wCDSatVbTYvC7eYt7Wo6wW 219vZLM4u+wgm8WNX22sFpd3zWGzOPK/n9Hi1PXPbBYb7k5ltfhw/yKzxcJNh9gcuD1mN1xk 8dg56y67x6Eraxk9rpxoYvWYvPAis0ffllWMHp83yQWwR3HZpKTmZJalFunbJXBl3GqdwVTw Rqji9rmzrA2MHfxdjJwcEgImEov637FD2GISF+6tZ+ti5OIQEljGKNH67zZQggOsaEpvPkiN kMB0RokvG0wgal4ySjT9msAKkuAV0JL4PXUOE4jNIqAq8XTbREYQm01AR2L7t+NgcVGBMInZ 188yQ9QLSvyYfI8FxBYR0JR41vCSGWQos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E0tSC5oDgp PddQrzgxt7g0L10vOT93EyM4HTyT2sG4ssHiEKMAB6MSD++O9W6BQqyJZcWVuYcYJTiYlUR4 HW8DhXhTEiurUovy44tKc1KLDzEmA4NgIrOUaHI+MFXllcQbGpuYGVkamRmbmBsbkyasJM57 oNU6UEggPbEkNTs1tSC1CGYLEwenVAPjiZAdh67cvsVQ8/65iDlT95Q4gcmvL8U8y1nhkqgV EnX5772fCyMncx6W4PgZdt6K30Zctj7xfYvu0akXW7jiDnNGBKb9zt+WHix+0bV4ro17g9zG rlmuN7er/pfynFpaku5U43HaQ8PaX1DDm9v2fre66c+3B3leXVNgcmf61PFBLSbk5gMlluKM REMt5qLiRACSOoX7SwMAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2593 Lines: 69 Hi Doug, Great..i have found the problem like this. I will check your patch..and share the result. Best Regards, Jaehoon Chung On 03/16/2013 06:29 AM, Doug Anderson wrote: > On a flaky piece of hardware that seems good at generating CRC errors, > we have found that often times the CRC errors don't get reported > properly when using CONFIG_MMC_DW_IDMAC (they get reported OK when > using pio). > > The flow that happens is: > 1. dw_mci_interrupt() fires and status=80b8, pending=8088 so that > we hit (pending & DW_MCI_DATA_ERROR_FLAGS). We store 8088 in > data_status and set EVENT_DATA_ERROR in host->pending_events > 2. We schedule the tasklet and it runs. > 3. We're in STATE_SENDING_DATA in the tasklet and see > EVENT_DATA_ERROR so we dw_mci_stop_dma(). > 4. dw_mci_stop_dma() calls dw_mci_idmac_stop_dma() and > dw_mci_dma_cleanup(). These stop dma but _don't_ set > EVENT_XFER_COMPLETE (since we're host->using_dma). > 5. data->stop is NULL so we don't send a stop command. > 6. We move onto STATE_DATA_ERROR and loop again in the tasklet. > 7. We hit STATE_DATA_ERROR but the transfer isn't done, so the tasklet > stops. > > We never seem to get any additional DMA interrupts that cause > EVENT_XFER_COMPLETE and restart the tasklet so we just hang. That > doesn't seem surprising given that we've stopped DMA. > > We did put a print at the end of dw_mci_interrupt() to show the result > of the "mci_readl(host, IDSTS)" and saw 0xa000 in the case of the > above CRC error. > > A proposed fix for this is to ignore (but still clear) the > EVENT_XFER_COMPLETE in STATE_DATA_ERROR in the tasklet. > > Reported-by: Bing Zhao > Signed-off-by: Doug Anderson > --- > drivers/mmc/host/dw_mmc.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c > index 9834221..696b3bb 100644 > --- a/drivers/mmc/host/dw_mmc.c > +++ b/drivers/mmc/host/dw_mmc.c > @@ -1137,10 +1137,7 @@ static void dw_mci_tasklet_func(unsigned long priv) > goto unlock; > > case STATE_DATA_ERROR: > - if (!test_and_clear_bit(EVENT_XFER_COMPLETE, > - &host->pending_events)) > - break; > - > + clear_bit(EVENT_XFER_COMPLETE, &host->pending_events); > state = STATE_DATA_BUSY; > break; > } > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/