Re: [PATCH v3 11/11] PCI: imx6: Replace calls to udelay() with usleep_range()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Apr 12, 2019 at 9:26 AM Lucas Stach <l.stach@xxxxxxxxxxxxxx> wrote:
>
> Am Sonntag, den 31.03.2019, 21:25 -0700 schrieb Andrey Smirnov:
> > In both cases udelay() is called in non-atomic context, so there's
> > really no need to use it there. Change the code to use usleep_range()
> > instead.
> >
> > > Signed-off-by: Andrey Smirnov <andrew.smirnov@xxxxxxxxx>
> > ---
> >  drivers/pci/controller/dwc/pci-imx6.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c
> > index c9431a8a7ca1..3f13022991ec 100644
> > --- a/drivers/pci/controller/dwc/pci-imx6.c
> > +++ b/drivers/pci/controller/dwc/pci-imx6.c
> > @@ -167,7 +167,7 @@ static int pcie_phy_poll_ack(struct imx6_pcie *imx6_pcie, bool exp_val)
> >               if (val == exp_val)
> >                       return 0;
> >
> > -             udelay(1);
> > +             usleep_range(10, 100);
>
> I'm not sure we want to change this. This is dragging out the timeout
> considerably while the really short delay, together with the low number
> of max loop iterations suggests that the condition is usually met very
> quickly.
>
> Maybe this would even want a change in the other direction by replacing
> the udelay with a cpu_relax to speed up the condition detection and
> stall the CPU in device memory loads, instead of having it spin in a
> tight inner loop.
>

OK, will do.

Thanks,
Andrey Smirnov



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux