| .. | .. |
|---|
| 6 | 6 | */ |
|---|
| 7 | 7 | |
|---|
| 8 | 8 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
|---|
| 9 | +#define dev_fmt pr_fmt |
|---|
| 9 | 10 | |
|---|
| 10 | 11 | #include <linux/moduleparam.h> |
|---|
| 11 | 12 | #include <linux/wait.h> |
|---|
| .. | .. |
|---|
| 13 | 14 | #include <xen/events.h> |
|---|
| 14 | 15 | #include <linux/sched.h> |
|---|
| 15 | 16 | #include "pciback.h" |
|---|
| 16 | | - |
|---|
| 17 | | -int verbose_request; |
|---|
| 18 | | -module_param(verbose_request, int, 0644); |
|---|
| 19 | 17 | |
|---|
| 20 | 18 | static irqreturn_t xen_pcibk_guest_interrupt(int irq, void *dev_id); |
|---|
| 21 | 19 | |
|---|
| .. | .. |
|---|
| 147 | 145 | struct xen_pcibk_dev_data *dev_data; |
|---|
| 148 | 146 | int status; |
|---|
| 149 | 147 | |
|---|
| 150 | | - if (unlikely(verbose_request)) |
|---|
| 151 | | - printk(KERN_DEBUG DRV_NAME ": %s: enable MSI\n", pci_name(dev)); |
|---|
| 152 | | - |
|---|
| 153 | 148 | if (dev->msi_enabled) |
|---|
| 154 | 149 | status = -EALREADY; |
|---|
| 155 | 150 | else if (dev->msix_enabled) |
|---|
| .. | .. |
|---|
| 158 | 153 | status = pci_enable_msi(dev); |
|---|
| 159 | 154 | |
|---|
| 160 | 155 | if (status) { |
|---|
| 161 | | - pr_warn_ratelimited("%s: error enabling MSI for guest %u: err %d\n", |
|---|
| 162 | | - pci_name(dev), pdev->xdev->otherend_id, |
|---|
| 163 | | - status); |
|---|
| 156 | + dev_warn_ratelimited(&dev->dev, "error enabling MSI for guest %u: err %d\n", |
|---|
| 157 | + pdev->xdev->otherend_id, status); |
|---|
| 164 | 158 | op->value = 0; |
|---|
| 165 | 159 | return XEN_PCI_ERR_op_failed; |
|---|
| 166 | 160 | } |
|---|
| .. | .. |
|---|
| 169 | 163 | * the local domain's IRQ number. */ |
|---|
| 170 | 164 | |
|---|
| 171 | 165 | op->value = dev->irq ? xen_pirq_from_irq(dev->irq) : 0; |
|---|
| 172 | | - if (unlikely(verbose_request)) |
|---|
| 173 | | - printk(KERN_DEBUG DRV_NAME ": %s: MSI: %d\n", pci_name(dev), |
|---|
| 174 | | - op->value); |
|---|
| 166 | + |
|---|
| 167 | + dev_dbg(&dev->dev, "MSI: %d\n", op->value); |
|---|
| 175 | 168 | |
|---|
| 176 | 169 | dev_data = pci_get_drvdata(dev); |
|---|
| 177 | 170 | if (dev_data) |
|---|
| .. | .. |
|---|
| 184 | 177 | int xen_pcibk_disable_msi(struct xen_pcibk_device *pdev, |
|---|
| 185 | 178 | struct pci_dev *dev, struct xen_pci_op *op) |
|---|
| 186 | 179 | { |
|---|
| 187 | | - if (unlikely(verbose_request)) |
|---|
| 188 | | - printk(KERN_DEBUG DRV_NAME ": %s: disable MSI\n", |
|---|
| 189 | | - pci_name(dev)); |
|---|
| 190 | | - |
|---|
| 191 | 180 | if (dev->msi_enabled) { |
|---|
| 192 | 181 | struct xen_pcibk_dev_data *dev_data; |
|---|
| 193 | 182 | |
|---|
| .. | .. |
|---|
| 198 | 187 | dev_data->ack_intr = 1; |
|---|
| 199 | 188 | } |
|---|
| 200 | 189 | op->value = dev->irq ? xen_pirq_from_irq(dev->irq) : 0; |
|---|
| 201 | | - if (unlikely(verbose_request)) |
|---|
| 202 | | - printk(KERN_DEBUG DRV_NAME ": %s: MSI: %d\n", pci_name(dev), |
|---|
| 203 | | - op->value); |
|---|
| 190 | + |
|---|
| 191 | + dev_dbg(&dev->dev, "MSI: %d\n", op->value); |
|---|
| 192 | + |
|---|
| 204 | 193 | return 0; |
|---|
| 205 | 194 | } |
|---|
| 206 | 195 | |
|---|
| .. | .. |
|---|
| 213 | 202 | struct msix_entry *entries; |
|---|
| 214 | 203 | u16 cmd; |
|---|
| 215 | 204 | |
|---|
| 216 | | - if (unlikely(verbose_request)) |
|---|
| 217 | | - printk(KERN_DEBUG DRV_NAME ": %s: enable MSI-X\n", |
|---|
| 218 | | - pci_name(dev)); |
|---|
| 205 | + dev_dbg(&dev->dev, "enable MSI-X\n"); |
|---|
| 219 | 206 | |
|---|
| 220 | 207 | if (op->value > SH_INFO_MAX_VEC) |
|---|
| 221 | 208 | return -EINVAL; |
|---|
| .. | .. |
|---|
| 248 | 235 | if (entries[i].vector) { |
|---|
| 249 | 236 | op->msix_entries[i].vector = |
|---|
| 250 | 237 | xen_pirq_from_irq(entries[i].vector); |
|---|
| 251 | | - if (unlikely(verbose_request)) |
|---|
| 252 | | - printk(KERN_DEBUG DRV_NAME ": %s: " \ |
|---|
| 253 | | - "MSI-X[%d]: %d\n", |
|---|
| 254 | | - pci_name(dev), i, |
|---|
| 255 | | - op->msix_entries[i].vector); |
|---|
| 238 | + dev_dbg(&dev->dev, "MSI-X[%d]: %d\n", i, |
|---|
| 239 | + op->msix_entries[i].vector); |
|---|
| 256 | 240 | } |
|---|
| 257 | 241 | } |
|---|
| 258 | 242 | } else |
|---|
| 259 | | - pr_warn_ratelimited("%s: error enabling MSI-X for guest %u: err %d!\n", |
|---|
| 260 | | - pci_name(dev), pdev->xdev->otherend_id, |
|---|
| 261 | | - result); |
|---|
| 243 | + dev_warn_ratelimited(&dev->dev, "error enabling MSI-X for guest %u: err %d!\n", |
|---|
| 244 | + pdev->xdev->otherend_id, result); |
|---|
| 262 | 245 | kfree(entries); |
|---|
| 263 | 246 | |
|---|
| 264 | 247 | op->value = result; |
|---|
| .. | .. |
|---|
| 273 | 256 | int xen_pcibk_disable_msix(struct xen_pcibk_device *pdev, |
|---|
| 274 | 257 | struct pci_dev *dev, struct xen_pci_op *op) |
|---|
| 275 | 258 | { |
|---|
| 276 | | - if (unlikely(verbose_request)) |
|---|
| 277 | | - printk(KERN_DEBUG DRV_NAME ": %s: disable MSI-X\n", |
|---|
| 278 | | - pci_name(dev)); |
|---|
| 279 | | - |
|---|
| 280 | 259 | if (dev->msix_enabled) { |
|---|
| 281 | 260 | struct xen_pcibk_dev_data *dev_data; |
|---|
| 282 | 261 | |
|---|
| .. | .. |
|---|
| 291 | 270 | * an undefined IRQ value of zero. |
|---|
| 292 | 271 | */ |
|---|
| 293 | 272 | op->value = dev->irq ? xen_pirq_from_irq(dev->irq) : 0; |
|---|
| 294 | | - if (unlikely(verbose_request)) |
|---|
| 295 | | - printk(KERN_DEBUG DRV_NAME ": %s: MSI-X: %d\n", |
|---|
| 296 | | - pci_name(dev), op->value); |
|---|
| 273 | + |
|---|
| 274 | + dev_dbg(&dev->dev, "MSI-X: %d\n", op->value); |
|---|
| 275 | + |
|---|
| 297 | 276 | return 0; |
|---|
| 298 | 277 | } |
|---|
| 299 | 278 | #endif |
|---|
| .. | .. |
|---|
| 452 | 431 | dev_data->handled++; |
|---|
| 453 | 432 | if ((dev_data->handled % 1000) == 0) { |
|---|
| 454 | 433 | if (xen_test_irq_shared(irq)) { |
|---|
| 455 | | - pr_info("%s IRQ line is not shared " |
|---|
| 434 | + dev_info(&dev->dev, "%s IRQ line is not shared " |
|---|
| 456 | 435 | "with other domains. Turning ISR off\n", |
|---|
| 457 | 436 | dev_data->irq_name); |
|---|
| 458 | 437 | dev_data->ack_intr = 0; |
|---|