Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp737113lqo; Wed, 8 May 2024 13:16:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW9/NFCBM5d59QstZBvjdU1mc+nUr0nP1uY6BVaAA42caDmUF0kbEJcbvIfOAbCNEdJGAK80+JiMrXtNx3Xx2t9aekYvdLxVu2JHIjksg== X-Google-Smtp-Source: AGHT+IFnZ8jy2Si7xCYOTAUsTP5KddbJra7H/NjhmDEkdv8Z3xWJZThmn5O6bd/ZGcvAKnKQi0Ri X-Received: by 2002:a05:6a20:a11b:b0:1af:a4f7:cba1 with SMTP id adf61e73a8af0-1afc8d5e22amr4270267637.31.1715199364012; Wed, 08 May 2024 13:16:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715199364; cv=pass; d=google.com; s=arc-20160816; b=LULhcBatk7WEVgWnqzvmDvwsQZvAxz+7np/HYpNS/J86tXnKk2vvSX+QU+U5Jf03dY oNOX7xOx8RGPMmp+nRhiWi/xAQHOIJAkaWAywmpzg5bCjHiP2QJBE8P5LngjCnhBdRFA Tj7F/tpvHlHU0NTpkLcZAdDrY5j6uqiI0oBG2qs9zypckVVDOR/vCPh7QSNyWB8FgNUT ghJf4Q0O70arsoyx9MZfMxYN7eS8HBVn+HVbVkCKcrnE+NIR6AQL6RrO7ys1ft2GE/TX YOiR8ucU+JgsCrObi5ONMGxfH2lXqhklRAsfAXVX/c9YmZ0Oi/AFfV/H2QuI2Hv1QFMO xeLQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:subject:cc:to:from :date:dkim-signature; bh=bqEBJeYUEdbPbAtfOYPaoICj0Kxi3UUcu+sG8in/npo=; fh=x0iZuDwAPw+cLzixgs8XasWevl++OqdK7NbCA1Ix11A=; b=Nvqx8c3lt6yHqczD+uZ0e2N2wNTwKrJ3Tq8jrPFyELbKiOWosYrbuUW+fldql4HoQm QBLL9wkC5xkBJ9gmCwq8++9Jy7tQMf47h5MANc5M5r1FM6yCUXSDovg5pfuRBxIuSw9w xDYv/dKHSwZhXnm2jGqkj7fD9HCmimO5hpj/QwA1kEvPBjVAVY7s/VB40Vi02Rvrpt5d UccXFREg9BZtWW2Yb64f02azyw4fT/hKkF2qZCUIqRk9Na+5qxJ+aM2ahM3IwJ1llxhA 5HCPJZtO/OGOFtf9fP7QVLQSMALSUp/ZOL71Q1PkBAZNZVWlmWmKUvngifsdHNSIFt5B 5HYg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FlVzvJsU; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-173791-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-173791-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id n24-20020a63f818000000b005dc8372020esi719564pgh.580.2024.05.08.13.16.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 13:16:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-173791-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FlVzvJsU; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-173791-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-173791-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id E9DDEB22170 for ; Wed, 8 May 2024 20:14:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 93A4F130E47; Wed, 8 May 2024 20:14:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FlVzvJsU" 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 9EAB412BF23; Wed, 8 May 2024 20:14:32 +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=1715199273; cv=none; b=NR0LI2zlaXZv3soC6vAn360pP/Gwm2VydNIqxIQ3bqS9qar2i/QlYjKB4lzWHEcKjSVASPG3glB2HjX4bzYjmUe8cpjzLpKgwwh7jBHImMREaKi2V8jLN6Y324p2iU9tR9K/6Yc1jU+LRGke1Psx4+XPjnuqzvHbZv2EY4W6rA4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715199273; c=relaxed/simple; bh=cSANn1r02z11GW7siTDbWe0wORQUwoGGbSwqIt0FLcI=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=KwwWzE8+Pi+0tt59wcLxnRcWZh7vE8Ek5GOryShYZ2+kVuzuLqty9au5pUvIvdLT8Spe+CtwNGxoa33SsyVtz5XHO/UYam/8Edta8BhzZgHitwQCYTTuqlaQItlFYoxtpQAh+Tp4Ts9EcvixHX92/VmYRdeM9rbJb/SuEN9dpPw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FlVzvJsU; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id F00BEC32782; Wed, 8 May 2024 20:14:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715199272; bh=cSANn1r02z11GW7siTDbWe0wORQUwoGGbSwqIt0FLcI=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=FlVzvJsUILIQP0KBq+N5hgAJgaHSXEMjXDcyqpJy1EieK7aG4r4vxhyX+8s9lTAYe +kDKa0nFoVnCntiwWxP6gMq9KBuVU0yL8HYWytPYOeezCtn4LvInsgL65QIPKi82bH prq0oq6yOmrHQAPxBi9Hr/524Ro4hZVTVTnsB+ZRtYHlbeBtJ7HQPby697zmNUoL+X HA8bKH8Xg6cVKjGU9FbPJKH8DDnNgvT6l2oruCaKoBjidQkIhYveJuEt11ZT0OVOgE plvu/3bhbWj2hxv7fEYMcegNkHa77rPSIbIDh8YUBlAZ4a325ItEDJ4VMJmvbw8Z0m SVUXjjo0hJD0Q== Date: Wed, 8 May 2024 15:14:30 -0500 From: Bjorn Helgaas To: Kuppuswamy Sathyanarayanan Cc: Bjorn Helgaas , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Thatchanamurthy Satish Subject: Re: [PATCH v1] PCI/EDR: Align EDR implementation with PCI firmware r3.3 spec Message-ID: <20240508201430.GA1785648@bhelgaas> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240501022543.1626025-1-sathyanarayanan.kuppuswamy@linux.intel.com> On Wed, May 01, 2024 at 02:25:43AM +0000, Kuppuswamy Sathyanarayanan wrote: > During the Error Disconnect Recover (EDR) spec transition from r3.2 ECN > to PCI firmware spec r3.3, improvements were made to definitions of > EDR_PORT_DPC_ENABLE_DSM (0x0C) and EDR_PORT_LOCATE_DSM(0x0D) _DSMs. > > Specifically, > > * EDR_PORT_DPC_ENABLE_DSM _DSM version changed from 5 to 6, and > arg4 is now a package type instead of an integer in version 5. > * EDR_PORT_LOCATE_DSM _DSM uses BIT(31) to return the status of the > operation. > > Ensure _DSM implementation aligns with PCI firmware r3.3 spec > recommendation. More details about the EDR_PORT_DPC_ENABLE_DSM and > EDR_PORT_LOCATE_DSM _DSMs can be found in PCI firmware specification, > r3.3, sec 4.6.12 and sec 4.6.13. > > While at it, fix a typo in EDR_PORT_LOCATE_DSM comments. > > Fixes: ac1c8e35a326 ("PCI/DPC: Add Error Disconnect Recover (EDR) support") > Signed-off-by: Kuppuswamy Sathyanarayanan I split this into two patches and applied them to pci/edr for v6.10, thanks! Take a look here: https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git/log/?h=edr and make sure I didn't mess it up (only differences are comments and commit logs). > --- > drivers/pci/pcie/edr.c | 23 +++++++++++++++++------ > 1 file changed, 17 insertions(+), 6 deletions(-) > > diff --git a/drivers/pci/pcie/edr.c b/drivers/pci/pcie/edr.c > index 5f4914d313a1..fea098e22e3e 100644 > --- a/drivers/pci/pcie/edr.c > +++ b/drivers/pci/pcie/edr.c > @@ -35,7 +35,7 @@ static int acpi_enable_dpc(struct pci_dev *pdev) > * Behavior when calling unsupported _DSM functions is undefined, > * so check whether EDR_PORT_DPC_ENABLE_DSM is supported. > */ > - if (!acpi_check_dsm(adev->handle, &pci_acpi_dsm_guid, 5, > + if (!acpi_check_dsm(adev->handle, &pci_acpi_dsm_guid, 6, > 1ULL << EDR_PORT_DPC_ENABLE_DSM)) > return 0; > > @@ -47,11 +47,11 @@ static int acpi_enable_dpc(struct pci_dev *pdev) > argv4.package.elements = &req; > > /* > - * Per Downstream Port Containment Related Enhancements ECN to PCI > - * Firmware Specification r3.2, sec 4.6.12, EDR_PORT_DPC_ENABLE_DSM is > - * optional. Return success if it's not implemented. > + * Per PCI Firmware Specification r3.3, sec 4.6.12, > + * EDR_PORT_DPC_ENABLE_DSM is optional. Return success if it's not > + * implemented. > */ > - obj = acpi_evaluate_dsm(adev->handle, &pci_acpi_dsm_guid, 5, > + obj = acpi_evaluate_dsm(adev->handle, &pci_acpi_dsm_guid, 6, > EDR_PORT_DPC_ENABLE_DSM, &argv4); > if (!obj) > return 0; > @@ -86,7 +86,7 @@ static struct pci_dev *acpi_dpc_port_get(struct pci_dev *pdev) > > /* > * Behavior when calling unsupported _DSM functions is undefined, > - * so check whether EDR_PORT_DPC_ENABLE_DSM is supported. > + * so check whether EDR_PORT_LOCATE_DSM is supported. > */ > if (!acpi_check_dsm(adev->handle, &pci_acpi_dsm_guid, 5, > 1ULL << EDR_PORT_LOCATE_DSM)) > @@ -103,6 +103,17 @@ static struct pci_dev *acpi_dpc_port_get(struct pci_dev *pdev) > return NULL; > } > > + /* > + * Per PCI Firmware Specification r3.3, sec 4.6.13, bit 31 represents > + * the success/failure of the operation. If bit 31 is set, the operation > + * is 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.25.1 >