From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen N Chivers Subject: Re: Linux-3.14-rc2: Order of serial node compatibles in DTS files. Date: Wed, 12 Feb 2014 10:21:58 +1000 Message-ID: References: <20140206082635.GA7048@visitor2.iram.es> <20140207101036.GA823@visitor2.iram.es> <20140210110342.GA15806@visitor2.iram.es> <20140211072606.GA26514@visitor2.iram.es> <63AEBD99-AA87-4FD7-BBDA-0CE419959F14@kernel.crashing.org> <52FAA97F.4060600@gmail.com> <1392162080.6733.404.camel@snotra.buserror.net> <52FAB65C.4090201@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Return-path: In-Reply-To: <52FAB65C.4090201-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Sebastian Hesselbarth Cc: Arnd Bergmann , Chris Proctor , devicetree , Kumar Gala , linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org, Stephen N Chivers , Scott Wood List-Id: devicetree@vger.kernel.org Sebastian Hesselbarth wrote on 02/12/2014 10:46:36 AM: > From: Sebastian Hesselbarth > To: Scott Wood > Cc: Kumar Gala , Stephen N Chivers > , Chris Proctor , > linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org, Arnd Bergmann , > devicetree > Date: 02/12/2014 11:04 AM > Subject: Re: Linux-3.14-rc2: Order of serial node compatibles in DTS files. > > On 02/12/2014 12:41 AM, Scott Wood wrote: > > On Tue, 2014-02-11 at 23:51 +0100, Sebastian Hesselbarth wrote: > >> On 02/11/2014 11:33 PM, Kumar Gala wrote: > >>> Hmm, > >>> > >>> Wondering if this caused the issue: > >>> > >>> commit 105353145eafb3ea919f5cdeb652a9d8f270228e > >>> Author: Sebastian Hesselbarth > >>> Date: Tue Dec 3 14:52:00 2013 +0100 > >>> > >>> OF: base: match each node compatible against all given matches first > >> > >> [adding Arnd on Cc] > >> > >> Could be. I checked tty/serial/of_serial.c and it does not provide a > >> compatible for "fsl,ns16550". Does reverting the patch fix the issue > >> observed? > >> > >> I don't think the missing compatible is causing it, but of_serial > >> provides a DT match for .type = "serial" just to fail later on > >> with the error seen above. > >> > >> The commit in question reorders of_match_device in a way that match > >> table order is not relevant anymore. This can cause it to match > >> .type = "serial" first here. > >> > >> Rather than touching the commit, I suggest to remove the problematic > >> .type = "serial" from the match table. It is of no use anyway. > > > > Regardless of whether .type = "serial" gets removed, it seems wrong for > > of_match_node() to accept a .type-only match (or .name, or anything else > > that doesn't involve .compatible) before it accepts a compatible match > > other than the first in the compatible property. > > Right, I thought about it and came to the same conclusion. I sent a > patch a second ago to prefer .compatible != NULL matches over those > with .compatible == NULL. > > Would be great if Stephen can re-test that. If it solves the issue, I > can send a patch tomorrow. Done. But, the Interrupt Controller (MPIC) goes AWOL and it is down hill from there. The MPIC is specified in the DTS as: mpic: pic@40000 { interrupt-controller; #address-cells = <0>; #interrupt-cells = <2>; reg = <0x40000 0x40000>; compatible = "chrp,open-pic"; device_type = "open-pic"; big-endian; }; The board support file has the standard mechanism for allocating the PIC: struct mpic *mpic; mpic = mpic_alloc(NULL, 0, 0, 0, 256, " OpenPIC "); BUG_ON(mpic == NULL); mpic_init(mpic); I checked for damage in applying the patch and it has applied correctly. Stephen Chivers, CSC Australia Pty. Ltd. -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail1.bemta7.messagelabs.com (mail1.bemta7.messagelabs.com [216.82.254.102]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 2B08C2C00A2 for ; Wed, 12 Feb 2014 11:22:17 +1100 (EST) In-Reply-To: <52FAB65C.4090201@gmail.com> References: <20140206082635.GA7048@visitor2.iram.es> <20140207101036.GA823@visitor2.iram.es> <20140210110342.GA15806@visitor2.iram.es> <20140211072606.GA26514@visitor2.iram.es> <63AEBD99-AA87-4FD7-BBDA-0CE419959F14@kernel.crashing.org> <52FAA97F.4060600@gmail.com> <1392162080.6733.404.camel@snotra.buserror.net> <52FAB65C.4090201@gmail.com> To: Sebastian Hesselbarth MIME-Version: 1.0 Subject: Re: Linux-3.14-rc2: Order of serial node compatibles in DTS files. From: Stephen N Chivers Message-ID: Date: Wed, 12 Feb 2014 10:21:58 +1000 Content-Type: text/plain; charset="US-ASCII" Cc: Chris Proctor , Arnd Bergmann , devicetree , Stephen N Chivers , Scott Wood , linuxppc-dev@lists.ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sebastian Hesselbarth wrote on 02/12/2014 10:46:36 AM: > From: Sebastian Hesselbarth > To: Scott Wood > Cc: Kumar Gala , Stephen N Chivers > , Chris Proctor , > linuxppc-dev@lists.ozlabs.org, Arnd Bergmann , > devicetree > Date: 02/12/2014 11:04 AM > Subject: Re: Linux-3.14-rc2: Order of serial node compatibles in DTS files. > > On 02/12/2014 12:41 AM, Scott Wood wrote: > > On Tue, 2014-02-11 at 23:51 +0100, Sebastian Hesselbarth wrote: > >> On 02/11/2014 11:33 PM, Kumar Gala wrote: > >>> Hmm, > >>> > >>> Wondering if this caused the issue: > >>> > >>> commit 105353145eafb3ea919f5cdeb652a9d8f270228e > >>> Author: Sebastian Hesselbarth > >>> Date: Tue Dec 3 14:52:00 2013 +0100 > >>> > >>> OF: base: match each node compatible against all given matches first > >> > >> [adding Arnd on Cc] > >> > >> Could be. I checked tty/serial/of_serial.c and it does not provide a > >> compatible for "fsl,ns16550". Does reverting the patch fix the issue > >> observed? > >> > >> I don't think the missing compatible is causing it, but of_serial > >> provides a DT match for .type = "serial" just to fail later on > >> with the error seen above. > >> > >> The commit in question reorders of_match_device in a way that match > >> table order is not relevant anymore. This can cause it to match > >> .type = "serial" first here. > >> > >> Rather than touching the commit, I suggest to remove the problematic > >> .type = "serial" from the match table. It is of no use anyway. > > > > Regardless of whether .type = "serial" gets removed, it seems wrong for > > of_match_node() to accept a .type-only match (or .name, or anything else > > that doesn't involve .compatible) before it accepts a compatible match > > other than the first in the compatible property. > > Right, I thought about it and came to the same conclusion. I sent a > patch a second ago to prefer .compatible != NULL matches over those > with .compatible == NULL. > > Would be great if Stephen can re-test that. If it solves the issue, I > can send a patch tomorrow. Done. But, the Interrupt Controller (MPIC) goes AWOL and it is down hill from there. The MPIC is specified in the DTS as: mpic: pic@40000 { interrupt-controller; #address-cells = <0>; #interrupt-cells = <2>; reg = <0x40000 0x40000>; compatible = "chrp,open-pic"; device_type = "open-pic"; big-endian; }; The board support file has the standard mechanism for allocating the PIC: struct mpic *mpic; mpic = mpic_alloc(NULL, 0, 0, 0, 256, " OpenPIC "); BUG_ON(mpic == NULL); mpic_init(mpic); I checked for damage in applying the patch and it has applied correctly. Stephen Chivers, CSC Australia Pty. Ltd.