{"id":2224281,"url":"http://patchwork.ozlabs.org/api/1.2/patches/2224281/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-pci/patch/20260417-pcie-intel-gw-v5-6-0a2b933fe04f@dev.tdt.de/","project":{"id":28,"url":"http://patchwork.ozlabs.org/api/1.2/projects/28/?format=json","name":"Linux PCI development","link_name":"linux-pci","list_id":"linux-pci.vger.kernel.org","list_email":"linux-pci@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260417-pcie-intel-gw-v5-6-0a2b933fe04f@dev.tdt.de>","list_archive_url":null,"date":"2026-04-17T08:35:50","name":"[v5,6/7] PCI: intel-gw: Move driver atu base assignment to probe function","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"447486d5f8bc669019705bea3bb3d9fd4975e4f4","submitter":{"id":72238,"url":"http://patchwork.ozlabs.org/api/1.2/people/72238/?format=json","name":"Florian Eckert","email":"fe@dev.tdt.de"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-pci/patch/20260417-pcie-intel-gw-v5-6-0a2b933fe04f@dev.tdt.de/mbox/","series":[{"id":500275,"url":"http://patchwork.ozlabs.org/api/1.2/series/500275/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-pci/list/?series=500275","date":"2026-04-17T08:35:46","name":"PCI: intel-gw: Fixes to make the driver working again","version":5,"mbox":"http://patchwork.ozlabs.org/series/500275/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2224281/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2224281/checks/","tags":{},"related":[],"headers":{"Return-Path":"\n <linux-pci+bounces-52697-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-pci@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=temperror header.d=dev.tdt.de header.i=@dev.tdt.de header.a=rsa-sha256\n header.s=z1-selector1 header.b=PfcNhIHL;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-pci+bounces-52697-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=temperror (0-bit key) header.d=dev.tdt.de header.i=@dev.tdt.de\n header.b=\"PfcNhIHL\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=194.37.255.70","smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=dev.tdt.de","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=dev.tdt.de"],"Received":["from sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fxpK21bBvz1yGt\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 17 Apr 2026 18:41:58 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id DECB53088BA6\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 17 Apr 2026 08:36:23 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 6C2D83AF65E;\n\tFri, 17 Apr 2026 08:36:21 +0000 (UTC)","from mxout70.expurgate.net (mxout70.expurgate.net [194.37.255.70])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 08A4F2E8897;\n\tFri, 17 Apr 2026 08:36:19 +0000 (UTC)","from [194.37.255.9] (helo=mxout.expurgate.net)\n\tby relay.expurgate.net with smtp (Exim 4.92)\n\t(envelope-from <prvs=75813159fe=fe@dev.tdt.de>)\n\tid 1wDegP-00BgAo-2h; Fri, 17 Apr 2026 10:36:13 +0200","from [195.243.126.94] (helo=securemail.tdt.de)\n\tby relay.expurgate.net with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)\n\t(Exim 4.92)\n\t(envelope-from <fe@dev.tdt.de>)\n\tid 1wDegO-008N6Z-I4; Fri, 17 Apr 2026 10:36:12 +0200","from securemail.tdt.de (localhost [127.0.0.1])\n\tby securemail.tdt.de (Postfix) with ESMTP id EE3D8240042;\n\tFri, 17 Apr 2026 10:36:10 +0200 (CEST)","from mail.dev.tdt.de (unknown [10.2.4.42])\n\tby securemail.tdt.de (Postfix) with ESMTP id E7B43240041;\n\tFri, 17 Apr 2026 10:36:10 +0200 (CEST)","from [10.2.3.40] (unknown [10.2.3.40])\n\tby mail.dev.tdt.de (Postfix) with ESMTPSA id BF16E23BD7;\n\tFri, 17 Apr 2026 10:36:10 +0200 (CEST)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776414981; cv=none;\n b=lczi7WTqjKgqK96kkNYQFL+4GM4easwDaEh7FlsX6Cg48iofF4iPDHxnHgrqPHCgR1SM6zuPXY2ucknGSb34EJW8bCOzThbxXW69R+0g7PuC1lkwD8yAN78OLzZOY+LWCsgi5LCb+tlk4gV5Z2zPPJ4fTD3uVkmwOaeewTbMZzM=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776414981; c=relaxed/simple;\n\tbh=eLZe6oSogFgFNQGIVtFMPFO0Vms8X8TQuQx8X9tkJlY=;\n\th=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References:\n\t In-Reply-To:To:Cc;\n b=PDlYIRl0GNmqOs6HFMNC1N7Xz6QZnUiBAM2t/Y4QbUrEvyFIw/B95zIBu7SOwF3Oygonn57vTn8U35BD0fKqrfpZo36dyEBf4Y8+a/nyqrHKCmSDkAdy/G3Po8Dn22GXPsa5jKUXHGDVTuiNZypcf1CSJIynXJBzYdJgjF0HZMM=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=dev.tdt.de;\n spf=pass smtp.mailfrom=dev.tdt.de;\n dkim=temperror (0-bit key) header.d=dev.tdt.de header.i=@dev.tdt.de\n header.b=PfcNhIHL; arc=none smtp.client-ip=194.37.255.70","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=dev.tdt.de;\n\ts=z1-selector1; t=1776414971;\n\tbh=mY2z2QKdBBeOr5UiVcsrgdhx1nZV87htEaBPB/m6dSw=;\n\th=From:Date:Subject:References:In-Reply-To:To:Cc:From;\n\tb=PfcNhIHLKCOuh6hsTq7jQ/30pQ0mboL/UKYqM83NXwmKnHwGq0HX1vNQhrvBRG0Nc\n\t OmDVbuzz0avZyMeIuLTcKyj4pXBtC8dDFdDvE23404Ao0JYXTLE1T2ApkmqJXa9CfX\n\t UQm/5wPSpj/AsqVzC9YxAVcSdQYN5JMxwq9gWsG601TcC0mTRdJBzQja38bGLqeOQF\n\t KNP/xw1Ml6paLgzA6BMyT48V3xybcU6/vpvppXlQ3e81BI01fHh2tBKtRplaQHSldc\n\t TKW7SGNOn2hVzaZafo8WHUeHa5w7zL3T7hhkkZ6bFXwlGVqBX0oRpqxWEQiFPDJSnI\n\t VSgaTCZbul+Dw==","From":"Florian Eckert <fe@dev.tdt.de>","Date":"Fri, 17 Apr 2026 10:35:50 +0200 (CEST)","Subject":"[PATCH v5 6/7] PCI: intel-gw: Move driver atu base assignment to\n probe function","Precedence":"bulk","X-Mailing-List":"linux-pci@vger.kernel.org","List-Id":"<linux-pci.vger.kernel.org>","List-Subscribe":"<mailto:linux-pci+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-pci+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Message-ID":"<20260417-pcie-intel-gw-v5-6-0a2b933fe04f@dev.tdt.de>","References":"<20260417-pcie-intel-gw-v5-0-0a2b933fe04f@dev.tdt.de>","In-Reply-To":"<20260417-pcie-intel-gw-v5-0-0a2b933fe04f@dev.tdt.de>","To":"Lorenzo Pieralisi <lpieralisi@kernel.org>, =?utf-8?q?Krzysztof_Wilczy?=\n\t=?utf-8?q?=C5=84ski?= <kwilczynski@kernel.org>,\n Manivannan Sadhasivam <mani@kernel.org>, Rob Herring <robh@kernel.org>,\n Bjorn Helgaas <bhelgaas@google.com>, Johan Hovold <johan+linaro@kernel.org>,\n Sajid Dalvi <sdalvi@google.com>, Ajay Agarwal <ajayagarwal@google.com>,\n Krzysztof Kozlowski <krzk+dt@kernel.org>, Conor Dooley <conor+dt@kernel.org>","Cc":"linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,\n\tdevicetree@vger.kernel.org, Florian Eckert <fe@dev.tdt.de>,\n\tEckert.Florian@googlemail.com, ms@dev.tdt.de","X-Mailer":"b4 0.14.2","X-Developer-Signature":"v=1; a=ed25519-sha256; t=1776414969; l=4090;\n i=fe@dev.tdt.de; s=20260205; h=from:subject:message-id;\n bh=kL2musMQ5PHaQWBVzchER4SxtQ6ESnYIALm57Dd11Ys=;\n b=MGUFGW1DqMVDQZmJQwac5r4KNEdwWjoroWsuXPX2wAuVFxy0K1HyDsbZ7nl98QuBioNXXHwmi\n Y3n4rB8f5MIBAxpWc8EXv4zZU5akHqoGc1/ZaraF2KCIVtOYlv10d4q","X-Developer-Key":"i=fe@dev.tdt.de; a=ed25519;\n pk=q7Pvv3Au2sAVRhBz5UF7ZqUPNxUwXQ78Jdqu8E6Negk=","Content-Transfer-Encoding":"quoted-printable","X-purgate-type":"clean","X-purgate-ID":"151534::1776414973-1A6C6049-5D25D6A0/0/0","X-purgate":"clean"},"content":"If no ATU resource is defined in the devicetree, then driver´s default\nvalue '0x300000' [1] is set. This is done during probing in the function\n'dw_pcie_get_resources()' [2] by dwc core.\n\nThe driver overwrites this again when its own init callback\n'pp->ops->init()' [3] function 'intel_pcie_host_setup()' [4] is called.\nThis is done, because the 'atu_base' offset for this IP is '0xC0000'rather\nthan '0x300000'.\n\ncallstack:\nintel_pcie_probe()\n  dw_pcie_host_init()\n    dw_pcie_host_get_resources()\n      dw_pcie_get_resources() [2]\n    pp->ops->init = intel_pcie_rc_init() [3]\n                      intel_pcie_host_setup() [4]\n\nHowever, this is a problem because, the callback 'pp->ops->init' is called\nafter 'dw_pcie_get_resources()' in dwc core (see callstack). The 'atu_base'\nmust be set before, so that this value is not set by dwc core. Therefore\nthe assignment of 'atu_base' is moved to driver´s probe function.\n\nWhile we’re at it, the change also adds the option to load ATU information\nfrom the device tree. For reasons of backwards compatibility, this is not\nmandatory. If ‘atu’ is not specified in the devicetree, then driver’s\ndefault value is still used and set in driver´s probe function. If the 'atu'\nresource is present in the devicetree, then dwc core loads it via the\nfunction 'dw_pcie_get_resources()' and not in the driver´s probe function.\n\n[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/pci/controller/dwc/pcie-designware.h?h=v7.0#n292\n[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/pci/controller/dwc/pcie-designware.c?h=v7.0#n150\n[3] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/pci/controller/dwc/pcie-designware-host.c?h=v7.0#n588\n[4] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/pci/controller/dwc/pcie-intel-gw.c?h=v7.0#n301\n\nSigned-off-by: Florian Eckert <fe@dev.tdt.de>\n---\n drivers/pci/controller/dwc/pcie-intel-gw.c | 28 ++++++++++++++++++++++++++--\n 1 file changed, 26 insertions(+), 2 deletions(-)","diff":"diff --git a/drivers/pci/controller/dwc/pcie-intel-gw.c b/drivers/pci/controller/dwc/pcie-intel-gw.c\nindex afd933050c92ee31c477e0b1738ab1136bdcfbf6..59b11e45944e199aac0f599f96d6cc90e2104708 100644\n--- a/drivers/pci/controller/dwc/pcie-intel-gw.c\n+++ b/drivers/pci/controller/dwc/pcie-intel-gw.c\n@@ -310,8 +310,6 @@ static int intel_pcie_host_setup(struct intel_pcie *pcie)\n \t\tgoto clk_err;\n \t}\n \n-\tpci->atu_base = pci->dbi_base + 0xC0000;\n-\n \tret = phy_init(pcie->phy);\n \tif (ret)\n \t\tgoto phy_err;\n@@ -395,6 +393,7 @@ static int intel_pcie_probe(struct platform_device *pdev)\n \tstruct device *dev = &pdev->dev;\n \tstruct intel_pcie *pcie;\n \tstruct dw_pcie_rp *pp;\n+\tstruct resource *res;\n \tstruct dw_pcie *pci;\n \tint ret;\n \n@@ -419,6 +418,31 @@ static int intel_pcie_probe(struct platform_device *pdev)\n \tpci->ops = &intel_pcie_ops;\n \tpp->ops = &intel_pcie_dw_ops;\n \n+\t/*\n+\t * If the 'atu' resource is not available in the devicetree,\n+\t * then use the driver default value for backward compatibility.\n+\t * The 'atu' should always be set in the devicetree, as this is\n+\t * hardware specific setting that should not be defined in the\n+\t * source.\n+\t */\n+\tres = platform_get_resource_byname(pdev, IORESOURCE_MEM, \"atu\");\n+\tif (!res) {\n+\t\tres = platform_get_resource_byname(pdev, IORESOURCE_MEM, \"dbi\");\n+\t\tpci->dbi_base = devm_pci_remap_cfg_resource(pci->dev, res);\n+\t\tif (IS_ERR(pci->dbi_base))\n+\t\t\treturn PTR_ERR(pci->dbi_base);\n+\t\tpci->dbi_phys_addr = res->start;\n+\t\tpci->atu_base = devm_ioremap(dev, res->start + 0xC0000, SZ_4K);\n+\t\tif (!pci->atu_base) {\n+\t\t\tdev_err(dev, \"failed to remap ATU space\\n\");\n+\t\t\treturn -ENOMEM;\n+\n+\t\t}\n+\t\tpci->atu_size = SZ_4K;\n+\t\tpci->atu_phys_addr = res->start + 0xC0000;\n+\t\tdev_warn(dev, \"devicetree ATU resource is missing; driver`s default value is being used\\n\");\n+\t}\n+\n \tret = dw_pcie_host_init(pp);\n \tif (ret) {\n \t\tdev_err(dev, \"Cannot initialize host\\n\");\n","prefixes":["v5","6/7"]}