Received: by 2002:a05:7208:13ce:b0:7f:395a:35b6 with SMTP id r14csp185977rbe; Wed, 28 Feb 2024 17:05:20 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWpKSgKq5WayiaBCl8CGE0flxJaQxGeM5dWY9AlgWb1oncIBxZCQksx953GyIpl7GUVRZi0DA9DTOk9U+6tmIgfb1kzcpi2mMPNT266BA== X-Google-Smtp-Source: AGHT+IHgIIvGP6LOnvLkA3cEYXTQtzz4dGFPrTWJDUJ/ovNAvqSK8B5t5V1dvgxkpc1Lvb8Al7dK X-Received: by 2002:a05:6830:208:b0:6e4:7b1a:e334 with SMTP id em8-20020a056830020800b006e47b1ae334mr599917otb.20.1709168718141; Wed, 28 Feb 2024 17:05:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709168718; cv=pass; d=google.com; s=arc-20160816; b=pvCk2syyPYhmtYjfjLGQe1czbNxtGXkyPitF4SHwlgf8fS3FewYiQ2om8v1/qpJrSh L43pbNoyh+cN224HOHcDkvphGm64bDKCUPoVxRoyJ/c64NHTCUhSWVeqoFbUMhXIqnnD ilwwSVtBiSZHkalj9BtO5hgtGIKt6XkM+30R3we1DPq5bxU6uBJ/QXmw7yd11u5LU6gN 3n5kUa4/ULXr/4qJ5uo0Ru1VQHpVe+9NxT4bJp93ys5vt0u5Q76f0sy4CbFnQLm3mwqF ISIXJF0JQyXXdsHr6mqYNjg15GnOV/Ffvr3L8WPUG70lW3KKnqTppsY5iEOcLIAVHhdl P0Qw== 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=lvkGfHx1ycK0UHDn4p1G7EZFyBe9z6kYHcy9/UBqooE=; fh=n0WZ+SCW4kcZd7Fg2x/n8ppTGwoxbgVOsfV1XGjKRgM=; b=RSINgUcgFR0N8rjXtuBZEq+XX5tA0MIzIVxSGoiIE67XzHF3nPO6dAkgPLhNhj/pl5 nvhdns3dMl2QX8py9onYoCNqdOoppG2slT1IGRMRARluhVDn20mjpLBgWEisIGfrwn6i w3ZRXDxF0zkI8SYy5eRht9awKqQFJVDR6iWBBUNpPjujIugKXwKGXp4Q38cspMiljgrm O9S04JcgslpoDdxPgsZTUEaW8hjfFRnxXALFCjybSERQjcfI1UI49XrbVggELMsllMnA W7yDDORhbDxBV3LmsHWSTRIm/RhUo2DCDHgxHY2r6XJzEPyJcpvEKMavfLYyJ8gHQ8Rq qtVA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=CfyjDQ15; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-85861-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85861-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 a192-20020a6390c9000000b005cd88161d2fsi244761pge.694.2024.02.28.17.05.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 17:05:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85861-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=CfyjDQ15; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-85861-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85861-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 B80B1B2184E for ; Thu, 29 Feb 2024 00:00:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F07C8EDB; Thu, 29 Feb 2024 00:00:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="CfyjDQ15" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (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 7808E13D2FD; Thu, 29 Feb 2024 00:00:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709164812; cv=none; b=OO6DW+krpYRFRZaGqyRHR+gUwJEjgpT1JScFbUwiuXr5dOzqG7+ZAbQaAUl+WZZkn+AHjMKsoRqTbfg92D9gfGW0Cgu9ix+ZlL7sKtgyLMSMljX8JHx3n8CxRU5CBb9G9b29c1KnwhokhoH4wKLbAvYPIo+R5w7lglVXglVHZQI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709164812; c=relaxed/simple; bh=qo1L9+mSe0yIWvvN760Et2xlAvVq2979ZfEn++Kk//I=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=gdsnoCBy1alguecqQcIlRrS4FTRAgd0rqnvL2e/DhZbkscogV3M/kTqeQJrJE8pxRIRX/FhkzW4gXbUO+b9GNZlpd8DR7+XFcSt2LCcxpeMvTSdfKcI4zTC8CSc5FzN2a0AnR+OJ5/ViRanX9TaTrlcwABslRl1Pvtqo9CxjSu0= 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=CfyjDQ15; arc=none smtp.client-ip=192.198.163.16 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=1709164811; x=1740700811; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=qo1L9+mSe0yIWvvN760Et2xlAvVq2979ZfEn++Kk//I=; b=CfyjDQ15YM1r2TiNytL9Kwhx0Nh12ohOTMYYeLUBJA3uBAXm31o5KmIV Maa/fIJy5y5IrjpP4Hhyl+QXRCscKIaH86qaXCQ4bzwlnL/5o5AVLSzgO jCryq4Ve/mxtnmxCErY1IjZQIjpAveAjsqi3F8fr1zR5SiwYsnqJkZqrf lzv/Kvvzd9qGtib7q0YE1ZbeuVKA05EspzkJOQ1FAza8E4lRq6NjAl4TV EZ/+K/LJmNK+S5d2ahMlJPuLXG7oDY1CvYLTJ6HaQn96f8DPiV66sRvav 7vFm6sIWUbHvJG2NZQ8Nvin2ucH61ztd5Mw/DXdurud2ilmkfU71YTH42 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10998"; a="4183220" X-IronPort-AV: E=Sophos;i="6.06,191,1705392000"; d="scan'208";a="4183220" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2024 16:00:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,191,1705392000"; d="scan'208";a="30785492" Received: from smitpat1-mobl.amr.corp.intel.com (HELO [10.209.30.182]) ([10.209.30.182]) by fmviesa002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2024 16:00:06 -0800 Message-ID: Date: Wed, 28 Feb 2024 16:00:06 -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 0/3] PCI/DPC: Clean up DPC vs AER/EDR ownership and Kconfig Content-Language: en-US To: Ethan Zhao , Bjorn Helgaas , linux-pci@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Matthew W Carlis , Keith Busch , Lukas Wunner , Mika Westerberg , Jesse Brandeburg , Bjorn Helgaas References: <20240222221521.32159-1-helgaas@kernel.org> <89984f11-b84e-4da0-ab5b-f2048461aae0@linux.intel.com> <52245cb8-879e-4997-a1b5-cdfbd702dee7@linux.intel.com> <81f2dfa4-14c6-423c-96ee-b11b8a4670ed@linux.intel.com> From: Kuppuswamy Sathyanarayanan In-Reply-To: <81f2dfa4-14c6-423c-96ee-b11b8a4670ed@linux.intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 2/26/24 11:12 PM, Ethan Zhao wrote: > On 2/27/2024 2:35 PM, Kuppuswamy Sathyanarayanan wrote: >> Hi, >> >> On 2/26/24 10:18 PM, Ethan Zhao wrote: >>> On 2/23/2024 6:15 AM, Bjorn Helgaas wrote: >>>> From: Bjorn Helgaas >>>> >>>> Previously we could request control of DPC without AER, which is illegal >>>> per spec.  Also, we could enable CONFIG_PCIE_DPC without CONFIG_PCIE_EDR, >>>> which is also illegal.  This series addresses both. >>> I have a question here, how to understand the relationship EDR & AER ? >>> somewhere EDR touches AER status without checking _OSC granted bits, >>> such as >>>     pci_aer_raw_clear_status(edev); >> >> Which_OSC bits? >> >> EDR code will only get triggered if OS advertises the EDR support (which >> also means OS supports AER and DPC), and both AER and DPC is owned by >> the firmware. During the EDR notification, the OS is allowed to touch AER > > Means no need to check if host->native_aer ? why checked in > pcie_do_recovery() ? pcie_do_recovery() can be called form EDR (FF) or native path. That check is used to skip device status clearing in FF mode. You can find details about it in https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/pci/pcie/err.c?id=068c29a248b6ddbfdf7bb150b547569759620d36 > > Thanks, > Ethan > >> and DPC registers. So there is no problem with EDR code using AER routines. >> >> >>> sometimes EDR calling AER with host->native_aer checked, like >>> >>> pcie_do_recovery() >>> { >>>   ... >>>   if (host->native_aer || pcie_ports_native) { >>>          pcie_clear_device_status(dev); >>>          pci_aer_clear_nonfatal_status(dev); >>>      } >>>   ... >>> } >>> >>> That is really confusing. could we do some cleanup to eliminate it ? >>> such as seperate AER code into common code and runtime part. >>> >>> >>> Thanks, >>> Ethan >>>   >>>> Bjorn Helgaas (3): >>>>     PCI/DPC: Request DPC only if also requesting AER >>>>     PCI/DPC: Remove CONFIG_PCIE_EDR >>>>     PCI/DPC: Encapsulate pci_acpi_add_edr_notifier() >>>> >>>>    drivers/acpi/pci_root.c   | 22 ++++++++++++---------- >>>>    drivers/pci/pci.h         |  4 ++++ >>>>    drivers/pci/pcie/Kconfig  | 14 ++++---------- >>>>    drivers/pci/pcie/Makefile |  5 ++++- >>>>    drivers/pci/pcie/dpc.c    | 10 ---------- >>>>    include/linux/pci-acpi.h  |  8 -------- >>>>    6 files changed, 24 insertions(+), 39 deletions(-) >>>> > -- Sathyanarayanan Kuppuswamy Linux Kernel Developer