Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933115AbcDNRDC (ORCPT ); Thu, 14 Apr 2016 13:03:02 -0400 Received: from mail.kernel.org ([198.145.29.136]:47266 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932099AbcDNRDA (ORCPT ); Thu, 14 Apr 2016 13:03:00 -0400 Date: Thu, 14 Apr 2016 12:02:55 -0500 From: Rob Herring To: Pantelis Antoniou Cc: Mark Rutland , Russell King - ARM Linux , rank Rowand , Masahiro Yamada , devicetree@vger.kernel.org, Arnd Bergmann , Linux Kernel Mailing List , linux-arm-kernel Subject: Re: [Question] refcount of DT node Message-ID: <20160414170255.GA26137@rob-hp-laptop> References: <20160414084849.GT19428@n2100.arm.linux.org.uk> <20160414095957.GB10273@leverpostej> <06E9E2D3-4627-4970-ABBB-34B5ED620709@konsulko.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <06E9E2D3-4627-4970-ABBB-34B5ED620709@konsulko.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2105 Lines: 48 On Thu, Apr 14, 2016 at 01:02:56PM +0300, Pantelis Antoniou wrote: > Hi Mark, > > > On Apr 14, 2016, at 12:59 , Mark Rutland wrote: > > > > On Thu, Apr 14, 2016 at 09:48:49AM +0100, Russell King - ARM Linux wrote: > >> On Thu, Apr 14, 2016 at 04:47:57PM +0900, Masahiro Yamada wrote: > >>> Hi experts. > >>> > >>> My understanding of refcount of DT node is poor. > >> > >> The message from DT people is... don't worry about DT node refcounting. > >> Do whatever you want with it, they don't care whether you have correct > >> refcounting or not. > >> > >> The background behind that is that I've tried to fix the refcounting, > >> and even had the coccinelle people generate some stuff to work on this > >> issue, but DT people's attitude towards it is "don't bother". > >> > >> So yes, people may get it wrong, but it seems it's something that DT > >> people want ignored. > > > > I'm not sure that's quite fair; the last discussion I recall about this > > ended up concluding that we need a better API, rather than papering over > > problems. > > > > That said, there isn't much obvious progress on that front. > > > > Frank, Pantelis, Rob, were there any conclusions on this from ELC, or is > > this something that needs someone to propose something? > > > > Frank mentioned that he wants a new API. I have some ideas about it too. > > My take is that drivers should never do reference counting, we have to figure > out a way for DT access using copy semantics or locks. Generally yes, but I think there may be exceptions. I think the locking is too fine grained for what we need. For almost all users, I think we only need locking at the overlay or changeset level. The only other user I am aware of is PSeries (IIRC) and they only need reference counting for a few things like memory and cpu. I would handle those cases explicitly. But that is going to require someone familar with PSeries to work on. I suppose we could separate overlays from the OF_DYNAMIC dependency (or just the ref counting part of it) and then OF_DYNAMIC goes back to PPC only. Rob