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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B967AC05027 for ; Wed, 15 Feb 2023 01:02:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Lpzqmbx/gMsd+H9ujZJdMhITqHZLoUhqud9mmYvoaFc=; b=u/eHHZQUMs38yY a4bRKtR1yi99EZX4pXLr5KU2D7DsXqmI6OV97pSJqr7NIU/1FEZjzYlHr3VmNQ8A6EhAhKaB8M8x4 hLHbTFdxRBb7e9WTLVTJdaaXW2K7Q+6e4RTzJUytbXuZKme7HrFbmonrsoeNdjCFy2Pk3ckPDNDHv bhFFn06CPcKdjIvNHXGfDvwajQbDjw37/EoPsoPtleYuqe4EjcEA4ACVhbIsYHBoKLBxdt1LCGC8H WhD1IwuALAi4MbG7VJajrUoErBFVrI+uRJtfB1V4E/IPzysegkyv4OcaOT9leyTsNa5oXr5CD3vKS DuPjYo/1upoDlZSnbcsw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pS6Al-0047Pn-8A; Wed, 15 Feb 2023 01:01:23 +0000 Received: from esa1.hgst.iphmx.com ([68.232.141.245]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pS6Ai-0047Ne-4k for linux-arm-kernel@lists.infradead.org; Wed, 15 Feb 2023 01:01:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1676422879; x=1707958879; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=XOcFePDBSO8jCjv36R6D31rgCgrBpc9VWxAmEMfwpY4=; b=GMWhC+6ay0saXyjpdTPD0N+Lmenva8JKBrto9majhKRVM1KEuqrGlN0J 57QUl422OuoEola2aJ7c/EtbDfbHCqYJXW9ZXbbcx1SYOi+Vqhx9SgS7P 8Fe7tTAwGCWzt6GbdZtJ3DpKKwUs0shkebf5NrNKqr8MOKg3fIRoMGdWk GP9Xf+WFYkGJZfzX3YQNKu0gMMi8A+rVXYU5EnaZOsqq52gEvp7Ms4Ijs Sx3XJhCA+e2Dfkn5v7BfuPS2eeyS2u5EdIRtO50ZqSA/4ne/meXUB/aY0 Pg7t5QTBhzy7UbiQIwYHUeNR+PLnN/3zlKFpQ9jgRIMGzbXjumUShv33B A==; X-IronPort-AV: E=Sophos;i="5.97,298,1669046400"; d="scan'208";a="335288770" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 15 Feb 2023 09:01:10 +0800 IronPort-SDR: 8Q5Uv8cW2oCG30f3nMZo41ff8kGUC3ihdBwDeVXUDwM8py4LEoRNwxDaWXHAQPpv1gg8JswELm BNODvXjAVebpLSsYDfwyXbR8WYXgd4PjqG+NPiDD7/Pg087/AEk1YEG9Z360nhhfhVp72saHlV yr53lkaHvtVFSagQj8Zk18w9S6gsEDAVYqU2I7EaCboNYdc+4dlbhKxNkKK1PyTrgFCcDJm1v4 Z6xWDzeCPy6e0SazQauJth+aASuq9FFl5hrOogNhRdB7DMGX305t4EuBaBFWIhC3sZe17rEmoA nRk= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 14 Feb 2023 16:18:17 -0800 IronPort-SDR: 4gOX0sB5jvt2xBfVOhUyQlEV9gqxlIKJwYzOmp1LOfrLyXzMqriJSdhhu5nrJViZcnEpsp7/sS Vps7nsVRcd7U2oq6xsc90otIuvvFIXu8v3ar2FL45HtfGlOsua7Hn1fuRSKoTEOeYTkV25iNUP S5SeCSyEyXobHvsKBr12uAKZ158BQchGfz5rj80yENCu22p2K3btVKzfGA1L/ozf8olFWY2Ul2 jLG0h4Hja6EWUfQSgUktq/pKX++ZeuPu6AGlHqA8Vf8TSZ4XE2idNHF2+WukPC91x+eJmRmMNo 9qw= WDCIronportException: Internal Received: from usg-ed-osssrv.wdc.com ([10.3.10.180]) by uls-op-cesaip01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 14 Feb 2023 17:01:11 -0800 Received: from usg-ed-osssrv.wdc.com (usg-ed-osssrv.wdc.com [127.0.0.1]) by usg-ed-osssrv.wdc.com (Postfix) with ESMTP id 4PGfsK37Swz1Rx15 for ; Tue, 14 Feb 2023 17:01:09 -0800 (PST) Authentication-Results: usg-ed-osssrv.wdc.com (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=opensource.wdc.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d= opensource.wdc.com; h=content-transfer-encoding:content-type :in-reply-to:organization:from:references:to:content-language :subject:user-agent:mime-version:date:message-id; s=dkim; t= 1676422868; x=1679014869; bh=XOcFePDBSO8jCjv36R6D31rgCgrBpc9VWxA mEMfwpY4=; b=CWyGVs8vvV8V9TroMGTaXUrq6Dk5LKKI05WQCVteluiqIHuQR3/ KipJSou78EOtFXvraqsQfwe3sXXpfCfDnlzWxEKHgGxMSo7a+uHIRToYKdNN6OZP mgkERlXieonQr5tNTcfwecodSCCjr5yV/KxlbEjzc6Gg+09u6eR1fyZjZcs+mmOb IJUiceCuMikYRvouEdxoKNS7q/a30gK1wj51E8y8NIQaN94u2CYOx12zLJJQDMFv dEO/CdCQnKqXn28iAA7Y0MYiGtjNSeOgBDL8raHjVMxkmK0NGL0ypF7IgoBKzzpY JrSQWeqzyoPkBxSkCaWwrx1pFFDRSOuwhnA== X-Virus-Scanned: amavisd-new at usg-ed-osssrv.wdc.com Received: from usg-ed-osssrv.wdc.com ([127.0.0.1]) by usg-ed-osssrv.wdc.com (usg-ed-osssrv.wdc.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 7wgqqheMxBcW for ; Tue, 14 Feb 2023 17:01:08 -0800 (PST) Received: from [10.225.163.116] (unknown [10.225.163.116]) by usg-ed-osssrv.wdc.com (Postfix) with ESMTPSA id 4PGfsD4tpXz1RvLy; Tue, 14 Feb 2023 17:01:04 -0800 (PST) Message-ID: Date: Wed, 15 Feb 2023 10:01:03 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH v2 4/9] PCI: rockchip: Add poll and timeout to wait for PHY PLLs to be locked Content-Language: en-US To: Rick Wertenbroek , alberto.dassatti@heig-vd.ch Cc: xxm@rock-chips.com, rick.wertenbroek@heig-vd.ch, stable@vger.kernel.org, Rob Herring , Krzysztof Kozlowski , Heiko Stuebner , Shawn Lin , Lorenzo Pieralisi , =?UTF-8?Q?Krzysztof_Wilczy=c5=84ski?= , Bjorn Helgaas , Jani Nikula , Greg Kroah-Hartman , Rodrigo Vivi , Mikko Kovanen , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org References: <20230214140858.1133292-1-rick.wertenbroek@gmail.com> <20230214140858.1133292-5-rick.wertenbroek@gmail.com> From: Damien Le Moal Organization: Western Digital Research In-Reply-To: <20230214140858.1133292-5-rick.wertenbroek@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230214_170120_212888_5B03ED56 X-CRM114-Status: GOOD ( 21.25 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2/14/23 23:08, Rick Wertenbroek wrote: > The RK3399 PCIe controller should wait until the PHY PLLs are locked. > Add poll and timeout to wait for PHY PLLs to be locked. If they cannot > be locked generate error message and jump to error handler. Accessing > registers in the PHY clock domain when PLLs are not locked causes hang > The PHY PLLs status is checked through a side channel register. > This is documented in the TRM section 17.5.8.1 "PCIe Initialization > Sequence". > > Fixes: cf590b078391 ("PCI: rockchip: Add EP driver for Rockchip PCIe controller") > Cc: stable@vger.kernel.org > Signed-off-by: Rick Wertenbroek A couple of nits below. Otherwise: Reviewed-by: Damien Le Moal Tested-by: Damien Le Moal > --- > drivers/pci/controller/pcie-rockchip.c | 16 ++++++++++++++++ > drivers/pci/controller/pcie-rockchip.h | 2 ++ > 2 files changed, 18 insertions(+) > > diff --git a/drivers/pci/controller/pcie-rockchip.c b/drivers/pci/controller/pcie-rockchip.c > index 990a00e08..5f2e2dd5d 100644 > --- a/drivers/pci/controller/pcie-rockchip.c > +++ b/drivers/pci/controller/pcie-rockchip.c [...] > + err = readx_poll_timeout(rockchip_pcie_read_addr, PCIE_CLIENT_SIDE_BAND_STATUS, Nit: long line. Split it after the first comma. > + regs, !(regs & PCIE_CLIENT_PHY_ST), RK_PHY_PLL_LOCK_SLEEP_US, > + RK_PHY_PLL_LOCK_TIMEOUT_US); > + Nit: no need for this blank line. > + if (err) { > + dev_err(dev, "PHY PLLs could not lock, %d\n", err); > + goto err_power_off_phy; > + } > + -- Damien Le Moal Western Digital Research _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel