Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp712017ybz; Wed, 15 Apr 2020 17:16:45 -0700 (PDT) X-Google-Smtp-Source: APiQypL0tlhcfaTYCwL9prlcGw7eM3y2SQFJcHNd25kYfulES3rAlDzLxdF1MF2Ksycf7M9M3Rx3 X-Received: by 2002:a50:9ea1:: with SMTP id a30mr28395722edf.318.1586996205672; Wed, 15 Apr 2020 17:16:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586996205; cv=none; d=google.com; s=arc-20160816; b=CahvuCvoBLgh58W8q8yeyxifQKGU0bbGatAmmgbiC+6ObkBlh/0/m2ww6wyL+VZk+d rLeoeP6VdHWmu7E736XwIL2RAQyP4XtKYxu/beNRTPBmqnkjUWVCdLqitgbkgno3Rjyw uVet/L9HLmXgapfSMx+8BIj0NR55qxWgoSE1ZVCtNhfDpjiHjlKHQxBcB4Rjq8ATkhp6 HbzJYyAVip3RIjD5oUzNizy8jhF5ExKQoR6NIet9otG37rwgQ7b4VTfPKzbWC9Rw42CP /oU0Udm8D5BWO2Cf6FHS7VV1a8e649WonZouk5uG4QiAfSbOI343RGx/j+pnfDvsRLxo Povg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=kyVB+tiE+rN9XPO8kyR9LpGoCVCUanK+RTCgZf2jO/w=; b=bD4A2Trkir/xZV0HE4tQvDAho7QmAOWlxq3t54xsAZ9YT9HKUT2CxOXahBZ9A8f9m5 uYf/RrnePpUP7OKDa5Zn3vv8pht1P+maCMTTGZJ4slN+ADfDPdxIDxQUb//BmMpn2j2Y uSRACm4ubEKUgARjOCLfN51aUkx3QerXDKH1nC3UU0DH3a4NRZPDMDaLAU03sp7xDLxF CBSFaUOi8IbY29EnSQq/c0aPsmULEdz38ggF5W+5fcNka/1/59cH8cyDlHgzExcSYs5I iwIYWt4rlikhnQlNBu7z2MujDjnotx1bZQJTCC8h5iWg+cEr1zThRwpsvw9oM/aQ0N6R n/1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=AtCus4if; 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=st.com Return-Path: Received: from vger.kernel.org ([23.128.96.18]) by mx.google.com with ESMTP id oo21si6628944ejb.453.2020.04.15.17.16.22; Wed, 15 Apr 2020 17:16:45 -0700 (PDT) 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=@st.com header.s=STMicroelectronics header.b=AtCus4if; 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=st.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1415044AbgDOP72 (ORCPT + 99 others); Wed, 15 Apr 2020 11:59:28 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:39887 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2410054AbgDOP7F (ORCPT ); Wed, 15 Apr 2020 11:59:05 -0400 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03FFW6Hc032223; Wed, 15 Apr 2020 17:58:49 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=kyVB+tiE+rN9XPO8kyR9LpGoCVCUanK+RTCgZf2jO/w=; b=AtCus4ifxTr/M17C7ri7ozELEn/Q2Ec2NMTSkCz/IvF+XFvZo6YuHd32YlYf2oYS/GsH APJoL/Uzi2K52Si3f0QQZ/baw6p8Rgwj88/O828W5iZdUMHeCYr1qO74/hpuQKQfG2qH CVhR0zlBHEpDOiagc5QDIi5OYdz+Qk8xaeHxxFrdqRHLshviwWOoGf5mv1TDw8fPe1Yt o9eaA/WnMGrcnCgEXeeS85X9zD/9IJW9nSgy1NkwvHGC8n+ffXKEBiwfa6Tyy80K6cZS 0TnSTk268qtpIYIPvww/IqnBI8NB0T43DXg29NnpFwWL+I/LhKnGiAGxcd3ax2RIwlIO fg== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 30dn94cy00-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 15 Apr 2020 17:58:49 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 28E4B100038; Wed, 15 Apr 2020 17:58:49 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag6node2.st.com [10.75.127.17]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 178FA2AF597; Wed, 15 Apr 2020 17:58:49 +0200 (CEST) Received: from localhost (10.75.127.51) by SFHDAG6NODE2.st.com (10.75.127.17) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 15 Apr 2020 17:58:48 +0200 From: Christophe Kerello To: , , , , , , CC: , , , , , Christophe Kerello Subject: [PATCH v2 06/12] mtd: rawnand: stm32_fmc2: use FMC2_TIMEOUT_MS for timeouts Date: Wed, 15 Apr 2020 17:57:30 +0200 Message-ID: <1586966256-29548-7-git-send-email-christophe.kerello@st.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1586966256-29548-1-git-send-email-christophe.kerello@st.com> References: <1586966256-29548-1-git-send-email-christophe.kerello@st.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.75.127.51] X-ClientProxiedBy: SFHDAG5NODE2.st.com (10.75.127.14) To SFHDAG6NODE2.st.com (10.75.127.17) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.676 definitions=2020-04-15_05:2020-04-14,2020-04-15 signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch removes the constant FMC2_TIMEOUT_US. FMC2_TIMEOUT_MS is set to 5 seconds and this constant is used each time that we need to wait (except when the timeout value is set by the framework) Signed-off-by: Christophe Kerello --- drivers/mtd/nand/raw/stm32_fmc2_nand.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/mtd/nand/raw/stm32_fmc2_nand.c b/drivers/mtd/nand/raw/stm32_fmc2_nand.c index ab53314..f159c39 100644 --- a/drivers/mtd/nand/raw/stm32_fmc2_nand.c +++ b/drivers/mtd/nand/raw/stm32_fmc2_nand.c @@ -37,8 +37,7 @@ /* Max ECC buffer length */ #define FMC2_MAX_ECC_BUF_LEN (FMC2_BCHDSRS_LEN * FMC2_MAX_SG) -#define FMC2_TIMEOUT_US 1000 -#define FMC2_TIMEOUT_MS 1000 +#define FMC2_TIMEOUT_MS 5000 /* Timings */ #define FMC2_THIZ 1 @@ -525,9 +524,9 @@ static int stm32_fmc2_ham_calculate(struct nand_chip *chip, const u8 *data, u32 sr, heccr; int ret; - ret = readl_relaxed_poll_timeout(fmc2->io_base + FMC2_SR, - sr, sr & FMC2_SR_NWRF, 10, - FMC2_TIMEOUT_MS); + ret = readl_relaxed_poll_timeout_atomic(fmc2->io_base + FMC2_SR, + sr, sr & FMC2_SR_NWRF, 1, + 1000 * FMC2_TIMEOUT_MS); if (ret) { dev_err(fmc2->dev, "ham timeout\n"); return ret; @@ -1315,7 +1314,7 @@ static int stm32_fmc2_waitrdy(struct nand_chip *chip, unsigned long timeout_ms) /* Check if there is no pending requests to the NAND flash */ if (readl_relaxed_poll_timeout_atomic(fmc2->io_base + FMC2_SR, sr, sr & FMC2_SR_NWRF, 1, - FMC2_TIMEOUT_US)) + 1000 * FMC2_TIMEOUT_MS)) dev_warn(fmc2->dev, "Waitrdy timeout\n"); /* Wait tWB before R/B# signal is low */ -- 1.9.1