From: Matt Porter <mporter@ti.com>
To: "AnilKumar, Chimata" <anilkumar@ti.com>
Cc: Koen Kooi <koen@dominion.thruhere.net>,
"tony@atomide.com" <tony@atomide.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
"broonie@opensource.wolfsonmicro.com Brown"
<broonie@opensource.wolfsonmicro.com>
Subject: Re: [PATCH v3 4/4] arm/dts: Add tps65217 regulator DT data to am335x-bone.dts
Date: Mon, 10 Sep 2012 12:26:08 -0400 [thread overview]
Message-ID: <20120910162608.GI27758@beef> (raw)
In-Reply-To: <331ABD5ECB02734CA317220B2BBEABC13EA2A13B@DBDE01.ent.ti.com>
On Sat, Sep 08, 2012 at 06:38:21AM +0000, AnilKumar, Chimata wrote:
> On Wed, Sep 05, 2012 at 19:59:54, Koen Kooi wrote:
> >
> > Op 5 sep. 2012, om 16:24 heeft Matt Porter <mporter@ti.com> het volgende geschreven:
> >
> > > On Wed, Sep 05, 2012 at 03:29:30PM +0200, Koen Kooi wrote:
> > >>
> > >> Op 28 aug. 2012, om 07:34 heeft "AnilKumar, Chimata" <anilkumar@ti.com> het volgende geschreven:
> > >>
> > >>> Hi Koen,
> > >>>
> > >>> On Fri, Aug 24, 2012 at 13:32:17, Koen Kooi wrote:
> > >>>>
> > >>>> Op 24 aug. 2012, om 09:56 heeft Koen Kooi <koen@dominion.thruhere.net> het volgende geschreven:
> > >>>>
> > >>>>>
> > >>>>> Op 24 aug. 2012, om 09:26 heeft "AnilKumar, Chimata" <anilkumar@ti.com> het volgende geschreven:
> > >>>>>
> > >>>>>> Hi Koen,
> > >>>>>>
> > >>>>>> On Fri, Aug 24, 2012 at 11:58:34, Koen Kooi wrote:
> > >>>>>>>
> > >>>>>>> Op 24 aug. 2012, om 07:50 heeft "AnilKumar, Chimata" <anilkumar@ti.com> het volgende geschreven:
> > >>>>>>>
> > >>>>>>>> Hi Koen,
> > >>>>>>>>
> > >>>>>>>> On Thu, Aug 23, 2012 at 19:43:48, Koen Kooi wrote:
> > >>>>>>>>>
> > >>>>>>>>> Op 21 aug. 2012, om 13:17 heeft AnilKumar Ch <anilkumar@ti.com> het volgende geschreven:
> > >>>>>>>>>
> > >>>>>>>>>> Add tps65217 regulator device tree data to AM335x-Bone by adding
> > >>>>>>>>>> regulator consumers with tightened constraints and regulator-name.
> > >>>>>>>>>> TPS65217 regulator handle can be obtained by using this regulator
> > >>>>>>>>>> name.
> > >>>>>>>>>>
> > >>>>>>>>>> This patch also add I2C node with I2C frequency and tps65217 PMIC
> > >>>>>>>>>> I2C slave address.
> > >>>>>>>>>>
> > >>>>>>>>>> Signed-off-by: AnilKumar Ch <anilkumar@ti.com>
> > >>>>>>>>>
> > >>>>>>>>> I tried this and the kernel immediately crashes on my beaglebone. Could you upload the complete git tree and .config you used to test this to somewhere public please?
> > >>>>>>>>
> > >>>>>>>> Use this repo to test on beaglebone
> > >>>>>>>> https://github.com/hvaibhav/am335x-linux/commits/am335x-upstream-staging-pinctrl
> > >>>>>>>>
> > >>>>>>>> This wiki talks about how to build and use?
> > >>>>>>>> https://github.com/hvaibhav/am335x-linux/wiki/How-To-Use-Upstream-Tree
> > >>>>>>>>
> > >>>>>>>> Note: Enable tps65217 regulator in kernel config.
> > >>>>>>>
> > >>>>>>> I used that repo and as a seperate test I rebased that to latest mainline, same thing: as soon as I turn on the TPS in the .config it crashes on boot. Is the pinctrl repo the *exact* repo you used to test the patches on beaglebone?
> > >>>>>>
> > >>>>>> I tested on latest mainline after merging to
> > >>>>>> am335x-upstream-staging-pinctrl (voltage also changing)
> > >>>>>>
> > >>>>>> Can you share your .config and uImage?
> > >>>>>
> > >>>>> Config: https://github.com/beagleboard/kernel/blob/beaglebone-3.6/patches/configs/beaglebone
> > >>>>>
> > >>>>>> My config details:- (After merge)
> > >>>>>> 1. omap2plus_defconfig
> > >>>>>> 2. Enable tps65217 MFD driver
> > >>>>>> 3. Enable tps65217 regulator driver
> > >>>>>
> > >>>>>
> > >>>>> I rebased onto latest mainline and refreshed the base patches from Vaibhav and I now get:
> > >>>>>
> > >>>>> [ 0.246796] tps65217 0-0024: TPS65217 ID 0xf version 1.1
> > >>>>>
> > >>>>> So it boots! I don't know what made it break before, but it's working now :)
> > >>>>
> > >>>> *sigh* I'm an idiot:
> > >>>>
> > >>>> root@beaglebone:~# uname -a
> > >>>> Linux beaglebone 3.6.0-rc3-00103-gfd02083 #86 SMP Fri Aug 24 09:45:54 CEST 2012 armv7l GNU/Linux
> > >>>> root@beaglebone:~# zcat /proc/config.gz | grep 217
> > >>>> CONFIG_MFD_TPS65217=y
> > >>>> # CONFIG_REGULATOR_TPS65217 is not set
> > >>>>
> > >>>> Will retry with regulator driver actually turned on in a bit.
> > >>>
> > >>> Is it working after enabling the regulator?
> > >>
> > >> It took me a while to get back to this problem, but it still isn't working for me. I did manage to get more info on the error:
> > >>
> > >> root@bone-mainline:~# insmod tps65217-regulator.ko
> > >> [ 32.754419] Unable to handle kernel NULL pointer dereference at virtual address 000000c8
> > >> [ 32.763087] pgd = cea60000
> > >> [ 32.765969] [000000c8] *pgd=8fbed831, *pte=00000000, *ppte=00000000
> > >> [ 32.772617] Internal error: Oops: 17 [#1] SMP THUMB2
> > >> [ 32.777827] Modules linked in: tps65217_regulator(+) ip_tables x_tables snd_soc_omap snd_soc_core regmap_spi snd_pcm snd_timer snd soundcore snd_page_alloc ipv6
> > >> [ 32.792976] CPU: 0 Not tainted (3.6.0-rc4 #109)
> > >> [ 32.798106] PC is at regmap_read+0x8/0x38
> > >> [ 32.802315] LR is at regulator_get_voltage_sel_regmap+0x15/0x38
> > >
> > > I just got to this same point last night as I needed this working to
> > > test omap_hsmmc with edma dmaengine...
> > >
> > > The problem is that the tps65217-regulator driver is handing the wrong
> > > device to regulator_register() and it contains a null regmap. This patch
> > > passes in the the parent dev to fix it. Maybe I missed another patch
> > > that addresses this in a different way, such as the regulator devices
> > > being stuffed with the regmap devres?
> > >
> > > -Matt
> > >
> > > From 40d118bebc5eaf2a8df4f8b5e113b892a3210f96 Mon Sep 17 00:00:00 2001
> > > From: Matt Porter <mporter@ti.com>
> > > Date: Wed, 5 Sep 2012 10:09:50 -0400
> > > Subject: [PATCH] regulator: tps65217: fix crash during registration
> > >
> > > The struct device for each platform device bound to this
> > > driver is a child to the parent mfd device. The parent device
> > > is the one that actually contains the regmap devres so fix the
> > > null pointer dereference during the first regmap access in
> > > registration by passing in the parent device.
> > >
> > > Signed-off-by: Matt Porter <mporter@ti.com>
> > > ---
> > > drivers/regulator/tps65217-regulator.c | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/regulator/tps65217-regulator.c b/drivers/regulator/tps65217-regulator.c
> > > index 6caa222..af4916c 100644
> > > --- a/drivers/regulator/tps65217-regulator.c
> > > +++ b/drivers/regulator/tps65217-regulator.c
> > > @@ -292,7 +292,7 @@ static int __devinit tps65217_regulator_probe(struct platform_device *pdev)
> > > tps = dev_to_tps65217(pdev->dev.parent);
> > > tps->info[pdev->id] = info;
> > >
> > > - config.dev = &pdev->dev;
> > > + config.dev = pdev->dev.parent;
> > > config.of_node = pdev->dev.of_node;
> > > config.init_data = pdev->dev.platform_data;
> > > config.driver_data = tps;
> > > --
> > > 1.7.9.5
> >
> > That patch fixes it for me:
>
> This patch is not required, added a new feature to core.c file to address
> this. https://lkml.org/lkml/2012/9/7/390
Looks good, thanks for addressing it in the core.
-Matt
next prev parent reply other threads:[~2012-09-10 16:25 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-21 11:17 [PATCH v3 0/4] Add AM33XX regulators device tree data AnilKumar Ch
2012-08-21 11:17 ` [PATCH v3 1/4] arm/dts: regulator: Add tps65910 " AnilKumar Ch
2012-08-21 15:48 ` Stephen Warren
2012-08-21 16:38 ` Mark Brown
2012-08-21 18:05 ` Stephen Warren
2012-08-21 18:08 ` Mark Brown
2012-08-24 20:16 ` Tony Lindgren
2012-08-27 16:51 ` Mark Brown
2012-08-21 11:17 ` [PATCH v3 2/4] arm/dts: regulator: Add tps65217 " AnilKumar Ch
2012-08-21 11:17 ` [PATCH v3 3/4] arm/dts: Add tps65910 regulator DT data to am335x-evm.dts AnilKumar Ch
2012-08-21 11:17 ` [PATCH v3 4/4] arm/dts: Add tps65217 regulator DT data to am335x-bone.dts AnilKumar Ch
2012-08-23 14:13 ` Koen Kooi
2012-08-24 5:50 ` AnilKumar, Chimata
2012-08-24 6:28 ` Koen Kooi
2012-08-24 7:26 ` AnilKumar, Chimata
2012-08-24 7:56 ` Koen Kooi
2012-08-24 8:02 ` Koen Kooi
2012-08-28 5:34 ` AnilKumar, Chimata
2012-09-05 13:29 ` Koen Kooi
2012-09-05 14:24 ` Matt Porter
2012-09-05 14:29 ` Koen Kooi
2012-09-08 6:38 ` AnilKumar, Chimata
2012-09-10 16:26 ` Matt Porter [this message]
2012-08-21 13:57 ` [PATCH v3 0/4] Add AM33XX regulators device tree data Mark Brown
2012-08-30 21:01 ` Tony Lindgren
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=20120910162608.GI27758@beef \
--to=mporter@ti.com \
--cc=anilkumar@ti.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=koen@dominion.thruhere.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--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).