Received: by 2002:ab2:23c8:0:b0:1f2:fdbc:cb93 with SMTP id a8csp183725lqe; Wed, 27 Mar 2024 02:42:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXMRiYUbxJ5fPb35btma31kjKrTP42gR0slXWxN0Ek9RIdTKJGDnvhga/kUcekLMBu4cbttzu6+IOM4321Tzvj8/bDiCf0oR2kMF0AxJA== X-Google-Smtp-Source: AGHT+IFT7rNzvQQam8nDuXB2DXdiymdu7yOsc7u2br/JeDA18QrnGCAyYFrcRuGT+tXbCSuXx5o/ X-Received: by 2002:a17:90a:8c8c:b0:29b:bcea:c17e with SMTP id b12-20020a17090a8c8c00b0029bbceac17emr546302pjo.1.1711532523309; Wed, 27 Mar 2024 02:42:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711532523; cv=pass; d=google.com; s=arc-20160816; b=BzNjVCfxKUhpT+LSWvz10SvfLVkctEOl+pRwYspp3t0VM09jfi8/bkQ/0WKAoDA0Lb 5jRkcv5qgTgsaf2K0ecFWfGqEVtnrJtQzWmDCnc1NYFYoXkRP/eicC4W6NcISzNao4x4 Q3gvhPdgJBXMCJC8nrxpmpG//AoRXpIBWnB6QBwPlJO8xSybhUlHJk5cZO8jsM8/PFRk TIhFm2dpwnSCXDzhrzyJHdBD7g9dprGZp/vhtCnp2CM56gO/tyD35wkj+PW/Z5cJro3m M5qjzeVKQ5JH1StfTuV55XAdJpFKY6eCdnAkAtaHI+5BdC3MmEuoOVXbLM2EcxUREJB2 OVuA== ARC-Message-Signature: i=2; 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:dkim-signature; bh=mZXFo2MTuojYEhwLEAVa8FGDPxlaxlxlR9WZg52WjDM=; fh=vUIJnQ1iFDYKl9LFF9xJXYYsANIZbBC1y5JAKGwGZ6g=; b=Qu+xFkWY4VWLMbrAChD7FXJOPsP3dOE7O0N/0xNFqvJZY/CX6RnoVZ+20POW3ztGFA SuWKryBFWWB3OwsoHk20acwN51iOc9NS6hJY+q5s750pzdHchCJcYsXGcUgCzrB3b0b/ vTGNQR0aoI+gX7qDn7p+Gpv+sZRpTM10ZgNDfjWmfVcMnVSQK7jpfdFmTYkeba+EnJih 2BLTC9tIDtVOf+c9V4/S4W0ybHAPVkX7cRjP4yCodP1ezpd0Jzm3dAX2j22nq+7hm7Om w4eu/hbITfGhgELHAFU6uB9UdRwYr4TMtKD9tTcFjzjUfc9ToR0RV49dfSamAwX12MGk kNlg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=P0GWQbgn; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-120623-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120623-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id mu15-20020a17090b388f00b002a08eef120bsi1158497pjb.49.2024.03.27.02.42.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 02:42:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-120623-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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=P0GWQbgn; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-120623-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120623-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id F2E2A296291 for ; Wed, 27 Mar 2024 09:42:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0A7C7383BB; Wed, 27 Mar 2024 09:41:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="P0GWQbgn" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 195FC23773; Wed, 27 Mar 2024 09:41:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711532511; cv=none; b=cMmGQH+l0m41uW2iEQVSHFKjsgj7mvIDXU6Y699w85X/FKUpJqzpYyqTjgPxn7ik/oZMRzeRhvx0yJmmUIlZkBr7shE6GzuWZsR543bOsc6SsKwGxs+5jXMEcqJ4C0UfuWFht1R3brq/1zjCO1YNJKnDqpFKc7mG9HEiIGNADlw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711532511; c=relaxed/simple; bh=L3MDabzqy52UiiTpotcbYr/fCovWNhX/kTom1rvfcLE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=R39TkLNgQ0YoqCsa0N2SS3QpON7h4f1b1pgcMf00mfY3k2Zq0UTyt8OzdNhv6AcZyWaPv29Q9GLufy+xFWoM3OjGE6WHqv/G+Fzheuy4ag8slAuwN6g2Gd7XuQl2bQkwQ/ET1YU2PiAz1KPWglB9Py0TJ/KSF3hfxrF6woCI8ZQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=P0GWQbgn; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A5A4DC433C7; Wed, 27 Mar 2024 09:41:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711532510; bh=L3MDabzqy52UiiTpotcbYr/fCovWNhX/kTom1rvfcLE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=P0GWQbgnIHTf/G5uy23E/x7ykvt/PdbjSQBxEDrAG8933x7u7LE+eSEfWzro38F6g QTeiC5ZrZDZQ0mxGSlCSjQnsqn1y49orZqEvDjAoGZZ9q0gIPbo+M7I3xt9HttPI8H 0ObzP0rjgPRbxin+sZBZNp2rk832mLKAM7p1KnRhq9wZ0yPDRMP+wMo10ULBHkQC6j nG/B8CNKwie/6nXS6vLuQK2zBFa0RG4KiXbKOPr8QLv3RiNxkDJkl/eA9FSn3FwgFv Mv/vFRKgxrFAhrljpIyeoQrajgkpwvQXIcl2ucpka2zQMo91uLTc1IlOSqgvlN9q6x IIHd3CkrbewBw== Date: Wed, 27 Mar 2024 10:41:39 +0100 From: Niklas Cassel To: Manivannan Sadhasivam Cc: Jingoo Han , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Marek Vasut , Yoshihiro Shimoda , Thierry Reding , Jonathan Hunter , Vidya Sagar , Vignesh Raghavendra , Richard Zhu , Lucas Stach , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Minghuan Lian , Mingkai Hu , Roy Zang , Kunihiko Hayashi , Masami Hiramatsu , Kishon Vijay Abraham I , Jesper Nilsson , Srikanth Thokala , Shawn Lin , Heiko Stuebner , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-tegra@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@axis.com, linux-rockchip@lists.infradead.org Subject: Re: [PATCH v12 8/8] PCI: endpoint: Remove "core_init_notifier" flag Message-ID: References: <20240327-pci-dbi-rework-v12-0-082625472414@linaro.org> <20240327-pci-dbi-rework-v12-8-082625472414@linaro.org> 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: <20240327-pci-dbi-rework-v12-8-082625472414@linaro.org> On Wed, Mar 27, 2024 at 02:43:37PM +0530, Manivannan Sadhasivam wrote: > "core_init_notifier" flag is set by the glue drivers requiring refclk from > the host to complete the DWC core initialization. Also, those drivers will > send a notification to the EPF drivers once the initialization is fully > completed using the pci_epc_init_notify() API. Only then, the EPF drivers > will start functioning. > > For the rest of the drivers generating refclk locally, EPF drivers will > start functioning post binding with them. EPF drivers rely on the > 'core_init_notifier' flag to differentiate between the drivers. > Unfortunately, this creates two different flows for the EPF drivers. > > So to avoid that, let's get rid of the "core_init_notifier" flag and follow > a single initialization flow for the EPF drivers. This is done by calling > the dw_pcie_ep_init_notify() from all glue drivers after the completion of > dw_pcie_ep_init_registers() API. This will allow all the glue drivers to > send the notification to the EPF drivers once the initialization is fully > completed. > > Only difference here is that, the drivers requiring refclk from host will > send the notification once refclk is received, while others will send it > during probe time itself. > > But this also requires the EPC core driver to deliver the notification > after EPF driver bind. Because, the glue driver can send the notification > before the EPF drivers bind() and in those cases the EPF drivers will miss > the event. To accommodate this, EPC core is now caching the state of the > EPC initialization in 'init_complete' flag and pci-ep-cfs driver sends the > notification to EPF drivers based on that after each EPF driver bind. > > Tested-by: Niklas Cassel > Signed-off-by: Manivannan Sadhasivam > --- Reviewed-by: Niklas Cassel