Received: by 10.192.165.148 with SMTP id m20csp4098583imm; Mon, 30 Apr 2018 11:41:42 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo4+eDnDIhx/os5pVXR1EdqUPYK8hqdC/7JGxE6RRWyn65IOKMN4Gth92rZS3qnazddg3ZY X-Received: by 10.98.47.2 with SMTP id v2mr12976231pfv.239.1525113702188; Mon, 30 Apr 2018 11:41:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525113702; cv=none; d=google.com; s=arc-20160816; b=elIpvLHZGsKN6ovFW3avcQFEesAitltu1Gz/FBzgDCSbAyyqPZGyl8Xi5Tur2VQ9BU HJf8GZL1v4t6bzKNpqPPPYGHSl3JRRLTYzxKcZ+z/IhaNSkjsi+WMDyIcRJ4/3kE70Bx b/8GxT7NXppLQrCMManba4Z8GEV8McP3hQav+4WGeKqeleh8vkJw599mGR7CdXBbH+84 w+KngBIuFa/MUPVtpJVVdvNdVPYAxpBAzPo895KvsaZZzzlZPv9q2tv5z1mH1qkr86dx gQ6dIwVCn4mbaxltxGpleHh2PDCEtnY/VPTfeMBVIWa1zqHljcsn1ONfF5VS9+iGbPTo 6f5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dmarc-filter:arc-authentication-results; bh=n5ublK5koD9x5lOHBTnjePJr2SAZGYqcDKlYS44qu2w=; b=GbMgZR957ZU0WjklYhlyytDbYPxkkgof+vGCfEAw+2NEEhgVIDTNHGQTHTQhzmfzTy mohR1WFPZfHfNLRL7jTBfImSo4v6vEek/ntSJ3OPZVuPhq8WGGgc/NE+IZaSK599JP/X h3838mEIJDPdHiykgSNVTW4k2eL2b42UqOICcQMjJ1Jx7y+9o+FyaGnOML3ZWIFniu9R 8BItJ2IzHvG9RVxGz56MlZbkXdFkQBDbUx1zCkt/Bpk16opm2z5SRGy7GrDGNSnNTcjc H3983Jej+qBwZcHn/VCeJWbxyGjLXUNBokzA+mr2BfKWx5DMu6jTSISfl05om8rywj81 Mzdg== 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 k16-v6si8514756pli.171.2018.04.30.11.41.27; Mon, 30 Apr 2018 11:41:42 -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 S1754648AbeD3SkL (ORCPT + 99 others); Mon, 30 Apr 2018 14:40:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:47710 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753608AbeD3SkJ (ORCPT ); Mon, 30 Apr 2018 14:40:09 -0400 Received: from localhost (unknown [69.71.5.252]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DE55B21746; Mon, 30 Apr 2018 18:40:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DE55B21746 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=helgaas@kernel.org Date: Mon, 30 Apr 2018 13:40:07 -0500 From: Bjorn Helgaas To: Jan Kiszka Cc: Bjorn Helgaas , linux-pci@vger.kernel.org, Linux Kernel Mailing List , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 3/6] PCI: Introduce devm_of_pci_get_host_bridge_resources Message-ID: <20180430184007.GC95643@bhelgaas-glaptop.roam.corp.google.com> References: <20180427222427.GB73638@bhelgaas-glaptop.roam.corp.google.com> <869a8ad9-dd2f-8462-c0c4-2d8a62d74185@siemens.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <869a8ad9-dd2f-8462-c0c4-2d8a62d74185@siemens.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Apr 28, 2018 at 09:28:47AM +0200, Jan Kiszka wrote: > On 2018-04-28 00:24, Bjorn Helgaas wrote: > > On Tue, Apr 24, 2018 at 05:13:39PM +0200, Jan Kiszka wrote: > >> From: Jan Kiszka > >> > >> of_pci_get_host_bridge_resources allocates the resource structures it > >> fills dynamically, but none of its callers care to release them so far. > >> Rather than requiring everyone to do this explicitly, introduce a > >> managed version of that service. This differs API-wise only in taking a > >> reference to the associated device, rather than to the device tree node. > >> > >> As of_pci_get_host_bridge_resources is an exported interface, we cannot > >> simply drop it at this point. After converting all in-tree users to the > >> new API, we could phase out the unmanaged one over some grace period. > > > > It looks like it might be possible to split this into three or four > > patches: > > > > 1) Factor __of_pci_get_host_bridge_resources() out of > > of_pci_get_host_bridge_resources() > > > > 2) Add struct device * argument > > > > 3) Convert pr_info() to dev_info() > > > > 4) Add devm_of_pci_get_host_bridge_resources() > > Will do. I'm even considering > > 5) mark of_pci_get_host_bridge_resources() __deprecated, due to the leak > and no remaining in-tree user - what do you think? Sounds good. It'd be nice if we had some guideline about deprecation -- whether we actually need to mark things __deprecated, and then how long to wait before actually removing them, but I don't see anything in Documentation/. Looks like it was added by cbe4097f8ae6 ("of/pci: Add support for parsing PCI host bridge resources from DT") in v3.18, so it's been around for a while and I guess it would be nice to have a grace period before removing it.