Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] drivers: psci: PSCI checker module
From: Lorenzo Pieralisi @ 2016-10-26 17:35 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20161026172252.GV3716@linux.vnet.ibm.com>

On Wed, Oct 26, 2016 at 10:22:52AM -0700, Paul E. McKenney wrote:
> On Wed, Oct 26, 2016 at 06:10:06PM +0100, Lorenzo Pieralisi wrote:
> > On Wed, Oct 26, 2016 at 08:18:58AM -0700, Paul E. McKenney wrote:
> > > On Wed, Oct 26, 2016 at 02:17:52PM +0100, Lorenzo Pieralisi wrote:
> > > > On Tue, Oct 25, 2016 at 11:34:36AM -0700, Paul E. McKenney wrote:
> > > > 
> > > > [...]
> > > > 
> > > > > > > +static int __init psci_checker(void)
> > > > > > > +{
> > > > > > > +	int ret;
> > > > > > > +
> > > > > > > +	/*
> > > > > > > +	 * Since we're in an initcall, we assume that all the CPUs that all
> > > > > > > +	 * CPUs that can be onlined have been onlined.
> > > > > > > +	 *
> > > > > > > +	 * The tests assume that hotplug is enabled but nobody else is using it,
> > > > > > > +	 * otherwise the results will be unpredictable. However, since there
> > > > > > > +	 * is no userspace yet in initcalls, that should be fine.
> > > > > > 
> > > > > > I do not think it is. If you run a kernel with, say,
> > > > > > CONFIG_LOCK_TORTURE_TEST, cpus may disappear from the radar while
> > > > > > running the PSCI checker test itself; that at least would confuse the
> > > > > > checker, and that's just an example.
> > > > > > 
> > > > > > I added Paul to check what are the assumptions behind the torture test
> > > > > > hotplug tests, in particular if there are any implicit assumptions for
> > > > > > it to work (ie it is the only kernel test hotplugging cpus in and out
> > > > > > (?)), what I know is that the PSCI checker assumptions are not correct.
> > > > > 
> > > > > Both CONFIG_LOCK_TORTURE_TEST and CONFIG_RCU_TORTURE_TEST can and will
> > > > > hotplug CPUs.  The locktorture.onoff_holdoff and rcutorture.onoff_holdoff
> > > > > kernel parameters can delay the start of CPU-hotplug testing, and in
> > > > > my testing I set this delay to 30 seconds after boot.
> > > > > 
> > > > > One approach would be to make your test refuse to run if either of
> > > > > the lock/RCU torture tests was running.  Or do what Lorenzo suggests
> > > > > below.  The torture tests aren't crazy enough to offline the last CPU.
> > > > > Though they do try, just for effect, in cases where the last CPU is
> > > > > marked cpu_is_hotpluggable().  ;-)
> > > > 
> > > > Thank you Paul. I have an additional question though. Is there any
> > > > implicit assumption in LOCK/RCU torture tests whereby nothing else
> > > > in the kernel is hotplugging cpus in/out (through cpu_down()/up())
> > > > while they are running ?
> > > > 
> > > > I am asking because that's the main reason behind my query. Those tests
> > > > hotplug cpus in and out through cpu_down/up() but AFAICS nothing
> > > > prevents another piece of code in the kernel to call those functions and
> > > > the tests may just fail in that case (ie trying to cpu_down() a cpu
> > > > that is not online).
> > > > 
> > > > Are false negatives contemplated (or I am missing something) ?
> > > 
> > > The current code assumes nothing else doing CPU-hotplug operations,
> > > and will therefore print "RCU_HOTPLUG" error (or "LOCK_HOTPLUG" for
> > > locktorture) if any of the hotplug operations failed.
> > > 
> > > > I just would like to understand if what this patch currently does
> > > > is safe and sound. I think that calling cpu_down() and cpu_up()
> > > > is always safe, but the test can result in false negatives if
> > > > other kernel subsystems (eg LOCK torture test) are calling those
> > > > APIs in parallel (because cpu_down()/cpu_up() calls can fail - eg
> > > > trying to cpu_down() a cpu that is not online any longer, since it
> > > > was taken down by another kernel control path), that's the question
> > > > I have.
> > > 
> > > I am assuming that these added calls to cpu_down() and cpu_up() aren't
> > > enabled by default.  If they are, rcutorture and locktorture need some
> > > way to turn the off.
> > > 
> > > So maybe we need to have some sort of API that detects concurrent
> > > CPU-hotplug torturing?  Maybe something like the following?
> > > 
> > > 	static atomic_t n_cpu_hotplug_torturers;
> > > 	static atomic_t cpu_hotplug_concurrent_torture;
> > > 
> > > 	void torture_start_cpu_hotplug(void)
> > > 	{
> > > 		if (atomic_inc_return(&n_cpu_hotplug_torturers) > 1)
> > > 			atomic_inc(&cpu_hotplug_concurrent_torture);
> > > 	}
> > > 
> > > 	void torture_end_cpu_hotplug(void)
> > > 	{
> > > 		atomic_dec(&n_cpu_hotplug_torturers);
> > > 	}
> > > 
> > > 	bool torture_cpu_hotplug_was_concurrent(void)
> > > 	{
> > > 		return !!atomic_read(&cpu_hotplug_concurrent_torture);
> > > 	}
> > > 
> > > The locktorture and rcutorture code could then ignore CPU-hotplug
> > > errors that could be caused by concurrent access.  And complain
> > > bitterly about the concurrent access, of course!  ;-)
> > 
> > This could do, even better if we extend the torture hotplug tests to
> > take a cpumask so that basically Kevin's patch will be based on torture
> > hotplug tests infrastructure :D (ie he/we wanted to hotplug a subset of
> > the online mask corresponding to a "cluster" of cpus, that's to test the
> > PSCI CPU ON/OFF firmware interface behind cpu hotplug operations).
> > 
> > Still, this implies logging every possible cpu_down()/cpu_up() caller
> > through torture_start_cpu_hotplug().
> > 
> > What about userspace and sysfs interface that allow to offline cpus then ?
> > Point is, the torture hotplug tests take a snapshot of the maxcpu at
> > kthread init time and then randomize the logical cpu number, but it is
> > definitely possible unless I am mistaken that some of those cpus
> > disappear while the test is running and this will cause failures that
> > you can't detect through the API above.
> > 
> > That's why I suggested using the:
> > 
> > freeze_secondary_cpus(int primary);
> > 
> > for this patch because that allows us to quiesce all cpus other than
> > primary at once, with no interference possible from other kernel control
> > paths (but it is not a perfect solution either).
> > 
> > Userspace notwithstanding, I think the best solution consists in either
> > making this patch hotplug tests work on top of the torture hotplug tests
> > API or solving the dependency at kconfig level by disabling the PSCI
> > checker if any of torture tests are enabled which is not ideal but
> > I do not see any other option.
> > 
> > Thanks a lot for your feedback, thoughts appreciated.
> 
> Let me ask the question more directly.
> 
> Why on earth are we trying to run these tests concurrently?

We must prevent that, no question about that, that's why I started
this discussion. It is not fine to enable this checker and the
RCU/LOCK torture hotplug tests at the same time.

> After all, if we just run one at a time in isolation, there is no
> problem.

Fine by me, it was to understand if the current assumptions we made
are correct and they are definitely not. If we enable the PSCI checker
we must disable the torture rcu/lock hotplug tests either statically or
dynamically.

Thanks,
Lorenz

^ permalink raw reply

* [PATCH 2/2] clk: uniphier: add clock data for cpufreq
From: Masahiro Yamada @ 2016-10-26 17:31 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1477503088-26508-1-git-send-email-yamada.masahiro@socionext.com>

Data needed for CPU-gear change (cpufreq).

Note:
At this moment, some clock data for Pro5/Pxs2 (32bit SoCs) are
a bit faked because clock rates greater than LONG_MAX (~2.15 GHz)
must be avoided on 32 bit systems.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

I raised a flag in the following post:
https://www.spinics.net/lists/kernel/msg2361374.html

I have not had any comments.
Anyway, I am moving forward.
I can fix the data arrays to reflect the real
clock topology.


 drivers/clk/uniphier/clk-uniphier-sys.c | 111 ++++++++++++++++++++++++++++++++
 drivers/clk/uniphier/clk-uniphier.h     |  35 +++++++++-
 2 files changed, 145 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/uniphier/clk-uniphier-sys.c b/drivers/clk/uniphier/clk-uniphier-sys.c
index 5d02999..74ab179 100644
--- a/drivers/clk/uniphier/clk-uniphier-sys.c
+++ b/drivers/clk/uniphier/clk-uniphier-sys.c
@@ -41,6 +41,19 @@
 #define UNIPHIER_PRO4_SYS_CLK_USB3(idx, ch)				\
 	UNIPHIER_CLK_GATE("usb3" #ch, (idx), NULL, 0x2104, 16 + (ch))
 
+#define UNIPHIER_PRO5_SYS_CPUGEARS					\
+	UNIPHIER_CLK_DIV8("cpll", 2, 3, 4, 6, 8, 12, 16, 24),		\
+	UNIPHIER_CLK_DIV8("spll", 2, 3, 4, 6, 8, 12, 16, 24),		\
+	UNIPHIER_CLK_DIV8("ippll", 2, 3, 4, 6, 8, 12, 16, 24),		\
+	UNIPHIER_CLK_CPUGEAR("cpu-ca9", 32, 0x8000, 0x1f, 16,		\
+			     "cpll/2", "spll/2", "cpll/3", "spll/3",	\
+			     "cpll/4", "spll/4", "cpll/6", "spll/6",	\
+			     "cpll/8", "spll/8", "cpll/12", "spll/12",	\
+			     "cpll/16", "spll/16", "cpll/24", "spll/24"),\
+	UNIPHIER_CLK_CPUGEAR("cpu-ipp", 34, 0x8100, 0xf, 8,		\
+			     "ippll/2", "spll/2", "ippll/3", "spll/3",	\
+			     "spll/4", "spll/8", "ippll/4", "ippll/8")
+
 const struct uniphier_clk_data uniphier_sld3_sys_clk_data[] = {
 	UNIPHIER_CLK_FACTOR("spll", -1, "ref", 65, 1),		/* 1597.44 MHz */
 	UNIPHIER_CLK_FACTOR("upll", -1, "ref", 6000, 512),	/* 288 MHz */
@@ -96,6 +109,8 @@
 };
 
 const struct uniphier_clk_data uniphier_pro5_sys_clk_data[] = {
+	UNIPHIER_CLK_FACTOR("cpll", -1, "ref", 140, 1),		/* 2800 MHz */
+	UNIPHIER_CLK_FACTOR("ippll", -1, "ref", 130, 1),	/* 2600 MHz */
 	UNIPHIER_CLK_FACTOR("spll", -1, "ref", 120, 1),		/* 2400 MHz */
 	UNIPHIER_CLK_FACTOR("dapll1", -1, "ref", 128, 1),	/* 2560 MHz */
 	UNIPHIER_CLK_FACTOR("dapll2", -1, "ref", 144, 125),	/* 2949.12 MHz */
@@ -106,10 +121,43 @@
 	UNIPHIER_PRO4_SYS_CLK_GIO(12),				/* PCIe, USB3 */
 	UNIPHIER_PRO4_SYS_CLK_USB3(14, 0),
 	UNIPHIER_PRO4_SYS_CLK_USB3(15, 1),
+#if 1
+	/*
+	 * TODO:
+	 * The return type of .round_rate() is "long", which is 32 bit wide on
+	 * 32 bit systems.  Clock rate greater than LONG_MAX (~ 2.15 GHz) is
+	 * treated as an error.  Needs a workaround until the problem is fixed.
+	 */
+	UNIPHIER_CLK_FACTOR("cpll/2", -1, "ref", 70, 1),
+	UNIPHIER_CLK_FACTOR("cpll/3", -1, "ref", 140, 3),
+	UNIPHIER_CLK_FACTOR("cpll/4", -1, "ref", 35, 1),
+	UNIPHIER_CLK_FACTOR("cpll/6", -1, "ref", 70, 3),
+	UNIPHIER_CLK_FACTOR("cpll/8", -1, "ref", 35, 2),
+	UNIPHIER_CLK_FACTOR("cpll/12", -1, "ref", 35, 3),
+	UNIPHIER_CLK_FACTOR("cpll/16", -1, "ref", 35, 4),
+	UNIPHIER_CLK_FACTOR("cpll/24", -1, "ref", 35, 6),
+	UNIPHIER_CLK_FACTOR("spll/2", -1, "ref", 60, 1),
+	UNIPHIER_CLK_FACTOR("spll/3", -1, "ref", 40, 1),
+	UNIPHIER_CLK_FACTOR("spll/4", -1, "ref", 30, 1),
+	UNIPHIER_CLK_FACTOR("spll/6", -1, "ref", 20, 1),
+	UNIPHIER_CLK_FACTOR("spll/8", -1, "ref", 15, 1),
+	UNIPHIER_CLK_FACTOR("spll/12", -1, "ref", 10, 1),
+	UNIPHIER_CLK_FACTOR("spll/16", -1, "ref", 15, 2),
+	UNIPHIER_CLK_FACTOR("spll/24", -1, "ref", 5, 1),
+	UNIPHIER_CLK_CPUGEAR("cpu-ca9", 32, 0x8000, 0x1f, 16,
+			     "cpll/2", "spll/2", "cpll/3", "spll/3",
+			     "cpll/4", "spll/4", "cpll/6", "spll/6",
+			     "cpll/8", "spll/8", "cpll/12", "spll/12",
+			     "cpll/16", "spll/16", "cpll/24", "spll/24"),
+#else
+	UNIPHIER_PRO5_SYS_CPUGEARS,
+#endif
 	{ /* sentinel */ }
 };
 
 const struct uniphier_clk_data uniphier_pxs2_sys_clk_data[] = {
+	UNIPHIER_CLK_FACTOR("cpll", -1, "ref", 96, 1),		/* 2400 MHz */
+	UNIPHIER_CLK_FACTOR("ippll", -1, "ref", 96, 1),		/* 2400 MHz */
 	UNIPHIER_CLK_FACTOR("spll", -1, "ref", 96, 1),		/* 2400 MHz */
 	UNIPHIER_CLK_FACTOR("uart", 0, "spll", 1, 27),
 	UNIPHIER_CLK_FACTOR("i2c", 1, "spll", 1, 48),
@@ -121,20 +169,70 @@
 	/* The document mentions 0x2104 bit 18, but not functional */
 	UNIPHIER_CLK_GATE("usb30-phy", 16, NULL, 0x2104, 19),
 	UNIPHIER_CLK_GATE("usb31-phy", 20, NULL, 0x2104, 20),
+#if 1
+	/*
+	 * TODO:
+	 * The return type of .round_rate() is "long", which is 32 bit wide on
+	 * 32 bit systems.  Clock rate greater than LONG_MAX (~ 2.15 GHz) is
+	 * treated as an error.  Needs a workaround until the problem is fixed.
+	 */
+	UNIPHIER_CLK_FACTOR("cpll/2", -1, "ref", 48, 1),
+	UNIPHIER_CLK_FACTOR("cpll/3", -1, "ref", 32, 1),
+	UNIPHIER_CLK_FACTOR("cpll/4", -1, "ref", 24, 1),
+	UNIPHIER_CLK_FACTOR("cpll/6", -1, "ref", 16, 1),
+	UNIPHIER_CLK_FACTOR("cpll/8", -1, "ref", 12, 1),
+	UNIPHIER_CLK_FACTOR("cpll/12", -1, "ref", 8, 1),
+	UNIPHIER_CLK_FACTOR("cpll/16", -1, "ref", 6, 1),
+	UNIPHIER_CLK_FACTOR("cpll/24", -1, "ref", 4, 1),
+	UNIPHIER_CLK_FACTOR("spll/2", -1, "ref", 48, 1),
+	UNIPHIER_CLK_FACTOR("spll/3", -1, "ref", 32, 1),
+	UNIPHIER_CLK_FACTOR("spll/4", -1, "ref", 24, 1),
+	UNIPHIER_CLK_FACTOR("spll/6", -1, "ref", 16, 1),
+	UNIPHIER_CLK_FACTOR("spll/8", -1, "ref", 12, 1),
+	UNIPHIER_CLK_FACTOR("spll/12", -1, "ref", 8, 1),
+	UNIPHIER_CLK_FACTOR("spll/16", -1, "ref", 6, 1),
+	UNIPHIER_CLK_FACTOR("spll/24", -1, "ref", 4, 1),
+	UNIPHIER_CLK_CPUGEAR("cpu-ca9", 32, 0x8000, 0x1f, 16,
+			     "cpll/2", "spll/2", "cpll/3", "spll/3",
+			     "cpll/4", "spll/4", "cpll/6", "spll/6",
+			     "cpll/8", "spll/8", "cpll/12", "spll/12",
+			     "cpll/16", "spll/16", "cpll/24", "spll/24"),
+#else
+	UNIPHIER_PRO5_SYS_CPUGEARS,
+#endif
 	{ /* sentinel */ }
 };
 
 const struct uniphier_clk_data uniphier_ld11_sys_clk_data[] = {
+	UNIPHIER_CLK_FACTOR("cpll", -1, "ref", 392, 5),		/* 1960 MHz */
+	UNIPHIER_CLK_FACTOR("mpll", -1, "ref", 64, 1),		/* 1600 MHz */
 	UNIPHIER_CLK_FACTOR("spll", -1, "ref", 80, 1),		/* 2000 MHz */
+	UNIPHIER_CLK_FACTOR("vspll", -1, "ref", 80, 1),		/* 2000 MHz */
 	UNIPHIER_CLK_FACTOR("uart", 0, "spll", 1, 34),
 	UNIPHIER_CLK_FACTOR("i2c", 1, "spll", 1, 40),
 	UNIPHIER_LD11_SYS_CLK_STDMAC(8),			/* HSC, MIO */
 	UNIPHIER_CLK_FACTOR("usb2", -1, "ref", 24, 25),
+	/* CPU gears */
+	UNIPHIER_CLK_DIV4("cpll", 2, 3, 4, 8),
+	UNIPHIER_CLK_DIV4("mpll", 2, 3, 4, 8),
+	UNIPHIER_CLK_DIV3("spll", 3, 4, 8),
+	/* Note: both gear1 and gear4 are spll/4.  This is not a bug. */
+	UNIPHIER_CLK_CPUGEAR("cpu-ca53", 33, 0x8080, 0xf, 8,
+			     "cpll/2", "spll/4", "cpll/3", "spll/3",
+			     "spll/4", "spll/8", "cpll/4", "cpll/8"),
+	UNIPHIER_CLK_CPUGEAR("cpu-ipp", 34, 0x8100, 0xf, 8,
+			     "mpll/2", "spll/4", "mpll/3", "spll/3",
+			     "spll/4", "spll/8", "mpll/4", "mpll/8"),
 	{ /* sentinel */ }
 };
 
 const struct uniphier_clk_data uniphier_ld20_sys_clk_data[] = {
+	UNIPHIER_CLK_FACTOR("cpll", -1, "ref", 88, 1),		/* ARM: 2200 MHz */
+	UNIPHIER_CLK_FACTOR("gppll", -1, "ref", 52, 1),		/* Mali: 1300 MHz */
+	UNIPHIER_CLK_FACTOR("mpll", -1, "ref", 64, 1),		/* Codec: 1600 MHz */
 	UNIPHIER_CLK_FACTOR("spll", -1, "ref", 80, 1),		/* 2000 MHz */
+	UNIPHIER_CLK_FACTOR("s2pll", -1, "ref", 88, 1),		/* IPP: 2200 MHz */
+	UNIPHIER_CLK_FACTOR("vppll", -1, "ref", 504, 5),	/* 2520 MHz */
 	UNIPHIER_CLK_FACTOR("uart", 0, "spll", 1, 34),
 	UNIPHIER_CLK_FACTOR("i2c", 1, "spll", 1, 40),
 	UNIPHIER_LD20_SYS_CLK_SD,
@@ -147,5 +245,18 @@
 	UNIPHIER_CLK_GATE("usb30", 14, NULL, 0x210c, 14),
 	UNIPHIER_CLK_GATE("usb30-phy0", 16, NULL, 0x210c, 12),
 	UNIPHIER_CLK_GATE("usb30-phy1", 17, NULL, 0x210c, 13),
+	/* CPU gears */
+	UNIPHIER_CLK_DIV4("cpll", 2, 3, 4, 8),
+	UNIPHIER_CLK_DIV4("spll", 2, 3, 4, 8),
+	UNIPHIER_CLK_DIV4("s2pll", 2, 3, 4, 8),
+	UNIPHIER_CLK_CPUGEAR("cpu-ca72", 32, 0x8000, 0xf, 8,
+			     "cpll/2", "spll/2", "cpll/3", "spll/3",
+			     "spll/4", "spll/8", "cpll/4", "cpll/8"),
+	UNIPHIER_CLK_CPUGEAR("cpu-ca53", 33, 0x8080, 0xf, 8,
+			     "cpll/2", "spll/2", "cpll/3", "spll/3",
+			     "spll/4", "spll/8", "cpll/4", "cpll/8"),
+	UNIPHIER_CLK_CPUGEAR("cpu-ipp", 34, 0x8100, 0xf, 8,
+			     "s2pll/2", "spll/2", "s2pll/3", "spll/3",
+			     "spll/4", "spll/8", "s2pll/4", "s2pll/8"),
 	{ /* sentinel */ }
 };
diff --git a/drivers/clk/uniphier/clk-uniphier.h b/drivers/clk/uniphier/clk-uniphier.h
index 9707b0f..849824a 100644
--- a/drivers/clk/uniphier/clk-uniphier.h
+++ b/drivers/clk/uniphier/clk-uniphier.h
@@ -75,6 +75,20 @@ struct uniphier_clk_data {
 	} data;
 };
 
+#define UNIPHIER_CLK_CPUGEAR(_name, _idx, _regbase, _mask,	\
+			     _num_parents, ...)			\
+	{							\
+		.name = (_name),				\
+		.type = UNIPHIER_CLK_TYPE_CPUGEAR,		\
+		.idx = (_idx),					\
+		.data.cpugear = {				\
+			.parent_names = { __VA_ARGS__ },	\
+			.num_parents = (_num_parents),		\
+			.regbase = (_regbase),			\
+			.mask = (_mask)				\
+		 },						\
+	}
+
 #define UNIPHIER_CLK_FACTOR(_name, _idx, _parent, _mult, _div)	\
 	{							\
 		.name = (_name),				\
@@ -87,7 +101,6 @@ struct uniphier_clk_data {
 		},						\
 	}
 
-
 #define UNIPHIER_CLK_GATE(_name, _idx, _parent, _reg, _bit)	\
 	{							\
 		.name = (_name),				\
@@ -100,6 +113,26 @@ struct uniphier_clk_data {
 		},						\
 	}
 
+#define UNIPHIER_CLK_DIV(parent, div)				\
+	UNIPHIER_CLK_FACTOR(parent "/" #div, -1, parent, 1, div)
+
+#define UNIPHIER_CLK_DIV2(parent, div0, div1)			\
+	UNIPHIER_CLK_DIV(parent, div0),				\
+	UNIPHIER_CLK_DIV(parent, div1)
+
+#define UNIPHIER_CLK_DIV3(parent, div0, div1, div2)		\
+	UNIPHIER_CLK_DIV2(parent, div0, div1),			\
+	UNIPHIER_CLK_DIV(parent, div2)
+
+#define UNIPHIER_CLK_DIV4(parent, div0, div1, div2, div3)	\
+	UNIPHIER_CLK_DIV2(parent, div0, div1),			\
+	UNIPHIER_CLK_DIV2(parent, div2, div3)
+
+#define UNIPHIER_CLK_DIV8(parent, div0, div1, div2, div3,	\
+			  div4, div5, div6, div7)		\
+	UNIPHIER_CLK_DIV4(parent, div0, div1, div2, div3),	\
+	UNIPHIER_CLK_DIV4(parent, div4, div5, div6, div7)
+
 struct clk_hw *uniphier_clk_register_cpugear(struct device *dev,
 					     struct regmap *regmap,
 					     const char *name,
-- 
1.9.1

^ permalink raw reply related

* [PATCH 1/2] clk: uniphier: add CPU-gear change (cpufreq) support
From: Masahiro Yamada @ 2016-10-26 17:31 UTC (permalink / raw)
  To: linux-arm-kernel

Core support code for CPU frequency changes, which will be used by
the generic cpufreq driver.

The register view is different from the generic clk-mux; it has
a separate status register, and an update bit to load the register
setting.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 drivers/clk/uniphier/Makefile               |   3 +
 drivers/clk/uniphier/clk-uniphier-core.c    |   3 +
 drivers/clk/uniphier/clk-uniphier-cpugear.c | 115 ++++++++++++++++++++++++++++
 drivers/clk/uniphier/clk-uniphier.h         |  17 +++-
 4 files changed, 136 insertions(+), 2 deletions(-)
 create mode 100644 drivers/clk/uniphier/clk-uniphier-cpugear.c

diff --git a/drivers/clk/uniphier/Makefile b/drivers/clk/uniphier/Makefile
index f27b3603..665d1d6 100644
--- a/drivers/clk/uniphier/Makefile
+++ b/drivers/clk/uniphier/Makefile
@@ -1,8 +1,11 @@
 obj-y	+= clk-uniphier-core.o
+
+obj-y	+= clk-uniphier-cpugear.o
 obj-y	+= clk-uniphier-fixed-factor.o
 obj-y	+= clk-uniphier-fixed-rate.o
 obj-y	+= clk-uniphier-gate.o
 obj-y	+= clk-uniphier-mux.o
+
 obj-y	+= clk-uniphier-sys.o
 obj-y	+= clk-uniphier-mio.o
 obj-y	+= clk-uniphier-peri.o
diff --git a/drivers/clk/uniphier/clk-uniphier-core.c b/drivers/clk/uniphier/clk-uniphier-core.c
index 26c53f7..0007218 100644
--- a/drivers/clk/uniphier/clk-uniphier-core.c
+++ b/drivers/clk/uniphier/clk-uniphier-core.c
@@ -27,6 +27,9 @@ static struct clk_hw *uniphier_clk_register(struct device *dev,
 					const struct uniphier_clk_data *data)
 {
 	switch (data->type) {
+	case UNIPHIER_CLK_TYPE_CPUGEAR:
+		return uniphier_clk_register_cpugear(dev, regmap, data->name,
+						     &data->data.cpugear);
 	case UNIPHIER_CLK_TYPE_FIXED_FACTOR:
 		return uniphier_clk_register_fixed_factor(dev, data->name,
 							  &data->data.factor);
diff --git a/drivers/clk/uniphier/clk-uniphier-cpugear.c b/drivers/clk/uniphier/clk-uniphier-cpugear.c
new file mode 100644
index 0000000..9bff26e
--- /dev/null
+++ b/drivers/clk/uniphier/clk-uniphier-cpugear.c
@@ -0,0 +1,115 @@
+/*
+ * Copyright (C) 2016 Socionext Inc.
+ *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/clk-provider.h>
+#include <linux/delay.h>
+#include <linux/device.h>
+#include <linux/regmap.h>
+
+#include "clk-uniphier.h"
+
+#define UNIPHIER_CLK_CPUGEAR_STAT	0	/* status */
+#define UNIPHIER_CLK_CPUGEAR_SET	4	/* set */
+#define UNIPHIER_CLK_CPUGEAR_UPD	8	/* update */
+#define   UNIPHIER_CLK_CPUGEAR_UPD_BIT	BIT(0)
+
+struct uniphier_clk_cpugear {
+	struct clk_hw hw;
+	struct regmap *regmap;
+	unsigned int regbase;
+	unsigned int mask;
+};
+
+#define to_uniphier_clk_cpugear(_hw) \
+			container_of(_hw, struct uniphier_clk_cpugear, hw)
+
+static int uniphier_clk_cpugear_set_parent(struct clk_hw *hw, u8 index)
+{
+	struct uniphier_clk_cpugear *gear = to_uniphier_clk_cpugear(hw);
+	int ret;
+	unsigned int val;
+
+	ret = regmap_write_bits(gear->regmap,
+				gear->regbase + UNIPHIER_CLK_CPUGEAR_SET,
+				gear->mask, index);
+	if (ret)
+		return ret;
+
+	ret = regmap_write_bits(gear->regmap,
+				gear->regbase + UNIPHIER_CLK_CPUGEAR_SET,
+				UNIPHIER_CLK_CPUGEAR_UPD_BIT,
+				UNIPHIER_CLK_CPUGEAR_UPD_BIT);
+	if (ret)
+		return ret;
+
+	return regmap_read_poll_timeout(gear->regmap,
+				gear->regbase + UNIPHIER_CLK_CPUGEAR_UPD,
+				val, !(val & UNIPHIER_CLK_CPUGEAR_UPD_BIT),
+				0, 1);
+}
+
+static u8 uniphier_clk_cpugear_get_parent(struct clk_hw *hw)
+{
+	struct uniphier_clk_cpugear *gear = to_uniphier_clk_cpugear(hw);
+	int num_parents = clk_hw_get_num_parents(hw);
+	int ret;
+	unsigned int val;
+
+	ret = regmap_read(gear->regmap,
+			  gear->regbase + UNIPHIER_CLK_CPUGEAR_STAT, &val);
+	if (ret)
+		return ret;
+
+	val &= gear->mask;
+
+	return val < num_parents ? val : -EINVAL;
+}
+
+static const struct clk_ops uniphier_clk_cpugear_ops = {
+	.determine_rate = __clk_mux_determine_rate,
+	.set_parent = uniphier_clk_cpugear_set_parent,
+	.get_parent = uniphier_clk_cpugear_get_parent,
+};
+
+struct clk_hw *uniphier_clk_register_cpugear(struct device *dev,
+					 struct regmap *regmap,
+					 const char *name,
+				const struct uniphier_clk_cpugear_data *data)
+{
+	struct uniphier_clk_cpugear *gear;
+	struct clk_init_data init;
+	int ret;
+
+	gear = devm_kzalloc(dev, sizeof(*gear), GFP_KERNEL);
+	if (!gear)
+		return ERR_PTR(-ENOMEM);
+
+	init.name = name;
+	init.ops = &uniphier_clk_cpugear_ops;
+	init.flags = CLK_SET_RATE_PARENT;
+	init.parent_names = data->parent_names;
+	init.num_parents = data->num_parents,
+
+	gear->regmap = regmap;
+	gear->regbase = data->regbase;
+	gear->mask = data->mask;
+	gear->hw.init = &init;
+
+	ret = devm_clk_hw_register(dev, &gear->hw);
+	if (ret)
+		return ERR_PTR(ret);
+
+	return &gear->hw;
+}
diff --git a/drivers/clk/uniphier/clk-uniphier.h b/drivers/clk/uniphier/clk-uniphier.h
index 0244dba..9707b0f 100644
--- a/drivers/clk/uniphier/clk-uniphier.h
+++ b/drivers/clk/uniphier/clk-uniphier.h
@@ -20,15 +20,24 @@
 struct device;
 struct regmap;
 
-#define UNIPHIER_CLK_MUX_MAX_PARENTS	8
+#define UNIPHIER_CLK_CPUGEAR_MAX_PARENTS	16
+#define UNIPHIER_CLK_MUX_MAX_PARENTS		8
 
 enum uniphier_clk_type {
+	UNIPHIER_CLK_TYPE_CPUGEAR,
 	UNIPHIER_CLK_TYPE_FIXED_FACTOR,
 	UNIPHIER_CLK_TYPE_FIXED_RATE,
 	UNIPHIER_CLK_TYPE_GATE,
 	UNIPHIER_CLK_TYPE_MUX,
 };
 
+struct uniphier_clk_cpugear_data {
+	const char *parent_names[UNIPHIER_CLK_CPUGEAR_MAX_PARENTS];
+	unsigned int num_parents;
+	unsigned int regbase;
+	unsigned int mask;
+};
+
 struct uniphier_clk_fixed_factor_data {
 	const char *parent_name;
 	unsigned int mult;
@@ -58,6 +67,7 @@ struct uniphier_clk_data {
 	enum uniphier_clk_type type;
 	int idx;
 	union {
+		struct uniphier_clk_cpugear_data cpugear;
 		struct uniphier_clk_fixed_factor_data factor;
 		struct uniphier_clk_fixed_rate_data rate;
 		struct uniphier_clk_gate_data gate;
@@ -90,7 +100,10 @@ struct uniphier_clk_data {
 		},						\
 	}
 
-
+struct clk_hw *uniphier_clk_register_cpugear(struct device *dev,
+					     struct regmap *regmap,
+					     const char *name,
+				const struct uniphier_clk_cpugear_data *data);
 struct clk_hw *uniphier_clk_register_fixed_factor(struct device *dev,
 						  const char *name,
 			const struct uniphier_clk_fixed_factor_data *data);
-- 
1.9.1

^ permalink raw reply related

* [RFC PATCH 4/5] w1: add a callback to call slave when a new device is connected
From: Antoine Tenart @ 2016-10-26 17:30 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CANLsYkxfnF9-H9mawt3BWTgy5gjf8Qs3O6iSRGiLQ=8vfYACTQ@mail.gmail.com>

Hello Mathieu,

On Wed, Oct 26, 2016 at 10:42:28AM -0600, Mathieu Poirier wrote:
> On 26 October 2016 at 08:57, Antoine Tenart
> <antoine.tenart@free-electrons.com> wrote:
> >                 }
> > +               if (fops->callback) {
> > +                       err = fops->callback(sl);
> > +                       /*
> > +                        * Do not return an error as the slave driver correctly
> > +                        * probed.
> > +                        */
> 
> I don't get this part.  What's the point of calling a callback if a
> failure is not important - maybe I'm just missing something.
> 
> > +                       if (err)
> > +                               dev_err(&sl->dev,
> > +                                       "callback call failed. err=%d\n", err);
> > +               }

In our case it can be not that important: if we fail to apply an
overlay, we can still use the w1 interfaces to access the eeprom.

Anyway, all those errors weren't taken into account by the w1 framework
before (see my other patch). Also, the w1 patches are given for the
example and could be improved. Part of the reason is the w1 framework
itself :-)

Antoine

-- 
Antoine T?nart, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20161026/0499f6d0/attachment.sig>

^ permalink raw reply

* [PATCH 1/2] ARM: dma-mapping: Support cache sync after arm_dma_get_sgtable
From: Robin Murphy @ 2016-10-26 17:24 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1477501448-30915-2-git-send-email-thierry.escande@collabora.com>

On 26/10/16 18:04, Thierry Escande wrote:
> From: Heng-Ruey Hsu <henryhsu@chromium.org>
> 
> Currently arm_dma_sync_sg_* require dma_address to do cache sync. But
> dma address is set by map_sg(). We can't do cache sync after
> arm_dma_get_sgtable. The behavior is different from iommu_ops.
> 
> We don't have to get dma address in arm_dma_sync_sg_* and convert the
> address to physical address in arm_dma_sync_single_*. With this change
> sg_page() is used to get physical address and do sync directly.
> 
> Signed-off-by: Heng-Ruey Hsu <henryhsu@chromium.org>
> Tested-by: Heng-ruey Hsu <henryhsu@chromium.org>
> Reviewed-by: Tomasz Figa <tfiga@chromium.org>
> Signed-off-by: Thierry Escande <thierry.escande@collabora.com>
> ---
>  arch/arm/mm/dma-mapping.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
> index ab4f745..dc42ca6 100644
> --- a/arch/arm/mm/dma-mapping.c
> +++ b/arch/arm/mm/dma-mapping.c
> @@ -1120,13 +1120,11 @@ void arm_dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nents,
>  void arm_dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg,
>  			int nents, enum dma_data_direction dir)
>  {
> -	struct dma_map_ops *ops = get_dma_ops(dev);
>  	struct scatterlist *s;
>  	int i;
>  
>  	for_each_sg(sg, s, nents, i)
> -		ops->sync_single_for_cpu(dev, sg_dma_address(s), s->length,
> -					 dir);
> +		__dma_page_dev_to_cpu(sg_page(s), s->offset, s->length, dir);

This breaks dmabounce. The .sync_single_for_cpu implementation there is
non-trivial.

Robin.

>  }
>  
>  /**
> @@ -1139,13 +1137,11 @@ void arm_dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg,
>  void arm_dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg,
>  			int nents, enum dma_data_direction dir)
>  {
> -	struct dma_map_ops *ops = get_dma_ops(dev);
>  	struct scatterlist *s;
>  	int i;
>  
>  	for_each_sg(sg, s, nents, i)
> -		ops->sync_single_for_device(dev, sg_dma_address(s), s->length,
> -					    dir);
> +		__dma_page_cpu_to_dev(sg_page(s), s->offset, s->length, dir);
>  }
>  
>  /*
> 

^ permalink raw reply

* [PATCH v3] drivers: psci: PSCI checker module
From: Paul E. McKenney @ 2016-10-26 17:22 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20161026171006.GA16248@red-moon>

On Wed, Oct 26, 2016 at 06:10:06PM +0100, Lorenzo Pieralisi wrote:
> On Wed, Oct 26, 2016 at 08:18:58AM -0700, Paul E. McKenney wrote:
> > On Wed, Oct 26, 2016 at 02:17:52PM +0100, Lorenzo Pieralisi wrote:
> > > On Tue, Oct 25, 2016 at 11:34:36AM -0700, Paul E. McKenney wrote:
> > > 
> > > [...]
> > > 
> > > > > > +static int __init psci_checker(void)
> > > > > > +{
> > > > > > +	int ret;
> > > > > > +
> > > > > > +	/*
> > > > > > +	 * Since we're in an initcall, we assume that all the CPUs that all
> > > > > > +	 * CPUs that can be onlined have been onlined.
> > > > > > +	 *
> > > > > > +	 * The tests assume that hotplug is enabled but nobody else is using it,
> > > > > > +	 * otherwise the results will be unpredictable. However, since there
> > > > > > +	 * is no userspace yet in initcalls, that should be fine.
> > > > > 
> > > > > I do not think it is. If you run a kernel with, say,
> > > > > CONFIG_LOCK_TORTURE_TEST, cpus may disappear from the radar while
> > > > > running the PSCI checker test itself; that at least would confuse the
> > > > > checker, and that's just an example.
> > > > > 
> > > > > I added Paul to check what are the assumptions behind the torture test
> > > > > hotplug tests, in particular if there are any implicit assumptions for
> > > > > it to work (ie it is the only kernel test hotplugging cpus in and out
> > > > > (?)), what I know is that the PSCI checker assumptions are not correct.
> > > > 
> > > > Both CONFIG_LOCK_TORTURE_TEST and CONFIG_RCU_TORTURE_TEST can and will
> > > > hotplug CPUs.  The locktorture.onoff_holdoff and rcutorture.onoff_holdoff
> > > > kernel parameters can delay the start of CPU-hotplug testing, and in
> > > > my testing I set this delay to 30 seconds after boot.
> > > > 
> > > > One approach would be to make your test refuse to run if either of
> > > > the lock/RCU torture tests was running.  Or do what Lorenzo suggests
> > > > below.  The torture tests aren't crazy enough to offline the last CPU.
> > > > Though they do try, just for effect, in cases where the last CPU is
> > > > marked cpu_is_hotpluggable().  ;-)
> > > 
> > > Thank you Paul. I have an additional question though. Is there any
> > > implicit assumption in LOCK/RCU torture tests whereby nothing else
> > > in the kernel is hotplugging cpus in/out (through cpu_down()/up())
> > > while they are running ?
> > > 
> > > I am asking because that's the main reason behind my query. Those tests
> > > hotplug cpus in and out through cpu_down/up() but AFAICS nothing
> > > prevents another piece of code in the kernel to call those functions and
> > > the tests may just fail in that case (ie trying to cpu_down() a cpu
> > > that is not online).
> > > 
> > > Are false negatives contemplated (or I am missing something) ?
> > 
> > The current code assumes nothing else doing CPU-hotplug operations,
> > and will therefore print "RCU_HOTPLUG" error (or "LOCK_HOTPLUG" for
> > locktorture) if any of the hotplug operations failed.
> > 
> > > I just would like to understand if what this patch currently does
> > > is safe and sound. I think that calling cpu_down() and cpu_up()
> > > is always safe, but the test can result in false negatives if
> > > other kernel subsystems (eg LOCK torture test) are calling those
> > > APIs in parallel (because cpu_down()/cpu_up() calls can fail - eg
> > > trying to cpu_down() a cpu that is not online any longer, since it
> > > was taken down by another kernel control path), that's the question
> > > I have.
> > 
> > I am assuming that these added calls to cpu_down() and cpu_up() aren't
> > enabled by default.  If they are, rcutorture and locktorture need some
> > way to turn the off.
> > 
> > So maybe we need to have some sort of API that detects concurrent
> > CPU-hotplug torturing?  Maybe something like the following?
> > 
> > 	static atomic_t n_cpu_hotplug_torturers;
> > 	static atomic_t cpu_hotplug_concurrent_torture;
> > 
> > 	void torture_start_cpu_hotplug(void)
> > 	{
> > 		if (atomic_inc_return(&n_cpu_hotplug_torturers) > 1)
> > 			atomic_inc(&cpu_hotplug_concurrent_torture);
> > 	}
> > 
> > 	void torture_end_cpu_hotplug(void)
> > 	{
> > 		atomic_dec(&n_cpu_hotplug_torturers);
> > 	}
> > 
> > 	bool torture_cpu_hotplug_was_concurrent(void)
> > 	{
> > 		return !!atomic_read(&cpu_hotplug_concurrent_torture);
> > 	}
> > 
> > The locktorture and rcutorture code could then ignore CPU-hotplug
> > errors that could be caused by concurrent access.  And complain
> > bitterly about the concurrent access, of course!  ;-)
> 
> This could do, even better if we extend the torture hotplug tests to
> take a cpumask so that basically Kevin's patch will be based on torture
> hotplug tests infrastructure :D (ie he/we wanted to hotplug a subset of
> the online mask corresponding to a "cluster" of cpus, that's to test the
> PSCI CPU ON/OFF firmware interface behind cpu hotplug operations).
> 
> Still, this implies logging every possible cpu_down()/cpu_up() caller
> through torture_start_cpu_hotplug().
> 
> What about userspace and sysfs interface that allow to offline cpus then ?
> Point is, the torture hotplug tests take a snapshot of the maxcpu at
> kthread init time and then randomize the logical cpu number, but it is
> definitely possible unless I am mistaken that some of those cpus
> disappear while the test is running and this will cause failures that
> you can't detect through the API above.
> 
> That's why I suggested using the:
> 
> freeze_secondary_cpus(int primary);
> 
> for this patch because that allows us to quiesce all cpus other than
> primary at once, with no interference possible from other kernel control
> paths (but it is not a perfect solution either).
> 
> Userspace notwithstanding, I think the best solution consists in either
> making this patch hotplug tests work on top of the torture hotplug tests
> API or solving the dependency at kconfig level by disabling the PSCI
> checker if any of torture tests are enabled which is not ideal but
> I do not see any other option.
> 
> Thanks a lot for your feedback, thoughts appreciated.

Let me ask the question more directly.

Why on earth are we trying to run these tests concurrently?

After all, if we just run one at a time in isolation, there is no problem.

							Thanx, Paul

^ permalink raw reply

* [PATCH V3 0/8] IOMMU probe deferral support
From: Robin Murphy @ 2016-10-26 17:14 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <003a01d22f97$82534c70$86f9e550$@codeaurora.org>

On 26/10/16 15:44, Sricharan wrote:
> Hi Robin,
> 
>> On 04/10/16 18:03, Sricharan R wrote:
>>> Initial post from Laurent Pinchart[1]. This is
>>> series calls the dma ops configuration for the devices
>>> at a generic place so that it works for all busses.
>>> The dma_configure_ops for a device is now called during
>>> the device_attach callback just before the probe of the
>>> bus/driver is called. Similarly dma_deconfigure is called during
>>> device/driver_detach path.
>>>
>>>
>>> pci_bus_add_devices    (platform/amba)(_device_create/driver_register)
>>>        |                         |
>>> pci_bus_add_device     (device_add/driver_register)
>>>        |                         |
>>> device_attach           device_initial_probe
>>>        |                         |
>>> __device_attach_driver    __device_attach_driver
>>>        |
>>> driver_probe_device
>>>        |
>>> really_probe
>>>        |
>>> dma_configure
>>>
>>>  Similarly on the device/driver_unregister path __device_release_driver is
>>>  called which inturn calls dma_deconfigure.
>>>
>>>  If the ACPI bus code follows the same, we can add acpi_dma_configure
>>>  at the same place as of_dma_configure.
>>>
>>>  This series is based on the recently merged Generic DT bindings for
>>>  PCI IOMMUs and ARM SMMU from Robin Murphy robin.murphy at arm.com [2]
>>>
>>>  This time tested this with platform and pci device for probe deferral
>>>  and reprobe on arm64 based platform. There is an issue on the cleanup
>>>  path for arm64 though, where there is WARN_ON if the dma_ops is reset while
>>>  device is attached to an domain in arch_teardown_dma_ops.
>>>  But with iommu_groups created from the iommu driver, the device is always
>>>  attached to a domain/default_domain. So so the WARN has to be removed/handled
>>>  probably.
>>
>> I've finally got the chance to take a proper look at this series (sorry
>> for the delay). First up, with these patches on top of 4.9-rc2, my
>> little script for unbinding some PCI devices and rebinding them to VFIO
>> now goes horribly, horribly wrong.
>>
>> Robin.
>>
> 
>    Thanks for looking in to this.
>     I was trying to reproduce the below with a command like this in my setup.
> 
> echo 0002\:00\:00.0 >  /sys/bus/pci/devices/0002\:00\:000.0/driver/unbind0.0/driver/unbind
> echo 0x17cb 0x0104 > /sys/bus/pci/drivers/vfio-pci/new_id
> 
> But for me the unbind and reconfiguring/adding the iommus_ops to vfio-pci did
> succeed, although the WARN_ON in arch_teardown_dma_ops was there, that

Oh, yes, I hacked that out already to cut the noise down.

> could be suppresed.  The vfio_pci_probe was not going through because
>  the pci hdr_type was not PCI_HEADER_TYPE_NORMAL.
>  But anyways iommu unbind/rebind seemed to be going through.
> 
> If i can get what your script is doing, i can try that and see what happens.

---8<---
#!/bin/sh

#Juno Sky2, SATA
DEVICES='0000:08:00.0 0000:03:00.0'

for DEV in $DEVICES
do
	BUSDEV=/sys/bus/pci/devices/$DEV
	GROUP=$(basename $(readlink $BUSDEV/iommu_group))
	DRV=$(readlink -f $BUSDEV/driver)
	read VID < $BUSDEV/vendor
	read DID < $BUSDEV/device

	echo $DEV > $BUSDEV/driver/unbind
	echo $VID $DID > /sys/bus/pci/drivers/vfio-pci/new_id
done
# it would then goes on to launch kvmtool and rebind the original
# drivers afterwards, but that doesn't matter here
--->8---

The segfault doesn't always happen, but the kref warnings and the
vfio-pci driver failing to probe certainly do.

> 
> Regards,
>   Sricharan
> 
> 
> 
>> [   39.901592] iommu: Removing device 0000:08:00.0 from group 0

Yikes, on second look, that definitely shouldn't be happening.
Everything below is probably the resulting fallout.

Robin.

>> [   39.907383] ------------[ cut here ]------------
>> [   39.911969] WARNING: CPU: 0 PID: 174 at
>> arch/arm64/mm/dma-mapping.c:856 arch_teardown_dma_ops+0x48/0x68
>> [   39.921266] Modules linked in:
>> [   39.924290]
>> [   39.925766] CPU: 0 PID: 174 Comm: vfio Not tainted 4.9.0-rc2+ #1249
>> [   39.931967] Hardware name: ARM Juno development board (r1) (DT)
>> [   39.937826] task: ffffffc975ee9900 task.stack: ffffffc974d60000
>> [   39.943687] PC is at arch_teardown_dma_ops+0x48/0x68
>> [   39.948603] LR is at arch_teardown_dma_ops+0x34/0x68
>> [   39.953516] pc : [<ffffff80080948f8>] lr : [<ffffff80080948e4>]
>> pstate: 60000145
>> [   39.960834] sp : ffffffc974d63ca0
>> [   39.964112] x29: ffffffc974d63ca0 x28: ffffffc974d60000
>> [   39.969377] x27: ffffff80088a2000 x26: 0000000000000040
>> [   39.974642] x25: 0000000000000123 x24: ffffffc976a48918
>> [   39.979907] x23: ffffffc974d63eb8 x22: ffffff8008db7550
>> [   39.985171] x21: 000000000000000d x20: ffffffc9763e9b50
>> [   39.990435] x19: ffffffc9763f20a0 x18: 0000000000000010
>> [   39.995699] x17: 0000007f99c18018 x16: ffffff80080c0580
>> [   40.000964] x15: ffffff8008bb7000 x14: 000137c100013798
>> [   40.006228] x13: ffffffffff000000 x12: ffffffffffffffff
>> [   40.011492] x11: 0000000000000018 x10: 000000000000000d
>> [   40.016757] x9 : 0000000040000000 x8 : 0000000000210d00
>> [   40.022021] x7 : 00000049771bc000 x6 : 00000000001f17ed
>> [   40.027286] x5 : ffffff80084c4208 x4 : 0000000000000080
>> [   40.032551] x3 : ffffffc975ea9800 x2 : ffffffbf25d7aa50
>> [   40.037815] x1 : 0000000000000000 x0 : 0000000000000080
>> [   40.043078]
>> [   40.044549] ---[ end trace 35c1e743d6e6c035 ]---
>> [   40.049117] Call trace:
>> [   40.051537] Exception stack(0xffffffc974d63ad0 to 0xffffffc974d63c00)
>> [   40.057914] 3ac0:                                   ffffffc9763f20a0
>> 0000008000000000
>> [   40.065668] 3ae0: ffffffc974d63ca0 ffffff80080948f8 ffffffbf25d7aa40
>> ffffffc975ea9800
>> [   40.073421] 3b00: ffffffc974d60000 000000000002fc80 ffffffc976801e00
>> ffffffc974d60000
>> [   40.081175] 3b20: ffffff80084c4208 0000000000000040 ffffff80088a2000
>> ffffffc974d60000
>> [   40.088928] 3b40: ffffff80084caf78 ffffffc974d60000 ffffffc974d60000
>> ffffffc974d60000
>> [   40.096682] 3b60: ffffffc975ea9800 ffffffc974d60000 0000000000000080
>> 0000000000000000
>> [   40.104435] 3b80: ffffffbf25d7aa50 ffffffc975ea9800 0000000000000080
>> ffffff80084c4208
>> [   40.112188] 3ba0: 00000000001f17ed 00000049771bc000 0000000000210d00
>> 0000000040000000
>> [   40.119941] 3bc0: 000000000000000d 0000000000000018 ffffffffffffffff
>> ffffffffff000000
>> [   40.127695] 3be0: 000137c100013798 ffffff8008bb7000 ffffff80080c0580
>> 0000007f99c18018
>> [   40.135450] [<ffffff80080948f8>] arch_teardown_dma_ops+0x48/0x68
>> [   40.141400] [<ffffff8008764a14>] of_dma_deconfigure+0xc/0x18
>> [   40.147005] [<ffffff8008552804>] dma_deconfigure+0xc/0x18
>> [   40.152353] [<ffffff800853ba10>] __device_release_driver+0x88/0x120
>> [   40.158560] [<ffffff800853bacc>] device_release_driver+0x24/0x38
>> [   40.164507] [<ffffff800853a868>] unbind_store+0xe8/0x110
>> [   40.169767] [<ffffff8008539c70>] drv_attr_store+0x20/0x30
>> [   40.175113] [<ffffff800823ab18>] sysfs_kf_write+0x48/0x58
>> [   40.180458] [<ffffff8008239ea8>] kernfs_fop_write+0xb0/0x1d8
>> [   40.186063] [<ffffff80081c507c>] __vfs_write+0x1c/0x100
>> [   40.191237] [<ffffff80081c5e80>] vfs_write+0xa0/0x1b8
>> [   40.196239] [<ffffff80081c7274>] SyS_write+0x44/0xa0
>> [   40.201155] [<ffffff8008082ef0>] el0_svc_naked+0x24/0x28
>> [   40.206703] vfio-pci 0000:08:00.0: Failed to setup iommu ops
>> [   40.212382] vfio-pci: probe of 0000:08:00.0 failed with error -22
>> [   40.228075] ------------[ cut here ]------------
>> [   40.235263] WARNING: CPU: 1 PID: 174 at ./include/linux/kref.h:46
>> kobject_get+0x64/0x88
>> [   40.243181] Modules linked in:
>> [   40.246201]
>> [   40.247673] CPU: 1 PID: 174 Comm: vfio Tainted: G        W
>> 4.9.0-rc2+ #1249
>> [   40.255076] Hardware name: ARM Juno development board (r1) (DT)
>> [   40.260932] task: ffffffc975ee9900 task.stack: ffffffc974d60000
>> [   40.266787] PC is at kobject_get+0x64/0x88
>> [   40.270840] LR is at iommu_bus_notifier+0x40/0x110
>> [   40.275577] pc : [<ffffff800834d20c>] lr : [<ffffff80084c3fd0>]
>> pstate: 80000145
>> [   40.282894] sp : ffffffc974d63c00
>> [   40.286169] x29: ffffffc974d63c00 x28: ffffffc974d60000
>> [   40.291431] x27: ffffff80088a2000 x26: 0000000000000040
>> [   40.296692] x25: 0000000000000123 x24: ffffffc974c8f418
>> [   40.301953] x23: 0000000000000006 x22: ffffffc9763f10a0
>> [   40.307214] x21: ffffffc9763e9a00 x20: ffffffc9763f10a0
>> [   40.312474] x19: ffffffc9763ebc80 x18: 0000007fd65069e0
>> [   40.317734] x17: 0000007f8d0ae3c0 x16: ffffff80081c7230
>> [   40.322995] x15: 0000007f8d136588 x14: ffffffffffffffff
>> [   40.328255] x13: 0000000000000004 x12: 0000000000000030
>> [   40.333515] x11: 0000000000000030 x10: 0101010101010101
>> [   40.338775] x9 : feff716475687163 x8 : 7f7f7f7f7f7f7f7f
>> [   40.344035] x7 : feff716475687163 x6 : ffffffc976abf400
>> [   40.349295] x5 : ffffffc976abf400 x4 : 0000000000000000
>> [   40.354555] x3 : ffffff80084c3f90 x2 : ffffffc9763ebcb8
>> [   40.359814] x1 : 0000000000000001 x0 : ffffff8008d4f000
>> [   40.365074]
>> [   40.366542] ---[ end trace 35c1e743d6e6c036 ]---
>> [   40.371107] Call trace:
>> [   40.373523] Exception stack(0xffffffc974d63a30 to 0xffffffc974d63b60)
>> [   40.379895] 3a20:                                   ffffffc9763ebc80
>> 0000008000000000
>> [   40.387643] 3a40: ffffffc974d63c00 ffffff800834d20c ffffffc976812400
>> ffffff8008237d94
>> [   40.395391] 3a60: ffffffbf25d78940 ffffffc974d60000 ffffffc975e259d8
>> 0000000000005b81
>> [   40.403139] 3a80: ffffffc974d60000 ffffff8008d4b31f ffffff8008b0f000
>> ffffffc976811c80
>> [   40.410887] 3aa0: ffffffc974d60000 ffffffc974d60000 ffffffc974d60000
>> ffffff8008237000
>> [   40.418634] 3ac0: ffffffc975e259d8 ffffff8008b1b9a8 ffffff8008d4f000
>> 0000000000000001
>> [   40.426382] 3ae0: ffffffc9763ebcb8 ffffff80084c3f90 0000000000000000
>> ffffffc976abf400
>> [   40.434130] 3b00: ffffffc976abf400 feff716475687163 7f7f7f7f7f7f7f7f
>> feff716475687163
>> [   40.441877] 3b20: 0101010101010101 0000000000000030 0000000000000030
>> 0000000000000004
>> [   40.449625] 3b40: ffffffffffffffff 0000007f8d136588 ffffff80081c7230
>> 0000007f8d0ae3c0
>> [   40.457372] [<ffffff800834d20c>] kobject_get+0x64/0x88
>> [   40.462455] [<ffffff80084c3fd0>] iommu_bus_notifier+0x40/0x110
>> [   40.468227] [<ffffff80080da288>] notifier_call_chain+0x50/0x90
>> [   40.473997] [<ffffff80080da694>] __blocking_notifier_call_chain+0x4c/0x90
>> [   40.480713] [<ffffff80080da6ec>] blocking_notifier_call_chain+0x14/0x20
>> [   40.487259] [<ffffff800853b9e4>] __device_release_driver+0x5c/0x120
>> [   40.493460] [<ffffff800853bacc>] device_release_driver+0x24/0x38
>> [   40.499402] [<ffffff800853a868>] unbind_store+0xe8/0x110
>> [   40.504656] [<ffffff8008539c70>] drv_attr_store+0x20/0x30
>> [   40.509997] [<ffffff800823ab18>] sysfs_kf_write+0x48/0x58
>> [   40.515337] [<ffffff8008239ea8>] kernfs_fop_write+0xb0/0x1d8
>> [   40.520936] [<ffffff80081c507c>] __vfs_write+0x1c/0x100
>> [   40.526104] [<ffffff80081c5e80>] vfs_write+0xa0/0x1b8
>> [   40.531100] [<ffffff80081c7274>] SyS_write+0x44/0xa0
>> [   40.536011] [<ffffff8008082ef0>] el0_svc_naked+0x24/0x28
>> [   40.541324] ata1.00: disabled
>> [   40.544878] sd 0:0:0:0: [sda] Synchronizing SCSI cache
>> [   40.550062] sd 0:0:0:0: [sda] Synchronize Cache(10) failed: Result:
>> hostbyte=0x04 driverbyte=0x00
>> [   40.558871] sd 0:0:0:0: [sda] Stopping disk
>> [   40.563037] sd 0:0:0:0: [sda] Start/Stop Unit failed: Result:
>> hostbyte=0x04 driverbyte=0x00
>> [   40.586990] Unable to handle kernel paging request at virtual address
>> 0002003e
>> [   40.594702] pgd = ffffffc974c80000
>> [   40.598165] [0002003e] *pgd=00000009f5102003[   40.602241] ,
>> *pud=00000009f5102003
>> , *pmd=0000000000000000[   40.607694]
>> [   40.609171] Internal error: Oops: 96000006 [#1] PREEMPT SMP
>> [   40.614684] Modules linked in:
>> [   40.617712] CPU: 3 PID: 174 Comm: vfio Tainted: G        W
>> 4.9.0-rc2+ #1249
>> [   40.625118] Hardware name: ARM Juno development board (r1) (DT)
>> [   40.630977] task: ffffffc975ee9900 task.stack: ffffffc974d60000
>> [   40.636841] PC is at kobject_get+0x14/0x88
>> [   40.640897] LR is at iommu_get_domain_for_dev+0x1c/0x48
>> [   40.646068] pc : [<ffffff800834d1bc>] lr : [<ffffff80084c3dec>]
>> pstate: 60000145
>> [   40.653387] sp : ffffffc974d63c60
>> [   40.656664] x29: ffffffc974d63c60 x28: ffffffc974d60000
>> [   40.661928] x27: ffffff80088a2000 x26: 0000000000000040
>> [   40.667193] x25: 0000000000000123 x24: ffffffc974c8f418
>> [   40.672457] x23: ffffffc974d63eb8 x22: ffffff8008dab568
>> [   40.677720] x21: 000000000000000d x20: ffffff8008dab568
>> [   40.682984] x19: 0000000000020002 x18: 0000000000000000
>> [   40.688246] x17: 0000000000000007 x16: 0000000000000001
>> [   40.693509] x15: ffffffc974cd091c x14: ffffffffffffffff
>> [   40.698773] x13: ffffffc974cd01cd x12: 0000000000000030
>> [   40.704036] x11: 0101010101010101 x10: 7f7f7f7f7f7f7f7f
>> [   40.709300] x9 : 0000000040000000 x8 : 0000000000210d00
>> [   40.714563] x7 : ffffffc975f95018 x6 : 0000000000000000
>> [   40.719826] x5 : 0000000000000000 x4 : ffffffc9763f1210
>> [   40.725088] x3 : 0000000000000000 x2 : ffffffc9763f10e8
>> [   40.730351] x1 : 0000000000000000 x0 : 0000000000020002
>> [   40.735613]
>> [   40.737085] Process vfio (pid: 174, stack limit = 0xffffffc974d60020)
>> [   40.743460] Stack: (0xffffffc974d63c60 to 0xffffffc974d64000)
>> [   40.749150] 3c60: ffffffc974d63c80 ffffff80084c3dec ffffffc9763e9a00
>> ffffff80085377a4
>> [   40.756904] 3c80: ffffffc974d63ca0 ffffff80080948c4 ffffffc9763f10a0
>> ffffff8008dab568
>> [   40.764658] 3ca0: ffffffc974d63cc0 ffffff8008764a14 ffffffc9763f10a0
>> ffffff8008dab568
>> [   40.772411] 3cc0: ffffffc974d63cd0 ffffff8008552804 ffffffc974d63ce0
>> ffffff800853ba10
>> [   40.780165] 3ce0: ffffffc974d63d00 ffffff800853bacc ffffffc9763f1100
>> ffffffc9763f10a0
>> [   40.787918] 3d00: ffffffc974d63d20 ffffff800853a868 ffffff8008d68f18
>> ffffffc9763f10a0
>> [   40.795672] 3d20: ffffffc974d63d50 ffffff8008539c70 000000000000000d
>> ffffffc974c8f400
>> [   40.803425] 3d40: ffffffc9757d5880 0000000000000000 ffffffc974d63d60
>> ffffff800823ab18
>> [   40.811178] 3d60: ffffffc974d63d70 ffffff8008239ea8 ffffffc974d63dc0
>> ffffff80081c507c
>> [   40.818931] 3d80: 000000000000000d 0000000000000000 ffffffc974c8f100
>> ffffffc974d63eb8
>> [   40.826684] 3da0: 000000001285f6a0 0000000000000015 0000000000000123
>> ffffff80080bf6ac
>> [   40.834437] 3dc0: ffffffc974d63e40 ffffff80081c5e80 000000000000000d
>> 0000000000000000
>> [   40.842190] 3de0: ffffffc974d63e30 ffffff80080c087c ffffffc974d63e20
>> ffffff80081c5c0c
>> [   40.849943] 3e00: ffffffc974c8f100 0000000000000001 ffffffc974c8f100
>> ffffffc974d63eb8
>> [   40.857696] 3e20: ffffffc974d63e40 ffffff80081c5f48 000000000000000d
>> ffffffc974c8f100
>> [   40.865450] 3e40: ffffffc974d63e80 ffffff80081c7274 ffffffc974c8f100
>> ffffffc974c8f100
>> [   40.873203] 3e60: 000000001285f6a0 000000000000000d 0000000060000000
>> 0000000000000000
>> [   40.880956] 3e80: 0000000000000000 ffffff8008082ef0 0000000000000000
>> 0000000000000001
>> [   40.888709] 3ea0: ffffffffffffffff 0000007f8d0ae3dc 0000000000000000
>> 0000000000000000
>> [   40.896461] 3ec0: 0000000000000001 000000001285f6a0 000000000000000d
>> 0000000000000000
>> [   40.904215] 3ee0: ae2e2e2e3f464b49 0000000000000000 000000001285f6b0
>> 39322f392f2f2f2f
>> [   40.911968] 3f00: 0000000000000040 fefefeff2f2d2f2f 7f7f7f7f7f7f7f7f
>> 0101010101010101
>> [   40.919721] 3f20: 0000000000000002 0000000000000004 ffffffffffffffff
>> 0000007f8d136588
>> [   40.927474] 3f40: 0000000000000000 0000007f8d0ae3c0 0000007fd65069e0
>> 00000000004ee000
>> [   40.935226] 3f60: 0000000000000001 000000001285f6a0 000000000000000d
>> 0000000000000001
>> [   40.942980] 3f80: 0000000000000020 000000001285eed8 00000000004ba158
>> 0000000000000000
>> [   40.950732] 3fa0: 0000000000000000 0000007fd6507f30 000000000040e74c
>> 0000007fd6507130
>> [   40.958485] 3fc0: 0000007f8d0ae3dc 0000000060000000 0000000000000001
>> 0000000000000040
>> [   40.966238] 3fe0: 0000000000000000 0000000000000000 0000002000103a00
>> 4000000010000000
>> [   40.973986] Call trace:
>> [   40.976405] Exception stack(0xffffffc974d63a90 to 0xffffffc974d63bc0)
>> [   40.982780] 3a80:                                   0000000000020002
>> 0000008000000000
>> [   40.990533] 3aa0: ffffffc974d63c60 ffffff800834d1bc ffffffc974d63ae0
>> ffffff80085377a4
>> [   40.998287] 3ac0: ffffffc974d63b10 ffffff8008537424 ffffffc975e3ac28
>> ffffffc975e3ac38
>> [   41.006041] 3ae0: ffffffc974d63b30 ffffff80081737cc ffffffc975e3ac38
>> ffffff8008da62c0
>> [   41.013794] 3b00: ffffffc975e98100 ffffff80085401b0 0000000000000001
>> ffffff8008540a08
>> [   41.021547] 3b20: 00000000000036b8 0000000000000040 0000000000020002
>> 0000000000000000
>> [   41.029300] 3b40: ffffffc9763f10e8 0000000000000000 ffffffc9763f1210
>> 0000000000000000
>> [   41.037053] 3b60: 0000000000000000 ffffffc975f95018 0000000000210d00
>> 0000000040000000
>> [   41.044805] 3b80: 7f7f7f7f7f7f7f7f 0101010101010101 0000000000000030
>> ffffffc974cd01cd
>> [   41.052558] 3ba0: ffffffffffffffff ffffffc974cd091c 0000000000000001
>> 0000000000000007
>> [   41.060311] [<ffffff800834d1bc>] kobject_get+0x14/0x88
>> [   41.065398] [<ffffff80084c3dec>] iommu_get_domain_for_dev+0x1c/0x48
>> [   41.071607] [<ffffff80080948c4>] arch_teardown_dma_ops+0x14/0x68
>> [   41.077556] [<ffffff8008764a14>] of_dma_deconfigure+0xc/0x18
>> [   41.083161] [<ffffff8008552804>] dma_deconfigure+0xc/0x18
>> [   41.088509] [<ffffff800853ba10>] __device_release_driver+0x88/0x120
>> [   41.094715] [<ffffff800853bacc>] device_release_driver+0x24/0x38
>> [   41.100663] [<ffffff800853a868>] unbind_store+0xe8/0x110
>> [   41.105922] [<ffffff8008539c70>] drv_attr_store+0x20/0x30
>> [   41.111268] [<ffffff800823ab18>] sysfs_kf_write+0x48/0x58
>> [   41.116612] [<ffffff8008239ea8>] kernfs_fop_write+0xb0/0x1d8
>> [   41.122216] [<ffffff80081c507c>] __vfs_write+0x1c/0x100
>> [   41.127390] [<ffffff80081c5e80>] vfs_write+0xa0/0x1b8
>> [   41.132391] [<ffffff80081c7274>] SyS_write+0x44/0xa0
>> [   41.137307] [<ffffff8008082ef0>] el0_svc_naked+0x24/0x28
>> [   41.142567] Code: 910003fd f9000bf3 aa0003f3 b4000180 (3940f000)
>> [   41.148667] ---[ end trace 35c1e743d6e6c037 ]---
>> Segmentation fault
>> / #
>>
>>
>> _______________________________________________
>> linux-arm-kernel mailing list
>> linux-arm-kernel at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

^ permalink raw reply

* [PATCH v6 1/5] ARM: davinci: da8xx: add usb phy clocks
From: Sekhar Nori @ 2016-10-26 17:13 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <0302c410-4b05-3a5b-3801-5ab73089a9e2@lechnology.com>

On Wednesday 26 October 2016 10:07 PM, David Lechner wrote:
> On 10/26/2016 02:59 AM, Sekhar Nori wrote:
>> On Wednesday 26 October 2016 08:36 AM, David Lechner wrote:
>>> Up to this point, the USB phy clock configuration was handled
>>> manually in
>>> the board files and in the usb drivers. This adds proper clocks so that
>>> the usb drivers can use clk_get and clk_enable and not have to worry
>>> about
>>> the details. Also, the related code is removed from the board files and
>>> replaced with the new clock registration functions.
>>>
>>> Signed-off-by: David Lechner <david@lechnology.com>
>>> Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
>>> ---
>>>
>>> I have added "ARM: davinci: da8xx: Enable the usb20 "per" clk on
>>> phy_clk_enable"
>>> from Axel Haslam to this patch.
>>>
>>> In the review of Axel's patch, Sekhar said:
>>>
>>>> We should not be using a NULL device pointer here. Can you pass the
>>>> musb
>>>> device pointer available in the same file? Also, da850_clks[] in
>>>> da850.c
>>>> needs to be fixed to add the matching device name.
>>>
>>> However, the musb device may not be registered. The usb20_clk can be
>>> used to
>>> supply a 48MHz clock to USB 1.1 (ohci) without using the musb device.
>>> So, I am
>>> inclined to leave this as NULL.
>>
>> But clock look-up has nothing to do with device being registered AFAICT.
>> It is used to identify the clock consumer. Passing NULL there means the
>> clock is not associated with any device. Which is not correct as we are
>> specifically looking at MUSB module clock.
>>
>> Thanks,
>> Sekhar
>>
> 
> FWIW, clk_get() uses dev_name() to get the device name, which will
> return NULL until after the platform device is registered.

I believe you can set init_name in the device to setup an initial name
until registration.

> 
> I can add the device references anyway. However, this is complicated by
> the fact that the musb platform device declaration is inside of an #if
> IS_ENABLED(CONFIG_USB_MUSB_HDRC). I can either remove the #if or add
> more #if's. Do you have a preference on this?

Please remove the #if's. Usually device registration is never done
conditionally based on whether the driver is built or not. So this seems
incorrect anyway.

Thanks,
Sekhar

^ permalink raw reply

* [PATCH v3] drivers: psci: PSCI checker module
From: Lorenzo Pieralisi @ 2016-10-26 17:10 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20161026151858.GQ3716@linux.vnet.ibm.com>

On Wed, Oct 26, 2016 at 08:18:58AM -0700, Paul E. McKenney wrote:
> On Wed, Oct 26, 2016 at 02:17:52PM +0100, Lorenzo Pieralisi wrote:
> > On Tue, Oct 25, 2016 at 11:34:36AM -0700, Paul E. McKenney wrote:
> > 
> > [...]
> > 
> > > > > +static int __init psci_checker(void)
> > > > > +{
> > > > > +	int ret;
> > > > > +
> > > > > +	/*
> > > > > +	 * Since we're in an initcall, we assume that all the CPUs that all
> > > > > +	 * CPUs that can be onlined have been onlined.
> > > > > +	 *
> > > > > +	 * The tests assume that hotplug is enabled but nobody else is using it,
> > > > > +	 * otherwise the results will be unpredictable. However, since there
> > > > > +	 * is no userspace yet in initcalls, that should be fine.
> > > > 
> > > > I do not think it is. If you run a kernel with, say,
> > > > CONFIG_LOCK_TORTURE_TEST, cpus may disappear from the radar while
> > > > running the PSCI checker test itself; that at least would confuse the
> > > > checker, and that's just an example.
> > > > 
> > > > I added Paul to check what are the assumptions behind the torture test
> > > > hotplug tests, in particular if there are any implicit assumptions for
> > > > it to work (ie it is the only kernel test hotplugging cpus in and out
> > > > (?)), what I know is that the PSCI checker assumptions are not correct.
> > > 
> > > Both CONFIG_LOCK_TORTURE_TEST and CONFIG_RCU_TORTURE_TEST can and will
> > > hotplug CPUs.  The locktorture.onoff_holdoff and rcutorture.onoff_holdoff
> > > kernel parameters can delay the start of CPU-hotplug testing, and in
> > > my testing I set this delay to 30 seconds after boot.
> > > 
> > > One approach would be to make your test refuse to run if either of
> > > the lock/RCU torture tests was running.  Or do what Lorenzo suggests
> > > below.  The torture tests aren't crazy enough to offline the last CPU.
> > > Though they do try, just for effect, in cases where the last CPU is
> > > marked cpu_is_hotpluggable().  ;-)
> > 
> > Thank you Paul. I have an additional question though. Is there any
> > implicit assumption in LOCK/RCU torture tests whereby nothing else
> > in the kernel is hotplugging cpus in/out (through cpu_down()/up())
> > while they are running ?
> > 
> > I am asking because that's the main reason behind my query. Those tests
> > hotplug cpus in and out through cpu_down/up() but AFAICS nothing
> > prevents another piece of code in the kernel to call those functions and
> > the tests may just fail in that case (ie trying to cpu_down() a cpu
> > that is not online).
> > 
> > Are false negatives contemplated (or I am missing something) ?
> 
> The current code assumes nothing else doing CPU-hotplug operations,
> and will therefore print "RCU_HOTPLUG" error (or "LOCK_HOTPLUG" for
> locktorture) if any of the hotplug operations failed.
> 
> > I just would like to understand if what this patch currently does
> > is safe and sound. I think that calling cpu_down() and cpu_up()
> > is always safe, but the test can result in false negatives if
> > other kernel subsystems (eg LOCK torture test) are calling those
> > APIs in parallel (because cpu_down()/cpu_up() calls can fail - eg
> > trying to cpu_down() a cpu that is not online any longer, since it
> > was taken down by another kernel control path), that's the question
> > I have.
> 
> I am assuming that these added calls to cpu_down() and cpu_up() aren't
> enabled by default.  If they are, rcutorture and locktorture need some
> way to turn the off.
> 
> So maybe we need to have some sort of API that detects concurrent
> CPU-hotplug torturing?  Maybe something like the following?
> 
> 	static atomic_t n_cpu_hotplug_torturers;
> 	static atomic_t cpu_hotplug_concurrent_torture;
> 
> 	void torture_start_cpu_hotplug(void)
> 	{
> 		if (atomic_inc_return(&n_cpu_hotplug_torturers) > 1)
> 			atomic_inc(&cpu_hotplug_concurrent_torture);
> 	}
> 
> 	void torture_end_cpu_hotplug(void)
> 	{
> 		atomic_dec(&n_cpu_hotplug_torturers);
> 	}
> 
> 	bool torture_cpu_hotplug_was_concurrent(void)
> 	{
> 		return !!atomic_read(&cpu_hotplug_concurrent_torture);
> 	}
> 
> The locktorture and rcutorture code could then ignore CPU-hotplug
> errors that could be caused by concurrent access.  And complain
> bitterly about the concurrent access, of course!  ;-)

This could do, even better if we extend the torture hotplug tests to
take a cpumask so that basically Kevin's patch will be based on torture
hotplug tests infrastructure :D (ie he/we wanted to hotplug a subset of
the online mask corresponding to a "cluster" of cpus, that's to test the
PSCI CPU ON/OFF firmware interface behind cpu hotplug operations).

Still, this implies logging every possible cpu_down()/cpu_up() caller
through torture_start_cpu_hotplug().

What about userspace and sysfs interface that allow to offline cpus then ?
Point is, the torture hotplug tests take a snapshot of the maxcpu at
kthread init time and then randomize the logical cpu number, but it is
definitely possible unless I am mistaken that some of those cpus
disappear while the test is running and this will cause failures that
you can't detect through the API above.

That's why I suggested using the:

freeze_secondary_cpus(int primary);

for this patch because that allows us to quiesce all cpus other than
primary at once, with no interference possible from other kernel control
paths (but it is not a perfect solution either).

Userspace notwithstanding, I think the best solution consists in either
making this patch hotplug tests work on top of the torture hotplug tests
API or solving the dependency at kconfig level by disabling the PSCI
checker if any of torture tests are enabled which is not ideal but
I do not see any other option.

Thanks a lot for your feedback, thoughts appreciated.

Lorenzo

> 
> Or am I missing your point?
> 
> 							Thanx, Paul
> 
> > Thanks !
> > Lorenzo
> > 
> > > 
> > > 						Thanx, Paul
> > > 
> > > > There is something simple you can do to get this "fixed".
> > > > 
> > > > You can use the new API James implemented for hibernate,
> > > > that allows you to disable (ie PSCI CPU OFF) all "secondary" cpus
> > > > other than the primary one passed in as parameter:
> > > > 
> > > > freeze_secondary_cpus(int primary);
> > > > 
> > > > that function will _cpu_down() all online cpus other than "primary"
> > > > in one go, without any interference allowed from other bits of the
> > > > kernel. It requires an enable_nonboot_cpus() counterpart, and you
> > > > can do that for every online cpus you detect (actually you can even
> > > > avoid using the online cpu mask and use the present mask to carry
> > > > out the test). If there is a resident trusted OS you can just
> > > > trigger the test with primary == tos_resident_cpu, since all
> > > > others are bound to fail (well, you can run them and check they
> > > > do fail, it is a checker after all).
> > > > 
> > > > You would lose the capability of hotplugging a "cluster" at a time, but
> > > > I do not think it is a big problem, the test above would cover it
> > > > and more importantly, it is safe to execute.
> > > > 
> > > > Or we can augment the torture test API to restrict the cpumask
> > > > it actually uses to offline/online cpus (I am referring to
> > > > torture_onoff(), kernel/torture.c).
> > > > 
> > > > Further comments appreciated since I am not sure I grokked the
> > > > assumption the torture tests make about hotplugging cpus in and out,
> > > > I will go through the commits logs again to find more info.
> > > > 
> > > > Thanks !
> > > > Lorenzo
> > > > 
> > > > > +	 */
> > > > > +	nb_available_cpus = num_online_cpus();
> > > > > +
> > > > > +	/* Check PSCI operations are set up and working. */
> > > > > +	ret = psci_ops_check();
> > > > > +	if (ret)
> > > > > +		return ret;
> > > > > +
> > > > > +	pr_info("PSCI checker started using %u CPUs\n", nb_available_cpus);
> > > > > +
> > > > > +	pr_info("Starting hotplug tests\n");
> > > > > +	ret = hotplug_tests();
> > > > > +	if (ret == 0)
> > > > > +		pr_info("Hotplug tests passed OK\n");
> > > > > +	else if (ret > 0)
> > > > > +		pr_err("%d error(s) encountered in hotplug tests\n", ret);
> > > > > +	else {
> > > > > +		pr_err("Out of memory\n");
> > > > > +		return ret;
> > > > > +	}
> > > > > +
> > > > > +	pr_info("Starting suspend tests (%d cycles per state)\n",
> > > > > +		NUM_SUSPEND_CYCLE);
> > > > > +	ret = suspend_tests();
> > > > > +	if (ret == 0)
> > > > > +		pr_info("Suspend tests passed OK\n");
> > > > > +	else if (ret > 0)
> > > > > +		pr_err("%d error(s) encountered in suspend tests\n", ret);
> > > > > +	else {
> > > > > +		switch (ret) {
> > > > > +		case -ENOMEM:
> > > > > +			pr_err("Out of memory\n");
> > > > > +			break;
> > > > > +		case -ENODEV:
> > > > > +			pr_warn("Could not start suspend tests on any CPU\n");
> > > > > +			break;
> > > > > +		}
> > > > > +	}
> > > > > +
> > > > > +	pr_info("PSCI checker completed\n");
> > > > > +	return ret < 0 ? ret : 0;
> > > > > +}
> > > > > +late_initcall(psci_checker);
> > > > > -- 
> > > > > 2.10.0
> > > > > 
> > > > 
> > > 
> > 
> 

^ permalink raw reply

* [v12, 5/8] soc: fsl: add GUTS driver for QorIQ platforms
From: Scott Wood @ 2016-10-26 17:06 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1474441040-11946-6-git-send-email-yangbo.lu@nxp.com>

On Wed, 2016-09-21 at 14:57 +0800, Yangbo Lu wrote:
> diff --git a/drivers/soc/fsl/Kconfig b/drivers/soc/fsl/Kconfig
> new file mode 100644
> index 0000000..b99764c
> --- /dev/null
> +++ b/drivers/soc/fsl/Kconfig
> @@ -0,0 +1,19 @@
> +#
> +# Freescale SOC drivers
> +#
> +
> +source "drivers/soc/fsl/qe/Kconfig"
> +
> +config FSL_GUTS
> +	bool "Freescale QorIQ GUTS driver"
> +	select SOC_BUS
> +	help
> +	??The global utilities block controls power management, I/O device
> +	??enabling, power-onreset(POR) configuration monitoring, alternate
> +	??function selection for multiplexed signals,and clock control.
> +	??This driver is to manage and access global utilities block.
> +	??Initially only reading SVR and registering soc device are
> supported.
> +	??Other guts accesses, such as reading RCW, should eventually be
> moved
> +	??into this driver as well.
> +
> +	??If you want GUTS driver support, you should say Y here.

This is user-enablable without dependencies, which means it will break some
randconfigs. ?If this is to be enabled via select then remove the text after
"bool".

> +/* SoC die attribute definition for QorIQ platform */
> +static const struct fsl_soc_die_attr fsl_soc_die[] = {
> +#ifdef CONFIG_PPC
> +	/*
> +	?* Power Architecture-based SoCs T Series
> +	?*/
> +
> +	/* Die: T4240, SoC: T4240/T4160/T4080 */
> +	{ .die		= "T4240",
> +	??.svr		= 0x82400000,
> +	??.mask		= 0xfff00000,
> +	},
> +	/* Die: T1040, SoC: T1040/T1020/T1042/T1022 */
> +	{ .die		= "T1040",
> +	??.svr		= 0x85200000,
> +	??.mask		= 0xfff00000,
> +	},
> +	/* Die: T2080, SoC: T2080/T2081 */
> +	{ .die		= "T2080",
> +	??.svr		= 0x85300000,
> +	??.mask		= 0xfff00000,
> +	},
> +	/* Die: T1024, SoC: T1024/T1014/T1023/T1013 */
> +	{ .die		= "T1024",
> +	??.svr		= 0x85400000,
> +	??.mask		= 0xfff00000,
> +	},
> +#endif /* CONFIG_PPC */
> +#if defined(CONFIG_ARCH_MXC) || defined(CONFIG_ARCH_LAYERSCAPE)

Will this driver ever be probed on MXC? ?Why do we need these ifdefs at all?


> +	/*
> +	?* ARM-based SoCs LS Series
> +	?*/
> +
> +	/* Die: LS1043A, SoC: LS1043A/LS1023A */
> +	{ .die		= "LS1043A",
> +	??.svr		= 0x87920000,
> +	??.mask		= 0xffff0000,
> +	},
> +	/* Die: LS2080A, SoC: LS2080A/LS2040A/LS2085A */
> +	{ .die		= "LS2080A",
> +	??.svr		= 0x87010000,
> +	??.mask		= 0xff3f0000,
> +	},
> +	/* Die: LS1088A, SoC: LS1088A/LS1048A/LS1084A/LS1044A */
> +	{ .die		= "LS1088A",
> +	??.svr		= 0x87030000,
> +	??.mask		= 0xff3f0000,
> +	},
> +	/* Die: LS1012A, SoC: LS1012A */
> +	{ .die		= "LS1012A",
> +	??.svr		= 0x87040000,
> +	??.mask		= 0xffff0000,
> +	},
> +	/* Die: LS1046A, SoC: LS1046A/LS1026A */
> +	{ .die		= "LS1046A",
> +	??.svr		= 0x87070000,
> +	??.mask		= 0xffff0000,
> +	},
> +	/* Die: LS2088A, SoC: LS2088A/LS2048A/LS2084A/LS2044A */
> +	{ .die		= "LS2088A",
> +	??.svr		= 0x87090000,
> +	??.mask		= 0xff3f0000,
> +	},
> +	/* Die: LS1021A, SoC: LS1021A/LS1020A/LS1022A
> +	?* Note: Put this die at the end in cause of incorrect
> identification
> +	?*/
> +	{ .die		= "LS1021A",
> +	??.svr		= 0x87000000,
> +	??.mask		= 0xfff00000,
> +	},
> +#endif /* CONFIG_ARCH_MXC || CONFIG_ARCH_LAYERSCAPE */

Instead of relying on ordering, add more bits to the mask so that there's no
overlap. ?I think 0xfff70000 would work.

> +out:
> +	kfree(soc_dev_attr.machine);
> +	kfree(soc_dev_attr.family);
> +	kfree(soc_dev_attr.soc_id);
> +	kfree(soc_dev_attr.revision);
> +	iounmap(guts->regs);
> +out_free:
> +	kfree(guts);
> +	return ret;
> +}

Please use devm.

-Scott

^ permalink raw reply

* [PATCH 2/2] ARM: dma-mapping: Handle prot with non-consistent dma attribute
From: Thierry Escande @ 2016-10-26 17:04 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1477501448-30915-1-git-send-email-thierry.escande@collabora.com>

From: Heng-Ruey Hsu <henryhsu@chromium.org>

With this change, __get_dma_pgprot() now returns the VMA access
protection passed directly instead of overriding it if called with
NON_CONSISTENT DMA attribute.

Signed-off-by: Heng-Ruey Hsu <henryhsu@chromium.org>
Tested-by: Heng-ruey Hsu <henryhsu@chromium.org>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Thierry Escande <thierry.escande@collabora.com>
---
 arch/arm/mm/dma-mapping.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index dc42ca6..d608c185 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -640,6 +640,9 @@ static void __free_from_contiguous(struct device *dev, struct page *page,
 
 static inline pgprot_t __get_dma_pgprot(unsigned long attrs, pgprot_t prot)
 {
+	if (attrs & DMA_ATTR_NON_CONSISTENT)
+		return prot;
+
 	prot = (attrs & DMA_ATTR_WRITE_COMBINE) ?
 			pgprot_writecombine(prot) :
 			pgprot_dmacoherent(prot);
-- 
2.7.4

^ permalink raw reply related

* [PATCH 1/2] ARM: dma-mapping: Support cache sync after arm_dma_get_sgtable
From: Thierry Escande @ 2016-10-26 17:04 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1477501448-30915-1-git-send-email-thierry.escande@collabora.com>

From: Heng-Ruey Hsu <henryhsu@chromium.org>

Currently arm_dma_sync_sg_* require dma_address to do cache sync. But
dma address is set by map_sg(). We can't do cache sync after
arm_dma_get_sgtable. The behavior is different from iommu_ops.

We don't have to get dma address in arm_dma_sync_sg_* and convert the
address to physical address in arm_dma_sync_single_*. With this change
sg_page() is used to get physical address and do sync directly.

Signed-off-by: Heng-Ruey Hsu <henryhsu@chromium.org>
Tested-by: Heng-ruey Hsu <henryhsu@chromium.org>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Thierry Escande <thierry.escande@collabora.com>
---
 arch/arm/mm/dma-mapping.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index ab4f745..dc42ca6 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -1120,13 +1120,11 @@ void arm_dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nents,
 void arm_dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg,
 			int nents, enum dma_data_direction dir)
 {
-	struct dma_map_ops *ops = get_dma_ops(dev);
 	struct scatterlist *s;
 	int i;
 
 	for_each_sg(sg, s, nents, i)
-		ops->sync_single_for_cpu(dev, sg_dma_address(s), s->length,
-					 dir);
+		__dma_page_dev_to_cpu(sg_page(s), s->offset, s->length, dir);
 }
 
 /**
@@ -1139,13 +1137,11 @@ void arm_dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg,
 void arm_dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg,
 			int nents, enum dma_data_direction dir)
 {
-	struct dma_map_ops *ops = get_dma_ops(dev);
 	struct scatterlist *s;
 	int i;
 
 	for_each_sg(sg, s, nents, i)
-		ops->sync_single_for_device(dev, sg_dma_address(s), s->length,
-					    dir);
+		__dma_page_cpu_to_dev(sg_page(s), s->offset, s->length, dir);
 }
 
 /*
-- 
2.7.4

^ permalink raw reply related

* [PATCH 0/2] ARM DMA mapping
From: Thierry Escande @ 2016-10-26 17:04 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

This series introduces 2 changes in ARM DMA mapping. The first one is
about supporting cache maintenance after calling arm_dma_get_sgtable().
The other one handles VMA access protection in __get_dma_pgprot().

Heng-Ruey Hsu (2):
  ARM: dma-mapping: Support cache sync after arm_dma_get_sgtable
  ARM: dma-mapping: Handle prot with non-consistent dma attribute

 arch/arm/mm/dma-mapping.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

-- 
2.7.4

^ permalink raw reply

* [RESEND PATCH] arm: assabet_defconfig: disable IDE subsystem
From: Bartlomiej Zolnierkiewicz @ 2016-10-26 17:01 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <4264651.gPKphdYuCx@wuerfel>


Hi,

On Wednesday, July 13, 2016 04:37:31 PM Arnd Bergmann wrote:
> On Wednesday, July 13, 2016 12:59:23 PM CEST Bartlomiej Zolnierkiewicz wrote:
> > 
> > On Friday, July 08, 2016 10:23:48 PM Arnd Bergmann wrote:
> > > On Friday, July 8, 2016 5:24:41 PM CEST Bartlomiej Zolnierkiewicz wrote:
> > > > This patch disables deprecated IDE subsystem in assabet_defconfig
> > > > (no IDE host drivers are selected in this config so there is no
> > > > valid reason to enable IDE subsystem itself).
> > > > 
> > > > Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> > > > Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> > > 
> > > I think the series makes a lot of sense. I have checked your assertions
> > > in the changelogs and found no flaws in your logic, so I think we should
> > > take them all through arm-soc unless there are other concerns.
> > 
> > Thank you.
> > 
> > Should I resend everything or just patches that were not reposted yet
> > (the ones that were marked as RFT initially and got no feedback)?
> 
> I'd be fine with just getting a pull request with all the patches that
> had no negative feedback and that were not already applied (if any).

Here it is (sorry for taking so long).

The following changes since commit 07d9a380680d1c0eb51ef87ff2eab5c994949e69:

  Linux 4.9-rc2 (2016-10-23 17:10:14 -0700)

are available in the git repository at:

  https://github.com/bzolnier/linux.git v4.9-rc2-arm-configs-pata

for you to fetch changes up to bc9c6cc857849ec0d83bd13c1812bae9345dc553:

  arm: spitz_defconfig: convert to use libata PATA drivers (2016-10-26 18:43:33 +0200)

----------------------------------------------------------------
Bartlomiej Zolnierkiewicz (16):
      arm: assabet_defconfig: disable IDE subsystem
      arm: badge4_defconfig: disable IDE subsystem
      arm: cerfcube_defconfig: disable IDE subsystem
      arm: lart_defconfig: disable IDE subsystem
      arm: mainstone_defconfig: disable IDE subsystem
      arm: shannon_defconfig: disable IDE subsystem
      arm: collie_defconfig: convert to use libata PATA drivers
      arm: omap1_defconfig: convert to use libata PATA drivers
      arm: am200epdkit_defconfig: convert to use libata PATA drivers
      arm: corgi_defconfig: convert to use libata PATA drivers
      arm: h3600_defconfig: convert to use libata PATA drivers
      arm: ixp4xx_defconfig: convert to use libata PATA drivers
      arm: jornada720_defconfig: convert to use libata PATA drivers
      arm: netwinder_defconfig: convert to use libata PATA drivers
      arm: s3c2410_defconfig: convert to use libata PATA drivers
      arm: spitz_defconfig: convert to use libata PATA drivers

 arch/arm/configs/am200epdkit_defconfig |  5 +++--
 arch/arm/configs/assabet_defconfig     |  1 -
 arch/arm/configs/badge4_defconfig      |  2 --
 arch/arm/configs/cerfcube_defconfig    |  1 -
 arch/arm/configs/collie_defconfig      |  5 +++--
 arch/arm/configs/corgi_defconfig       |  7 +++----
 arch/arm/configs/h3600_defconfig       |  5 +++--
 arch/arm/configs/ixp4xx_defconfig      |  9 +++++----
 arch/arm/configs/jornada720_defconfig  |  5 +++--
 arch/arm/configs/lart_defconfig        |  2 --
 arch/arm/configs/mainstone_defconfig   |  1 -
 arch/arm/configs/netwinder_defconfig   |  7 ++++---
 arch/arm/configs/omap1_defconfig       |  4 ++--
 arch/arm/configs/s3c2410_defconfig     | 10 +++-------
 arch/arm/configs/shannon_defconfig     |  1 -
 arch/arm/configs/spitz_defconfig       |  8 +++-----
 16 files changed, 32 insertions(+), 41 deletions(-)

^ permalink raw reply

* [PATCH 1/2] of, numa: Add function to disable of_node_to_nid().
From: David Daney @ 2016-10-26 17:00 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20161026134301.GV25086@rric.localdomain>

On 10/26/2016 06:43 AM, Robert Richter wrote:
> On 25.10.16 14:31:00, David Daney wrote:
>> From: David Daney <david.daney@cavium.com>
>>
>> On arm64 NUMA kernels we can pass "numa=off" on the command line to
>> disable NUMA.  A side effect of this is that kmalloc_node() calls to
>> non-zero nodes will crash the system with an OOPS:
>>
>> [    0.000000] [<fffffc00081bba84>] __alloc_pages_nodemask+0xa4/0xe68
>> [    0.000000] [<fffffc00082163a8>] new_slab+0xd0/0x57c
>> [    0.000000] [<fffffc000821879c>] ___slab_alloc+0x2e4/0x514
>> [    0.000000] [<fffffc000823882c>] __slab_alloc+0x48/0x58
>> [    0.000000] [<fffffc00082195a0>] __kmalloc_node+0xd0/0x2e0
>> [    0.000000] [<fffffc00081119b8>] __irq_domain_add+0x7c/0x164
>> [    0.000000] [<fffffc0008b75d30>] its_probe+0x784/0x81c
>> [    0.000000] [<fffffc0008b75e10>] its_init+0x48/0x1b0
>> .
>> .
>> .
>>
>> This is caused by code like this in kernel/irq/irqdomain.c
>>
>>      domain = kzalloc_node(sizeof(*domain) + (sizeof(unsigned int) * size),
>>                    GFP_KERNEL, of_node_to_nid(of_node));
>>
>> When NUMA is disabled, the concept of a node is really undefined, so
>> of_node_to_nid() should unconditionally return NUMA_NO_NODE.
>>
>> Add __of_force_no_numa() to allow of_node_to_nid() to be forced to
>> return NUMA_NO_NODE.
>>
>> The follow on patch will call this new function from the arm64 numa
>> code.
>
> Didn't that work before?

I am fairly certain that it used to work.

> numa=off just maps all mem to node 0.

Yes, that is the current behavior.

> If mem
> allocation is requested for another node it should just fall back to a
> node with mem (node 0 then).

This is the root of the problem.  The ITS code is allocating memory. It 
calls of_node_to_nid() to determine which node it resides on.  The 
answer in the failing case is node-1.  Since we have mapped all the 
memory to node-0 the  __kmalloc_node(..., 1) call fails with the OOPS shown.

It could be that __kmalloc_node() used to allocate memory on a node 
other than the requested node if the request couldn't be met.  But in 
v4.8 and later it produces that OOPS.

If you pass a node containing free memory or NUMA_NO_NODE to 
__kmalloc_node(), the allocation succeeds.

When we first did these patches, I advocated removing the numa=off 
feature, and requiring people to install usable firmware on their 
systems.  That was rejected on the grounds that not everybody has the 
ability to change their firmware and we would like to allow NUMA kernels 
to run on systems with defective firmware by supplying this command line 
parameter.  Now that I have seen requests from the wild for this, I 
think it is a good idea to allow numa=off to be used to work around this 
bad firmware.

The change in this patch set is fairly small, and seems to get the job 
done.  An alternative would be to change __kmalloc_node() to ignore the 
node parameter if the request cannot be made, but I assume that there 
were good reasons to have the current behavior, so that would be a much 
more complicated change to make.



> I suspect there is something wrong with
> the page initialization, see:
>
>   http://www.spinics.net/lists/arm-kernel/msg535191.html
>   https://bugzilla.redhat.com/show_bug.cgi?id=1387793
>
> What is the complete oops?
>
> So I think k*alloc_node() must be able to handle requests to
> non-existing nodes. Otherwise your fix is incomplete, assume a failed
> of_numa_init() causing a dummy init but still some devices reporting a
> node.

.
.
.
EFI stub: Booting Linux Kernel...
EFI stub: Using DTB from configuration table
EFI stub: Exiting boot services and installing virtual address map...
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.8.0-rc8-dd (ddaney at localhost.localdomain) 
(gcc version 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC) ) #29 SMP Tue Sep 
27 15:50:35 PDT 2016
[    0.000000] Boot CPU: AArch64 Processor [431f0a10]
[    0.000000] NUMA turned off
[    0.000000] earlycon: pl11 at MMIO 0x000087e024000000 (options '')
[    0.000000] bootconsole [pl11] enabled
[    0.000000] efi: Getting EFI parameters from FDT:
[    0.000000] efi: EFI v2.40 by Cavium Thunder cn88xx EFI 
jenkins_weekly_build_40-0-ga1f880f Sep 13 2016 17:05:35
[    0.000000] efi:  ACPI=0xfffff000  ACPI 2.0=0xfffff014  SMBIOS 
3.0=0x10ffafcf000
[    0.000000] cma: Reserved 512 MiB at 0x00000000c0000000
[    0.000000] NUMA disabled
[    0.000000] NUMA: Faking a node at [mem 
0x0000000000000000-0x0000010fffffffff]
[    0.000000] NUMA: Adding memblock [0x1400000 - 0xfffdffff] on node 0
[    0.000000] NUMA: Adding memblock [0xfffe0000 - 0xffffffff] on node 0
[    0.000000] NUMA: Adding memblock [0x100000000 - 0xfffffffff] on node 0
[    0.000000] NUMA: Adding memblock [0x10000400000 - 0x10ffa38ffff] on 
node 0
[    0.000000] NUMA: Adding memblock [0x10ffa390000 - 0x10ffa41ffff] on 
node 0
[    0.000000] NUMA: Adding memblock [0x10ffa420000 - 0x10ffaeaffff] on 
node 0
[    0.000000] NUMA: Adding memblock [0x10ffaeb0000 - 0x10ffaffffff] on 
node 0
[    0.000000] NUMA: Adding memblock [0x10ffb000000 - 0x10ffffaffff] on 
node 0
[    0.000000] NUMA: Adding memblock [0x10ffffb0000 - 0x10fffffffff] on 
node 0
[    0.000000] NUMA: Initmem setup node 0 [mem 0x01400000-0x10fffffffff]
[    0.000000] NUMA: NODE_DATA [mem 0x10ffffae480-0x10ffffaff7f]
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000001400000-0x00000000ffffffff]
[    0.000000]   Normal   [mem 0x0000000100000000-0x0000010fffffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000001400000-0x00000000fffdffff]
[    0.000000]   node   0: [mem 0x00000000fffe0000-0x00000000ffffffff]
[    0.000000]   node   0: [mem 0x0000000100000000-0x0000000fffffffff]
[    0.000000]   node   0: [mem 0x0000010000400000-0x0000010ffa38ffff]
[    0.000000]   node   0: [mem 0x0000010ffa390000-0x0000010ffa41ffff]
[    0.000000]   node   0: [mem 0x0000010ffa420000-0x0000010ffaeaffff]
[    0.000000]   node   0: [mem 0x0000010ffaeb0000-0x0000010ffaffffff]
[    0.000000]   node   0: [mem 0x0000010ffb000000-0x0000010ffffaffff]
[    0.000000]   node   0: [mem 0x0000010ffffb0000-0x0000010fffffffff]
[    0.000000] Initmem setup node 0 [mem 
0x0000000001400000-0x0000010fffffffff]
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: PSCIv0.2 detected in firmware.
[    0.000000] psci: Using standard PSCI v0.2 function IDs
[    0.000000] psci: Trusted OS resident on physical CPU 0x0
[    0.000000] percpu: Embedded 3 pages/cpu @ffffff0ff6900000 s116736 
r8192 d71680 u196608
[    0.000000] Detected VIPT I-cache on CPU0
[    0.000000] CPU features: enabling workaround for Cavium erratum 27456
[    0.000000] Built 1 zonelists in Node order, mobility grouping on. 
Total pages: 2094720
[    0.000000] Policy zone: Normal
[    0.000000] Kernel command line: BOOT_IMAGE=/vmlinuz-4.8.0-rc8-dd 
root=/dev/mapper/rhel-root ro crashkernel=auto rd.lvm.lv=rhel/root 
rd.lvm.lv=rhel/swap LANG=en_US.UTF-8 numa=off console=ttyAMA0,115200n8 
earlycon=pl011,0x87e024000000
[    0.000000] log_buf_len individual max cpu contribution: 4096 bytes
[    0.000000] log_buf_len total cpu_extra contributions: 389120 bytes
[    0.000000] log_buf_len min size: 524288 bytes
[    0.000000] log_buf_len: 1048576 bytes
[    0.000000] early log buf free: 519176(99%)
[    0.000000] PID hash table entries: 4096 (order: -1, 32768 bytes)
[    0.000000] software IO TLB [mem 0xfbfd0000-0xfffd0000] (64MB) mapped 
at [fffffe00fbfd0000-fffffe00fffcffff]
[    0.000000] Memory: 133391936K/134193152K available (7356K kernel 
code, 1359K rwdata, 3392K rodata, 1216K init, 6799K bss, 276928K 
reserved, 524288K cma-reserved)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     modules : 0xfffffc0000000000 - 0xfffffc0008000000   ( 
   128 MB)
[    0.000000]     vmalloc : 0xfffffc0008000000 - 0xfffffdff5fff0000   ( 
  2045 GB)
[    0.000000]       .text : 0xfffffc0008080000 - 0xfffffc00087b0000   ( 
  7360 KB)
[    0.000000]     .rodata : 0xfffffc00087b0000 - 0xfffffc0008b10000   ( 
  3456 KB)
[    0.000000]       .init : 0xfffffc0008b10000 - 0xfffffc0008c40000   ( 
  1216 KB)
[    0.000000]       .data : 0xfffffc0008c40000 - 0xfffffc0008d93e00   ( 
  1360 KB)
[    0.000000]        .bss : 0xfffffc0008d93e00 - 0xfffffc0009437d48   ( 
  6800 KB)
[    0.000000]     fixed   : 0xfffffdff7e7d0000 - 0xfffffdff7ec00000   ( 
  4288 KB)
[    0.000000]     PCI I/O : 0xfffffdff7ee00000 - 0xfffffdff7fe00000   ( 
    16 MB)
[    0.000000]     vmemmap : 0xfffffdff80000000 - 0xfffffe0000000000   ( 
     2 GB maximum)
[    0.000000]               0xfffffdff80005000 - 0xfffffdffc4000000   ( 
  1087 MB actual)
[    0.000000]     memory  : 0xfffffe0001400000 - 0xffffff1000000000 
(1114092 MB)
[    0.000000] SLUB: HWalign=128, Order=0-3, MinObjects=0, CPUs=96, Nodes=1
[    0.000000] Hierarchical RCU implementation.
[    0.000000] 	Build-time adjustment of leaf fanout to 64.
[    0.000000] 	RCU restricting CPUs from NR_CPUS=4096 to nr_cpu_ids=96.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=64, nr_cpu_ids=96
[    0.000000] NR_IRQS:64 nr_irqs:64 0
[    0.000000] GICv3: GIC: Using split EOI/Deactivate mode
[    0.000000] ITS: /interrupt-controller at 801000000000/gic-its at 801000020000
[    0.000000] ITS at 0x0000801000020000: allocated 2097152 Devices 
@10001000000 (flat, esz 8, psz 64K, shr 1)
[    0.000000] ITS: /interrupt-controller at 801000000000/gic-its at 901000020000
[    0.000000] ITS at 0x0000901000020000: allocated 2097152 Devices 
@10002000000 (flat, esz 8, psz 64K, shr 1)
[    0.000000] Unable to handle kernel NULL pointer dereference at 
virtual address 00001680
[    0.000000] pgd = fffffc0009470000
[    0.000000] [00001680] *pgd=0000010ffff90003, *pud=0000010ffff90003, 
*pmd=0000010ffff90003, *pte=0000000000000000
[    0.000000] Internal error: Oops: 96000006 [#1] SMP
[    0.000000] Modules linked in:
[    0.000000] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.8.0-rc8-dd #29
[    0.000000] Hardware name: Cavium ThunderX CN88XX board (DT)
[    0.000000] task: fffffc0008c71c80 task.stack: fffffc0008c40000
[    0.000000] PC is at __alloc_pages_nodemask+0xa4/0xe68
[    0.000000] LR is at __alloc_pages_nodemask+0x38/0xe68
[    0.000000] pc : [<fffffc00081c8950>] lr : [<fffffc00081c88e4>] 
pstate: 600000c5
[    0.000000] sp : fffffc0008c43880
[    0.000000] x29: fffffc0008c43880 x28: ffffff000041fc00
[    0.000000] x27: 0000000000201200 x26: 0000000000000000
[    0.000000] x25: 0000000000000001 x24: 0000000000001680
[    0.000000] x23: 0000000000201200 x22: fffffc0008c439c8
[    0.000000] x21: fffffc0008c63000 x20: 0000000000201200
[    0.000000] x19: 0000000000000000 x18: 0000000000000070
[    0.000000] x17: 0000000000000008 x16: 0000000000000000
[    0.000000] x15: 0000000000000000 x14: 2820303030303030
[    0.000000] x13: 3230303031402073 x12: 6563697665442032
[    0.000000] x11: 0000000000000020 x10: fffffc0009334000
[    0.000000] x9 : 0000000001bfff3f x8 : 7f7f7f7f7f7f7f7f
[    0.000000] x7 : 0000000001210111 x6 : fffffdffc00010a0
[    0.000000] x5 : 0000000000000000 x4 : 0000000000000000
[    0.000000] x3 : 0000000000000000 x2 : 0000000000000000
[    0.000000] x1 : 0000000000000000 x0 : fffffc0008c63bb0
[    0.000000]
[    0.000000] Process swapper/0 (pid: 0, stack limit = 0xfffffc0008c40020)
[    0.000000] Stack: (0xfffffc0008c43880 to 0xfffffc0008c44000)
[    0.000000] 3880: fffffc0008c439f0 fffffc000821fa70 ffffff000041fc00 
0000000000000200
[    0.000000] 38a0: fffffc0008115374 0000000000000000 0000000000000000 
0000000000000001
[    0.000000] 38c0: 0000000000000000 0000000000000000 0000000000201200 
ffffff000041fc00
[    0.000000] 38e0: fffffc0008c43960 fffffc000810bc20 fffffc0008c43960 
fffffc0008c43960
[    0.000000] 3900: fffffc0008c43930 00000000ffffffd0 fffffc0008c43960 
fffffc0008c43960
[    0.000000] 3920: fffffc0008c43930 00000000ffffffd0 fffffc0008c43970 
fffffc0008221658
[    0.000000] 3940: 7f7f7f7f7f7f7f7f 0000000000000002 0101010101010101 
0000000000000020
[    0.000000] 3960: fffffc0008c43a70 fffffc0008221c04 0000000000000001 
00000000024080c0
[    0.000000] 3980: fffffc0008115374 fffffc0008bf8648 0000000000001000 
0000000000000000
[    0.000000] 39a0: ffffff000041fc00 0000000000000001 ffffff0ff691e840 
ffffff000041fc00
[    0.000000] 39c0: ffffff0ff691e840 0000000000001680 0000000000000000 
0000000000000000
[    0.000000] 39e0: 0000000100000000 0000000000000000 fffffc0008c43a70 
fffffc0008221e24
[    0.000000] 3a00: 0000000000000001 00000000024080c0 fffffc0008115374 
fffffc0008bf8648
[    0.000000] 3a20: 0000000000001000 0000000000000000 0000000000000000 
0000000000000001
[    0.000000] 3a40: ffffff0ff691e840 ffffff000041fc00 fffffc000928a1e8 
024080c000000006
[    0.000000] 3a60: fffffc0008ca6a38 000000000000005c fffffc0008c43b90 
fffffc0008239498
[    0.000000] 3a80: 00000000000000c0 ffffff000041fc00 ffffff0000424f00 
0000000000000070
[    0.000000] 3aa0: 0000000000000001 fffffc0008115374 ffffff000041fc00 
fffffc00093f1000
[    0.000000] 3ac0: ffffff0002000000 ffffff0000433000 fffffc0008c43bd0 
fffffc0008a308f0
[    0.000000] 3ae0: 0000000000010000 0000020000000000 0000000000000000 
0000000000000001
[    0.000000] 3b00: fffffc0008c43b30 fffffc000861f07c fffffc000941efc0 
00000000000000c0
[    0.000000] 3b20: ffffff0ffff44e60 00000000000000c0 fffffc0008c43b70 
fffffc000861f234
[    0.000000] 3b40: ffffff0ffff44e60 0000000000000004 ffffff0ffff44e60 
fffffc0008c43c70
[    0.000000] 3b60: 0000000000000000 fffffc0008a74460 fffffc0008c43ba0 
fffffc000861f3fc
[    0.000000] 3b80: fffffc0008c43ba0 fffffc00083ca55c fffffc0008c43bd0 
fffffc0008222c20
[    0.000000] 3ba0: ffffff000041fc00 00000000024080c0 ffffff0ff691e840 
fffffc0008115374
[    0.000000] 3bc0: 0000000000000001 00000000024080c0 fffffc0008c43c20 
fffffc0008115374
[    0.000000] 3be0: 0000000000000070 ffffff0ffff44e80 ffffff0ffff44e60 
0000000000000000
[    0.000000] 3c00: fffffc0008849a18 ffffffffffffffff 0000000000000000 
ffffff0000433000
[    0.000000] 3c20: fffffc0008c43c80 fffffc0008b461dc ffffff0000424e80 
2800000000000000
[    0.000000] 3c40: 0000000000010000 0000020000000000 0000000000000000 
0000000000000400
[    0.000000] 3c60: 0000000000000400 ffffff00004330f8 0000000000000001 
ffffff0ffffabe00
[    0.000000] 3c80: fffffc0008c43dc0 fffffc0008b462bc fffffc0008d33488 
fffffc0008d33000
[    0.000000] 3ca0: ffffff0ffff44e60 fffffc0008c6c840 ffffff0000424b00 
ffffff0000424880
[    0.000000] 3cc0: 0000000000000002 0000000000000000 0000000001bae074 
0000000001f1001c
[    0.000000] 3ce0: 0000000000000000 fffffc0008a30890 ffffff0000424b00 
fffffc0008849940
[    0.000000] 3d00: ffffff0000433020 fffffc0008a308f0 ffffff0000433008 
ffffff0ffff44e60
[    0.000000] 3d20: fffffc000ac00000 0000000000000008 0000000000000001 
8107000000000000
[    0.000000] 3d40: 00000000000000c0 0000000001000000 00000008fff44e60 
0000010002000000
[    0.000000] 3d60: 0000000000000100 81070000000000ff fffffc0008c43dc0 
0000000008b462cc
[    0.000000] 3d80: 0000901000020000 000090100021ffff ffffff0ffff44f08 
0000000000000200
[    0.000000] 3da0: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    0.000000] 3dc0: fffffc0008c43e10 fffffc0008b4543c fffffc0008c6c828 
fffffc0008d32000
[    0.000000] 3de0: fffffc0008c6c000 ffffff0ffff44470 fffffc0008849000 
ffffff0000424880
[    0.000000] 3e00: fffffc0008c43e10 fffffc0008b45420 fffffc0008c43e60 
fffffc0008b456bc
[    0.000000] 3e20: 0000000000000002 0000000000000003 0000000000000030 
ffffff0000424880
[    0.000000] 3e40: ffffff0ffff44470 0000000000000000 0000000000000018 
fffffc0008000000
[    0.000000] 3e60: fffffc0008c43f00 fffffc0008b5aec8 ffffff0000424700 
fffffc0008c43f60
[    0.000000] 3e80: fffffc0008c43f60 0000000000000000 fffffc0008c43f70 
fffffc0008d92000
[    0.000000] 3ea0: fffffc0008a734e0 fffffc0008a734b8 fffffc0008c43f00 
0000000208b5ae3c
[    0.000000] 3ec0: 0000000000000000 00009010805fffff ffffff0ffff44518 
0000000000000200
[    0.000000] 3ee0: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    0.000000] 3f00: fffffc0008c43f80 fffffc0008b43f9c fffffc0008c60000 
fffffc0008b66628
[    0.000000] 3f20: fffffc0008b66628 fffffc0008dc0000 fffffc0008c60000 
ffffff0ffffac580
[    0.000000] 3f40: 0000000002840000 0000000002870000 0000000000000020 
0000000000000000
[    0.000000] 3f60: fffffc0008c43f60 fffffc0008c43f60 fffffc0008c43f70 
fffffc0008c43f70
[    0.000000] 3f80: fffffc0008c43f90 fffffc0008b12d60 fffffc0008c43fa0 
fffffc0008b10a3c
[    0.000000] 3fa0: 0000000000000000 fffffc0008b101c4 0000010ff7a35218 
0000000000000e12
[    0.000000] 3fc0: 0000000021200000 0000000030d00980 0000000000000000 
0000000001400000
[    0.000000] 3fe0: 0000000000000000 fffffc0008b66628 0000000000000000 
0000000000000000
[    0.000000] Call trace:
[    0.000000] Exception stack(0xfffffc0008c436b0 to 0xfffffc0008c437e0)
[    0.000000] 36a0:                                   0000000000000000 
0000040000000000
[    0.000000] 36c0: fffffc0008c43880 fffffc00081c8950 ffffff0ffffaf180 
0000000000000003
[    0.000000] 36e0: fffffc0008c63000 00000000ffffffff 0000000000000001 
0000000000000000
[    0.000000] 3700: fffffc0008c43720 fffffc00081e25cc 0000000000000000 
0000000001bfff3f
[    0.000000] 3720: fffffc0008c43750 fffffc00081c8454 0000000000000012 
0000000000000000
[    0.000000] 3740: fffffffffffffff8 0000000000000012 fffffc0008c63bb0 
0000000000000000
[    0.000000] 3760: 0000000000000000 0000000000000000 0000000000000000 
0000000000000000
[    0.000000] 3780: fffffdffc00010a0 0000000001210111 7f7f7f7f7f7f7f7f 
0000000001bfff3f
[    0.000000] 37a0: fffffc0009334000 0000000000000020 6563697665442032 
3230303031402073
[    0.000000] 37c0: 2820303030303030 0000000000000000 0000000000000000 
0000000000000008
[    0.000000] [<fffffc00081c8950>] __alloc_pages_nodemask+0xa4/0xe68
[    0.000000] [<fffffc000821fa70>] new_slab+0xd0/0x564
[    0.000000] [<fffffc0008221e24>] ___slab_alloc+0x2e4/0x514
[    0.000000] [<fffffc0008239498>] __slab_alloc+0x48/0x58
[    0.000000] [<fffffc0008222c20>] __kmalloc_node+0xd0/0x2dc
[    0.000000] [<fffffc0008115374>] __irq_domain_add+0x7c/0x164
[    0.000000] [<fffffc0008b461dc>] its_probe+0x784/0x81c
[    0.000000] [<fffffc0008b462bc>] its_init+0x48/0x1b0
[    0.000000] [<fffffc0008b4543c>] gic_init_bases+0x228/0x360
[    0.000000] [<fffffc0008b456bc>] gic_of_init+0x148/0x1cc
[    0.000000] [<fffffc0008b5aec8>] of_irq_init+0x184/0x298
[    0.000000] [<fffffc0008b43f9c>] irqchip_init+0x14/0x38
[    0.000000] [<fffffc0008b12d60>] init_IRQ+0xc/0x30
[    0.000000] [<fffffc0008b10a3c>] start_kernel+0x240/0x3b8
[    0.000000] [<fffffc0008b101c4>] __primary_switched+0x30/0x6c
[    0.000000] Code: 912ec2a0 b9403809 0a0902fb 37b007db (f9400300)
[    0.000000] ---[ end trace 0000000000000000 ]---
[    0.000000] Kernel panic - not syncing: Fatal exception
[    0.000000] ---[ end Kernel panic - not syncing: Fatal exception


Same thing on v4.8.x and v4.9-rc?




>
> -Robert
>

^ permalink raw reply

* [PATCH 02/12] ASoC: dapm: Implement stereo mixer control support
From: Mark Brown @ 2016-10-26 16:57 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20161003110804.28235-3-wens@csie.org>

On Mon, Oct 03, 2016 at 07:07:54PM +0800, Chen-Yu Tsai wrote:

> While DAPM is mono or single channel, its controls can be shared between
> widgets, such as sharing one stereo mixer control between the left and
> right channel widgets.

> This patch introduces support for such shared mixer controls.

Based on this changelog I'm really not sure what the intended semantic
of this change is which makes it difficult to review.  What are you
expecting these controls to look like and how are you expecting them to
work?

> -static void dapm_set_mixer_path_status(struct snd_soc_dapm_path *p, int i)
> +static void dapm_set_mixer_path_status(struct snd_soc_dapm_path *p, int i,
> +				       int nth_path)

It looks like the goal is to attach more than one path to a single
control somehow?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20161026/f0e9a8c2/attachment.sig>

^ permalink raw reply

* Pinctrl nodes missing for USB
From: Krzysztof Kozlowski @ 2016-10-26 16:53 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CANAwSgQ=pp93tDAERQ1iaryY3_pVhTeun=RaTo9ws1UKtS1PhA@mail.gmail.com>

On Wed, Oct 26, 2016 at 05:56:54PM +0530, Anand Moon wrote:
> Hi All,
> 
> I have tried to enable CONFIG_DEBUG_PINCTRL=y on Odroid XU4.
> Just to try to understand the feature.
> Is this feature suppoted for USB nodes.
> 
> Below is the output of failed to pase pinctrl for USB nodes via dts.

I do not see any question here...

Anyway the devices not instantiated from DT will have such warning and
USB devices are not present in DT, from obvious reasons... However what
surprises me is why pinctrl_dt_to_map() was called for USB devices?

Best regards,
Krzysztof

> 
> [   11.627809] samsung-pinctrl 13400000.pinctrl: request pin 39
> (gpx3-7) for gpx3:39
> [   11.726818] xhci-hcd xhci-hcd.2.auto: no of_node; not parsing pinctrl DT
> [   11.801452] usb usb3: no of_node; not parsing pinctrl DT
> [   11.805471] hub 3-0:1.0: no of_node; not parsing pinctrl DT
> [   11.883263] usb usb4: no of_node; not parsing pinctrl DT
> [   11.887362] hub 4-0:1.0: no of_node; not parsing pinctrl DT
> [   11.926683] xhci-hcd xhci-hcd.5.auto: no of_node; not parsing pinctrl DT
> [   11.999588] usb usb5: no of_node; not parsing pinctrl DT
> [   12.003208] hub 5-0:1.0: no of_node; not parsing pinctrl DT
> [   12.085100] usb usb6: no of_node; not parsing pinctrl DT
> [   12.088936] hub 6-0:1.0: no of_node; not parsing pinctrl DT
> [   12.491299] usb 3-1: no of_node; not parsing pinctrl DT
> [   12.528446] hub 3-1:1.0: no of_node; not parsing pinctrl DT
> [   12.555071] usb 4-1: no of_node; not parsing pinctrl DT
> [   12.611412] hub 4-1:1.0: no of_node; not parsing pinctrl DT
> [   13.020668] usb 4-1.1: no of_node; not parsing pinctrl DT
> [   13.081803] usb-storage 4-1.1:1.0: no of_node; not parsing pinctrl DT
> [   13.091721] usb 5-1: no of_node; not parsing pinctrl DT
> [   13.127124] r8152 5-1:2.0: no of_node; not parsing pinctrl DT
> [   13.208321] r8152 5-1:1.0: no of_node; not parsing pinctrl DT
> [   14.281196] sd 0:0:0:0: no of_node; not parsing pinctrl DT
> [   16.057197] usb 4-1.2: no of_node; not parsing pinctrl DT
> [   16.079507] usb-storage 4-1.2:1.0: no of_node; not parsing pinctrl DT
> [   17.236626] sd 1:0:0:0: no of_node; not parsing pinctrl DT
> [   17.612139] usbhid 2-1:1.0: no of_node; not parsing pinctrl DT
> [   17.625511] usbhid 2-1:1.1: no of_node; not parsing pinctrl DT
> [   17.755059] hid-generic 0003:24AE:1000.0001: no of_node; not
> parsing pinctrl DT
> [   17.933665] hid-generic 0003:24AE:1000.0002: no of_node; not
> parsing pinctrl DT
> [ 1009.259380] usb 4-1.2: no of_node; not parsing pinctrl DT
> [ 1009.267240] usb-storage 4-1.2:1.0: no of_node; not parsing pinctrl DT
> [ 1010.311832] sd 1:0:0:0: no of_node; not parsing pinctrl DT
> 
> 
> Below is the complete output of dmesg | grep pinctr
> -------------------------------------
> root at odroidcsh:/usr/src/odroidxu3-4.y-devel# dmesg | grep pinc
> [    1.704176] pinctrl core: initialized pinctrl subsystem
> [    1.716053] reg-dummy reg-dummy: no of_node; not parsing pinctrl DT
> [    2.221885] samsung-pinctrl 13400000.pinctrl: try to register 40 pins ...
> [    2.221925] pinctrl core: registered pin 0 (gpy7-0) on samsung-pinctrl
> [    2.222005] pinctrl core: registered pin 1 (gpy7-1) on samsung-pinctrl
> [    2.222041] pinctrl core: registered pin 2 (gpy7-2) on samsung-pinctrl
> [    2.222077] pinctrl core: registered pin 3 (gpy7-3) on samsung-pinctrl
> [    2.222113] pinctrl core: registered pin 4 (gpy7-4) on samsung-pinctrl
> [    2.222148] pinctrl core: registered pin 5 (gpy7-5) on samsung-pinctrl
> [    2.222183] pinctrl core: registered pin 6 (gpy7-6) on samsung-pinctrl
> [    2.222217] pinctrl core: registered pin 7 (gpy7-7) on samsung-pinctrl
> [    2.222275] pinctrl core: registered pin 8 (gpx0-0) on samsung-pinctrl
> [    2.222320] pinctrl core: registered pin 9 (gpx0-1) on samsung-pinctrl
> [    2.222364] pinctrl core: registered pin 10 (gpx0-2) on samsung-pinctrl
> [    2.222406] pinctrl core: registered pin 11 (gpx0-3) on samsung-pinctrl
> [    2.222449] pinctrl core: registered pin 12 (gpx0-4) on samsung-pinctrl
> [    2.222491] pinctrl core: registered pin 13 (gpx0-5) on samsung-pinctrl
> [    2.222532] pinctrl core: registered pin 14 (gpx0-6) on samsung-pinctrl
> [    2.222573] pinctrl core: registered pin 15 (gpx0-7) on samsung-pinctrl
> [    2.222614] pinctrl core: registered pin 16 (gpx1-0) on samsung-pinctrl
> [    2.222653] pinctrl core: registered pin 17 (gpx1-1) on samsung-pinctrl
> [    2.222693] pinctrl core: registered pin 18 (gpx1-2) on samsung-pinctrl
> [    2.222732] pinctrl core: registered pin 19 (gpx1-3) on samsung-pinctrl
> [    2.222771] pinctrl core: registered pin 20 (gpx1-4) on samsung-pinctrl
> [    2.222809] pinctrl core: registered pin 21 (gpx1-5) on samsung-pinctrl
> [    2.222847] pinctrl core: registered pin 22 (gpx1-6) on samsung-pinctrl
> [    2.222885] pinctrl core: registered pin 23 (gpx1-7) on samsung-pinctrl
> [    2.222922] pinctrl core: registered pin 24 (gpx2-0) on samsung-pinctrl
> [    2.222958] pinctrl core: registered pin 25 (gpx2-1) on samsung-pinctrl
> [    2.222994] pinctrl core: registered pin 26 (gpx2-2) on samsung-pinctrl
> [    2.223030] pinctrl core: registered pin 27 (gpx2-3) on samsung-pinctrl
> [    2.223065] pinctrl core: registered pin 28 (gpx2-4) on samsung-pinctrl
> [    2.223100] pinctrl core: registered pin 29 (gpx2-5) on samsung-pinctrl
> [    2.223134] pinctrl core: registered pin 30 (gpx2-6) on samsung-pinctrl
> [    2.223168] pinctrl core: registered pin 31 (gpx2-7) on samsung-pinctrl
> [    2.223202] pinctrl core: registered pin 32 (gpx3-0) on samsung-pinctrl
> [    2.223258] pinctrl core: registered pin 33 (gpx3-1) on samsung-pinctrl
> [    2.223302] pinctrl core: registered pin 34 (gpx3-2) on samsung-pinctrl
> [    2.223345] pinctrl core: registered pin 35 (gpx3-3) on samsung-pinctrl
> [    2.223388] pinctrl core: registered pin 36 (gpx3-4) on samsung-pinctrl
> [    2.223430] pinctrl core: registered pin 37 (gpx3-5) on samsung-pinctrl
> [    2.223471] pinctrl core: registered pin 38 (gpx3-6) on samsung-pinctrl
> [    2.223512] pinctrl core: registered pin 39 (gpx3-7) on samsung-pinctrl
> [    2.324367] samsung-pinctrl 13410000.pinctrl: try to register 85 pins ...
> [    2.324441] pinctrl core: registered pin 40 (gpc0-0) on samsung-pinctrl
> [    2.324501] pinctrl core: registered pin 41 (gpc0-1) on samsung-pinctrl
> [    2.324547] pinctrl core: registered pin 42 (gpc0-2) on samsung-pinctrl
> [    2.324591] pinctrl core: registered pin 43 (gpc0-3) on samsung-pinctrl
> [    2.324634] pinctrl core: registered pin 44 (gpc0-4) on samsung-pinctrl
> [    2.324676] pinctrl core: registered pin 45 (gpc0-5) on samsung-pinctrl
> [    2.324718] pinctrl core: registered pin 46 (gpc0-6) on samsung-pinctrl
> [    2.324760] pinctrl core: registered pin 47 (gpc0-7) on samsung-pinctrl
> [    2.324801] pinctrl core: registered pin 48 (gpc1-0) on samsung-pinctrl
> [    2.324841] pinctrl core: registered pin 49 (gpc1-1) on samsung-pinctrl
> [    2.324881] pinctrl core: registered pin 50 (gpc1-2) on samsung-pinctrl
> [    2.324921] pinctrl core: registered pin 51 (gpc1-3) on samsung-pinctrl
> [    2.324960] pinctrl core: registered pin 52 (gpc1-4) on samsung-pinctrl
> [    2.324999] pinctrl core: registered pin 53 (gpc1-5) on samsung-pinctrl
> [    2.325038] pinctrl core: registered pin 54 (gpc1-6) on samsung-pinctrl
> [    2.325076] pinctrl core: registered pin 55 (gpc1-7) on samsung-pinctrl
> [    2.325113] pinctrl core: registered pin 56 (gpc2-0) on samsung-pinctrl
> [    2.325151] pinctrl core: registered pin 57 (gpc2-1) on samsung-pinctrl
> [    2.325187] pinctrl core: registered pin 58 (gpc2-2) on samsung-pinctrl
> [    2.325224] pinctrl core: registered pin 59 (gpc2-3) on samsung-pinctrl
> [    2.325259] pinctrl core: registered pin 60 (gpc2-4) on samsung-pinctrl
> [    2.325295] pinctrl core: registered pin 61 (gpc2-5) on samsung-pinctrl
> [    2.325330] pinctrl core: registered pin 62 (gpc2-6) on samsung-pinctrl
> [    2.325365] pinctrl core: registered pin 63 (gpc3-0) on samsung-pinctrl
> [    2.325468] pinctrl core: registered pin 64 (gpc3-1) on samsung-pinctrl
> [    2.325503] pinctrl core: registered pin 65 (gpc3-2) on samsung-pinctrl
> [    2.325560] pinctrl core: registered pin 66 (gpc3-3) on samsung-pinctrl
> [    2.325604] pinctrl core: registered pin 67 (gpc4-0) on samsung-pinctrl
> [    2.325647] pinctrl core: registered pin 68 (gpc4-1) on samsung-pinctrl
> [    2.325795] pinctrl core: registered pin 69 (gpd1-0) on samsung-pinctrl
> [    2.325839] pinctrl core: registered pin 70 (gpd1-1) on samsung-pinctrl
> [    2.325881] pinctrl core: registered pin 71 (gpd1-2) on samsung-pinctrl
> [    2.325923] pinctrl core: registered pin 72 (gpd1-3) on samsung-pinctrl
> [    2.325963] pinctrl core: registered pin 73 (gpd1-4) on samsung-pinctrl
> [    2.326004] pinctrl core: registered pin 74 (gpd1-5) on samsung-pinctrl
> [    2.326044] pinctrl core: registered pin 75 (gpd1-6) on samsung-pinctrl
> [    2.326084] pinctrl core: registered pin 76 (gpd1-7) on samsung-pinctrl
> [    2.326123] pinctrl core: registered pin 77 (gpy0-0) on samsung-pinctrl
> [    2.326163] pinctrl core: registered pin 78 (gpy0-1) on samsung-pinctrl
> [    2.326201] pinctrl core: registered pin 79 (gpy0-2) on samsung-pinctrl
> [    2.326239] pinctrl core: registered pin 80 (gpy0-3) on samsung-pinctrl
> [    2.326277] pinctrl core: registered pin 81 (gpy0-4) on samsung-pinctrl
> [    2.326314] pinctrl core: registered pin 82 (gpy0-5) on samsung-pinctrl
> [    2.326351] pinctrl core: registered pin 83 (gpy1-0) on samsung-pinctrl
> [    2.326387] pinctrl core: registered pin 84 (gpy1-1) on samsung-pinctrl
> [    2.326423] pinctrl core: registered pin 85 (gpy1-2) on samsung-pinctrl
> [    2.326459] pinctrl core: registered pin 86 (gpy1-3) on samsung-pinctrl
> [    2.326493] pinctrl core: registered pin 87 (gpy2-0) on samsung-pinctrl
> [    2.326528] pinctrl core: registered pin 88 (gpy2-1) on samsung-pinctrl
> [    2.326562] pinctrl core: registered pin 89 (gpy2-2) on samsung-pinctrl
> [    2.326596] pinctrl core: registered pin 90 (gpy2-3) on samsung-pinctrl
> [    2.326653] pinctrl core: registered pin 91 (gpy2-4) on samsung-pinctrl
> [    2.326697] pinctrl core: registered pin 92 (gpy2-5) on samsung-pinctrl
> [    2.326740] pinctrl core: registered pin 93 (gpy3-0) on samsung-pinctrl
> [    2.326782] pinctrl core: registered pin 94 (gpy3-1) on samsung-pinctrl
> [    2.326824] pinctrl core: registered pin 95 (gpy3-2) on samsung-pinctrl
> [    2.326866] pinctrl core: registered pin 96 (gpy3-3) on samsung-pinctrl
> [    2.326908] pinctrl core: registered pin 97 (gpy3-4) on samsung-pinctrl
> [    2.326949] pinctrl core: registered pin 98 (gpy3-5) on samsung-pinctrl
> [    2.326990] pinctrl core: registered pin 99 (gpy3-6) on samsung-pinctrl
> [    2.327030] pinctrl core: registered pin 100 (gpy3-7) on samsung-pinctrl
> [    2.327070] pinctrl core: registered pin 101 (gpy4-0) on samsung-pinctrl
> [    2.327110] pinctrl core: registered pin 102 (gpy4-1) on samsung-pinctrl
> [    2.327148] pinctrl core: registered pin 103 (gpy4-2) on samsung-pinctrl
> [    2.327187] pinctrl core: registered pin 104 (gpy4-3) on samsung-pinctrl
> [    2.327225] pinctrl core: registered pin 105 (gpy4-4) on samsung-pinctrl
> [    2.327263] pinctrl core: registered pin 106 (gpy4-5) on samsung-pinctrl
> [    2.327300] pinctrl core: registered pin 107 (gpy4-6) on samsung-pinctrl
> [    2.327337] pinctrl core: registered pin 108 (gpy4-7) on samsung-pinctrl
> [    2.327373] pinctrl core: registered pin 109 (gpy5-0) on samsung-pinctrl
> [    2.327409] pinctrl core: registered pin 110 (gpy5-1) on samsung-pinctrl
> [    2.327445] pinctrl core: registered pin 111 (gpy5-2) on samsung-pinctrl
> [    2.327479] pinctrl core: registered pin 112 (gpy5-3) on samsung-pinctrl
> [    2.327514] pinctrl core: registered pin 113 (gpy5-4) on samsung-pinctrl
> [    2.327548] pinctrl core: registered pin 114 (gpy5-5) on samsung-pinctrl
> [    2.327583] pinctrl core: registered pin 115 (gpy5-6) on samsung-pinctrl
> [    2.327639] pinctrl core: registered pin 116 (gpy5-7) on samsung-pinctrl
> [    2.327683] pinctrl core: registered pin 117 (gpy6-0) on samsung-pinctrl
> [    2.327726] pinctrl core: registered pin 118 (gpy6-1) on samsung-pinctrl
> [    2.327769] pinctrl core: registered pin 119 (gpy6-2) on samsung-pinctrl
> [    2.327812] pinctrl core: registered pin 120 (gpy6-3) on samsung-pinctrl
> [    2.327853] pinctrl core: registered pin 121 (gpy6-4) on samsung-pinctrl
> [    2.327894] pinctrl core: registered pin 122 (gpy6-5) on samsung-pinctrl
> [    2.327935] pinctrl core: registered pin 123 (gpy6-6) on samsung-pinctrl
> [    2.327976] pinctrl core: registered pin 124 (gpy6-7) on samsung-pinctrl
> [    2.381195] samsung-pinctrl 14000000.pinctrl: try to register 46 pins ...
> [    2.381304] pinctrl core: registered pin 125 (gpe0-0) on samsung-pinctrl
> [    2.381343] pinctrl core: registered pin 126 (gpe0-1) on samsung-pinctrl
> [    2.381381] pinctrl core: registered pin 127 (gpe0-2) on samsung-pinctrl
> [    2.381452] pinctrl core: registered pin 128 (gpe0-3) on samsung-pinctrl
> [    2.381489] pinctrl core: registered pin 129 (gpe0-4) on samsung-pinctrl
> [    2.381526] pinctrl core: registered pin 130 (gpe0-5) on samsung-pinctrl
> [    2.381562] pinctrl core: registered pin 131 (gpe0-6) on samsung-pinctrl
> [    2.381597] pinctrl core: registered pin 132 (gpe0-7) on samsung-pinctrl
> [    2.381633] pinctrl core: registered pin 133 (gpe1-0) on samsung-pinctrl
> [    2.381668] pinctrl core: registered pin 134 (gpe1-1) on samsung-pinctrl
> [    2.381702] pinctrl core: registered pin 135 (gpf0-0) on samsung-pinctrl
> [    2.381737] pinctrl core: registered pin 136 (gpf0-1) on samsung-pinctrl
> [    2.381794] pinctrl core: registered pin 137 (gpf0-2) on samsung-pinctrl
> [    2.381838] pinctrl core: registered pin 138 (gpf0-3) on samsung-pinctrl
> [    2.381881] pinctrl core: registered pin 139 (gpf0-4) on samsung-pinctrl
> [    2.381923] pinctrl core: registered pin 140 (gpf0-5) on samsung-pinctrl
> [    2.381965] pinctrl core: registered pin 141 (gpf1-0) on samsung-pinctrl
> [    2.382006] pinctrl core: registered pin 142 (gpf1-1) on samsung-pinctrl
> [    2.382048] pinctrl core: registered pin 143 (gpf1-2) on samsung-pinctrl
> [    2.382089] pinctrl core: registered pin 144 (gpf1-3) on samsung-pinctrl
> [    2.382129] pinctrl core: registered pin 145 (gpf1-4) on samsung-pinctrl
> [    2.382169] pinctrl core: registered pin 146 (gpf1-5) on samsung-pinctrl
> [    2.382209] pinctrl core: registered pin 147 (gpf1-6) on samsung-pinctrl
> [    2.382248] pinctrl core: registered pin 148 (gpf1-7) on samsung-pinctrl
> [    2.382287] pinctrl core: registered pin 149 (gpg0-0) on samsung-pinctrl
> [    2.382326] pinctrl core: registered pin 150 (gpg0-1) on samsung-pinctrl
> [    2.382363] pinctrl core: registered pin 151 (gpg0-2) on samsung-pinctrl
> [    2.382400] pinctrl core: registered pin 152 (gpg0-3) on samsung-pinctrl
> [    2.382437] pinctrl core: registered pin 153 (gpg0-4) on samsung-pinctrl
> [    2.382473] pinctrl core: registered pin 154 (gpg0-5) on samsung-pinctrl
> [    2.382509] pinctrl core: registered pin 155 (gpg0-6) on samsung-pinctrl
> [    2.382544] pinctrl core: registered pin 156 (gpg0-7) on samsung-pinctrl
> [    2.382580] pinctrl core: registered pin 157 (gpg1-0) on samsung-pinctrl
> [    2.382614] pinctrl core: registered pin 158 (gpg1-1) on samsung-pinctrl
> [    2.382649] pinctrl core: registered pin 159 (gpg1-2) on samsung-pinctrl
> [    2.382683] pinctrl core: registered pin 160 (gpg1-3) on samsung-pinctrl
> [    2.382717] pinctrl core: registered pin 161 (gpg1-4) on samsung-pinctrl
> [    2.382774] pinctrl core: registered pin 162 (gpg1-5) on samsung-pinctrl
> [    2.382818] pinctrl core: registered pin 163 (gpg1-6) on samsung-pinctrl
> [    2.382861] pinctrl core: registered pin 164 (gpg1-7) on samsung-pinctrl
> [    2.382903] pinctrl core: registered pin 165 (gpg2-0) on samsung-pinctrl
> [    2.382945] pinctrl core: registered pin 166 (gpg2-1) on samsung-pinctrl
> [    2.382987] pinctrl core: registered pin 167 (gpj4-0) on samsung-pinctrl
> [    2.383027] pinctrl core: registered pin 168 (gpj4-1) on samsung-pinctrl
> [    2.383068] pinctrl core: registered pin 169 (gpj4-2) on samsung-pinctrl
> [    2.383108] pinctrl core: registered pin 170 (gpj4-3) on samsung-pinctrl
> [    2.443773] samsung-pinctrl 14010000.pinctrl: try to register 54 pins ...
> [    2.443876] pinctrl core: registered pin 171 (gpa0-0) on samsung-pinctrl
> [    2.443912] pinctrl core: registered pin 172 (gpa0-1) on samsung-pinctrl
> [    2.443948] pinctrl core: registered pin 173 (gpa0-2) on samsung-pinctrl
> [    2.443983] pinctrl core: registered pin 174 (gpa0-3) on samsung-pinctrl
> [    2.444041] pinctrl core: registered pin 175 (gpa0-4) on samsung-pinctrl
> [    2.444085] pinctrl core: registered pin 176 (gpa0-5) on samsung-pinctrl
> [    2.444129] pinctrl core: registered pin 177 (gpa0-6) on samsung-pinctrl
> [    2.444172] pinctrl core: registered pin 178 (gpa0-7) on samsung-pinctrl
> [    2.444213] pinctrl core: registered pin 179 (gpa1-0) on samsung-pinctrl
> [    2.444255] pinctrl core: registered pin 180 (gpa1-1) on samsung-pinctrl
> [    2.444297] pinctrl core: registered pin 181 (gpa1-2) on samsung-pinctrl
> [    2.444338] pinctrl core: registered pin 182 (gpa1-3) on samsung-pinctrl
> [    2.444379] pinctrl core: registered pin 183 (gpa1-4) on samsung-pinctrl
> [    2.444419] pinctrl core: registered pin 184 (gpa1-5) on samsung-pinctrl
> [    2.444458] pinctrl core: registered pin 185 (gpa2-0) on samsung-pinctrl
> [    2.444497] pinctrl core: registered pin 186 (gpa2-1) on samsung-pinctrl
> [    2.444536] pinctrl core: registered pin 187 (gpa2-2) on samsung-pinctrl
> [    2.444575] pinctrl core: registered pin 188 (gpa2-3) on samsung-pinctrl
> [    2.444612] pinctrl core: registered pin 189 (gpa2-4) on samsung-pinctrl
> [    2.444650] pinctrl core: registered pin 190 (gpa2-5) on samsung-pinctrl
> [    2.444687] pinctrl core: registered pin 191 (gpa2-6) on samsung-pinctrl
> [    2.444756] pinctrl core: registered pin 192 (gpa2-7) on samsung-pinctrl
> [    2.444792] pinctrl core: registered pin 193 (gpb0-0) on samsung-pinctrl
> [    2.444828] pinctrl core: registered pin 194 (gpb0-1) on samsung-pinctrl
> [    2.444864] pinctrl core: registered pin 195 (gpb0-2) on samsung-pinctrl
> [    2.444899] pinctrl core: registered pin 196 (gpb0-3) on samsung-pinctrl
> [    2.444934] pinctrl core: registered pin 197 (gpb0-4) on samsung-pinctrl
> [    2.444968] pinctrl core: registered pin 198 (gpb1-0) on samsung-pinctrl
> [    2.445002] pinctrl core: registered pin 199 (gpb1-1) on samsung-pinctrl
> [    2.445059] pinctrl core: registered pin 200 (gpb1-2) on samsung-pinctrl
> [    2.445102] pinctrl core: registered pin 201 (gpb1-3) on samsung-pinctrl
> [    2.445145] pinctrl core: registered pin 202 (gpb1-4) on samsung-pinctrl
> [    2.445188] pinctrl core: registered pin 203 (gpb2-0) on samsung-pinctrl
> [    2.445231] pinctrl core: registered pin 204 (gpb2-1) on samsung-pinctrl
> [    2.445273] pinctrl core: registered pin 205 (gpb2-2) on samsung-pinctrl
> [    2.445314] pinctrl core: registered pin 206 (gpb2-3) on samsung-pinctrl
> [    2.445355] pinctrl core: registered pin 207 (gpb3-0) on samsung-pinctrl
> [    2.445395] pinctrl core: registered pin 208 (gpb3-1) on samsung-pinctrl
> [    2.445435] pinctrl core: registered pin 209 (gpb3-2) on samsung-pinctrl
> [    2.445475] pinctrl core: registered pin 210 (gpb3-3) on samsung-pinctrl
> [    2.445514] pinctrl core: registered pin 211 (gpb3-4) on samsung-pinctrl
> [    2.445553] pinctrl core: registered pin 212 (gpb3-5) on samsung-pinctrl
> [    2.445591] pinctrl core: registered pin 213 (gpb3-6) on samsung-pinctrl
> [    2.445629] pinctrl core: registered pin 214 (gpb3-7) on samsung-pinctrl
> [    2.445766] pinctrl core: registered pin 215 (gpb4-0) on samsung-pinctrl
> [    2.445806] pinctrl core: registered pin 216 (gpb4-1) on samsung-pinctrl
> [    2.445843] pinctrl core: registered pin 217 (gph0-0) on samsung-pinctrl
> [    2.445879] pinctrl core: registered pin 218 (gph0-1) on samsung-pinctrl
> [    2.445915] pinctrl core: registered pin 219 (gph0-2) on samsung-pinctrl
> [    2.445950] pinctrl core: registered pin 220 (gph0-3) on samsung-pinctrl
> [    2.445985] pinctrl core: registered pin 221 (gph0-4) on samsung-pinctrl
> [    2.446019] pinctrl core: registered pin 222 (gph0-5) on samsung-pinctrl
> [    2.446053] pinctrl core: registered pin 223 (gph0-6) on samsung-pinctrl
> [    2.446088] pinctrl core: registered pin 224 (gph0-7) on samsung-pinctrl
> [    2.459704] samsung-pinctrl 3860000.pinctrl: try to register 7 pins ...
> [    2.459809] pinctrl core: registered pin 225 (gpz-0) on samsung-pinctrl
> [    2.459849] pinctrl core: registered pin 226 (gpz-1) on samsung-pinctrl
> [    2.459888] pinctrl core: registered pin 227 (gpz-2) on samsung-pinctrl
> [    2.459927] pinctrl core: registered pin 228 (gpz-3) on samsung-pinctrl
> [    2.459965] pinctrl core: registered pin 229 (gpz-4) on samsung-pinctrl
> [    2.460003] pinctrl core: registered pin 230 (gpz-5) on samsung-pinctrl
> [    2.460040] pinctrl core: registered pin 231 (gpz-6) on samsung-pinctrl
> [    2.939603] pinctrl core: add 4 pinctrl maps
> [    2.939841] samsung-pinctrl 14010000.pinctrl: found group selector
> 6 for gpa0-6
> [    2.939894] samsung-pinctrl 14010000.pinctrl: found group selector
> 6 for gpa0-6
> [    2.939944] samsung-pinctrl 14010000.pinctrl: found group selector
> 7 for gpa0-7
> [    2.939992] samsung-pinctrl 14010000.pinctrl: found group selector
> 7 for gpa0-7
> [    2.940022] samsung-pinctrl 14010000.pinctrl: request pin 177
> (gpa0-6) for 12c80000.i2c
> [    2.940089] samsung-pinctrl 14010000.pinctrl: request pin 178
> (gpa0-7) for 12c80000.i2c
> [    2.941356] s3c-i2c 12c80000.i2c: obtain a copy of previously claimed pinctrl
> [    4.370371] alarmtimer alarmtimer: no of_node; not parsing pinctrl DT
> [    5.154339] pinctrl core: add 2 pinctrl maps
> [    5.154682] pinctrl core: add 2 pinctrl maps
> [    5.154943] samsung-pinctrl 14010000.pinctrl: found group selector
> 32 for gpb2-0
> [    5.155011] samsung-pinctrl 14010000.pinctrl: found group selector
> 32 for gpb2-0
> [    5.155082] samsung-pinctrl 14010000.pinctrl: found group selector
> 34 for gpb2-2
> [    5.155148] samsung-pinctrl 14010000.pinctrl: found group selector
> 34 for gpb2-2
> [    5.155183] samsung-pinctrl 14010000.pinctrl: request pin 203
> (gpb2-0) for 12dd0000.pwm
> [    5.155224] samsung-pinctrl 14010000.pinctrl: request pin 205
> (gpb2-2) for 12dd0000.pwm
> [    6.901592] serial8250 serial8250: no of_node; not parsing pinctrl DT
> [    9.157724] pinctrl core: add 2 pinctrl maps
> [    9.157952] samsung-pinctrl 13400000.pinctrl: found group selector
> 39 for gpx3-7
> [    9.158011] samsung-pinctrl 13400000.pinctrl: found group selector
> 39 for gpx3-7
> [    9.158041] samsung-pinctrl 13400000.pinctrl: request pin 39
> (gpx3-7) for 14530000.hdmi
> [    9.158853] samsung-pinctrl 13400000.pinctrl: request pin 39
> (gpx3-7) for gpx3:39
> [    9.169059] exynos-drm exynos-drm: no of_node; not parsing pinctrl DT
> [    9.683767] usb usb1: no of_node; not parsing pinctrl DT
> [    9.688758] hub 1-0:1.0: no of_node; not parsing pinctrl DT
> [    9.854041] usb usb2: no of_node; not parsing pinctrl DT
> [    9.857966] hub 2-0:1.0: no of_node; not parsing pinctrl DT
> [    9.925566] pinctrl core: add 4 pinctrl maps
> [    9.925744] samsung-pinctrl 14010000.pinctrl: found group selector
> 14 for gpa2-0
> [    9.925992] samsung-pinctrl 14010000.pinctrl: found group selector
> 14 for gpa2-0
> [    9.926046] samsung-pinctrl 14010000.pinctrl: found group selector
> 15 for gpa2-1
> [    9.926092] samsung-pinctrl 14010000.pinctrl: found group selector
> 15 for gpa2-1
> [    9.926122] samsung-pinctrl 14010000.pinctrl: request pin 185
> (gpa2-0) for 12ca0000.i2c
> [    9.926155] samsung-pinctrl 14010000.pinctrl: request pin 186
> (gpa2-1) for 12ca0000.i2c
> [    9.938344] pinctrl core: add 2 pinctrl maps
> [    9.938564] samsung-pinctrl 13400000.pinctrl: found group selector
> 12 for gpx0-4
> [    9.938620] samsung-pinctrl 13400000.pinctrl: found group selector
> 12 for gpx0-4
> [    9.938649] samsung-pinctrl 13400000.pinctrl: request pin 12
> (gpx0-4) for 4-0066
> [    9.951595] s2mps11-pmic s2mps11-regulator: no of_node; not parsing
> pinctrl DT
> [   10.354652] s5m-rtc s2mps14-rtc: no of_node; not parsing pinctrl DT
> [   10.358618] dummy 4-0006: no of_node; not parsing pinctrl DT
> [   10.391220] s2mps11-clk s2mps11-clk: no of_node; not parsing pinctrl DT
> [   10.504969] cpufreq-dt cpufreq-dt: no of_node; not parsing pinctrl DT
> [   10.605180] pinctrl core: add 2 pinctrl maps
> [   10.605286] samsung-pinctrl 13410000.pinctrl: found group selector
> 29 for gpd1-0
> [   10.605313] samsung-pinctrl 13410000.pinctrl: found group selector
> 29 for gpd1-0
> [   10.605331] samsung-pinctrl 13410000.pinctrl: request pin 69
> (gpd1-0) for pwrseq
> [   10.605645] samsung-pinctrl 13410000.pinctrl: request pin 69
> (gpd1-0) for gpd1:69
> [   10.623242] pinctrl core: add 2 pinctrl maps
> [   10.623392] pinctrl core: add 2 pinctrl maps
> [   10.623536] pinctrl core: add 2 pinctrl maps
> [   10.623706] pinctrl core: add 6 pinctrl maps
> [   10.623878] pinctrl core: add 8 pinctrl maps
> [   10.624024] pinctrl core: add 2 pinctrl maps
> [   10.624174] pinctrl core: add 2 pinctrl maps
> [   10.624278] samsung-pinctrl 13410000.pinctrl: found group selector
> 0 for gpc0-0
> [   10.624307] samsung-pinctrl 13410000.pinctrl: found group selector
> 0 for gpc0-0
> [   10.624335] samsung-pinctrl 13410000.pinctrl: found group selector
> 1 for gpc0-1
> [   10.624362] samsung-pinctrl 13410000.pinctrl: found group selector
> 1 for gpc0-1
> [   10.624389] samsung-pinctrl 13410000.pinctrl: found group selector
> 3 for gpc0-3
> [   10.624415] samsung-pinctrl 13410000.pinctrl: found group selector
> 3 for gpc0-3
> [   10.624442] samsung-pinctrl 13410000.pinctrl: found group selector
> 4 for gpc0-4
> [   10.624467] samsung-pinctrl 13410000.pinctrl: found group selector
> 4 for gpc0-4
> [   10.624493] samsung-pinctrl 13410000.pinctrl: found group selector
> 5 for gpc0-5
> [   10.624518] samsung-pinctrl 13410000.pinctrl: found group selector
> 5 for gpc0-5
> [   10.624543] samsung-pinctrl 13410000.pinctrl: found group selector
> 6 for gpc0-6
> [   10.624568] samsung-pinctrl 13410000.pinctrl: found group selector
> 6 for gpc0-6
> [   10.624594] samsung-pinctrl 13410000.pinctrl: found group selector
> 23 for gpc3-0
> [   10.624619] samsung-pinctrl 13410000.pinctrl: found group selector
> 23 for gpc3-0
> [   10.624644] samsung-pinctrl 13410000.pinctrl: found group selector
> 24 for gpc3-1
> [   10.624668] samsung-pinctrl 13410000.pinctrl: found group selector
> 24 for gpc3-1
> [   10.624693] samsung-pinctrl 13410000.pinctrl: found group selector
> 25 for gpc3-2
> [   10.624717] samsung-pinctrl 13410000.pinctrl: found group selector
> 25 for gpc3-2
> [   10.624755] samsung-pinctrl 13410000.pinctrl: found group selector
> 26 for gpc3-3
> [   10.624785] samsung-pinctrl 13410000.pinctrl: found group selector
> 26 for gpc3-3
> [   10.624815] samsung-pinctrl 13410000.pinctrl: found group selector
> 2 for gpc0-2
> [   10.624843] samsung-pinctrl 13410000.pinctrl: found group selector
> 2 for gpc0-2
> [   10.624873] samsung-pinctrl 13410000.pinctrl: found group selector
> 7 for gpc0-7
> [   10.624901] samsung-pinctrl 13410000.pinctrl: found group selector
> 7 for gpc0-7
> [   10.624917] samsung-pinctrl 13410000.pinctrl: request pin 40
> (gpc0-0) for 12200000.mmc
> [   10.624936] samsung-pinctrl 13410000.pinctrl: request pin 41
> (gpc0-1) for 12200000.mmc
> [   10.624954] samsung-pinctrl 13410000.pinctrl: request pin 43
> (gpc0-3) for 12200000.mmc
> [   10.624972] samsung-pinctrl 13410000.pinctrl: request pin 44
> (gpc0-4) for 12200000.mmc
> [   10.624990] samsung-pinctrl 13410000.pinctrl: request pin 45
> (gpc0-5) for 12200000.mmc
> [   10.625007] samsung-pinctrl 13410000.pinctrl: request pin 46
> (gpc0-6) for 12200000.mmc
> [   10.625025] samsung-pinctrl 13410000.pinctrl: request pin 63
> (gpc3-0) for 12200000.mmc
> [   10.625043] samsung-pinctrl 13410000.pinctrl: request pin 64
> (gpc3-1) for 12200000.mmc
> [   10.625061] samsung-pinctrl 13410000.pinctrl: request pin 65
> (gpc3-2) for 12200000.mmc
> [   10.625078] samsung-pinctrl 13410000.pinctrl: request pin 66
> (gpc3-3) for 12200000.mmc
> [   10.625095] samsung-pinctrl 13410000.pinctrl: request pin 42
> (gpc0-2) for 12200000.mmc
> [   10.625113] samsung-pinctrl 13410000.pinctrl: request pin 47
> (gpc0-7) for 12200000.mmc
> [   10.654376] samsung-pinctrl 13410000.pinctrl: request pin 42
> (gpc0-2) for gpc0:42
> [   10.734790] pinctrl core: add 2 pinctrl maps
> [   10.735262] pinctrl core: add 2 pinctrl maps
> [   10.736085] pinctrl core: add 2 pinctrl maps
> [   10.736604] pinctrl core: add 2 pinctrl maps
> [   10.737220] pinctrl core: add 6 pinctrl maps
> [   10.737601] samsung-pinctrl 13410000.pinctrl: found group selector
> 16 for gpc2-0
> [   10.737699] samsung-pinctrl 13410000.pinctrl: found group selector
> 16 for gpc2-0
> [   10.737803] samsung-pinctrl 13410000.pinctrl: found group selector
> 17 for gpc2-1
> [   10.737899] samsung-pinctrl 13410000.pinctrl: found group selector
> 17 for gpc2-1
> [   10.738001] samsung-pinctrl 13410000.pinctrl: found group selector
> 18 for gpc2-2
> [   10.738095] samsung-pinctrl 13410000.pinctrl: found group selector
> 18 for gpc2-2
> [   10.738196] samsung-pinctrl 13410000.pinctrl: found group selector
> 19 for gpc2-3
> [   10.738289] samsung-pinctrl 13410000.pinctrl: found group selector
> 19 for gpc2-3
> [   10.738389] samsung-pinctrl 13410000.pinctrl: found group selector
> 20 for gpc2-4
> [   10.738481] samsung-pinctrl 13410000.pinctrl: found group selector
> 20 for gpc2-4
> [   10.738642] samsung-pinctrl 13410000.pinctrl: found group selector
> 21 for gpc2-5
> [   10.738749] samsung-pinctrl 13410000.pinctrl: found group selector
> 21 for gpc2-5
> [   10.738863] samsung-pinctrl 13410000.pinctrl: found group selector
> 22 for gpc2-6
> [   10.738968] samsung-pinctrl 13410000.pinctrl: found group selector
> 22 for gpc2-6
> [   10.739022] samsung-pinctrl 13410000.pinctrl: request pin 56
> (gpc2-0) for 12220000.mmc
> [   10.739078] samsung-pinctrl 13410000.pinctrl: request pin 57
> (gpc2-1) for 12220000.mmc
> [   10.739127] samsung-pinctrl 13410000.pinctrl: request pin 58
> (gpc2-2) for 12220000.mmc
> [   10.739175] samsung-pinctrl 13410000.pinctrl: request pin 59
> (gpc2-3) for 12220000.mmc
> [   10.739224] samsung-pinctrl 13410000.pinctrl: request pin 60
> (gpc2-4) for 12220000.mmc
> [   10.739272] samsung-pinctrl 13410000.pinctrl: request pin 61
> (gpc2-5) for 12220000.mmc
> [   10.739320] samsung-pinctrl 13410000.pinctrl: request pin 62
> (gpc2-6) for 12220000.mmc
> [   10.923667] mmcblk mmc1:0007: no of_node; not parsing pinctrl DT
> [   11.140046] snd-soc-dummy snd-soc-dummy: no of_node; not parsing pinctrl DT
> [   11.220467] usb 2-1: no of_node; not parsing pinctrl DT
> [   11.626518] pinctrl core: add 2 pinctrl maps
> [   11.626743] samsung-pinctrl 13400000.pinctrl: found group selector
> 39 for gpx3-7
> [   11.626793] samsung-pinctrl 13400000.pinctrl: found group selector
> 39 for gpx3-7
> [   11.626820] samsung-pinctrl 13400000.pinctrl: request pin 39
> (gpx3-7) for 14530000.hdmi
> [   11.627809] samsung-pinctrl 13400000.pinctrl: request pin 39
> (gpx3-7) for gpx3:39
> [   11.726818] xhci-hcd xhci-hcd.2.auto: no of_node; not parsing pinctrl DT
> [   11.801452] usb usb3: no of_node; not parsing pinctrl DT
> [   11.805471] hub 3-0:1.0: no of_node; not parsing pinctrl DT
> [   11.883263] usb usb4: no of_node; not parsing pinctrl DT
> [   11.887362] hub 4-0:1.0: no of_node; not parsing pinctrl DT
> [   11.926683] xhci-hcd xhci-hcd.5.auto: no of_node; not parsing pinctrl DT
> [   11.999588] usb usb5: no of_node; not parsing pinctrl DT
> [   12.003208] hub 5-0:1.0: no of_node; not parsing pinctrl DT
> [   12.085100] usb usb6: no of_node; not parsing pinctrl DT
> [   12.088936] hub 6-0:1.0: no of_node; not parsing pinctrl DT
> [   12.491299] usb 3-1: no of_node; not parsing pinctrl DT
> [   12.528446] hub 3-1:1.0: no of_node; not parsing pinctrl DT
> [   12.555071] usb 4-1: no of_node; not parsing pinctrl DT
> [   12.611412] hub 4-1:1.0: no of_node; not parsing pinctrl DT
> [   13.020668] usb 4-1.1: no of_node; not parsing pinctrl DT
> [   13.081803] usb-storage 4-1.1:1.0: no of_node; not parsing pinctrl DT
> [   13.091721] usb 5-1: no of_node; not parsing pinctrl DT
> [   13.127124] r8152 5-1:2.0: no of_node; not parsing pinctrl DT
> [   13.208321] r8152 5-1:1.0: no of_node; not parsing pinctrl DT
> [   14.281196] sd 0:0:0:0: no of_node; not parsing pinctrl DT
> [   16.057197] usb 4-1.2: no of_node; not parsing pinctrl DT
> [   16.079507] usb-storage 4-1.2:1.0: no of_node; not parsing pinctrl DT
> [   17.236626] sd 1:0:0:0: no of_node; not parsing pinctrl DT
> [   17.612139] usbhid 2-1:1.0: no of_node; not parsing pinctrl DT
> [   17.625511] usbhid 2-1:1.1: no of_node; not parsing pinctrl DT
> [   17.755059] hid-generic 0003:24AE:1000.0001: no of_node; not
> parsing pinctrl DT
> [   17.933665] hid-generic 0003:24AE:1000.0002: no of_node; not
> parsing pinctrl DT
> [ 1009.259380] usb 4-1.2: no of_node; not parsing pinctrl DT
> [ 1009.267240] usb-storage 4-1.2:1.0: no of_node; not parsing pinctrl DT
> [ 1010.311832] sd 1:0:0:0: no of_node; not parsing pinctrl DT
> 
> Best Regards
> -Anand Moon

^ permalink raw reply

* [PATCH 3/4] iommu/arm-smmu: Add context save restore support
From: Robin Murphy @ 2016-10-26 16:51 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1477070066-15044-4-git-send-email-sricharan@codeaurora.org>

On 21/10/16 18:14, Sricharan R wrote:
> The smes registers and the context bank registers are
> the ones that are needs to be saved and restored.
> Fortunately the smes are already stored as a part

"Fortunately"? Hey, that's by design! :P

I was actually planning to finish off suspend/resume beyond those
foundations laid by the big rework, so it's nice to see something already.

> of the smmu device structure. So just write that
> back. The data required to configure the context banks
> are the master's domain data and pgtable cfgs.
> So store them as a part of the context banks info
> and just reconfigure the context banks on the restore
> path.
> 
> Signed-off-by: Sricharan R <sricharan@codeaurora.org>
> ---
>  drivers/iommu/arm-smmu.c | 52 +++++++++++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 51 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
> index 45f2762..578cdc2 100644
> --- a/drivers/iommu/arm-smmu.c
> +++ b/drivers/iommu/arm-smmu.c
> @@ -328,6 +328,11 @@ struct arm_smmu_master_cfg {
>  #define for_each_cfg_sme(fw, i, idx) \
>  	for (i = 0; idx = __fwspec_cfg(fw)->smendx[i], i < fw->num_ids; ++i)
>  
> +struct cbinfo {
> +	struct arm_smmu_domain		*domain;
> +	struct io_pgtable_cfg		pgtbl_cfg;
> +};
> +
>  struct arm_smmu_device {
>  	struct device			*dev;
>  
> @@ -378,6 +383,9 @@ struct arm_smmu_device {
>  	struct clk                      **clocks;
>  
>  	u32				cavium_id_base; /* Specific to Cavium */
> +
> +	/* For save/restore of context bank registers */
> +	struct cbinfo                   *cb_saved_ctx;

I'd prefer to follow the same pattern for context banks as for the
stream map registers, i.e. keep just the smmu pointer and cbndx in the
arm_smmu_domain, and move the rest of the context bank state to the
arm_smmu_device. Yes, it requires rather more refactoring, but it's
going to result in cleaner and more obvious code in the end.

>  };
>  
>  enum arm_smmu_context_fmt {
> @@ -972,6 +980,8 @@ static int arm_smmu_init_domain_context(struct iommu_domain *domain,
>  
>  	/* Initialise the context bank with our page table cfg */
>  	arm_smmu_init_context_bank(smmu_domain, &pgtbl_cfg);
> +	smmu->cb_saved_ctx[cfg->cbndx].domain = smmu_domain;
> +	smmu->cb_saved_ctx[cfg->cbndx].pgtbl_cfg = pgtbl_cfg;
>  
>  	/*
>  	 * Request context fault interrupt. Do this last to avoid the
> @@ -1861,6 +1871,10 @@ static int arm_smmu_device_cfg_probe(struct arm_smmu_device *smmu)
>  	}
>  	dev_notice(smmu->dev, "\t%u context banks (%u stage-2 only)\n",
>  		   smmu->num_context_banks, smmu->num_s2_context_banks);
> +
> +	smmu->cb_saved_ctx = devm_kzalloc(smmu->dev,
> +			     sizeof(struct cbinfo) * smmu->num_context_banks,
> +			     GFP_KERNEL);
>  	/*
>  	 * Cavium CN88xx erratum #27704.
>  	 * Ensure ASID and VMID allocation is unique across all SMMUs in
> @@ -2115,8 +2129,44 @@ static int arm_smmu_resume(struct device *dev)
>  {
[...]
  	struct arm_smmu_device *smmu = dev_get_drvdata(dev);
[...]
	int ret = arm_smmu_enable_clocks(smmu);
> +	if (ret)
> +		return ret;
> +
> +	arm_smmu_device_reset(smmu);

For reference, what I'm aiming for is for that to be the entire resume
function.

> -	return arm_smmu_enable_clocks(smmu);
> +	/* Restore the smes and the context banks */
> +	for (idx = 0; idx < smmu->num_mapping_groups; ++idx) {
> +		mutex_lock(&smmu->stream_map_mutex);

What are we taking this lock to protect against - can we resume one SMMU
multiple times in parallel?

> +		if (!smrs[idx].valid) {
> +			mutex_unlock(&smmu->stream_map_mutex);
> +			continue;

Nope, you can't skip anything, because there's no guarantee the SMRs (or
anything else) which are invalid in the saved state are also invalid in
the current hardware state. Consider the case of restoring from hibernate.

> +		}
> +
> +		arm_smmu_write_sme(smmu, idx);

arm_smmu_device_reset() already did that.

> +		cb = smmu->s2crs[idx].cbndx;
> +		mutex_unlock(&smmu->stream_map_mutex);
> +
> +		if (!i || (cb != pcb)) {

This took a while to figure out, and it seems like an unnecessary
micro-optimisation since it still doesn't actually prevent initialising
the same context bank multiple times (there's no guarantee that all
s2crs targeting that context are consecutive).

> +			domain = smmu->cb_saved_ctx[cb].domain;
> +			pgtbl_cfg = &smmu->cb_saved_ctx[cb].pgtbl_cfg;
> +
> +			if (domain) {
> +				mutex_lock(&domain->init_mutex);

Assuming the device link stuff works as I would expect it to (I've not
looked in detail), then shouldn't the SMMU be resumed before any of its
masters are, so what are we taking this lock to protect against?

Robin.

> +				arm_smmu_init_context_bank(domain, pgtbl_cfg);
> +				mutex_unlock(&domain->init_mutex);
> +			}
> +		}
> +		pcb = cb;
> +		i++;
> +	}
> +
> +	return 0;
>  }
>  
>  static int arm_smmu_suspend(struct device *dev)
> 

^ permalink raw reply

* [PATCH v7] spi: sun4i: Allow transfers larger than FIFO size
From: Mark Brown @ 2016-10-26 16:45 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CADi83T55fLfiMs+z0R6tf=fcFmuPS0fDFKwtXy25AKiEP1DiXw@mail.gmail.com>

On Wed, Oct 26, 2016 at 09:06:31AM -0700, Alex Gagniuc wrote:

> Thanks for the heads up! Sorry about that. Do you want me to resend
> this as a single mail?

It's fine, no need.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20161026/47c93815/attachment.sig>

^ permalink raw reply

* [RFC PATCH 4/5] w1: add a callback to call slave when a new device is connected
From: Mathieu Poirier @ 2016-10-26 16:42 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20161026145756.21689-5-antoine.tenart@free-electrons.com>

On 26 October 2016 at 08:57, Antoine Tenart
<antoine.tenart@free-electrons.com> wrote:
> This patch adds the possibility for slave drivers to register a
> callback, to be called whenever a new device matching the slave ID
> is connected.
>
> Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
> ---
>  drivers/w1/w1.c        | 10 ++++++++++
>  drivers/w1/w1_family.h |  2 ++
>  2 files changed, 12 insertions(+)
>
> diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
> index 80d0cc4e6e7f..7010ffd1ea93 100644
> --- a/drivers/w1/w1.c
> +++ b/drivers/w1/w1.c
> @@ -659,6 +659,16 @@ static int w1_family_notify(unsigned long action, struct w1_slave *sl)
>                                 return err;
>                         }
>                 }
> +               if (fops->callback) {
> +                       err = fops->callback(sl);
> +                       /*
> +                        * Do not return an error as the slave driver correctly
> +                        * probed.
> +                        */

I don't get this part.  What's the point of calling a callback if a
failure is not important - maybe I'm just missing something.

> +                       if (err)
> +                               dev_err(&sl->dev,
> +                                       "callback call failed. err=%d\n", err);
> +               }
>
>                 break;
>         case BUS_NOTIFY_DEL_DEVICE:
> diff --git a/drivers/w1/w1_family.h b/drivers/w1/w1_family.h
> index 10a7a0767187..5e165babc6f3 100644
> --- a/drivers/w1/w1_family.h
> +++ b/drivers/w1/w1_family.h
> @@ -55,11 +55,13 @@ struct w1_slave;
>   * @add_slave: add_slave
>   * @remove_slave: remove_slave
>   * @groups: sysfs group
> + * @callback: called when a new device is discovered
>   */
>  struct w1_family_ops
>  {
>         int  (* add_slave)(struct w1_slave *);
>         void (* remove_slave)(struct w1_slave *);
> +       int  (* callback)(struct w1_slave *);
>         const struct attribute_group **groups;
>  };
>
> --
> 2.10.1
>

^ permalink raw reply

* [RFC PATCH 3/5] w1: report errors returned by w1_family_notify
From: Mathieu Poirier @ 2016-10-26 16:39 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20161026145756.21689-4-antoine.tenart@free-electrons.com>

On 26 October 2016 at 08:57, Antoine Tenart
<antoine.tenart@free-electrons.com> wrote:

GKH won't accept an empty commit log.

> Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
> ---
>  drivers/w1/w1.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
> index bb34362e930a..80d0cc4e6e7f 100644
> --- a/drivers/w1/w1.c
> +++ b/drivers/w1/w1.c
> @@ -702,7 +702,9 @@ static int __w1_attach_slave_device(struct w1_slave *sl)
>                         dev_name(&sl->dev), err);
>                 return err;
>         }
> -       w1_family_notify(BUS_NOTIFY_ADD_DEVICE, sl);
> +       err = w1_family_notify(BUS_NOTIFY_ADD_DEVICE, sl);
> +       if (err)
> +               return err;
>
>         dev_set_uevent_suppress(&sl->dev, false);
>         kobject_uevent(&sl->dev.kobj, KOBJ_ADD);
> --
> 2.10.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* [PATCH 2/2] ARM: dts: uniphier: add CPU clocks and OPP table for PXs2 SoC
From: Masahiro Yamada @ 2016-10-26 16:37 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1477499859-12415-1-git-send-email-yamada.masahiro@socionext.com>

Add a CPU clock to every CPU node and a CPU OPP table to use the
generic cpufreq driver.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 arch/arm/boot/dts/uniphier-pxs2.dtsi | 46 ++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/arch/arm/boot/dts/uniphier-pxs2.dtsi b/arch/arm/boot/dts/uniphier-pxs2.dtsi
index 950f07b..83ba3e6 100644
--- a/arch/arm/boot/dts/uniphier-pxs2.dtsi
+++ b/arch/arm/boot/dts/uniphier-pxs2.dtsi
@@ -56,32 +56,78 @@
 			device_type = "cpu";
 			compatible = "arm,cortex-a9";
 			reg = <0>;
+			clocks = <&sys_clk 32>;
 			enable-method = "psci";
 			next-level-cache = <&l2>;
+			operating-points-v2 = <&cpu_opp>;
 		};
 
 		cpu at 1 {
 			device_type = "cpu";
 			compatible = "arm,cortex-a9";
 			reg = <1>;
+			clocks = <&sys_clk 32>;
 			enable-method = "psci";
 			next-level-cache = <&l2>;
+			operating-points-v2 = <&cpu_opp>;
 		};
 
 		cpu at 2 {
 			device_type = "cpu";
 			compatible = "arm,cortex-a9";
 			reg = <2>;
+			clocks = <&sys_clk 32>;
 			enable-method = "psci";
 			next-level-cache = <&l2>;
+			operating-points-v2 = <&cpu_opp>;
 		};
 
 		cpu at 3 {
 			device_type = "cpu";
 			compatible = "arm,cortex-a9";
 			reg = <3>;
+			clocks = <&sys_clk 32>;
 			enable-method = "psci";
 			next-level-cache = <&l2>;
+			operating-points-v2 = <&cpu_opp>;
+		};
+	};
+
+	cpu_opp: opp_table {
+		compatible = "operating-points-v2";
+		opp-shared;
+
+		opp at 100000000 {
+			opp-hz = /bits/ 64 <100000000>;
+			clock-latency-ns = <300>;
+		};
+		opp at 150000000 {
+			opp-hz = /bits/ 64 <150000000>;
+			clock-latency-ns = <300>;
+		};
+		opp at 200000000 {
+			opp-hz = /bits/ 64 <200000000>;
+			clock-latency-ns = <300>;
+		};
+		opp at 300000000 {
+			opp-hz = /bits/ 64 <300000000>;
+			clock-latency-ns = <300>;
+		};
+		opp at 400000000 {
+			opp-hz = /bits/ 64 <400000000>;
+			clock-latency-ns = <300>;
+		};
+		opp at 600000000 {
+			opp-hz = /bits/ 64 <600000000>;
+			clock-latency-ns = <300>;
+		};
+		opp at 800000000 {
+			opp-hz = /bits/ 64 <800000000>;
+			clock-latency-ns = <300>;
+		};
+		opp at 1200000000 {
+			opp-hz = /bits/ 64 <1200000000>;
+			clock-latency-ns = <300>;
 		};
 	};
 
-- 
1.9.1

^ permalink raw reply related

* [PATCH 1/2] ARM: dts: uniphier: add CPU clocks and OPP table for Pro5 SoC
From: Masahiro Yamada @ 2016-10-26 16:37 UTC (permalink / raw)
  To: linux-arm-kernel

Add a CPU clock to every CPU node and a CPU OPP table to use the
generic cpufreq driver.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 arch/arm/boot/dts/uniphier-pro5.dtsi | 74 ++++++++++++++++++++++++++++++++++++
 1 file changed, 74 insertions(+)

diff --git a/arch/arm/boot/dts/uniphier-pro5.dtsi b/arch/arm/boot/dts/uniphier-pro5.dtsi
index 5357ea9..5bd6068 100644
--- a/arch/arm/boot/dts/uniphier-pro5.dtsi
+++ b/arch/arm/boot/dts/uniphier-pro5.dtsi
@@ -56,16 +56,90 @@
 			device_type = "cpu";
 			compatible = "arm,cortex-a9";
 			reg = <0>;
+			clocks = <&sys_clk 32>;
 			enable-method = "psci";
 			next-level-cache = <&l2>;
+			operating-points-v2 = <&cpu_opp>;
 		};
 
 		cpu at 1 {
 			device_type = "cpu";
 			compatible = "arm,cortex-a9";
 			reg = <1>;
+			clocks = <&sys_clk 32>;
 			enable-method = "psci";
 			next-level-cache = <&l2>;
+			operating-points-v2 = <&cpu_opp>;
+		};
+	};
+
+	cpu_opp: opp_table {
+		compatible = "operating-points-v2";
+		opp-shared;
+
+		opp at 100000000 {
+			opp-hz = /bits/ 64 <100000000>;
+			clock-latency-ns = <300>;
+		};
+		opp at 116667000 {
+			opp-hz = /bits/ 64 <116667000>;
+			clock-latency-ns = <300>;
+		};
+		opp at 150000000 {
+			opp-hz = /bits/ 64 <150000000>;
+			clock-latency-ns = <300>;
+		};
+		opp at 175000000 {
+			opp-hz = /bits/ 64 <175000000>;
+			clock-latency-ns = <300>;
+		};
+		opp at 200000000 {
+			opp-hz = /bits/ 64 <200000000>;
+			clock-latency-ns = <300>;
+		};
+		opp at 233334000 {
+			opp-hz = /bits/ 64 <233334000>;
+			clock-latency-ns = <300>;
+		};
+		opp at 300000000 {
+			opp-hz = /bits/ 64 <300000000>;
+			clock-latency-ns = <300>;
+		};
+		opp at 350000000 {
+			opp-hz = /bits/ 64 <350000000>;
+			clock-latency-ns = <300>;
+		};
+		opp at 400000000 {
+			opp-hz = /bits/ 64 <400000000>;
+			clock-latency-ns = <300>;
+		};
+		opp at 466667000 {
+			opp-hz = /bits/ 64 <466667000>;
+			clock-latency-ns = <300>;
+		};
+		opp at 600000000 {
+			opp-hz = /bits/ 64 <600000000>;
+			clock-latency-ns = <300>;
+		};
+		opp at 700000000 {
+			opp-hz = /bits/ 64 <700000000>;
+			clock-latency-ns = <300>;
+		};
+		opp at 800000000 {
+			opp-hz = /bits/ 64 <800000000>;
+			clock-latency-ns = <300>;
+		};
+		opp at 933334000 {
+			opp-hz = /bits/ 64 <933334000>;
+			clock-latency-ns = <300>;
+		};
+		opp at 1200000000 {
+			opp-hz = /bits/ 64 <1200000000>;
+			clock-latency-ns = <300>;
+		};
+		opp at 1400000000 {
+			opp-hz = /bits/ 64 <1400000000>;
+			clock-latency-ns = <300>;
 		};
 	};
 
-- 
1.9.1

^ permalink raw reply related

* [PATCH v6 1/5] ARM: davinci: da8xx: add usb phy clocks
From: David Lechner @ 2016-10-26 16:37 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <6bcc1ac1-446c-6191-1c63-e37ccfaf9556@ti.com>

On 10/26/2016 02:59 AM, Sekhar Nori wrote:
> On Wednesday 26 October 2016 08:36 AM, David Lechner wrote:
>> Up to this point, the USB phy clock configuration was handled manually in
>> the board files and in the usb drivers. This adds proper clocks so that
>> the usb drivers can use clk_get and clk_enable and not have to worry about
>> the details. Also, the related code is removed from the board files and
>> replaced with the new clock registration functions.
>>
>> Signed-off-by: David Lechner <david@lechnology.com>
>> Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
>> ---
>>
>> I have added "ARM: davinci: da8xx: Enable the usb20 "per" clk on phy_clk_enable"
>> from Axel Haslam to this patch.
>>
>> In the review of Axel's patch, Sekhar said:
>>
>>> We should not be using a NULL device pointer here. Can you pass the musb
>>> device pointer available in the same file? Also, da850_clks[] in da850.c
>>> needs to be fixed to add the matching device name.
>>
>> However, the musb device may not be registered. The usb20_clk can be used to
>> supply a 48MHz clock to USB 1.1 (ohci) without using the musb device. So, I am
>> inclined to leave this as NULL.
>
> But clock look-up has nothing to do with device being registered AFAICT.
> It is used to identify the clock consumer. Passing NULL there means the
> clock is not associated with any device. Which is not correct as we are
> specifically looking at MUSB module clock.
>
> Thanks,
> Sekhar
>

FWIW, clk_get() uses dev_name() to get the device name, which will 
return NULL until after the platform device is registered.

I can add the device references anyway. However, this is complicated by 
the fact that the musb platform device declaration is inside of an #if 
IS_ENABLED(CONFIG_USB_MUSB_HDRC). I can either remove the #if or add 
more #if's. Do you have a preference on this?

^ permalink raw reply

* [RFC PATCH 1/5] of: introduce the overlay manager
From: Mathieu Poirier @ 2016-10-26 16:29 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20161026145756.21689-2-antoine.tenart@free-electrons.com>

Hi Antoine,

Please find my comments below.

On 26 October 2016 at 08:57, Antoine Tenart
<antoine.tenart@free-electrons.com> wrote:
> The overlay manager is an in-kernel library helping to handle dt overlay
> loading when using capes.
>
> Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
> ---
>  drivers/of/Kconfig                           |   2 +
>  drivers/of/Makefile                          |   1 +
>  drivers/of/overlay-manager/Kconfig           |   6 +
>  drivers/of/overlay-manager/Makefile          |   1 +
>  drivers/of/overlay-manager/overlay-manager.c | 199 +++++++++++++++++++++++++++
>  include/linux/overlay-manager.h              |  38 +++++
>  6 files changed, 247 insertions(+)
>  create mode 100644 drivers/of/overlay-manager/Kconfig
>  create mode 100644 drivers/of/overlay-manager/Makefile
>  create mode 100644 drivers/of/overlay-manager/overlay-manager.c
>  create mode 100644 include/linux/overlay-manager.h
>
> diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig
> index bc07ad30c9bf..e57aeaf0bf4f 100644
> --- a/drivers/of/Kconfig
> +++ b/drivers/of/Kconfig
> @@ -116,4 +116,6 @@ config OF_OVERLAY
>  config OF_NUMA
>         bool
>
> +source "drivers/of/overlay-manager/Kconfig"
> +
>  endif # OF
> diff --git a/drivers/of/Makefile b/drivers/of/Makefile
> index d7efd9d458aa..d738fd41271f 100644
> --- a/drivers/of/Makefile
> +++ b/drivers/of/Makefile
> @@ -16,3 +16,4 @@ obj-$(CONFIG_OF_OVERLAY) += overlay.o
>  obj-$(CONFIG_OF_NUMA) += of_numa.o
>
>  obj-$(CONFIG_OF_UNITTEST) += unittest-data/
> +obj-y += overlay-manager/
> diff --git a/drivers/of/overlay-manager/Kconfig b/drivers/of/overlay-manager/Kconfig
> new file mode 100644
> index 000000000000..eeb76054dcb8
> --- /dev/null
> +++ b/drivers/of/overlay-manager/Kconfig
> @@ -0,0 +1,6 @@
> +config OF_OVERLAY_MGR
> +       bool "Device Tree Overlay Manager"
> +       depends on OF_OVERLAY
> +       help
> +         Enable the overlay manager to handle automatic overlay loading when
> +         devices are detected.
> diff --git a/drivers/of/overlay-manager/Makefile b/drivers/of/overlay-manager/Makefile
> new file mode 100644
> index 000000000000..86d2b53950e7
> --- /dev/null
> +++ b/drivers/of/overlay-manager/Makefile
> @@ -0,0 +1 @@
> +obj-$(CONFIG_OF_OVERLAY_MGR)                   += overlay-manager.o
> diff --git a/drivers/of/overlay-manager/overlay-manager.c b/drivers/of/overlay-manager/overlay-manager.c
> new file mode 100644
> index 000000000000..a725d7e24d38
> --- /dev/null
> +++ b/drivers/of/overlay-manager/overlay-manager.c
> @@ -0,0 +1,199 @@
> +/*
> + * Copyright (C) 2016 - Antoine Tenart <antoine.tenart@free-electrons.com>
> + *
> + * This file is licensed under the terms of the GNU General Public
> + * License version 2. This program is licensed "as is" without any
> + * warranty of any kind, whether express or implied.
> + */
> +
> +#include <linux/firmware.h>
> +#include <linux/list.h>
> +#include <linux/of.h>
> +#include <linux/of_fdt.h>
> +#include <linux/overlay-manager.h>
> +#include <linux/slab.h>
> +#include <linux/spinlock.h>
> +
> +struct overlay_mgr_overlay {
> +       struct list_head list;
> +       char *name;
> +};

Please use the proper documentation format for structures.

> +
> +LIST_HEAD(overlay_mgr_overlays);
> +LIST_HEAD(overlay_mgr_formats);
> +DEFINE_SPINLOCK(overlay_mgr_lock);
> +DEFINE_SPINLOCK(overlay_mgr_format_lock);
> +
> +/*
> + * overlay_mgr_register_format()
> + *
> + * Adds a new format candidate to the list of supported formats. The registered
> + * formats are used to parse the headers stored on the dips.
> + */
> +int overlay_mgr_register_format(struct overlay_mgr_format *candidate)
> +{
> +       struct overlay_mgr_format *format;
> +       int err = 0;
> +
> +       spin_lock(&overlay_mgr_format_lock);
> +
> +       /* Check if the format is already registered */
> +       list_for_each_entry(format, &overlay_mgr_formats, list) {
> +               if (!strcpy(format->name, candidate->name)) {

This function is public to the rest of the kernel - limiting the
lenght of ->name and using strncpy() is probably a good idea.

> +                       err = -EEXIST;
> +                       goto err;
> +               }
> +       }
> +
> +       list_add_tail(&candidate->list, &overlay_mgr_formats);
> +
> +err:
> +       spin_unlock(&overlay_mgr_format_lock);
> +       return err;
> +}
> +EXPORT_SYMBOL_GPL(overlay_mgr_register_format);
> +
> +/*
> + * overlay_mgr_parse()
> + *
> + * Parse raw data with registered format parsers. Fills the candidate string if
> + * one parser understood the raw data format.
> + */
> +int overlay_mgr_parse(struct device *dev, void *data, char ***candidates,

I'm pretty sure there is another way to proceed than using 3 levels of
references.  It makes the code hard to read and a prime candidate for
errors.

> +                     unsigned *n)
> +{
> +       struct list_head *pos, *tmp;
> +       struct overlay_mgr_format *format;
> +
> +       list_for_each_safe(pos, tmp, &overlay_mgr_formats) {
> +               format = list_entry(pos, struct overlay_mgr_format, list);

Can you use list_for_each_safe_entry() ?

> +
> +               format->parse(dev, data, candidates, n);

->parse() returns an error code.  It is probably a good idea to check
it.  If it isn't needed then a comment explaining why it is the case
would be appreciated.

> +               if (n > 0)
> +                       return 0;
> +       }
> +
> +       return -EINVAL;
> +}
> +EXPORT_SYMBOL_GPL(overlay_mgr_parse);
> +
> +static int overlay_mgr_check_overlay(struct device_node *node)
> +{
> +       struct property *p;
> +       const char *str = NULL;
> +
> +       p = of_find_property(node, "compatible", NULL);
> +       if (!p)
> +               return -EINVAL;
> +
> +       do {
> +               str = of_prop_next_string(p, str);
> +               if (of_machine_is_compatible(str))
> +                       return 0;
> +       } while (str);
> +
> +       return -EINVAL;
> +}
> +
> +/*
> + * _overlay_mgr_insert()
> + *
> + * Try to request and apply an overlay given a candidate name.
> + */
> +static int _overlay_mgr_apply(struct device *dev, char *candidate)
> +{
> +       struct overlay_mgr_overlay *overlay;
> +       struct device_node *node;
> +       const struct firmware *firmware;
> +       char *firmware_name;
> +       int err = 0;
> +
> +       spin_lock(&overlay_mgr_lock);
> +
> +       list_for_each_entry(overlay, &overlay_mgr_overlays, list) {
> +               if (!strcmp(overlay->name, candidate)) {
> +                       dev_err(dev, "overlay already loaded\n");
> +                       err = -EEXIST;
> +                       goto err_lock;
> +               }
> +       }
> +
> +       overlay = devm_kzalloc(dev, sizeof(*overlay), GFP_KERNEL);

Function devm_kzalloc() can sleep but you're holding a spinlock - I'm
surprised the kernel didn't complain here.  Allocate the memory before
holding the lock.  If the overly is already loaded simply free it on
the error path.

> +       if (!overlay) {
> +               err = -ENOMEM;
> +               goto err_lock;
> +       }
> +
> +       overlay->name = candidate;
> +
> +       firmware_name = kasprintf(GFP_KERNEL, "overlay-%s.dtbo", candidate);
> +       if (!firmware_name) {
> +               err = -ENOMEM;
> +               goto err_free;
> +       }
> +
> +       dev_info(dev, "requesting firmware '%s'\n", firmware_name);
> +
> +       err = request_firmware_direct(&firmware, firmware_name, dev);
> +       if (err) {
> +               dev_info(dev, "failed to request firmware '%s'\n",
> +                        firmware_name);
> +               goto err_free;
> +       }
> +
> +       of_fdt_unflatten_tree((unsigned long *)firmware->data, NULL, &node);
> +       if (!node) {
> +               dev_err(dev, "failed to unflatted tree\n");
> +               err = -EINVAL;
> +               goto err_fw;
> +       }
> +
> +       of_node_set_flag(node, OF_DETACHED);
> +
> +       err = of_resolve_phandles(node);
> +       if (err) {
> +               dev_err(dev, "failed to resolve phandles: %d\n", err);
> +               goto err_fw;
> +       }
> +
> +       err = overlay_mgr_check_overlay(node);
> +       if (err) {
> +               dev_err(dev, "overlay checks failed: %d\n", err);
> +               goto err_fw;
> +       }
> +
> +       err = of_overlay_create(node);
> +       if (err < 0) {
> +               dev_err(dev, "failed to create overlay: %d\n", err);
> +               goto err_fw;
> +       }
> +
> +       list_add_tail(&overlay->list, &overlay_mgr_overlays);
> +
> +       dev_info(dev, "loaded firmware '%s'\n", firmware_name);
> +

out:

> +       spin_unlock(&overlay_mgr_lock);
> +       return 0;

return err;

> +
> +err_fw:
> +       release_firmware(firmware);
> +err_free:
> +       devm_kfree(dev, overlay);

goto out;

> +err_lock:
> +       spin_unlock(&overlay_mgr_lock);
> +       return err;

This code is repeated twice.  See above corrections to fix the situation.

> +}
> +
> +int overlay_mgr_apply(struct device *dev, char **candidates, unsigned n)
> +{
> +       int i, ret;
> +
> +       for (i=0; i < n; i++) {

I'm surprised checkpatch.pl let you get away with this one.

> +               ret = _overlay_mgr_apply(dev, candidates[i]);
> +               if (!ret)
> +                       return 0;
> +       }
> +
> +       return -EINVAL;
> +}
> +EXPORT_SYMBOL_GPL(overlay_mgr_apply);
> diff --git a/include/linux/overlay-manager.h b/include/linux/overlay-manager.h
> new file mode 100644
> index 000000000000..8adcc4f5ddf6
> --- /dev/null
> +++ b/include/linux/overlay-manager.h
> @@ -0,0 +1,38 @@
> +/*
> + * Copyright (C) 2016 - Antoine Tenart <antoine.tenart@free-electrons.com>
> + *
> + * This file is licensed under the terms of the GNU General Public
> + * License version 2. This program is licensed "as is" without any
> + * warranty of any kind, whether express or implied.
> + */
> +
> +#ifndef __OVERLAY_MGR_H__
> +#define __OVERLAY_MGR_H__
> +
> +#include <linux/device.h>
> +#include <linux/list.h>
> +#include <linux/sizes.h>
> +
> +#define OVERLAY_MGR_DIP_MAX_SZ         SZ_128
> +
> +struct overlay_mgr_format {
> +       struct list_head list;
> +       char *name;
> +       int (*parse)(struct device *dev, void *data, char ***candidates,
> +                    unsigned *n);
> +};

Please use the kernel documentation standard.

> +
> +int overlay_mgr_register_format(struct overlay_mgr_format *candidate);
> +int overlay_mgr_parse(struct device *dev, void *data, char ***candidates,
> +                     unsigned *n);
> +int overlay_mgr_apply(struct device *dev, char **candidates, unsigned n);
> +
> +#define dip_convert(field)                                      \
> +        (                                                       \
> +                (sizeof(field) == 1) ? field :                  \
> +                (sizeof(field) == 2) ? be16_to_cpu(field) :     \
> +                (sizeof(field) == 4) ? be32_to_cpu(field) :     \
> +                -1                                              \
> +        )

Please document your macro definition.  Otherwise reviewers are left guessing...

> +
> +#endif /* __OVERLAY_MGR_H__ */
> --
> 2.10.1
>

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox