[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210630102049.4446b48f@coco.lan>
Date: Wed, 30 Jun 2021 10:20:49 +0200
From: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
To: Mark Brown <broonie@...nel.org>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linuxarm@...wei.com, mauro.chehab@...wei.com,
Axel Lin <axel.lin@...ics.com>,
Lee Jones <lee.jones@...aro.org>,
Arnd Bergmann <arnd@...db.de>,
Liam Girdwood <lgirdwood@...il.com>,
linux-kernel@...r.kernel.org, linux-staging@...ts.linux.dev
Subject: Re: [PATCH v10 2/5] regulator: hi6421v600-regulator: fix platform
drvdata
Em Tue, 29 Jun 2021 16:11:01 +0100
Mark Brown <broonie@...nel.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
Powered by blists - more mailing lists