From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751218AbdBKRim (ORCPT ); Sat, 11 Feb 2017 12:38:42 -0500 Received: from bh-25.webhostbox.net ([208.91.199.152]:55164 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750815AbdBKRik (ORCPT ); Sat, 11 Feb 2017 12:38:40 -0500 Date: Sat, 11 Feb 2017 09:38:37 -0800 From: Guenter Roeck To: Qi Hou Cc: Peter Rosin , Rob Herring , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: Tracebacks in -next due to 'of: fix of_node leak caused in of_find_node_opts_by_path' Message-ID: <20170211173837.GA25434@roeck-us.net> References: <20170211012947.GA3102@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170211012947.GA3102@roeck-us.net> User-Agent: Mutt/1.5.24 (2015-08-30) X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: guenter@roeck-us.net X-Authenticated-Sender: bh-25.webhostbox.net: guenter@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 10, 2017 at 05:29:47PM -0800, Guenter Roeck wrote: > Hi, > > I see a number of tracebacks in test runs on qemu-next, all related to omap > configurations. > > Here is an example: > > [ 0.000000] OF: ERROR: Bad of_node_put() on /ocp@68000000 > [ 0.000000] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G W 4.10.0-rc7-next-20170210 #1 > [ 0.000000] Hardware name: Generic OMAP3-GP (Flattened Device Tree) > [ 0.000000] [] (unwind_backtrace) from [] (show_stack+0x10/0x14) > [ 0.000000] [] (show_stack) from [] (dump_stack+0x98/0xac) > [ 0.000000] [] (dump_stack) from [] (kobject_release+0x48/0x7c) > [ 0.000000] [] (kobject_release) from [] (__of_translate_address+0xb0/0x2cc) > [ 0.000000] [] (__of_translate_address) from [] (__of_address_to_resource+0x28/0xb4) > [ 0.000000] [] (__of_address_to_resource) from [] (of_address_to_resource+0x70/0x80) > [ 0.000000] [] (of_address_to_resource) from [] (of_syscon_register+0x88/0x22c) > [ 0.000000] [] (of_syscon_register) from [] (syscon_node_to_regmap+0x90/0x94) > [ 0.000000] [] (syscon_node_to_regmap) from [] (omap_control_init+0x50/0xd8) > [ 0.000000] [] (omap_control_init) from [] (omap_clk_init+0x3c/0x70) > [ 0.000000] [] (omap_clk_init) from [] (__omap_sync32k_timer_init+0x20/0x2b4) > [ 0.000000] [] (__omap_sync32k_timer_init) from [] (omap3_secure_sync32k_timer_init+0x3c/0x48) > [ 0.000000] [] (omap3_secure_sync32k_timer_init) from [] (start_kernel+0x244/0x38c) > [ 0.000000] [] (start_kernel) from [<8020807c>] (0x8020807c) > [ 0.000000] Clocking rate (Crystal/Core/MPU): 26.0/332/500 MHz > > There are several such messages with different call paths. > > A log with all tracebacks is available at > http://kerneltests.org/builders/qemu-arm-next/builds/627/steps/qemubuildcommand/logs/stdio > > Bisect points to commit 'of: fix of_node leak caused in > of_find_node_opts_by_path'. Bisect log is attached. > > It is going to be interesting to learn if the patch introduces a problem > or if it exposes one. > It exposes a problem. omap3xxx_hwmod_is_hs_ip_block_usable() calls of_find_node_by_name(bus, ...), which releases 'bus'. The function is called multiple times with the same 'bus' node, meaning 'bus' is released multiple times. There are other instances of the same problem, such as in leon_init_timers() or _qcom_cc_register_board_clk(). I'll see if I can submit some patches. Guenter