On Fri, Apr 01, 2016 at 02:52:44PM -0500, Rob Herring wrote: > On Thu, Mar 31, 2016 at 12:32 AM, David Gibson > <david@xxxxxxxxxxxxxxxxxxxxx> wrote: > > On Wed, Mar 23, 2016 at 07:40:21PM -0500, Rob Herring wrote: > >> PCI device unit addresses are in the form DD or DD,F where DD is the > >> device 0-0x1f and F is the function 0-7. Add checks that the unit > >> address matches this form. > > > > Hmm.. we ought to be able to do a bit better than this, again by > > constructing the expected unit address from reg. > > If I do that, I can't check the dev and function values are within range. Not from here, but that seems an odd place to do it anyway. Instead I'd suggest checking the dev and function values in a verifier for 'reg' values on the bus, then check the unit address afterwards. > > While we're at it, > > it probably makes sense to have that dependent on a check which makes > > sure the first entry in a pci device's 'reg' is the config address. > > You mean just check the first cell masked with 0x1f000000 is 0, right? I guess, I'd have to look at the PCI reg encoding again. > Really, I'm not so worried about checking PCI devices. DT's with PCI > devices described are rare. All I really want to check first are > leading 0s, leading 0x and uppercase hex. That's 90% of what I find in > reviews and am tired of commenting on. I do think bus specific checks > are useful, but don't think we need to fill them all in right now. Ok. How about we leave the PCI checked function as just /* TODO */ for now then. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Attachment:
signature.asc
Description: PGP signature