From patchwork Wed Sep 5 14:24:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Porter X-Patchwork-Id: 1409641 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id C3B58DF28C for ; Wed, 5 Sep 2012 14:27:19 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T9GWF-0007rY-Gy; Wed, 05 Sep 2012 14:23:51 +0000 Received: from mail-iy0-f177.google.com ([209.85.210.177]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1T9GWB-0007qo-Cr for linux-arm-kernel@lists.infradead.org; Wed, 05 Sep 2012 14:23:48 +0000 Received: by iaai1 with SMTP id i1so861458iaa.36 for ; Wed, 05 Sep 2012 07:23:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=AUl+raKDl2pUVAWXS9yK36swulH6WJW4QYQSAur51kc=; b=Ada9eXhrW8ajCBWYUBQNE6pBq6Ew2PMBX/e7kP05VgSdD5uQU87hj2kOjUoaCaKG0q BaKvHLiM7fQxIMizojFvFPaSv00IB4BCg3XQBWldVpP2RIoOkhbxNX3NHo/JiJLwwedp 8HDdZutfCnZdPn/y0Aoq+EQqh6NBy85gF3YH0DF/6aifpyNs5JgsUiwjt7sifOA+rVMI iehsm4T3v/QL1CSQdcdD8ldBq7Gzm1zXHJMMXKd6aZ9i9jwqi/I4ToOuE7JySj3kkXZI If8FSSeuZsRaF9xSuEjYZ3I7rkrexkpzRS2bcJ6TgxUToOqba17KZBKjCje+CBTgifZu +zrA== Received: by 10.50.202.8 with SMTP id ke8mr18218200igc.6.1346855025592; Wed, 05 Sep 2012 07:23:45 -0700 (PDT) Received: from beef (cpe-24-166-64-7.neo.res.rr.com. [24.166.64.7]) by mx.google.com with ESMTPS id 10sm3370881igf.11.2012.09.05.07.23.42 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 05 Sep 2012 07:23:43 -0700 (PDT) Date: Wed, 5 Sep 2012 10:24:34 -0400 From: Matt Porter To: Koen Kooi Subject: Re: [PATCH v3 4/4] arm/dts: Add tps65217 regulator DT data to am335x-bone.dts Message-ID: <20120905142433.GG27758@beef> References: <1345547850-29761-1-git-send-email-anilkumar@ti.com> <1345547850-29761-5-git-send-email-anilkumar@ti.com> <331ABD5ECB02734CA317220B2BBEABC13EA1F1D7@DBDE01.ent.ti.com> <583C0877-1C4C-46B6-A5D0-BDD34D6BB7C8@dominion.thruhere.net> <331ABD5ECB02734CA317220B2BBEABC13EA1F3B0@DBDE01.ent.ti.com> <6C2AC14D-1CAC-4B93-910C-B7E52D3355FD@dominion.thruhere.net> <45D5714B-BB2C-49BB-8C5D-F69749EC324A@dominion.thruhere.net> <331ABD5ECB02734CA317220B2BBEABC13EA20AA6@DBDE01.ent.ti.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.210.177 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (ohiomdp[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: tony@atomide.com, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, "AnilKumar, Chimata" , "broonie@opensource.wolfsonmicro.com Brown" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org On Wed, Sep 05, 2012 at 03:29:30PM +0200, Koen Kooi wrote: > > Op 28 aug. 2012, om 07:34 heeft "AnilKumar, Chimata" 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 het volgende geschreven: > >> > >>> > >>> Op 24 aug. 2012, om 09:26 heeft "AnilKumar, Chimata" 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" 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 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 > >>>>>>> > >>>>>>> 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 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 Tested-by: Koen Kooi --- 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;