Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp684831pxb; Thu, 19 Nov 2020 11:07:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJw3BAs4qCeLxp19QJZ7mwBNWVxXUTj7a+o6nm8byMguKZmizUWXgCkwn0kmz4HsXOY1o3VN X-Received: by 2002:a17:906:2806:: with SMTP id r6mr23039222ejc.130.1605812856098; Thu, 19 Nov 2020 11:07:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605812856; cv=none; d=google.com; s=arc-20160816; b=TBxSvssiulOoOOoIbWHMwfufqd2DdZSU5Zvx6yFn4qp5IAQ7Wbh6PzluiEsSL8K8bk t6Kd3JS/f4pvWuFlbKrtLZfqhNAVERCSRnq//HEsVuSxi4bGg4ob9hIiBZKpReB/W7gt wnYljhoDcWEL9igxHwAO1puHd5PDU9zij3+W3KqDuwmyYhDXaBeeO25BawOsZOIeuJEP B9u2HklB7SyTYBDnuKcVcsaMTHh3avPBrDWYR+PM7P+4QTAIRkTe3T8sLLppGbumWq5g ay2xxifffRWwpi0j1O2C6EkrSqfI+R6+q10OPXl/p3TdlFgMr1hPz4b3C/xnRONSN9I8 LgQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:subject:reply-to:cc:from:to:dkim-signature:date; bh=mGRxcfYAolC/NAFMZCqEsZ2XXtf/Sf6e5ygXw0wgKUk=; b=wFm5vDrm4cSi9hUR5SaTMaOrAZ6Ykm4GyszG2hIh8DWhb7yCeVIaiOZnGi46R0kEN0 XhAKSRYBYfNTLa86+ix2cvB/FsU6aw40AZ5cLRF0wWYfRYl+jdPO6P0XiXpNaCctjL7j gpj4trz2nKUWwoRbE5PdRRq9TnVozwHxY4RttmDz0gTCJQM9Nahbx3i2iJP2yESvBAhH 1ndImxYRJuTTGM6vrXgdlG9oJAEILE+r0sZ3Ow1+4plyaBPAav+koKPP+yTENZWZcP4v At0eyYgNezCx+MuNMnFMab2Lnx8hXi386Wc03Irx/b7l5KMPn5oEmJRsXHXVk+Ufzr2R oW0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=MEvmfNVu; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y7si344892ejd.450.2020.11.19.11.07.10; Thu, 19 Nov 2020 11:07:36 -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=@pm.me header.s=protonmail header.b=MEvmfNVu; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727476AbgKSTEu (ORCPT + 99 others); Thu, 19 Nov 2020 14:04:50 -0500 Received: from mail2.protonmail.ch ([185.70.40.22]:56000 "EHLO mail2.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727267AbgKSTEu (ORCPT ); Thu, 19 Nov 2020 14:04:50 -0500 Date: Thu, 19 Nov 2020 19:04:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1605812687; bh=mGRxcfYAolC/NAFMZCqEsZ2XXtf/Sf6e5ygXw0wgKUk=; h=Date:To:From:Cc:Reply-To:Subject:From; b=MEvmfNVu1l/+M20A+8ShDsCBsLr3t1Is6Icz36mhsLHKeha+urkYFvIxxi4H4kuTm LOJs7Bn5M8NQ+EGt1LHHPoj1HxZJ/NcFvQY2DK2aDYLx028jtyy9PYjymdLx9dr89q Us/fH6fD4mNdUTbq6HdRrYGlM2OZxtmZiRlgijTKkLpDcwl06Wp0jQqQIxJ5q1ezES yk0AioPpW7PtAVr6cn8FQiNH7z0eyDjhO8j5ZiOE4Hp3xu5xhkA9Yf5wu7v+u7/T9F Lm44VJfG6ZFGxLx6l8Gv18rhNNOLLNMUP89GCYhRKURqMk+C0eUCCX7+A0YC/hPm/1 GBAnwv1cAcHRw== To: Bjorn Helgaas From: Alexander Lobakin Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Alexander Lobakin Reply-To: Alexander Lobakin Subject: [PATCH pci-next] pci: remap: keep both device name and resource name for config space Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 19000000-19ffffff : pci@18b00000 19000000-190fffff : PCI Bus 0000:01 19000000-1900ffff : 0000:01:00.0 19100000-191fffff : PCI Bus 0000:01 1a000000-1affffff : pci@18b20000 1a000000-1a0fffff : PCI Bus 0001:01 1a000000-1a00ffff : 0001:01:00.0 1a100000-1a1fffff : PCI Bus 0001:01 After: 18b00000-18b01fff : 18b00000.pci dbi 18b10000-18b11fff : 18b00000.pci config 18b20000-18b21fff : 18b20000.pci dbi 18b30000-18b31fff : 18b20000.pci config 19000000-19ffffff : pci@18b00000 19000000-190fffff : PCI Bus 0000:01 19000000-1900ffff : 0000:01:00.0 19100000-191fffff : PCI Bus 0000:01 1a000000-1affffff : pci@18b20000 1a000000-1a0fffff : PCI Bus 0001:01 1a000000-1a00ffff : 0001:01:00.0 1a100000-1a1fffff : PCI Bus 0001:01 Signed-off-by: Alexander Lobakin --- 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 dev= ice *dev, =09} =20 =09size =3D resource_size(res); -=09name =3D res->name ?: dev_name(dev); + +=09if (res->name) +=09=09name =3D devm_kasprintf(dev, GFP_KERNEL, "%s %s", dev_name(dev), +=09=09=09=09 res->name); +=09else +=09=09name =3D devm_kstrdup(dev, dev_name(dev), GFP_KERNEL); +=09if (!name) +=09=09return IOMEM_ERR_PTR(-ENOMEM); =20 =09if (!devm_request_mem_region(dev, res->start, size, name)) { =09=09dev_err(dev, "can't request region for resource %pR\n", res); --=20 2.29.2