From nobody Mon Feb 9 06:30:58 2026 Received: from mail-dy1-f175.google.com (mail-dy1-f175.google.com [74.125.82.175]) (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 0466311CA0 for ; Fri, 9 Jan 2026 23:20:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768000840; cv=none; b=nV9tmzuePKWz/mO8/MGDt90bwJBi3ZNLPqRzI1Zl8TLXHSRpDt5BzVPIRCCSO7jAu54bvp86o9w+r98sltAHq3eP0TR0MKwqlYKxsm2VNoCCVAX3iBsyrW4hUOLlrpc8zyn2NxSkYf1Lju2czqSLTUoLWPA7Gz6FbPEpgULxMZU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768000840; c=relaxed/simple; bh=uauslJDPya+Mi7zN1byIbUwAtUSQdr/JY6BhQOY2c/Q=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=gRJWx/bfczm0AudjpqBwFN6CcB8p74WCd29IDpHWjEPayWrOaXcT8p/PBUVpL9ETbePJmV1vN2xF4/KRjGZvwu7uwN3WCWho/GBL/s5LOgYZbACORbXreb06Sg8QDeOFEHyAI6Jr54+E6GIER5FIHwKg1Of4GRymme/GvgkIaUA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=c3CVD0jJ; arc=none smtp.client-ip=74.125.82.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="c3CVD0jJ" Received: by mail-dy1-f175.google.com with SMTP id 5a478bee46e88-2ae53df0be7so7162987eec.1 for ; Fri, 09 Jan 2026 15:20:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1768000838; x=1768605638; 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=qjc69Ug76udGWAJNdjlmNMgaDAb0OMq4cVdQ7MxrqJE=; b=c3CVD0jJ9WGxFSqtFXoqRtwAgq5Oj8Gruceqzr6ZYJ6ID+CCn5lfobA7QMw97TLXBy +8UvL1jDPgrDyFkYgwS3fK1ktNJrUD+oMw+XNNUWYbw+p0D0eLX6UbkvpsJKtKkQE8un k9I/xiOxeGPcoaXs+cbYEQJ76wYSydE8BjSXk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768000838; x=1768605638; 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=qjc69Ug76udGWAJNdjlmNMgaDAb0OMq4cVdQ7MxrqJE=; b=CaUKmV0J3olYjGiPSb787a7pFUsxIKyz8oEtzXpmb2nbikmGhXhoYRZEgTZn45tPbf +6qqbeq2RTDXxYolSmK4Yz9BclIIKAru2dHVUcjzwjiFR221od0oMPa7GBawgs4NsYkR IQoabEDMTXl1JyeQV0cuH5a/MRLt6Dqrc3JhPCU7lPmreHbWvk1asl7vZD/10P0E2cH3 2A1TBv4QnqdItE2VTUWRKqxbMOQ+3Mek3N+TlFej1byv9RJ6SCzzBU3Xi2a6RYFBidn7 87MmZOGDL/FzYTIen3Zfi1DgLHRwAXJW0L4Rs1rYrIWJNeYTH9Axz0OiPxxEHbymdy/y GHxA== X-Forwarded-Encrypted: i=1; AJvYcCUINBUodWprkbNtlmC4rhNHVwxtnyyd403+kqCAJZc2GBP66gP2T3iWDVvrLP6Gml2OtrMKNndh6SJiAg8=@vger.kernel.org X-Gm-Message-State: AOJu0Yyd5ekTcEmFM6OKHWhRAMXQVWuOQX/kJyErIFuo38evXgbwbB4Y FNYc1eofng/xp4ChyCt8tDPuFJrBewHKLkPocat+j+ltb78bKdUIDvR1qnS3rXdy6A== X-Gm-Gg: AY/fxX4VB6y5KTN5bVdiiLPvc+wTr7jy0LrCOaBpPf3AVyYkOMw/K9tpBGDoHB6lVtR fBw6LMdLV3HJ/uW83sR9paV6MuBF+ZkNGQAkz28dNw8rwLFuyl7W5omVOvtf2KrGkG0ZhkUa4FH cwm+raWvUmYuQK04VCjUzrGahAEEtnXbusRTypCelO1PBIbNGZMXlERiEOOTd36UGix0yEOHCfG I7YwORc8AgzgVl6+nXBtUmRYNyQL0BHsMGgvFvn5p5TPLOM+qhoc8cjDPEuE7I3yq/5XVeRfiSy D+Z+S+tx+OAzGm+Dq8sOBMm8F+W+Hs1GrAaJwVPks6Svh1NlmysgcWwVXD040LVpapCGkMuJaDn tS6KajEzsdU8S3HxfRZA/Qqn8dBIl3QyJ/hBFM5RNhV6m/Npfvzi7Vz6P8LTMiu8ElJEgWaUN6N ZNPuglUJC/yQNZzow9yhGLznx6GbZmNBgaXthoMj7HklhhcCg59w== X-Google-Smtp-Source: AGHT+IENuKRYZp3sFnXek7nzyZvUtio8CAjc9bIG5jdIyZX3kNkVI7th7ggrqtKv/AAwDJa2fnZXLw== X-Received: by 2002:a05:693c:3101:b0:2b0:5b8f:1c5a with SMTP id 5a478bee46e88-2b17d30f8f8mr11744254eec.31.1768000834204; Fri, 09 Jan 2026 15:20:34 -0800 (PST) Received: from localhost ([2a00:79e0:2e7c:8:b4c7:3d26:a6c4:9c0e]) by smtp.gmail.com with UTF8SMTPSA id 5a478bee46e88-2b1707b16e4sm11779989eec.26.2026.01.09.15.20.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 09 Jan 2026 15:20:33 -0800 (PST) From: Brian Norris To: Bjorn Helgaas Cc: Lukas Wunner , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Manivannan Sadhasivam , Brian Norris Subject: [PATCH] PCI/portdrv: Allow probing even without child services Date: Fri, 9 Jan 2026 15:20:13 -0800 Message-ID: <20260109152013.1.I5fd5d83f518681b3949d8ab2f16ba8244fd3e774@changeid> X-Mailer: git-send-email 2.52.0.457.g6b5491de43-goog 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 PCIe port driver fails to probe if it finds no child services, presumably under the assumption that the driver is not useful in that case. However, the driver *can* still be useful for power management support -- namely, it still configures the port for runtime PM / D3, which may be important for allowing a bridge to enter low power modes. Thus, we allow probe to succeed even if no IRQs and no child services are available. This also mirrors existing behavior for ports that have no PCIe capabilities, where we'd also probe successfully. This change is a bit more important after commit f5cd8a929c82 ("PCI: dwc: Remove MSI/MSIX capability for Root Port if iMSI-RX is used as MSI controller"), because it's common for some DWC-based systems to: 1. have only have the "aer" and "pcie_pme" port services available and 2. not define legacy INTx interrupts properly in their device tree. After commit f5cd8a929c82, such systems may fail pcie_init_service_irqs() and so exit with -ENODEV. Link: https://lore.kernel.org/all/nyada24tqwlkzdceyoxbzitzygvp4elvj5oajnqdw= b33xkcdwk@76vnrx45fsfd/ Signed-off-by: Brian Norris --- drivers/pci/pcie/portdrv.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/drivers/pci/pcie/portdrv.c b/drivers/pci/pcie/portdrv.c index 38a41ccf79b9..e47901a3e880 100644 --- a/drivers/pci/pcie/portdrv.c +++ b/drivers/pci/pcie/portdrv.c @@ -330,7 +330,7 @@ static int pcie_device_init(struct pci_dev *pdev, int s= ervice, int irq) */ static int pcie_port_device_register(struct pci_dev *dev) { - int status, capabilities, i, nr_service; + int status, capabilities, i; int irqs[PCIE_PORT_DEVICE_MAXSERVICES]; =20 /* Enable PCI Express port device */ @@ -355,29 +355,18 @@ static int pcie_port_device_register(struct pci_dev *= dev) if (status) { capabilities &=3D PCIE_PORT_SERVICE_HP; if (!capabilities) - goto error_disable; + return 0; } =20 /* Allocate child services if any */ - status =3D -ENODEV; - nr_service =3D 0; for (i =3D 0; i < PCIE_PORT_DEVICE_MAXSERVICES; i++) { int service =3D 1 << i; if (!(capabilities & service)) continue; - if (!pcie_device_init(dev, service, irqs[i])) - nr_service++; + pcie_device_init(dev, service, irqs[i]); } - if (!nr_service) - goto error_cleanup_irqs; =20 return 0; - -error_cleanup_irqs: - pci_free_irq_vectors(dev); -error_disable: - pci_disable_device(dev); - return status; } =20 typedef int (*pcie_callback_t)(struct pcie_device *); --=20 2.52.0.457.g6b5491de43-goog