lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <24F76C61-22AA-466A-88EA-8C143616BA84@intel.com>
Date:   Fri, 26 Feb 2021 17:47:16 +0000
From:   "Kelley, Sean V" <sean.v.kelley@...el.com>
To:     Xiaofei Tan <tanxiaofei@...wei.com>,
        "bhelgaas@...gle.com" <bhelgaas@...gle.com>,
        "sathyanarayanan.kuppuswamy@...ux.intel.com" 
        <sathyanarayanan.kuppuswamy@...ux.intel.com>,
        "Jonathan.Cameron@...wei.com" <Jonathan.Cameron@...wei.com>,
        "refactormyself@...il.com" <refactormyself@...il.com>
CC:     "linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linuxarm@...wei.com" <linuxarm@...wei.com>
Subject: Re: [PATCH v2] PCI/AER: Change to use helper pcie_aer_is_native() in
 some places



On 2/4/21, 6:07 PM, "Xiaofei Tan" <tanxiaofei@...wei.com> wrote:

    Use helper function pcie_aer_is_native() in some places to keep
    the code tidy. No function changes.

    Signed-off-by: Xiaofei Tan <tanxiaofei@...wei.com>
    Reviewed-by: Krzysztof Wilczyński <kw@...ux.com>


Nice use of the helper and good suggestion from Krzysztof.

Acked-by: Sean V Kelley <sean.v.kelley@...el.com>



    ---
    Changes from v1 to v2:
    - Add the fix suggested by Krzysztof.
    ---
     drivers/pci/pcie/aer.c          | 4 ++--
     drivers/pci/pcie/err.c          | 2 +-
     drivers/pci/pcie/portdrv_core.c | 3 +--
     3 files changed, 4 insertions(+), 5 deletions(-)

    diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c
    index 77b0f2c..03212d0 100644
    --- a/drivers/pci/pcie/aer.c
    +++ b/drivers/pci/pcie/aer.c
    @@ -1397,7 +1397,7 @@ static pci_ers_result_t aer_root_reset(struct pci_dev *dev)
     	 */
     	aer = root ? root->aer_cap : 0;

    -	if ((host->native_aer || pcie_ports_native) && aer) {
    +	if (pcie_aer_is_native(dev) && aer) {
     		/* Disable Root's interrupt in response to error messages */
     		pci_read_config_dword(root, aer + PCI_ERR_ROOT_COMMAND, &reg32);
     		reg32 &= ~ROOT_PORT_INTR_ON_MESG_MASK;
    @@ -1417,7 +1417,7 @@ static pci_ers_result_t aer_root_reset(struct pci_dev *dev)
     		pci_info(dev, "Root Port link has been reset (%d)\n", rc);
     	}

    -	if ((host->native_aer || pcie_ports_native) && aer) {
    +	if (pcie_aer_is_native(dev) && aer) {
     		/* Clear Root Error Status */
     		pci_read_config_dword(root, aer + PCI_ERR_ROOT_STATUS, &reg32);
     		pci_write_config_dword(root, aer + PCI_ERR_ROOT_STATUS, reg32);
    diff --git a/drivers/pci/pcie/err.c b/drivers/pci/pcie/err.c
    index 510f31f..1d6cfb9 100644
    --- a/drivers/pci/pcie/err.c
    +++ b/drivers/pci/pcie/err.c
    @@ -237,7 +237,7 @@ pci_ers_result_t pcie_do_recovery(struct pci_dev *dev,
     	 * this status.  In that case, the signaling device may not even be
     	 * visible to the OS.
     	 */
    -	if (host->native_aer || pcie_ports_native) {
    +	if (pcie_aer_is_native(dev)) {
     		pcie_clear_device_status(bridge);
     		pci_aer_clear_nonfatal_status(bridge);
     	}
    diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c
    index e1fed664..3b3743e 100644
    --- a/drivers/pci/pcie/portdrv_core.c
    +++ b/drivers/pci/pcie/portdrv_core.c
    @@ -221,8 +221,7 @@ static int get_port_device_capability(struct pci_dev *dev)
     	}

     #ifdef CONFIG_PCIEAER
    -	if (dev->aer_cap && pci_aer_available() &&
    -	    (pcie_ports_native || host->native_aer)) {
    +	if (pci_aer_available() && pcie_aer_is_native(dev)) {
     		services |= PCIE_PORT_SERVICE_AER;

     		/*
    -- 
    2.8.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ