All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: Rob Herring <robherring2@gmail.com>
Cc: Robert Richter <rric@kernel.org>,
	Catalin Marinas <Catalin.Marinas@arm.com>,
	Will Deacon <Will.Deacon@arm.com>,
	Rob Herring <robh+dt@kernel.org>, Arnd Bergmann <arnd@arndb.de>,
	Pawel Moll <Pawel.Moll@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	Radha Mohan Chintakuntla <rchintakuntla@cavium.com>,
	Robert Richter <rrichter@cavium.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: Re: [PATCH 2/5] arm64, thunder: Add initial dts for Cavium Thunder SoC
Date: Wed, 30 Jul 2014 18:48:03 +0100	[thread overview]
Message-ID: <20140730174803.GF20162@leverpostej> (raw)
In-Reply-To: <CAL_JsqLJ_W34XTF2aMOW9z+Gq4oxbrX1RztyJN8Mi0OFPeNxfg@mail.gmail.com>

[...]

> >> +     gic0: interrupt-controller@801000000000 {
> >
> > To make this easier to read, please place a comma between 32-bit
> > portions of the unit address (e.g. here have 8010,00000000).
> 
> Mark, perhaps a dtc or checkpatch.pl check for this?

Sure. Dodgy first atttempt at checkpatch below.

---->8----
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 182be0f..8aee3f5 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2136,6 +2136,14 @@ sub process {
                        }
                }
 
+# check for difficult-to-read unit-addresses
+               if (defined $root &&
+                       ($realfile =~ /\.dtsi?$/ && $line =~ /([a-z0-9._\-+]++@([0-9a-f]+))\s*{/gi) &&
+                       (length($2) > 8)) {
+                               WARN("LONG_DT_UNIT_ADDRESS",
+                                    "Consider splitting long unit address \"$2\" with a comma between cells\n" . $herecurr);
+               }
+
 # check we are in a valid source file if not then ignore this hunk
                next if ($realfile !~ /\.(h|c|s|S|pl|sh)$/);
----8<----

It would also be nice to check matching unit-address and reg, but doing
that correctly requires knowing #address-cells, which sounds a little
painful.

I'm not sure where I picked up the comma convention, as it doesn't seem
to be in ePAPR.  It does seem common though, and is my personal
preference:

[mark@leverpostej:~/src/linux]% git grep '@[a-z0-9]\+,[a-b0-9]\+' \                          
	-- arch/arm/boot/dts | wc -l
254
[mark@leverpostej:~/src/linux]% git grep '@[a-z0-9]\+,[a-b0-9]\+' \
	-- arch/powerpc/boot/dts | wc -l
370
[mark@leverpostej:~/src/linux]% git grep '@[a-z0-9]\+,[a-b0-9]\+' \
        -- arch/*/boot/dts | wc -l
631

[...]

> >> +             uaa0: serial@87e024000000 {
> >> +                     compatible = "arm,pl011", "arm,primecell";
> >> +                     reg = <0x87e0 0x24000000 0x0 0x1000>;
> >> +                     interrupts = <1 21 4>;
> >> +                     clocks = <&refclk50mhz>;
> >> +                     clock-names = "apb_pclk";
> >
> > Is this actually the apb_pclk, or is the the uartclk? I assume it's the
> > latter.
> 
> Shouldn't new bindings have both clocks here? A single clock was a
> mistake I think (mine in fact).

I don't think we fixed it up in the end. It made drivers look a bit messy and
it dropped off my priority queue.

Cheers,
Mark.

WARNING: multiple messages have this Message-ID (diff)
From: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>
To: Rob Herring <robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Robert Richter <rric-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Catalin Marinas <Catalin.Marinas-5wv7dgnIgG8@public.gmane.org>,
	Will Deacon <Will.Deacon-5wv7dgnIgG8@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>,
	Pawel Moll <Pawel.Moll-5wv7dgnIgG8@public.gmane.org>,
	Ian Campbell
	<ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>,
	Kumar Gala <galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	Radha Mohan Chintakuntla
	<rchintakuntla-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>,
	Robert Richter <rrichter-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH 2/5] arm64, thunder: Add initial dts for Cavium Thunder SoC
Date: Wed, 30 Jul 2014 18:48:03 +0100	[thread overview]
Message-ID: <20140730174803.GF20162@leverpostej> (raw)
In-Reply-To: <CAL_JsqLJ_W34XTF2aMOW9z+Gq4oxbrX1RztyJN8Mi0OFPeNxfg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

[...]

> >> +     gic0: interrupt-controller@801000000000 {
> >
> > To make this easier to read, please place a comma between 32-bit
> > portions of the unit address (e.g. here have 8010,00000000).
> 
> Mark, perhaps a dtc or checkpatch.pl check for this?

Sure. Dodgy first atttempt at checkpatch below.

---->8----
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 182be0f..8aee3f5 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2136,6 +2136,14 @@ sub process {
                        }
                }
 
+# check for difficult-to-read unit-addresses
+               if (defined $root &&
+                       ($realfile =~ /\.dtsi?$/ && $line =~ /([a-z0-9._\-+]++@([0-9a-f]+))\s*{/gi) &&
+                       (length($2) > 8)) {
+                               WARN("LONG_DT_UNIT_ADDRESS",
+                                    "Consider splitting long unit address \"$2\" with a comma between cells\n" . $herecurr);
+               }
+
 # check we are in a valid source file if not then ignore this hunk
                next if ($realfile !~ /\.(h|c|s|S|pl|sh)$/);
----8<----

It would also be nice to check matching unit-address and reg, but doing
that correctly requires knowing #address-cells, which sounds a little
painful.

I'm not sure where I picked up the comma convention, as it doesn't seem
to be in ePAPR.  It does seem common though, and is my personal
preference:

[mark@leverpostej:~/src/linux]% git grep '@[a-z0-9]\+,[a-b0-9]\+' \                          
	-- arch/arm/boot/dts | wc -l
254
[mark@leverpostej:~/src/linux]% git grep '@[a-z0-9]\+,[a-b0-9]\+' \
	-- arch/powerpc/boot/dts | wc -l
370
[mark@leverpostej:~/src/linux]% git grep '@[a-z0-9]\+,[a-b0-9]\+' \
        -- arch/*/boot/dts | wc -l
631

[...]

> >> +             uaa0: serial@87e024000000 {
> >> +                     compatible = "arm,pl011", "arm,primecell";
> >> +                     reg = <0x87e0 0x24000000 0x0 0x1000>;
> >> +                     interrupts = <1 21 4>;
> >> +                     clocks = <&refclk50mhz>;
> >> +                     clock-names = "apb_pclk";
> >
> > Is this actually the apb_pclk, or is the the uartclk? I assume it's the
> > latter.
> 
> Shouldn't new bindings have both clocks here? A single clock was a
> mistake I think (mine in fact).

I don't think we fixed it up in the end. It made drivers look a bit messy and
it dropped off my priority queue.

Cheers,
Mark.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/5] arm64, thunder: Add initial dts for Cavium Thunder SoC
Date: Wed, 30 Jul 2014 18:48:03 +0100	[thread overview]
Message-ID: <20140730174803.GF20162@leverpostej> (raw)
In-Reply-To: <CAL_JsqLJ_W34XTF2aMOW9z+Gq4oxbrX1RztyJN8Mi0OFPeNxfg@mail.gmail.com>

[...]

> >> +     gic0: interrupt-controller at 801000000000 {
> >
> > To make this easier to read, please place a comma between 32-bit
> > portions of the unit address (e.g. here have 8010,00000000).
> 
> Mark, perhaps a dtc or checkpatch.pl check for this?

Sure. Dodgy first atttempt at checkpatch below.

---->8----
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 182be0f..8aee3f5 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2136,6 +2136,14 @@ sub process {
                        }
                }
 
+# check for difficult-to-read unit-addresses
+               if (defined $root &&
+                       ($realfile =~ /\.dtsi?$/ && $line =~ /([a-z0-9._\-+]++@([0-9a-f]+))\s*{/gi) &&
+                       (length($2) > 8)) {
+                               WARN("LONG_DT_UNIT_ADDRESS",
+                                    "Consider splitting long unit address \"$2\" with a comma between cells\n" . $herecurr);
+               }
+
 # check we are in a valid source file if not then ignore this hunk
                next if ($realfile !~ /\.(h|c|s|S|pl|sh)$/);
----8<----

It would also be nice to check matching unit-address and reg, but doing
that correctly requires knowing #address-cells, which sounds a little
painful.

I'm not sure where I picked up the comma convention, as it doesn't seem
to be in ePAPR.  It does seem common though, and is my personal
preference:

[mark at leverpostej:~/src/linux]% git grep '@[a-z0-9]\+,[a-b0-9]\+' \                          
	-- arch/arm/boot/dts | wc -l
254
[mark at leverpostej:~/src/linux]% git grep '@[a-z0-9]\+,[a-b0-9]\+' \
	-- arch/powerpc/boot/dts | wc -l
370
[mark@leverpostej:~/src/linux]% git grep '@[a-z0-9]\+,[a-b0-9]\+' \
        -- arch/*/boot/dts | wc -l
631

[...]

> >> +             uaa0: serial at 87e024000000 {
> >> +                     compatible = "arm,pl011", "arm,primecell";
> >> +                     reg = <0x87e0 0x24000000 0x0 0x1000>;
> >> +                     interrupts = <1 21 4>;
> >> +                     clocks = <&refclk50mhz>;
> >> +                     clock-names = "apb_pclk";
> >
> > Is this actually the apb_pclk, or is the the uartclk? I assume it's the
> > latter.
> 
> Shouldn't new bindings have both clocks here? A single clock was a
> mistake I think (mine in fact).

I don't think we fixed it up in the end. It made drivers look a bit messy and
it dropped off my priority queue.

Cheers,
Mark.

  reply	other threads:[~2014-07-30 17:48 UTC|newest]

Thread overview: 97+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-30 15:06 [PATCH 0/5] arm64, thunder: Enable Cavium Thunder SoC Family Robert Richter
2014-07-30 15:06 ` Robert Richter
2014-07-30 15:06 ` [PATCH 1/5] arm64, thunder: Add Kconfig option for " Robert Richter
2014-07-30 15:06   ` Robert Richter
2014-07-30 15:06 ` [PATCH 2/5] arm64, thunder: Add initial dts for Cavium Thunder SoC Robert Richter
2014-07-30 15:06   ` Robert Richter
2014-07-30 15:06   ` Robert Richter
2014-07-30 15:46   ` Mark Rutland
2014-07-30 15:46     ` Mark Rutland
2014-07-30 15:46     ` Mark Rutland
2014-07-30 16:37     ` Rob Herring
2014-07-30 16:37       ` Rob Herring
2014-07-30 16:37       ` Rob Herring
2014-07-30 17:48       ` Mark Rutland [this message]
2014-07-30 17:48         ` Mark Rutland
2014-07-30 17:48         ` Mark Rutland
2014-08-05  8:47         ` Robert Richter
2014-08-05  8:47           ` Robert Richter
2014-08-05  8:47           ` Robert Richter
2014-07-31 11:32       ` Robert Richter
2014-07-31 11:32         ` Robert Richter
2014-07-31 11:32         ` Robert Richter
2014-07-31 12:34       ` Robert Richter
2014-07-31 12:34         ` Robert Richter
2014-07-31 12:34         ` Robert Richter
2014-07-31 15:22         ` Rob Herring
2014-07-31 15:22           ` Rob Herring
2014-07-31 15:22           ` Rob Herring
2014-07-31 16:35           ` Robert Richter
2014-07-31 16:35             ` Robert Richter
2014-07-31 16:35             ` Robert Richter
2014-07-31  8:41     ` Ganapatrao Kulkarni
2014-07-31  9:53       ` Mark Rutland
2014-07-31  9:53         ` Mark Rutland
2014-07-31  9:53         ` Mark Rutland
2014-07-31 11:12         ` Ganapatrao Kulkarni
2014-07-31 11:33           ` Mark Rutland
2014-07-31 11:33             ` Mark Rutland
2014-07-31 11:33             ` Mark Rutland
2014-08-01 17:04             ` Robert Richter
2014-08-01 17:04               ` Robert Richter
2014-08-01 17:04               ` Robert Richter
2014-08-01 18:00               ` Mark Rutland
2014-08-01 18:00                 ` Mark Rutland
2014-08-01 18:00                 ` Mark Rutland
2014-08-01 10:25     ` Robert Richter
2014-08-01 10:25       ` Robert Richter
2014-08-01 10:25       ` Robert Richter
2014-07-30 18:12   ` Olof Johansson
2014-07-30 18:12     ` Olof Johansson
2014-07-30 18:12     ` Olof Johansson
2014-07-30 18:35     ` Mark Rutland
2014-07-30 18:35       ` Mark Rutland
2014-07-30 18:35       ` Mark Rutland
2014-07-30 18:14   ` Olof Johansson
2014-07-30 18:14     ` Olof Johansson
2014-07-30 18:14     ` Olof Johansson
2014-08-01 16:18     ` Robert Richter
2014-08-01 16:18       ` Robert Richter
2014-08-01 16:18       ` Robert Richter
2014-08-28 16:15     ` Robert Richter
2014-08-28 16:15       ` Robert Richter
2014-08-28 16:15       ` Robert Richter
2014-08-28 16:25       ` Mark Rutland
2014-08-28 16:25         ` Mark Rutland
2014-08-28 16:25         ` Mark Rutland
2014-08-28 16:31         ` Olof Johansson
2014-08-28 16:31           ` Olof Johansson
2014-08-28 16:31           ` Olof Johansson
2014-08-28 18:14           ` Robert Richter
2014-08-28 18:14             ` Robert Richter
2014-08-28 18:14             ` Robert Richter
2014-08-28 23:01             ` Olof Johansson
2014-08-28 23:01               ` Olof Johansson
2014-08-28 23:01               ` Olof Johansson
2014-08-29 12:10               ` Robert Richter
2014-08-29 12:10                 ` Robert Richter
2014-08-29 12:10                 ` Robert Richter
2014-08-29 13:49                 ` [PATCH] arm64, dts: Add dtbs_install make target Robert Richter
2014-08-29 13:49                   ` Robert Richter
2014-08-29 13:49                   ` Robert Richter
2014-09-05  6:55                   ` Robert Richter
2014-09-05  6:55                     ` Robert Richter
2014-09-05  6:55                     ` Robert Richter
2014-07-31 10:24   ` [PATCH 2/5] arm64, thunder: Add initial dts for Cavium Thunder SoC Arnd Bergmann
2014-07-31 10:24     ` Arnd Bergmann
2014-07-31 10:24     ` Arnd Bergmann
2014-07-31 11:33     ` Robert Richter
2014-07-31 11:33       ` Robert Richter
2014-07-31 11:33       ` Robert Richter
2014-07-30 15:06 ` [PATCH 3/5] arm64, thunder: document devicetree bindings " Robert Richter
2014-07-30 15:06   ` Robert Richter
2014-07-30 15:06   ` Robert Richter
2014-07-30 15:06 ` [PATCH 4/5] arm64, defconfig: Enable Cavium Thunder SoC in defconfig Robert Richter
2014-07-30 15:06   ` Robert Richter
2014-07-30 15:06 ` [PATCH 5/5] arm64, defconfig: Enable tmpfs mount option Robert Richter
2014-07-30 15:06   ` Robert Richter

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=20140730174803.GF20162@leverpostej \
    --to=mark.rutland@arm.com \
    --cc=Catalin.Marinas@arm.com \
    --cc=Pawel.Moll@arm.com \
    --cc=Will.Deacon@arm.com \
    --cc=arnd@arndb.de \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rchintakuntla@cavium.com \
    --cc=robh+dt@kernel.org \
    --cc=robherring2@gmail.com \
    --cc=rric@kernel.org \
    --cc=rrichter@cavium.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.