Re: [PATCH v3 13/15] riscv: dts: canaan: fix bus {ranges,reg} warnings

From: Conor.Dooley
Date: Thu Jun 30 2022 - 15:31:43 EST


On 30/06/2022 18:02, Conor Dooley wrote:
>
>
> On 30/06/2022 17:49, Niklas Cassel wrote:
>> On Wed, Jun 29, 2022 at 07:43:42PM +0100, Conor Dooley wrote:
>>> From: Conor Dooley <conor.dooley@xxxxxxxxxxxxx>
>>>
>>> The k210 devicetrees warn about missing/empty reg and/or ranges
>>> properties:
>>> arch/riscv/boot/dts/canaan/k210.dtsi:408.22-460.5: Warning (unit_address_vs_reg): /soc/bus@52000000: node has a unit name, but no reg or ranges property
>>> arch/riscv/boot/dts/canaan/k210.dtsi:352.22-406.5: Warning (simple_bus_reg): /soc/bus@50400000: missing or empty reg/ranges property
>>>
>>> Add reg and ranges properties that naively cap the buses after the
>>> allocation of their last devices.
>>>
>>> Signed-off-by: Conor Dooley <conor.dooley@xxxxxxxxxxxxx>
>>> ---
>>> arch/riscv/boot/dts/canaan/k210.dtsi | 9 ++++++---
>>> 1 file changed, 6 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/arch/riscv/boot/dts/canaan/k210.dtsi b/arch/riscv/boot/dts/canaan/k210.dtsi
>>> index 948dc235e39d..6a34dc4f3e51 100644
>>> --- a/arch/riscv/boot/dts/canaan/k210.dtsi
>>> +++ b/arch/riscv/boot/dts/canaan/k210.dtsi
>>> @@ -163,7 +163,8 @@ apb0: bus@50200000 {
>>> #address-cells = <1>;
>>> #size-cells = <1>;
>>> compatible = "simple-pm-bus";
>>> - ranges;
>>> + regs = <0x50200000 0x200000>;
>>> + ranges = <0x50200000 0x50200000 0x200000>;
>>
>> This looks wrong.
>>
>> The property is called "reg" not "regs".
>
> Yeah...
>
>>
>> And I don't think that you should provide "reg" at all,
>> simply supplying "ranges" should be sufficient, no?
>
> I don't recall why I put the regs in, I'll drop it if
> possible & respond if I can't.
> IIRC, it did actually complain.

It does not complain. Good spot, thanks.
I'll drop "regs" for v4.
Conor.