Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1935778imm; Thu, 7 Jun 2018 02:44:03 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKwFGIlr0uaCHVmev6S7aMSVFNC70qj/VUKOKFn+UdaFAQgqrqn9cBTisX4h7Iq6RpxFKGC X-Received: by 2002:a17:902:b40f:: with SMTP id x15-v6mr1317562plr.270.1528364643037; Thu, 07 Jun 2018 02:44:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528364643; cv=none; d=google.com; s=arc-20160816; b=a97ygZ4b7dbVNnP0Kmt+eLxre7dLaJyQkFMka+7v/TjHvK5E56YJvYLIkWiTGxbryS Cb2DD10Va/zM5o+LssBOS+ZyUn+uZyFoHLz2UCk/Q8z/21pIcBwp+Y3G7KxPjiGx9e0m eXqdOGn2hz3pGAGPxsaLw208n6taBmXm/PXlpSjelxCrFGOSaFuuFVvHLD0FSfDeMzkC ZoIb6peLCIEwnaLftEuhnIt04bGDL+U7qf59gEN7fFgAYAaNiJAIRhgdjEhTA9IgCr6i GudoYtPcendEkbkGODcoIe05PvyX4E6TOdlS+qVH9RncxeZEBgIlk943yjCrWqXpYIkD Hwaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=ytphiiv66/tXQuPwBwWZOrdrWwGufIFjRu2iDBiuTPs=; b=fnAo1a1NRWB0vc8Qy5sErMzWK8xkIo3Hy+wmDaKk0HQpduJnyEnG6sgo5iDYHUPhIH 1cIeOau9u2D2xg+/k3g6qncdKhX5vV3KfRRCv9GpGIP8HaZjuUx4RTySYpS5TEyL5ALw UDPCj/2AIsu94skWtsm0uk1+EMR6/syDMMq3UqBQYBpVm4Et3ONZAw0eyO2LteTDjgFT aIs3bjLvAWgisx9zbsLSGSsxq7XQdjCH15mHxerER1W7yng5zQXrAkEzMZa7EvMp9eAY 2GUVg/mnEz1NtOKiWkt40JyAhHMIRDBI2TK1+nXp6Xd1E5fNfQBc3LNIUv/Led8cr8dS cg/Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w12-v6si34488843plq.595.2018.06.07.02.43.48; Thu, 07 Jun 2018 02:44:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753571AbeFGJnX (ORCPT + 99 others); Thu, 7 Jun 2018 05:43:23 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:49358 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753075AbeFGJnW (ORCPT ); Thu, 7 Jun 2018 05:43:22 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9C02615AB; Thu, 7 Jun 2018 02:43:21 -0700 (PDT) Received: from [10.37.9.91] (unknown [10.37.9.91]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 27D1F3F5A0; Thu, 7 Jun 2018 02:43:15 -0700 (PDT) Subject: Re: [PATCH v4 05/14] coresight: get/put module in coresight_build/release_path To: Kim Phillips Cc: Greg Kroah-Hartman , Mathieu Poirier , Leo Yan , Alexander Shishkin , Alex Williamson , Andrew Morton , David Howells , Eric Auger , Eric Biederman , Gargi Sharma , Geert Uytterhoeven , Kefeng Wang , Kirill Tkhai , Mike Rapoport , Oleg Nesterov , Pavel Tatashin , Rik van Riel , Robin Murphy , Russell King , Thierry Reding , Todd Kjos , Randy Dunlap , linux-arm-kernel , Linux Kernel Mailing List References: <20180605210710.22227-1-kim.phillips@arm.com> <20180605210710.22227-6-kim.phillips@arm.com> <20180606082422.GB19727@kroah.com> <20180606155501.704583e1412996a1a2c6fa61@arm.com> From: Suzuki K Poulose Message-ID: <30e98462-237f-df2f-39d9-f0414f52b950@arm.com> Date: Thu, 7 Jun 2018 10:43:26 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180606155501.704583e1412996a1a2c6fa61@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/06/2018 09:55 PM, Kim Phillips wrote: > On Wed, 6 Jun 2018 10:46:36 +0100 > Suzuki K Poulose wrote: > >> And while we are at this, I also realised that we hold references to the >> parent devices for each connection (via bus_find_device() from >> of_coresight_get_endpoint_device()), while parsing the platform data, >> which is never released. > > Would this fix that?: Not completely. We store the dev_name() as a reference, which itself can be free'd, when the device is gone. I have a fix for this in my next version of the DT clean up series [0], where I clean up most of the platform parsing code. [0] http://lists.infradead.org/pipermail/linux-arm-kernel/2018-June/582904.html Cheers Suzuki > > diff --git a/drivers/hwtracing/coresight/of_coresight.c b/drivers/hwtracing/coresight/of_coresight.c > index a33a92ebe74b..a43ab078c85e 100644 > --- a/drivers/hwtracing/coresight/of_coresight.c > +++ b/drivers/hwtracing/coresight/of_coresight.c > @@ -181,6 +181,8 @@ of_get_coresight_platform_data(struct device *dev, > pdata->child_names[i] = dev_name(rdev); > pdata->child_ports[i] = rendpoint.id; > > + put_device(rdev); > + > i++; > } while (ep); > }