From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) (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 E4DF021A459 for ; Tue, 3 Mar 2026 01:09:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772500163; cv=none; b=ikJjcPQJxf8xUB2TeBc2JBN3Nd8q6XP/dFJ0jXPC9JdaNix9et+IDA3V8aRnYyIfyVHDcvj3e0ujzSJ0phWkD5gMHu2LtMZTenl65VzJO0mAadd+5uSOst0nIu8iku6mlqcQIEMqY55VLZr8SkcL0L46jA5R+whDRm5vj3iydxw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772500163; c=relaxed/simple; bh=w3XJNMngVH9o2x8Fo5Z+SPPnOKYZk1VuCewxXQHywRk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uHpVhYPqYl1maigkeOGO/o4zdM5peiC63e6bCbsULMJXDQX+jxOvabB1NZ2fIAfY8psDMrzB1/b9imQNKtLiYHUUon0Oh1EarmK8ZI3FZra4o9PJ+/+SgaB6rcLulO26MYgVpUb8KE7oeuT1x4cIRebMPXKIq9iwJLl9eILaOUg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=dS+LVF8o; arc=none smtp.client-ip=209.85.216.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dS+LVF8o" Received: by mail-pj1-f45.google.com with SMTP id 98e67ed59e1d1-3598e065d8dso768416a91.2 for ; Mon, 02 Mar 2026 17:09:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772500161; x=1773104961; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=SNfT7rc1kauxFP4QoLAxKKWlk0j1ruWc56+EWObHoAU=; b=dS+LVF8ou9Zz93QFikDpAP7pC9t6MOJIxgU5f2273WXXLTLjKe8pM9IOBBxCIAlhcn HOuu6YwE3p8U6PQUCYkxTPKlsqouBWk1UYm6kAhmfE5OW8pJp50Mu7rswWilOWbRNk9W jwcsldw7G1Ig6r8wRgLXaXYeTpZ33+aGHnmStVAL1JpoDdjZQ58Gt3EENYveR/5CsZzQ UMidENnBWqwspNHJFwBPjNWPcgWOd2oz/SoudWyssRN0we3Q3DU23fUSealLNtTHOptB CgAEXUiWFHYCtgcbifxpG9X1c0P5BjYcYVLYjIFBsbi9WGOStwHTc6SJsI0PtP38i7WH EGnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772500161; x=1773104961; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SNfT7rc1kauxFP4QoLAxKKWlk0j1ruWc56+EWObHoAU=; b=KuMn9xbhgVLbBU1wj15DgKxKfADMLIF/L352VOhw99GkDgWFbvA1OuDq4EqTGDf9kd VR8LyxAambArZ+tF9M8t6my4pJGW6FqNwgb2n6HuLNQ1tMXWlKO3RFwbLfKqNPkRjqM4 mzi2iZG8wkZaBWWKbTh83yTpjrscUx+WO8nu5Gn3Qq0kmnAaGX/Ggm/UsfqMveVP0qrW 1eAlMeRVNX8qNoDEN0OpJza0UMlARhji+OUE37vn9CNlT5NNg0tr3JoiYlUoaqs9xiYU vOQWBoxEzJCwKn7rRnnz1CNq/UXZF6lmCEuQxp+1JZSEciQmB+rD1dxJDsq068ucE7G2 i3Lg== X-Forwarded-Encrypted: i=1; AJvYcCX0kU/Ut6mMbw4EIy/yAWBaap6ShGD3r87Qvkvcq5ljHaABSGSuI+o/N4lHwNtAfMFLdeziOq2DE3cdWao=@vger.kernel.org X-Gm-Message-State: AOJu0YwAfXX+bFYe+XoJGDQHJaboaOpkEQM2Q2XCL2C/WX6gmvXKmYSS ZXW4AGDhm3+cZlpyEzDnNpNW8fu7UhpbNShgVc210vDpc71MZKpAsa7a X-Gm-Gg: ATEYQzx/1z8r+RFbYxNpvvAvnpzy9aVCXR6/hxCKgFOblzmxPJumeTXi7PyEOULq9bv HSOsUqHG6NjUxxKE70PlKAKahz869UX+4/FcrJJHlkeqwoxGZbcBb4CHorMFoYu7IeY/1ZWfw/B UegkdljBeNm26XaA2Z0B4Ovuelnx9jxbBJAfTIAY74lLzptf2vnk6sqJoX/ITujO7N2wTHpGfAg w36hFgJEubcgRdfTCdNkaYtyledD6VeqSUDGM7QJSPfrtt3T6mriUZoMFP9dXtjlXxyxUJ0/QZQ QH/pVLhNp2/2thOpbhXu8mGmDtu3/d/F4x1cQJoxqgrdtZ79WCw//0I7saGFOSCPBdn2wr+Mo5g Ue2q1gbMNjWITNYrvpoDwTdJAWOem0OqRptgSahzid0GFAVTWZppHEMVPE+vxW1mB4Q3HP6J+i4 CCfQBzS4vXuxzpx/s0QitRWA== X-Received: by 2002:a17:90a:e18f:b0:340:4abf:391d with SMTP id 98e67ed59e1d1-35965cd0f39mr13847656a91.16.1772500161304; Mon, 02 Mar 2026 17:09:21 -0800 (PST) Received: from localhost ([2001:19f0:ac00:4eb8:5400:5ff:fe30:7df3]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3599c408296sm384302a91.5.2026.03.02.17.09.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Mar 2026 17:09:20 -0800 (PST) Date: Tue, 3 Mar 2026 09:08:53 +0800 From: Inochi Amaoto To: Yao Zi , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Bjorn Helgaas , Siddharth Vadapalli , Hans Zhang <18255117159@163.com>, Kishon Vijay Abraham I , Chen Wang , Manikandan K Pillai , Christophe JAILLET , Inochi Amaoto , Han Gao Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/2] PCI: cadence: Support platform-specific hooks for RC init/deinit Message-ID: References: <20260227181925.52475-1-me@ziyao.cc> <20260227181925.52475-2-me@ziyao.cc> 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: <20260227181925.52475-2-me@ziyao.cc> On Fri, Feb 27, 2026 at 06:19:24PM +0000, Yao Zi wrote: > Support initialization and de-initialization hooks provided by > platform-specific drivers. Initialization ones run after everything > else has been set up for RC, but before it's probed by the PCI > subsystem, to allow platform drivers to easily override RC properties > like LNKCAP. De-initialization ones run before anything else has been > cleaned-up. > > Signed-off-by: Yao Zi > --- > drivers/pci/controller/cadence/pcie-cadence-host.c | 8 +++++++- > drivers/pci/controller/cadence/pcie-cadence.h | 7 +++++++ > 2 files changed, 14 insertions(+), 1 deletion(-) > LGTM. Reviewed-by: Inochi Amaoto Regards, Inochi > diff --git a/drivers/pci/controller/cadence/pcie-cadence-host.c b/drivers/pci/controller/cadence/pcie-cadence-host.c > index db3154c1eccb..23ee5a9c240d 100644 > --- a/drivers/pci/controller/cadence/pcie-cadence-host.c > +++ b/drivers/pci/controller/cadence/pcie-cadence-host.c > @@ -304,6 +304,8 @@ static int cdns_pcie_host_init_address_translation(struct cdns_pcie_rc *rc) > > static void cdns_pcie_host_deinit(struct cdns_pcie_rc *rc) > { > + if (rc->ops->deinit) > + rc->ops->deinit(rc); > cdns_pcie_host_deinit_address_translation(rc); > cdns_pcie_host_deinit_root_port(rc); > } > @@ -316,7 +318,11 @@ int cdns_pcie_host_init(struct cdns_pcie_rc *rc) > if (err) > return err; > > - return cdns_pcie_host_init_address_translation(rc); > + err = cdns_pcie_host_init_address_translation(rc); > + if (err) > + return err; > + > + return rc->ops->init ? rc->ops->init(rc) : 0; > } > EXPORT_SYMBOL_GPL(cdns_pcie_host_init); > > diff --git a/drivers/pci/controller/cadence/pcie-cadence.h b/drivers/pci/controller/cadence/pcie-cadence.h > index 443033c607d7..7d8f8e87915b 100644 > --- a/drivers/pci/controller/cadence/pcie-cadence.h > +++ b/drivers/pci/controller/cadence/pcie-cadence.h > @@ -100,6 +100,11 @@ struct cdns_pcie { > const struct cdns_plat_pcie_of_data *cdns_pcie_reg_offsets; > }; > > +struct cdns_pcie_rc_ops { > + int (*init)(struct cdns_pcie_rc *rc); > + void (*deinit)(struct cdns_pcie_rc *rc); > +}; > + > /** > * struct cdns_pcie_rc - private data for this PCIe Root Complex driver > * @pcie: Cadence PCIe controller > @@ -115,6 +120,7 @@ struct cdns_pcie { > * @quirk_detect_quiet_flag: LTSSM Detect Quiet min delay set as quirk > * @ecam_supported: Whether the ECAM is supported > * @no_inbound_map: Whether inbound mapping is supported > + * @ops: Platform-specific hooks to initialize/de-initialize PCIe Root Complex > */ > struct cdns_pcie_rc { > struct cdns_pcie pcie; > @@ -127,6 +133,7 @@ struct cdns_pcie_rc { > unsigned int quirk_detect_quiet_flag:1; > unsigned int ecam_supported:1; > unsigned int no_inbound_map:1; > + const struct cdns_pcie_rc_ops *ops; > }; > > /** > -- > 2.53.0 >