Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753713Ab3DWLOx (ORCPT ); Tue, 23 Apr 2013 07:14:53 -0400 Received: from mail-ia0-f174.google.com ([209.85.210.174]:59154 "EHLO mail-ia0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751204Ab3DWLOw (ORCPT ); Tue, 23 Apr 2013 07:14:52 -0400 MIME-Version: 1.0 In-Reply-To: <516BF4DA.6000204@gaisler.com> References: <1363355140-28216-1-git-send-email-andreas@gaisler.com> <1363355140-28216-4-git-send-email-andreas@gaisler.com> <516BF4DA.6000204@gaisler.com> Date: Tue, 23 Apr 2013 13:14:51 +0200 Message-ID: Subject: Re: [PATCH v5 3/3] gpio: grgpio: Add irq support From: Linus Walleij To: Andreas Larson Cc: Grant Likely , Rob Herring , Anton Vorontsov , "linux-kernel@vger.kernel.org" , "devicetree-discuss@lists.ozlabs.org" , software@gaisler.com Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1637 Lines: 39 On Mon, Apr 15, 2013 at 2:38 PM, Andreas Larson wrote: > On 2013-04-10 21:25, Linus Walleij wrote: >>> +int grgpio_irq_map(struct irq_domain *d, unsigned int virq, (...) >>> + /* Request underlying irq if not already requested */ >>> + lirq->virq = virq; >>> + uirq = &priv->uirqs[lirq->index]; >>> + if (uirq->refcnt == 0) { >>> + ret = request_irq(uirq->uirq, grgpio_irq_handler, 0, >>> + dev_name(priv->dev), priv); >> >> >> No, please request all present uirqs in probe() before creating the >> irqdomain. > > > The reason for doing it at irq_map and not in probe is that one > typical hardware setup for this core is that it has irqs that are shared > with pretty much all other cores in the system. Therefore, if this > drivers requests all its irqs in the probe function, pretty much all the > drivers for the other cores in the system that were not lucky enough to > request their irq before this driver will fail their probes in such a > hardware setup. This driver can not share irq:s so even if the other > drivers can handle shared irqs they are out of luck if this driver is > probed first. > > That is why only the irqs that are actually used should be requested and > thus why the driver does it on demand instead of in the probe. OK I buy that explanation... Thanks, Linus Walleij -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/