powerpc/eeh_cache: Add pr_debug() prints for insert/remove
authorOliver O'Halloran <oohall@gmail.com>
Fri, 15 Feb 2019 00:48:12 +0000 (11:48 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 21 Feb 2019 13:10:14 +0000 (00:10 +1100)
The EEH address cache is used to map a physical MMIO address back to a PCI
device. It's useful to know when it's being manipulated, but currently this
requires recompiling with #define DEBUG set. This is pointless since we
have dynamic_debug nowdays, so remove the #ifdef guard and add a pr_debug()
for the remove case too.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Reviewed-by: Sam Bobroff <sbobroff@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/eeh_cache.c

index 201943d54a6ece9a022023e01e7453521e030fb3..b2c320e0fcef80e9df8b5e5ccb55aa0c336a380c 100644 (file)
@@ -157,10 +157,8 @@ eeh_addr_cache_insert(struct pci_dev *dev, resource_size_t alo,
        piar->pcidev = dev;
        piar->flags = flags;
 
-#ifdef DEBUG
        pr_debug("PIAR: insert range=[%pap:%pap] dev=%s\n",
                 &alo, &ahi, pci_name(dev));
-#endif
 
        rb_link_node(&piar->rb_node, parent, p);
        rb_insert_color(&piar->rb_node, &pci_io_addr_cache_root.rb_root);
@@ -240,6 +238,8 @@ restart:
                piar = rb_entry(n, struct pci_io_addr_range, rb_node);
 
                if (piar->pcidev == dev) {
+                       pr_debug("PIAR: remove range=[%pap:%pap] dev=%s\n",
+                                &piar->addr_lo, &piar->addr_hi, pci_name(dev));
                        rb_erase(n, &pci_io_addr_cache_root.rb_root);
                        kfree(piar);
                        goto restart;