From nobody Fri Apr 17 07:44:17 2026 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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 23ED98F49 for ; Mon, 23 Feb 2026 02:37:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771814276; cv=none; b=IjL3bdms0w1QbQORpYeM47D8GeQf9Rp/XDlpohDvEnAvJZ76/oWGvbsaMRJPxu5pfWvMdOoxmTuQ21Qcu8AO/ZQUHpGMiPIYKVZZCa8/XX8sDSU65dSk2Yjk+3EF0GQaMVqJMAV+n+tJhtoBXmiSt2DvmMGTEKWSUon4pH+xeD8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771814276; c=relaxed/simple; bh=U1qqUSl+ekG80aAN0BL8qAKe1EwwuLWWeKmOeg3iaTI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=soW+fQhbJR2JjjPrG8KHwp2bwy/5WwJqj24x0/e+Ua7qdNCT5IdcC3vObJmT12UNKWD1fUZslfiFO8fSldi6ieqeQD0hScJMr6KD3Q8mtXh+7z3Iz/pIsunCF53XZjwkyerH08NoQIp1W0Je+E5XaQKr++tG3nTnKWknMw8q1fg= 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=RdoClBb/; arc=none smtp.client-ip=209.85.128.53 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="RdoClBb/" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-4836e3288cdso25468045e9.0 for ; Sun, 22 Feb 2026 18:37:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771814272; x=1772419072; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Y4l6XEq4Cu+6mytZi6jUh4pUu7eeB+DRuzflxR/izUA=; b=RdoClBb/OMWfGFJM7XkFF/caTESIOqOGSB1Q8Q5NYgivP9950wr42D30rTtpwdI2Yp UUfb0vQP5UwWffd2DWRZnBuNN0n9qxxOB1oy0U1K5xvdFM3Za5L1sby94JpAnEy/3PbW 7vDRg5UrYE1FW+7ATxoSgX3Za4N1egi3a95XZoo1d9NEYHJEDLPXPLMLH6+0ssVJ/Np9 gDt4aaEnuLJr8sAruoZY1pHriEuAGZ3ua6ZIgVZy47II7KOgrmZyUOqQADWJTjsB/X4Z 84+pR1gtxRw8HWg6Rh4X/K2iSVHqLBq7DSwL5PdJaen+7zoPUg3sPT2ydZiC4rxFoy7l 7Yhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771814272; x=1772419072; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Y4l6XEq4Cu+6mytZi6jUh4pUu7eeB+DRuzflxR/izUA=; b=VGEF3lVNbMloc8bZ8dhl3mvw6k4Ijzy/0he6HU61Zo0Nw0rkxwtoYsozhMrl/lUIW2 AcgUf4Ip8J2WfyuKConAsdK2deDcPyF10SbLwLhFSPpKochZekvKKql6+Jk4XXRa267N KA0gkEiPzZ3d8Cxsag41EJpovyuxYlMIs4xlnOrW80b5Vzc8Jl0Izww0FjvISvHamSl9 q7W1iPSXq8ABrtiMEPA9AAM6pw1P9xbQY7ccu0OqtgaRAx+U4QfsB5BeDF1ScotWeBNR RIqRgZGWLx6LXcKaF3RwX6Q+zrdFzN2CIV6iYCjq2f9Xf6tpyeFJalxSONEZDPXrSiNg vElg== X-Forwarded-Encrypted: i=1; AJvYcCWvwyeRzaO834SxgJ4JuP7wqPuH1fSThwTeU0ot7q+dNJljulgTqzf0UpLEa6+X1aduLeidmXVsgBcA350=@vger.kernel.org X-Gm-Message-State: AOJu0YwyHthqnpgO+6bUa61PwZkO79/qIJaI1agaHIc0JKOrBHQbUKtx zoJpWWvgypPRQ9EVknNAY5YZLWT6QywarwG74o1h9JFu0qTX5IV0Niq/ X-Gm-Gg: AZuq6aJMmGuFqNKoulIQzp+3FWjiUxrz3XjQdbiXyHPGI7wEJXbcJKdEnGAuf5WKhwt qGnUewLuM9yCpUeBf3rn1A6aQfCTs7OiYZonouDfxESFmRsm7W8TE4TW+TSQSNOlMNkj+JhnLJd nmJBG0GOKK2SVCxPQhQquw4bJIBq8dQh9/+M8VbFeXa3Kmtv4QC0MHURYQcrhtyU39r7LHNQQxD 5mpRrTq3DqLKZMmQVDncCwrveUyQ/OaqbsHEDXs3x0KkUDxv0gUklo/9e9MQ6yWAMsiVOr51G49 +n9fuHCmVyurmfNRwaZjwLElY3Cpyw73onQn5LCguPfrEvvK5pdt4/WCkjhb5TouMwM2UyE77Zg J5hkpKlViiPhe+a7vCXB+eqn0jqzcy+HntDt/reOb4x8iG9h7UEUSE30NS5TibdzOaNJCRzJwvm NlvyQdonXDlLiNjdPKxeDMPM7Et2kMVAh2padqwSfXg9THEtWAMGIATakHnSZUkVc= X-Received: by 2002:a05:600c:214b:b0:47e:e051:79ee with SMTP id 5b1f17b1804b1-4839fe90522mr178048815e9.3.1771814272381; Sun, 22 Feb 2026 18:37:52 -0800 (PST) Received: from LAPTOP-B9QI2C1K.localdomain ([31.205.125.101]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43970bf9f77sm17687341f8f.5.2026.02.22.18.37.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Feb 2026 18:37:51 -0800 (PST) From: Majed Alkhaleefah To: Scott Murray , Bjorn Helgaas Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Majed Alkhaleefah Subject: [PATCH] PCI: cpcihp: Check pci_hp_add_bridge() return value Date: Mon, 23 Feb 2026 02:36:46 +0000 Message-ID: <20260223023645.344137-2-majedalkhaleefah@gmail.com> X-Mailer: git-send-email 2.43.0 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" Check the return value of pci_hp_add_bridge() in cpci_configure_slot(). If bridge initialization fails, log an error message using err(). Current functionality doesn't consider uninitialized bridges a failure. Changing this may introduce regressions. As such, intentionally avoid propagating the failure (e.g., returning -ENODEV). This patch addresses an item in the cpcihp TODO list. Compile-tested only. Signed-off-by: Majed Alkhaleefah --- drivers/pci/hotplug/cpci_hotplug_pci.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/pci/hotplug/cpci_hotplug_pci.c b/drivers/pci/hotplug/c= pci_hotplug_pci.c index 6c48066acb44..331c21833c44 100644 --- a/drivers/pci/hotplug/cpci_hotplug_pci.c +++ b/drivers/pci/hotplug/cpci_hotplug_pci.c @@ -269,8 +269,12 @@ int cpci_configure_slot(struct slot *slot) parent =3D slot->dev->bus; =20 for_each_pci_bridge(dev, parent) { - if (PCI_SLOT(dev->devfn) =3D=3D PCI_SLOT(slot->devfn)) - pci_hp_add_bridge(dev); + if (PCI_SLOT(dev->devfn) =3D=3D PCI_SLOT(slot->devfn)) { + if (pci_hp_add_bridge(dev) !=3D 0) { + err("Failed to initialize bridge %s at slot %02x", + pci_name(dev), slot->number); + } + } } =20 pci_assign_unassigned_bridge_resources(parent->self); --=20 2.43.0