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 61C80C433F5 for ; Fri, 7 Oct 2022 12:34:55 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CC02684E7C; Fri, 7 Oct 2022 14:34:52 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="TLMoL8Tc"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4AB3784E7D; Fri, 7 Oct 2022 14:34:51 +0200 (CEST) Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 74E8184E7A for ; Fri, 7 Oct 2022 14:34:48 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jh80.chung@gmail.com Received: by mail-pg1-x532.google.com with SMTP id j71so4585060pge.2 for ; Fri, 07 Oct 2022 05:34:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=9MTpumQyfz2iLc8/xoHfcvYU6G5GB2z8cWBub9dLxaw=; b=TLMoL8Tca/rpXx6Vydof9/Sd4oPciokxC0O2PqBDqJ6rSTIqh5ILCjrYGot38d25Lq stDtDdhh7G5z1/pVmsltg0KrDHzoABBqmo+32dzc/OK2slzARLiUW+r7Qzt2AZ7Re95B NgRitV6hTxGjlFwLvt6dB2RnGOfyu/R3Az9+P1+XYrOi6gtgNE8dH0EfEl+f5awdxGyf jYqa8AH7mirw0skq0qZOQoZbvyacQ4vIkpfoaFcHVk+uN+J4ylhSYJf1dcac9YJkuCHs XgApfT/5MTY2NgDKIFag106BJn+MWnAM5N2VU5c51E/f3mODk8zbcTIGWj2EbWU/ar8J osPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9MTpumQyfz2iLc8/xoHfcvYU6G5GB2z8cWBub9dLxaw=; b=aDCTW2vxb7tjNa9vvbn3WWYkNnqbFubnv8zxNaQpxxx29SWd25HEp5bmCGGmYOgks+ ZT5VET/YgpI9QqIXukyXC1QrzGJcu08BcuYNKRIsMvyH/p5HWKnuxs2tPFoLjKukr+69 zFS5OP9CxQdlHh+HOx/07PN0IZjFlK1zFDZhRhnzuhGi955H1FAqQWKWcUnLXrZ+UAtc Jf0eeGa55jmEqO/RctOxTS9puiX2CUT4jZ6ZO2xPIN+aC8ERfF0a/QkvSeZ7QKy8Wc/5 JU7s27UWM70q39dCbWQYjX8DY6QKL04jbClRxxmXHARBGKqEa+yEcVL5S0QxFtoxw+vN z87Q== X-Gm-Message-State: ACrzQf3GI29X5i4k1Q/IlbHyknUQQpx7V5s8ichSiPPIzchd+4IbvnxR OSd/0syis/wcXoIsy4soILHmAC+R0IJliQ== X-Google-Smtp-Source: AMsMyM4P4AShyt+C2u/eDED+njysWJCGN1UxwNyNHKoShhcxiPBQlR1FSqxwLR3CQwjXK9Z5y/YWRQ== X-Received: by 2002:a63:5b58:0:b0:452:2ba4:f86b with SMTP id l24-20020a635b58000000b004522ba4f86bmr4233822pgm.223.1665146086786; Fri, 07 Oct 2022 05:34:46 -0700 (PDT) Received: from [192.168.0.19] ([183.99.112.216]) by smtp.gmail.com with ESMTPSA id e14-20020a056a0000ce00b005626a1c77c8sm1494543pfj.80.2022.10.07.05.34.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 07 Oct 2022 05:34:46 -0700 (PDT) Message-ID: Date: Fri, 7 Oct 2022 21:34:43 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH] mmc: dwmmc: only clear handled interrupts Content-Language: en-US To: John Keeping , Jaehoon Chung Cc: Peng Fan , u-boot@lists.denx.de References: <20220915175656.3447093-1-john@metanate.com> From: Jaehoon Chung In-Reply-To: <20220915175656.3447093-1-john@metanate.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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.6 at phobos.denx.de X-Virus-Status: Clean On 9/16/22 02:56, John Keeping wrote: > Unconditionally clearing DTO when RXDR is set leads to spurious timeouts > in FIFO mode transfers if events occur in the following order: > > mask = dwmci_readl(host, DWMCI_RINTSTS); > > // Hardware asserts DWMCI_INTMSK_DTO here > > dwmci_writel(host, DWMCI_RINTSTS, DWMCI_INTMSK_DTO); > > if (mask & DWMCI_INTMSK_DTO) { > // Unreachable as DTO is cleared without being handled! > return 0; > } > > Only clear interrupts that we have seen and are handling so that DTO is > not missed. > > Signed-off-by: John Keeping Reviewed-by: Jaehoon Chung Best Regards, Jaehoon Chung > --- > drivers/mmc/dw_mmc.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c > index 4232c5eb8c..5085a3b491 100644 > --- a/drivers/mmc/dw_mmc.c > +++ b/drivers/mmc/dw_mmc.c > @@ -168,7 +168,8 @@ 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); > + mask & (DWMCI_INTMSK_RXDR | > + DWMCI_INTMSK_DTO)); > while (size) { > ret = dwmci_fifo_ready(host, > DWMCI_FIFO_EMPTY,