Commit 4969a3a2 authored by Boris Ostrovsky's avatar Boris Ostrovsky

xen/pci: Get rid of verbose_request and use dev_dbg() instead

Information printed under verbose_request is clearly used for debugging
only. Remove it and use dev_dbg() instead.
Signed-off-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
Link: https://lore.kernel.org/r/1590719092-8578-1-git-send-email-boris.ostrovsky@oracle.comReviewed-by: default avatarJuergen Gross <jgross@suse.com>
Signed-off-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
parent 64b3eaf3
...@@ -77,9 +77,6 @@ static inline void pcifront_init_sd(struct pcifront_sd *sd, ...@@ -77,9 +77,6 @@ static inline void pcifront_init_sd(struct pcifront_sd *sd,
static DEFINE_SPINLOCK(pcifront_dev_lock); static DEFINE_SPINLOCK(pcifront_dev_lock);
static struct pcifront_device *pcifront_dev; static struct pcifront_device *pcifront_dev;
static int verbose_request;
module_param(verbose_request, int, 0644);
static int errno_to_pcibios_err(int errno) static int errno_to_pcibios_err(int errno)
{ {
switch (errno) { switch (errno) {
...@@ -190,8 +187,7 @@ static int pcifront_bus_read(struct pci_bus *bus, unsigned int devfn, ...@@ -190,8 +187,7 @@ static int pcifront_bus_read(struct pci_bus *bus, unsigned int devfn,
struct pcifront_sd *sd = bus->sysdata; struct pcifront_sd *sd = bus->sysdata;
struct pcifront_device *pdev = pcifront_get_pdev(sd); struct pcifront_device *pdev = pcifront_get_pdev(sd);
if (verbose_request) dev_dbg(&pdev->xdev->dev,
dev_info(&pdev->xdev->dev,
"read dev=%04x:%02x:%02x.%d - offset %x size %d\n", "read dev=%04x:%02x:%02x.%d - offset %x size %d\n",
pci_domain_nr(bus), bus->number, PCI_SLOT(devfn), pci_domain_nr(bus), bus->number, PCI_SLOT(devfn),
PCI_FUNC(devfn), where, size); PCI_FUNC(devfn), where, size);
...@@ -199,8 +195,7 @@ static int pcifront_bus_read(struct pci_bus *bus, unsigned int devfn, ...@@ -199,8 +195,7 @@ static int pcifront_bus_read(struct pci_bus *bus, unsigned int devfn,
err = do_pci_op(pdev, &op); err = do_pci_op(pdev, &op);
if (likely(!err)) { if (likely(!err)) {
if (verbose_request) dev_dbg(&pdev->xdev->dev, "read got back value %x\n",
dev_info(&pdev->xdev->dev, "read got back value %x\n",
op.value); op.value);
*val = op.value; *val = op.value;
...@@ -229,10 +224,8 @@ static int pcifront_bus_write(struct pci_bus *bus, unsigned int devfn, ...@@ -229,10 +224,8 @@ static int pcifront_bus_write(struct pci_bus *bus, unsigned int devfn,
struct pcifront_sd *sd = bus->sysdata; struct pcifront_sd *sd = bus->sysdata;
struct pcifront_device *pdev = pcifront_get_pdev(sd); struct pcifront_device *pdev = pcifront_get_pdev(sd);
if (verbose_request) dev_dbg(&pdev->xdev->dev,
dev_info(&pdev->xdev->dev, "write dev=%04x:%02x:%02x.%d - offset %x size %d val %x\n",
"write dev=%04x:%02x:%02x.%d - "
"offset %x size %d val %x\n",
pci_domain_nr(bus), bus->number, pci_domain_nr(bus), bus->number,
PCI_SLOT(devfn), PCI_FUNC(devfn), where, size, val); PCI_SLOT(devfn), PCI_FUNC(devfn), where, size, val);
......
...@@ -156,9 +156,7 @@ int xen_pcibk_config_read(struct pci_dev *dev, int offset, int size, ...@@ -156,9 +156,7 @@ int xen_pcibk_config_read(struct pci_dev *dev, int offset, int size,
* (as if device didn't respond) */ * (as if device didn't respond) */
u32 value = 0, tmp_val; u32 value = 0, tmp_val;
if (unlikely(verbose_request)) dev_dbg(&dev->dev, "read %d bytes at 0x%x\n", size, offset);
dev_printk(KERN_DEBUG, &dev->dev, "read %d bytes at 0x%x\n",
size, offset);
if (!valid_request(offset, size)) { if (!valid_request(offset, size)) {
err = XEN_PCI_ERR_invalid_offset; err = XEN_PCI_ERR_invalid_offset;
...@@ -197,9 +195,7 @@ int xen_pcibk_config_read(struct pci_dev *dev, int offset, int size, ...@@ -197,9 +195,7 @@ int xen_pcibk_config_read(struct pci_dev *dev, int offset, int size,
} }
out: out:
if (unlikely(verbose_request)) dev_dbg(&dev->dev, "read %d bytes at 0x%x = %x\n", size, offset, value);
dev_printk(KERN_DEBUG, &dev->dev,
"read %d bytes at 0x%x = %x\n", size, offset, value);
*ret_val = value; *ret_val = value;
return xen_pcibios_err_to_errno(err); return xen_pcibios_err_to_errno(err);
...@@ -214,10 +210,8 @@ int xen_pcibk_config_write(struct pci_dev *dev, int offset, int size, u32 value) ...@@ -214,10 +210,8 @@ int xen_pcibk_config_write(struct pci_dev *dev, int offset, int size, u32 value)
u32 tmp_val; u32 tmp_val;
int field_start, field_end; int field_start, field_end;
if (unlikely(verbose_request)) dev_dbg(&dev->dev, "write request %d bytes at 0x%x = %x\n",
dev_printk(KERN_DEBUG, &dev->dev, size, offset, value);
"write request %d bytes at 0x%x = %x\n", size,
offset, value);
if (!valid_request(offset, size)) if (!valid_request(offset, size))
return XEN_PCI_ERR_invalid_offset; return XEN_PCI_ERR_invalid_offset;
......
...@@ -68,36 +68,30 @@ static int command_write(struct pci_dev *dev, int offset, u16 value, void *data) ...@@ -68,36 +68,30 @@ static int command_write(struct pci_dev *dev, int offset, u16 value, void *data)
dev_data = pci_get_drvdata(dev); dev_data = pci_get_drvdata(dev);
if (!pci_is_enabled(dev) && is_enable_cmd(value)) { if (!pci_is_enabled(dev) && is_enable_cmd(value)) {
if (unlikely(verbose_request)) dev_dbg(&dev->dev, "enable\n");
dev_printk(KERN_DEBUG, &dev->dev, "enable\n");
err = pci_enable_device(dev); err = pci_enable_device(dev);
if (err) if (err)
return err; return err;
if (dev_data) if (dev_data)
dev_data->enable_intx = 1; dev_data->enable_intx = 1;
} else if (pci_is_enabled(dev) && !is_enable_cmd(value)) { } else if (pci_is_enabled(dev) && !is_enable_cmd(value)) {
if (unlikely(verbose_request)) dev_dbg(&dev->dev, "disable\n");
dev_printk(KERN_DEBUG, &dev->dev, "disable\n");
pci_disable_device(dev); pci_disable_device(dev);
if (dev_data) if (dev_data)
dev_data->enable_intx = 0; dev_data->enable_intx = 0;
} }
if (!dev->is_busmaster && is_master_cmd(value)) { if (!dev->is_busmaster && is_master_cmd(value)) {
if (unlikely(verbose_request)) dev_dbg(&dev->dev, "set bus master\n");
dev_printk(KERN_DEBUG, &dev->dev, "set bus master\n");
pci_set_master(dev); pci_set_master(dev);
} else if (dev->is_busmaster && !is_master_cmd(value)) { } else if (dev->is_busmaster && !is_master_cmd(value)) {
if (unlikely(verbose_request)) dev_dbg(&dev->dev, "clear bus master\n");
dev_printk(KERN_DEBUG, &dev->dev, "clear bus master\n");
pci_clear_master(dev); pci_clear_master(dev);
} }
if (!(cmd->val & PCI_COMMAND_INVALIDATE) && if (!(cmd->val & PCI_COMMAND_INVALIDATE) &&
(value & PCI_COMMAND_INVALIDATE)) { (value & PCI_COMMAND_INVALIDATE)) {
if (unlikely(verbose_request)) dev_dbg(&dev->dev, "enable memory-write-invalidate\n");
dev_printk(KERN_DEBUG, &dev->dev,
"enable memory-write-invalidate\n");
err = pci_set_mwi(dev); err = pci_set_mwi(dev);
if (err) { if (err) {
dev_warn(&dev->dev, "cannot enable memory-write-invalidate (%d)\n", dev_warn(&dev->dev, "cannot enable memory-write-invalidate (%d)\n",
...@@ -106,9 +100,7 @@ static int command_write(struct pci_dev *dev, int offset, u16 value, void *data) ...@@ -106,9 +100,7 @@ static int command_write(struct pci_dev *dev, int offset, u16 value, void *data)
} }
} else if ((cmd->val & PCI_COMMAND_INVALIDATE) && } else if ((cmd->val & PCI_COMMAND_INVALIDATE) &&
!(value & PCI_COMMAND_INVALIDATE)) { !(value & PCI_COMMAND_INVALIDATE)) {
if (unlikely(verbose_request)) dev_dbg(&dev->dev, "disable memory-write-invalidate\n");
dev_printk(KERN_DEBUG, &dev->dev,
"disable memory-write-invalidate\n");
pci_clear_mwi(dev); pci_clear_mwi(dev);
} }
......
...@@ -186,8 +186,6 @@ void xen_pcibk_do_op(struct work_struct *data); ...@@ -186,8 +186,6 @@ void xen_pcibk_do_op(struct work_struct *data);
int xen_pcibk_xenbus_register(void); int xen_pcibk_xenbus_register(void);
void xen_pcibk_xenbus_unregister(void); void xen_pcibk_xenbus_unregister(void);
extern int verbose_request;
void xen_pcibk_test_and_schedule_op(struct xen_pcibk_device *pdev); void xen_pcibk_test_and_schedule_op(struct xen_pcibk_device *pdev);
#endif #endif
......
...@@ -15,9 +15,6 @@ ...@@ -15,9 +15,6 @@
#include <linux/sched.h> #include <linux/sched.h>
#include "pciback.h" #include "pciback.h"
int verbose_request;
module_param(verbose_request, int, 0644);
static irqreturn_t xen_pcibk_guest_interrupt(int irq, void *dev_id); static irqreturn_t xen_pcibk_guest_interrupt(int irq, void *dev_id);
/* Ensure a device is has the fake IRQ handler "turned on/off" and is /* Ensure a device is has the fake IRQ handler "turned on/off" and is
...@@ -148,9 +145,6 @@ int xen_pcibk_enable_msi(struct xen_pcibk_device *pdev, ...@@ -148,9 +145,6 @@ int xen_pcibk_enable_msi(struct xen_pcibk_device *pdev,
struct xen_pcibk_dev_data *dev_data; struct xen_pcibk_dev_data *dev_data;
int status; int status;
if (unlikely(verbose_request))
dev_printk(KERN_DEBUG, &dev->dev, "enable MSI\n");
if (dev->msi_enabled) if (dev->msi_enabled)
status = -EALREADY; status = -EALREADY;
else if (dev->msix_enabled) else if (dev->msix_enabled)
...@@ -169,8 +163,8 @@ int xen_pcibk_enable_msi(struct xen_pcibk_device *pdev, ...@@ -169,8 +163,8 @@ int xen_pcibk_enable_msi(struct xen_pcibk_device *pdev,
* the local domain's IRQ number. */ * the local domain's IRQ number. */
op->value = dev->irq ? xen_pirq_from_irq(dev->irq) : 0; op->value = dev->irq ? xen_pirq_from_irq(dev->irq) : 0;
if (unlikely(verbose_request))
dev_printk(KERN_DEBUG, &dev->dev, "MSI: %d\n", op->value); dev_dbg(&dev->dev, "MSI: %d\n", op->value);
dev_data = pci_get_drvdata(dev); dev_data = pci_get_drvdata(dev);
if (dev_data) if (dev_data)
...@@ -183,9 +177,6 @@ static ...@@ -183,9 +177,6 @@ static
int xen_pcibk_disable_msi(struct xen_pcibk_device *pdev, int xen_pcibk_disable_msi(struct xen_pcibk_device *pdev,
struct pci_dev *dev, struct xen_pci_op *op) struct pci_dev *dev, struct xen_pci_op *op)
{ {
if (unlikely(verbose_request))
dev_printk(KERN_DEBUG, &dev->dev, "disable MSI\n");
if (dev->msi_enabled) { if (dev->msi_enabled) {
struct xen_pcibk_dev_data *dev_data; struct xen_pcibk_dev_data *dev_data;
...@@ -196,8 +187,9 @@ int xen_pcibk_disable_msi(struct xen_pcibk_device *pdev, ...@@ -196,8 +187,9 @@ int xen_pcibk_disable_msi(struct xen_pcibk_device *pdev,
dev_data->ack_intr = 1; dev_data->ack_intr = 1;
} }
op->value = dev->irq ? xen_pirq_from_irq(dev->irq) : 0; op->value = dev->irq ? xen_pirq_from_irq(dev->irq) : 0;
if (unlikely(verbose_request))
dev_printk(KERN_DEBUG, &dev->dev, "MSI: %d\n", op->value); dev_dbg(&dev->dev, "MSI: %d\n", op->value);
return 0; return 0;
} }
...@@ -210,8 +202,7 @@ int xen_pcibk_enable_msix(struct xen_pcibk_device *pdev, ...@@ -210,8 +202,7 @@ int xen_pcibk_enable_msix(struct xen_pcibk_device *pdev,
struct msix_entry *entries; struct msix_entry *entries;
u16 cmd; u16 cmd;
if (unlikely(verbose_request)) dev_dbg(&dev->dev, "enable MSI-X\n");
dev_printk(KERN_DEBUG, &dev->dev, "enable MSI-X\n");
if (op->value > SH_INFO_MAX_VEC) if (op->value > SH_INFO_MAX_VEC)
return -EINVAL; return -EINVAL;
...@@ -244,9 +235,7 @@ int xen_pcibk_enable_msix(struct xen_pcibk_device *pdev, ...@@ -244,9 +235,7 @@ int xen_pcibk_enable_msix(struct xen_pcibk_device *pdev,
if (entries[i].vector) { if (entries[i].vector) {
op->msix_entries[i].vector = op->msix_entries[i].vector =
xen_pirq_from_irq(entries[i].vector); xen_pirq_from_irq(entries[i].vector);
if (unlikely(verbose_request)) dev_dbg(&dev->dev, "MSI-X[%d]: %d\n", i,
dev_printk(KERN_DEBUG, &dev->dev,
"MSI-X[%d]: %d\n", i,
op->msix_entries[i].vector); op->msix_entries[i].vector);
} }
} }
...@@ -267,9 +256,6 @@ static ...@@ -267,9 +256,6 @@ static
int xen_pcibk_disable_msix(struct xen_pcibk_device *pdev, int xen_pcibk_disable_msix(struct xen_pcibk_device *pdev,
struct pci_dev *dev, struct xen_pci_op *op) struct pci_dev *dev, struct xen_pci_op *op)
{ {
if (unlikely(verbose_request))
dev_printk(KERN_DEBUG, &dev->dev, "disable MSI-X\n");
if (dev->msix_enabled) { if (dev->msix_enabled) {
struct xen_pcibk_dev_data *dev_data; struct xen_pcibk_dev_data *dev_data;
...@@ -284,8 +270,9 @@ int xen_pcibk_disable_msix(struct xen_pcibk_device *pdev, ...@@ -284,8 +270,9 @@ int xen_pcibk_disable_msix(struct xen_pcibk_device *pdev,
* an undefined IRQ value of zero. * an undefined IRQ value of zero.
*/ */
op->value = dev->irq ? xen_pirq_from_irq(dev->irq) : 0; op->value = dev->irq ? xen_pirq_from_irq(dev->irq) : 0;
if (unlikely(verbose_request))
dev_printk(KERN_DEBUG, &dev->dev, "MSI-X: %d\n", op->value); dev_dbg(&dev->dev, "MSI-X: %d\n", op->value);
return 0; return 0;
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment