From: Rob Herring <robh@kernel.org>
To: Rob Herring <robh@kernel.org>
Cc: Charles Keepax <ckeepax@opensource.cirrus.com>,
linux-kernel@vger.kernel.org, Peter Chen <peter.chen@nxp.com>,
Frank Rowand <frowand.list@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
devicetree@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
Tony Lindgren <tony@atomide.com>,
Peter Chen <peter.chen@kernel.org>
Subject: Re: [PATCH] of: Check 'of_node_reused' flag on of_match_device()
Date: Thu, 20 Jan 2022 11:31:25 -0600 [thread overview]
Message-ID: <YemcbdZnrFevcPZI@robh.at.kernel.org> (raw)
In-Reply-To: <20220118173404.1891800-1-robh@kernel.org>
On Tue, 18 Jan 2022 11:34:04 -0600, Rob Herring wrote:
> Commit 0f153a1b8193 ("usb: chipidea: Set the DT node on the child
> device") caused the child device to match on the parent driver
> instead of the child's driver since the child's DT node pointer matched.
> The worst case result is a loop of the parent driver probing another
> instance and creating yet another child device eventually exhausting the
> stack. If the child driver happens to match first, then everything works
> fine.
>
> A device sharing the DT node should never do DT based driver matching,
> so let's simply check of_node_reused in of_match_device() to prevent
> that.
>
> Fixes: 0f153a1b8193 ("usb: chipidea: Set the DT node on the child device")
> Link: https://lore.kernel.org/all/20220114105620.GK18506@ediswmail.ad.cirrus.com/
> Reported-by: Charles Keepax <ckeepax@opensource.cirrus.com>
> Cc: Frank Rowand <frowand.list@gmail.com>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Tony Lindgren <tony@atomide.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Peter Chen <peter.chen@nxp.com>
> Tested-by: Charles Keepax <ckeepax@opensource.cirrus.com>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
> drivers/of/device.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Applied, thanks!
prev parent reply other threads:[~2022-01-20 17:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-18 17:34 [PATCH] of: Check 'of_node_reused' flag on of_match_device() Rob Herring
2022-01-20 17:31 ` Rob Herring [this message]
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=YemcbdZnrFevcPZI@robh.at.kernel.org \
--to=robh@kernel.org \
--cc=arnd@arndb.de \
--cc=ckeepax@opensource.cirrus.com \
--cc=devicetree@vger.kernel.org \
--cc=frowand.list@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peter.chen@kernel.org \
--cc=peter.chen@nxp.com \
--cc=tony@atomide.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is 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).