[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171129225708.32271.35467.stgit@bhelgaas-glaptop.roam.corp.google.com>
Date: Wed, 29 Nov 2017 16:57:08 -0600
From: Bjorn Helgaas <helgaas@...nel.org>
To: linux-pci@...r.kernel.org
Cc: Dave Jones <davej@...emonkey.org.uk>,
Fengguang Wu <fengguang.wu@...el.com>,
linux-kernel@...r.kernel.org, David Woodhouse <dwmw@...zon.co.uk>
Subject: [PATCH] PCI: Tone down resource mmap warning
From: Bjorn Helgaas <bhelgaas@...gle.com>
When a process tries to mmap more space than is available in a PCI BAR, we
emit a warning and a backtrace. The mmap fails anyway, so the backtrace is
mainly for debugging. It seems like overkill now, so reduce this to a
dev_info() and remove the backtrace.
This was added by b5ff7df3df9e ("Check mapped ranges on sysfs resource
files").
Reported-by: Fengguang Wu <fengguang.wu@...el.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@...gle.com>
---
drivers/pci/pci-sysfs.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index 06c7f0b85cd2..97f071674605 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -1217,11 +1217,9 @@ static int pci_mmap_resource(struct kobject *kobj, struct bin_attribute *attr,
return -EINVAL;
if (!pci_mmap_fits(pdev, bar, vma, PCI_MMAP_SYSFS)) {
- WARN(1, "process \"%s\" tried to map 0x%08lx bytes at page 0x%08lx on %s BAR %d (start 0x%16Lx, size 0x%16Lx)\n",
+ dev_info(&pdev->dev, "process \"%s\" tried to map 0x%lx bytes at page 0x%lx of BAR %d %pR\n",
current->comm, vma->vm_end-vma->vm_start, vma->vm_pgoff,
- pci_name(pdev), bar,
- (u64)pci_resource_start(pdev, bar),
- (u64)pci_resource_len(pdev, bar));
+ bar, res);
return -EINVAL;
}
mmap_type = res->flags & IORESOURCE_MEM ? pci_mmap_mem : pci_mmap_io;
Powered by blists - more mailing lists