ia64/linux-2.6.18-xen.hg

changeset 303:d827dfc6593e

merge with linux-2.6.18-xen.hg (staging)
author Alex Williamson <alex.williamson@hp.com>
date Thu Nov 01 09:07:45 2007 -0600 (2007-11-01)
parents b4ace76fb245 7df27803297a
children 98de2b149423
files
line diff
     1.1 --- a/drivers/pci/bus.c	Tue Oct 30 16:44:52 2007 -0600
     1.2 +++ b/drivers/pci/bus.c	Thu Nov 01 09:07:45 2007 -0600
     1.3 @@ -17,6 +17,8 @@
     1.4  
     1.5  #include "pci.h"
     1.6  
     1.7 +extern int pci_mem_align;
     1.8 +
     1.9  /**
    1.10   * pci_bus_alloc_resource - allocate a resource from a parent bus
    1.11   * @bus: PCI bus
    1.12 @@ -44,6 +46,11 @@ pci_bus_alloc_resource(struct pci_bus *b
    1.13  
    1.14  	type_mask |= IORESOURCE_IO | IORESOURCE_MEM;
    1.15  
    1.16 +	/* If the boot parameter 'pci-mem-align' was specified then we need to 
    1.17 +	   align the memory addresses, at page size alignment. */
    1.18 +	if (pci_mem_align && (align < (PAGE_SIZE-1)))
    1.19 +		align = PAGE_SIZE - 1;
    1.20 +
    1.21  	for (i = 0; i < PCI_BUS_NUM_RESOURCES; i++) {
    1.22  		struct resource *r = bus->resource[i];
    1.23  		if (!r)
     2.1 --- a/drivers/pci/quirks.c	Tue Oct 30 16:44:52 2007 -0600
     2.2 +++ b/drivers/pci/quirks.c	Thu Nov 01 09:07:45 2007 -0600
     2.3 @@ -23,6 +23,40 @@
     2.4  #include <linux/acpi.h>
     2.5  #include "pci.h"
     2.6  
     2.7 +/* A global flag which signals if we should page-align PCI mem windows. */
     2.8 +int pci_mem_align = 0;
     2.9 +
    2.10 +static int __init set_pci_mem_align(char *str)
    2.11 +{
    2.12 +	pci_mem_align = 1;
    2.13 +	return 1;
    2.14 +}
    2.15 +__setup("pci-mem-align", set_pci_mem_align);
    2.16 +
    2.17 +/* This quirk function enables us to force all memory resources which are 
    2.18 + * assigned to PCI devices, to be page-aligned.
    2.19 + */
    2.20 +static void __devinit quirk_align_mem_resources(struct pci_dev *dev)
    2.21 +{
    2.22 +	int i;
    2.23 +	struct resource *r;
    2.24 +	resource_size_t old_start;
    2.25 +
    2.26 +	if (!pci_mem_align)
    2.27 +		return;
    2.28 +
    2.29 +	for (i=0; i < DEVICE_COUNT_RESOURCE; i++) {
    2.30 +		r = &dev->resource[i];
    2.31 +		if ((r == NULL) || !(r->flags & IORESOURCE_MEM))
    2.32 +			continue;
    2.33 +
    2.34 +		old_start = r->start;
    2.35 +		r->start = (r->start + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1);
    2.36 +		r->end = r->end - (old_start - r->start);
    2.37 +	}
    2.38 +}
    2.39 +DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, quirk_align_mem_resources);
    2.40 +
    2.41  /* The Mellanox Tavor device gives false positive parity errors
    2.42   * Mark this device with a broken_parity_status, to allow
    2.43   * PCI scanning code to "skip" this now blacklisted device.
     3.1 --- a/drivers/xen/blkfront/vbd.c	Tue Oct 30 16:44:52 2007 -0600
     3.2 +++ b/drivers/xen/blkfront/vbd.c	Thu Nov 01 09:07:45 2007 -0600
     3.3 @@ -361,7 +361,7 @@ xlvbd_barrier(struct blkfront_info *info
     3.4  		info->feature_barrier ? QUEUE_ORDERED_DRAIN : QUEUE_ORDERED_NONE, NULL);
     3.5  	if (err)
     3.6  		return err;
     3.7 -	printk("blkfront: %s: barriers %s\n",
     3.8 +	printk(KERN_INFO "blkfront: %s: barriers %s\n",
     3.9  	       info->gd->disk_name, info->feature_barrier ? "enabled" : "disabled");
    3.10  	return 0;
    3.11  }
    3.12 @@ -369,7 +369,7 @@ xlvbd_barrier(struct blkfront_info *info
    3.13  int
    3.14  xlvbd_barrier(struct blkfront_info *info)
    3.15  {
    3.16 -	printk("blkfront: %s: barriers disabled\n", info->gd->disk_name);
    3.17 +	printk(KERN_INFO "blkfront: %s: barriers disabled\n", info->gd->disk_name);
    3.18  	return -ENOSYS;
    3.19  }
    3.20  #endif
     4.1 --- a/drivers/xen/core/xencomm.c	Tue Oct 30 16:44:52 2007 -0600
     4.2 +++ b/drivers/xen/core/xencomm.c	Thu Nov 01 09:07:45 2007 -0600
     4.3 @@ -27,6 +27,10 @@
     4.4  #include <asm/xen/xencomm.h>	/* for is_kern_addr() */
     4.5  #endif
     4.6  
     4.7 +#ifdef HAVE_XEN_PLATFORM_COMPAT_H
     4.8 +#include <xen/platform-compat.h>
     4.9 +#endif
    4.10 +
    4.11  static int xencomm_init(struct xencomm_desc *desc,
    4.12  			void *buffer, unsigned long bytes)
    4.13  {
     5.1 --- a/drivers/xen/netfront/netfront.c	Tue Oct 30 16:44:52 2007 -0600
     5.2 +++ b/drivers/xen/netfront/netfront.c	Thu Nov 01 09:07:45 2007 -0600
     5.3 @@ -221,7 +221,7 @@ static void netif_disconnect_backend(str
     5.4  static int network_connect(struct net_device *);
     5.5  static void network_tx_buf_gc(struct net_device *);
     5.6  static void network_alloc_rx_buffers(struct net_device *);
     5.7 -static int send_fake_arp(struct net_device *);
     5.8 +static void send_fake_arp(struct net_device *);
     5.9  
    5.10  static irqreturn_t netif_int(int irq, void *dev_id, struct pt_regs *ptregs);
    5.11  
    5.12 @@ -542,7 +542,7 @@ static void backend_changed(struct xenbu
    5.13  		if (network_connect(netdev) != 0)
    5.14  			break;
    5.15  		xenbus_switch_state(dev, XenbusStateConnected);
    5.16 -		(void)send_fake_arp(netdev);
    5.17 +		send_fake_arp(netdev);
    5.18  		break;
    5.19  
    5.20  	case XenbusStateClosing:
    5.21 @@ -557,8 +557,9 @@ static void backend_changed(struct xenbu
    5.22   * @param dev device
    5.23   * @return 0 on success, error code otherwise
    5.24   */
    5.25 -static int send_fake_arp(struct net_device *dev)
    5.26 +static void send_fake_arp(struct net_device *dev)
    5.27  {
    5.28 +#ifdef CONFIG_INET
    5.29  	struct sk_buff *skb;
    5.30  	u32             src_ip, dst_ip;
    5.31  
    5.32 @@ -567,16 +568,17 @@ static int send_fake_arp(struct net_devi
    5.33  
    5.34  	/* No IP? Then nothing to do. */
    5.35  	if (src_ip == 0)
    5.36 -		return 0;
    5.37 +		return;
    5.38  
    5.39  	skb = arp_create(ARPOP_REPLY, ETH_P_ARP,
    5.40  			 dst_ip, dev, src_ip,
    5.41  			 /*dst_hw*/ NULL, /*src_hw*/ NULL,
    5.42  			 /*target_hw*/ dev->dev_addr);
    5.43  	if (skb == NULL)
    5.44 -		return -ENOMEM;
    5.45 +		return;
    5.46  
    5.47 -	return dev_queue_xmit(skb);
    5.48 +	dev_queue_xmit(skb);
    5.49 +#endif
    5.50  }
    5.51  
    5.52  static inline int netfront_tx_slot_available(struct netfront_info *np)
    5.53 @@ -2098,6 +2100,7 @@ static struct net_device * __devinit cre
    5.54  	return ERR_PTR(err);
    5.55  }
    5.56  
    5.57 +#ifdef CONFIG_INET
    5.58  /*
    5.59   * We use this notifier to send out a fake ARP reply to reset switches and
    5.60   * router ARP caches when an IP interface is brought up on a VIF.
    5.61 @@ -2110,11 +2113,18 @@ inetdev_notify(struct notifier_block *th
    5.62  
    5.63  	/* UP event and is it one of our devices? */
    5.64  	if (event == NETDEV_UP && dev->open == network_open)
    5.65 -		(void)send_fake_arp(dev);
    5.66 +		send_fake_arp(dev);
    5.67  
    5.68  	return NOTIFY_DONE;
    5.69  }
    5.70  
    5.71 +static struct notifier_block notifier_inetdev = {
    5.72 +	.notifier_call  = inetdev_notify,
    5.73 +	.next           = NULL,
    5.74 +	.priority       = 0
    5.75 +};
    5.76 +#endif
    5.77 +
    5.78  
    5.79  static void netif_disconnect_backend(struct netfront_info *info)
    5.80  {
    5.81 @@ -2168,12 +2178,6 @@ static struct xenbus_driver netfront = {
    5.82  };
    5.83  
    5.84  
    5.85 -static struct notifier_block notifier_inetdev = {
    5.86 -	.notifier_call  = inetdev_notify,
    5.87 -	.next           = NULL,
    5.88 -	.priority       = 0
    5.89 -};
    5.90 -
    5.91  static int __init netif_init(void)
    5.92  {
    5.93  	if (!is_running_on_xen())
    5.94 @@ -2196,7 +2200,9 @@ static int __init netif_init(void)
    5.95  
    5.96  	IPRINTK("Initialising virtual ethernet driver.\n");
    5.97  
    5.98 +#ifdef CONFIG_INET
    5.99  	(void)register_inetaddr_notifier(&notifier_inetdev);
   5.100 +#endif
   5.101  
   5.102  	return xenbus_register_frontend(&netfront);
   5.103  }
   5.104 @@ -2208,7 +2214,9 @@ static void __exit netif_exit(void)
   5.105  	if (is_initial_xendomain())
   5.106  		return;
   5.107  
   5.108 +#ifdef CONFIG_INET
   5.109  	unregister_inetaddr_notifier(&notifier_inetdev);
   5.110 +#endif
   5.111  
   5.112  	netif_exit_accel();
   5.113