From mboxrd@z Thu Jan 1 00:00:00 1970 From: jon-hunter@ti.com (Jon Hunter) Date: Wed, 17 Apr 2013 08:25:05 -0500 Subject: [PATCH 3/5] gpio/omap: Add DT support to GPIO driver In-Reply-To: References: <1329321854-24490-1-git-send-email-b-cousson@ti.com> <5155C902.7080207@wwwdotorg.org> <5165CB9D.1090202@wwwdotorg.org> <51671D7B.5060303@wwwdotorg.org> <51673D70.3010503@wwwdotorg.org> <516C31C3.9040505@wwwdotorg.org> <516C7C43.3040105@wwwdotorg.org> <516C8760.2050500@ti.com> <516D9B05.1000501@wwwdotorg.org> <516DA60A.5070000@ti.com> <516DCCA8.3070108@wwwdotorg.org> <516DDB4D.9020500@ti.com> <516E022F.5050708@ti.com> Message-ID: <516EA2B1.3070201@ti.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 04/17/2013 02:55 AM, Javier Martinez Canillas wrote: ... > There are so many patches flying around in this thread that I missed it :-) > > Sorry about that... No problem. >> I was trying to see if we could find a common solution that everyone >> could use as it seems that ideally we should all be requesting the gpio. >> >> Cheers >> Jon >> >> [1] http://marc.info/?l=linux-arm-kernel&m=136606204823845&w=1 > > btw, I shared the latest patch with only build testing it, but today I > gave a try and I found a problem with this approach. The .xlate > function is being called twice for each GPIO-IRQ so the first time > gpio_request_one() succeeds but the second time it fails returning > -EBUSY. I tried it and I did not see that. I don't see the below warning either. > This raises a warning on drivers/of/platform.c > (WARN_ON(of_irq_to_resource_table(np, res, num_irq) != num_irq)): > > 0.285308] ------------[ cut here ]------------ > [ 0.285369] WARNING: at drivers/of/platform.c:171 > of_device_alloc+0x154/0x168() > [ 0.285430] Modules linked in: > [ 0.285491] [] (unwind_backtrace+0x0/0xf0) from > [] (warn_slowpath_common+0x4c/0x68) > [ 0.285552] [] (warn_slowpath_common+0x4c/0x68) from > [] (warn_slowpath_null+0x1c/0x24) > [ 0.285614] [] (warn_slowpath_null+0x1c/0x24) from > [] (of_device_alloc+0x154/0x168) > [ 0.285675] [] (of_device_alloc+0x154/0x168) from > [] (of_platform_device_create_pdata+0x34/0x80) > [ 0.285736] [] > (of_platform_device_create_pdata+0x34/0x80) from [] > (gpmc_probe_generic_child+0x180/0x240) > [ 0.285827] [] (gpmc_probe_generic_child+0x180/0x240) > from [] (gpmc_probe+0x4b4/0x614) > [ 0.285888] [] (gpmc_probe+0x4b4/0x614) from [] > (platform_drv_probe+0x18/0x1c) > [ 0.285949] [] (platform_drv_probe+0x18/0x1c) from > [] (driver_probe_device+0x108/0x21c) Any chance you have still have some additional code in your dts to request the gpio? I recall you made some hacks to make this work before. > I probably won't have time to dig further on this until later this > week but I wanted to share with you in case you know why is being > calling twice and if you thought about a solution. Care to post your dts file? > It works if I don't check the return gpio_request_one() (or better if > we don't return on omap_gpio_irq_domain_xlate) but of course is not > the right solution. Yes we need to check the return value. Cheers Jon