ia64/linux-2.6.18-xen.hg

changeset 852:571229e265e2

pci: Do not disable I/O decoding on reassigning resource.

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>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Apr 06 13:47:27 2009 +0100 (2009-04-06)
parents 67a7ffcc5067
children 711e402bc141
files drivers/pci/quirks.c
line diff
     1.1 --- a/drivers/pci/quirks.c	Wed Apr 01 11:43:01 2009 +0100
     1.2 +++ b/drivers/pci/quirks.c	Mon Apr 06 13:47:27 2009 +0100
     1.3 @@ -26,15 +26,16 @@
     1.4  
     1.5  #ifdef CONFIG_PCI_REASSIGN
     1.6  /*
     1.7 - * This quirk function disables the device and releases resources
     1.8 - * which is specified by kernel's boot parameter 'reassigndev'.
     1.9 + * This quirk function disables memory decoding and releases memory 
    1.10 + * resources which is specified by kernel's boot parameter 'reassigndev'.
    1.11   * Later on, kernel will assign page-aligned memory resource back
    1.12 - * to that device.
    1.13 + * to the device.
    1.14   */
    1.15  static void __devinit quirk_release_resources(struct pci_dev *dev)
    1.16  {
    1.17  	int i;
    1.18  	struct resource *r;
    1.19 +	u16 command;
    1.20  
    1.21  	if (pci_is_reassigndev(dev)) {
    1.22  		if (dev->hdr_type == PCI_HEADER_TYPE_NORMAL &&
    1.23 @@ -43,9 +44,11 @@ static void __devinit quirk_release_reso
    1.24  			return;
    1.25  		}
    1.26  		printk(KERN_INFO 
    1.27 -			"PCI: Disable device and release resources [%s].\n",
    1.28 +			"PCI: Disable memory decoding and release memory resources [%s].\n",
    1.29  			pci_name(dev));
    1.30 -		pci_disable_device(dev);
    1.31 +		pci_read_config_word(dev, PCI_COMMAND, &command);
    1.32 +		command &= ~PCI_COMMAND_MEMORY;
    1.33 +		pci_write_config_word(dev, PCI_COMMAND, command);
    1.34  
    1.35  		for (i=0; i < PCI_NUM_RESOURCES; i++) {
    1.36  			r = &dev->resource[i];