From nobody Sat Sep 26 13:47:00 2026 Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) (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 AABF626738C for ; Tue, 1 Sep 2026 01:13:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788225227; cv=none; b=VvxV3nYpWtOTp2Lr+mCVroY3ldE/D6KSZvASaIQqkmjVnh1SBMQnioE7SxJ6dyQ4P3FYunKSeYW6FGtYeekkIz8jftbbHG439iDekPvm1asAAQLFgLAUVDww2Z0JAz7nAdNnkT+VJa155OLJ4YF0+h+Uizc+0MK0hCAzX296IWw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788225227; c=relaxed/simple; bh=6MU93lD7oPCvVgWA1NeStXtYPktufCBo3mj6HDbyAGg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=afF7GeJtEnQUT88w/BjlZh54YCL2afa2cx7Mz34RlCeIlthhLKdOwYnrooqUbuAquc+D1ND42GygnWDxGvux4Mx/9RGFxVrYG06OoWDusx9r2ifU5YOAt+G1nFo1q2dQik05usknJvDXoPPpxvctOIZZmn4At82nqjuMNAsHN3Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com; spf=pass smtp.mailfrom=riscstar.com; dkim=pass (2048-bit key) header.d=riscstar-com.20251104.gappssmtp.com header.i=@riscstar-com.20251104.gappssmtp.com header.b=xavhA7YA; arc=none smtp.client-ip=209.85.222.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=riscstar.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=riscstar-com.20251104.gappssmtp.com header.i=@riscstar-com.20251104.gappssmtp.com header.b="xavhA7YA" Received: by mail-qk1-f177.google.com with SMTP id af79cd13be357-930f618435cso362701285a.3 for ; Mon, 31 Aug 2026 18:13:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=riscstar-com.20251104.gappssmtp.com; s=20251104; t=1788225224; x=1788830024; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=y08cvUPAERT8DtacgubgZYXObs4Ve5NXsThRcrzdsK4=; b=xavhA7YADyS0y7zPAa/fYaLchuSN1gH/eSjP4m9qT/go9icu306dzxGooqf6+jyjV8 9SYrEFNK1GeSDKiafUERFvPEoqfSpXorrckVa4nyu5qOto+mspMpb2oq5sTK6xgAYtX0 dRnUNjM4tGGWrbK+jvZ24NDNlTMIigWt11/pKQear/A962//jLUqDc6NQ89ErOpQ/6WN 4KEbG9336UVO3657LS2/C4N8CZuiJE5uFCgcrO3UaKRy/FSCu4xkWKp/7n/vcq1/+cTN gYwUlVReVCl5iKhgK5y4muNboGcf+CzpeKKiHzhx8EFvCzaWS96HGmHp6W9V8sLVUpoE +nlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788225224; x=1788830024; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=y08cvUPAERT8DtacgubgZYXObs4Ve5NXsThRcrzdsK4=; b=Ggy60K25tqMGNhjWH3vmAusRNOTsQLSEBnR7tgMjX2SuoL7JhujNOSURTl6OF6qio/ 82oVg08O9WWap891aXtcnF9sSgbHw0goZKdblJ+d+oudCplL6o2+tpPmmgdxOJtzwYfw UTNqemdlBzZW+aLgBXA1oNxoIhW90lLPFe3FZETnqV5JcpMvuoMj00d9lAFEySU7VPxy 8EuSpR1lGQPAudDra1GXEgSV8vvCxhouCjU7YqMkRWld/KcupLYb7XJWf+/3JOQxxu4z KXFeCd+9+8JkswSoAD8gF+nxhJe6sMEgtpMmpjg1IWoQ22BGpCYj5GQHZe8W0hTbBSiY JLNw== X-Forwarded-Encrypted: i=1; AHgh+Rr4Ub0g7tvH79k8SYsk+xaIUX1/WpBSuct8URq2ggIBWmDoCdqsHnp6tDSJIFMRS29sfAoXZ6Le/qd5a9s=@vger.kernel.org X-Gm-Message-State: AFuF++kdbPoIWNDqaTqs7mxyCHM7+PUn8sDVxCUObYN4LS/qwKs2sCmO gs7pQGSvDktKbY93pkY5zF3jhsMowpo6Yir+EGxjn+KCLux00NAWlCt/sC6U/7zUsVQ= X-Gm-Gg: AR+sD11qMMEiN9OaI2+yATh7kq7GFselhI6Hfnmyyf4ARVQ246oOniZFmFyCZiBBS4Y 8AEElUNrd1g03hntYrEDxJuK12sANH7uR7YtZ32I20rHNJh7vwHJkoGNnF5c31PX3II7yNNZ75F Q/K1T6hrnLI0YadywaiSTq8XenSlIkkQiWy47BJ44b9v6i+tqQY9CsJOYE+62FZkKL591dB2/Tw xtSBEBb9ol2G34dmwEp5cR9Zaz2nvY5HDOR1T1Cax2N+oy49rJLNI2YR61acQnTcbZM4Giy4R2k P8pfw9lz36LwUHD36PtuVIcQXZ84qOCeJrsCfvugF0m40eOUY5QztfOh9Zhnj4keUy2gaKLoNRx a0duDbs+PYPnrUXNilaEeHAcrZNl9rXOKgu7r2BdqRcrX4f5KCwXF/PQWxc2ip6NlUIVSr2B4gl IejRW941Z+r/r8Hgs/GhLSViPDmPWPPCAPG7RyoAz67F6vqUaorb6l0tDXMAXyPAH8 X-Received: by 2002:a05:620a:2991:b0:939:36f3:fea8 with SMTP id af79cd13be357-93936f400d5mr1392214385a.25.1788225224521; Mon, 31 Aug 2026 18:13:44 -0700 (PDT) Received: from zippy.localdomain ([73.62.185.64]) by smtp.gmail.com with ESMTPSA id af79cd13be357-9391740a307sm581347285a.42.2026.08.31.18.13.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Aug 2026 18:13:44 -0700 (PDT) From: Alex Elder To: bhelgaas@google.com, robh@kernel.org, saravanak@kernel.org Cc: herve.codina@bootlin.com, daniel@riscstar.com, mohd.anwar@oss.qualcomm.com, lorenzo.bianconi@oss.qualcomm.com, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/4] PCI: of: drop the reg_num argument to of_pci_set_address() Date: Mon, 31 Aug 2026 20:13:34 -0500 Message-ID: <20260901011338.1323243-2-elder@riscstar.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260901011338.1323243-1-elder@riscstar.com> References: <20260901011338.1323243-1-elder@riscstar.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The reg_num argument passed to of_pci_set_address() is always zero, so get rid of it. Reviewed-by: Herve Codina Signed-off-by: Alex Elder --- drivers/pci/of_property.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/pci/of_property.c b/drivers/pci/of_property.c index 75a358f73e694..505226b876c56 100644 --- a/drivers/pci/of_property.c +++ b/drivers/pci/of_property.c @@ -52,7 +52,7 @@ enum of_pci_prop_compatible { }; =20 static void of_pci_set_address(struct pci_dev *pdev, u32 *prop, u64 addr, - u32 reg_num, u32 flags, bool reloc) + u32 flags, bool reloc) { if (pdev) { prop[0] =3D FIELD_PREP(OF_PCI_ADDR_FIELD_BUS, pdev->bus->number) | @@ -61,7 +61,7 @@ static void of_pci_set_address(struct pci_dev *pdev, u32 = *prop, u64 addr, } else prop[0] =3D 0; =20 - prop[0] |=3D flags | reg_num; + prop[0] |=3D flags; if (!reloc) { prop[0] |=3D OF_PCI_ADDR_FIELD_NONRELOC; prop[1] =3D upper_32_bits(addr); @@ -131,7 +131,7 @@ static int of_pci_prop_ranges(struct pci_dev *pdev, str= uct of_changeset *ocs, continue; =20 val64 =3D pci_bus_address(pdev, &res[j] - pdev->resource); - of_pci_set_address(pdev, rp[i].parent_addr, val64, 0, flags, + of_pci_set_address(pdev, rp[i].parent_addr, val64, flags, false); if (pci_is_bridge(pdev)) { memcpy(rp[i].child_addr, rp[i].parent_addr, @@ -164,7 +164,7 @@ static int of_pci_prop_reg(struct pci_dev *pdev, struct= of_changeset *ocs, struct of_pci_addr_pair reg =3D { 0 }; =20 /* configuration space */ - of_pci_set_address(pdev, reg.phys_addr, 0, 0, 0, true); + of_pci_set_address(pdev, reg.phys_addr, 0, 0, true); =20 return of_changeset_add_prop_u32_array(ocs, np, "reg", (u32 *)®, sizeof(reg) / sizeof(u32)); @@ -458,7 +458,7 @@ static int of_pci_host_bridge_prop_ranges(struct pci_ho= st_bridge *bridge, /* PCI bus address */ val64 =3D res->start; of_pci_set_address(NULL, &ranges[ranges_sz], - val64 - window->offset, 0, flags, false); + val64 - window->offset, flags, false); ranges_sz +=3D OF_PCI_ADDRESS_CELLS; =20 /* Host bus address */ --=20 2.53.0 From nobody Sat Sep 26 13:47:00 2026 Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) (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 F2D283563E8 for ; Tue, 1 Sep 2026 01:13:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788225228; cv=none; b=SRjSXmfd/AQqqWX+vboLAKa2aYNn8rbmfifDL25COaZd/qq6DCaiwge1K2+VwQ4FVC7gSZ5/hTA8MMPxn0GGpT6cyAusT59TcrgYW3kqXwXJ9cskkOqiIMSDA1nXBldmi1mcFUtVArXwXA2XOPBDgg9dyXYFyYZHowFdjUOCkzU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788225228; c=relaxed/simple; bh=BtmQtSAcOc1sMwXsSXHd/N0LJhsNzGr+XDlMMcgHhfo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WawdVcLUs+OmmP2FOpjRxvmlsAoWjsqgNB5Mv1eRWB+PiLuPuN2fdwhnhZutK6nLn6AH/uKtnpAhlv7Xoe2lNKUnu61JG7DPGjRKsJAAbNuW+30dhmlEQsG0+w6bPIAPrw7N3KwG30YPZyP4nrJfc4TgXFejsxw5A7cM58sYhEI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com; spf=pass smtp.mailfrom=riscstar.com; dkim=pass (2048-bit key) header.d=riscstar-com.20251104.gappssmtp.com header.i=@riscstar-com.20251104.gappssmtp.com header.b=UeO3NF6m; arc=none smtp.client-ip=209.85.222.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=riscstar.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=riscstar-com.20251104.gappssmtp.com header.i=@riscstar-com.20251104.gappssmtp.com header.b="UeO3NF6m" Received: by mail-qk1-f169.google.com with SMTP id af79cd13be357-939309d02d6so181794485a.3 for ; Mon, 31 Aug 2026 18:13:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=riscstar-com.20251104.gappssmtp.com; s=20251104; t=1788225226; x=1788830026; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=H/KJ6sckLCdEVJDbpdFqbeYqPNdthT6c5yyUBXrsMRU=; b=UeO3NF6mBiYWu/bg2jtm+5yt2bc4QNZS8A+vHdyNKJYVdxBjqTBU0XuzYLSO351pX1 Dga8jS+KlnI6U9rJPFIdB9pVlnItoSEMc1kYSUppdTDrCYRO55eebDax6IhEsP4+lrLE OzKjaLhrvQJ5OKunc/rXgGjZp5cB4I3zcQpbjm9CxXrz12L6KT0zgUsHydSxBpC+MLHU DUV11en0BbwjVTOgEsu1dea4JHdi8Gka4OCaY8flwbB+7GGiFzu7gGABQpOxwZlqh3Ak pZkWgnL1p0GvY3lYkDYgmZQVDWRpoRZyE0Klq4kRKbhOyOFI9JdRQ7qSDe+GTR2Q3xGO BKlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788225226; x=1788830026; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=H/KJ6sckLCdEVJDbpdFqbeYqPNdthT6c5yyUBXrsMRU=; b=FbRrP0BUtuzwq97aMMbp43/6L65AxJtJgjMyGq89gfzF7M9WKet38a9U4BWCJq0zOt n+W+QTx6aUsgXYjv1EGHGPuLczkgzAYqM95V4ce8v5J71dtjJSICLNAdAe4K6I+4kISm hXFI8XHFY2mmBKjQz9X/5dR6JFQCu65P3gjlxgrbJylcpRcI0Gc2ibQqj8BUVn/PUj9n PsWUJie/2Hvv63QXtQ+ra6F5pssxjsGr9iNj1wPRSQ3CvVI9h1rRd8aS7TijxzK2V92u /XsCh/yWVvKoP4/eXPYK8/5sl+vMRpWX+iMEhCvfhb1pGnw0l0PK1tjbGrVBZ0aC0RLA tp7w== X-Forwarded-Encrypted: i=1; AHgh+RpyLMXuTOZJJV1CK0MbfjBPw4cRwuqqrEwtSY4bQucgHjHSD3TL/7Unm69tl24f190OKjXSREqbvOC4Yl0=@vger.kernel.org X-Gm-Message-State: AFuF++n7v/YkPWGC6bdWDj2W4GNDC51FnQscQ0L6yVJifNzsIa8X4mpt JmmRwFbgIE/nT62bZmdLot/rkJ+j/HMdRKl3hc2cZAYhauKlUE12ehFrKBa5NwJapeg= X-Gm-Gg: AR+sD1121Mu0MWcR/twYyIPWySZQaOvk35VL5DA27Lo4uS59dCrtJjxDrJPVzYHrlio DiiQdfrUybgv4JhZ9mHJNso5YcOB9DA2BuplRlu9ib9eOYSr8RzVo04WJ84TKFHC+u1fLhGUpsu x4OHt7ejyag5zAeOvQG1uny4NVQbBOSLrisMmX9+9fMSvaXTnQmkE/TtlW3t1TaV+ag7M6ISkuk vc3GDEuY/U2efh4Cam63aE7Z8ipQOzSaQXrm4BumnN5L4Xn8na7USM+vFz5oHM07HgUJRzGpqJZ ITzyMvWYbj4cPbFzmColz30NFJKqW0lpRjoRi2VPznqfsneyh9Zv7mEAoB3LZKMKBppVeoo6brM FhIcBBE2pq1RVGJdGF1KJ9+SdCdFPpGfIjktAvejWIcco9ITo+PnJ5BbPB5KerCXrJEy58BabX7 toHP+XvIQWPg2hnEeJu0kSjQY2dfpG/8CXWFbH498Nx5a/FyIa8CjGz+/dhtGET4Hr X-Received: by 2002:a05:620a:319d:b0:937:2e9f:70a8 with SMTP id af79cd13be357-9394819fd3emr665302685a.39.1788225225778; Mon, 31 Aug 2026 18:13:45 -0700 (PDT) Received: from zippy.localdomain ([73.62.185.64]) by smtp.gmail.com with ESMTPSA id af79cd13be357-9391740a307sm581347285a.42.2026.08.31.18.13.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Aug 2026 18:13:45 -0700 (PDT) From: Alex Elder To: bhelgaas@google.com, robh@kernel.org, saravanak@kernel.org Cc: herve.codina@bootlin.com, daniel@riscstar.com, mohd.anwar@oss.qualcomm.com, lorenzo.bianconi@oss.qualcomm.com, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 2/4] PCI: of: don't zero flags in of_pci_get_addr_flags() Date: Mon, 31 Aug 2026 20:13:35 -0500 Message-ID: <20260901011338.1323243-3-elder@riscstar.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260901011338.1323243-1-elder@riscstar.com> References: <20260901011338.1323243-1-elder@riscstar.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The flags variable whose address is passed to of_pci_get_addr_flags() is zeroed before assigning a value to it. Skip the zeroing and just assign it instead. Reviewed-by: Herve Codina Signed-off-by: Alex Elder --- drivers/pci/of_property.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/pci/of_property.c b/drivers/pci/of_property.c index 505226b876c56..22fea1905a080 100644 --- a/drivers/pci/of_property.c +++ b/drivers/pci/of_property.c @@ -82,12 +82,10 @@ static int of_pci_get_addr_flags(const struct resource = *res, u32 *flags) else return -EINVAL; =20 - *flags =3D 0; + *flags =3D FIELD_PREP(OF_PCI_ADDR_FIELD_SS, ss); if (res->flags & IORESOURCE_PREFETCH) *flags |=3D OF_PCI_ADDR_FIELD_PREFETCH; =20 - *flags |=3D FIELD_PREP(OF_PCI_ADDR_FIELD_SS, ss); - return 0; } =20 --=20 2.53.0 From nobody Sat Sep 26 13:47:00 2026 Received: from mail-qk1-f173.google.com (mail-qk1-f173.google.com [209.85.222.173]) (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 6B2F1392814 for ; Tue, 1 Sep 2026 01:13:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788225230; cv=none; b=p18lv6suK2MOmrukIQpt99hl2lJrKQuMU8NeG2fSDPzauH3bCnPgaxHput7HEpvCPWmt1IK378QSWW9bVitXVsNIqNL/TE52t/u9jEEaGu/UtOOMIEDR1/gbGcDqMpoQUwfV0TzobwcGyTjQBO/J8LhNClqS0iZRpkRchNTdbDs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788225230; c=relaxed/simple; bh=N1/zE0vOogzKBBPg63BlWE0GGZRJLhZwlu+xUzAqzIc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kGxyNfYybkuMSY+QmGcmB72odYGYjJfJkh64MYkVxk4l73GfdgyJWBgzo8RS2aZVQIh/j4+Lndjs28o4gjmohaM3hAz8ORhu3KqnWq8wJKHcUydXg/458gwXGG9Yg2q7Dm0yKaGlygm1ex7P3SEg5U/mQFomqUoqSW4TkWjvuGE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com; spf=pass smtp.mailfrom=riscstar.com; dkim=pass (2048-bit key) header.d=riscstar-com.20251104.gappssmtp.com header.i=@riscstar-com.20251104.gappssmtp.com header.b=we4uzwAa; arc=none smtp.client-ip=209.85.222.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=riscstar.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=riscstar-com.20251104.gappssmtp.com header.i=@riscstar-com.20251104.gappssmtp.com header.b="we4uzwAa" Received: by mail-qk1-f173.google.com with SMTP id af79cd13be357-92f0b5ed131so503454085a.3 for ; Mon, 31 Aug 2026 18:13:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=riscstar-com.20251104.gappssmtp.com; s=20251104; t=1788225227; x=1788830027; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=KxdgYaNd6hSon04HBpeXAMQRDv5bhxmTgVA17jV1UzA=; b=we4uzwAaEHZDjQRUtrMHnDBvO8zxLQzWRHZs3bkFVtVvLYViV6Omsc/VWbfmJBYBsU UGto5zqc2caePWr0x7XiWriVxFPjAxZB/yurzGOuMK64ANRenXIsrP5it9Ldd+H0uaOM AFkbLKWwTm7Jx+7O80i3dypGlZ1ykFMHo9R4TJ+e/ANmvK3MEJSRYAeG/syPmyQ99Vk0 dl336pXPhc8MBq796slMVIULfacGV2EkYbvA5xa6vqCKgitZzuKBhfYa9RgUjn+3CTvg jeJCFCpIZWUdbJeTwep6FC8xhcCS+wyCwKHV4wVI3SKerKhAwm8o2ywTY10vY6F/3YbI Mmrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788225227; x=1788830027; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=KxdgYaNd6hSon04HBpeXAMQRDv5bhxmTgVA17jV1UzA=; b=tOpL9OmsFD0f1WIdj9Tq+QJOeMuSveop2B4i+EIWQuhQt22Sh4M2veA3mFMfNndLKn CXB27dsoAln8U4w0MD84mCn6ZjRjC36AtK1Vw7YeTS31hacNZNq73ZNRiqEgJjtGlz8E bkQPMMFhIqFqb6wcM7yEZE9recq7Vrj+j6oviGrFBhFfRJgT2OsaYkW8r9/MYW2zCYwE qbRyZooaHjrq+Vy9yLMU0Z0ZiDTQwpN0WlE7B0aYIZb6ksBnRn61+46O5TQHCIWG4/ye g4OpCaoX3ruHqPwitZ7rpL4q7RkGrHhTydMsT725coG1MwAiSXHpDCWJeJxD201rD4E9 pPBQ== X-Forwarded-Encrypted: i=1; AHgh+Rp8a5/ZZ93f0cK9Tq1pAImJ1qikyaSVFb8S60QyPLtEAa8oHNxAxwUVs5cUG8V6Q8VPA/ljqu59SdvtE/g=@vger.kernel.org X-Gm-Message-State: AFuF++k/zXgGDBhxcUiK/IiJO2rK12oDh4w78PtrzgpZ9Xmrl8ZkulUs xoXVtyMmRjjToS6tkODZaGtVe8tpCZXJf07hHgfPyZlQB9pcvp0dA3yspL5URLmq6P8= X-Gm-Gg: AR+sD11qbvF+HGTMgMHRFEly6LrjSm0s+qr0SPj93f8ZiYP3gGd4IR5WSPwVDeXDP8v 7fwfg7NtfAFIUbP3JbEsKVQ88ucJaz7GGRJd6uQ7xrY7/A27omjoCe7Bd8RIrnDNLBafggJaPtU tLAoKk4tiwel9R+voQLY9Zq8Dx+qbih5dw2qaylRi8INZ+voc7hbQzWiQcVDzBONyeBLEhhoNYP yl01thpteK2RhVICueXV7s/kUPx+Bokvd6eCY/gQX7FM2yh0Xm4fdjpWNbcJNhSU5lXj1tZJeFr ZwIcwF2mIeRp0ta3ckO/2+wMHyoNXNQ6n6TPlE2VYrewTqmyzIqQBqK5HPgeoRZEuh/ljwFbA+w 2OXK319jYFk+GdRvPkBdYIDEsGkLEodqDab6OosfG6pbDFwueUOfT+J0F1lRDqBISRL1obX8dPM FnqgojaqxG/J9lp/R3W3fMTsnPU6Dw6RRtS1oL0IulSFWpqOeFU9TllB+ag6GthuTv/V/lXHGx/ CE= X-Received: by 2002:a05:620a:4550:b0:937:27fb:96f8 with SMTP id af79cd13be357-9391397dc7dmr3345492585a.41.1788225227134; Mon, 31 Aug 2026 18:13:47 -0700 (PDT) Received: from zippy.localdomain ([73.62.185.64]) by smtp.gmail.com with ESMTPSA id af79cd13be357-9391740a307sm581347285a.42.2026.08.31.18.13.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Aug 2026 18:13:46 -0700 (PDT) From: Alex Elder To: bhelgaas@google.com, robh@kernel.org, saravanak@kernel.org Cc: herve.codina@bootlin.com, daniel@riscstar.com, mohd.anwar@oss.qualcomm.com, lorenzo.bianconi@oss.qualcomm.com, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 3/4] PCI: of: introduce of_pci_verify_node() Date: Mon, 31 Aug 2026 20:13:36 -0500 Message-ID: <20260901011338.1323243-4-elder@riscstar.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260901011338.1323243-1-elder@riscstar.com> References: <20260901011338.1323243-1-elder@riscstar.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Commit 407d1a51921e9 ("PCI: Create device tree node for bridge") linked the PCI enumeration process together with devicetree, creating a devicetree node for discovered PCI bridges. Its successor commit ae9813db1dc5a ("PCI: Add quirks to generate device tree node for Xilinx Alveo U50") shows how to use a PCI final fixup quirk to also create a devicetree node for a non-bridge PCI device. These changes allowed devicetree overlays to describe components downstream of a PCI device, by providing a place to attach the overlay. Note that the dynamic devicetree node is only created if the device didn't already have an assigned node. Later, commit aa7b4bbcb3a1d ("arm64: dts: qcom: qcs6490-rb3gen2: Add TC9563 PCIe switch node") *pre-defined* devicetree nodes to represent the PCI device nodes that would (also) be discovered via the PCI enumeration process. The devicetree node in this case is created with the content from the DTS file. So when a (host) bridge is done being initialized during PCI enumeration, no node is dynamically created (the commits mentioned above do not apply). Ideally, any pre-defined PCI devicetree node would contain exactly the same information as whatever the dynamic creation process would produce (though it could include more). However that is not the case for the pre-defined Qualcomm RB3gen2 nodes. And in particular, the endpoint (function) nodes include this property: device_type =3D "pci"; This is simply wrong; that property is meant only for bridge nodes. Rob Herring requested that a runtime check to be added to spot this specific error, only for non-bridge PCI devices. Herve Codina further suggested we ensure that bridge PCI devices *do* define the device_type property, with value "pci". Signed-off-by: Alex Elder Reviewed-by: Herve Codina --- v3: - Switch a function header to use kernel-doc format - Add a warning if a PCI bridge node has no device_type property drivers/pci/bus.c | 1 + drivers/pci/of.c | 31 +++++++++++++++++++++++++++++++ drivers/pci/pci.h | 3 +++ 3 files changed, 35 insertions(+) diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c index 655ed53436d3e..679afbc6d3109 100644 --- a/drivers/pci/bus.c +++ b/drivers/pci/bus.c @@ -351,6 +351,7 @@ void pci_bus_add_device(struct pci_dev *dev) * are not assigned yet for some devices. */ pcibios_bus_add_device(dev); + of_pci_verify_node(dev); pci_fixup_device(pci_fixup_final, dev); if (pci_is_bridge(dev)) of_pci_make_dev_node(dev); diff --git a/drivers/pci/of.c b/drivers/pci/of.c index a51dff91b196d..1838a3109514c 100644 --- a/drivers/pci/of.c +++ b/drivers/pci/of.c @@ -1085,3 +1085,34 @@ int of_pci_get_equalization_presets(struct device *d= ev, return 0; } EXPORT_SYMBOL_GPL(of_pci_get_equalization_presets); + +/** + * of_pci_verify_node - Sanity check some PCI device node properties + * @pdev: The PCI device whose device node is checked + * + * PCI enumeration authoritatively discovers what we need to know about + * a PCI device. A devicetree-based platform will represent a PCI root + * bridge with a node, but otherwise devicetree doesn't typically include + * many PCI nodes. Where such nodes do exist, experience has shown that + * the "device_type" property is sometimes wrong, so warn about that. + */ +void of_pci_verify_node(struct pci_dev *pdev) +{ + struct device_node *np =3D pci_device_to_OF_node(pdev); + bool device_is_bridge; + bool device_type_pci; + + /* Nothing to check if there's no pre-existing devicetree node */ + if (!np) + return; + + device_is_bridge =3D pci_is_bridge(pdev); + device_type_pci =3D of_node_is_type(np, "pci"); + + /* Bridges should have device type "pci"; endpoints should not */ + if (device_is_bridge =3D=3D device_type_pci) + return; + + dev_err(&pdev->dev, "PCI %s have \"pci\" device_type property\n", + device_is_bridge ? "bridge should" : "endpoint should not"); +} diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index ba3c3fddddc23..2e33d3bd4b0ba 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h @@ -1253,6 +1253,7 @@ bool of_pci_supply_present(struct device_node *np); int of_pci_get_equalization_presets(struct device *dev, struct pci_eq_presets *presets, int num_lanes); +void of_pci_verify_node(struct pci_dev *pdev); #else static inline int of_get_pci_domain_nr(struct device_node *node) @@ -1308,6 +1309,8 @@ static inline int of_pci_get_equalization_presets(str= uct device *dev, =20 return 0; } + +static inline void of_pci_verify_node(struct pci_dev *pdev) { } #endif /* CONFIG_OF */ =20 struct of_changeset; --=20 2.53.0 From nobody Sat Sep 26 13:47:00 2026 Received: from mail-qk1-f182.google.com (mail-qk1-f182.google.com [209.85.222.182]) (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 9403B391E7A for ; Tue, 1 Sep 2026 01:13:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788225232; cv=none; b=Nz0q2FmdDwAbP22ydKHZxFiVpyEivGmur4Qi87z3DlTwQcIu6EPVB+rL1cP6cYeqGWp13OCLyOvKYvpb/3mZfQ9Yi2HqY0G7ZPKLBMqo5jF+ad6pS1WBBTv+KQ6buw4eoPzLCTcQMmbq0Kyud/12gF+25tVJWWTAplSJVW/PMw4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788225232; c=relaxed/simple; bh=WKNiEu5bb54kPNb9BHttsHup3tUYWbXtGShP7J3NSTI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DI42OHEYxaHPwYz0oO7ikkrTxka+iki8wIp5j3pd0PTuj5OHPT+ThEksvjdoYx8kP2HirY1t66ZeQWoilJBR6yAVZ/SLldWxpz4oUq5yslSCzJO1bm7nb/Wqbsoe3fmDMI32+T97Pz44MB3fsVLYUWMO2cG34CFgeQ/6TmIEyA4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com; spf=pass smtp.mailfrom=riscstar.com; dkim=pass (2048-bit key) header.d=riscstar-com.20251104.gappssmtp.com header.i=@riscstar-com.20251104.gappssmtp.com header.b=LUkh9QB1; arc=none smtp.client-ip=209.85.222.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=riscstar.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=riscstar-com.20251104.gappssmtp.com header.i=@riscstar-com.20251104.gappssmtp.com header.b="LUkh9QB1" Received: by mail-qk1-f182.google.com with SMTP id af79cd13be357-9371bcf1f8fso293936885a.1 for ; Mon, 31 Aug 2026 18:13:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=riscstar-com.20251104.gappssmtp.com; s=20251104; t=1788225228; x=1788830028; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=3KMFnK7MaewcQgkI6RfHvTFLlVRVgXCbhr3VFJt6MAI=; b=LUkh9QB1qbS5Ebdef1hnPz1YpFe912bhC/nANz2FQNEbW36eEEKyImMKVyf15go/IE LR0EO+1Dxf1/Bu+UIoyXk77Dp0aNsi40PHAbMC7uIM+bV5K1fjvAGCGGrDY2WSiwb2Cz t44RfbAk9QrwviAtzEmLVXJ7+bt+lGOuyleDY5asm4B+iW31N+3YlQ+nKLCKRYecCMJL yAC6jl/qCqenleubmFXnTXipi8J/QKLDcckwyC/eO9YxRMiSyec6JZxThWa9guzJYdzn Q4yjj3Y4HMX0HF5kC8JAAtB7gEN1/b6+cjjTlrZkHOlS+yfTXDMMp+o2S8EPA5go4gNL fAGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788225228; x=1788830028; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=3KMFnK7MaewcQgkI6RfHvTFLlVRVgXCbhr3VFJt6MAI=; b=KFhQd6c1X3xVxBHdBmu+6pZ99ptmKo9EmjntGvozeNRzbT2bYr50Sg4MDwwxm/si6g DSSjlJfQqsZOtsp+/W++1rTcsYqbXl2C6m11qyO3tOWmJM/bQ47x7dNqHUdk5DyfCyvb PNATcG1muzZyKQZdxUTMBeyDV4ZwFA1T/F4w8zsJlCXfXZA1xKeGmV9yDSsSC5b6UV1a KGW+A227at6I0m+1asDYoqgwO2Z1FzLIU4POk9PPORAq/cwzjOu9HJnyFb4diO/VY6ai av2ygOdEhjaDelgd3QYLIBbtxRmdZRYUDDLl05zKf8UnlN9MlovvQrdQfa1ORpM5ApEZ Y8Sw== X-Forwarded-Encrypted: i=1; AHgh+RqbrlYXeI7bpM0OFIi7RjrwbVHa+5BNvD7j7jX4VENO9psIONNmG7SJLMsu5+xshT+cSRzUzvLYH6+IVoc=@vger.kernel.org X-Gm-Message-State: AFuF++kkXFPp4FY21U5i38w9lL5Z/l0MzcSaSeAyEKve8qo8F1aFYSaF VuXuLn5M4lvEM7kqdJAkksBPUjK0NUNFTvyfwD5ED8Qpmv+Qz4bLEgNm9jMMShPcxTg= X-Gm-Gg: AR+sD10hiIDql3RZmzMadI/ydq8j04wUp30GKIG+yUZcJHsf8TCmBaKQG5uIbc/qe3Y U2fVukKwd8wxFBQn7v5DupYQz1SARXtUb0Q+T0/r4srZAUGyhnj/AgDX6PcPY31HnqejgOG58eu BQcN1Gs3zq6YkbqPeVKDCaN1XNB/D+fap27DhP54XZ9rn+2tOm3zDY1fLzG18CJsR5rIoIcTHOC l3NSTb0yY1taictcjwj50KJrmaHAKYfq3OmgsHga4lrZDKsopV2Ec2TTuy1FcQVc08gUPkWSsHO meR7JcW7uECMuemVfUxhWQztdsN3ve5ZgVLB0DyIAtao5Km1IwF2ytlQq7+EqovjQAuzMUypzQH IwP3ULahdcTpPkhc02vKeGfwy/c17aEhVUeU+kYTUInUeuoZesyVzr/3w2D4oGgcARqjy/9i6Yp LcugVQIvVtZOvrJXpO0ked5uIg1isxpRVCtXdrss7v25INqk1GqQCsARJaCUZ/oUJtUG8PTVJvU VE= X-Received: by 2002:a05:620a:40cb:b0:930:b4f9:f327 with SMTP id af79cd13be357-939138df3d1mr3066774785a.33.1788225228344; Mon, 31 Aug 2026 18:13:48 -0700 (PDT) Received: from zippy.localdomain ([73.62.185.64]) by smtp.gmail.com with ESMTPSA id af79cd13be357-9391740a307sm581347285a.42.2026.08.31.18.13.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Aug 2026 18:13:47 -0700 (PDT) From: Alex Elder To: bhelgaas@google.com, robh@kernel.org, saravanak@kernel.org Cc: herve.codina@bootlin.com, daniel@riscstar.com, mohd.anwar@oss.qualcomm.com, lorenzo.bianconi@oss.qualcomm.com, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 4/4] of: address: kill of_node_is_pcie() Date: Mon, 31 Aug 2026 20:13:37 -0500 Message-ID: <20260901011338.1323243-5-elder@riscstar.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260901011338.1323243-1-elder@riscstar.com> References: <20260901011338.1323243-1-elder@riscstar.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The of_bus->match function for the "PCI" bus type is fairly liberal in what it accepts as a PCI bus devicetree node. If a node has no device_type property, it even allows a node named "pcie@" to be accepted as represnting a devicetree bus, though it issues a warning in that case. A recent PCI commit introduced of_pci_verify_node(). When a PCI device is added, if it has a devicetree node, that function checks its device_type property. For PCI bridge devices, if there is no device_type property (value "pci"), a warning is issued. That warning duplicates the warning made by of_node_is_pcie(), and there's no point in that. Avoid the second (OF) warning by just checking the node name directly in of_bus_pci_match(). That leaves of_node_is_pcie() unused, so get rid of it. Signed-off-by: Alex Elder --- v3: - Added (new) in this version of the series drivers/of/address.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/of/address.c b/drivers/of/address.c index 499d37ceae210..ee2eb44884d85 100644 --- a/drivers/of/address.c +++ b/drivers/of/address.c @@ -134,16 +134,6 @@ static unsigned int of_bus_pci_get_flags(const __be32 = *addr) * PCI bus specific translator */ =20 -static bool of_node_is_pcie(const struct device_node *np) -{ - bool is_pcie =3D of_node_name_eq(np, "pcie"); - - if (is_pcie) - pr_warn_once("%pOF: Missing device_type\n", np); - - return is_pcie; -} - static int of_bus_pci_match(struct device_node *np) { /* @@ -156,7 +146,7 @@ static int of_bus_pci_match(struct device_node *np) */ return of_node_is_type(np, "pci") || of_node_is_type(np, "pciex") || of_node_is_type(np, "vci") || of_node_is_type(np, "ht") || - of_node_is_pcie(np); + of_node_name_eq(np, "pcie"); } =20 static void of_bus_pci_count_cells(struct device_node *np, --=20 2.53.0