Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp5118607pxu; Thu, 10 Dec 2020 13:28:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJzd6K7wmplec1zFDrMfN+IBTKsWnqB+jQS1BE52VmtYB/oFsKdi7wJeuRtiDSmH8bMw1mGe X-Received: by 2002:a50:8b61:: with SMTP id l88mr8954557edl.250.1607635679968; Thu, 10 Dec 2020 13:27:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607635679; cv=none; d=google.com; s=arc-20160816; b=Yh7f9oepBqmdf8R1YTKyCv0FMgz47s4FiqC8tjOD0etkksPHODNDlOTFnqrQK/eTQu Ktvoc+QL/twFayGkudLkF7mCIVzw3bYCFAjWRYSSo+kQjxQOgq5Og9jqrcfrVteO4EXv orWC4cGZ4cJ8l6fQLHdDPWL5QN+gq1vYwSPwDKaATws+K0KAwP3njLQwknIGIFozBSFE vSkJVrvaEBFKxe4FYS01dk59dHBis4jBmOA0FryrHuZ2NjfCNEZoZicp6RTU/nNsUbv9 C20KEWh+VHOicbgdR4pMHdWiY6mzMjRS1hJqa9ccaNgf5TMK9/64BLi51IEv3OAM8wqG bNEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :message-id:subject:cc:to:from:dkim-signature:date; bh=15Bu26IDFYez9JCFVB2Zz6r1GWWeBPG6De/xJ5BxnPI=; b=PMqdbcd1BrbK5dQnChqMAGUEZ1vVaRKPfI2QMKPIMfoEcyop8DMC/xA8HutVDYJpYo z3SOcfO1rNBLoPst1ej22glYvwhdXkbazh2JcFEfpEVgpVcKr+F9Gc4mtHfmXwXW0rHG Krt5YUbVGbKBeilqlBr+EaPjhgN2evXuAerT3KdnnGL20886ko/IwcJ2PqFx0yd4KxC+ OI9d9WwbqLe1aDo5UEcEc/mtkIUw/cRNbZ7wAoVQ5W4AQejY39tL9nYQnLAcvBVDXEsT Jp/13nh475sRUtgQHfqw8SEkmiCe7Qcxf0Ulo+vQMWn8qGFowqdKoP42gSpUTgi779qa MARA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=c29tY261; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k3si3674985edk.307.2020.12.10.13.27.36; Thu, 10 Dec 2020 13:27:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=c29tY261; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393692AbgLJVYw (ORCPT + 99 others); Thu, 10 Dec 2020 16:24:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:37378 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2394009AbgLJVXh (ORCPT ); Thu, 10 Dec 2020 16:23:37 -0500 Date: Thu, 10 Dec 2020 15:22:55 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1607635377; bh=TOz09/Be4KaJAdEckZ6bX5dETMcE9pxq2g7yzIxBw60=; h=From:To:Cc:Subject:In-Reply-To:From; b=c29tY261aNn7r2A2U6A3CanPIzaCva7CfX+EOKAD8VV/0N+cwt8mBFXk5sYldhOZe qgm0RkrZ/l4M2nJ1K1isLdePt9NcwqlWk5/clR8RVtPtaQApwT6hzXy/e1iOwXYn8m OdDHUTSGbidktRpNOWmo7rVVV9jKLrNgCCCFfBJlhz+XvWujcXc8Juz7W6gdWsFooU Uugs9Yv53zi8BwVEMuKZMm5rLVwjlSlrvavelbAj5oT6kSat3ehf8n/EfnBYrhdATk OgdNUD7X3gnPRZCsgp+G7sKHSE7pH0iK/EBetU9MMyvf9vOpmd9reSySUUwo4QPgxH Bz8gCUGgaAePA== From: Bjorn Helgaas To: Alexander Lobakin Cc: Bjorn Helgaas , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 pci-next] PCI: Keep both device name and resource name for config space remaps Message-ID: <20201210212255.GA56204@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 19, 2020 at 09:26:33PM +0000, Alexander Lobakin wrote: > Follow the rule taken in commit 35bd8c07db2c > ("devres: keep both device name and resource name in pretty name") > and keep both device and resource names while requesting memory > regions for PCI config space to prettify e.g. /proc/iomem output: > > Before (DWC Host Controller): > > 18b00000-18b01fff : dbi > 18b10000-18b11fff : config > 18b20000-18b21fff : dbi > 18b30000-18b31fff : config > > After: > > 18b00000-18b01fff : 18b00000.pci dbi > 18b10000-18b11fff : 18b00000.pci config > 18b20000-18b21fff : 18b20000.pci dbi > 18b30000-18b31fff : 18b20000.pci config > > Since v1 [0]: > - massage subject and commit message (Bjorn); > - no functional changes. > > [0] https://lore.kernel.org/lkml/JvyOzv8K8n5CCdP1xfLOdOWh4AbFrXdMMOEExr6em8@cp4-web-036.plabs.ch > > Cc: Bjorn Helgaas > Signed-off-by: Alexander Lobakin Applied to pci/enumeration for v5.11, thanks! > --- > drivers/pci/pci.c | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c > index e578d34095e9..0716691f7d14 100644 > --- a/drivers/pci/pci.c > +++ b/drivers/pci/pci.c > @@ -4188,7 +4188,14 @@ void __iomem *devm_pci_remap_cfg_resource(struct device *dev, > } > > size = resource_size(res); > - name = res->name ?: dev_name(dev); > + > + if (res->name) > + name = devm_kasprintf(dev, GFP_KERNEL, "%s %s", dev_name(dev), > + res->name); > + else > + name = devm_kstrdup(dev, dev_name(dev), GFP_KERNEL); > + if (!name) > + return IOMEM_ERR_PTR(-ENOMEM); > > if (!devm_request_mem_region(dev, res->start, size, name)) { > dev_err(dev, "can't request region for resource %pR\n", res); > -- > 2.29.2 > >