From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lee Jones Subject: Re: [PATCH v3 11/15] mfd: menelaus: Start to use irqdomain Date: Tue, 10 Dec 2013 09:20:50 +0000 Message-ID: <20131210092050.GT12675@lee--X1> References: <20131209161422.GC24047@saruman.home> <1386606085-26838-1-git-send-email-balbi@ti.com> <1386606085-26838-11-git-send-email-balbi@ti.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Return-path: Content-Disposition: inline In-Reply-To: <1386606085-26838-11-git-send-email-balbi@ti.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Felipe Balbi Cc: Tony Lindgren , Linux OMAP Mailing List , Linux Kernel Mailing List , Linux ARM Kernel Mailing List , Aaro Koskinen List-Id: linux-omap@vger.kernel.org PiBJbnRyb2R1Y2UgYW4gaXJxX2NoaXAgYW5kIGlycV9kb21haW4gZm9yIG1lbmVsYXVzIGRyaXZl ci4gRm9sbG93aW5nCj4gcGF0Y2hlcyB3aWxsIGNvbnZlcnQgdXNlcyB0byB0cmFkaXRpb25hbCBy ZXF1ZXN0X3RocmVhZGVkX2lycSgpLgo+IAo+IFdoaWxlIGF0IHRoYXQsIHNvbWUgYmV0dGVyIGVy cm9yIGhhbmRsaW5nIGhhZCB0byBiZSBhZGRlZCwgc28gd2UgY291bGQKPiBmcmVlIGlycSBkZXNj cyB3ZSBhbGxvY2F0ZWQuCj4gCj4gVGVzdGVkLWJ5OiBBYXJvIEtvc2tpbmVuIDxhYXJvLmtvc2tp bmVuQGlraS5maT4KPiBTaWduZWQtb2ZmLWJ5OiBGZWxpcGUgQmFsYmkgPGJhbGJpQHRpLmNvbT4K PiAtLS0KPiAgZHJpdmVycy9tZmQvbWVuZWxhdXMuYyB8IDEyNyArKysrKysrKysrKysrKysrKysr KysrKysrKysrKysrKysrKysrKysrKysrKysr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mcgaW4gdGhpcyBwYXRjaC4KCkl0IHNob3VsZCBoYXZlIGJlZW4g cmVtb3ZlZCB3aXRoIHRoZSBmaW5hbCB1c2Ugb2YgdGhlIGxvY2sgd2FzLgoKPHNuaXA+CgotLSAK TGVlIEpvbmVzCkxpbmFybyBTVE1pY3JvZWxlY3Ryb25pY3MgTGFuZGluZyBUZWFtIExlYWQKTGlu YXJvLm9yZyDilIIgT3BlbiBzb3VyY2Ugc29mdHdhcmUgZm9yIEFSTSBTb0NzCkZvbGxvdyBMaW5h cm86IEZhY2Vib29rIHwgVHdpdHRlciB8IEJsb2cKCl9fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fCmxpbnV4LWFybS1rZXJuZWwgbWFpbGluZyBsaXN0CmxpbnV4 LWFybS1rZXJuZWxAbGlzdHMuaW5mcmFkZWFkLm9yZwpodHRwOi8vbGlzdHMuaW5mcmFkZWFkLm9y Zy9tYWlsbWFuL2xpc3RpbmZvL2xpbnV4LWFybS1rZXJuZWwK From mboxrd@z Thu Jan 1 00:00:00 1970 From: lee.jones@linaro.org (Lee Jones) Date: Tue, 10 Dec 2013 09:20:50 +0000 Subject: [PATCH v3 11/15] mfd: menelaus: Start to use irqdomain In-Reply-To: <1386606085-26838-11-git-send-email-balbi@ti.com> References: <20131209161422.GC24047@saruman.home> <1386606085-26838-1-git-send-email-balbi@ti.com> <1386606085-26838-11-git-send-email-balbi@ti.com> Message-ID: <20131210092050.GT12675@lee--X1> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org > Introduce an irq_chip and irq_domain for menelaus driver. Following > patches will convert uses to traditional request_threaded_irq(). > > While at that, some better error handling had to be added, so we could > free irq descs we allocated. > > Tested-by: Aaro Koskinen > Signed-off-by: Felipe Balbi > --- > drivers/mfd/menelaus.c | 127 ++++++++++++++++++++++++++++++++++++++++++++++--- > + irq_domain_add_legacy(node, MENELAUS_NR_IRQS, irq_base, 0, > + &irq_domain_simple_ops, m); When will this driver become DT compliant? I think you should use irq_domain_add_simple() to future proof yourself a little. > + m->irq_base = irq_base; > + > + for (i = irq_base; i < irq_base + MENELAUS_NR_IRQS; i++) { > + irq_set_chip_data(i, m); > + irq_set_chip_and_handler(i, &menelaus_irq_chip, > + handle_simple_irq); > + irq_set_nested_thread(i, 1); > + set_irq_flags(i, IRQF_VALID); This assumes that this h/w only exists on ARM platforms. Is that true? > + } This is usually completed in an *_irq_map() operation call-back. I can't see where you reverse this process either (usually *_irq_unmap()) > - mutex_init(&m->lock); > - This doesn't belong in this patch. It should have been removed with the final use of the lock was. -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org ? Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753600Ab3LJJ03 (ORCPT ); Tue, 10 Dec 2013 04:26:29 -0500 Received: from mail-yh0-f42.google.com ([209.85.213.42]:50539 "EHLO mail-yh0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754035Ab3LJJUz (ORCPT ); Tue, 10 Dec 2013 04:20:55 -0500 Date: Tue, 10 Dec 2013 09:20:50 +0000 From: Lee Jones To: Felipe Balbi Cc: Tony Lindgren , Aaro Koskinen , Linux OMAP Mailing List , Linux ARM Kernel Mailing List , Linux Kernel Mailing List Subject: Re: [PATCH v3 11/15] mfd: menelaus: Start to use irqdomain Message-ID: <20131210092050.GT12675@lee--X1> References: <20131209161422.GC24047@saruman.home> <1386606085-26838-1-git-send-email-balbi@ti.com> <1386606085-26838-11-git-send-email-balbi@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1386606085-26838-11-git-send-email-balbi@ti.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Introduce an irq_chip and irq_domain for menelaus driver. Following > patches will convert uses to traditional request_threaded_irq(). > > While at that, some better error handling had to be added, so we could > free irq descs we allocated. > > Tested-by: Aaro Koskinen > Signed-off-by: Felipe Balbi > --- > drivers/mfd/menelaus.c | 127 ++++++++++++++++++++++++++++++++++++++++++++++--- > + irq_domain_add_legacy(node, MENELAUS_NR_IRQS, irq_base, 0, > + &irq_domain_simple_ops, m); When will this driver become DT compliant? I think you should use irq_domain_add_simple() to future proof yourself a little. > + m->irq_base = irq_base; > + > + for (i = irq_base; i < irq_base + MENELAUS_NR_IRQS; i++) { > + irq_set_chip_data(i, m); > + irq_set_chip_and_handler(i, &menelaus_irq_chip, > + handle_simple_irq); > + irq_set_nested_thread(i, 1); > + set_irq_flags(i, IRQF_VALID); This assumes that this h/w only exists on ARM platforms. Is that true? > + } This is usually completed in an *_irq_map() operation call-back. I can't see where you reverse this process either (usually *_irq_unmap()) > - mutex_init(&m->lock); > - This doesn't belong in this patch. It should have been removed with the final use of the lock was. -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog