From: Bjorn Helgaas <helgaas@kernel.org>
To: Alexander Lobakin <alobakin@pm.me>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH pci-next] pci: remap: keep both device name and resource name for config space
Date: Thu, 19 Nov 2020 13:35:32 -0600 [thread overview]
Message-ID: <20201119193532.GA195197@bjorn-Precision-5520> (raw)
In-Reply-To: <JvyOzv8K8n5CCdP1xfLOdOWh4AbFrXdMMOEExr6em8@cp4-web-036.plabs.ch>
Please look at the git history and follow the subject line convention.
On Thu, Nov 19, 2020 at 07:04:42PM +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
> 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
Makes sense. I would remove the rest of this output from the commit
log since it isn't relevant and doesn't change.
> 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 <alobakin@pm.me>
> ---
> 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
>
>
prev parent reply other threads:[~2020-11-19 19:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-19 19:04 [PATCH pci-next] pci: remap: keep both device name and resource name for config space Alexander Lobakin
2020-11-19 19:35 ` Bjorn Helgaas [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201119193532.GA195197@bjorn-Precision-5520 \
--to=helgaas@kernel.org \
--cc=alobakin@pm.me \
--cc=bhelgaas@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox