Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753857AbcKUOF4 (ORCPT ); Mon, 21 Nov 2016 09:05:56 -0500 Received: from mailapp01.imgtec.com ([195.59.15.196]:37745 "EHLO mailapp01.imgtec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753678AbcKUOFz (ORCPT ); Mon, 21 Nov 2016 09:05:55 -0500 Subject: Re: [Patch v7 6/7] irqchip: xilinx: Try to fall back if xlnx,kind-of-intr not provided To: Thomas Gleixner References: <20161114121351.10924-1-Zubair.Kakakhel@imgtec.com> <20161114121351.10924-7-Zubair.Kakakhel@imgtec.com> CC: , , , , , , From: Zubair Lutfullah Kakakhel Message-ID: <7f07be12-fb2e-e8ad-e0e6-52c58542470a@imgtec.com> Date: Mon, 21 Nov 2016 14:05:46 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [192.168.154.45] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2032 Lines: 71 Hi, On 11/18/2016 01:29 PM, Thomas Gleixner wrote: > On Mon, 14 Nov 2016, Zubair Lutfullah Kakakhel wrote: > >> The powerpc dts file does not have the xlnx,kind-of-intr property. >> Instead of erroring out, give a warning instead. And attempt to >> continue to probe the interrupt controller while assuming >> kind-of-intr is 0x0 as a fall back. > > This is broken, really. On multiplatform kernels this will try to probe the > chip no matter what. I'm not sure I understand why this driver will probe on multi-platform kernels if the compatible string isn't in the DT? > > Powerpc already has: > > static const struct of_device_id xilinx_intc_match[] __initconst = { > { .compatible = "xlnx,opb-intc-1.00.c", }, > { .compatible = "xlnx,xps-intc-1.00.a", }, > {} > }; > > Unless I'm missing something important, then adding those compatible > strings to the driver will just keep stuff working as expected instead of > adding unsafe and broken heuristics. > The last two lines of the driver already specify the compatible strings. " IRQCHIP_DECLARE(xilinx_intc_xps, "xlnx,xps-intc-1.00.a", xilinx_intc_of_init); IRQCHIP_DECLARE(xilinx_intc_opb, "xlnx,opb-intc-1.00.c", xilinx_intc_of_init); " I'll elaborate on the commit message. The DT node in arch/powerpc for this driver is intc_0: interrupt-controller@81800000 { #interrupt-cells = <0x2>; compatible = "xlnx,xps-intc-1.00.a"; interrupt-controller ; reg = < 0x81800000 0x10000 >; xlnx,num-intr-inputs = <0xc>; } ; The DT node in arch/microblaze for this driver is intc_0: interrupt-controller@81800000 { #interrupt-cells = <0x2>; compatible = "xlnx,xps-intc-1.00.a"; interrupt-controller ; reg = < 0x81800000 0x10000 >; xlnx,kind-of-intr = <0x100>; //! xlnx,num-intr-inputs = <0x9>; } ; The PPC driver assumes the kind-of-intr value be 0x0 and doesn't specify it in DT. This patch makes that a fall back case. Instead of completely error-ing out. Regards, ZubairLK > Thanks, > > tglx > >