Re: [PATCH] checks: Update #{size,address}-cells check for 'dma-ranges'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Thu, Jan 12, 2023 at 01:47:03PM -0600, Rob Herring wrote:
> On Thu, Jan 12, 2023 at 6:59 AM Qun-Wei Lin <qun-wei.lin@xxxxxxxxxxxx> wrote:
> >
> > The "dma-ranges" property value is a sequence of
> >         child-address  parent-address  child-size
> >
> > The size of each field is determined by taking the child's
> > "#address-cells" value, the parent's "#address-cells" value,
> > and the child's "#size-cells" value.
> >
> > However, in the following example, it gives a false alarm:
> > +-----------------------------------+---------------------------------------+
> > | ranges.dts                        | dma-ranges.dts                        |
> > +-----------------------------------+---------------------------------------+
> > | /dts-v1/;                         | /dts-v1/;                             |
> > |                                   |                                       |
> > | /{                                | /{                                    |
> > |   #address-cells = <1>;           |   #address-cells = <1>;               |
> > |                                   |                                       |
> > |   parent {                        |   parent {                            |
> > |     #address-cells = <1>;         |     #address-cells = <1>;             |
> > |     #size-cells = <1>;            |     #size-cells = <1>;                |
> > |     ranges = <0x0 0xe000 0x1000>; |     dma-ranges = <0x0 0xe000 0x1000>; |
> > |     child {                       |     child {                           |
> > |       ...                         |       ...                             |
> > |     };                            |     };                                |
> > |   };                              |   };                                  |
> > | };                                | };                                    |
> > +-----------------------------------+---------------------------------------+
> > | no warning                        | Warning (avoid_unnecessary_addr_size) |
> > +-----------------------------------+---------------------------------------+
> >
> > Same as "ranges", it should not be reported in this check.
> 
> Except that dma-ranges only makes sense if there is a ranges property.

Hm, does it?  It would certainly be an odd situation, but I can
imagine a sort of bus that can DMA, but which has no-addressable
registers on it.

-- 
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


[Index of Archives]     [Device Tree]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux