Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1900422pxb; Fri, 5 Feb 2021 04:27:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJy/V5iqcrJ1MqEKjlfP31yOzMBG6Vw4BgBxTAjkeevCH96GhuZu7eP9VkQ3rOijBkpadV3C X-Received: by 2002:a17:906:dfce:: with SMTP id jt14mr3858733ejc.345.1612528076094; Fri, 05 Feb 2021 04:27:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612528076; cv=none; d=google.com; s=arc-20160816; b=qDMxRpUXRwK5zW8qAfp6PqTaHmuvfUWbfnpGg/CFt9xJiMBvdSRmN0hagMQonuOGi2 1y2yVhuxp9NaqTQef9oegkYo0TGPVOV7Rh3oMLbdKX0a4LjIvBzywdW4GMmFFDfvkP8y 4pQ98Z97J3nCEq8sQ+cHjG30jgL4l9EUQrAhgvDCT3x2l5EAg0eXgDEUpFxxbE0EwYId 0UCaWvW03cLULdV6atUUrcFXH1t2Dy0hxrZufeNSd0Yj7UcW9ZTkB+MANjXbTw5Zn/Fg 9GiyWJ09SpXr2uPGJBAk7sV79aPLO0HDlpE+gmiHR/xoHrNNJk/RLYPMfWNdCedqreCS 6AKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=TgkwKl2BECy0Q+4thRnTns/kLvVDeFiR+zC2ZUA0n98=; b=mjlAXDqodBWyPNbhch/HO9RCBA+SPxTq2x/uj8Jhlq8fZNiDXh59ZLaksV8FV0Z8l9 XlrLC0eIjzCNIPhiuOR0LRz0BDLSi9+pvOhVVcj1aoVYminoGUmG52g8QrQAhwCXaRlz +6tl6clXF5ZuZdp5/KDpgoHuVqDEUNWPP99hd8YZk86JF8o7wU61LBR+Y2FrXskBmYxO fvhsoCJg0U+Uqp9QcleAUaA4L393l1R5wMgWUc1y0gDgnbCNlAc7e/YtH+oDC3nhi3l4 EVEkYtrBQ0cZj80lhuVOXa7MbxU6Py7WN9N/ol7Gym7krgZab7OurVoPzM9z1CQGKwQy Xzvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=ZaGbZ3Wn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g20si4855848edb.494.2021.02.05.04.27.30; Fri, 05 Feb 2021 04:27:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=ZaGbZ3Wn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231784AbhBEMXi (ORCPT + 99 others); Fri, 5 Feb 2021 07:23:38 -0500 Received: from mx07-00178001.pphosted.com ([185.132.182.106]:54607 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231934AbhBEMUa (ORCPT ); Fri, 5 Feb 2021 07:20:30 -0500 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 115CCNU0017758; Fri, 5 Feb 2021 13:19:34 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=selector1; bh=TgkwKl2BECy0Q+4thRnTns/kLvVDeFiR+zC2ZUA0n98=; b=ZaGbZ3WnKyL+34zPpozlCxSsS1fDB+i8+Jne3JsCO7zziBNZjFyM8lUk9Lsu/WWFKuyt 4uBOmwiOufLR+SuB2/GAJJPgb6tF5hEHQNLdp2X0fg4s3L40YJnAC7DNmRUf4Ro/bBdK BRtHkH0h4yhVzqHtt/w0M3MGTqUdkraDptCN/Sn0ubB/BFBr56gykoa1xarY2yzef7cj yQS5+Acm8l2hifU7r2hjsdSCsxmf5WU2/y6+L6A435wMcesa93KPa2ePYQ4vZw+pbCOa SPNMRfqeTSLq3sQxkIKFZImibAilqCV+U1Uhdc80q2mkG6Z4KKjizNcccxTKIHq4k9ZR Ag== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 36d0fsen70-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 05 Feb 2021 13:19:34 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id D8A7B10002A; Fri, 5 Feb 2021 13:19:33 +0100 (CET) Received: from Webmail-eu.st.com (sfhdag2node3.st.com [10.75.127.6]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id AF04122FF07; Fri, 5 Feb 2021 13:19:33 +0100 (CET) Received: from lmecxl0504.lme.st.com (10.75.127.50) by SFHDAG2NODE3.st.com (10.75.127.6) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 5 Feb 2021 13:19:33 +0100 Subject: Re: [PATCH 1/2] mmc: mmci: enable MMC_CAP_NEED_RSP_BUSY To: Ulf Hansson CC: Russell King , Linus Walleij , , =?UTF-8?Q?Marek_Va=c5=a1ut?= , "linux-mmc@vger.kernel.org" , Linux Kernel Mailing List References: <20210204120547.15381-1-yann.gautier@foss.st.com> <20210204120547.15381-2-yann.gautier@foss.st.com> From: Yann GAUTIER Message-ID: Date: Fri, 5 Feb 2021 13:19:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.75.127.50] X-ClientProxiedBy: SFHDAG2NODE1.st.com (10.75.127.4) To SFHDAG2NODE3.st.com (10.75.127.6) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369,18.0.737 definitions=2021-02-05_07:2021-02-05,2021-02-05 signatures=0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/5/21 10:53 AM, Ulf Hansson wrote: > - trimmed cc-list > > On Thu, 4 Feb 2021 at 13:08, wrote: >> >> From: Yann Gautier >> >> To properly manage commands awaiting R1B responses, the capability >> MMC_CAP_NEED_RSP_BUSY is enabled in mmci driver, for variants that >> manage busy detection. >> This R1B management needs both the flags MMC_CAP_NEED_RSP_BUSY and >> MMC_CAP_WAIT_WHILE_BUSY to be enabled together. > > Would it be possible for you to share a little bit more about the > problem? Like under what circumstances does things screw up? > > Is the issue only occurring when the cmd->busy_timeout becomes larger > than host->max_busy_timeout. Or even in other cases? > >> >> Signed-off-by: Yann Gautier >> --- >> drivers/mmc/host/mmci.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c >> index 1bc674577ff9..bf6971fdd1a6 100644 >> --- a/drivers/mmc/host/mmci.c >> +++ b/drivers/mmc/host/mmci.c >> @@ -2148,7 +2148,7 @@ static int mmci_probe(struct amba_device *dev, >> if (variant->busy_dpsm_flag) >> mmci_write_datactrlreg(host, >> host->variant->busy_dpsm_flag); >> - mmc->caps |= MMC_CAP_WAIT_WHILE_BUSY; >> + mmc->caps |= MMC_CAP_WAIT_WHILE_BUSY | MMC_CAP_NEED_RSP_BUSY; > > This isn't correct as the ux500 (and likely also other legacy > variants) don't need this. I have tried it in the past and it works > fine for ux500 without MMC_CAP_NEED_RSP_BUSY. > > The difference is rather that the busy detection for stm32 variants > needs a corresponding HW busy timeout to be set (its > variant->busy_timeout flag is set). Perhaps we can use that > information instead? > > Note that, MMC_CAP_NEED_RSP_BUSY, means that cmd->busy_timeout will > not be set by the core for erase commands, CMD5 and CMD6. > > By looking at the code in mmci_start_command(), it looks like we will > default to a timeout of 10s, when cmd->busy_timeout isn't set. At > least for some erase requests, that won't be sufficient. Would it be > possible to disable the HW busy timeout in some way - and maybe use a > software timeout instead? Maybe I already asked Ludovic about this? > :-) > > BTW, did you check that the MMCIDATATIMER does get the correct value > set for the timer in mmci_start_command() and if > host->max_busy_timeout gets correctly set in > mmci_set_max_busy_timeout()? > > [...] > > Kind regards > Uffe > Hi Ulf, Thanks for the hints. I'll check all of that and get back with updated patches. As I tried to explain in the cover letter and in reply to Adrian, I saw a freeze (BUSYD0) in test 37 during MMC_ERASE command with SECURE_ERASE_ARG, when running this test just after test 36 (or any other write test). But maybe, as you said that's mostly a incorrect timeout issue. Regards, Yann