Re: [PATCH v3 04/12] PCI: aardvark: Improve link training

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

 



On Friday 24 April 2020 20:55:23 Pali Rohár wrote:
> On Friday 24 April 2020 12:00:54 Rob Herring wrote:
> > On Fri, Apr 24, 2020 at 10:39 AM Pali Rohár <pali@xxxxxxxxxx> wrote:
> > > @@ -988,6 +1046,11 @@ static int advk_pcie_probe(struct platform_device *pdev)
> > >         }
> > >         pcie->root_bus_nr = bus->start;
> > >
> > > +       ret = of_pci_get_max_link_speed(dev->of_node);
> > > +       if (ret < 0)
> > > +               return ret;
> > 
> > Why just give up simply on DT error? Just start at gen 3 since you now
> > retry at lower speeds.
> 
> Ou, I forgot there a special check for ret == -ENOENT.
> 
> > > +       pcie->link_gen = (ret > 3) ? 3 : ret;
> > > +

This code should have been something like this:

+	ret = of_pci_get_max_link_speed(dev->of_node);
+	if (ret == -ENOENT || ret > 3)
+		pcie->link_gen = 3;
+	else if (ret >= 0)
+		pcie->link_gen = ret;
+	else {
+		dev_err(dev, "Failed to parse max-link-speed\n");
+		return ret;
+	}



[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