From: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
To: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [RFC 3/3] checks: Add unit-address checks for PCI buses
Date: Mon, 4 Apr 2016 11:08:32 +1000 [thread overview]
Message-ID: <20160404010832.GE16485@voom.fritz.box> (raw)
In-Reply-To: <CAL_JsqK5Ze4P8ofykfebV30TrMzur0cvhZi_RQMkW-kUbsvTpw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1795 bytes --]
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-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org> 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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2016-04-04 1:08 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-24 0:40 [RFC 1/3] checks: Add infrastructure for setting bus type of nodes Rob Herring
[not found] ` <1458780021-5052-1-git-send-email-robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2016-03-24 0:40 ` [RFC 2/3] checks: Add unit-address checks for simple-bus and default Rob Herring
[not found] ` <1458780021-5052-2-git-send-email-robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2016-03-31 5:29 ` David Gibson
[not found] ` <20160331052912.GE416-1s0os16eZneny3qCrzbmXA@public.gmane.org>
2016-03-31 16:18 ` Rob Herring
[not found] ` <CAL_JsqJO+9Wna4mjeRLj+ELy7BwL7K=QEVrNGs3CuAaE3Y_Q3A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-04-01 2:27 ` David Gibson
[not found] ` <20160401022735.GJ416-1s0os16eZneny3qCrzbmXA@public.gmane.org>
2016-04-01 18:50 ` Rob Herring
[not found] ` <CAL_JsqLup+esWdQ1dzpOaj17BaE2d2CJ6sJAqBUcNx2xBvNFKg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-04-04 0:22 ` David Gibson
2016-03-24 0:40 ` [RFC 3/3] checks: Add unit-address checks for PCI buses Rob Herring
[not found] ` <1458780021-5052-3-git-send-email-robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2016-03-31 5:32 ` David Gibson
[not found] ` <20160331053220.GF416-1s0os16eZneny3qCrzbmXA@public.gmane.org>
2016-04-01 19:52 ` Rob Herring
[not found] ` <CAL_JsqK5Ze4P8ofykfebV30TrMzur0cvhZi_RQMkW-kUbsvTpw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-04-04 1:08 ` David Gibson [this message]
2016-03-31 5:22 ` [RFC 1/3] checks: Add infrastructure for setting bus type of nodes David Gibson
[not found] ` <20160331052247.GD416-1s0os16eZneny3qCrzbmXA@public.gmane.org>
2016-03-31 15:17 ` Rob Herring
[not found] ` <CAL_JsqKTarcy2UHKD5m2F7TNP3stNnpCdxTrptGeiTXJJHiGaA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-04-01 2:23 ` David Gibson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160404010832.GE16485@voom.fritz.box \
--to=david-xt8fgy+axnrb3ne2bgzf6laj5h9x9tb+@public.gmane.org \
--cc=devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).