* Re: [PATCH v1 1/2] vsprintf: introduce %dE for error constants
From: Andrew Morton @ 2019-08-24 23:58 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Jonathan Corbet, linux-doc, linux-kernel, linux-gpio,
Linus Walleij, Bartosz Golaszewski, Petr Mladek,
Sergey Senozhatsky, Steven Rostedt
In-Reply-To: <20190824233724.1775-1-uwe@kleine-koenig.org>
(cc printk maintainers).
On Sun, 25 Aug 2019 01:37:23 +0200 Uwe Kleine-König <uwe@kleine-koenig.org> wrote:
> pr_info("probing failed (%dE)\n", ret);
>
> expands to
>
> probing failed (EIO)
>
> if ret holds -EIO (or EIO). This introduces an array of error codes. If
> the error code is missing, %dE falls back to %d and so prints the plain
> number.
Huh. I'm surprised we don't already have this. Seems that this will
be applicable in a lot of places? Although we shouldn't go blindly
converting everything in sight - that would risk breaking userspace
which parses kernel strings.
Is it really necessary to handle the positive errnos? Does much kernel
code actually do that (apart from kernel code which is buggy)?
> Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
> ---
> Hello
>
> there are many code sites that benefit from this. Just grep for
> "(%d)" ...
Yup. This observation shouldn't be below the "^---$" ;) An approximate
grep|wc would be interesting.
> --- a/lib/vsprintf.c
> +++ b/lib/vsprintf.c
> @@ -533,6 +533,192 @@ char *number(char *buf, char *end, unsigned long long num,
> return buf;
> }
>
> +#define ERRORCODE(x) { .str = #x, .err = x }
> +
> +static const struct {
> + const char *str;
> + int err;
> +} errorcodes[] = {
It's a bit of a hack, but an array of char*'s and a separate array of
ushorts would save a bit of space.
> + ERRORCODE(EPERM),
> + ERRORCODE(ENOENT),
> + ERRORCODE(ESRCH),
>
> ...
>
> +static noinline_for_stack
Why this? I'm suspecting this will actually increase stack use?
> +char *errstr(char *buf, char *end, unsigned long long num,
> + struct printf_spec spec)
> +{
> + char *errname = NULL;
> + size_t errnamelen, copy;
> + int i;
> +
> + for (i = 0; i < ARRAY_SIZE(errorcodes); ++i) {
> + if (num == errorcodes[i].err || num == -errorcodes[i].err) {
> + errname = errorcodes[i].str;
> + break;
> + }
> + }
> +
> + if (!errname) {
> + /* fall back to ordinary number */
> + return number(buf, end, num, spec);
> + }
> +
> + copy = errnamelen = strlen(errname);
> + if (copy > end - buf)
> + copy = end - buf;
> + buf = memcpy(buf, errname, copy);
> +
> + return buf + errnamelen;
> +}
OK, I guess `errstr' is an OK name for a static function and we can use
this to add a new strerror() should the need arise.
>
> ...
>
^ permalink raw reply
* [PATCH v1 1/2] vsprintf: introduce %dE for error constants
From: Uwe Kleine-König @ 2019-08-24 23:37 UTC (permalink / raw)
To: Andrew Morton
Cc: Jonathan Corbet, linux-doc, linux-kernel, linux-gpio,
Linus Walleij, Bartosz Golaszewski
pr_info("probing failed (%dE)\n", ret);
expands to
probing failed (EIO)
if ret holds -EIO (or EIO). This introduces an array of error codes. If
the error code is missing, %dE falls back to %d and so prints the plain
number.
Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
---
Hello
there are many code sites that benefit from this. Just grep for
"(%d)" ...
As an example the follow up patch converts a printk to use this new
format escape.
Best regards
Uwe
Documentation/core-api/printk-formats.rst | 3 +
lib/vsprintf.c | 193 +++++++++++++++++++++-
2 files changed, 195 insertions(+), 1 deletion(-)
diff --git a/Documentation/core-api/printk-formats.rst b/Documentation/core-api/printk-formats.rst
index c6224d039bcb..81002414f956 100644
--- a/Documentation/core-api/printk-formats.rst
+++ b/Documentation/core-api/printk-formats.rst
@@ -35,6 +35,9 @@ Integer types
u64 %llu or %llx
+To print the name that corresponds to an integer error constant, use %dE and
+pass the int.
+
If <type> is dependent on a config option for its size (e.g., sector_t,
blkcnt_t) or is architecture-dependent for its size (e.g., tcflag_t), use a
format specifier of its largest possible type and explicitly cast to it.
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index b0967cf17137..672eab8dab84 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -533,6 +533,192 @@ char *number(char *buf, char *end, unsigned long long num,
return buf;
}
+#define ERRORCODE(x) { .str = #x, .err = x }
+
+static const struct {
+ const char *str;
+ int err;
+} errorcodes[] = {
+ ERRORCODE(EPERM),
+ ERRORCODE(ENOENT),
+ ERRORCODE(ESRCH),
+ ERRORCODE(EINTR),
+ ERRORCODE(EIO),
+ ERRORCODE(ENXIO),
+ ERRORCODE(E2BIG),
+ ERRORCODE(ENOEXEC),
+ ERRORCODE(EBADF),
+ ERRORCODE(ECHILD),
+ ERRORCODE(EAGAIN),
+ ERRORCODE(ENOMEM),
+ ERRORCODE(EACCES),
+ ERRORCODE(EFAULT),
+ ERRORCODE(ENOTBLK),
+ ERRORCODE(EBUSY),
+ ERRORCODE(EEXIST),
+ ERRORCODE(EXDEV),
+ ERRORCODE(ENODEV),
+ ERRORCODE(ENOTDIR),
+ ERRORCODE(EISDIR),
+ ERRORCODE(EINVAL),
+ ERRORCODE(ENFILE),
+ ERRORCODE(EMFILE),
+ ERRORCODE(ENOTTY),
+ ERRORCODE(ETXTBSY),
+ ERRORCODE(EFBIG),
+ ERRORCODE(ENOSPC),
+ ERRORCODE(ESPIPE),
+ ERRORCODE(EROFS),
+ ERRORCODE(EMLINK),
+ ERRORCODE(EPIPE),
+ ERRORCODE(EDOM),
+ ERRORCODE(ERANGE),
+ ERRORCODE(EDEADLK),
+ ERRORCODE(ENAMETOOLONG),
+ ERRORCODE(ENOLCK),
+ ERRORCODE(ENOSYS),
+ ERRORCODE(ENOTEMPTY),
+ ERRORCODE(ELOOP),
+ ERRORCODE(EWOULDBLOCK),
+ ERRORCODE(ENOMSG),
+ ERRORCODE(EIDRM),
+ ERRORCODE(ECHRNG),
+ ERRORCODE(EL2NSYNC),
+ ERRORCODE(EL3HLT),
+ ERRORCODE(EL3RST),
+ ERRORCODE(ELNRNG),
+ ERRORCODE(EUNATCH),
+ ERRORCODE(ENOCSI),
+ ERRORCODE(EL2HLT),
+ ERRORCODE(EBADE),
+ ERRORCODE(EBADR),
+ ERRORCODE(EXFULL),
+ ERRORCODE(ENOANO),
+ ERRORCODE(EBADRQC),
+ ERRORCODE(EBADSLT),
+ ERRORCODE(EBFONT),
+ ERRORCODE(ENOSTR),
+ ERRORCODE(ENODATA),
+ ERRORCODE(ETIME),
+ ERRORCODE(ENOSR),
+ ERRORCODE(ENONET),
+ ERRORCODE(ENOPKG),
+ ERRORCODE(EREMOTE),
+ ERRORCODE(ENOLINK),
+ ERRORCODE(EADV),
+ ERRORCODE(ESRMNT),
+ ERRORCODE(ECOMM),
+ ERRORCODE(EPROTO),
+ ERRORCODE(EMULTIHOP),
+ ERRORCODE(EDOTDOT),
+ ERRORCODE(EBADMSG),
+ ERRORCODE(EOVERFLOW),
+ ERRORCODE(ENOTUNIQ),
+ ERRORCODE(EBADFD),
+ ERRORCODE(EREMCHG),
+ ERRORCODE(ELIBACC),
+ ERRORCODE(ELIBBAD),
+ ERRORCODE(ELIBSCN),
+ ERRORCODE(ELIBMAX),
+ ERRORCODE(ELIBEXEC),
+ ERRORCODE(EILSEQ),
+ ERRORCODE(ERESTART),
+ ERRORCODE(ESTRPIPE),
+ ERRORCODE(EUSERS),
+ ERRORCODE(ENOTSOCK),
+ ERRORCODE(EDESTADDRREQ),
+ ERRORCODE(EMSGSIZE),
+ ERRORCODE(EPROTOTYPE),
+ ERRORCODE(ENOPROTOOPT),
+ ERRORCODE(EPROTONOSUPPORT),
+ ERRORCODE(ESOCKTNOSUPPORT),
+ ERRORCODE(EOPNOTSUPP),
+ ERRORCODE(EPFNOSUPPORT),
+ ERRORCODE(EAFNOSUPPORT),
+ ERRORCODE(EADDRINUSE),
+ ERRORCODE(EADDRNOTAVAIL),
+ ERRORCODE(ENETDOWN),
+ ERRORCODE(ENETUNREACH),
+ ERRORCODE(ENETRESET),
+ ERRORCODE(ECONNABORTED),
+ ERRORCODE(ECONNRESET),
+ ERRORCODE(ENOBUFS),
+ ERRORCODE(EISCONN),
+ ERRORCODE(ENOTCONN),
+ ERRORCODE(ESHUTDOWN),
+ ERRORCODE(ETOOMANYREFS),
+ ERRORCODE(ETIMEDOUT),
+ ERRORCODE(ECONNREFUSED),
+ ERRORCODE(EHOSTDOWN),
+ ERRORCODE(EHOSTUNREACH),
+ ERRORCODE(EALREADY),
+ ERRORCODE(EINPROGRESS),
+ ERRORCODE(ESTALE),
+ ERRORCODE(EUCLEAN),
+ ERRORCODE(ENOTNAM),
+ ERRORCODE(ENAVAIL),
+ ERRORCODE(EISNAM),
+ ERRORCODE(EREMOTEIO),
+ ERRORCODE(EDQUOT),
+ ERRORCODE(ENOMEDIUM),
+ ERRORCODE(EMEDIUMTYPE),
+ ERRORCODE(ECANCELED),
+ ERRORCODE(ENOKEY),
+ ERRORCODE(EKEYEXPIRED),
+ ERRORCODE(EKEYREVOKED),
+ ERRORCODE(EKEYREJECTED),
+ ERRORCODE(EOWNERDEAD),
+ ERRORCODE(ENOTRECOVERABLE),
+ ERRORCODE(ERFKILL),
+ ERRORCODE(EHWPOISON),
+ ERRORCODE(ERESTARTSYS),
+ ERRORCODE(ERESTARTNOINTR),
+ ERRORCODE(ERESTARTNOHAND),
+ ERRORCODE(ENOIOCTLCMD),
+ ERRORCODE(ERESTART_RESTARTBLOCK),
+ ERRORCODE(EPROBE_DEFER),
+ ERRORCODE(EOPENSTALE),
+ ERRORCODE(ENOPARAM),
+ ERRORCODE(EBADHANDLE),
+ ERRORCODE(ENOTSYNC),
+ ERRORCODE(EBADCOOKIE),
+ ERRORCODE(ENOTSUPP),
+ ERRORCODE(ETOOSMALL),
+ ERRORCODE(ESERVERFAULT),
+ ERRORCODE(EBADTYPE),
+ ERRORCODE(EJUKEBOX),
+ ERRORCODE(EIOCBQUEUED),
+ ERRORCODE(ERECALLCONFLICT),
+};
+
+static noinline_for_stack
+char *errstr(char *buf, char *end, unsigned long long num,
+ struct printf_spec spec)
+{
+ char *errname = NULL;
+ size_t errnamelen, copy;
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(errorcodes); ++i) {
+ if (num == errorcodes[i].err || num == -errorcodes[i].err) {
+ errname = errorcodes[i].str;
+ break;
+ }
+ }
+
+ if (!errname) {
+ /* fall back to ordinary number */
+ return number(buf, end, num, spec);
+ }
+
+ copy = errnamelen = strlen(errname);
+ if (copy > end - buf)
+ copy = end - buf;
+ buf = memcpy(buf, errname, copy);
+
+ return buf + errnamelen;
+}
+
static noinline_for_stack
char *special_hex_number(char *buf, char *end, unsigned long long num, int size)
{
@@ -2566,7 +2752,12 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
num = va_arg(args, unsigned int);
}
- str = number(str, end, num, spec);
+ if (spec.type == FORMAT_TYPE_INT && *fmt == 'E') {
+ fmt++;
+ str = errstr(str, end, num, spec);
+ } else {
+ str = number(str, end, num, spec);
+ }
}
}
--
2.20.1
^ permalink raw reply related
* [PATCH v1 2/2] gpiolib: print an error name instead of a plain number in error string
From: Uwe Kleine-König @ 2019-08-24 23:37 UTC (permalink / raw)
To: Andrew Morton, Linus Walleij, Bartosz Golaszewski
Cc: Jonathan Corbet, linux-doc, linux-kernel, linux-gpio
In-Reply-To: <20190824233724.1775-1-uwe@kleine-koenig.org>
This is an example that makes use of the just introduced printk format
%dE that prints (e.g.) "EIO" when the matching integer is -EIO (or EIO).
Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
---
drivers/gpio/gpiolib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index f497003f119c..b50ea24f087f 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -1247,7 +1247,7 @@ static void gpiochip_setup_devs(void)
list_for_each_entry(gdev, &gpio_devices, list) {
err = gpiochip_setup_dev(gdev);
if (err)
- pr_err("%s: Failed to initialize gpio device (%d)\n",
+ pr_err("%s: Failed to initialize gpio device (%dE)\n",
dev_name(&gdev->dev), err);
}
}
--
2.20.1
^ permalink raw reply related
* Re: [GIT PULL] GPIO fixes for v5.3
From: pr-tracker-bot @ 2019-08-24 21:50 UTC (permalink / raw)
To: Linus Walleij
Cc: Linus Torvalds, linux-kernel, open list:GPIO SUBSYSTEM,
Bartosz Golaszewski
In-Reply-To: <CACRpkdaWR9GZ0Hem4h-jdGcYc_Uwx29XvsHuEgvXiebRG6DCwA@mail.gmail.com>
The pull request you sent on Sat, 24 Aug 2019 23:17:54 +0200:
> git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git tags/gpio-v5.3-4
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/083f0f2cd402df40f62e16b1e4208e6033f52aba
Thank you!
--
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/prtracker
^ permalink raw reply
* [GIT PULL] GPIO fixes for v5.3
From: Linus Walleij @ 2019-08-24 21:17 UTC (permalink / raw)
To: Linus Torvalds
Cc: linux-kernel, open list:GPIO SUBSYSTEM, Bartosz Golaszewski
Hi Linus,
here is a (hopefully last) set of GPIO fixes for the v5.3 kernel
cycle. Two are pretty core.
Please pull them in! Details in the signed tag.
Yours,
Linus Walleij
The following changes since commit d45331b00ddb179e291766617259261c112db872:
Linux 5.3-rc4 (2019-08-11 13:26:41 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git
tags/gpio-v5.3-4
for you to fetch changes up to 48057ed1840fde9239b1e000bea1a0a1f07c5e99:
gpio: Fix irqchip initialization order (2019-08-23 11:00:43 +0200)
----------------------------------------------------------------
GPIO fixes for the v5.3 kernel:
- Fix not reporting open drain/source lines to userspace as "input"
- Fix a minor build error found in randconfigs
- Fix a chip select quirk on the Freescale SPI
- Fix the irqchip initialization semantic order to reflect what
it was using the old API
----------------------------------------------------------------
Andreas Kemnade (1):
gpio: of: fix Freescale SPI CS quirk handling
Bartosz Golaszewski (1):
gpiolib: never report open-drain/source lines as 'input' to user-space
Linus Walleij (1):
gpio: Fix irqchip initialization order
YueHaibing (1):
gpio: Fix build error of function redefinition
drivers/gpio/gpiolib-of.c | 2 +-
drivers/gpio/gpiolib.c | 36 +++++++++++++++++++-----------------
include/linux/gpio.h | 24 ------------------------
3 files changed, 20 insertions(+), 42 deletions(-)
^ permalink raw reply
* Re: [PATCH v4] arm64: dts: ls1088a: fix gpio node
From: Shawn Guo @ 2019-08-24 19:14 UTC (permalink / raw)
To: Hui Song
Cc: Li Yang, Rob Herring, Mark Rutland, Linus Walleij,
Bartosz Golaszewski, linux-arm-kernel, devicetree, linux-kernel,
linux-gpio
In-Reply-To: <20190820055438.43469-1-hui.song_1@nxp.com>
On Tue, Aug 20, 2019 at 01:54:38PM +0800, Hui Song wrote:
> From: Song Hui <hui.song_1@nxp.com>
>
> add ls1088a gpio specify compatible.
>
> Signed-off-by: Song Hui <hui.song_1@nxp.com>
I updated the patch subject as below, and applied the patch.
arm64: dts: ls1088a: update gpio compatible
Shawn
> ---
> Changes in v4:
> - update the patch description.
> Changes in v3:
> - delete the attribute of little-endian.
> Changes in v2:
> - update the subject.
>
>
> diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi
> index dfbead4..ff669c8 100644
> --- a/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi
> +++ b/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi
> @@ -269,7 +269,7 @@
> };
>
> gpio0: gpio@2300000 {
> - compatible = "fsl,qoriq-gpio";
> + compatible = "fsl,ls1088a-gpio", "fsl,qoriq-gpio";
> reg = <0x0 0x2300000 0x0 0x10000>;
> interrupts = <0 36 IRQ_TYPE_LEVEL_HIGH>;
> little-endian;
> @@ -280,7 +280,7 @@
> };
>
> gpio1: gpio@2310000 {
> - compatible = "fsl,qoriq-gpio";
> + compatible = "fsl,ls1088a-gpio", "fsl,qoriq-gpio";
> reg = <0x0 0x2310000 0x0 0x10000>;
> interrupts = <0 36 IRQ_TYPE_LEVEL_HIGH>;
> little-endian;
> @@ -291,7 +291,7 @@
> };
>
> gpio2: gpio@2320000 {
> - compatible = "fsl,qoriq-gpio";
> + compatible = "fsl,ls1088a-gpio", "fsl,qoriq-gpio";
> reg = <0x0 0x2320000 0x0 0x10000>;
> interrupts = <0 37 IRQ_TYPE_LEVEL_HIGH>;
> little-endian;
> @@ -302,7 +302,7 @@
> };
>
> gpio3: gpio@2330000 {
> - compatible = "fsl,qoriq-gpio";
> + compatible = "fsl,ls1088a-gpio", "fsl,qoriq-gpio";
> reg = <0x0 0x2330000 0x0 0x10000>;
> interrupts = <0 37 IRQ_TYPE_LEVEL_HIGH>;
> little-endian;
> --
> 2.9.5
>
^ permalink raw reply
* Re: [PATCH 2/2] tracing: drop handling of NOTRACE symbol
From: Uwe Kleine-König @ 2019-08-24 14:04 UTC (permalink / raw)
To: Linus Walleij, Steven Rostedt
Cc: Ingo Molnar, open list:GPIO SUBSYSTEM, Sascha Hauer, Tal Shorer
In-Reply-To: <CACRpkdax=n6hYfixSgsVaT2vPiZGdCC=tbQJrazzao946_M7yA@mail.gmail.com>
Hello Linus and Steven,
On Mon, Apr 08, 2019 at 04:29:15PM +0200, Linus Walleij wrote:
> On Mon, Apr 8, 2019 at 4:27 PM Steven Rostedt <rostedt@goodmis.org> wrote:
>
> > On Mon, 8 Apr 2019 15:42:55 +0200
> > Linus Walleij <linus.walleij@linaro.org> wrote:
> >
> > > > That's fine for me, but I'm a bit surprised you did that without an ack
> > > > from the tracing people?
> > >
> > > oOOPS no I guess I shouldn't, haha I just didn't
> > > look close enough, I thought for some reason it only
> > > applied in the GPIO subsystem. I'll back this out.
> >
> > No need to back it out.
> >
> > Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
>
> OK applied to the GPIO tree.
I just found this patch in one of my older topic branches and it still
applies to current Linus (Torvald)'s master.
Given that the only user is gone since 5.2-rc1 (commit
12f2639038ef420fe796171ffb810b30d1ac0619)
For reference, here comes it again, slightly adapted to reality. (Use
git am --scissors to apply.)
Best regards
Uwe
---->8----
From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
Date: Fri, 5 Apr 2019 21:31:47 +0200
Subject: [PATCH] tracing: drop handling of NOTRACE symbol
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
When a header defined the NOTRACE cpp symbol creation of tracepoints was
skipped. Since this feature was introduced in 4.4-rc1 it was only ever
used by the gpio events and this was dropped in v5.2-rc1. So
remove this now unused knob, also to not encourage a new usage.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
include/linux/tracepoint.h | 17 +++--------------
1 file changed, 3 insertions(+), 14 deletions(-)
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
index 1fb11daa5c53..7d03805503bd 100644
--- a/include/linux/tracepoint.h
+++ b/include/linux/tracepoint.h
@@ -136,18 +136,7 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p)
#define TP_ARGS(args...) args
#define TP_CONDITION(args...) args
-/*
- * Individual subsystem my have a separate configuration to
- * enable their tracepoints. By default, this file will create
- * the tracepoints if CONFIG_TRACEPOINT is defined. If a subsystem
- * wants to be able to disable its tracepoints from being created
- * it can define NOTRACE before including the tracepoint headers.
- */
-#if defined(CONFIG_TRACEPOINTS) && !defined(NOTRACE)
-#define TRACEPOINTS_ENABLED
-#endif
-
-#ifdef TRACEPOINTS_ENABLED
+#ifdef CONFIG_TRACEPOINTS
/*
* it_func[0] is never NULL because there is at least one element in the array
@@ -295,7 +284,7 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p)
#define EXPORT_TRACEPOINT_SYMBOL(name) \
EXPORT_SYMBOL(__tracepoint_##name)
-#else /* !TRACEPOINTS_ENABLED */
+#else /* !CONFIG_TRACEPOINTS */
#define __DECLARE_TRACE(name, proto, args, cond, data_proto, data_args) \
static inline void trace_##name(proto) \
{ } \
@@ -327,7 +316,7 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p)
#define EXPORT_TRACEPOINT_SYMBOL_GPL(name)
#define EXPORT_TRACEPOINT_SYMBOL(name)
-#endif /* TRACEPOINTS_ENABLED */
+#endif /* CONFIG_TRACEPOINTS */
#ifdef CONFIG_TRACING
/**
--
2.20.1
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply related
* Re: [PATCH 0/3] CP115 pinctrl support
From: Miquel Raynal @ 2019-08-24 11:33 UTC (permalink / raw)
To: Linus Walleij, Yan Markman
Cc: Thomas Petazzoni, Rob Herring, Mark Rutland,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
Gregory Clement, Antoine Tenart, Maxime Chevallier, Nadav Haklai,
open list:GPIO SUBSYSTEM, Linux ARM, Grzegorz Jaszczyk,
Marcin Wojtas, Stefan Chulski
In-Reply-To: <CACRpkdY-AtaS67u4s58PifFtP5C7xp4P15J+hW_Dba=Gb4rhSQ@mail.gmail.com>
Hi Linus,
Linus Walleij <linus.walleij@linaro.org> wrote on Thu, 15 Aug 2019
10:10:46 +0200:
> On Wed, Aug 14, 2019 at 2:35 PM Thomas Petazzoni
> <thomas.petazzoni@bootlin.com> wrote:
> > On Wed, 14 Aug 2019 10:12:36 +0200
> > Linus Walleij <linus.walleij@linaro.org> wrote:
> >
> > > On Wed, Aug 7, 2019 at 2:47 PM Linus Walleij <linus.walleij@linaro.org> wrote:
> > > > On Mon, Aug 5, 2019 at 12:16 PM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> > > >
> > > > > This is the second batch of changes (out of three) to support the brand
> > > > > new Marvell CN9130 SoCs which are made of one AP807 and one CP115.
> > > > >
> > > > > We add a new compatible (and the relevant support in the pinctrl
> > > > > driver) before the addition in batch 3/3 of CN9130 SoCs DT using it.
> > > >
> > > > Waiting for review from the Mvebu maintainers.
> > > >
> > > > If it takes too long just nudge me, it looks good to me.
> > >
> > > So if the other MVEBU maintainers don't really look much at MVEBU
> > > patches anymore while Miquel is working a lot on the platform,
> > > what about listing Miquel as maintainer under the SoC entry, hm?
> >
> > Miquel sent his series on August 5, i.e 9 days ago. We're in August, in
> > the middle of the summer vacations for many people. While it is nice to
> > see subsystem maintainers who want to get code merged in a timely
> > fashion, I think it is probably wise to give it some more time for
> > review in this period of the year.
>
> OK then maybe I am a bit impatient.
Actually Gregory is on vacation until September, so if we still are in
time for this merge window I suppose you can take it.
Thanks,
Miquèl
^ permalink raw reply
* Re: [PATCH] gpiolib: acpi: Add gpiolib_acpi_run_edge_events_on_boot option and blacklist
From: Ian W MORRISON @ 2019-08-24 10:53 UTC (permalink / raw)
To: Hans de Goede
Cc: Mika Westerberg, Andy Shevchenko, Linus Walleij,
Bartosz Golaszewski, Benjamin Tissoires, linux-gpio, linux-acpi,
linux-kernel, stable, Daniel Drake
In-Reply-To: <20190823215255.7631-1-hdegoede@redhat.com>
On Sat, 24 Aug 2019 at 07:53, Hans de Goede <hdegoede@redhat.com> wrote:
>
> To avoid problems like this, this commit adds a new
> gpiolib_acpi_run_edge_events_on_boot kernel commandline option which
> can be "on", "off", or "auto" (default).
>
> In auto mode the default is on and a DMI based blacklist is used,
> the initial version of this blacklist contains the Minix Neo Z83-4
> fixing the HDMI being broken on this device.
>
Many thanks Hans. I've tested the patch including the command line
option with both v5.3-rc5 and linux-next on a Minix Neo Z83-4 and it
works fine.
Best regards,
Ian
^ permalink raw reply
* linusw/devel boot: 53 boots: 1 failed, 52 passed (v5.3-rc1-47-g9ed7ccefcb30)
From: kernelci.org bot @ 2019-08-24 0:01 UTC (permalink / raw)
To: linux-gpio, fellows
linusw/devel boot: 53 boots: 1 failed, 52 passed (v5.3-rc1-47-g9ed7ccefcb30)
Full Boot Summary: https://kernelci.org/boot/all/job/linusw/branch/devel/kernel/v5.3-rc1-47-g9ed7ccefcb30/
Full Build Summary: https://kernelci.org/build/linusw/branch/devel/kernel/v5.3-rc1-47-g9ed7ccefcb30/
Tree: linusw
Branch: devel
Git Describe: v5.3-rc1-47-g9ed7ccefcb30
Git Commit: 9ed7ccefcb306fb61e27b4b74aca1ed29656c572
Git URL: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git/
Tested: 35 unique boards, 15 SoC families, 3 builds out of 6
Boot Regressions Detected:
arm64:
defconfig:
gcc-8:
apq8016-sbc:
lab-mhart: failing since 24 days (last pass: v5.2-10808-g9637d517347e - first fail: v5.3-rc1-5-ga299726da44f)
Boot Failure Detected:
arm64:
defconfig:
gcc-8:
apq8016-sbc: 1 failed lab
---
For more info write to <info@kernelci.org>
^ permalink raw reply
* linusw/devel build: 6 builds: 0 failed, 6 passed, 13 warnings (v5.3-rc1-47-g9ed7ccefcb30)
From: kernelci.org bot @ 2019-08-23 23:16 UTC (permalink / raw)
To: linux-gpio, fellows
linusw/devel build: 6 builds: 0 failed, 6 passed, 13 warnings (v5.3-rc1-47-g9ed7ccefcb30)
Full Build Summary: https://kernelci.org/build/linusw/branch/devel/kernel/v5.3-rc1-47-g9ed7ccefcb30/
Tree: linusw
Branch: devel
Git Describe: v5.3-rc1-47-g9ed7ccefcb30
Git Commit: 9ed7ccefcb306fb61e27b4b74aca1ed29656c572
Git URL: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git/
Built: 6 unique architectures
Warnings Detected:
arc:
nsim_hs_defconfig (gcc-8): 2 warnings
arm64:
arm:
multi_v7_defconfig (gcc-8): 6 warnings
mips:
32r2el_defconfig (gcc-8): 3 warnings
riscv:
defconfig (gcc-8): 2 warnings
x86_64:
Warnings summary:
7 <stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
1 arch/arm/boot/dts/bcm47094-linksys-panamera.dts:129.4-18: Warning (reg_format): /mdio-bus-mux/mdio@200:reg: property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
1 arch/arm/boot/dts/bcm47094-linksys-panamera.dts:128.22-132.5: Warning (avoid_default_addr_size): /mdio-bus-mux/mdio@200: Relying on default #size-cells value
1 arch/arm/boot/dts/bcm47094-linksys-panamera.dts:128.22-132.5: Warning (avoid_default_addr_size): /mdio-bus-mux/mdio@200: Relying on default #address-cells value
1 arch/arm/boot/dts/bcm47094-linksys-panamera.dtb: Warning (spi_bus_reg): Failed prerequisite 'reg_format'
1 arch/arm/boot/dts/bcm47094-linksys-panamera.dtb: Warning (pci_device_bus_num): Failed prerequisite 'reg_format'
1 arch/arm/boot/dts/bcm47094-linksys-panamera.dtb: Warning (i2c_bus_reg): Failed prerequisite 'reg_format'
================================================================================
Detailed per-defconfig build reports:
--------------------------------------------------------------------------------
32r2el_defconfig (mips, gcc-8) — PASS, 0 errors, 3 warnings, 0 section mismatches
Warnings:
<stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
<stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
<stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
--------------------------------------------------------------------------------
defconfig (riscv, gcc-8) — PASS, 0 errors, 2 warnings, 0 section mismatches
Warnings:
<stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
<stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
--------------------------------------------------------------------------------
defconfig (arm64, gcc-8) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
multi_v7_defconfig (arm, gcc-8) — PASS, 0 errors, 6 warnings, 0 section mismatches
Warnings:
arch/arm/boot/dts/bcm47094-linksys-panamera.dts:129.4-18: Warning (reg_format): /mdio-bus-mux/mdio@200:reg: property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
arch/arm/boot/dts/bcm47094-linksys-panamera.dtb: Warning (pci_device_bus_num): Failed prerequisite 'reg_format'
arch/arm/boot/dts/bcm47094-linksys-panamera.dtb: Warning (i2c_bus_reg): Failed prerequisite 'reg_format'
arch/arm/boot/dts/bcm47094-linksys-panamera.dtb: Warning (spi_bus_reg): Failed prerequisite 'reg_format'
arch/arm/boot/dts/bcm47094-linksys-panamera.dts:128.22-132.5: Warning (avoid_default_addr_size): /mdio-bus-mux/mdio@200: Relying on default #address-cells value
arch/arm/boot/dts/bcm47094-linksys-panamera.dts:128.22-132.5: Warning (avoid_default_addr_size): /mdio-bus-mux/mdio@200: Relying on default #size-cells value
--------------------------------------------------------------------------------
nsim_hs_defconfig (arc, gcc-8) — PASS, 0 errors, 2 warnings, 0 section mismatches
Warnings:
<stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
<stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
--------------------------------------------------------------------------------
x86_64_defconfig (x86_64, gcc-8) — PASS, 0 errors, 0 warnings, 0 section mismatches
---
For more info write to <info@kernelci.org>
^ permalink raw reply
* linusw/devel boot: 54 boots: 2 failed, 51 passed with 1 untried/unknown (v5.3-rc1-46-gf4e9bcc05f4e)
From: kernelci.org bot @ 2019-08-23 22:56 UTC (permalink / raw)
To: linux-gpio, fellows
linusw/devel boot: 54 boots: 2 failed, 51 passed with 1 untried/unknown (v5.3-rc1-46-gf4e9bcc05f4e)
Full Boot Summary: https://kernelci.org/boot/all/job/linusw/branch/devel/kernel/v5.3-rc1-46-gf4e9bcc05f4e/
Full Build Summary: https://kernelci.org/build/linusw/branch/devel/kernel/v5.3-rc1-46-gf4e9bcc05f4e/
Tree: linusw
Branch: devel
Git Describe: v5.3-rc1-46-gf4e9bcc05f4e
Git Commit: f4e9bcc05f4e8d543afbfc0ca1fd4435a2204776
Git URL: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git/
Tested: 36 unique boards, 15 SoC families, 3 builds out of 6
Boot Regressions Detected:
arm:
multi_v7_defconfig:
gcc-8:
omap3-beagle-xm:
lab-baylibre: new failure (last pass: v5.3-rc1-25-g470219c619e9)
arm64:
defconfig:
gcc-8:
apq8016-sbc:
lab-mhart: failing since 24 days (last pass: v5.2-10808-g9637d517347e - first fail: v5.3-rc1-5-ga299726da44f)
r8a7795-salvator-x:
lab-baylibre: new failure (last pass: v5.3-rc1-35-ga7e42142926f)
Boot Failures Detected:
arm64:
defconfig:
gcc-8:
apq8016-sbc: 1 failed lab
arm:
multi_v7_defconfig:
gcc-8:
omap3-beagle-xm: 1 failed lab
---
For more info write to <info@kernelci.org>
^ permalink raw reply
* linusw/devel build: 6 builds: 0 failed, 6 passed, 13 warnings (v5.3-rc1-46-gf4e9bcc05f4e)
From: kernelci.org bot @ 2019-08-23 22:12 UTC (permalink / raw)
To: linux-gpio, fellows
linusw/devel build: 6 builds: 0 failed, 6 passed, 13 warnings (v5.3-rc1-46-gf4e9bcc05f4e)
Full Build Summary: https://kernelci.org/build/linusw/branch/devel/kernel/v5.3-rc1-46-gf4e9bcc05f4e/
Tree: linusw
Branch: devel
Git Describe: v5.3-rc1-46-gf4e9bcc05f4e
Git Commit: f4e9bcc05f4e8d543afbfc0ca1fd4435a2204776
Git URL: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git/
Built: 6 unique architectures
Warnings Detected:
arc:
nsim_hs_defconfig (gcc-8): 2 warnings
arm64:
arm:
multi_v7_defconfig (gcc-8): 6 warnings
mips:
32r2el_defconfig (gcc-8): 3 warnings
riscv:
defconfig (gcc-8): 2 warnings
x86_64:
Warnings summary:
7 <stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
1 arch/arm/boot/dts/bcm47094-linksys-panamera.dts:129.4-18: Warning (reg_format): /mdio-bus-mux/mdio@200:reg: property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
1 arch/arm/boot/dts/bcm47094-linksys-panamera.dts:128.22-132.5: Warning (avoid_default_addr_size): /mdio-bus-mux/mdio@200: Relying on default #size-cells value
1 arch/arm/boot/dts/bcm47094-linksys-panamera.dts:128.22-132.5: Warning (avoid_default_addr_size): /mdio-bus-mux/mdio@200: Relying on default #address-cells value
1 arch/arm/boot/dts/bcm47094-linksys-panamera.dtb: Warning (spi_bus_reg): Failed prerequisite 'reg_format'
1 arch/arm/boot/dts/bcm47094-linksys-panamera.dtb: Warning (pci_device_bus_num): Failed prerequisite 'reg_format'
1 arch/arm/boot/dts/bcm47094-linksys-panamera.dtb: Warning (i2c_bus_reg): Failed prerequisite 'reg_format'
================================================================================
Detailed per-defconfig build reports:
--------------------------------------------------------------------------------
32r2el_defconfig (mips, gcc-8) — PASS, 0 errors, 3 warnings, 0 section mismatches
Warnings:
<stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
<stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
<stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
--------------------------------------------------------------------------------
defconfig (riscv, gcc-8) — PASS, 0 errors, 2 warnings, 0 section mismatches
Warnings:
<stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
<stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
--------------------------------------------------------------------------------
defconfig (arm64, gcc-8) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
multi_v7_defconfig (arm, gcc-8) — PASS, 0 errors, 6 warnings, 0 section mismatches
Warnings:
arch/arm/boot/dts/bcm47094-linksys-panamera.dts:129.4-18: Warning (reg_format): /mdio-bus-mux/mdio@200:reg: property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
arch/arm/boot/dts/bcm47094-linksys-panamera.dtb: Warning (pci_device_bus_num): Failed prerequisite 'reg_format'
arch/arm/boot/dts/bcm47094-linksys-panamera.dtb: Warning (i2c_bus_reg): Failed prerequisite 'reg_format'
arch/arm/boot/dts/bcm47094-linksys-panamera.dtb: Warning (spi_bus_reg): Failed prerequisite 'reg_format'
arch/arm/boot/dts/bcm47094-linksys-panamera.dts:128.22-132.5: Warning (avoid_default_addr_size): /mdio-bus-mux/mdio@200: Relying on default #address-cells value
arch/arm/boot/dts/bcm47094-linksys-panamera.dts:128.22-132.5: Warning (avoid_default_addr_size): /mdio-bus-mux/mdio@200: Relying on default #size-cells value
--------------------------------------------------------------------------------
nsim_hs_defconfig (arc, gcc-8) — PASS, 0 errors, 2 warnings, 0 section mismatches
Warnings:
<stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
<stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
--------------------------------------------------------------------------------
x86_64_defconfig (x86_64, gcc-8) — PASS, 0 errors, 0 warnings, 0 section mismatches
---
For more info write to <info@kernelci.org>
^ permalink raw reply
* [PATCH] gpiolib: acpi: Add gpiolib_acpi_run_edge_events_on_boot option and blacklist
From: Hans de Goede @ 2019-08-23 21:52 UTC (permalink / raw)
To: Mika Westerberg, Andy Shevchenko, Linus Walleij,
Bartosz Golaszewski
Cc: Hans de Goede, Benjamin Tissoires, linux-gpio, linux-acpi,
linux-kernel, stable, Daniel Drake, Ian W MORRISON
Another day; another DSDT bug we need to workaround...
Since commit ca876c7483b6 ("gpiolib-acpi: make sure we trigger edge events
at least once on boot") we call _AEI edge handlers at boot.
In some rare cases this causes problems. One example of this is the Minix
Neo Z83-4 mini PC, this device has a clear DSDT bug where it has some copy
and pasted code for dealing with Micro USB-B connector host/device role
switching, while the mini PC does not even have a micro-USB connector.
This code, which should not be there, messes with the DDC data pin from
the HDMI connector (switching it to GPIO mode) breaking HDMI support.
To avoid problems like this, this commit adds a new
gpiolib_acpi_run_edge_events_on_boot kernel commandline option which
can be "on", "off", or "auto" (default).
In auto mode the default is on and a DMI based blacklist is used,
the initial version of this blacklist contains the Minix Neo Z83-4
fixing the HDMI being broken on this device.
Cc: stable@vger.kernel.org
Cc: Daniel Drake <drake@endlessm.com>
Cc: Ian W MORRISON <ianwmorrison@gmail.com>
Reported-by: Ian W MORRISON <ianwmorrison@gmail.com>
Suggested-by: Ian W MORRISON <ianwmorrison@gmail.com>
Fixes: ca876c7483b6 ("gpiolib-acpi: make sure we trigger edge events at least once on boot")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
drivers/gpio/gpiolib-acpi.c | 52 ++++++++++++++++++++++++++++++++++---
1 file changed, 48 insertions(+), 4 deletions(-)
diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
index 39f2f9035c11..546dc2c1f3f1 100644
--- a/drivers/gpio/gpiolib-acpi.c
+++ b/drivers/gpio/gpiolib-acpi.c
@@ -7,6 +7,7 @@
* Mika Westerberg <mika.westerberg@linux.intel.com>
*/
+#include <linux/dmi.h>
#include <linux/errno.h>
#include <linux/gpio/consumer.h>
#include <linux/gpio/driver.h>
@@ -19,6 +20,23 @@
#include "gpiolib.h"
+static int gpiolib_acpi_run_edge_events_on_boot = -1;
+
+static int __init gpiolib_acpi_run_edge_events_on_boot_setup(char *arg)
+{
+ if (!strcmp(arg, "on"))
+ gpiolib_acpi_run_edge_events_on_boot = 1;
+ else if (!strcmp(arg, "off"))
+ gpiolib_acpi_run_edge_events_on_boot = 0;
+ else if (!strcmp(arg, "auto"))
+ gpiolib_acpi_run_edge_events_on_boot = -1;
+
+ return 1;
+}
+
+__setup("gpiolib_acpi_run_edge_events_on_boot=",
+ gpiolib_acpi_run_edge_events_on_boot_setup);
+
/**
* struct acpi_gpio_event - ACPI GPIO event handler data
*
@@ -150,6 +168,29 @@ bool acpi_gpio_get_irq_resource(struct acpi_resource *ares,
}
EXPORT_SYMBOL_GPL(acpi_gpio_get_irq_resource);
+static const struct dmi_system_id run_edge_events_on_boot_blacklist[] =
+{
+ {
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "MINIX"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "Z83-4"),
+ }
+ },
+ {} /* Terminating entry */
+};
+
+static bool acpi_gpiochip_run_edge_events_on_boot(void)
+{
+ if (gpiolib_acpi_run_edge_events_on_boot == -1) {
+ if (dmi_check_system(run_edge_events_on_boot_blacklist))
+ gpiolib_acpi_run_edge_events_on_boot = 0;
+ else
+ gpiolib_acpi_run_edge_events_on_boot = 1;
+ }
+
+ return gpiolib_acpi_run_edge_events_on_boot;
+}
+
static void acpi_gpiochip_request_irq(struct acpi_gpio_chip *acpi_gpio,
struct acpi_gpio_event *event)
{
@@ -170,10 +211,13 @@ static void acpi_gpiochip_request_irq(struct acpi_gpio_chip *acpi_gpio,
event->irq_requested = true;
/* Make sure we trigger the initial state of edge-triggered IRQs */
- value = gpiod_get_raw_value_cansleep(event->desc);
- if (((event->irqflags & IRQF_TRIGGER_RISING) && value == 1) ||
- ((event->irqflags & IRQF_TRIGGER_FALLING) && value == 0))
- event->handler(event->irq, event);
+ if (acpi_gpiochip_run_edge_events_on_boot() &&
+ (event->irqflags & (IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING))) {
+ value = gpiod_get_raw_value_cansleep(event->desc);
+ if (((event->irqflags & IRQF_TRIGGER_RISING) && value == 1) ||
+ ((event->irqflags & IRQF_TRIGGER_FALLING) && value == 0))
+ event->handler(event->irq, event);
+ }
}
static void acpi_gpiochip_request_irqs(struct acpi_gpio_chip *acpi_gpio)
--
2.22.0
^ permalink raw reply related
* Re: [git pull] pinctrl: sh-pfc: Updates for v5.4 (take two)
From: Linus Walleij @ 2019-08-23 21:07 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: open list:GPIO SUBSYSTEM, Linux-Renesas
In-Reply-To: <20190823125948.21685-1-geert+renesas@glider.be>
On Fri, Aug 23, 2019 at 2:59 PM Geert Uytterhoeven
<geert+renesas@glider.be> wrote:
> The following changes since commit 625efea83a7c37d281c6a90526813a1366929d24:
>
> pinctrl: rza1: Use devm_platform_ioremap_resource() helper (2019-08-09 09:34:45 +0200)
>
> are available in the Git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git tags/sh-pfc-for-v5.4-tag2
>
> for you to fetch changes up to 0a6864274e4166cde21f26193350c7fcd9716ef5:
>
> pinctrl: rza2: Include the appropriate headers (2019-08-23 09:08:10 +0200)
Pulled into my pinctrl "devel" branch, thanks!
Yours,
Linus Walleij
^ permalink raw reply
* Re: [PATCH] pinctrl: bcm2835: Pass irqchip when adding gpiochip
From: Linus Walleij @ 2019-08-23 21:04 UTC (permalink / raw)
To: Stefan Wahren
Cc: open list:GPIO SUBSYSTEM, Eric Anholt, Bartosz Golaszewski,
Thierry Reding
In-Reply-To: <b93be430-a20c-6709-dda4-b16d76858300@i2se.com>
On Fri, Aug 23, 2019 at 9:00 PM Stefan Wahren <stefan.wahren@i2se.com> wrote:
> > Can you give me some test ideas?
>
> I configured a GPIO as input with pull-up, setup the interrupt via sysfs
> and wired the GPIO to GND.
> After that i checked that /proc/interrupts for the pin has increased.
> Everything worked as expected.
>
> Is it sufficient?
>
> Tested-by: Stefan Wahren <stefan.wahren@i2se.com>
Works for me, at least it is not crashing or going numb, elaborate
testing we do in -next, thanks! Applied with your test-tag.
Yours,
Linus Walleij
^ permalink raw reply
* linusw/fixes boot: 55 boots: 1 failed, 53 passed with 1 untried/unknown (v5.3-rc4-4-g48057ed1840f)
From: kernelci.org bot @ 2019-08-23 19:35 UTC (permalink / raw)
To: linux-gpio, fellows
linusw/fixes boot: 55 boots: 1 failed, 53 passed with 1 untried/unknown (v5.3-rc4-4-g48057ed1840f)
Full Boot Summary: https://kernelci.org/boot/all/job/linusw/branch/fixes/kernel/v5.3-rc4-4-g48057ed1840f/
Full Build Summary: https://kernelci.org/build/linusw/branch/fixes/kernel/v5.3-rc4-4-g48057ed1840f/
Tree: linusw
Branch: fixes
Git Describe: v5.3-rc4-4-g48057ed1840f
Git Commit: 48057ed1840fde9239b1e000bea1a0a1f07c5e99
Git URL: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git/
Tested: 37 unique boards, 15 SoC families, 3 builds out of 6
Boot Regressions Detected:
arm64:
defconfig:
gcc-8:
meson-gxl-s905x-khadas-vim:
lab-baylibre: new failure (last pass: v5.3-rc4-4-g607ff4deb08f)
Boot Failure Detected:
arm:
multi_v7_defconfig:
gcc-8:
sun7i-a20-cubieboard2: 1 failed lab
---
For more info write to <info@kernelci.org>
^ permalink raw reply
* Re: [PATCH] pinctrl: bcm2835: Pass irqchip when adding gpiochip
From: Stefan Wahren @ 2019-08-23 19:00 UTC (permalink / raw)
To: Linus Walleij, open list:GPIO SUBSYSTEM, Eric Anholt
Cc: Bartosz Golaszewski, Thierry Reding
In-Reply-To: <a82230ae-4f3a-2600-0bea-85c432c56d05@i2se.com>
Hi Linus,
Am 23.08.19 um 10:07 schrieb Stefan Wahren:
> Hi Linus,
>
> [removed Simon from CC to stop annoy him]
>
> On 23.08.19 09:46, Linus Walleij wrote:
>> On Mon, Aug 12, 2019 at 8:29 AM Linus Walleij <linus.walleij@linaro.org> wrote:
>>
>>> We need to convert all old gpio irqchips to pass the irqchip
>>> setup along when adding the gpio_chip. For more info see
>>> drivers/gpio/TODO.
>>>
>>> For chained irqchips this is a pretty straight-forward
>>> conversion. The BCM2835 has multiple parents so let's
>>> exploit the new facility in the GPIO_IRQCHIP to actually
>>> deal with multiple parents.
>>>
>>> Cc: Simon Arlott <simon@arlott.org>
please remove Simon's email address before applying
>>> Cc: Eric Anholt <eric@anholt.net>
>>> Cc: Stefan Wahren <stefan.wahren@i2se.com>
and use my new address in the future.
>>> Cc: Thierry Reding <treding@nvidia.com>
>>> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
>> This patch is a bit scary because I haven't tried converting multiple
>> parents before. Any chance one of you RPi people could give it
>> a test run, so you don't have to experience testing it in linux-next?
> it's on my TODO list, but i didn't had the time to test it yet.
>
> Can you give me some test ideas?
I configured a GPIO as input with pull-up, setup the interrupt via sysfs
and wired the GPIO to GND.
After that i checked that /proc/interrupts for the pin has increased.
Everything worked as expected.
Is it sufficient?
Tested-by: Stefan Wahren <stefan.wahren@i2se.com>
>
>> Yours,
>> Linus Walleij
^ permalink raw reply
* linusw/fixes build: 6 builds: 0 failed, 6 passed, 34 warnings (v5.3-rc4-4-g48057ed1840f)
From: kernelci.org bot @ 2019-08-23 18:50 UTC (permalink / raw)
To: linux-gpio, fellows
linusw/fixes build: 6 builds: 0 failed, 6 passed, 34 warnings (v5.3-rc4-4-g48057ed1840f)
Full Build Summary: https://kernelci.org/build/linusw/branch/fixes/kernel/v5.3-rc4-4-g48057ed1840f/
Tree: linusw
Branch: fixes
Git Describe: v5.3-rc4-4-g48057ed1840f
Git Commit: 48057ed1840fde9239b1e000bea1a0a1f07c5e99
Git URL: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git/
Built: 6 unique architectures
Warnings Detected:
arc:
nsim_hs_defconfig (gcc-8): 5 warnings
arm64:
defconfig (gcc-8): 5 warnings
arm:
multi_v7_defconfig (gcc-8): 21 warnings
mips:
32r2el_defconfig (gcc-8): 3 warnings
riscv:
x86_64:
Warnings summary:
5 <stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
2 drivers/pinctrl/qcom/pinctrl-spmi-gpio.c:820:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
2 drivers/pinctrl/qcom/pinctrl-spmi-gpio.c:815:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
2 drivers/pinctrl/pinctrl-rockchip.c:2783:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
2 drivers/gpu/drm/sun4i/sun4i_tcon.c:316:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 include/linux/compiler.h:328:5: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/video/fbdev/sh_mobile_lcdcfb.c:2086:22: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/video/fbdev/sh_mobile_lcdcfb.c:1596:22: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/usb/phy/phy-ab8500-usb.c:459:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/usb/phy/phy-ab8500-usb.c:440:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/usb/phy/phy-ab8500-usb.c:424:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/usb/phy/phy-ab8500-usb.c:370:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/usb/phy/phy-ab8500-usb.c:352:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/usb/phy/phy-ab8500-usb.c:332:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/mmc/host/sdhci-s3c.c:613:19: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/mmc/host/atmel-mci.c:2426:40: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/mmc/host/atmel-mci.c:2422:28: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/mmc/host/atmel-mci.c:2415:30: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/iommu/arm-smmu-v3.c:1189:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c:992:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/gpu/drm/sti/sti_hdmi.c:855:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/gpu/drm/sti/sti_hdmi.c:853:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/gpu/drm/sti/sti_hdmi.c:851:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/dma/imx-dma.c:542:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 arch/arc/kernel/unwind.c:836:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 arch/arc/kernel/unwind.c:827:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
================================================================================
Detailed per-defconfig build reports:
--------------------------------------------------------------------------------
32r2el_defconfig (mips, gcc-8) — PASS, 0 errors, 3 warnings, 0 section mismatches
Warnings:
<stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
<stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
<stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
--------------------------------------------------------------------------------
defconfig (riscv, gcc-8) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
defconfig (arm64, gcc-8) — PASS, 0 errors, 5 warnings, 0 section mismatches
Warnings:
drivers/iommu/arm-smmu-v3.c:1189:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/pinctrl/qcom/pinctrl-spmi-gpio.c:815:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/pinctrl/qcom/pinctrl-spmi-gpio.c:820:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/pinctrl/pinctrl-rockchip.c:2783:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/gpu/drm/sun4i/sun4i_tcon.c:316:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
--------------------------------------------------------------------------------
multi_v7_defconfig (arm, gcc-8) — PASS, 0 errors, 21 warnings, 0 section mismatches
Warnings:
drivers/dma/imx-dma.c:542:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mmc/host/sdhci-s3c.c:613:19: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mmc/host/atmel-mci.c:2415:30: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mmc/host/atmel-mci.c:2422:28: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mmc/host/atmel-mci.c:2426:40: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/pinctrl/qcom/pinctrl-spmi-gpio.c:815:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/pinctrl/qcom/pinctrl-spmi-gpio.c:820:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/pinctrl/pinctrl-rockchip.c:2783:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/video/fbdev/sh_mobile_lcdcfb.c:2086:22: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/video/fbdev/sh_mobile_lcdcfb.c:1596:22: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/usb/phy/phy-ab8500-usb.c:424:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/usb/phy/phy-ab8500-usb.c:440:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/usb/phy/phy-ab8500-usb.c:459:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/usb/phy/phy-ab8500-usb.c:332:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/usb/phy/phy-ab8500-usb.c:352:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/usb/phy/phy-ab8500-usb.c:370:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/gpu/drm/sti/sti_hdmi.c:851:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/gpu/drm/sti/sti_hdmi.c:853:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/gpu/drm/sti/sti_hdmi.c:855:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/gpu/drm/sun4i/sun4i_tcon.c:316:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c:992:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
--------------------------------------------------------------------------------
nsim_hs_defconfig (arc, gcc-8) — PASS, 0 errors, 5 warnings, 0 section mismatches
Warnings:
<stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
include/linux/compiler.h:328:5: warning: this statement may fall through [-Wimplicit-fallthrough=]
arch/arc/kernel/unwind.c:827:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
arch/arc/kernel/unwind.c:836:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
<stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
--------------------------------------------------------------------------------
x86_64_defconfig (x86_64, gcc-8) — PASS, 0 errors, 0 warnings, 0 section mismatches
---
For more info write to <info@kernelci.org>
^ permalink raw reply
* Re: gpiolib-acpi problematic trigger of edge events during boot
From: Hans de Goede @ 2019-08-23 18:48 UTC (permalink / raw)
To: Daniel Drake, Benjamin Tissoires
Cc: Endless Linux Upstreaming Team, open list:PIN CONTROL SUBSYSTEM,
ACPI Devel Maling List
In-Reply-To: <CAD8Lp47Le8CBkc3HN4_8+x6ZqR5eiwbVh+VbnfFysKgPgErptQ@mail.gmail.com>
Hi Daniel,
On 8/23/19 4:59 AM, Daniel Drake wrote:
> Hi,
>
> acpi_gpiochip_request_irq() has this code:
>
> /* Make sure we trigger the initial state of edge-triggered IRQs */
> value = gpiod_get_raw_value_cansleep(event->desc);
> if (((event->irqflags & IRQF_TRIGGER_RISING) && value == 1) ||
> ((event->irqflags & IRQF_TRIGGER_FALLING) && value == 0))
> event->handler(event->irq, event);
>
> Originally introduced in:
> commit ca876c7483b697b498868b1f575997191b077885
> Author: Benjamin Tissoires <benjamin.tissoires@redhat.com>
> Date: Thu Jul 12 17:25:06 2018 +0200
>
> gpiolib-acpi: make sure we trigger edge events at least once on boot
>
> This code is causing a problem on a new consumer laptop, which is
> based on the new ACPI reduced hardware standard. Under this design,
> the power button is now just an ordinary GPIO that should be handled
> by software: ACPI's _AEI method lists this GPIO as one that the OS
> should monitor for changes, and the OS is expected to call the
> corresponding _EVT method when that happens, which will in turn raise
> a Notify event on the power button device.
>
> Here, the GpioInt defined in _AEI is Edge-triggered, ActiveHigh. The
> GPIO level is ordinarily high, but goes low when the button is
> pressed. We checked this definition and behaviour with the vendor,
> even suggesting that it should maybe be ActiveLow instead, but they
> responded that this is correct and by-design.
>
> These conditions set the IRQF_TRIGGER_RISING flag and cause the _EVT
> event handler to be called by the code above as soon as the pinctrl
> module is loaded. In other words, loading the pinctrl driver causes
> the system to incorrectly believe the power button has been pressed so
> it will immediately go into suspend or shutdown.
>
> Fortunately this is perhaps not a serious issue, as at least Ubuntu
> and Endless build the corresponding pinctrl drivers directly into the
> kernel image. They are then loaded in early boot, and despite a power
> button event being reported, it's so early that userspace doesn't
> notice and no action is taken.
>
> But I raise this anyway as a potential problem should that ever
> change, it may also become a more widespead issue as the ACPI reduced
> hardware standard becomes more and more common in consumer devices.
>
> Any ideas for how we can better deal with this issue?
>
> I can see the rationale for handling the specific cases mentioned in
> the original commit message, but at the same time this code seems to
> be assuming that an edge transition has happened, which is not true in
> this case.
The code does not as much assume that an edge has happened as well
that calling the handler unnecessarily is safely to do, IOW that
it only sets state which may have already been set to the same
state, without any side-effects.
In your power-button example this clearly is not true.
I picked up Benjamin's patch (which he wrote for the surface 3)
because I have been seeing the second issue (micro-usb-b ports
not working on device mode unless first forced to host mode)
and quite a few different Cherry Trail devices.
Yesterday and today I have actually been working on an issue
where the root cause is also this issue. The case I'm working on
is the HDMI output of the Minix Neo Z83-4 Mini PC not working.
The problem is the DSDT for this Cherry Trail device has been copy
and pasted from a tablet and thus has the host/device role switch code
(even though the Mini PC has no micro USB connector at all).
For some reason the _AEI handler for this is also bit-banging the DDC
data pin of the HDMI connector, flipping it from its DDC special function
into GPIO mode, breaking DDC on the HDMI connector.
As mentioned in another mail-thread my plan to fix this is:
1) Add a gpiolib_acpi_run_edge_events_on_startup kernel parameter which
controls this behavior
2) Make this default paramter to auto which uses a DMI blacklist
But I have the feeling that $otherOS (aka Windows) does not do this
and that if we hit more cases we may need to completely stop doing
this or switch to a whitelist. Although the whitelist for the micro-usb
role-sw thingie is going to be huge (Windows does not do device mode so
it does not care).
Anyways for now I think a blacklist is a good approach we can
re-evaluate if it grows too much.
Daniel, I will Cc you on the patch adding the blacklist, if you
want you can add the laptop you are seeing this on to the list, although
as you mentioned ATM this does not seem to be a real problem on that
laptop, so I'm not 100% sure if we should add it to the blacklist.
Regards,
Hans
^ permalink raw reply
* [git pull] pinctrl: sh-pfc: Updates for v5.4 (take two)
From: Geert Uytterhoeven @ 2019-08-23 12:59 UTC (permalink / raw)
To: Linus Walleij; +Cc: linux-gpio, linux-renesas-soc, Geert Uytterhoeven
Hi Linus,
The following changes since commit 625efea83a7c37d281c6a90526813a1366929d24:
pinctrl: rza1: Use devm_platform_ioremap_resource() helper (2019-08-09 09:34:45 +0200)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git tags/sh-pfc-for-v5.4-tag2
for you to fetch changes up to 0a6864274e4166cde21f26193350c7fcd9716ef5:
pinctrl: rza2: Include the appropriate headers (2019-08-23 09:08:10 +0200)
----------------------------------------------------------------
pinctrl: sh-pfc: Updates for v5.4 (take two)
- Support switching between function and gpio at runtime,
- Small fixes and cleanups.
Thanks for pulling!
----------------------------------------------------------------
Linus Walleij (3):
pinctrl: sh-pfc: Include the right header
pinctrl: rza2: Drop driver use of consumer flags
pinctrl: rza2: Include the appropriate headers
Nishka Dasgupta (1):
pinctrl: rza1: Add of_node_put() before return
Yoshihiro Shimoda (3):
pinctrl: sh-pfc: Add new flags into struct sh_pfc_pin_config
pinctrl: sh-pfc: Remove incomplete flag "cfg->type"
pinctrl: sh-pfc: Rollback to mux if required when the gpio is freed
drivers/pinctrl/pinctrl-rza1.c | 12 ++++++++---
drivers/pinctrl/pinctrl-rza2.c | 17 ++++++++-------
drivers/pinctrl/sh-pfc/gpio.c | 2 +-
drivers/pinctrl/sh-pfc/pinctrl.c | 45 ++++++++++++++++++++--------------------
4 files changed, 42 insertions(+), 34 deletions(-)
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply
* Re: [PATCH v2] microblaze: Switch to standard restart handler
From: Linus Walleij @ 2019-08-23 11:19 UTC (permalink / raw)
To: Michal Simek; +Cc: open list:GPIO SUBSYSTEM, Bartosz Golaszewski, Arnd Bergmann
In-Reply-To: <896d895c-0504-36c3-e1ba-5b4cf9cc9cac@monstr.eu>
On Fri, Aug 23, 2019 at 12:56 PM Michal Simek <monstr@monstr.eu> wrote:
> > +void machine_restart(char *cmd)
> > +{
> > + do_kernel_restart(cmd);
> > + /* Give the restart hook 1 s to take us down */
> > + mdelay(1000);
> > + pr_emerg("Reboot failed -- System halted\n");
> > + while (1);
> > +}
> > +
> > /*
> > * MMU_init sets up the basic memory mappings for the kernel,
> > * including both RAM and possibly some I/O regions,
> >
>
> I will test this for sure. What's the reason to add machine_restart to
> mm/ folder? You can simply keep it in a location where it was.
It is because the three calls to machine_restart() were in this
file and therefore I just put it in proximity.
I can move it.
> Do you know why of_find_gpio can failed in connection to gpio-xilinx driver?
The only reason it'd fail would be if the module is not compiled
in, or deferred probe happens, but then -EPROBE_DEFER
would be returned I think.
Yours,
Linus Walleij
^ permalink raw reply
* Re: [PATCH v2] microblaze: Switch to standard restart handler
From: Michal Simek @ 2019-08-23 10:55 UTC (permalink / raw)
To: Linus Walleij, linux-gpio; +Cc: Bartosz Golaszewski, Arnd Bergmann
In-Reply-To: <20190823094728.15012-1-linus.walleij@linaro.org>
[-- Attachment #1.1: Type: text/plain, Size: 7882 bytes --]
On 23. 08. 19 11:47, Linus Walleij wrote:
> The microblaze uses the legacy APIs to dig out a GPIO pin
> defined in the root of the device tree to issue a hard
> reset of the platform.
>
> Asserting a hard reset should be done using the standard
> DT-enabled and fully GPIO descriptor aware driver in
> drivers/power/reset/gpio-restart.c using the bindings
> from Documentation/devicetree/bindings/power/reset/gpio-restart.txt
>
> To achieve this, first make sure microblaze makes use of
> the standard kernel restart path utilizing do_kernel_restart()
> from <linux/reboot.h>. Put in some grace time and an
> emergency print if the restart does not properly assert.
>
> As this is basic platform functionality we patch the DTS
> file and defconfig in one go for a lockstep change.
>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Michal Simek <monstr@monstr.eu>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> ChangeLog v1->v2:
> - Fix the reset GPIOs property in the DTS file to be
> just "gpios" as expected by the driver.
>
> Hi Michal, would be great if you could test and fix this up
> so I can get rid of one more site where legacy GPIO is used.
> I am unsure of the appropriate polarity and delays, hence the
> comments in the DTS file.
> ---
> arch/microblaze/boot/dts/system.dts | 16 +++++-
> arch/microblaze/configs/mmu_defconfig | 2 +
> arch/microblaze/configs/nommu_defconfig | 2 +
> arch/microblaze/include/asm/setup.h | 1 -
> arch/microblaze/kernel/reset.c | 76 -------------------------
> arch/microblaze/mm/init.c | 11 ++++
> 6 files changed, 30 insertions(+), 78 deletions(-)
>
> diff --git a/arch/microblaze/boot/dts/system.dts b/arch/microblaze/boot/dts/system.dts
> index 5a8a9d090c37..5b236527176e 100644
> --- a/arch/microblaze/boot/dts/system.dts
> +++ b/arch/microblaze/boot/dts/system.dts
> @@ -18,7 +18,6 @@
> #address-cells = <1>;
> #size-cells = <1>;
> compatible = "xlnx,microblaze";
> - hard-reset-gpios = <&LEDs_8Bit 2 1>;
> model = "testing";
> DDR2_SDRAM: memory@90000000 {
> device_type = "memory";
> @@ -281,6 +280,21 @@
> gpios = <&LEDs_8Bit 7 1>;
> };
> } ;
> +
> + gpio-restart {
> + compatible = "gpio-restart";
> + /*
> + * FIXME: is this active low or active high?
> + * the current flag (1) indicates active low.
> + * delay measures are templates, should be adjusted
> + * to datasheet or trial-and-error with real hardware.
> + */
> + gpios = <&LEDs_8Bit 2 1>;
> + active-delay = <100>;
> + inactive-delay = <10>;
> + wait-delay = <100>;
> + };
> +
> RS232_Uart_1: serial@84000000 {
> clock-frequency = <125000000>;
> compatible = "xlnx,xps-uartlite-1.00.a";
> diff --git a/arch/microblaze/configs/mmu_defconfig b/arch/microblaze/configs/mmu_defconfig
> index 92fd4e95b488..ae8d7d407ff4 100644
> --- a/arch/microblaze/configs/mmu_defconfig
> +++ b/arch/microblaze/configs/mmu_defconfig
> @@ -59,6 +59,8 @@ CONFIG_SPI_XILINX=y
> CONFIG_GPIOLIB=y
> CONFIG_GPIO_SYSFS=y
> CONFIG_GPIO_XILINX=y
> +CONFIG_POWER_RESET=y
> +CONFIG_POWER_RESET_GPIO_RESTART=y
> # CONFIG_HWMON is not set
> CONFIG_WATCHDOG=y
> CONFIG_XILINX_WATCHDOG=y
> diff --git a/arch/microblaze/configs/nommu_defconfig b/arch/microblaze/configs/nommu_defconfig
> index 06d69a6e192d..a2a6be511551 100644
> --- a/arch/microblaze/configs/nommu_defconfig
> +++ b/arch/microblaze/configs/nommu_defconfig
> @@ -62,6 +62,8 @@ CONFIG_SPI_XILINX=y
> CONFIG_GPIOLIB=y
> CONFIG_GPIO_SYSFS=y
> CONFIG_GPIO_XILINX=y
> +CONFIG_POWER_RESET=y
> +CONFIG_POWER_RESET_GPIO_RESTART=y
> # CONFIG_HWMON is not set
> CONFIG_WATCHDOG=y
> CONFIG_XILINX_WATCHDOG=y
> diff --git a/arch/microblaze/include/asm/setup.h b/arch/microblaze/include/asm/setup.h
> index ce9b7b786156..54d634ed98e6 100644
> --- a/arch/microblaze/include/asm/setup.h
> +++ b/arch/microblaze/include/asm/setup.h
> @@ -29,7 +29,6 @@ void machine_early_init(const char *cmdline, unsigned int ram,
> unsigned int fdt, unsigned int msr, unsigned int tlb0,
> unsigned int tlb1);
>
> -void machine_restart(char *cmd);
> void machine_shutdown(void);
> void machine_halt(void);
> void machine_power_off(void);
> diff --git a/arch/microblaze/kernel/reset.c b/arch/microblaze/kernel/reset.c
> index fcbe1daf6316..b56af4eb91bf 100644
> --- a/arch/microblaze/kernel/reset.c
> +++ b/arch/microblaze/kernel/reset.c
> @@ -10,82 +10,6 @@
> #include <linux/init.h>
> #include <linux/of_platform.h>
>
> -/* Trigger specific functions */
> -#ifdef CONFIG_GPIOLIB
> -
> -#include <linux/of_gpio.h>
> -
> -static int handle; /* reset pin handle */
> -static unsigned int reset_val;
> -
> -static int of_platform_reset_gpio_probe(void)
> -{
> - int ret;
> - handle = of_get_named_gpio(of_find_node_by_path("/"),
> - "hard-reset-gpios", 0);
> -
> - if (!gpio_is_valid(handle)) {
> - pr_info("Skipping unavailable RESET gpio %d (%s)\n",
> - handle, "reset");
> - return -ENODEV;
> - }
> -
> - ret = gpio_request(handle, "reset");
> - if (ret < 0) {
> - pr_info("GPIO pin is already allocated\n");
> - return ret;
> - }
> -
> - /* get current setup value */
> - reset_val = gpio_get_value(handle);
> - /* FIXME maybe worth to perform any action */
> - pr_debug("Reset: Gpio output state: 0x%x\n", reset_val);
> -
> - /* Setup GPIO as output */
> - ret = gpio_direction_output(handle, 0);
> - if (ret < 0)
> - goto err;
> -
> - /* Setup output direction */
> - gpio_set_value(handle, 0);
> -
> - pr_info("RESET: Registered gpio device: %d, current val: %d\n",
> - handle, reset_val);
> - return 0;
> -err:
> - gpio_free(handle);
> - return ret;
> -}
> -device_initcall(of_platform_reset_gpio_probe);
> -
> -
> -static void gpio_system_reset(void)
> -{
> - if (gpio_is_valid(handle))
> - gpio_set_value(handle, 1 - reset_val);
> - else
> - pr_notice("Reset GPIO unavailable - halting!\n");
> -}
> -#else
> -static void gpio_system_reset(void)
> -{
> - pr_notice("No reset GPIO present - halting!\n");
> -}
> -
> -void of_platform_reset_gpio_probe(void)
> -{
> - return;
> -}
> -#endif
> -
> -void machine_restart(char *cmd)
> -{
> - pr_notice("Machine restart...\n");
> - gpio_system_reset();
> - while (1)
> - ;
> -}
> -
> void machine_shutdown(void)
> {
> pr_notice("Machine shutdown...\n");
> diff --git a/arch/microblaze/mm/init.c b/arch/microblaze/mm/init.c
> index a015a951c8b7..4a45e037107f 100644
> --- a/arch/microblaze/mm/init.c
> +++ b/arch/microblaze/mm/init.c
> @@ -17,6 +17,8 @@
> #include <linux/slab.h>
> #include <linux/swap.h>
> #include <linux/export.h>
> +#include <linux/delay.h>
> +#include <linux/reboot.h>
>
> #include <asm/page.h>
> #include <asm/mmu_context.h>
> @@ -265,6 +267,15 @@ static void __init mmu_init_hw(void)
> : : : "r11");
> }
>
> +void machine_restart(char *cmd)
> +{
> + do_kernel_restart(cmd);
> + /* Give the restart hook 1 s to take us down */
> + mdelay(1000);
> + pr_emerg("Reboot failed -- System halted\n");
> + while (1);
> +}
> +
> /*
> * MMU_init sets up the basic memory mappings for the kernel,
> * including both RAM and possibly some I/O regions,
>
I will test this for sure. What's the reason to add machine_restart to
mm/ folder? You can simply keep it in a location where it was.
Do you know why of_find_gpio can failed in connection to gpio-xilinx driver?
Thanks,
Michal
--
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply
* Re: [PATCH] gpio: Fix irqchip initialization order
From: Andy Shevchenko @ 2019-08-23 10:25 UTC (permalink / raw)
To: Linus Walleij
Cc: Wei Xu, open list:GPIO SUBSYSTEM, Bartosz Golaszewski,
Thierry Reding, Grygorii Strashko
In-Reply-To: <CACRpkdYKN23csn+DekZdNRN1HN8weX8SiU5W6XofvqzdAERTAQ@mail.gmail.com>
On Fri, Aug 23, 2019 at 12:02 PM Linus Walleij <linus.walleij@linaro.org> wrote:
>
> On Fri, Aug 23, 2019 at 10:31 AM Wei Xu <xuwei5@hisilicon.com> wrote:
>
> > Yes, this fixes the problem and tested based on gpio/devel branch.
> > So,
> >
> > Tested-by: Wei Xu <xuwei5@hisilicon.com>
>
> Awesome! Thanks a lot Wei!
> I'll get this to Torvalds tree ASAP.
Thanks, Linus, to fix this!
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply
* Re: [PATCH 1/6 v2] gpio: Add support for hierarchical IRQ domains
From: Linus Walleij @ 2019-08-23 10:13 UTC (permalink / raw)
To: Marc Zyngier
Cc: Brian Masney, open list:GPIO SUBSYSTEM, Bartosz Golaszewski,
Thomas Gleixner, Lina Iyer, Jon Hunter, Sowjanya Komatineni,
Bitan Biswas, linux-tegra, David Daney, Masahiro Yamada,
Thierry Reding
In-Reply-To: <63f2d086-eb71-4153-071e-71102fe24a14@arm.com>
On Fri, Aug 23, 2019 at 11:12 AM Marc Zyngier <marc.zyngier@arm.com> wrote:
> > We should be encouraged to operate on IRQ descriptors rather
> > than IRQ numbers when doing this kind of deep core work,
> > right?
>
> Certainly, I'd like to gradually move over from the IRQ number to an
> irq_desc. In interrupt-heavy contexts, this ends up being quite time
> consuming. I have an old patch series somewhere changing irq domains to
> use irq_descs internally instead of IRQ numbers, which I should maybe
> revive.
We currently interact most heavily with the irqchip by way of
mapping GPIO lines to the corresponding IRQs, so I suppose
the existing
int gpiod_to_irq(struct gpio_desc *desc);
Need a corresponding
struct irq_desc *gpiod_to_irq_desc(struct gpio_desc *desc);
at some point, and then we can start to de-pollute the kernel
from this for all drivers using the modern GPIO descriptor
API. It's a big task but can certainly be done with some
help.
On the driver back-end we are in surprisingly good shape
thanks to all the abstractions provided for dealing with IRQ
chip drivers.
Yours,
Linus Walleij
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox