From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastian Hesselbarth Subject: Re: Linux-3.14-rc2: Order of serial node compatibles in DTS files. Date: Wed, 12 Feb 2014 09:25:24 +0100 Message-ID: <52FB2FF4.6060905@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> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Stephen N Chivers Cc: Arnd Bergmann , Chris Proctor , devicetree , Kumar Gala , linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org, Scott Wood List-Id: devicetree@vger.kernel.org On 02/12/2014 01:21 AM, Stephen N Chivers wrote: > 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: >>> >>> 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. Hmm, I did a mistake in the patch: - while (m->name[0] || m->type[0]) { + while (m->compatible[0] || m->name[0] || m->type[0]) { for the second added match. Otherwise, the matches are not evaluated down to the sentinel but the loop quits on the first match table entry without .name and .type set. Sebastian -- 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