hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/pci/xen-pcifront.c
....@@ -22,6 +22,7 @@
2222 #include <linux/bitops.h>
2323 #include <linux/time.h>
2424 #include <linux/ktime.h>
25
+#include <linux/swiotlb.h>
2526 #include <xen/platform_pci.h>
2627
2728 #include <asm/xen/swiotlb-xen.h>
....@@ -76,9 +77,6 @@
7677
7778 static DEFINE_SPINLOCK(pcifront_dev_lock);
7879 static struct pcifront_device *pcifront_dev;
79
-
80
-static int verbose_request;
81
-module_param(verbose_request, int, 0644);
8280
8381 static int errno_to_pcibios_err(int errno)
8482 {
....@@ -190,18 +188,16 @@
190188 struct pcifront_sd *sd = bus->sysdata;
191189 struct pcifront_device *pdev = pcifront_get_pdev(sd);
192190
193
- if (verbose_request)
194
- dev_info(&pdev->xdev->dev,
195
- "read dev=%04x:%02x:%02x.%d - offset %x size %d\n",
196
- pci_domain_nr(bus), bus->number, PCI_SLOT(devfn),
197
- PCI_FUNC(devfn), where, size);
191
+ dev_dbg(&pdev->xdev->dev,
192
+ "read dev=%04x:%02x:%02x.%d - offset %x size %d\n",
193
+ pci_domain_nr(bus), bus->number, PCI_SLOT(devfn),
194
+ PCI_FUNC(devfn), where, size);
198195
199196 err = do_pci_op(pdev, &op);
200197
201198 if (likely(!err)) {
202
- if (verbose_request)
203
- dev_info(&pdev->xdev->dev, "read got back value %x\n",
204
- op.value);
199
+ dev_dbg(&pdev->xdev->dev, "read got back value %x\n",
200
+ op.value);
205201
206202 *val = op.value;
207203 } else if (err == -ENODEV) {
....@@ -229,12 +225,10 @@
229225 struct pcifront_sd *sd = bus->sysdata;
230226 struct pcifront_device *pdev = pcifront_get_pdev(sd);
231227
232
- if (verbose_request)
233
- dev_info(&pdev->xdev->dev,
234
- "write dev=%04x:%02x:%02x.%d - "
235
- "offset %x size %d val %x\n",
236
- pci_domain_nr(bus), bus->number,
237
- PCI_SLOT(devfn), PCI_FUNC(devfn), where, size, val);
228
+ dev_dbg(&pdev->xdev->dev,
229
+ "write dev=%04x:%02x:%02x.%d - offset %x size %d val %x\n",
230
+ pci_domain_nr(bus), bus->number,
231
+ PCI_SLOT(devfn), PCI_FUNC(devfn), where, size, val);
238232
239233 return errno_to_pcibios_err(do_pci_op(pdev, &op));
240234 }
....@@ -291,8 +285,7 @@
291285 vector[i] = op.msix_entries[i].vector;
292286 }
293287 } else {
294
- printk(KERN_DEBUG "enable msix get value %x\n",
295
- op.value);
288
+ pr_info("enable msix get value %x\n", op.value);
296289 err = op.value;
297290 }
298291 } else {
....@@ -364,12 +357,12 @@
364357 err = do_pci_op(pdev, &op);
365358 if (err == XEN_PCI_ERR_dev_not_found) {
366359 /* XXX No response from backend, what shall we do? */
367
- printk(KERN_DEBUG "get no response from backend for disable MSI\n");
360
+ pr_info("get no response from backend for disable MSI\n");
368361 return;
369362 }
370363 if (err)
371364 /* how can pciback notify us fail? */
372
- printk(KERN_DEBUG "get fake response frombackend\n");
365
+ pr_info("get fake response from backend\n");
373366 }
374367
375368 static struct xen_pci_frontend_ops pci_frontend_ops = {
....@@ -1104,7 +1097,7 @@
11041097 case XenbusStateClosed:
11051098 if (xdev->state == XenbusStateClosed)
11061099 break;
1107
- /* Missed the backend's CLOSING state -- fallthrough */
1100
+ fallthrough; /* Missed the backend's CLOSING state */
11081101 case XenbusStateClosing:
11091102 dev_warn(&xdev->dev, "backend going away!\n");
11101103 pcifront_try_disconnect(pdev);