Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.1/patches/2220466/?format=api
{ "id": 2220466, "url": "http://patchwork.ozlabs.org/api/1.1/patches/2220466/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260407104154.2842132-3-sherry.sun@nxp.com/", "project": { "id": 28, "url": "http://patchwork.ozlabs.org/api/1.1/projects/28/?format=api", "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 }, "msgid": "<20260407104154.2842132-3-sherry.sun@nxp.com>", "date": "2026-04-07T10:41:44", "name": "[V11,02/12] PCI: host-generic: Add common helpers for parsing Root Port properties", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "65e3a4aa92f474ec36f224478afcdeb2024f595e", "submitter": { "id": 77063, "url": "http://patchwork.ozlabs.org/api/1.1/people/77063/?format=api", "name": "Sherry Sun", "email": "sherry.sun@nxp.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260407104154.2842132-3-sherry.sun@nxp.com/mbox/", "series": [ { "id": 498961, "url": "http://patchwork.ozlabs.org/api/1.1/series/498961/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-pci/list/?series=498961", "date": "2026-04-07T10:41:47", "name": "pci-imx6: Add support for parsing the reset property in new Root Port binding", "version": 11, "mbox": "http://patchwork.ozlabs.org/series/498961/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2220466/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2220466/checks/", "tags": {}, "headers": { "Return-Path": "\n <linux-pci+bounces-52027-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=pass (2048-bit key;\n unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256\n header.s=selector1 header.b=J6r/Bs6j;\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-52027-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com\n header.b=\"J6r/Bs6j\"", "smtp.subspace.kernel.org;\n arc=fail smtp.client-ip=52.101.72.39", "smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=nxp.com", "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=nxp.com", "dkim=none (message not signed)\n header.d=none;dmarc=none action=none header.from=nxp.com;" ], "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)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fqjX16DzSz1yD3\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 07 Apr 2026 20:45:21 +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 3B390306962D\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 7 Apr 2026 10:42:01 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id E68B23A9601;\n\tTue, 7 Apr 2026 10:42:00 +0000 (UTC)", "from AM0PR02CU008.outbound.protection.outlook.com\n (mail-westeuropeazon11013039.outbound.protection.outlook.com [52.101.72.39])\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 1D42A3A9618;\n\tTue, 7 Apr 2026 10:41:59 +0000 (UTC)", "from VI0PR04MB12114.eurprd04.prod.outlook.com\n (2603:10a6:800:315::13) by DB9PR04MB8281.eurprd04.prod.outlook.com\n (2603:10a6:10:25f::21) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9769.17; Tue, 7 Apr\n 2026 10:41:56 +0000", "from VI0PR04MB12114.eurprd04.prod.outlook.com\n ([fe80::feda:fd0e:147f:f994]) by VI0PR04MB12114.eurprd04.prod.outlook.com\n ([fe80::feda:fd0e:147f:f994%6]) with mapi id 15.20.9769.018; Tue, 7 Apr 2026\n 10:41:56 +0000" ], "ARC-Seal": [ "i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775558520; cv=fail;\n b=meGj3LgFKLYOq+ZXIYPWLsyfZpBgzbIEe0SELV5j3/knyaq1mHdj/wcrm4eVG0+sbl+rqNBrk/z+Q4KjFKAhDV6Xoq35CeUTEkwQElF4VRhRMoVOssDz9H9pWmpBR/9UzujcM3JCgj0co4hwGjrQgDJatlrQNxNxIqnHnqmL25w=", "i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;\n b=j0Kl1VhpjIojc4hIXHwHy3PlPLU5ZdRKP350JuNMS31EzypOMeqL/G80YIPw8ZZa5wNIQVZct+Z4pnwO2RwLDxLF9MVLXKfDJ1YH2Vr/TRLj5dkHvvzbo5CqYU3c0ztBecMRFYxAvheY6Y8fDxF0Hlg1PmJp0kRVWl0c++SUbOmiNCBwGZ7om1Yh+SLwyQZ8GC6462IFwkgvT0VGSkZspcz71pXpu0gA46AAT5ldK/e8tzTnKEzQvcAH8zLmliyPW8/2G08ZWi6S+f/1jRfB0RepPZk4fVDo32DdkOf+iwFGUwDcIkSMSQwB3a/0mJYBJn/aq3/N5uBMtiuh0W7Ijg==" ], "ARC-Message-Signature": [ "i=2; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775558520; c=relaxed/simple;\n\tbh=ABBA6YcqUqncWx1Yfw3oBQivDxneBXvCKZzIxNjCLHM=;\n\th=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:\n\t Content-Type:MIME-Version;\n b=NW98rLXjSEoYnYnfojLkbcYp49Gl/aWdPQTnMIOvuF0wqNn7zPPTZ4etOg1zulYgtb39cHq4IneHuuODwsZ2CcoEp2X3MCNJoHvhGaSmApUl8Rlvs5x0ItRnCs9GD2e1G00qEefqGGqwvjmLZLfYKnb9bp5aW1uKpqkp0YDYPwo=", "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector10001;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;\n bh=JWc5DpOZwdPAWd68S6FIswmTCvI8uEkPWqQpR0jDV1o=;\n b=neIr+Qg7c6ZrPggqsPcOuhelY5nnMYn9ruoLmRUy/q5SbnNzIlX6Uk0iyKpc+yhS6ngDbUT8bdMurAm1GlKDw53LdI64gvU/mt4id/khMUOAmE5qlvr5TAMWyRiJj8EpKMXQvD5WX9LX65jYc0FMNWEcBipcx+j/UQS1SdMuZ2evoFYX51UFILoQX4GvmHZgMD4k3VHOtQ+g6ONrgcaLDfUneW/hJPcEC4ZUYMCyRXqitVuvHgrZoW3fSqW6SE2j/1p4d/Bi1KtsHJQRdz2UnqVGl/jCHnwETc2sa+/l0yI39SoxnOwJyiseJGOfalT+G/D3zvfdkVlbUwH9uwFPjA==" ], "ARC-Authentication-Results": [ "i=2; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=nxp.com;\n spf=pass smtp.mailfrom=nxp.com;\n dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com\n header.b=J6r/Bs6j; arc=fail smtp.client-ip=52.101.72.39", "i=1; mx.microsoft.com 1; spf=pass\n smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass\n header.d=nxp.com; arc=none" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=JWc5DpOZwdPAWd68S6FIswmTCvI8uEkPWqQpR0jDV1o=;\n b=J6r/Bs6jWnhjI7MI485SVe5jQwiPG/zY2wBNtZBzZbP/VyZ4tBwt42/zrYAviLgHy2WPQhcomPLDCIiA4Fu8Qsea8qEKGOm7JkO7DPvJobMr5ueDkhtRiu+r7906oxrfZ6PoLdzi2h368qacy/R+8Qzg83/msdya/UvprQfqKR2zlAO9ouE5Z4KowD0R6m1H/xnELcZsMOQWQBsCTyVnL4T+s8C7+qoKK5yfl3Z8uUD8rFDAGJKyRw541eq9ivabNDd4rh9hHc2n8lYiwBtIU3LilBvocBhtnFgc9h2tYnJVMeSmJczXILzvW4zaEAIGfhgv5Ih3PAjBvUQUPotyrQ==", "From": "Sherry Sun <sherry.sun@nxp.com>", "To": "robh@kernel.org,\n\tkrzk+dt@kernel.org,\n\tconor+dt@kernel.org,\n\tFrank.Li@nxp.com,\n\ts.hauer@pengutronix.de,\n\tkernel@pengutronix.de,\n\tfestevam@gmail.com,\n\tlpieralisi@kernel.org,\n\tkwilczynski@kernel.org,\n\tmani@kernel.org,\n\tbhelgaas@google.com,\n\thongxing.zhu@nxp.com,\n\tl.stach@pengutronix.de", "Cc": "imx@lists.linux.dev,\n\tlinux-pci@vger.kernel.org,\n\tlinux-arm-kernel@lists.infradead.org,\n\tdevicetree@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org", "Subject": "[PATCH V11 02/12] PCI: host-generic: Add common helpers for parsing\n Root Port properties", "Date": "Tue, 7 Apr 2026 18:41:44 +0800", "Message-Id": "<20260407104154.2842132-3-sherry.sun@nxp.com>", "X-Mailer": "git-send-email 2.37.1", "In-Reply-To": "<20260407104154.2842132-1-sherry.sun@nxp.com>", "References": "<20260407104154.2842132-1-sherry.sun@nxp.com>", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain", "X-ClientProxiedBy": "MA5P287CA0060.INDP287.PROD.OUTLOOK.COM\n (2603:1096:a01:1d3::9) To VI0PR04MB12114.eurprd04.prod.outlook.com\n (2603:10a6:800:315::13)", "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", "X-MS-PublicTrafficType": "Email", "X-MS-TrafficTypeDiagnostic": "VI0PR04MB12114:EE_|DB9PR04MB8281:EE_", "X-MS-Office365-Filtering-Correlation-Id": "2b7681fb-1a10-4d82-947c-08de94924a35", "X-MS-Exchange-SenderADCheck": "1", "X-MS-Exchange-AntiSpam-Relay": "0", "X-Microsoft-Antispam": "\n\tBCL:0;ARA:13230040|19092799006|52116014|376014|7416014|366016|1800799024|38350700014|921020|56012099003|22082099003|18002099003;", "X-Microsoft-Antispam-Message-Info": "\n\t1iVgPN9QPYsxBJVugCyAapqnLpOTPD2gAmydzDBtluyuVdzqg6zSwaPS/PWlbUwxumgSpot+BvIY/45cIoxkGuhtiE/sxd5fSJqPRyDI9TXY+o5D64vUGIRbxdWa/C0psg9vvIgtTSaV1zpii/y0tZkKO8597FYQ0lV3ErUP5OAcjI/FT9LtM9to1j4i2JmTadboKKr9iVOrvj5sBwKpDM+8WHKCn2byUR/FLwwQ1p7HBICCUxZkDyXTeipZGlQ8B+HtpJSuVEBloHSo0LcngdJgyelluHP3ZffvNXVSQEhy79RlAlU4Zg7aOWDhn8o65E7cogw/Iff5JcBaxr5tVdF81d0Xxf78cteJgiFmUvgsYgE8UdbHXVZKaYG/ZMOO2XPjUtZIablLdMIUKW+QkM7Y7K/g6JPoorXvgJIPnblkbk0wahK8FdIG7IglgYWHw1+JHzbIpu+sZ4QdbM9VsaPg6csRvgg6tsY/fbjxeZfBN8nTRmRM/1wpxwAV0LPYqQZjN1o0lsibYfJs4quWEAciICGSFmiuku5EFyIC/qG1bgZ350ZQENc+VG/PXfJsNbajLBhzUOXhlqWGresZndHLs3ZCTS/mZMvtdwrHBMlnNr+amwrhD72RqWd8W6UYzAt3J0ryhU7vkCM+A5uqqp6iAj6+lqqFWvYh5XWQjsPFwg9HLfvFi0J5Hu2bbc0QvPBMi85jG7zs6ni9S4U8UKCPTe7a60sYPHD5SqNxvh0OKWokCp18MgLy/IE3CTEVL84wAh7cF4za3k8vk0kJZtmm9OzaP/4NPBxnM39xnME=", "X-Forefront-Antispam-Report": "\n\tCIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI0PR04MB12114.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(19092799006)(52116014)(376014)(7416014)(366016)(1800799024)(38350700014)(921020)(56012099003)(22082099003)(18002099003);DIR:OUT;SFP:1101;", "X-MS-Exchange-AntiSpam-MessageData-ChunkCount": "1", "X-MS-Exchange-AntiSpam-MessageData-0": "\n MX4smWyBaB+muglZbxsT7LEI/qCqTT5TmqQhbasaXqtgvE8NIkKAiklvo74x4XCKD6ijDouZJaVAzRdbiaRdZgmOJRzvZUglL+lOwzfIEExygHGf4aok3opClKnHlhy8ft7wBLZWw9CwRkmFnH6IQ9PGBSOhPH/TqjuxM5+NOYIKCwBb1udEuWMLFlfjRUs+P5N7Kl4PwwGZSm8zSSCSE7AzaWqNlP1V0B7WD8H5SIlvNn8fCvD0LNbkP82kCHPWFJLGFwQB8JokXfxrFPDb03ffxyRWxHDGOSFXn16MQ8edAYf2yARcQ53+hSBu20HW2cM88kEm0jgpdPoqfsE5Fw5dkW9jFEF5b4BarqZ14GOztncXHsmDpBKDrsZwLT51CdvONAHeNttjAjkUWW0vxisN5aNQe4OvV8snU0y9Rs0bn9UxuPcepty5EYpEK3PnE1XNgGXQtlbeSZi+z7xBl+6JMqat/BYY/gvDQjgfe11XbTcfW07o/aYRvWpJMhp0sWt3jZkqu0nYHVvbCrvDMtbrCspoPuioPsU4blPJUHWSrkM+UlMHOpKzcGkM4CgfoKo2VVKOVhEk23ocDeOdF9CotQ9gFNtkv4kA8f5LbM9mEKYjQogQ5nOzZ/tw27xSIddFUqb/MOFQGhypNEtqLkWMcDgn+eqvRIyIQfWdIlCM2NmoGdvrfwyu0c0+QtHTdvv82TLgJJuss2EqSzhQEl8z3PAVvvlBu53QNEQh0AxwDnSFTJyzHqaSb+DjWgbKPhLH0Y2qxVLrMwQuxzRsgKqhbZI41dPLmJ7d9MZdau57F8eTAld5NxkBINAFdWrfVwIEmoh0Y21/BWzQxmPe7F1IgtPP4pE+W/QUoSzg+D7YnisH997MHo9ud64YlC0kxfICvQ98P+UGUjE0qUy6zuVmp6ZhSGpuunxkibjWYqYFyQqIieWsQ8FUfb2CVA7d1d3ENyZWucSIdWe8XiLa1j3MowrAEiA0Lr+bxGC9+rFABOS5ucnettW5SiMtJiDWeIwjSFyKAYIwbPyPQVY3MAlFz6gjhI2u+p2RYTEMRlksBPVH17u+qQkmGc1okd5cUHNjZX3b3h39Tc3swzgFC6OiC61uGCutZtcxy3lAvDHXYCFW9bC47x5cYeDdp8iXaRIAqGCy/+WpFqAl2HT14Gheil/1oofYv+5wxGhBJWow8oveypA+2aT45viZ4V4Z2E/bEL4gjIYIyYNRPZERCnKsKE2KeTLzDRYZO3duV1ZC7UIsThXt+pmblbSPSKdch7qIBFsisON4yUg5RdJoHWk1Mhb5PTvZcS+gQoKginHsqBnmst7/x7JfZllNF0kl/ydQX3Ln2KmABdlpp6pDOBCG0CADn3iMW1x3JRwjbxVy99m5+I8tcXIfVdLlN/0ZCVQ4HYQyMYvIlLpHfgOfqU+OdCLBAntohigC+9ewWSCebFuEzJ1+e1mMioqU+RItLDp0Y4W9cOSlP7DkUBSOZGtZF5F6oDbAqrrlmGjp3dzPkTByDokwWEA9Ew1lr+eKVNqJ2TggUZ9d0qRksmJJLHwReH5pxhP4L4KsEPvVi14luKKwuMEBxkHGLgVAh2SXx4v+X8zO4j52ExZDUNSEHABETPwt3nsyLD4YGhsihexi4LXJKMwv0aeDg8fIPNmQO3YtAby/p01BCaNcyyznMbx9X6JokhlEyHwgLnIDis7eTjTvhFk/GKpb4WlSiM9Y+jmbC4r6sayG4lEQ+Jgc7g==", "X-OriginatorOrg": "nxp.com", "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n 2b7681fb-1a10-4d82-947c-08de94924a35", "X-MS-Exchange-CrossTenant-AuthSource": "VI0PR04MB12114.eurprd04.prod.outlook.com", "X-MS-Exchange-CrossTenant-AuthAs": "Internal", "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "07 Apr 2026 10:41:56.7272\n (UTC)", "X-MS-Exchange-CrossTenant-FromEntityHeader": "Hosted", "X-MS-Exchange-CrossTenant-Id": "686ea1d3-bc2b-4c6f-a92c-d99c5c301635", "X-MS-Exchange-CrossTenant-MailboxType": "HOSTED", "X-MS-Exchange-CrossTenant-UserPrincipalName": "\n amskOO6n8iZs4NX3v4Fk3TLgHVHZCFzEzaoUiB0+ZxnKMEVsXfLGjU0V9XQi+euAG7YV2IFlBbRtQDj1Q/zOLA==", "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "DB9PR04MB8281" }, "content": "Introduce generic helper functions to parse Root Port device tree nodes\nand extract common properties like reset GPIOs. This allows multiple\nPCI host controller drivers to share the same parsing logic.\n\nDefine struct pci_host_port to hold common Root Port properties\n(currently only reset GPIO descriptor) and add\npci_host_common_parse_ports() to parse Root Port nodes from device tree.\n\nAlso add the 'ports' list to struct pci_host_bridge for better maintain\nparsed Root Port information.\n\nSigned-off-by: Sherry Sun <sherry.sun@nxp.com>\n---\n drivers/pci/controller/pci-host-common.c | 77 ++++++++++++++++++++++++\n drivers/pci/controller/pci-host-common.h | 16 +++++\n drivers/pci/probe.c | 1 +\n include/linux/pci.h | 1 +\n 4 files changed, 95 insertions(+)", "diff": "diff --git a/drivers/pci/controller/pci-host-common.c b/drivers/pci/controller/pci-host-common.c\nindex d6258c1cffe5..0fb6991dde7b 100644\n--- a/drivers/pci/controller/pci-host-common.c\n+++ b/drivers/pci/controller/pci-host-common.c\n@@ -9,6 +9,7 @@\n \n #include <linux/kernel.h>\n #include <linux/module.h>\n+#include <linux/gpio/consumer.h>\n #include <linux/of.h>\n #include <linux/of_address.h>\n #include <linux/of_pci.h>\n@@ -17,6 +18,82 @@\n \n #include \"pci-host-common.h\"\n \n+/**\n+ * pci_host_common_delete_ports - Cleanup function for port list\n+ * @data: Pointer to the port list head\n+ */\n+void pci_host_common_delete_ports(void *data)\n+{\n+\tstruct list_head *ports = data;\n+\tstruct pci_host_port *port, *tmp;\n+\n+\tlist_for_each_entry_safe(port, tmp, ports, list)\n+\t\tlist_del(&port->list);\n+}\n+EXPORT_SYMBOL_GPL(pci_host_common_delete_ports);\n+\n+/**\n+ * pci_host_common_parse_port - Parse a single Root Port node\n+ * @dev: Device pointer\n+ * @bridge: PCI host bridge\n+ * @node: Device tree node of the Root Port\n+ *\n+ * Returns: 0 on success, negative error code on failure\n+ */\n+static int pci_host_common_parse_port(struct device *dev,\n+\t\t\t\t struct pci_host_bridge *bridge,\n+\t\t\t\t struct device_node *node)\n+{\n+\tstruct pci_host_port *port;\n+\tstruct gpio_desc *reset;\n+\n+\treset = devm_fwnode_gpiod_get(dev, of_fwnode_handle(node),\n+\t\t\t\t \"reset\", GPIOD_ASIS, \"PERST#\");\n+\tif (IS_ERR(reset))\n+\t\treturn PTR_ERR(reset);\n+\n+\tport = devm_kzalloc(dev, sizeof(*port), GFP_KERNEL);\n+\tif (!port)\n+\t\treturn -ENOMEM;\n+\n+\tport->reset = reset;\n+\tINIT_LIST_HEAD(&port->list);\n+\tlist_add_tail(&port->list, &bridge->ports);\n+\n+\treturn 0;\n+}\n+\n+/**\n+ * pci_host_common_parse_ports - Parse Root Port nodes from device tree\n+ * @dev: Device pointer\n+ * @bridge: PCI host bridge\n+ *\n+ * This function iterates through child nodes of the host bridge and parses\n+ * Root Port properties (currently only reset GPIO).\n+ *\n+ * Returns: 0 on success, -ENOENT if no ports found, other negative error codes\n+ * on failure\n+ */\n+int pci_host_common_parse_ports(struct device *dev, struct pci_host_bridge *bridge)\n+{\n+\tint ret = -ENOENT;\n+\n+\tfor_each_available_child_of_node_scoped(dev->of_node, of_port) {\n+\t\tif (!of_node_is_type(of_port, \"pci\"))\n+\t\t\tcontinue;\n+\t\tret = pci_host_common_parse_port(dev, bridge, of_port);\n+\t\tif (ret)\n+\t\t\treturn ret;\n+\t}\n+\n+\tif (ret)\n+\t\treturn ret;\n+\n+\treturn devm_add_action_or_reset(dev, pci_host_common_delete_ports,\n+\t\t\t\t\t&bridge->ports);\n+}\n+EXPORT_SYMBOL_GPL(pci_host_common_parse_ports);\n+\n static void gen_pci_unmap_cfg(void *ptr)\n {\n \tpci_ecam_free((struct pci_config_window *)ptr);\ndiff --git a/drivers/pci/controller/pci-host-common.h b/drivers/pci/controller/pci-host-common.h\nindex b5075d4bd7eb..37714bedb625 100644\n--- a/drivers/pci/controller/pci-host-common.h\n+++ b/drivers/pci/controller/pci-host-common.h\n@@ -12,6 +12,22 @@\n \n struct pci_ecam_ops;\n \n+/**\n+ * struct pci_host_port - Generic Root Port properties\n+ * @list: List node for linking multiple ports\n+ * @reset: GPIO descriptor for PERST# signal\n+ *\n+ * This structure contains common properties that can be parsed from\n+ * Root Port device tree nodes.\n+ */\n+struct pci_host_port {\n+\tstruct list_head\tlist;\n+\tstruct gpio_desc\t*reset;\n+};\n+\n+void pci_host_common_delete_ports(void *data);\n+int pci_host_common_parse_ports(struct device *dev, struct pci_host_bridge *bridge);\n+\n int pci_host_common_probe(struct platform_device *pdev);\n int pci_host_common_init(struct platform_device *pdev,\n \t\t\t struct pci_host_bridge *bridge,\ndiff --git a/drivers/pci/probe.c b/drivers/pci/probe.c\nindex eaa4a3d662e8..629ae08b7d35 100644\n--- a/drivers/pci/probe.c\n+++ b/drivers/pci/probe.c\n@@ -677,6 +677,7 @@ static void pci_init_host_bridge(struct pci_host_bridge *bridge)\n {\n \tINIT_LIST_HEAD(&bridge->windows);\n \tINIT_LIST_HEAD(&bridge->dma_ranges);\n+\tINIT_LIST_HEAD(&bridge->ports);\n \n \t/*\n \t * We assume we can manage these PCIe features. Some systems may\ndiff --git a/include/linux/pci.h b/include/linux/pci.h\nindex 8f63de38f2d2..a73ea81ce88f 100644\n--- a/include/linux/pci.h\n+++ b/include/linux/pci.h\n@@ -636,6 +636,7 @@ struct pci_host_bridge {\n \tint\t\tdomain_nr;\n \tstruct list_head windows;\t/* resource_entry */\n \tstruct list_head dma_ranges;\t/* dma ranges resource list */\n+\tstruct list_head ports;\t\t/* Root Port list (pci_host_port) */\n #ifdef CONFIG_PCI_IDE\n \tu16 nr_ide_streams; /* Max streams possibly active in @ide_stream_ida */\n \tstruct ida ide_stream_ida;\n", "prefixes": [ "V11", "02/12" ] }