From patchwork Mon May 20 17:46:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 2594501 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork2.kernel.org (Postfix) with ESMTP id 871B3DF2A2 for ; Mon, 20 May 2013 17:46:54 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UeUAd-0002zO-Bz; Mon, 20 May 2013 17:46:51 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UeUAa-0006Ny-H3; Mon, 20 May 2013 17:46:48 +0000 Received: from mho-02-ewr.mailhop.org ([204.13.248.72]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UeUAW-0006NK-T7 for linux-arm-kernel@lists.infradead.org; Mon, 20 May 2013 17:46:45 +0000 Received: from c-50-131-214-131.hsd1.ca.comcast.net ([50.131.214.131] helo=localhost.localdomain) by mho-02-ewr.mailhop.org with esmtpa (Exim 4.72) (envelope-from ) id 1UeUAC-000HoJ-05; Mon, 20 May 2013 17:46:24 +0000 Received: from Mutt by mutt-smtp-wrapper.pl 1.2 (www.zdo.com/articles/mutt-smtp-wrapper.shtml) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 50.131.214.131 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1+TrwHuTcfwKbheCwFkwNoC Date: Mon, 20 May 2013 10:46:21 -0700 From: Tony Lindgren To: Aaro Koskinen Subject: Re: [BISECTED] 3.10-rc1 OMAP1 GPIO IRQ regression Message-ID: <20130520174621.GI10378@atomide.com> References: <20130513205302.GA3157@blackmetal.musicnaut.iki.fi> <20130516180933.GG5600@atomide.com> <20130516210006.GA31836@blackmetal.musicnaut.iki.fi> <20130516214430.GN5600@atomide.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20130516214430.GN5600@atomide.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130520_134644_961638_0D73B3FD X-CRM114-Status: GOOD ( 24.55 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [204.13.248.72 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Cc: Grant Likely , linux-omap@vger.kernel.org, Jon Hunter , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org * Tony Lindgren [130516 14:50]: > * Aaro Koskinen [130516 14:05]: > > On Thu, May 16, 2013 at 11:09:34AM -0700, Tony Lindgren wrote: > > > * Aaro Koskinen [130513 13:58]: > > > > I tested 3.10-rc1 on OMAP1 / Nokia 770, and Retu MFD probe is broken: > > > > > > > > [ 2.264221] retu-mfd 2-0001: Retu v3.2 found > > > > [ 2.281951] retu-mfd 2-0001: Failed to allocate IRQs: -12 > > > > [ 2.300140] retu-mfd: probe of 2-0001 failed with error -12 > > > > > > > > The error is coming from regmap code. According to git bisect, it is > > > > caused by: > > > > > > > > commit ede4d7a5b9835510fd1f724367f68d2fa4128453 > > > > Author: Jon Hunter > > > > Date: Fri Mar 1 11:22:47 2013 -0600 > > > > > > > > gpio/omap: convert gpio irq domain to linear mapping > > > > > > > > The commit does not anymore revert cleanly, and I haven't yet tried > > > > crafting a manual revert, so any fix proposals/ideas are welcome... > > > > > > Hmm this might be a bit trickier to fix. Obviously the real solution > > > is to convert omap1 to SPARSE_IRQ like we did for omap2+. > > > > > > For the -rc cycle, it might be possible to fix this by adding a > > > different irq_to_gpio() and gpio_to_irq() functions for omap1. > > > > The commit reverts cleanly if we also revert > > 3513cdeccc647d41c4a9ff923af17deaaac04a66 (gpio/omap: optimise interrupt > > service routine), which seems to be just some minor optimization. The > > result is below, and with it 770 works again. > > Hmm in this case it seems that we should just fix it rather than go back > to the old code, so let's take a look at that first. Does the following fix it for you or do we need to fix something else there too? Regards, Tony Tested-by: Aaro Koskinen Signed-off-by: Tony Lindgren --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c @@ -1094,6 +1094,7 @@ static int omap_gpio_probe(struct platform_device *pdev) const struct omap_gpio_platform_data *pdata; struct resource *res; struct gpio_bank *bank; + int irq_base; match = of_match_device(of_match_ptr(omap_gpio_match), dev); @@ -1135,11 +1136,23 @@ static int omap_gpio_probe(struct platform_device *pdev) pdata->get_context_loss_count; } - - bank->domain = irq_domain_add_linear(node, bank->width, - &irq_domain_simple_ops, NULL); - if (!bank->domain) + /* + * REVISIT: Once we have omap1 supporting SPARSE_IRQ, we can drop + * irq_alloc_descs() and irq_domain_add_legacy() and just do: + * + * bank->domain = irq_domain_add_linear(node, bank->width, + * &irq_domain_simple_ops, NULL); + * if (!bank->domain) + * return -ENODEV; + */ + irq_base = irq_alloc_descs(-1, 0, bank->width, 0); + if (irq_base < 0) { + dev_err(dev, "Couldn't allocate IRQ numbers\n"); return -ENODEV; + } + + bank->domain = irq_domain_add_legacy(node, bank->width, irq_base, + 0, &irq_domain_simple_ops, NULL); if (bank->regs->set_dataout && bank->regs->clr_dataout) bank->set_dataout = _set_gpio_dataout_reg;