Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp17320rdb; Wed, 21 Feb 2024 15:25:40 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWAObPK61J3K9KpaR5ScVGFys0mpx+vi8xj00UZi7oT2RSZfFb2HYqm5P4MkmvXph1V4rrvz13Wc1e2b9AnJXXEg5H4Qz8cMjfUqcYdiA== X-Google-Smtp-Source: AGHT+IEEO0jI8vi9rPRkTCJIS4Sen6Ta4ZQFXtLOAPtJU+8oM1AnQMBaj6erUgRFZ0Nh23jXiDRl X-Received: by 2002:a17:906:af0f:b0:a3e:c94b:a06d with SMTP id lx15-20020a170906af0f00b00a3ec94ba06dmr5764499ejb.57.1708557940141; Wed, 21 Feb 2024 15:25:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708557940; cv=pass; d=google.com; s=arc-20160816; b=tm2coeFVdvVevLpDumlax1HgIcMd7eDe41IdjXKWJiqC+3FkHH5VOf1aF3dwKWn/rN 4AC3kRvJLDkzcEkUiPvwi/2NxH5DWpp0ms//YBRS56fu4rZx6S4bSB92/t0DSOClMyiY mf4zs30scNsiSx3VeIopBwmi+L4GcKSiw8mJkNua8NLwJGVq8n/ZIF9arcBAJEMv1jhu BuDIvjjVc+xKdS3TW4CrP+wmXuTDEmXm3icO5pWbx40tWUwk248bikY0z8Y9TraOFllh StGsY1oQL13TRbiZoUTHiApfvT1sNbscI0moy/9bQm54KCAdIKuOC1jPZhD+723YbkyS q5hQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:subject:cc:to:from:date:dkim-signature; bh=Wrn4PPhK+d9JCAOM6v79zVaXGYQ3t9IK7KGh+StJejc=; fh=sikZ6spBLqTSpalvm3ubBfevJNfYq/DDGJuTuyVmcr4=; b=RpY+4Qu1Ww+oYLKHHRNLtsqjIlJEc+Wg0eDCG8MswpsmtCt2bCsFClmZL6cNjGAJP0 bJpOqMr/k0JKoV+BzJos6jjZc8b/DE69S7OIHiTCBpAjYj9kJY1utYAnMpZLx6/QTT1k ObwjC6d7X74dCK1/aTAEijmzngGuUcwTw2mixieipsokkt617JliX4gfy/ZgqE/mX0kd J7VOITkFnoZIazc/Z9qx7pa4Fzb/FRY7hmLLcVK3p6LYVBxJWcIl07qQhi1vHwW0d0yB R4jG8eXepOPW5zAq0nadGZqvIRXv7r1TRCsYvH1b62ygrfS7Kg2mT4CSLijvoglYJtbL MrFg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=enu4yqBB; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-75652-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75652-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id hk15-20020a170906c9cf00b00a3f5df34c45si510455ejb.128.2024.02.21.15.25.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 15:25:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-75652-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=enu4yqBB; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-75652-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75652-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 917881F235D5 for ; Wed, 21 Feb 2024 23:25:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D8DBE129A6C; Wed, 21 Feb 2024 23:25:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="enu4yqBB" 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 027D1A35; Wed, 21 Feb 2024 23:25:27 +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=1708557928; cv=none; b=Y3oV3WjpQPKnmsmYsPqxLTI7KHTD5s31fY5epGOBSmqG4pZZUxhVnsGOmX1bp3QQoX8qwF9TbUl50x9W8BRQby9PM0hH+u9J6bM0ebEPE3tf7ac7YmN74ZfH24YyUolfCPmOFUP25g9EfJPxLvoXeQxe9LTgaM/7CNxy2DEbVpE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708557928; c=relaxed/simple; bh=cm0rXHuYpdUHHEiy4MG/nHpcI2fGOqCABwVVztVbBUA=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=D2WAWxpVXmcxP22dPL/aLsIyuaXwJARdbPoW+JxYktpv0wK3N4qHzqs5zdfJmeCtBOV5+JVktqPXYZ9cLRCFjs+6/TlWik0VoXL2y7F5LN5lkT5HpgvlEquujDkfBZ1ydP9EsYUm2qX5sTRXrQbr11LDvUvYQcqw9ugKkYYNZgo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=enu4yqBB; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E6CEC433C7; Wed, 21 Feb 2024 23:25:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708557927; bh=cm0rXHuYpdUHHEiy4MG/nHpcI2fGOqCABwVVztVbBUA=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=enu4yqBBb/AYies9CfHBzeZEXCn6XnamsV5WkPgFOTTIcWY47IDWEmHA8bHBhcYew AJpLO1EARhcu+Quv0pwf5hx78d5KRcIQD7N6x5wbqxxdFc7Nnn7l19gcU1M+JULo55 iv9mNLg4BvCXr+7DgAbh0nWL4BDkc8ciRNSbnMR0LfnS7t9DUEBuOCwMSb/LbMC8cv ZTN1wWwCMQ/UXAeQ+6G44z2C4KiWKmwQLEoCVCxDULQ7fpDVed9ad6dQbGJrwtEJG+ aAqYIFKnHd2UytSpCUCINY1bmW5Sck71AX2iu3FeA8DxyD0ru7Jh8/8l4U6YOJpqh8 DdZhkeWuFIvSw== Date: Wed, 21 Feb 2024 17:25:23 -0600 From: Bjorn Helgaas To: Kuppuswamy Sathyanarayanan Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Helgaas , stable@vger.kernel.org, Matthew W Carlis , Keith Busch , Lukas Wunner , Mika Westerberg , Jesse Brandeburg Subject: Re: [PATCH] PCI/DPC: Request DPC only if also requesting AER Message-ID: <20240221232523.GA1533169@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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <39ef1387-609c-45ca-9bfa-e01b72cacaaa@linux.intel.com> On Tue, Feb 20, 2024 at 06:45:32PM -0800, Kuppuswamy Sathyanarayanan wrote: > On 2/20/24 3:55 PM, Bjorn Helgaas wrote: > > From: Bjorn Helgaas > > > > When booting with "pci=noaer", we don't request control of AER, but we > > previously *did* request control of DPC, as in the dmesg log attached at > > the bugzilla below: > > > > Command line: ... pci=noaer > > acpi PNP0A08:00: _OSC: OS supports [ExtendedConfig ASPM ClockPM Segments MSI EDR HPX-Type3] > > acpi PNP0A08:00: _OSC: OS now controls [PCIeHotplug SHPCHotplug PME PCIeCapability LTR DPC] > > > > That's illegal per PCI Firmware Spec, r3.3, sec 4.5.1, table 4-5, which > > says: > > > > If the operating system sets this bit [OSC_PCI_EXPRESS_DPC_CONTROL], it > > must also set bit 7 of the Support field (indicating support for Error > > Disconnect Recover notifications) and bits 3 and 4 of the Control field > > (requesting control of PCI Express Advanced Error Reporting and the PCI > > Express Capability Structure). > > > > Request DPC control only if we have also requested AER control. > > Can you also add similar check in calculate_support call? > >         if (pci_aer_available() && IS_ENABLED(CONFIG_PCIE_EDR)) >                 support |= OSC_PCI_EDR_SUPPORT; That doesn't seem right to me. The implementation note in sec 4.6.12 suggests that EDR Notifications may be used even when the firmware maintains control of AER and DPC. Maybe that note is wrong or misleading, but as written, I interpret that as meaning that it may be useful for the platform to know that the OS supports EDR even if it AER control isn't requested or granted. > > Fixes: ac1c8e35a326 ("PCI/DPC: Add Error Disconnect Recover (EDR) support") > > Link: https://bugzilla.kernel.org/show_bug.cgi?id=218491#c12 > > Signed-off-by: Bjorn Helgaas > > Cc: # v5.7+ > > Cc: Kuppuswamy Sathyanarayanan > > Cc: Matthew W Carlis > > Cc: Keith Busch > > Cc: Lukas Wunner > > Cc: Mika Westerberg > > Cc: Jesse Brandeburg > > --- > > drivers/acpi/pci_root.c | 20 +++++++++++--------- > > 1 file changed, 11 insertions(+), 9 deletions(-) > > > > diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c > > index 58b89b8d950e..1c16965427b3 100644 > > --- a/drivers/acpi/pci_root.c > > +++ b/drivers/acpi/pci_root.c > > @@ -518,17 +518,19 @@ static u32 calculate_control(void) > > if (IS_ENABLED(CONFIG_HOTPLUG_PCI_SHPC)) > > control |= OSC_PCI_SHPC_NATIVE_HP_CONTROL; > > > > - if (pci_aer_available()) > > + if (pci_aer_available()) { > > control |= OSC_PCI_EXPRESS_AER_CONTROL; > > > > - /* > > - * Per the Downstream Port Containment Related Enhancements ECN to > > - * the PCI Firmware Spec, r3.2, sec 4.5.1, table 4-5, > > - * OSC_PCI_EXPRESS_DPC_CONTROL indicates the OS supports both DPC > > - * and EDR. > > - */ > > - if (IS_ENABLED(CONFIG_PCIE_DPC) && IS_ENABLED(CONFIG_PCIE_EDR)) > > - control |= OSC_PCI_EXPRESS_DPC_CONTROL; > > + /* > > + * Per PCI Firmware Spec, r3.3, sec 4.5.1, table 4-5, the > > + * OS can request DPC control only if it has advertised > > + * OSC_PCI_EDR_SUPPORT and requested both > > + * OSC_PCI_EXPRESS_CAPABILITY_CONTROL and > > I think you mean OSC_PCI_EXPRESS_DPC_CONTROL. No, I just tried to rephrase the text for _OSC Control, bit 7 (quoted in the commit log), so I think requesting control of bits 3 and 4 (AER and PCIe Capability) is right. > > + * OSC_PCI_EXPRESS_AER_CONTROL. > > + */ > > + if (IS_ENABLED(CONFIG_PCIE_DPC) && IS_ENABLED(CONFIG_PCIE_EDR)) > > + control |= OSC_PCI_EXPRESS_DPC_CONTROL; > > Since you are cleaning up this part, why not add a patch to remove > CONFIG_PCIE_EDR? Good idea, I'll do that, too. Bjorn