All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>,
	Lee Jones <lee.jones@linaro.org>
Cc: Mark Brown <broonie@linaro.org>,
	Samuel Ortiz <sameo@linux.intel.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Carlo Caione <carlo@caione.org>,
	Maxime Ripard <maxime.ripard@free-electrons.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-sunxi@googlegroups.com
Subject: Re: [PATCH 1/3] mfd-core: Don't register supplies from add_device, add register_supply_aliases()
Date: Mon, 19 May 2014 10:18:11 +0200	[thread overview]
Message-ID: <5379BE43.7090809@redhat.com> (raw)
In-Reply-To: <20140519074855.GP25203@opensource.wolfsonmicro.com>

Hi,

On 05/19/2014 09:48 AM, Charles Keepax wrote:
> On Mon, May 19, 2014 at 08:47:05AM +0100, Lee Jones wrote:
>>> We cannot register supply alias in mfd_add_device before calling
>>> platform_add_device, for 2 reasons:
>>> 1) devm resources may not be registered before the (platform) drivers probe
>>>    method runs
>>> 2) The platform-dev's name must be set before registering the aliases which
>>>    happens from platform_add_device.
>>>
>>> So stop registering supply aliases from mfd_add_device, and add a
>>> mfd_register_supply_aliases helper functions for the cell's plaform driver
>>> probe method to use.
>>>
>>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>>> ---
>>>  drivers/mfd/mfd-core.c   | 37 +++++++++++++++++++++----------------
>>>  include/linux/mfd/core.h |  6 +++++-
>>>  2 files changed, 26 insertions(+), 17 deletions(-)
>>
>> Change looks reasonable to me, but I'd like to have Mark look over the
>> changes.  If he's okay with them I think it's best for this set to go
>> through the MFD tree as a whole.
> 
> This should already be fixed by this patch:
> 
> mfd: core: Don't use devres functions before device is added

Ah, I did not check next, yes that would fix *half* of the problem,
the other half is that adding aliases uses dev->name (at least for
logging, did not check if it is used for anything else) and that is
not set yet before the device is added.

Basically the moral of the story is that it is a BAD idea to do
anything with a device before it is added. So my proposed series
would replace the "mfd: core: Don't use devres functions before device is added"
patch.

Regards,

Hans

  reply	other threads:[~2014-05-19  8:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-18 13:49 [PATCH 0/3] Fix WARN_ON caused by "mfd: Allow mapping regulator supplies to MFD device from children" Hans de Goede
2014-05-18 13:49 ` [PATCH 1/3] mfd-core: Don't register supplies from add_device, add register_supply_aliases() Hans de Goede
2014-05-19  7:47   ` Lee Jones
2014-05-19  7:48     ` Lee Jones
2014-05-19  7:48     ` Charles Keepax
2014-05-19  8:18       ` Hans de Goede [this message]
2014-05-19  8:28         ` Charles Keepax
2014-05-19  9:11           ` Lee Jones
2014-05-18 13:49 ` [PATCH 2/3] regulator/axp20x: Call mfd_register_supply_aliases Hans de Goede
2014-05-18 13:49 ` [PATCH 3/3] arizona-mfd-codecs: Add mfd_register_supply_aliases() calls Hans de Goede
2014-05-19  8:29   ` Charles Keepax

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=5379BE43.7090809@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=broonie@linaro.org \
    --cc=carlo@caione.org \
    --cc=ckeepax@opensource.wolfsonmicro.com \
    --cc=lee.jones@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sunxi@googlegroups.com \
    --cc=maxime.ripard@free-electrons.com \
    --cc=sameo@linux.intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.