From mboxrd@z Thu Jan 1 00:00:00 1970 From: marc.zyngier@arm.com (Marc Zyngier) Date: Wed, 30 Sep 2015 10:08:59 +0100 Subject: [PATCH 1/4] of: Add of_parse_phandle_with_opt_args() helper function In-Reply-To: References: <1442944336-11754-1-git-send-email-marc.zyngier@arm.com> <1442944336-11754-2-git-send-email-marc.zyngier@arm.com> Message-ID: <560BA6AB.3060500@arm.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 29/09/15 18:28, Rob Herring wrote: > On Tue, Sep 22, 2015 at 12:52 PM, Marc Zyngier wrote: >> of_parse_phandle_with_args() is slightly inflexible as it doesn't >> allow the (unusual) case where the #*-cells property is not defined. >> In order to support this, introduce of_parse_phandle_with_opt_args() >> which assumes that #*-cells is zero when it is not defined, > > zero or cell_count - 1? Zero is how the lack of #msi-cells property is interpreted. (cell_count - 1) is how this is implemented. > I would be okay with always assuming zero rather than being an error > if that simplifies things. It is not really the kernel's job to be a > dtb validator. I'd be fine with that too. I'd just like it to be a defined behaviour, not an unexpected side effect. > Also, I assume this was done for some compatibility? In general, we > should be explicit, so "#msi-cells = <0>" should be recommended and we > should update dts files if they are not. I agree that over time, we should update the existing DTS. But I hear Mark chanting "Stable DT" behind me, so I'm inclined to provide an transition path... ;-) I'll respin the series later today. Thanks, M. -- Jazz is not dead. It just smells funny... From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754690AbbI3JJI (ORCPT ); Wed, 30 Sep 2015 05:09:08 -0400 Received: from foss.arm.com ([217.140.101.70]:58583 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751545AbbI3JJC (ORCPT ); Wed, 30 Sep 2015 05:09:02 -0400 Message-ID: <560BA6AB.3060500@arm.com> Date: Wed, 30 Sep 2015 10:08:59 +0100 From: Marc Zyngier Organization: ARM Ltd User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0 MIME-Version: 1.0 To: Rob Herring CC: "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Mark Rutland , Rob Herring , Jason Cooper , Thomas Gleixner , Bjorn Helgaas Subject: Re: [PATCH 1/4] of: Add of_parse_phandle_with_opt_args() helper function References: <1442944336-11754-1-git-send-email-marc.zyngier@arm.com> <1442944336-11754-2-git-send-email-marc.zyngier@arm.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 29/09/15 18:28, Rob Herring wrote: > On Tue, Sep 22, 2015 at 12:52 PM, Marc Zyngier wrote: >> of_parse_phandle_with_args() is slightly inflexible as it doesn't >> allow the (unusual) case where the #*-cells property is not defined. >> In order to support this, introduce of_parse_phandle_with_opt_args() >> which assumes that #*-cells is zero when it is not defined, > > zero or cell_count - 1? Zero is how the lack of #msi-cells property is interpreted. (cell_count - 1) is how this is implemented. > I would be okay with always assuming zero rather than being an error > if that simplifies things. It is not really the kernel's job to be a > dtb validator. I'd be fine with that too. I'd just like it to be a defined behaviour, not an unexpected side effect. > Also, I assume this was done for some compatibility? In general, we > should be explicit, so "#msi-cells = <0>" should be recommended and we > should update dts files if they are not. I agree that over time, we should update the existing DTS. But I hear Mark chanting "Stable DT" behind me, so I'm inclined to provide an transition path... ;-) I'll respin the series later today. Thanks, M. -- Jazz is not dead. It just smells funny...