From: Mark Kettenis Date: Thu, 9 Apr 2020 11:38:56 +0200 (CEST) Subject: [PATCH v5 10/29] pci: Adjust dm_pci_read_bar32() to return errors correctly In-Reply-To: (message from Andy Shevchenko on Thu, 9 Apr 2020 12:06:11 +0300) References: <20200408225749.171380-1-sjg@chromium.org> <20200408165737.v5.10.I36321d5e30daf051900f01f6289dfc58439871ea@changeid> Message-ID: <01616c9ee50e8d7e@bloch.sibelius.xs4all.nl> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de > From: Andy Shevchenko > Date: Thu, 9 Apr 2020 12:06:11 +0300 > > On Thu, Apr 9, 2020 at 2:00 AM Simon Glass wrote: > > > > At present if reading a BAR returns 0xffffffff (e.g. the device is not > > present) then the value is masked and a different value is returned. > > This makes it harder to detect the problem when debugging. > > If you insisting on the code, you may need to reword the commit > message, at least by removing ambiguous "device not present", because > this is not how PCI spec defines situations when device is not > present. In addition to that: The 0xffffffff value is an artifact of how x86 systems handle aborted PCI transactions. Other architectures will probably generate a fault of some sorts. It looks like at least some of the pci drivers in u-boot emulate the x86 behaviour but I'm not sure all of them do.