From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759803AbbA3JA1 (ORCPT ); Fri, 30 Jan 2015 04:00:27 -0500 Received: from mail-la0-f52.google.com ([209.85.215.52]:46554 "EHLO mail-la0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752637AbbA3JAZ (ORCPT ); Fri, 30 Jan 2015 04:00:25 -0500 MIME-Version: 1.0 In-Reply-To: <20150130040904.8F89D1402A7@ozlabs.org> References: <1421243519-6257-2-git-send-email-geert+renesas@glider.be> <20150130040904.8F89D1402A7@ozlabs.org> Date: Fri, 30 Jan 2015 10:00:23 +0100 X-Google-Sender-Auth: 3Gik7pF_1LlUBvBIPFAFxQHX_8k Message-ID: Subject: Re: [1/3] powerpc/pmac: Fix DT refcount imbalance in pmac_pic_probe_oldstyle From: Geert Uytterhoeven To: Michael Ellerman Cc: Geert Uytterhoeven , Benjamin Herrenschmidt , Bryan Wu , Richard Purdie , Jingoo Han , Lee Jones , "devicetree@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Michael, On Fri, Jan 30, 2015 at 5:09 AM, Michael Ellerman wrote: > On Wed, 2015-14-01 at 13:51:57 UTC, Geert Uytterhoeven wrote: >> of_find_node_by_name() calls of_node_put() on its "from" parameter, >> which must not be done on "master", as it's still in use, and will be >> released manually later. This may cause a zero kref refcount. >> Use of_get_child_by_name() instead to fix this. > > But of_find_node_by_name() searches *all* nodes, not just the children of the > parameter. That's correct. However, I guess the second mac-io will just be a direct child. > So this is a logic change AFAICS, and I have no idea what machines we'd need to > test on to check it. Originally it comes from arch/ppc/platforms/pmac_pic.c, added in 2002 in full-history-linux commit 5ea3254844ae344a ("Import arch/ppc and include/asm-ppc changes from linuxppc_2_5 tree"). I've also checked my linuxppc mail archives from 1997-2002, but couldn't find the actual patch and a description. So I don't know on which machines it's needed. > So I think an of_node_get(master) would be safer and also fix the refcounting. If no one can confirm the above, that may indeed be the best solution. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds