public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee@kernel.org>
To: "Michał Oleszczyk" <oleszczyk.m@gmail.com>
Cc: linux-kernel@vger.kernel.org,
	"Michał Oleszczyk" <m.oleszczyk@grinn-global.com>
Subject: Re: [PATCH v2] mfd: core: Delete corresponding OF node entries from list on  MFD removal
Date: Wed, 10 Aug 2022 12:28:29 +0100	[thread overview]
Message-ID: <YvOWXTzT7uIhVMBI@google.com> (raw)
In-Reply-To: <20220809060336.31892-1-m.oleszczyk@grinn-global.com>

On Tue, 09 Aug 2022, Michał Oleszczyk wrote:

> From: Michal Oleszczyk <oleszczyk.m@gmail.com>
> 
> When we consider MFD which implements hotplug (e.g. USB hotplug
> driver based on product and vendor IDs) functionality it turns out
> that its sub-devices are correctly matched with corresponding device
> tree nodes only at the first time. When physical device reboots
> or is replugged (and MFD driver is disconnected and probed back
> again) all sub-devices fails in mfd_add_device() with error
> 'Failed to locate of_node'.
> 
> The reason of that behavior is that when any MFD sub-device is
> created for the first time (and matched with device tree node) it
> is added to the mfd_of_node_list. It looks like this list is never
> cleaned even if devices added there are intentionally removed from
> the system. So when MFD device is replugged and all sub-devices
> are matched with their device tree nodes again they fail as matched
> nodes already exist in mfd_of_node_list. In other words current
> implementation does not support MFD with hotplug feature.
> 
> This commit extends MFD core for hotplugging support by removing
> appropriate OF node entry from mfd_of_node_list when corresponding
> device is removed from the system. Thanks to that when device is
> added once again it can be matched with its device tree node
> successfully.
> 
> Signed-off-by: Michal Oleszczyk <oleszczyk.m@gmail.com>
> ---
> 
> Changes in v2: removing unused variable declaration.
> 
>  drivers/mfd/mfd-core.c | 7 +++++++
>  1 file changed, 7 insertions(+)

Applied, thanks.

-- 
Lee Jones [李琼斯]

      reply	other threads:[~2022-08-10 11:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-09  6:03 [PATCH v2] mfd: core: Delete corresponding OF node entries from list on MFD removal Michał Oleszczyk
2022-08-10 11:28 ` Lee Jones [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=YvOWXTzT7uIhVMBI@google.com \
    --to=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.oleszczyk@grinn-global.com \
    --cc=oleszczyk.m@gmail.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