From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E1852C433EF for ; Wed, 12 Jan 2022 11:15:09 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3EE808313E; Wed, 12 Jan 2022 12:15:07 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=samsung.com header.i=@samsung.com header.b="s/eBT5s1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id ADAF18313E; Wed, 12 Jan 2022 12:15:04 +0100 (CET) Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6209682F89 for ; Wed, 12 Jan 2022 12:14:58 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jh80.chung@samsung.com Received: from epcas1p2.samsung.com (unknown [182.195.41.46]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20220112111453epoutp04f6583a23c05c9abafbd97ebe1a50d95a~JgacBaE3L2289122891epoutp04b for ; Wed, 12 Jan 2022 11:14:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20220112111453epoutp04f6583a23c05c9abafbd97ebe1a50d95a~JgacBaE3L2289122891epoutp04b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1641986093; bh=TSw+/2DnTWCOpt49UsL+FeciRrvUGbqOkhN3NRZlRpQ=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=s/eBT5s1aLW2y1Jd/YaTHrZf+Qor++9uxdG7oaIq9QlE0ckL85w3wg2qgqmo9dKz6 lmYYA8RTi8QY3K1DPgjfE4ODgm9SqqDnDpub5zRl626Tcc4M+oWgF0Fo9lm5YvX/3d Ld0X3Cy77Xm0lAxcC1p6BulbTGgv4YRcmLDnIn6E= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20220112111452epcas1p41ef46339768787d347c0294555384a73~JgaawP_NC1922119221epcas1p4B; Wed, 12 Jan 2022 11:14:52 +0000 (GMT) Received: from epsmges1p3.samsung.com (unknown [182.195.38.233]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4JYlMX0T48z4x9Q9; Wed, 12 Jan 2022 11:14:48 +0000 (GMT) Received: from epcas1p2.samsung.com ( [182.195.41.46]) by epsmges1p3.samsung.com (Symantec Messaging Gateway) with SMTP id ED.5E.09592.728BED16; Wed, 12 Jan 2022 20:14:47 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas1p2.samsung.com (KnoxPortal) with ESMTPA id 20220112111447epcas1p24934e9ca239580b2d799098d9f5b9649~JgaWlXi5d2284322843epcas1p2d; Wed, 12 Jan 2022 11:14:47 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20220112111447epsmtrp22ecaf482deab2d34e6acb48421b4b454~JgaWkxr2_1522215222epsmtrp2h; Wed, 12 Jan 2022 11:14:47 +0000 (GMT) X-AuditID: b6c32a37-28fff70000002578-f1-61deb8270bc3 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id BF.8C.29871.728BED16; Wed, 12 Jan 2022 20:14:47 +0900 (KST) Received: from [10.113.113.235] (unknown [10.113.113.235]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20220112111447epsmtip14d1871a2c7921feac89478f2931fc54e~JgaWbDbEY2849728497epsmtip1e; Wed, 12 Jan 2022 11:14:47 +0000 (GMT) Subject: Re: [PATCH] mmc: dw_mmc: Fixes timeout issue for FIFO mode To: "gtXfined H." Cc: peng.fan@nxp.com, U-Boot Mailing List From: Jaehoon Chung Message-ID: Date: Wed, 12 Jan 2022 20:15:29 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrDKsWRmVeSWpSXmKPExsWy7bCmnq76jnuJBj/m2lg8eLGTxeLHqi+s Fm/3drI7MHvsnHWX3ePsnR2MHhvf7WAKYI7KtslITUxJLVJIzUvOT8nMS7dV8g6Od443NTMw 1DW0tDBXUshLzE21VXLxCdB1y8wB2qSkUJaYUwoUCkgsLlbSt7Mpyi8tSVXIyC8usVVKLUjJ KTAt0CtOzC0uzUvXy0stsTI0MDAyBSpMyM5YMfcde8EL7Yqv276wNTC+k+ti5OSQEDCR+P9q I1MXIxeHkMAORolrl96xQjifGCXuvn3FCOF8Y5Q4eOwmK0zLlJ0bmCESexklFsz5DVX1nlGi YfNNFpAqYQFniT37m9lBbBEBFYm+mT+B4hwczAIOEhdbjUDCbAI6Etu/HWcCsXkF7CSO7FwJ ZrMIqEosvXmcEcQWFYiUuP9jOTtEjaDEyZlPwMZzCgRKbLt2DCzOLCAucevJfCYIW15i+9s5 YMdJCDxil3g+/zILxNUuEh/332OCsIUlXh3fwg5hS0l8freXDaJhGaPEndt/oZz1jBIHti9h g6gylti/dDITxAeaEut36UOEFSV2/p7LCLG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vNRyveLE 3OLSvHS95PzcTYzg0NfS3MG4fdUHvUOMTByMhxglOJiVRHjLYu4mCvGmJFZWpRblxxeV5qQW H2KU5mBREue90HUyXkggPbEkNTs1tSC1CCbLxMEp1cDEEbrdcu00L6W/Z91dnFvvqVUapP0U OJZ8YVtAUE942/+8ebY35NPvMQTsMmW1WPb/eErFapZihuzn0dnyjusVjojx8IhvdrrJKnzy x8u6vDvHVHkaLA/OY9qSUbvMI7/1kSlbL4va5PsfG1a9ldK8+vFkskf4ZNltNxZtO1h7zPNm rfWsTQWLpp+UCK741bn5/Ld93s+drMu6ilML+HxOebxdcadI459u9tt7DdsXREYaXVY43cq9 0OEOp2d7qafo9Ef6s31C2v3cjOZfOd8b6fZcoGKeQrXu9fj1c3ZPnh4wbcaXW5HT6rZscVy7 /Hcmu5nFe2mX5Vo2rcuyferZ58Y+lCk/LF2S7lOWnqHEUpyRaKjFXFScCAB7rUoO7AIAAA== X-CMS-MailID: 20220112111447epcas1p24934e9ca239580b2d799098d9f5b9649 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: SVC_REQ_APPROVE CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20220111102419epcas1p17569dac08e8ccb4e3a07e74e70d83023 References: <20220111102411.16666-1-hmz007@gmail.com> <571db934-3fe0-ff40-f197-63176a3f726e@samsung.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Hi, On 1/12/22 3:17 PM, gtXfined H. wrote: > Hi, > > I switched back to master branch and only made the following changes. > > --- a/drivers/mmc/dw_mmc.c > +++ b/drivers/mmc/dw_mmc.c > @@ -167,6 +167,10 @@ static int dwmci_data_transfer(struct dwmci_host > *host, struct mmc_data *data) > len = 0; > if (data->flags == MMC_DATA_READ && > (mask & (DWMCI_INTMSK_RXDR | > DWMCI_INTMSK_DTO))) { > + if (!(mask & DWMCI_INTMSK_DTO) && > + (dwmci_readl(host, DWMCI_RINTSTS) & > DWMCI_INTMSK_DTO)) { > + printf("warn: DTO changed to 1\n"); > + } > dwmci_writel(host, DWMCI_RINTSTS, > DWMCI_INTMSK_RXDR | You need to set your email-client environment. https://www.kernel.org/doc/html/v5.16/process/email-clients.html?highlight=email > DWMCI_INTMSK_DTO); > while (size) { > @@ -224,6 +228,11 @@ static int dwmci_data_transfer(struct dwmci_host > *host, struct mmc_data *data) > > dwmci_writel(host, DWMCI_RINTSTS, mask); > > +#ifdef CONFIG_SPL_BUILD > + printf("mmc: transfer %8p, %5d, in %4ld (%d, %02x)\n", > + buf, data->blocks, get_timer(start), size, mask); > +#endif > + > return ret; > } > > Then tried the same test and reproduced the timeout issue with the > following logs. > > U-Boot SPL 2022.01-00373-gfe04d885fb-dirty (Jan 12 2022 - 13:52:15 +0800) > Trying to boot from MMC1 > mmc: transfer 3fffac8, 1, in 0 (0, 0c) > mmc: transfer 3fffb80, 1, in 2 (0, 0c) > mmc: transfer 3fffd00, 1, in 1 (0, 0c) > warn: DTO changed to 1 > mmc: transfer 2001c0, 1, in 1001 (0, 04) > mmc_load_image_raw_sector: mmc block read error > Trying to boot from MMC1 > warn: DTO changed to 1 > mmc: transfer 2001c0, 1, in 1001 (0, 04) > mmc_load_image_raw_sector: mmc block read error > SPL: failed to boot from all boot devices > ### ERROR ### Please RESET the board ### > > According to the logs, you can see that the DTO interrupt was > unintentionally cleared I had been tested after set the fifo-mode. It's occurred timeout error. But your patch doesn't work, too. It's not solution to solve this problem. Well, I have checked some code. It seems that there are some bugs about fifo-mode. Best Regards, Jaehoon Chung > > > BR, > Jensen, Huang > > > On Wed, Jan 12, 2022 at 7:04 AM Jaehoon Chung > wrote: > >> On 1/11/22 8:05 PM, gtXfined H. wrote: >>> Hi, >>> >>>> Which board did you test? When you do power-on, is it reproduced every >>> time? >>> >>> I am using Rockchip RK3399 based board - NanoPi R4S for this test. >>> It doesn't appear every time, but it should be encountered once about 20 >>> times. >>> I have run "setenv bootcmd reset; saveenv; reset" for automated testing. >> >> This patch doesn't clarify. >> >> The below commit had been fixed that doesn't work when data read. >> "mmc: dw_mmc: Fixes data read when receiving DTO interrupt in FIFO mode" >> >> It seems that not clearing during reset card. >> (power glitch or other problem..?) >> >> Best Regards, >> Jaehoon Chung >> >>> >>> >>>> Could you change from your ID to your name? >>> >>> This is my first time sending a patch, sorry I didn't notice this, do I >>> need to resend this patch? >>> >>> >>> BR, >>> Jensen, Huang >>> >>> >>> On Tue, Jan 11, 2022 at 6:38 PM Jaehoon Chung >>> wrote: >>> >>>> Hi, >>>> >>>> On 1/11/22 7:24 PM, hmz007 wrote: >>>>> Clearing the DTO interrupt should be unnecessary, and it would >>>>> potentially result in never receiving this interrupt again. >>>>> >>>>> Do power-on or reset from uboot for a while can reproduce the issue: >>>>> dwmci_data_transfer: Timeout waiting for data! >>>>> mmc_load_image_raw_sector: mmc block read error >>>> >>>> Which board did you test? When you do power-on, is it reproduced every >>>> time? >>>> >>>>> >>>>> Tested on NanoPi R4S with SanDisk Extreme PRO 32GB. >>>>> >>>>> Fixes: 8cb9d3ed3a ("mmc: dw_mmc: Fixes data read when receiving DTO >>>> interrupt in FIFO mode") >>>>> Signed-off-by: hmz007 >>>> >>>> Could you change from your ID to your name? >>>> >>>> Best Regards, >>>> Jaehoon Chung >>>> >>>>> --- >>>>> drivers/mmc/dw_mmc.c | 2 +- >>>>> 1 file changed, 1 insertion(+), 1 deletion(-) >>>>> >>>>> diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c >>>>> index a949dad574..8fa26b340b 100644 >>>>> --- a/drivers/mmc/dw_mmc.c >>>>> +++ b/drivers/mmc/dw_mmc.c >>>>> @@ -168,7 +168,7 @@ static int dwmci_data_transfer(struct dwmci_host >>>> *host, struct mmc_data *data) >>>>> if (data->flags == MMC_DATA_READ && >>>>> (mask & (DWMCI_INTMSK_RXDR | >>>> DWMCI_INTMSK_DTO))) { >>>>> dwmci_writel(host, DWMCI_RINTSTS, >>>>> - DWMCI_INTMSK_RXDR | >>>> DWMCI_INTMSK_DTO); >>>>> + DWMCI_INTMSK_RXDR); >>>>> while (size) { >>>>> ret = dwmci_fifo_ready(host, >>>>> DWMCI_FIFO_EMPTY, >>>>> >>>> >>>> >>> >> >> >