Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp95610rdd; Mon, 8 Jan 2024 19:42:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IG1cy79VCwU08xZ2aAi6zzwiTM2HVesDp9l2HJtSC0OvKqtBFd0uqhxn4BLi8rIxSx47gVV X-Received: by 2002:a17:902:b28c:b0:1d4:bb7a:4ae9 with SMTP id u12-20020a170902b28c00b001d4bb7a4ae9mr2198470plr.16.1704771735785; Mon, 08 Jan 2024 19:42:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704771735; cv=none; d=google.com; s=arc-20160816; b=Lke412f0F9ikVUXEbmihj4t96eBJF5VaL/IpoD194gbfF7mz8evKESrQcjR+A/r4A+ ettadk+raulxiR7jJFXxVD2BU8RLjVtnteZe4qHI1x4yh4tp12ckX2feDR8CZjzQV1C1 NcBRo9ZKBOiVnB74y0kzWAptlr2LQC3m3DCC8K6C4/ZVeN/YOH0FpACApZHufK6SoJdt yd1UD7e77ZMr+YzEP3hgUgO0EEJtDifYcrZHC9wmfSl+AM9kbIOzyVw/6fKh6XJp8nL7 aaCcCsXAvibhDar57Fjr1ljqmfzBsHbxbLs0G9RJ5fK+zD11OorAxpwbuucdBKKzUgFX QVFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=aRtasBW72KfoDwZ/WxCb0AK88cwbM9CGvhgyqKmj2qs=; fh=oXxco8xeJ3ttHPzzhCRIc7B1mxzzf/zoDyJYRI6X7QI=; b=l3EbJotN3R1dD71o5R9zPrahwO+rk7cH4K9IJf+GwaKRPcXKuC8LNO5gbxNn0eSTk2 +BQMTmk1E4AjZoFhcUsVyTroBzCxCCZKNvkmuQI7Ndly0Ofs6aBxV4Ugs2FvIGM/5CUQ bHy7lcUuiOiKVoXTm0KKaX4Ct5zS8qFYPzzsBhBOd3/ljAI8/9WhX7SiTPt6nx7WyT/d OXvJQkZANiAMkLzIwmewaj0oJSAxPaQyeutej9HBT/t0NHKtIMFi7Km0qqUQ5YNm9U6c XixfA8ah7dmhbaRB2A4UJqKxp87ZIR52w0IQ2JXTVdEBMemzxfo6wOyyJpMb81y0NGxR xBJw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-20333-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20333-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linux.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id i14-20020a170902c94e00b001d3e5749922si832186pla.324.2024.01.08.19.42.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 19:42:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-20333-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-20333-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20333-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linux.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 65A19B2207A for ; Tue, 9 Jan 2024 03:42:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4FAB746A8; Tue, 9 Jan 2024 03:42:04 +0000 (UTC) Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) (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 9650479C4; Tue, 9 Jan 2024 03:42:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-6dac8955af0so1076512b3a.0; Mon, 08 Jan 2024 19:42:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704771722; x=1705376522; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=aRtasBW72KfoDwZ/WxCb0AK88cwbM9CGvhgyqKmj2qs=; b=oBJAecOx7AA74JCFSt03I2pARts5YSFqLgkYpYI3rauTHW5qM4zqRbFkqcRLNJCpqY ImYIFnWlPL9iV5DUrViCVui1quqC3bYY3PPMrSTOZxbxg/cNvYb99QMU6TTCno9ovlNa hsAy60H2zBhsaOtMetEDc8uTaiSnCiDPpXjx25AsfT3eRKAWyEV/NcnG/yj4hNnuPCL4 C/cKo+1wyKVqJGuitWBujN22qoUF3IQLMJhjkIqmWibMSBi7b8XWenQdzknNpkNv2pwT i+cP7u0UEKszKvhPhEvAHiTqtCM3XrlRfOR6OCcD/dPcLT4UiHKVGABW479brZkUM9hO vHhQ== X-Gm-Message-State: AOJu0Yx7zcMdbOdmHIrVjqKDFG3X6Mz/l9cts/8dfOk+Ozl15Sx4M859 d6DZtZevG1wnNkknRSwDbA0= X-Received: by 2002:a05:6a00:3a25:b0:6d9:bf50:1c94 with SMTP id fj37-20020a056a003a2500b006d9bf501c94mr2546935pfb.9.1704771721845; Mon, 08 Jan 2024 19:42:01 -0800 (PST) Received: from localhost (fpd11144dd.ap.nuro.jp. [209.17.68.221]) by smtp.gmail.com with ESMTPSA id kt3-20020a056a004ba300b006d9aa04574csm603224pfb.52.2024.01.08.19.42.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 19:42:01 -0800 (PST) Date: Tue, 9 Jan 2024 12:41:59 +0900 From: Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= To: Siddharth Vadapalli Cc: lpieralisi@kernel.org, robh@kernel.org, bhelgaas@google.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, ilpo.jarvinen@linux.intel.com, vigneshr@ti.com, r-gunasekaran@ti.com, srk@ti.com Subject: Re: [PATCH v3] PCI: keystone: Fix race condition when initializing PHYs Message-ID: <20240109034159.GA3301517@rocinante> References: <20230927041845.1222080-1-s-vadapalli@ti.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230927041845.1222080-1-s-vadapalli@ti.com> Hello, > The PCI driver invokes the PHY APIs using the ks_pcie_enable_phy() > function. The PHY in this case is the Serdes. It is possible that the > PCI instance is configured for 2 lane operation across two different > Serdes instances, using 1 lane of each Serdes. In such a configuration, > if the reference clock for one Serdes is provided by the other Serdes, > it results in a race condition. After the Serdes providing the reference > clock is initialized by the PCI driver by invoking its PHY APIs, it is > not guaranteed that this Serdes remains powered on long enough for the > PHY APIs based initialization of the dependent Serdes. In such cases, > the PLL of the dependent Serdes fails to lock due to the absence of the > reference clock from the former Serdes which has been powered off by the > PM Core. > > Fix this by obtaining reference to the PHYs before invoking the PHY > initialization APIs and releasing reference after the initialization is > complete. Applied to controller/keystone, thank you! [1/1] PCI: keystone: Fix race condition when initializing PHYs https://git.kernel.org/pci/pci/c/c12ca110c613 Krzysztof