From nobody Mon Feb 9 16:16:50 2026 Received: from out30-111.freemail.mail.aliyun.com (out30-111.freemail.mail.aliyun.com [115.124.30.111]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E89FB295DBD; Sat, 24 Jan 2026 07:46:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.111 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769240796; cv=none; b=jwCNdMY8yMrV9mc10TlOgdteY9w6hyXTeh94BhwvWyn4LBNK2ZN1jZSk4L0DovoKkZY50wMzRjZshrO+M4EQImN+ZkvJ/ounrvfJWCS9f/MKSTCdEbDKCcL/LInJkpfWMy3hrB022a/hEIo+6rGzIsk7SeEhUkY8xQWEpEPl4dk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769240796; c=relaxed/simple; bh=DHHusRbl1IM4WN4WL9LdbN3k4S50p6qeMvx+0XHW0V8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=gRGvN7zxztWP6AwXZgNNbvdq5Aj1JpnQbqgnZc5MKCbKUQl5/PW2PWy8LdZlKQZ4R8rVwK2hFw6iuqdo21spNI7EYyHyZaUzjporBR6lPOie2K7Xvv5CNQzyn0NDwjWLNqqg4lMQQCsERWyr0FyyDuxv43puxE645pl85LaOJfM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=Alaj+Rcu; arc=none smtp.client-ip=115.124.30.111 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="Alaj+Rcu" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1769240785; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=Z4gdvlXokQQkApksODv/C5pE+VqLfxiQb8yzNUh4ogA=; b=Alaj+RcuD7WFDhtwyDLdP7cSly0cK2cDfC+8I3B2mOsJ1E3KRO4wqEFMcahIsew4IePn/Ig+iYePL0elkFMPBgO6LCkv0XxU/I+Tf2zqKg03P01eTTQK5bwdDSnoPBg6kJK/hKbkOUSp6jo30qSc14mqDdcETuNISZMYmRscJt0= Received: from localhost.localdomain(mailfrom:xueshuai@linux.alibaba.com fp:SMTPD_---0WxiIIAG_1769240784 cluster:ay36) by smtp.aliyun-inc.com; Sat, 24 Jan 2026 15:46:25 +0800 From: Shuai Xue To: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, bhelgaas@google.com, kbusch@kernel.org, sathyanarayanan.kuppuswamy@linux.intel.com Cc: mahesh@linux.ibm.com, oohall@gmail.com, xueshuai@linux.alibaba.com, Jonathan.Cameron@huawei.com, terry.bowman@amd.com, tianruidong@linux.alibaba.com, lukas@wunner.de Subject: [PATCH v7 1/5] PCI/DPC: Clarify naming for error port in DPC Handling Date: Sat, 24 Jan 2026 15:45:53 +0800 Message-Id: <20260124074557.73961-2-xueshuai@linux.alibaba.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20260124074557.73961-1-xueshuai@linux.alibaba.com> References: <20260124074557.73961-1-xueshuai@linux.alibaba.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" dpc_handler() is registered for error port which recevie DPC interrupt and acpi_dpc_port_get() locate the port that experienced the containment event. Rename edev and pdev to err_port for clear so that later patch will avoid misused err_port in pcie_do_recovery(). No functional changes intended. Reviewed-by: Kuppuswamy Sathyanarayanan Signed-off-by: Shuai Xue Reviewed-by: Jonathan Cameron --- drivers/pci/pcie/dpc.c | 10 +++++----- drivers/pci/pcie/edr.c | 34 +++++++++++++++++----------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/drivers/pci/pcie/dpc.c b/drivers/pci/pcie/dpc.c index fc18349614d7..bff29726c6a5 100644 --- a/drivers/pci/pcie/dpc.c +++ b/drivers/pci/pcie/dpc.c @@ -361,21 +361,21 @@ static bool dpc_is_surprise_removal(struct pci_dev *p= dev) =20 static irqreturn_t dpc_handler(int irq, void *context) { - struct pci_dev *pdev =3D context; + struct pci_dev *err_port =3D context; =20 /* * According to PCIe r6.0 sec 6.7.6, errors are an expected side effect * of async removal and should be ignored by software. */ - if (dpc_is_surprise_removal(pdev)) { - dpc_handle_surprise_removal(pdev); + if (dpc_is_surprise_removal(err_port)) { + dpc_handle_surprise_removal(err_port); return IRQ_HANDLED; } =20 - dpc_process_error(pdev); + dpc_process_error(err_port); =20 /* We configure DPC so it only triggers on ERR_FATAL */ - pcie_do_recovery(pdev, pci_channel_io_frozen, dpc_reset_link); + pcie_do_recovery(err_port, pci_channel_io_frozen, dpc_reset_link); =20 return IRQ_HANDLED; } diff --git a/drivers/pci/pcie/edr.c b/drivers/pci/pcie/edr.c index e86298dbbcff..521fca2f40cb 100644 --- a/drivers/pci/pcie/edr.c +++ b/drivers/pci/pcie/edr.c @@ -150,7 +150,7 @@ static int acpi_send_edr_status(struct pci_dev *pdev, s= truct pci_dev *edev, =20 static void edr_handle_event(acpi_handle handle, u32 event, void *data) { - struct pci_dev *pdev =3D data, *edev; + struct pci_dev *pdev =3D data, *err_port; pci_ers_result_t estate =3D PCI_ERS_RESULT_DISCONNECT; u16 status; =20 @@ -169,36 +169,36 @@ static void edr_handle_event(acpi_handle handle, u32 = event, void *data) * may be that port or a parent of it (PCI Firmware r3.3, sec * 4.6.13). */ - edev =3D acpi_dpc_port_get(pdev); - if (!edev) { + err_port =3D acpi_dpc_port_get(pdev); + if (!err_port) { pci_err(pdev, "Firmware failed to locate DPC port\n"); return; } =20 - pci_dbg(pdev, "Reported EDR dev: %s\n", pci_name(edev)); + pci_dbg(pdev, "Reported EDR dev: %s\n", pci_name(err_port)); =20 /* If port does not support DPC, just send the OST */ - if (!edev->dpc_cap) { - pci_err(edev, FW_BUG "This device doesn't support DPC\n"); + if (!err_port->dpc_cap) { + pci_err(err_port, FW_BUG "This device doesn't support DPC\n"); goto send_ost; } =20 /* Check if there is a valid DPC trigger */ - pci_read_config_word(edev, edev->dpc_cap + PCI_EXP_DPC_STATUS, &status); + pci_read_config_word(err_port, err_port->dpc_cap + PCI_EXP_DPC_STATUS, &s= tatus); if (!(status & PCI_EXP_DPC_STATUS_TRIGGER)) { - pci_err(edev, "Invalid DPC trigger %#010x\n", status); + pci_err(err_port, "Invalid DPC trigger %#010x\n", status); goto send_ost; } =20 - dpc_process_error(edev); - pci_aer_raw_clear_status(edev); + dpc_process_error(err_port); + pci_aer_raw_clear_status(err_port); =20 /* * Irrespective of whether the DPC event is triggered by ERR_FATAL * or ERR_NONFATAL, since the link is already down, use the FATAL * error recovery path for both cases. */ - estate =3D pcie_do_recovery(edev, pci_channel_io_frozen, dpc_reset_link); + estate =3D pcie_do_recovery(err_port, pci_channel_io_frozen, dpc_reset_li= nk); =20 send_ost: =20 @@ -207,15 +207,15 @@ static void edr_handle_event(acpi_handle handle, u32 = event, void *data) * to firmware. If not successful, send _OST(0xF, BDF << 16 | 0x81). */ if (estate =3D=3D PCI_ERS_RESULT_RECOVERED) { - pci_dbg(edev, "DPC port successfully recovered\n"); - pcie_clear_device_status(edev); - acpi_send_edr_status(pdev, edev, EDR_OST_SUCCESS); + pci_dbg(err_port, "DPC port successfully recovered\n"); + pcie_clear_device_status(err_port); + acpi_send_edr_status(pdev, err_port, EDR_OST_SUCCESS); } else { - pci_dbg(edev, "DPC port recovery failed\n"); - acpi_send_edr_status(pdev, edev, EDR_OST_FAILED); + pci_dbg(err_port, "DPC port recovery failed\n"); + acpi_send_edr_status(pdev, err_port, EDR_OST_FAILED); } =20 - pci_dev_put(edev); + pci_dev_put(err_port); } =20 void pci_acpi_add_edr_notifier(struct pci_dev *pdev) --=20 2.39.3