From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 DC0281974EB; Thu, 6 Jun 2024 14:17:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717683459; cv=none; b=WAxtlhXeZaTHyfUAGgtcfO+a0o3IkleggPMXNo+a0LBh9sn9V2dNS55G6E/KN9/pzR0fTV4hbgY6KrPKLFp05iDHPn0FwnRl2U5RBvqR1+UUoYEwk6mh8mHbaqMNs1iJSBxydILnTA2LhsIdihcLjL7QT6Q0xqzWy9nx0gU/OW8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717683459; c=relaxed/simple; bh=ujE6YGSxhPdbtbhM+DtClxFc9v2vWWwYq+2z+nqrlP0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hh4rr0ACo8aKcaxt67wsdABJHaZEkZk8i4UlJGcE6lyJFifJ+cbTNxBkGqwkNCYNfvkXBwmFU5/B+orYyR8rgHtQaK+6mXrDoe4/WVOI+QdiBq3kwtxBuIctGb4LFG5hYDQh7rTNqITWf+1bAEwLxnPx2g5VwiRwqm1yU8vTNzI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=qr4W2gU3; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="qr4W2gU3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB398C2BD10; Thu, 6 Jun 2024 14:17:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1717683459; bh=ujE6YGSxhPdbtbhM+DtClxFc9v2vWWwYq+2z+nqrlP0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qr4W2gU38yQV5c+Tr2TypUQYJ1cIz4F7HIAe1Lh5Zzb3KfUBo+9PmKdqyT4BN4wW2 yhAiLYMdcDtur8+iLdtnwLC3yM66qztvo1nv/e93SLg7Wl4RFxwcqoL5Cja6rU7T5b 2qcXSa2oFi9uGsakvAiB15fvO2DvVpGklo7HBL5c= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Kuppuswamy Sathyanarayanan , Bjorn Helgaas , Sasha Levin , Satish Thatchanamurthy Subject: [PATCH 6.1 338/473] PCI/EDR: Align EDR_PORT_LOCATE_DSM with PCI Firmware r3.3 Date: Thu, 6 Jun 2024 16:04:27 +0200 Message-ID: <20240606131711.087177539@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240606131659.786180261@linuxfoundation.org> References: <20240606131659.786180261@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Kuppuswamy Sathyanarayanan [ Upstream commit e2e78a294a8a863898b781dbcf90e087eda3155d ] The "Downstream Port Containment related Enhancements" ECN of Jan 28, 2019 (document 12888 below), defined the EDR_PORT_LOCATE_DSM function with Revision ID 5 with a return value encoding (Bits 2:0 = Function, Bits 7:3 = Device, Bits 15:8 = Bus). When the ECN was integrated into PCI Firmware r3.3, sec 4.6.13, Bit 31 was added to indicate success or failure. Check Bit 31 for failure in acpi_dpc_port_get(). Link: https://lore.kernel.org/r/20240501022543.1626025-1-sathyanarayanan.kuppuswamy@linux.intel.com Link: https://members.pcisig.com/wg/PCI-SIG/document/12888 Fixes: ac1c8e35a326 ("PCI/DPC: Add Error Disconnect Recover (EDR) support") Signed-off-by: Kuppuswamy Sathyanarayanan [bhelgaas: split into two patches, update commit log] Signed-off-by: Bjorn Helgaas Tested-by: Satish Thatchanamurthy # one platform Signed-off-by: Sasha Levin --- drivers/pci/pcie/edr.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/pci/pcie/edr.c b/drivers/pci/pcie/edr.c index 5b5a502363c00..35210007602c5 100644 --- a/drivers/pci/pcie/edr.c +++ b/drivers/pci/pcie/edr.c @@ -80,8 +80,9 @@ static struct pci_dev *acpi_dpc_port_get(struct pci_dev *pdev) u16 port; /* - * Behavior when calling unsupported _DSM functions is undefined, - * so check whether EDR_PORT_DPC_ENABLE_DSM is supported. + * If EDR_PORT_LOCATE_DSM is not implemented under the target of + * EDR, the target is the port that experienced the containment + * event (PCI Firmware r3.3, sec 4.6.13). */ if (!acpi_check_dsm(adev->handle, &pci_acpi_dsm_guid, 5, 1ULL << EDR_PORT_LOCATE_DSM)) @@ -98,6 +99,16 @@ static struct pci_dev *acpi_dpc_port_get(struct pci_dev *pdev) return NULL; } + /* + * Bit 31 represents the success/failure of the operation. If bit + * 31 is set, the operation failed. + */ + if (obj->integer.value & BIT(31)) { + ACPI_FREE(obj); + pci_err(pdev, "Locate Port _DSM failed\n"); + return NULL; + } + /* * Firmware returns DPC port BDF details in following format: * 15:8 = bus -- 2.43.0