Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1525537rbb; Mon, 26 Feb 2024 12:05:41 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUt4ob/Yz7Rj5aFp6uMe0GnJ+BcbH0bEiFBvVW+PnKwVpIpv0c7HWBXFaYaBvilnmTk7f7ZKxb0CSa0DRBHn7mMoxLNVxhM/lKKkyaRzg== X-Google-Smtp-Source: AGHT+IHuYNCIK+jE96iErRw94Vs69u/earGkbldAHSjp+Gp5RkPDQPlvh/6iaWkqwcTaqgvASslr X-Received: by 2002:a92:d406:0:b0:365:b41:213 with SMTP id q6-20020a92d406000000b003650b410213mr8531423ilm.17.1708977941246; Mon, 26 Feb 2024 12:05:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708977941; cv=pass; d=google.com; s=arc-20160816; b=ZxNDlUi4kXEZJcx7zbLF6OaBfmwkIiHftF1+K6gSayGLYCVUQwhUOIS4WpGAEQm37H aVm7jeQ3Asdyk5pm4qR4v+hrezRdoxIYHvteJpmqiSSQ6It9H9mL21bvT942+cFm2wI4 U2y6MNQZJvpLRPvtpG7kYCOrm7ItU9Upfsrfz2XT9SH+pSBxv+eG8mMogMKCJN1SDVJp AYK18VxajiuwGdMCFMbRKVrU05jW2BOkS8fA7UP6HQWUD18xD8qoz3NmXaH0e7hDHOP2 ZdAvGEgrrQjeuWOCBFQjinK+kerVisVNn8KEKdsn8yjlTOHvN/CElS+5tonIzAs4huqU TWaQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=SOLdmOlJwQ+tLerHZvQJTh67kBhtboy1+pb8+TjbQdM=; fh=ZTyXSrrx9BvFzOiG3HuY1kgtY1POmpdNXWC/BabaYAE=; b=gn8KQrICrhTbXfXRMR09bmgzc8NT5nIP65axTZATWIVpR+Z7UeNJ5X4lomkz8IN29o Lzn6fTHCB+vzOCC2NVsNCzl4Don9oiblvTXCjh5CkcYxBbxCah+drAyKsRlHs0710axx PRpyWccoeop6Fer3krwoFHelwSHBCnsJKc6c+iPfhi2l+DWokBtLC6QIxJ1qRq5LdWhf PAnYzn6ZH3cSWciEHO4URVdHzTAff6m8U0S61AKEefghBMxUufnofiI6tZULDwStduF/ tcGNFfETj/fAP+L0OXOUFunG0qMRDvHlrq5KA+jmuy5Lc7X6k6vxCXVIfqju7/a5w+vo qj0Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="a/S6xSlO"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-81941-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81941-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id b3-20020a631b03000000b005d6787271a3si4028344pgb.205.2024.02.26.12.05.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 12:05:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81941-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="a/S6xSlO"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-81941-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81941-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 9E67DB2AB57 for ; Mon, 26 Feb 2024 16:50:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 61E9512E1E5; Mon, 26 Feb 2024 16:50:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="a/S6xSlO" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) (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 7008D12C55E; Mon, 26 Feb 2024 16:50:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708966218; cv=none; b=fyFpISKE+BPrWK8KYzd3PEaTl5mIE5DWL7X87UAqbImAE/2pYRHct7aCTEgpEmqkQ2cmOsf6WQl1H4Gw5VgnZh2d78QpA5/UZpWfdlGGx7mCiXaVwtnKKSXYn4hk1G/ura5Wr8da3o79f5WT0WewilRFROHk+iQ2SVUkjZnJZEw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708966218; c=relaxed/simple; bh=7YvuyP2/3dQMz06f8V/sENTfum4SLtdXfnyglIOEK08=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=FZnznCa5pTcbgVf0pH1XlsVbysNbWMY456uw/OSmdZE743VF4gxj0EPvvlBab2kNuPg1vdv0gGskyocJpDdlokMxz8ZYH7O4gLkV5hgGN+GwbRefFubdJ5JNOqIQMxAhpt/HLmPCmU02TpmNVCJYi6nfZ+WnncTBK287DzZba1Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=a/S6xSlO; arc=none smtp.client-ip=192.198.163.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1708966217; x=1740502217; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=7YvuyP2/3dQMz06f8V/sENTfum4SLtdXfnyglIOEK08=; b=a/S6xSlORqGh5ZOWdQSRqjOdu6G4e0Z9QLyVLEaykGySUpqCUNNVY6O+ ohFE048AaFFZ22IZWSiTsIO5u0c8WDvycbevbNcM52darXWxW46mnOZKu kOm7etZ4Gwh8V9vSHJX4IyqllQy7AhyVBpnypw4jSt4mr4PmONo/kvclt RDDqcvwsroFX2rgwHIoTKmEJvXVENlZGoVC6lWvpdh0kNzYTssdAT9UGC Qqij5I2jY5ydniaCofVVwtIax6JoNcmEjSM75xlD8IQEp3XfEJbwWVlSh YtPjALktfVt/xiVvPYY99p600dHbGUkhIrhg2H28FdpcQg6PXxkLHuXiL w==; X-IronPort-AV: E=McAfee;i="6600,9927,10996"; a="7044878" X-IronPort-AV: E=Sophos;i="6.06,186,1705392000"; d="scan'208";a="7044878" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Feb 2024 08:50:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,186,1705392000"; d="scan'208";a="6871348" Received: from tvereenx-mobl.amr.corp.intel.com (HELO [10.251.5.170]) ([10.251.5.170]) by fmviesa008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Feb 2024 08:50:12 -0800 Message-ID: Date: Mon, 26 Feb 2024 08:50:11 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/3] PCI/DPC: Request DPC only if also requesting AER Content-Language: en-US To: Bjorn Helgaas Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Matthew W Carlis , Keith Busch , Lukas Wunner , Mika Westerberg , Jesse Brandeburg , Bjorn Helgaas , stable@vger.kernel.org References: <20240226163305.GA202015@bhelgaas> From: Kuppuswamy Sathyanarayanan In-Reply-To: <20240226163305.GA202015@bhelgaas> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 2/26/24 8:33 AM, Bjorn Helgaas wrote: > On Mon, Feb 26, 2024 at 07:46:05AM -0800, Kuppuswamy Sathyanarayanan wrote: >> On 2/26/24 7:18 AM, Bjorn Helgaas wrote: >>> On Sun, Feb 25, 2024 at 11:46:07AM -0800, Kuppuswamy Sathyanarayanan wrote: >>>> On 2/22/24 2:15 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). >>>> IIUC, this dependency is discussed in sec 4.5.2.4. "Dependencies >>>> Between _OSC Control Bits". >>>> >>>> Because handling of Downstream Port Containment has a dependency on >>>> Advanced Error Reporting, the operating system is required to >>>> request control over Advanced Error Reporting (bit 3 of the Control >>>> field) while requesting control over Downstream Port Containment >>>> Configuration (bit 7 of the Control field). If the operating system >>>> attempts to claim control of Downstream Port Containment >>>> Configuration without also claiming control over Advanced Error >>>> Reporting, firmware is required to refuse control of the feature >>>> being illegally claimed and mask the corresponding bit. Firmware is >>>> required to maintain ownership of Advanced Error Reporting if it >>>> retains ownership of Downstream Port Containment Configuration. If >>>> the operating system sets bit 7 of the Control field, it must set >>>> bit 7 of the Support field, indicating support for the Error >>>> Disconnect Recover event. >>> So I guess you're suggesting that there are two defects here? >>> >>> 1) Linux requested DPC control without requesting AER control. >>> >>> 2) Platform granted DPC control when it shouldn't have. >>> >>> I do agree with that, but obviously we can only fix 1) in Linux. >> Sorry, maybe my comment was not clear. I was just suggesting to >> change the spec reference from r3.3, sec 4.5.1, table 4-5 to r3.3, >> sec 4.5.2.4 "Dependencies Between _OSC Control Bits". > The requirement that the OS request AER control whenever it requests > DPC control is mentioned in both sec 4.5.1 and sec 4.5.2.4. IMO sec > 4.5.2.4 should not exist because the per-bit table in sec 4.5.1 is a > better place for implementation guidance. 4.5.2.4 is easy to miss, > mostly redundant, and hard to integrate with the 4.5.1 table. > > What advantage do you see for citing 4.5.2.4 instead of 4.5.1? The > only real difference I see is that it also points out a firmware > problem. I don't think the extra text is worth it since it doesn't > motivate the Linux change. My thinking is, since the fix is related to the dependency between _OSC control bits (AER & DPC), and there is a special section in the spec which discuss it, I thought it is better to  quote it. But I get your point. I think either if fine. > > Bjorn -- Sathyanarayanan Kuppuswamy Linux Kernel Developer