Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932547Ab2HHIaO (ORCPT ); Wed, 8 Aug 2012 04:30:14 -0400 Received: from mailrelay1.diasemi.com ([82.210.246.133]:58530 "EHLO mailrelay1.diasemi.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757854Ab2HHIaL convert rfc822-to-8bit (ORCPT ); Wed, 8 Aug 2012 04:30:11 -0400 From: "Opensource [Anthony Olech]" To: Mark Brown , "Opensource [Anthony Olech]" CC: LKML , David Dajun Chen Subject: RE: [PATCH] regmap-irq: allow auto-allocated IRQs to be mapped Thread-Topic: [PATCH] regmap-irq: allow auto-allocated IRQs to be mapped Thread-Index: AQHNckG72kyxY08IiEqTgpBfEDN7qZdONpdAgAAe5ICAABLO8IAAHywAgAEQD0A= Date: Wed, 8 Aug 2012 08:30:07 +0000 Message-ID: <24DF37198A1E704D9811D8F72B87EB51032C3DBB@NB-EX-MBX02.diasemi.com> References: <201208020805.q72858Yj003147@latitude.olech.com> <20120804105424.GB10523@opensource.wolfsonmicro.com> <24DF37198A1E704D9811D8F72B87EB51032C3B7E@NB-EX-MBX02.diasemi.com> <20120807140311.GH16861@opensource.wolfsonmicro.com> <24DF37198A1E704D9811D8F72B87EB51032C3C2A@NB-EX-MBX02.diasemi.com> <20120807170204.GU16861@opensource.wolfsonmicro.com> In-Reply-To: <20120807170204.GU16861@opensource.wolfsonmicro.com> Accept-Language: en-GB, de-DE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.20.21.86] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3090 Lines: 53 > -----Original Message----- > From: Mark Brown [mailto:broonie@opensource.wolfsonmicro.com] > Sent: 07 August 2012 18:02 > To: Opensource [Anthony Olech] > Cc: LKML; David Dajun Chen > Subject: Re: [PATCH] regmap-irq: allow auto-allocated IRQs to be mapped > On Tue, Aug 07, 2012 at 02:37:37PM +0000, Opensource [Anthony Olech] > wrote: > > > The bottom line here is that if your driver requires a dynamically > > > allocated legacy domain it is broken. > > I am trying to use the latest REGMAP API, and I do not understand why > > you say the DSA9058 driver "requires" a dynamically allocated legacy > domain. > If you care if you got a linear or a legacy domain then that shows you're reyling > on having a legacy domain (indeed, my statement above should've been > stronger - if anything in the driver itself cares if it's got a linear or a legacy > domain the driver is buggy). > > Surely the virtual IRQs that the PMIC component drivers use must be > > dynamically allocated. It is only the single GPIO line designated as > > an interrupt line in the machne drivert that is fixed by the hardware. > > That surely means the "irq_base" parameter to regmap_add_irq_chip() > > must be set to "-1". What else could it be set to?? > If the driver doesn't have any inputs which could be used as an interrupt by > another device then it should be set to -1, yes, and nothing in the code should > ever care how the specific virq values are related to each other. > If the driver does support another device using it as an interrupt controller then > unfortunately for non-DT systems platform data would need to configure an > irq_base so that the interrupt can be supplied to whatever the other device is > but in all other circumstances it should be set to -1. > > I am beginning to suspect that I have misunderstood something. The > > regmap-irq API seemed taylor-made for our PMIC with one real h/w > > interrupt line with several PMIC chip irq sources controlled by a set > > of registers that seemed to slot into the "regmap_add_irq_chip" struct > > perfectly. Why should that set of virtual irqs be given a specific base?? > It shouldn't, this is what I'm saying. The IRQs shouldn't have a base at all and > should instead be using a linear domain (which doesn't have a base but instead > maps each IRQ on demand). What your patch does is to stop that happening > and instead always allocate a legacy domain even when linear is OK. > It sounds like your code to allocate the IRQs is fine but the code using the IRQs > is buggy as it's relying on the linear domain. Thanks Mark, now we are getting somewhere - it must be my use of the IRQ domain IRQs is wrong. There are exactly 3 mfd drivers that specify a base of '-1', namely: palmas.c, 88pm805.c, arizona-irq.c so I will examine how they use the IRQs thanks for your help Tony Olech -- 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/