Thread (10 messages) 10 messages, 5 authors, 2020-08-03

Re: [RFC PATCH 00/17] Drop uses of pci_read_config_*() return value

From: Borislav Petkov <bp@alien8.de>
Date: 2020-08-02 20:18:47
Also in: dmaengine, dri-devel, intel-gfx, linux-crypto, linux-edac, linux-fpga, linux-gpio, linux-hwmon, linux-i2c, linux-ide, linux-iommu, linux-kernel-mentees, linux-pci, linux-rdma, lkml, netdev

On Sun, Aug 02, 2020 at 02:14:06PM -0500, Bjorn Helgaas wrote:
Wait, I'm not convinced yet.  I know that if a PCI read fails, you
normally get ~0 data because the host bridge fabricates it to complete
the CPU load.

But what guarantees that a PCI config register cannot contain ~0?
Well, I don't think you can differentiate that case, right?

I guess this is where the driver knowledge comes into play: if the read
returns ~0, the pci_read_config* should probably return in that case
something like:

	PCIBIOS_READ_MAYBE_FAILED

to denote it is all 1s and then the caller should be able to determine,
based on any of domain:bus:slot.func and whatever else the driver knows
about its hardware, whether the 1s are a valid value or an error.
Hopefully.

Or something better of which I cannot think of right now...

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help