From: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Grant Likely
<grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Leif Lindholm
<leif.lindholm-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Greg Kroah-Hartman
<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>
Cc: stable <stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [REGRESSION stable] "of: fix handling of '/' in options for of_find_node_by_path()" breaks stdout-path
Date: Mon, 16 Mar 2015 16:53:22 +0100 [thread overview]
Message-ID: <5506FC72.80800@redhat.com> (raw)
Hi All,
While updating my local working tree to 4.0-rc4 this morning I noticed that I no longer
got any console (neither video output not serial console) on an Allwinner A20 ARM
board.
This is caused by:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/drivers/of?id=106937e8ccdcf0f4b95fbf0fe9abd42766cade33
Reverting this commit fixes the serial console being gone for me.
After this there still is an issue that tty0 no longer is seen as console, where it
used to be properly used as console in 3.19, I'll investigate that further and send
a separate mail about this.
Greg, this commit has a: "Cc: <stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> # 3.19" please do not apply
this commit to stable!
u-boot sets stdout-path to this value on the board in question:
"/soc@01c00000/serial@01c28000:115200"
Looking at the first hunk of the patch in question, the problem is obvious:
@@ -714,16 +714,17 @@ static struct device_node *__of_find_node_by_path(struct device_node *parent,
const char *path)
{
struct device_node *child;
- int len = strchrnul(path, '/') - path;
- int term;
+ int len;
+ const char *end;
+ end = strchr(path, ':');
+ if (!end)
+ end = strchrnul(path, '/');
+
+ len = end - path;
if (!len)
return NULL;
- term = strchrnul(path, ':') - path;
- if (term < len)
- len = term;
-
__for_each_child_of_node(parent, child) {
const char *name = strrchr(child->full_name, '/');
if (WARN(!name, "malformed device_node %s\n", child->full_name))
The new code to determine len will match (when starting at root) the name of
all child nodes against: "soc@01c00000/serial@01c28000" as it checks for
the ":" first and then uses everything before it. Where as the old code
would match against: "soc@01c00000" which is the correct thing to do.
The best fix I can come up with is to check for both ":" and "/" and use
the earlier one as end to calculate the length. I've not coded this out /
tested this due to -ENOTIME. Note that I've also not audited the rest of
the patch for similar issues.
I will happily test any patches to fix this.
Regards,
Hans
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next reply other threads:[~2015-03-16 15:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-16 15:53 Hans de Goede [this message]
[not found] ` <5506FC72.80800-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-03-16 18:19 ` [REGRESSION stable] "of: fix handling of '/' in options for of_find_node_by_path()" breaks stdout-path Leif Lindholm
[not found] ` <20150316181957.GJ4278-t77nlHhSwNqAroYi2ySoxKxOck334EZe@public.gmane.org>
2015-03-17 13:58 ` Hans de Goede
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5506FC72.80800@redhat.com \
--to=hdegoede-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
--cc=leif.lindholm-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).