From patchwork Thu Feb 22 22:15:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 205084 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp245278dyb; Thu, 22 Feb 2024 14:16:08 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWkWKfsI/57aMDMOBSIZFOwRfDRvNCHBz0M21sej6SmEGOUyCBrvygs1LJDKE1MqCA+zQDuzm1P80Amtb24F6POKqYllQ== X-Google-Smtp-Source: AGHT+IHJ0dxxmmlzHEU3VkbRGcbAKxrJGn+nz7GhTq0LrsMtApeTuGLr1VfFMCkUCZdBPeg+vU9/ X-Received: by 2002:a05:6214:5f03:b0:68f:b5b0:6202 with SMTP id lx3-20020a0562145f0300b0068fb5b06202mr7825535qvb.15.1708640168237; Thu, 22 Feb 2024 14:16:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708640168; cv=pass; d=google.com; s=arc-20160816; b=ME6Qhlhyk5hiAO6kirKG6NXBOkerFOtUZr52sEAO7H8dWCYHE9VMxWNTBAP+1ZTIjm 3kCcEBIbLIkWMsIaxSRy75d3EGt52D2yc3UsOXndYZAO/29sxsymx382/6m1PRwIpjJD Ah35l4PeeFwOyqE5xzPx24b6zS0ITSR9vTIKQN7pBMg2QNFcKRfAPg20wJyq7pw9e3lE T0+CGRVNgCIwk+nrJSVCnnlI4VXPoC1JeqRiKWV4Uegz8n9dVzMdJbxdUxf2DSCU6yiM 2ZmtTt2GVqw+G7cmOwSe8oy3CYyYRVyDS9p5Z7qSFyoJvdVHJOrAo4B9guHGEIJUV9ER RkBA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=LhsiVH8WqSjkpg/lUmLLueFWsptWJWI+5zk2RxO7400=; fh=VqNV/H+NvTfRorL5u0gvqiaeUJYxz4RZ1JFzqqWkBPk=; b=w82PJcoQM4Vy2/buQDV432hIRb6z5QNVcz3FQ9VXgQv1CAOzW0f/wi8ZgNuAFaQGzY k2UMfLxbVGfH/veDkMNMI53ivFZEp2sQzBl8I9I12Rq3mGdW4Co7FKU8+nzw0RPXTry8 qpFjYsrrLpxa0/EhViyRS8ViNuPdxZEFjfg9rVrzb8nDZqzQ65i26J4t4FXLFv04kHS/ dOK73yZSgpjyy8Jllz4ZvbYeDy2IMOWUiX6P+TVo5RDSqIlJEPL64lGfKWMndQGvyanW bfnQY8Yl0cRmSW27joh5gr63K9bmhyda31BnknZZNICeVtQizeu9W03h68pOsTfLOsQM xHUA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BO0vpnTK; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-77457-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77457-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id m12-20020a0562141bcc00b0068f305eed02si13767525qvc.67.2024.02.22.14.16.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 14:16:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77457-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BO0vpnTK; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-77457-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77457-ouuuleilei=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 0D26D1C21D17 for ; Thu, 22 Feb 2024 22:16:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8068813BACE; Thu, 22 Feb 2024 22:15:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="BO0vpnTK" 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 E6BEC137919; Thu, 22 Feb 2024 22:15:36 +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=1708640137; cv=none; b=T5w/R/Z0xd5fPfUrbj2ouwz/me18GYbO7QZevjCylOqrbzsFMEmZdi5EFuDx7AimlfsU/2CeNebDFRwoGk4HH3vU/IDs20U9iqhX5/O8F/S3EAqA8mevXUzTrkhcKPO300zi6flIE8FWucYRdkAd3AkL1kWnmxzv/mu1m7Xdfok= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708640137; c=relaxed/simple; bh=+MPNAv4j9xziDIGU7n8YhnwXjcPBGJ3afHmStckr/LM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jeHsm1bR0zfrZTkipX1aIhYAAVgpFHY5pVqGv0LXXnpUQVZnYxZzbTw28dBvb4FVu7ywGH1ThcFvQxf+czIc/mBtVVhVoCTht3bCI3g5vuHGV2nhlKnrJ7DiHdWbw61qay42in6wNxMHqfjtgBlbEZbpDAkcLF1y+tuZAkvyt8s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BO0vpnTK; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F2F7C433F1; Thu, 22 Feb 2024 22:15:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708640136; bh=+MPNAv4j9xziDIGU7n8YhnwXjcPBGJ3afHmStckr/LM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BO0vpnTKrzJhRRACJU7/OJ5jHMKV5z75nlY+Rah3m83VgXiuVB9mkpOwxSFkvnS8o PRSKfTHqDsRTtVNMEtwz+H21sqTRKJxb/D9k4yyomoZbpJhezoGQFy0BE6Z3u5ZYXS wfkhlijVmz/HWdizhD3TJ11pdllQFvUwQl51bQUsPpC41tc813FwFp0/DXO1/F3Mce db/MJ+Rf1NqC8Mz7wcywry7tr3JMy5Ymc1Xe0kKEcOb4K+z/yg8o0KEpM6FYf8ecN0 wVQqPB8//tlLyzj/9x86EKYSOZBx1/LHfgnpjsNx3kyFgPSmp4L0nN6njos+xnHLtz S6qL/NTMWlNuw== From: Bjorn Helgaas To: linux-pci@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Kuppuswamy Sathyanarayanan , Matthew W Carlis , Keith Busch , Lukas Wunner , Mika Westerberg , Jesse Brandeburg , Bjorn Helgaas , stable@vger.kernel.org Subject: [PATCH v2 1/3] PCI/DPC: Request DPC only if also requesting AER Date: Thu, 22 Feb 2024 16:15:19 -0600 Message-Id: <20240222221521.32159-2-helgaas@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240222221521.32159-1-helgaas@kernel.org> References: <20240222221521.32159-1-helgaas@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791639073206311917 X-GMAIL-MSGID: 1791639073206311917 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. 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 Reviewed-by: Kuppuswamy Sathyanarayanan --- 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..efc292b6214e 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 + * OSC_PCI_EXPRESS_AER_CONTROL. + */ + if (IS_ENABLED(CONFIG_PCIE_DPC)) + control |= OSC_PCI_EXPRESS_DPC_CONTROL; + } return control; } From patchwork Thu Feb 22 22:15:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 205086 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp247313dyb; Thu, 22 Feb 2024 14:17:46 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWP/fXRjJFCk+MiUdA5+/YFct8Sj8rV9azTfJbx6ofSEpFyyM4DJRNqgQDo4C+Otd9rMbkaUu+wYKgOeW80Rr+SptN59A== X-Google-Smtp-Source: AGHT+IFnwjfSEOhqQtPraS2haIPEg9pCKkQWqLN2vABNgCpH6Bp2bbNNfmcxfQR2gd4hgVCTwD00 X-Received: by 2002:a05:6870:2008:b0:21e:b695:dff5 with SMTP id o8-20020a056870200800b0021eb695dff5mr293370oab.20.1708640266362; Thu, 22 Feb 2024 14:17:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708640266; cv=pass; d=google.com; s=arc-20160816; b=UwJHRXnWghqkwPPH4HfeiBJNqsAkyAKpa4re468j8e36NxsiLEW2PYRwHXv4Mw+/K6 rcUllErN3z2GTER3DJlkp7tt5vs7QrXafwr6xaBnJUDQUBJsx9RZcqsz58jICrAKXMJV oWt+Hp0oiqf2MTnLwI2VO5OmV1WuiTIEON3TmfM+3shI2Rqth4WbhB+mko1fO5YVs+vU GYTb4FZndVnQk1VJIsGZsNzyjPipoOk+nAOv0Bzd2RjKlWozzMnndPkqS/wqCAVF0vkg ZfD+nbmAAUNJ9PD0sVwB0rN5oZTWxs44mFg63d+XynLNRWmRFlrkyJVwX7rR4sHwHePs uPbw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=e2xU6PzrwoQRwdE2wy74QfhFcS/N9IB5sg/VjsBXPZc=; fh=DQlX4VOMXAZHEB/OHnjBToSsYwvB2UyOs7+/HRg3P7c=; b=k9SFfhDD4Gbxi6iA3l8G6jEXk8ZIGP0Xv+aVBOTlugJf9v1wSACD9IWGsl2XbU+fz9 9O7NNiHvjqsxprmCXaEDBoVl4K9iWyayVOx6ROHnwMY3qEmuO77IO2cdrPObqM+7BBuI 29Adxz68WDT0yh6yuJCo+9Y7pBJrQVZwDclR4+IcwoStbdaI1Ko/bJTHt9rI0qC7MW/o q1qkBf2T9r/dlUWeGt45hN8+4N24HUdzw0+4Ev0yH045JleOgzvNeMFk2DesrbtdBLEl rhq/+uOGv3CW5FhT6ti0Zcr+5Vg8JYvAlUp6CAs8H95a824YKPA+bXl1sxgmEX6Cjkct mUtA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=l8fcGj40; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-77458-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77458-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id u71-20020a63794a000000b005cfbea76cf8si10970128pgc.42.2024.02.22.14.17.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 14:17:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77458-ouuuleilei=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=l8fcGj40; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-77458-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77458-ouuuleilei=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 15E66B24982 for ; Thu, 22 Feb 2024 22:16:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9EB8213BAEA; Thu, 22 Feb 2024 22:15:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="l8fcGj40" 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 D95F113793B; Thu, 22 Feb 2024 22:15:38 +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=1708640138; cv=none; b=J9F6L94Bvl9tLu61ZRBGAe57cYvHZX9ZQE9RWhPunMxlioZMSsbe016UzQqR0SO6lyvNFIXmMey+k/MtAx0K/w5xfeG8Xye6lgf3JhqVqg2x4g3/4g1SEjegr0OLW2YziisWY/bKm+fGm3/JZ06HEtP8bFkg423KYCF/xuOs4ag= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708640138; c=relaxed/simple; bh=bARB3bwPnJD/Pqaol3M2Is4aqKt219+07FwF7t0zqkE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=HLwTJVMfEbDpCKX3PyMgTYKdUEtzssmCj48l++eq0nopl7vn2DTOHhwHYD9G7rDm7EzLqgSL/1PmWyKiVs2ENFPCGJXpLIhwj1KM5jJbaxE56vTRmJeTXG6LXwawdNtWFbWf+dBL7Wi6MZtitcSlpmP7vVBlkOG0ymcJBgRgb/c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=l8fcGj40; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26217C433B1; Thu, 22 Feb 2024 22:15:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708640138; bh=bARB3bwPnJD/Pqaol3M2Is4aqKt219+07FwF7t0zqkE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l8fcGj40frsSckf5Xo0GsLs4xGBMv+oFspZxlghnHZh1eM6b3P9yqYcMPyV2+wCTN 0gGRxN78h0ZzR5Ev55k+KMIVH7A/BikbbbMQDwoN8kinCgdqjaFJeWLI224VB/eH4l mfnAflIuRg/faX1BCQBr1JphCOToVPbWN7recDGBkGMEtaDPHM6jaDSJRHIRa6KSVa tX8LxxAUgc5xX1IiuxazxF0dG2OWePOlinRbYDAKm6iw4V3vWTFncT9pRmOsSaBgLN 8TS83udzgl9caj08MlLeRDxez97KInXaAyKvcEg2FhJKELcj/xEo+52tR5pknKf3/z NO4M7Wuscbz9g== From: Bjorn Helgaas To: linux-pci@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Kuppuswamy Sathyanarayanan , Matthew W Carlis , Keith Busch , Lukas Wunner , Mika Westerberg , Jesse Brandeburg , Bjorn Helgaas Subject: [PATCH v2 2/3] PCI/DPC: Remove CONFIG_PCIE_EDR Date: Thu, 22 Feb 2024 16:15:20 -0600 Message-Id: <20240222221521.32159-3-helgaas@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240222221521.32159-1-helgaas@kernel.org> References: <20240222221521.32159-1-helgaas@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791639175951626880 X-GMAIL-MSGID: 1791639175951626880 From: Bjorn Helgaas Previous Kconfig allowed the possibility of enabling CONFIG_PCIE_DPC without CONFIG_PCIE_EDR. The PCI Firmware Spec, r3.3, sec 4.5.1, table 4-5, says an ACPI OS that requests control of DPC must also advertise support for EDR. Remove CONFIG_PCIE_EDR and enable the EDR code with CONFIG_PCIE_DPC so that enabling DPC also enables EDR for ACPI systems. Since EDR is an ACPI feature, build edr.o only when CONFIG_ACPI is enabled. Stubs cover the case when DPC is enabled without ACPI. Signed-off-by: Bjorn Helgaas --- drivers/acpi/pci_root.c | 2 +- drivers/pci/pcie/Kconfig | 14 ++++---------- drivers/pci/pcie/Makefile | 5 ++++- drivers/pci/pcie/dpc.c | 10 ---------- include/linux/pci-acpi.h | 4 ++-- 5 files changed, 11 insertions(+), 24 deletions(-) diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index efc292b6214e..bcaf3d3a5e05 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c @@ -448,7 +448,7 @@ static u32 calculate_support(void) support |= OSC_PCI_ASPM_SUPPORT | OSC_PCI_CLOCK_PM_SUPPORT; if (pci_msi_enabled()) support |= OSC_PCI_MSI_SUPPORT; - if (IS_ENABLED(CONFIG_PCIE_EDR)) + if (IS_ENABLED(CONFIG_PCIE_DPC)) /* DPC => EDR support */ support |= OSC_PCI_EDR_SUPPORT; return support; diff --git a/drivers/pci/pcie/Kconfig b/drivers/pci/pcie/Kconfig index 8999fcebde6a..21e98289fbe9 100644 --- a/drivers/pci/pcie/Kconfig +++ b/drivers/pci/pcie/Kconfig @@ -137,6 +137,10 @@ config PCIE_DPC have this capability or you do not want to use this feature, it is safe to answer N. + On ACPI systems, this includes Error Disconnect Recover support, + the hybrid model that uses both firmware and OS to implement DPC, + as specified in the PCI Firmware Specification r3.3. + config PCIE_PTM bool "PCI Express Precision Time Measurement support" help @@ -145,13 +149,3 @@ config PCIE_PTM This is only useful if you have devices that support PTM, but it is safe to enable even if you don't. - -config PCIE_EDR - bool "PCI Express Error Disconnect Recover support" - depends on PCIE_DPC && ACPI - help - This option adds Error Disconnect Recover support as specified - in the Downstream Port Containment Related Enhancements ECN to - the PCI Firmware Specification r3.2. Enable this if you want to - support hybrid DPC model which uses both firmware and OS to - implement DPC. diff --git a/drivers/pci/pcie/Makefile b/drivers/pci/pcie/Makefile index 8de4ed5f98f1..72657f780c33 100644 --- a/drivers/pci/pcie/Makefile +++ b/drivers/pci/pcie/Makefile @@ -12,4 +12,7 @@ obj-$(CONFIG_PCIEAER_INJECT) += aer_inject.o obj-$(CONFIG_PCIE_PME) += pme.o obj-$(CONFIG_PCIE_DPC) += dpc.o obj-$(CONFIG_PCIE_PTM) += ptm.o -obj-$(CONFIG_PCIE_EDR) += edr.o + +ifdef CONFIG_ACPI +obj-$(CONFIG_PCIE_DPC) += edr.o +endif diff --git a/drivers/pci/pcie/dpc.c b/drivers/pci/pcie/dpc.c index 94111e438241..0aa79581250b 100644 --- a/drivers/pci/pcie/dpc.c +++ b/drivers/pci/pcie/dpc.c @@ -102,19 +102,9 @@ static bool dpc_completed(struct pci_dev *pdev) */ bool pci_dpc_recovered(struct pci_dev *pdev) { - struct pci_host_bridge *host; - if (!pdev->dpc_cap) return false; - /* - * Synchronization between hotplug and DPC is not supported - * if DPC is owned by firmware and EDR is not enabled. - */ - host = pci_find_host_bridge(pdev->bus); - if (!host->native_dpc && !IS_ENABLED(CONFIG_PCIE_EDR)) - return false; - /* * Need a timeout in case DPC never completes due to failure of * dpc_wait_rp_inactive(). The spec doesn't mandate a time limit, diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h index 078225b514d4..92e196ba0249 100644 --- a/include/linux/pci-acpi.h +++ b/include/linux/pci-acpi.h @@ -122,13 +122,13 @@ extern const guid_t pci_acpi_dsm_guid; #define DSM_PCI_POWER_ON_RESET_DELAY 0x08 #define DSM_PCI_DEVICE_READINESS_DURATIONS 0x09 -#ifdef CONFIG_PCIE_EDR +#ifdef CONFIG_PCIE_DPC void pci_acpi_add_edr_notifier(struct pci_dev *pdev); void pci_acpi_remove_edr_notifier(struct pci_dev *pdev); #else static inline void pci_acpi_add_edr_notifier(struct pci_dev *pdev) { } static inline void pci_acpi_remove_edr_notifier(struct pci_dev *pdev) { } -#endif /* CONFIG_PCIE_EDR */ +#endif /* CONFIG_PCIE_DPC */ int pci_acpi_set_companion_lookup_hook(struct acpi_device *(*func)(struct pci_dev *)); void pci_acpi_clear_companion_lookup_hook(void); From patchwork Thu Feb 22 22:15:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 205085 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp245810dyb; Thu, 22 Feb 2024 14:16:33 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXV/noh+3mzdCt1bDiuZODyJEF5FZMKxR053ebv1jFuP27AhKMYHONJrmP0/UDEvQP+2EnJqjqkgH4TuZyhlAgv9I4MFQ== X-Google-Smtp-Source: AGHT+IEzR2bCLthoSJmlMcHQH5Ii21oXgXzBB23h27bJ7SGzPCVv3toUBdHtgPfWOycvZXluOQ/6 X-Received: by 2002:a05:6830:111:b0:6e2:e71b:14ac with SMTP id i17-20020a056830011100b006e2e71b14acmr300537otp.29.1708640193500; Thu, 22 Feb 2024 14:16:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708640193; cv=pass; d=google.com; s=arc-20160816; b=JQRZ3Iwc/AvYW/e4WdyWq8b8jUoS/AIwArfTz9XDhEax6eSF8ESxMrqIm8/shqgQFr 2bGjnbJLIzN1CywEiddvH3TQfxM7TqMpF/RiWJU0DbhUAdt2KWSRkVpEC0sYauccOCdn nX0MGJmyQXomAMzKF0z1yFk7QDC+NGguN4AiGLayqT849U/Nex9n9YC338pB7CwbbGV/ eBV4/BV5Io/zvW+9NmrxYiJXbPT6e19ECHZZHgYljabW9CxlCpztrjw68ASS957mpi2B TYrz4CNxBSQ32gwoA/hieYC/dDvDg/K/GbXCYSjie38A7AbqwfqY7GmZY2tgMT/1FohP Vb2g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=kuWR9uRbhek61YerHrmxbf2u9syCwVcyZvbkeovVBrI=; fh=DQlX4VOMXAZHEB/OHnjBToSsYwvB2UyOs7+/HRg3P7c=; b=LhRCK5BURtJmW3pim5G8RzKfCXoAUhNk/60UF6/G5qy7QvykVswKH31zibWe7Lq04e CwgqCGGrvMVkKyyv+yH0tMMZH7PBBJQSiqyDgc5yDRjPoPRTbprBd0b/ExLT3yPteMP7 L12D0/r/Cblwe1nlKGnunE7p1E7pFR1TSpf3/ho7faqw2UJ9CGGKgxbZxTxcPcyzDQ73 G/6yIhreevCxMDRS4tuwgAnqrwXl8HBdMjvzo62dEu0ZQ4ebTvhxEhu9YlkUwN2F/IbO tNuGYhh6boRHuZObqL4RX2okSdbgFs+nHUEvu6z55Y0ajJbmWB+xGNL8DweOnkoTCjja 5HyA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ocbsyBFE; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-77459-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77459-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id o19-20020ac86993000000b0042c6d7ee1a8si13309177qtq.722.2024.02.22.14.16.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 14:16:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77459-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ocbsyBFE; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-77459-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77459-ouuuleilei=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 4A3A61C20BE3 for ; Thu, 22 Feb 2024 22:16:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4B04013BAF9; Thu, 22 Feb 2024 22:15:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ocbsyBFE" 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 B9A7513BAD9; Thu, 22 Feb 2024 22:15:40 +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=1708640140; cv=none; b=mqXpom37QUKT8dStiSfGN2/hmGfeMJ5fo8VECfSIcgGTVxzJWSLnzgs1s7GXDp5qeIVcVop3PRjIXROZ16bStYt/GW45yxQKFXhhIbxNLutQ+gxjfpw2dGDUVPIo8V5ujq2w/+SV8r9YnOA1/NykY3MxMyuZ+0jyctO+VVD6t5o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708640140; c=relaxed/simple; bh=hhEw0qiaiAYkiEH9B0A5irgUskKyCnw76BLLf50VB+A=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=qNT2FMx4CpmWQ1pEL/NSGwWU4JUhe0+QDFKUdLymfojy5eDM+K5m0T78R2eYBEoRDB1oyqrf5gAI7YfZEb2ieEO3vUbqN/WH/LtgfqMH2V0J3JHqRu8V+qf8aCUEhurM9Bwdy5FSibIJkkrnlT1NrfQV4Rtkqu0qTcfd6juWJp8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ocbsyBFE; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0107DC43394; Thu, 22 Feb 2024 22:15:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708640140; bh=hhEw0qiaiAYkiEH9B0A5irgUskKyCnw76BLLf50VB+A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ocbsyBFETCqICZl+rLoPCOLZarNPdHIPeSe5/DanR0suSE7dBzbun6UTv6mTaHMNB QJK1kedCyyHc9ls/oSv6LNUPHFCtMUetX0QF45quWxmYJWQDCzmu2iOhEUMnKisPqr aedpNd2xLasUeBScB8VsYke6iisaEGKeXgnO3/YjDrk4GbAQ1FGKLZZjQuvZfQi4tb 0mKuomPEzKK91AElsAm/kuvsmkb9HdJoQicZRL+1kfwxIbh1WkdSjrB7UwFU4/YdWb hdm3TgbINREcLvfvVcK7A86h6YedloY/tMAtrR6ZS67o1olUFA7psOkfLmmjtKTyfg rKOqCy5ezvrLw== From: Bjorn Helgaas To: linux-pci@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Kuppuswamy Sathyanarayanan , Matthew W Carlis , Keith Busch , Lukas Wunner , Mika Westerberg , Jesse Brandeburg , Bjorn Helgaas Subject: [PATCH v2 3/3] PCI/DPC: Encapsulate pci_acpi_add_edr_notifier() Date: Thu, 22 Feb 2024 16:15:21 -0600 Message-Id: <20240222221521.32159-4-helgaas@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240222221521.32159-1-helgaas@kernel.org> References: <20240222221521.32159-1-helgaas@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791639099460231249 X-GMAIL-MSGID: 1791639099460231249 From: Bjorn Helgaas pci_acpi_add_edr_notifier() and pci_acpi_remove_edr_notifier() are only referenced inside drivers/pci/. Move their declarations from include/linux/pci-acpi.h to drivers/pci/pci.h so they're not visible outside drivers/pci/. Signed-off-by: Bjorn Helgaas --- drivers/pci/pci.h | 4 ++++ include/linux/pci-acpi.h | 8 -------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index 2336a8d1edab..03bf2776d73b 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h @@ -432,11 +432,15 @@ void pci_dpc_init(struct pci_dev *pdev); void dpc_process_error(struct pci_dev *pdev); pci_ers_result_t dpc_reset_link(struct pci_dev *pdev); bool pci_dpc_recovered(struct pci_dev *pdev); +void pci_acpi_add_edr_notifier(struct pci_dev *pdev); +void pci_acpi_remove_edr_notifier(struct pci_dev *pdev); #else static inline void pci_save_dpc_state(struct pci_dev *dev) { } static inline void pci_restore_dpc_state(struct pci_dev *dev) { } static inline void pci_dpc_init(struct pci_dev *pdev) { } static inline bool pci_dpc_recovered(struct pci_dev *pdev) { return false; } +static inline void pci_acpi_add_edr_notifier(struct pci_dev *pdev) { } +static inline void pci_acpi_remove_edr_notifier(struct pci_dev *pdev) { } #endif #ifdef CONFIG_PCIEPORTBUS diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h index 92e196ba0249..f447ce215adf 100644 --- a/include/linux/pci-acpi.h +++ b/include/linux/pci-acpi.h @@ -122,14 +122,6 @@ extern const guid_t pci_acpi_dsm_guid; #define DSM_PCI_POWER_ON_RESET_DELAY 0x08 #define DSM_PCI_DEVICE_READINESS_DURATIONS 0x09 -#ifdef CONFIG_PCIE_DPC -void pci_acpi_add_edr_notifier(struct pci_dev *pdev); -void pci_acpi_remove_edr_notifier(struct pci_dev *pdev); -#else -static inline void pci_acpi_add_edr_notifier(struct pci_dev *pdev) { } -static inline void pci_acpi_remove_edr_notifier(struct pci_dev *pdev) { } -#endif /* CONFIG_PCIE_DPC */ - int pci_acpi_set_companion_lookup_hook(struct acpi_device *(*func)(struct pci_dev *)); void pci_acpi_clear_companion_lookup_hook(void);