Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp772564pxb; Thu, 19 Nov 2020 13:28:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJzPYN6Jb9K5BFjAg9Af1/Rko5O9fcgjkWv/G8B2zvoz4pspBv41iv8j4YJbd0z3jX60m3zB X-Received: by 2002:a05:6402:1155:: with SMTP id g21mr32444042edw.53.1605821321811; Thu, 19 Nov 2020 13:28:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605821321; cv=none; d=google.com; s=arc-20160816; b=D+a4WcUZyTkpz96F0hT5Dg97KAdLFLjWcOZF/fuK1I0Pa+70acTBAM8GxWmnVKAWs5 A+ScUbVG5XXZ2tLfZOaYp8pvgQYYO9twGXpJXx5oqE3DCILjzTYr1w7VrxLz7bL0tsZb QUyoMyfHpMrU5O2LxDeREdWQ15VQHExh/57EH86bj5IiEPmI+ixBRSgsyUmNs/n0v+rf DEU63Xsa1Xfz4eDd2sXIfjD4rWsxcNyAWAPhdQDlCGfcEExf+PbCNgJczZiMdO5mAiD7 JFJea95ibfl231E212luhprgC9r7rsd9afzwexygnyAxDm3U+8qOq1neJ+O6nQI2MsO+ VeRg== 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=pKqQfrVJcKcU3ZYHnLUfBraKNSIcU7V0RaxaYm3S38c=; b=cSLBDgsCverrTdvUFdjpyON1HeJ8IABjr/Yn2BFiOmqInOHBTP8m6y9d/3DGca00t2 xjOPWtj4tNZNU/DbSLVWfZQRkRKY9zfQnniOr5UzJf0fY8nkLE/a8DRXiM/pT835LLpB LN/u57mMMb1rhbank3DU2N0oPHrpzxO8xtmH6FXMhj6pzfITW/FABp9/MWy58X6NVkH0 Ci6qEqMDwEPyRTnYTcIfbH17+ZI5kXYyNuq/iGh2bWojOdclCy99zKV240YWw35yVIhG HfIikt3bTP8ZwUSGKITe5F0hKDEjBIPZm8Gu55F/9lr6vAlfoQMF6zh9hUEIC3U2pXIK 38fA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=cQLaXduU; 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 g25si518343ejh.614.2020.11.19.13.28.17; Thu, 19 Nov 2020 13:28:41 -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=cQLaXduU; 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 S1726636AbgKSV0r (ORCPT + 99 others); Thu, 19 Nov 2020 16:26:47 -0500 Received: from mail2.protonmail.ch ([185.70.40.22]:10356 "EHLO mail2.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726567AbgKSV0r (ORCPT ); Thu, 19 Nov 2020 16:26:47 -0500 Date: Thu, 19 Nov 2020 21:26:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1605821204; bh=pKqQfrVJcKcU3ZYHnLUfBraKNSIcU7V0RaxaYm3S38c=; h=Date:To:From:Cc:Reply-To:Subject:From; b=cQLaXduUcxc5c/ZUKlv35V73fuNkB0kr5swYWPhTSth+/SWrNWNyGfoygppdi1udM FyYkBD79zy8wt8TDRJPnXS7T+5MyWWWHCaoj1pM5U5Q5KrSIsI827nFg7gybaepcyV kbwkzaeOmfqfa8TG6sAqhRxzKtpW0N6SCH7iRCIvtDDa/saArD3fodGtdLHyIt9P33 fF8+x3Zd1AxZDtBWxvau2usaqqOxHsjZPtyirQlVLWoSM4AUtVn+mj/Y/WUJwQhKxX 09X+AKx7xZKU+5UTEKFxQ4b3cbOfctiRmXwyaFt7+Yb8F3gk4H4Uz/1gPOjyeTCOmJ j/rhWl/i1pwNQ== 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 v2 pci-next] PCI: Keep both device name and resource name for config space remaps 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 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 --- 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