Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp614485rdb; Thu, 15 Feb 2024 09:48:48 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUgpk0ke+KmaQyM9v7qhg7I84j8tWABrfPw81rFKuI9jrBc+gfQvxqzj7nE3Q9IzaCxgAXhvSgZ7I84VFCw0XYzFb/5WHDHxAiWoxjTQQ== X-Google-Smtp-Source: AGHT+IEhoBh5rAB03eVSqivbtSquKIUjz0UHX32BYQFqj6kwbHYQbJ6SmSwfPBKtwqAVU0Elyw1T X-Received: by 2002:a17:906:5615:b0:a3d:2762:71f7 with SMTP id f21-20020a170906561500b00a3d276271f7mr1858785ejq.66.1708019327925; Thu, 15 Feb 2024 09:48:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708019327; cv=pass; d=google.com; s=arc-20160816; b=Uq+x3uS1MWcaALon3cHetva8DT34GAfSxDTl9oo9umkoEimz0oA4SWzxXkgdJr1iJi FaO3V5cgCvtK9StyZZiIgbn6XKnIO1k/twDdlhUsZzOgIiEWQxD0F3DJy/bjFL9Z0x3t T/iEJalCkq2mKiHzEhiE6NElBaHDIkSVTeg0G5h9bp7jh44fsVdiCqSOVWk9EDY7sxsC NNeuGF0OIxWAsoVHQfW2g0Q5YYMyZfxVs3vybb3OEqcWP+moHgVxdpw7Sz1p8Ui6Fshg Y0HIeVbMynxp7DDuKzil81EuORQzUWlbCUjfGGpIKguoprk+TgMJ6ticj9E5M50YRPj/ u08w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=DDRPEsVl18wfCmnlXfXdVDXZZ1/0kETp5RT+YO4+BJw=; fh=Tu49t6Jcpu0XR2fZ0g/8vnwPGlxOjo53wSKXws5L0YQ=; b=pOof3GtVWpu8IHFCWgM75Anbt8GNEKymq8btI5pUbENG9CtxqaGpRVQzohvKRygB0U ORsOvnBrYm2C8pQBLPybMvqO+cZQIiCjKHTtC26gflK2Bh88fbB4Zd5LG5HrcO0qNssH bOwWeuO2p3xpwK7RCRsXLqZ55z6N6I+0KMEgCBQa2LlLwPDfN8rd46fmcIvVvBJ0Fz9D aHuFHpuK4fDjO+uJrJO17hZQAx6i3MZyop+6xkuDJnwZaMGWxBmQ0iwKwukMKQMTbUoI Tw4e8bzwets/7nO+WZgjVhat9T03ryyaTQsU5VH0pJIlhYwKsAFH3bIYk7fH0PVvVL/p i6Sw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Mqpx96TB; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-67437-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67437-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id y10-20020a1709063daa00b00a3bf7df1042si849055ejh.537.2024.02.15.09.48.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 09:48:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67437-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Mqpx96TB; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-67437-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67437-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 82D4A1F228FE for ; Thu, 15 Feb 2024 17:48:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F10B213848D; Thu, 15 Feb 2024 17:48:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Mqpx96TB" Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 119961369BF for ; Thu, 15 Feb 2024 17:48:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708019299; cv=none; b=XS3gwx0VroqqZIQzAi8IVcJSfjGsvIw5iCzqsoEY2vUZVGDWUFBvou/bu9i+aR4DB4BHZAAmgbrF/aSVJpfgCemZdRTLAWwehicdZPlx51cK26WGvEiYj7nIek7yReM1ByXoKcE0nKqIvQdsa6mDLMq0s27DIid/gdWC81Y3xQo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708019299; c=relaxed/simple; bh=Dt8Dfhv0KYo07qrCHA5x1pJBOjl5sHRZCS/sDgBwHEM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=NiT4Ao35e0saT1m+vzUWjJtELeB5hKZA4cRDm/KkLGflaGPJFbH+k0bBWFyUT6xugQL48ha/HZIo+XbNhMuD6FSIoB7RNvn6KPGOBzb94DJf+hEd+tQJnEaES2yExMBHvcgEkflDtQN0Pa+wuLG8/VPGVq+nwL3p7tJUNdaWjYw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Mqpx96TB; arc=none smtp.client-ip=209.85.208.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-lj1-f177.google.com with SMTP id 38308e7fff4ca-2d208d0b282so11859551fa.0 for ; Thu, 15 Feb 2024 09:48:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708019295; x=1708624095; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=DDRPEsVl18wfCmnlXfXdVDXZZ1/0kETp5RT+YO4+BJw=; b=Mqpx96TB3I78McgxJSV9m6BObXAxXSe8GBB+QaYAtCDEkNdAmJpkqY7winN86LjK4S 0OYXZkxISG90zg9nsoO/uP7kS11bpLhT+X+jIDKy5jTWom5FY4p1XhkrrfJ4vq0N0eSX BsNnHuvaU7n7XH+DxuCbTZnIIUmGO4bSO3G3LrCCjvHf6xQgLT2MO7jdsMEOckYn/Bql hblYPHEeoJoE2yEkwOvlEnRrQkupjwoZ9sJHPkuNc2zOLLuTlcupGqaqBlf28xvo1744 bYC8eja0J6hTRiFHFyvrbowc6OdzcNq8DAx8zKVFLy2nfoHfDd3TllgMTlKJruI8ALRj LBrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708019295; x=1708624095; h=content-transfer-encoding:in-reply-to:autocrypt: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=DDRPEsVl18wfCmnlXfXdVDXZZ1/0kETp5RT+YO4+BJw=; b=uJDTTni8doZZ5VwNkTk3eGFmrGP9UzNGl5h6a5/9D/ELZ7lpS+V/hzygzkAOdG0exM 3Y+OMSJVl44Z4Qprw8ZR7WgjQDEIe6nGSK5tV37B0hVgGB+EZxnfQa0CXomhsVIYZLOO bfB/zkjB1WMHgZkd3hdw4ufj8qGWfDE3HTh5n+Yb80uCiB9/XzwGMnwcSC9X40tGkHkm e5GghRjtQvSyfiIOdYiINKT6mtY0hYfudP9AvAC0y0+A6bCQd0/ZpV5OpRBQ3KbAlKYa gmqxbsrSGEfGragrrLA9Jca7iIWiDZOlVgcd//bioGj2UnxGcokfDRfrf6L1PzWli4Qq K5TA== X-Forwarded-Encrypted: i=1; AJvYcCVVnwncZ6NEvQ2puMX/7IFxk0CNMQI1Yx0DN2TYtAbsCIGzN3FEtidIrtswUpjKw1/u6neyNXgb2R2J1m/UXynp/VJgrT0LlL49pep5 X-Gm-Message-State: AOJu0YxSCXW7X5wY4CwW3CFJGku/0WySf+qZmbxqk7fDmWS7DxMpNel8 NIqVLYRyGcov1+ST2pE/Eo1u/Xj+CiENSBDc4Ak6bkL07ra9XcM5H0zCpIe2220= X-Received: by 2002:a19:ca53:0:b0:511:acd9:c10d with SMTP id h19-20020a19ca53000000b00511acd9c10dmr1652514lfj.40.1708019295073; Thu, 15 Feb 2024 09:48:15 -0800 (PST) Received: from [192.168.192.135] (078088045141.garwolin.vectranet.pl. [78.88.45.141]) by smtp.gmail.com with ESMTPSA id r1-20020a50d681000000b005638f04c122sm790193edi.14.2024.02.15.09.48.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 15 Feb 2024 09:48:14 -0800 (PST) Message-ID: Date: Thu, 15 Feb 2024 18:48:13 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] PCI: dwc: Use the correct sleep function in wait_for_link Content-Language: en-US To: Kuppuswamy Sathyanarayanan , Jingoo Han , Gustavo Pimentel , Manivannan Sadhasivam , Lorenzo Pieralisi , =?UTF-8?Q?Krzysztof_Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas Cc: Marijn Suijten , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold References: <20240215-topic-pci_sleep-v1-1-7ac79ac9739a@linaro.org> <361f7ae0-6de1-423c-bb64-82a5acccb502@linux.intel.com> From: Konrad Dybcio Autocrypt: addr=konrad.dybcio@linaro.org; keydata= xsFNBF9ALYUBEADWAhxdTBWrwAgDQQzc1O/bJ5O7b6cXYxwbBd9xKP7MICh5YA0DcCjJSOum BB/OmIWU6X+LZW6P88ZmHe+KeyABLMP5s1tJNK1j4ntT7mECcWZDzafPWF4F6m4WJOG27kTJ HGWdmtO+RvadOVi6CoUDqALsmfS3MUG5Pj2Ne9+0jRg4hEnB92AyF9rW2G3qisFcwPgvatt7 TXD5E38mLyOPOUyXNj9XpDbt1hNwKQfiidmPh5e7VNAWRnW1iCMMoKqzM1Anzq7e5Afyeifz zRcQPLaqrPjnKqZGL2BKQSZDh6NkI5ZLRhhHQf61fkWcUpTp1oDC6jWVfT7hwRVIQLrrNj9G MpPzrlN4YuAqKeIer1FMt8cq64ifgTzxHzXsMcUdclzq2LTk2RXaPl6Jg/IXWqUClJHbamSk t1bfif3SnmhA6TiNvEpDKPiT3IDs42THU6ygslrBxyROQPWLI9IL1y8S6RtEh8H+NZQWZNzm UQ3imZirlPjxZtvz1BtnnBWS06e7x/UEAguj7VHCuymVgpl2Za17d1jj81YN5Rp5L9GXxkV1 aUEwONM3eCI3qcYm5JNc5X+JthZOWsbIPSC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g5dfFju1Q//Xta1ShwL0MLSC1KL1lXGXeRM 8arzfyiB5wJ9tb9U/nZvhhdfilEDLe0jKJY0RJErbdRHsalwQCrtq/1ewQpMpsRxXzAjgfRN jc4tgxRWmI+aVTzSRpywNahzZBT695hMz81cVZJoZzaV0KaMTlSnBkrviPz1nIGHYCHJxF9r cIu0GSIyUjZ/7xslxdvjpLth16H27JCWDzDqIQMtg61063gNyEyWgt1qRSaK14JIH/DoYRfn jfFQSC8bffFjat7BQGFz4ZpRavkMUFuDirn5Tf28oc5ebe2cIHp4/kajTx/7JOxWZ80U70mA cBgEeYSrYYnX+UJsSxpzLc/0sT1eRJDEhI4XIQM4ClIzpsCIN5HnVF76UQXh3a9zpwh3dk8i bhN/URmCOTH+LHNJYN/MxY8wuukq877DWB7k86pBs5IDLAXmW8v3gIDWyIcgYqb2v8QO2Mqx YMqL7UZxVLul4/JbllsQB8F/fNI8AfttmAQL9cwo6C8yDTXKdho920W4WUR9k8NT/OBqWSyk bGqMHex48FVZhexNPYOd58EY9/7mL5u0sJmo+jTeb4JBgIbFPJCFyng4HwbniWgQJZ1WqaUC nas9J77uICis2WH7N8Bs9jy0wQYezNzqS+FxoNXmDQg2jetX8en4bO2Di7Pmx0jXA4TOb9TM izWDgYvmBE8= In-Reply-To: <361f7ae0-6de1-423c-bb64-82a5acccb502@linux.intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 15.02.2024 15:51, Kuppuswamy Sathyanarayanan wrote: > > On 2/15/24 2:39 AM, Konrad Dybcio wrote: >> According to [1], msleep should be used for large sleeps, such as the >> 100-ish ms one in this function. Comply with the guide and use it. >> >> [1] https://www.kernel.org/doc/Documentation/timers/timers-howto.txt >> >> Signed-off-by: Konrad Dybcio >> --- >> Tested on Qualcomm SC8280XP CRD >> --- >> drivers/pci/controller/dwc/pcie-designware.c | 2 +- >> drivers/pci/controller/dwc/pcie-designware.h | 3 +-- >> 2 files changed, 2 insertions(+), 3 deletions(-) >> >> diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/controller/dwc/pcie-designware.c >> index 250cf7f40b85..abce6afceb91 100644 >> --- a/drivers/pci/controller/dwc/pcie-designware.c >> +++ b/drivers/pci/controller/dwc/pcie-designware.c >> @@ -655,7 +655,7 @@ int dw_pcie_wait_for_link(struct dw_pcie *pci) >> if (dw_pcie_link_up(pci)) >> break; >> >> - usleep_range(LINK_WAIT_USLEEP_MIN, LINK_WAIT_USLEEP_MAX); >> + msleep(LINK_WAIT_MSLEEP_MAX); >> } >> >> if (retries >= LINK_WAIT_MAX_RETRIES) { >> diff --git a/drivers/pci/controller/dwc/pcie-designware.h b/drivers/pci/controller/dwc/pcie-designware.h >> index 26dae4837462..3f145d6a8a31 100644 >> --- a/drivers/pci/controller/dwc/pcie-designware.h >> +++ b/drivers/pci/controller/dwc/pcie-designware.h >> @@ -63,8 +63,7 @@ >> >> /* Parameters for the waiting for link up routine */ >> #define LINK_WAIT_MAX_RETRIES 10 >> -#define LINK_WAIT_USLEEP_MIN 90000 >> -#define LINK_WAIT_USLEEP_MAX 100000 >> +#define LINK_WAIT_MSLEEP_MAX 100 > > Since 90 ms is an acceptable value, why not use it? I suppose I can do that indeed.. Usually I go for the safer option when cleaning up old code, but you're right, 90 should be ok (unless somebody has some documentation stating otherwise) Konrad