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] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZC12lN9Cs0QlPhVh@lpieralisi>
Date:   Wed, 5 Apr 2023 15:24:36 +0200
From:   Lorenzo Pieralisi <lpieralisi@...nel.org>
To:     Sajid Dalvi <sdalvi@...gle.com>
Cc:     Han Jingoo <jingoohan1@...il.com>,
        Bjorn Helgaas <bhelgaas@...gle.com>,
        Gustavo Pimentel <gustavo.pimentel@...opsys.com>,
        Krzysztof Wilczyński <kw@...ux.com>,
        Rob Herring <robh@...nel.org>, kernel-team@...roid.com,
        linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
        Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
Subject: Re: [PATCH v2] PCI: dwc: Wait for link up only if link is started

On Thu, Mar 16, 2023 at 06:05:02PM -0500, Sajid Dalvi wrote:
> On Tue, Feb 28, 2023 at 10:36 PM Sajid Dalvi <sdalvi@...gle.com> wrote:
> >
> > Thanks for your review Jingoo.
> > Sajid
> >
> > On Tue, Feb 28, 2023 at 4:04 PM Han Jingoo <jingoohan1@...il.com> wrote:
> > >
> > > On Mon, Feb 27, 2023, Sajid Dalvi <sdalvi@...gle.com> wrote:
> > > >
> > > > In dw_pcie_host_init() regardless of whether the link has been started
> > > > or not, the code waits for the link to come up. Even in cases where
> > > > start_link() is not defined the code ends up spinning in a loop for 1
> > > > second. Since in some systems dw_pcie_host_init() gets called during
> > > > probe, this one second loop for each pcie interface instance ends up
> > > > extending the boot time.
> > > >
> > > > Call trace when start_link() is not defined:
> > > > dw_pcie_wait_for_link << spins in a loop for 1 second
> > > > dw_pcie_host_init
> > > >
> > > > Signed-off-by: Sajid Dalvi <sdalvi@...gle.com>
> > >
> > > (CC'ed Krzysztof Kozlowski)
> > >
> > > Acked-by: Jingoo Han <jingoohan1@...il.com>
> > >
> > > It looks good to me. I also checked the previous thread.
> > > I agree with Krzysztof's opinion that we should include
> > > only hardware-related features into DT.
> > > Thank you.
> > >
> > > Best regards,
> > > Jingoo Han
> > >
> > > > ---
> > > >  drivers/pci/controller/dwc/pcie-designware-host.c | 6 +++---
> > > >  1 file changed, 3 insertions(+), 3 deletions(-)
> > > >
> > > > diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c
> > > > index 9952057c8819..9709f69f173e 100644
> > > > --- a/drivers/pci/controller/dwc/pcie-designware-host.c
> > > > +++ b/drivers/pci/controller/dwc/pcie-designware-host.c
> > > > @@ -489,10 +489,10 @@ int dw_pcie_host_init(struct dw_pcie_rp *pp)
> > > >                 ret = dw_pcie_start_link(pci);
> > > >                 if (ret)
> > > >                         goto err_remove_edma;
> > > > -       }
> > > >
> > > > -       /* Ignore errors, the link may come up later */
> > > > -       dw_pcie_wait_for_link(pci);
> > > > +               /* Ignore errors, the link may come up later */
> > > > +               dw_pcie_wait_for_link(pci);
> > > > +       }
> > > >
> > > >         bridge->sysdata = pp;
> > > >
> > > > --
> > > > 2.39.2.722.g9855ee24e9-goog
> > > >
> 
> @bhelgaas Can this be picked up in your tree:
>  https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git/

This patch seems fine to me. The question I have though is why the
*current* code is written the way it is. Perhaps it is just the way
it is, I wonder whether this change can trigger a regression though.

I guess the only way to know is merging this path and check the
fallout.

Lorenzo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ