Received: by 2002:ab2:687:0:b0:1f4:6588:b3a7 with SMTP id s7csp198134lqe; Tue, 9 Apr 2024 21:32:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXoXbDD3QI3XsGZX1VmgjUmIZD6ibQZ7AxJEhYTjAqhySs+qmcAgg1JNfvrqaj+U2ufglfXmIwM/lfrjtr7xuJqqa5ArzliIge54P6OfA== X-Google-Smtp-Source: AGHT+IFhJfan59NESlFktugAPS9AvSg/kL19sC7zR/rXPwp1/YRlz+neyGZP5iBUAYOe0NvDpqDb X-Received: by 2002:a05:6870:8a0b:b0:22a:bdd7:7b3b with SMTP id p11-20020a0568708a0b00b0022abdd77b3bmr1833028oaq.11.1712723553281; Tue, 09 Apr 2024 21:32:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712723553; cv=pass; d=google.com; s=arc-20160816; b=mJkUU0k74elnJDHJSlWh7ltoZxcB+KbLiChV7enL9Eh0w8KnfymgZZGvRTFqBpG453 SWt9i9ewboYe/0BNF6yjvUmKXsOibqu+AC+d8s+I/GuFunIglD/zy8o9TJdCtl5OjEvR kkO/44YVLyrTcJLrhn1LOY8Rzo3vylNJcg2cBORIRhzI/gJcoYqvuv1D9nIXaup7u+x5 2WrcPX+NAnB1ZSocoLLZ8lrWutUdayOTYEtjlI+fMdeE818R54wwg8z24OAjAw/uJceA 9owwVXcRVUxiGabQUTctbWYCvkqK+9FCGsS3X69/YcLr7kIN05AHAYUjIIRaLlDtvrL+ cgmQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=efy12j6U7UKFnPYJHEY7DX+8QaEmNJiKEGUi/LTKmJ0=; fh=lI1+VmEnxSzJVRpzykEStdfMJpBuOvdoZtvWlLyzcuU=; b=iSLYM3dzaj/mJimtS1Av2FyaJIuOkCTZfxKNhLehpzDnzJfR7yoxDVCBnkWS6Em7BJ GWVkYaD/1hqoT9xBRlfyMeFM6oF5ZrXfnUVW6tE53TMwV/U857dO4rOciq3OBW6YDJ5y PXEBGxHAJxF51dfa+aAEYE/tYmSX5YyQzU6gcPsNd/kDPnq3a6jBjA/UfkAhSvK7ADRo bIBX+xw1j/pCaIle6HaWsDCFINHoC9zc0cvKqXZ3hLUQy2pqcD9LJ7PDAdC2kvHmmQs9 VbnwkNsnQjAoC9DFs6Xirs+AJHzEJs0FzIZviaDtsLwqFhTKotcmHgd91nIGrYUsUQAk FSCA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=sntech.de dmarc=pass fromdomain=sntech.de); spf=pass (google.com: domain of linux-kernel+bounces-137884-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137884-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sntech.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id f7-20020a63e307000000b005f3ffb10873si7983283pgh.503.2024.04.09.21.32.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 21:32:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-137884-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=sntech.de dmarc=pass fromdomain=sntech.de); spf=pass (google.com: domain of linux-kernel+bounces-137884-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137884-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sntech.de 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id E9F5F287B51 for ; Wed, 10 Apr 2024 04:32:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 220F810A31; Wed, 10 Apr 2024 04:32:11 +0000 (UTC) Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D4FA910A13; Wed, 10 Apr 2024 04:32:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.11.138.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712723530; cv=none; b=C69BhU2xs5oc6283MPzZnmt/e5fZ+KhbBhneyD/lFrZMfs+pYNdQl7fwSVVmKIu9aFOwBiOLG6FCA8wsDhyHc29UItg7LOQPZ2G8FoyZloxrnc6Ne8ZJpWr4YxqAmMdqQc6GiTnxdG9cjarwSB90m78TaXJcU95buaO9q+KtLkQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712723530; c=relaxed/simple; bh=siZOQ+4XPskfy2znOMEDWoSkPbfewpmOGbasV0ucBXs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=NyRdRuEqSzFgfm0jicmlBDlq6o01vywuQ6BkKPHk4Gc0/0HWRVX+MGhOKcsiz491jXqFdSfLEJhUTJGEbpKJn/cEpYfyQltsrW0NJOCVv3ww0eWLGz68n1ol7kbZefhL8qynaV4GdpetGNqNnO88C/xR5g4PR1HcGX9ljUmgLgc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sntech.de; spf=pass smtp.mailfrom=sntech.de; arc=none smtp.client-ip=185.11.138.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sntech.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sntech.de Received: from ip-185-104-138-50.ptr.icomera.net ([185.104.138.50] helo=phil.localnet) by gloria.sntech.de with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ruPcr-0007Sx-9l; Wed, 10 Apr 2024 06:31:57 +0200 From: Heiko Stuebner To: Jianfeng Liu Cc: conor+dt@kernel.org, devicetree@vger.kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, liujianfeng1994@gmail.com, robh@kernel.org, sfr@canb.auug.org.au Subject: Re: [PATCH] arm64: dts: rockchip: remove startup-delay-us from vcc3v3_pcie2x1l0 on rock-5b Date: Wed, 10 Apr 2024 06:31:48 +0200 Message-ID: <3879529.iIbC2pHGDl@phil> In-Reply-To: <20240403075916.1025550-1-liujianfeng1994@gmail.com> References: <2535182.Sgy9Pd6rRy@diego> <20240403075916.1025550-1-liujianfeng1994@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" Am Mittwoch, 3. April 2024, 09:59:16 CEST schrieb Jianfeng Liu: > Hi Heiko, >=20 > Tue, 02 Apr 2024 12:39:17 +0200, Heiko St=FCbner wrote: > >Does the pcie driver enable the regulator too late somehow? > The pcie driver will enable the regulator imediately when it is probed. > I added log at when driver is probed and when regulator is enabled. > Here is the log with "startup-delay-us =3D <50000>": > ``` > [ 1.572991] rockchip-dw-pcie a40800000.pcie: rockchip_pcie_probe start > [ 1.573697] rockchip-dw-pcie a40800000.pcie: going to enable vpcie3v3 = regulator > [ 1.575194] rockchip-dw-pcie a40800000.pcie: enable vpcie3v3 regulator= done > ``` >=20 > And here is the log without "startup-delay-us": > ``` > [ 1.518490] rockchip-dw-pcie a40800000.pcie: rockchip_pcie_probe start > [ 1.518603] rockchip-dw-pcie a40800000.pcie: going to enable vpcie3v3 = regulator > [ 1.518610] rockchip-dw-pcie a40800000.pcie: enable vpcie3v3 regulator= done > ``` >=20 > We can see startup-delay-us will delay the driver probe. >=20 > I also take a look at rockchip's SDK kernel, their pci driver is probed > very late: > ``` > [ 3.398682] dw-pcie fe170000.pcie: invalid resource > [ 3.398686] dw-pcie fe170000.pcie: Failed to initialize host > [ 3.398688] dw-pcie: probe of fe170000.pcie failed with error -22 > [ 3.399396] rk-pcie fe170000.pcie: invalid prsnt-gpios property in node > [ 3.399410] rk-pcie fe170000.pcie: Looking up vpcie3v3-supply from dev= ice tree > [ 3.405195] rk-pcie fe170000.pcie: host bridge /pcie@fe170000 ranges: > [ 3.405253] rk-pcie fe170000.pcie: IO 0x00f2100000..0x00f21fffff= -> 0x00f2100000 > [ 3.405283] rk-pcie fe170000.pcie: MEM 0x00f2200000..0x00f2ffffff= -> 0x00f2200000 > [ 3.405310] rk-pcie fe170000.pcie: MEM 0x0980000000..0x09bfffffff= -> 0x0980000000 > [ 3.405372] rk-pcie fe170000.pcie: iATU unroll: enabled > [ 3.405381] rk-pcie fe170000.pcie: iATU regions: 8 ob, 8 ib, align 64K= , limit 8G > [ 3.666917] rk-pcie fe170000.pcie: PCIe Link up, LTSSM is 0x30011 > [ 3.666932] rk-pcie fe170000.pcie: PCIe Gen.1 x1 link up > [ 3.667139] rk-pcie fe170000.pcie: PCI host bridge to bus 0002:20 > ``` >=20 > And it is reported that startup-delay-us is necessary in rockchip's SDK > kernel. But in mainline kernel it is different. that's not directly what I meant. I.e. if the behaviour changes with arbitary delay changes, it points very much to some sort of timing issue in the pcie driver itself. That's why I asked about the regulator turning on, because if the enable call returns 50ms earlier or later should never influence the behaviour of the driver. =46or example other threads could also just hinder the kernel from continuing the pcie probe even after the regulator is on - again leading to undefined behaviour, as you seem to be experiencing as described in your mail from yesterday.