public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sathyanarayanan Kuppuswamy  <sathyanarayanan.kuppuswamy@linux.intel.com>
To: Xiaochun Lee <lixiaochun.2888@163.com>, linux-pci@vger.kernel.org
Cc: bhelgaas@google.com, linux-kernel@vger.kernel.org,
	Xiaochun Lee <lixc17@lenovo.com>
Subject: Re: [PATCH v1] PCI/DPC: Skip EDR init when BIOS disable OS native DPC
Date: Wed, 27 Jul 2022 07:23:39 -0700	[thread overview]
Message-ID: <3dc43f00-0b01-1b02-74dc-6938f6db6e29@linux.intel.com> (raw)
In-Reply-To: <1658919957-53006-1-git-send-email-lixiaochun.2888@163.com>

Hi,

On 7/27/22 4:05 AM, Xiaochun Lee wrote:
> From: Xiaochun Lee <lixc17@lenovo.com>
> 
> ACPI BIOS may disable OS native AER and DPC support to notify OS
> that our platform doesn't support AER and DPC via the _OSC method.
> BIOS also might leave the containment be accomplished purely in HW.
> When firmware is set to non-aware OS DPC, we skip to install
> EDR handler to an ACPI device.

No, EDR is used when firmware controls the DPC.

When the Firmware owns Downstream Port Containment, it is expected to use
the new “Error Disconnect Recover” notification to alert OSPM of a
Downstream Port Containment event.

> 
> Signed-off-by: Xiaochun Lee <lixc17@lenovo.com>
> ---
>  drivers/pci/pcie/edr.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/drivers/pci/pcie/edr.c b/drivers/pci/pcie/edr.c
> index a6b9b47..97a680b 100644
> --- a/drivers/pci/pcie/edr.c
> +++ b/drivers/pci/pcie/edr.c
> @@ -19,6 +19,17 @@
>  #define EDR_OST_SUCCESS			0x80
>  #define EDR_OST_FAILED			0x81
>  
> +static int pcie_dpc_is_native(struct pci_dev *dev)
> +{
> +	struct pci_host_bridge *host = pci_find_host_bridge(dev->bus);
> +
> +	if (!dev->dpc_cap)
> +		return 0;
> +
> +	return pcie_ports_dpc_native || host->native_dpc;
> +}
> +
> +
>  /*
>   * _DSM wrapper function to enable/disable DPC
>   * @pdev   : PCI device structure
> @@ -212,6 +223,11 @@ void pci_acpi_add_edr_notifier(struct pci_dev *pdev)
>  		return;
>  	}
>  
> +	if (!pcie_dpc_is_native(pdev) && !pcie_aer_is_native(pdev)) {
> +		pci_dbg(pdev, "OS doesn't control DPC, skipping EDR init\n");
> +		return;
> +	}
> +
>  	status = acpi_install_notify_handler(adev->handle, ACPI_SYSTEM_NOTIFY,
>  					     edr_handle_event, pdev);
>  	if (ACPI_FAILURE(status)) {

-- 
Sathyanarayanan Kuppuswamy
Linux Kernel Developer

  reply	other threads:[~2022-07-27 14:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-27 11:05 [PATCH v1] PCI/DPC: Skip EDR init when BIOS disable OS native DPC Xiaochun Lee
2022-07-27 14:23 ` Sathyanarayanan Kuppuswamy [this message]
2022-07-28 10:11   ` [External] " Xiaochun XC17 Li
2022-07-28 13:38     ` Sathyanarayanan Kuppuswamy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3dc43f00-0b01-1b02-74dc-6938f6db6e29@linux.intel.com \
    --to=sathyanarayanan.kuppuswamy@linux.intel.com \
    --cc=bhelgaas@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lixc17@lenovo.com \
    --cc=lixiaochun.2888@163.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox