From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 24BAAD715D1 for ; Sat, 24 Jan 2026 07:46:50 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4dyn1T6V79z3bf4; Sat, 24 Jan 2026 18:46:37 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip=115.124.30.101 ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1769240797; cv=none; b=O3EMNNK76aFSRkfZ6bBfsmTsysS+J4OIfDRNV/lRpQehHeCGr9K9SMDlrrEGE0ytj4SQEPVFl+B5E5DdcN0DIX7DL4qtU731Cb2Uq3nT4IQxwYxjakV68CrzGYHaupX7D1IyrJPbBSphc0aWTh/5scTawugZDUoNMEWZ3wT1xmwTUHSAl/3V5cXvVTYFPvh14nXeVPsS44LOWX8ya19YSXC7Y8Qh4rcTA4j7bUEJnPPT0pXF3tfMPMtZ9UHU8Vvi2/sCQDw8jzdgbDwZFH0egu1NRRkdpdBYzE+dpxWodglbq3njEqgzW4pH+ESADyyb6CvpjLUbol0n+UVYx46/cQ== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1769240797; c=relaxed/relaxed; bh=Z4gdvlXokQQkApksODv/C5pE+VqLfxiQb8yzNUh4ogA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=NzwjYbPwdzdzty6yz88KOLsIJE2KHqL8xIKdAmGdp7xladbqchIc4C8ZPLGmo8TNktK3B81grR73eUQtS4nMplnmBE7GFfL5za27p6cbaU1tj3QLTMHtDQkpGTeWchO60jC6wydrqzQ/VlSwObEncKaC35ZR1wi8xVPA366ch0fRm5Xf4DeW+Ys/hxZf027d6atRroCLtDeDeVsqw2x9cLi2enckGyEew6tey7Dr0FIfsEbWqJUORI3s3dvkvZjDWfW7AhrvmaqsjN7SgyEOuwywc/1idreQWmem54uzcfpceEXxHCfklx4VNnAPeKfFY3Ge56E3wBp5cKtmQqvsRA== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; dkim=pass (1024-bit key; unprotected) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.a=rsa-sha256 header.s=default header.b=BFKiCpYY; dkim-atps=neutral; spf=pass (client-ip=115.124.30.101; helo=out30-101.freemail.mail.aliyun.com; envelope-from=xueshuai@linux.alibaba.com; receiver=lists.ozlabs.org) smtp.mailfrom=linux.alibaba.com Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.a=rsa-sha256 header.s=default header.b=BFKiCpYY; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.alibaba.com (client-ip=115.124.30.101; helo=out30-101.freemail.mail.aliyun.com; envelope-from=xueshuai@linux.alibaba.com; receiver=lists.ozlabs.org) Received: from out30-101.freemail.mail.aliyun.com (out30-101.freemail.mail.aliyun.com [115.124.30.101]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4dyn1Q1cgfz2yql for ; Sat, 24 Jan 2026 18:46:32 +1100 (AEDT) DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1769240787; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=Z4gdvlXokQQkApksODv/C5pE+VqLfxiQb8yzNUh4ogA=; b=BFKiCpYYMxKZiYhOfQOGGeoWoYS5LB4bMGFvoCZEO8PaTP/TTNU/nJuTm0mID6lkTmZE2dy0d0gCdx/WJDmo5bCG8FKGAHG5WYeZ5wrRX23Bl+MdyGCuaswMQmFd+L69GRjxXVBV3vV/k6mcxRrGoAhOitV1Gm7KfyQJbidNIFI= 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> X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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 *pdev) static irqreturn_t dpc_handler(int irq, void *context) { - struct pci_dev *pdev = context; + struct pci_dev *err_port = context; /* * 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; } - dpc_process_error(pdev); + dpc_process_error(err_port); /* 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); 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, struct pci_dev *edev, static void edr_handle_event(acpi_handle handle, u32 event, void *data) { - struct pci_dev *pdev = data, *edev; + struct pci_dev *pdev = data, *err_port; pci_ers_result_t estate = PCI_ERS_RESULT_DISCONNECT; u16 status; @@ -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 = acpi_dpc_port_get(pdev); - if (!edev) { + err_port = acpi_dpc_port_get(pdev); + if (!err_port) { pci_err(pdev, "Firmware failed to locate DPC port\n"); return; } - pci_dbg(pdev, "Reported EDR dev: %s\n", pci_name(edev)); + pci_dbg(pdev, "Reported EDR dev: %s\n", pci_name(err_port)); /* 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; } /* 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, &status); 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; } - dpc_process_error(edev); - pci_aer_raw_clear_status(edev); + dpc_process_error(err_port); + pci_aer_raw_clear_status(err_port); /* * 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 = pcie_do_recovery(edev, pci_channel_io_frozen, dpc_reset_link); + estate = pcie_do_recovery(err_port, pci_channel_io_frozen, dpc_reset_link); send_ost: @@ -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 == 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); } - pci_dev_put(edev); + pci_dev_put(err_port); } void pci_acpi_add_edr_notifier(struct pci_dev *pdev) -- 2.39.3