linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Mark Brown <broonie@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linuxarm@huawei.com, mauro.chehab@huawei.com,
	Axel Lin <axel.lin@ingics.com>, Lee Jones <lee.jones@linaro.org>,
	Arnd Bergmann <arnd@arndb.de>,
	Liam Girdwood <lgirdwood@gmail.com>,
	linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev
Subject: Re: [PATCH v10 2/5] regulator: hi6421v600-regulator: fix platform drvdata
Date: Wed, 30 Jun 2021 10:20:49 +0200	[thread overview]
Message-ID: <20210630102049.4446b48f@coco.lan> (raw)
In-Reply-To: <20210629151101.GB4613@sirena.org.uk>

Em Tue, 29 Jun 2021 16:11:01 +0100
Mark Brown <broonie@kernel.org> escreveu:

> On Tue, Jun 29, 2021 at 12:31:28PM +0200, Mauro Carvalho Chehab wrote:
> 
> > platform drvdata can't be used inside the regulator driver,
> > as this is already used by the MFD and SPMI drivers.  
> 
> Can you clarify what exactly is using which platform drvdata already?
> This all feels very confused and I can't tell what the problem that's
> being fixed is, if it's a real issue or how this fixes it.

It turns that the problem was not related to any bad usage of
platform data by MFD/SPMI drivers. There used to have a need to access
the SPMI privdata before we added support for regmap, but this is
long gone.

The problem is just that the Axel's patch was setting the platform
drvdata, but the internal logic was addressing a different memory
region (from the SPMI driver), because hi6421v600-regulator driver sets
the config.dev as:

	config.dev = pdev->dev.parent;

The config.dev needs to point to the SPMI driver, in order to ensure that 
regulator_register() will access the proper OF data from the SPMI
devicetree descriptors here:

	init_data = regulator_of_get_init_data(dev, regulator_desc, config,
					       &rdev->dev.of_node);

With the Axel's fixup patch:

	https://lore.kernel.org/lkml/20210630100911.5e866629@coco.lan/T/#t

the regression was solved.

Thanks,
Mauro

  parent reply	other threads:[~2021-06-30  8:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-29 10:31 [PATCH v10 0/5] Move Hisilicon 6421v600 SPMI and USB drivers out of staging Mauro Carvalho Chehab
2021-06-29 10:31 ` [PATCH v10 1/5] staging: hikey9xx: split hi6421v600 irq into a separate driver Mauro Carvalho Chehab
2021-06-29 10:31 ` [PATCH v10 2/5] regulator: hi6421v600-regulator: fix platform drvdata Mauro Carvalho Chehab
     [not found]   ` <CAFRkauCzHqUfva+zTRhOyiMMb4WsKPHvYJuqpOPwy+siPMZGOQ@mail.gmail.com>
2021-06-29 11:09     ` Mauro Carvalho Chehab
     [not found]       ` <CAFRkauCPKQyD_Dooqrxvra94RyLXrPDeCSSdfBfvh-o0Zh8q3g@mail.gmail.com>
2021-06-29 13:32         ` Mauro Carvalho Chehab
2021-06-29 15:11   ` Mark Brown
2021-06-29 19:31     ` Mauro Carvalho Chehab
2021-06-30  8:20     ` Mauro Carvalho Chehab [this message]
2021-06-29 10:31 ` [PATCH v10 3/5] mfd: hi6421-spmi-pmic: move driver from staging Mauro Carvalho Chehab
2021-07-01 14:02   ` Rob Herring
2021-06-29 10:43 ` [PATCH v10 0/5] Move Hisilicon 6421v600 SPMI and USB drivers out of staging Greg Kroah-Hartman
2021-06-30  8:28   ` Mauro Carvalho Chehab

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=20210630102049.4446b48f@coco.lan \
    --to=mchehab+huawei@kernel.org \
    --cc=arnd@arndb.de \
    --cc=axel.lin@ingics.com \
    --cc=broonie@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=lee.jones@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=linuxarm@huawei.com \
    --cc=mauro.chehab@huawei.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).