Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755317AbbFTWWF (ORCPT ); Sat, 20 Jun 2015 18:22:05 -0400 Received: from mail-yk0-f173.google.com ([209.85.160.173]:33902 "EHLO mail-yk0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754859AbbFTWVw (ORCPT ); Sat, 20 Jun 2015 18:21:52 -0400 MIME-Version: 1.0 In-Reply-To: <1434451039-18195-2-git-send-email-vigneshr@ti.com> References: <1434451039-18195-1-git-send-email-vigneshr@ti.com> <1434451039-18195-2-git-send-email-vigneshr@ti.com> Date: Sun, 21 Jun 2015 00:21:51 +0200 Message-ID: Subject: Re: [PATCH 1/3] mmc: host: omap_hsmmc: Fix DTO and DCRC handling From: Andreas Fenkart To: Vignesh R Cc: Ulf Hansson , Tony Lindgren , NeilBrown , linux-mmc , linux-omap , linux-kernel@vger.kernel.org, Kishon Vijay Abraham I Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2510 Lines: 63 Hi Vignesh, 2015-06-16 12:37 GMT+02:00 Vignesh R : > From: Kishon Vijay Abraham I > > DTO/DCRC errors were not being informed to the mmc core since > commit ae4bf788ee9b ("mmc: omap_hsmmc: consolidate error report handling of > HSMMC IRQ"). This commit made sure 'end_trans' is never set on DTO/DCRC > errors. This is because after this commit 'host->data' is checked after > it has been cleared to NULL by omap_hsmmc_dma_cleanup(). > > Because 'end_trans' is never set, omap_hsmmc_xfer_done() is never invoked > making core layer not to be aware of DTO/DCRC errors. Because of this > any command invoked after DTO/DCRC error leads to a hang. > > Fix this by checking for 'host->data' before it is actually cleared. This really fixes the problem, thanks for the analysis TESTED-BY > > Fixes: ae4bf788ee9b ("mmc: omap_hsmmc: consolidate error report handling of > HSMMC IRQ") > > CC: stable@vger.kernel.org > Signed-off-by: Kishon Vijay Abraham I > Signed-off-by: Vignesh R > --- > drivers/mmc/host/omap_hsmmc.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c > index 9df2b6801f76..d0abdffb0d7c 100644 > --- a/drivers/mmc/host/omap_hsmmc.c > +++ b/drivers/mmc/host/omap_hsmmc.c > @@ -1062,6 +1062,10 @@ static void omap_hsmmc_do_irq(struct omap_hsmmc_host *host, int status) > > if (status & (CTO_EN | CCRC_EN)) > end_cmd = 1; > + if (host->data || host->response_busy) { > + end_trans = !end_cmd; > + host->response_busy = 0; > + } > if (status & (CTO_EN | DTO_EN)) > hsmmc_command_incomplete(host, -ETIMEDOUT, end_cmd); > else if (status & (CCRC_EN | DCRC_EN)) > @@ -1081,10 +1085,6 @@ static void omap_hsmmc_do_irq(struct omap_hsmmc_host *host, int status) > } > dev_dbg(mmc_dev(host->mmc), "AC12 err: 0x%x\n", ac12); > } > - if (host->data || host->response_busy) { > - end_trans = !end_cmd; > - host->response_busy = 0; > - } > } > > OMAP_HSMMC_WRITE(host->base, STAT, status); > -- > 2.4.1 > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in Please read the FAQ at http://www.tux.org/lkml/