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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAKF3qh0GUgnyxx4P7M8jtwPdPT0xTPBjBQU3j8sqwsYANJrLag@mail.gmail.com>
Date:   Tue, 20 Oct 2020 16:33:14 +0800
From:   Ethan Zhao <xerces.zhao@...il.com>
To:     Sanjay R Mehta <Sanju.Mehta@....com>
Cc:     Bjorn Helgaas <bhelgaas@...gle.com>,
        Lukas Wunner <lukas@...ner.de>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Stuart Hayes <stuart.w.hayes@...il.com>,
        Alexandru Gagniuc <mr.nuke.me@...il.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] pciehp: Add check for DL_ACTIVE bit in pciehp_check_link_status()

On Tue, Oct 20, 2020 at 2:33 PM Sanjay R Mehta <Sanju.Mehta@....com> wrote:
>
> From: Sanjay R Mehta <sanju.mehta@....com>
>
> if DL_ACTIVE bit is set it means that there is no need to check
> PCI_EXP_LNKSTA_LT bit, as DL_ACTIVE would have set only if the link
> is already trained. Hence adding a check which takes care of this
> scenario.
Sorry, I couldn't understand the logic here. if DL_ACTIVE was set,
PCI_EXP_LNKSTA_LT is to be cleared, vice versa.  why need

(lnk_status & PCI_EXP_LNKSTA_LT) &&
 !(lnk_status & PCI_EXP_LNKSTA_DLLLA)

Double safe ?

Thanks,
Ethan

>
> Signed-off-by: Sanjay R Mehta <sanju.mehta@....com>
> ---
>  drivers/pci/hotplug/pciehp_hpc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
> index 53433b37e181..8ab2f6a2f388 100644
> --- a/drivers/pci/hotplug/pciehp_hpc.c
> +++ b/drivers/pci/hotplug/pciehp_hpc.c
> @@ -309,7 +309,8 @@ int pciehp_check_link_status(struct controller *ctrl)
>
>         pcie_capability_read_word(pdev, PCI_EXP_LNKSTA, &lnk_status);
>         ctrl_dbg(ctrl, "%s: lnk_status = %x\n", __func__, lnk_status);
> -       if ((lnk_status & PCI_EXP_LNKSTA_LT) ||
> +       if (((lnk_status & PCI_EXP_LNKSTA_LT) &&
> +            !(lnk_status & PCI_EXP_LNKSTA_DLLLA)) ||
>             !(lnk_status & PCI_EXP_LNKSTA_NLW)) {
>                 ctrl_err(ctrl, "link training error: status %#06x\n",
>                          lnk_status);
> --
> 2.25.1
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ