From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Thu, 7 Jan 2021 05:36:22 -0700 Subject: [PATCH 2/3] pci: Make auto-config code a little more robust In-Reply-To: <20210103220646.26707-3-phil@nwl.cc> References: <20210103220646.26707-1-phil@nwl.cc> <20210103220646.26707-3-phil@nwl.cc> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Sun, 3 Jan 2021 at 15:05, Phil Sutter wrote: > > On my DS414, some PCI devices return odd values when probing BAR sizes. > An obvious case is all-ones response, the Linux driver > (drivers/pci/probe.c) catches those explicitly and a comment explains > that either bit 0 or bit 1 must be clear (depending on MEM or IO type). > Other BARs return e.g. 0xfff0000f or 0xfff00004 and thus manage to break > size calculation due to the "middle" zeroes. Mitigate that copying more > or less what Linux does and do a "find least bit set". > > Signed-off-by: Phil Sutter > --- > drivers/pci/pci_auto.c | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > Reviewed-by: Simon Glass