]> xenbits.xensource.com Git - legacy/linux-2.6.18-xen.git/commitdiff
pci: Do not disable I/O decoding on reassigning resource.
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 6 Apr 2009 12:47:27 +0000 (13:47 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 6 Apr 2009 12:47:27 +0000 (13:47 +0100)
When I reserve UHCI for guest domain with "guestdev=" and
"reassign_resources" parameters, spurious interrupts occurred.
The reason is that UHCI is not reset by uhci_check_and_reset_hc
because I/O decoding is disabled. UHCI keeps asserting the interrupt
line. As a result spurious interrupts occur.

The patch does not disable I/O decoding. It disables only memory
decoding. So UHCI is reset and spurious interrupts do not occur.

Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
drivers/pci/quirks.c

index 027d8f0180f9994990f11d4c1fb9e918a633a608..1f7cfda389c4abbbb6f71f9035428a7c47d98fc1 100644 (file)
 
 #ifdef CONFIG_PCI_REASSIGN
 /*
- * This quirk function disables the device and releases resources
- * which is specified by kernel's boot parameter 'reassigndev'.
+ * This quirk function disables memory decoding and releases memory 
+ * resources which is specified by kernel's boot parameter 'reassigndev'.
  * Later on, kernel will assign page-aligned memory resource back
- * to that device.
+ * to the device.
  */
 static void __devinit quirk_release_resources(struct pci_dev *dev)
 {
        int i;
        struct resource *r;
+       u16 command;
 
        if (pci_is_reassigndev(dev)) {
                if (dev->hdr_type == PCI_HEADER_TYPE_NORMAL &&
@@ -43,9 +44,11 @@ static void __devinit quirk_release_resources(struct pci_dev *dev)
                        return;
                }
                printk(KERN_INFO 
-                       "PCI: Disable device and release resources [%s].\n",
+                       "PCI: Disable memory decoding and release memory resources [%s].\n",
                        pci_name(dev));
-               pci_disable_device(dev);
+               pci_read_config_word(dev, PCI_COMMAND, &command);
+               command &= ~PCI_COMMAND_MEMORY;
+               pci_write_config_word(dev, PCI_COMMAND, command);
 
                for (i=0; i < PCI_NUM_RESOURCES; i++) {
                        r = &dev->resource[i];