aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/mem.c2
-rw-r--r--drivers/net/xen-netfront.c19
-rw-r--r--drivers/pci/intel-iommu.c2
-rw-r--r--drivers/xen/events.c27
-rw-r--r--drivers/xen/manage.c10
5 files changed, 50 insertions, 10 deletions
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index 070e22e8ea9e..b6772d657547 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -80,7 +80,7 @@ static inline int valid_mmap_phys_addr_range(unsigned long pfn, size_t size)
80} 80}
81#endif 81#endif
82 82
83#ifdef CONFIG_NONPROMISC_DEVMEM 83#ifdef CONFIG_STRICT_DEVMEM
84static inline int range_is_allowed(unsigned long pfn, unsigned long size) 84static inline int range_is_allowed(unsigned long pfn, unsigned long size)
85{ 85{
86 u64 from = ((u64)pfn) << PAGE_SHIFT; 86 u64 from = ((u64)pfn) << PAGE_SHIFT;
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index ef671d1a3bf0..902bbe788215 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -92,7 +92,7 @@ struct netfront_info {
92 */ 92 */
93 union skb_entry { 93 union skb_entry {
94 struct sk_buff *skb; 94 struct sk_buff *skb;
95 unsigned link; 95 unsigned long link;
96 } tx_skbs[NET_TX_RING_SIZE]; 96 } tx_skbs[NET_TX_RING_SIZE];
97 grant_ref_t gref_tx_head; 97 grant_ref_t gref_tx_head;
98 grant_ref_t grant_tx_ref[NET_TX_RING_SIZE]; 98 grant_ref_t grant_tx_ref[NET_TX_RING_SIZE];
@@ -125,6 +125,17 @@ struct netfront_rx_info {
125 struct xen_netif_extra_info extras[XEN_NETIF_EXTRA_TYPE_MAX - 1]; 125 struct xen_netif_extra_info extras[XEN_NETIF_EXTRA_TYPE_MAX - 1];
126}; 126};
127 127
128static void skb_entry_set_link(union skb_entry *list, unsigned short id)
129{
130 list->link = id;
131}
132
133static int skb_entry_is_link(const union skb_entry *list)
134{
135 BUILD_BUG_ON(sizeof(list->skb) != sizeof(list->link));
136 return ((unsigned long)list->skb < PAGE_OFFSET);
137}
138
128/* 139/*
129 * Access macros for acquiring freeing slots in tx_skbs[]. 140 * Access macros for acquiring freeing slots in tx_skbs[].
130 */ 141 */
@@ -132,7 +143,7 @@ struct netfront_rx_info {
132static void add_id_to_freelist(unsigned *head, union skb_entry *list, 143static void add_id_to_freelist(unsigned *head, union skb_entry *list,
133 unsigned short id) 144 unsigned short id)
134{ 145{
135 list[id].link = *head; 146 skb_entry_set_link(&list[id], *head);
136 *head = id; 147 *head = id;
137} 148}
138 149
@@ -993,7 +1004,7 @@ static void xennet_release_tx_bufs(struct netfront_info *np)
993 1004
994 for (i = 0; i < NET_TX_RING_SIZE; i++) { 1005 for (i = 0; i < NET_TX_RING_SIZE; i++) {
995 /* Skip over entries which are actually freelist references */ 1006 /* Skip over entries which are actually freelist references */
996 if ((unsigned long)np->tx_skbs[i].skb < PAGE_OFFSET) 1007 if (skb_entry_is_link(&np->tx_skbs[i]))
997 continue; 1008 continue;
998 1009
999 skb = np->tx_skbs[i].skb; 1010 skb = np->tx_skbs[i].skb;
@@ -1123,7 +1134,7 @@ static struct net_device * __devinit xennet_create_dev(struct xenbus_device *dev
1123 /* Initialise tx_skbs as a free chain containing every entry. */ 1134 /* Initialise tx_skbs as a free chain containing every entry. */
1124 np->tx_skb_freelist = 0; 1135 np->tx_skb_freelist = 0;
1125 for (i = 0; i < NET_TX_RING_SIZE; i++) { 1136 for (i = 0; i < NET_TX_RING_SIZE; i++) {
1126 np->tx_skbs[i].link = i+1; 1137 skb_entry_set_link(&np->tx_skbs[i], i+1);
1127 np->grant_tx_ref[i] = GRANT_INVALID_REF; 1138 np->grant_tx_ref[i] = GRANT_INVALID_REF;
1128 } 1139 }
1129 1140
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
index 3f7b81c065d2..8d0e60ac849c 100644
--- a/drivers/pci/intel-iommu.c
+++ b/drivers/pci/intel-iommu.c
@@ -37,7 +37,7 @@
37#include "intel-iommu.h" 37#include "intel-iommu.h"
38#include <asm/proto.h> /* force_iommu in this header in x86-64*/ 38#include <asm/proto.h> /* force_iommu in this header in x86-64*/
39#include <asm/cacheflush.h> 39#include <asm/cacheflush.h>
40#include <asm/gart.h> 40#include <asm/iommu.h>
41#include "pci.h" 41#include "pci.h"
42 42
43#define IS_GFX_DEVICE(pdev) ((pdev->class >> 16) == PCI_BASE_CLASS_DISPLAY) 43#define IS_GFX_DEVICE(pdev) ((pdev->class >> 16) == PCI_BASE_CLASS_DISPLAY)
diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index 332dd63750a0..0e0c28574af8 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -734,6 +734,33 @@ static void restore_cpu_ipis(unsigned int cpu)
734 } 734 }
735} 735}
736 736
737/* Clear an irq's pending state, in preparation for polling on it */
738void xen_clear_irq_pending(int irq)
739{
740 int evtchn = evtchn_from_irq(irq);
741
742 if (VALID_EVTCHN(evtchn))
743 clear_evtchn(evtchn);
744}
745
746/* Poll waiting for an irq to become pending. In the usual case, the
747 irq will be disabled so it won't deliver an interrupt. */
748void xen_poll_irq(int irq)
749{
750 evtchn_port_t evtchn = evtchn_from_irq(irq);
751
752 if (VALID_EVTCHN(evtchn)) {
753 struct sched_poll poll;
754
755 poll.nr_ports = 1;
756 poll.timeout = 0;
757 poll.ports = &evtchn;
758
759 if (HYPERVISOR_sched_op(SCHEDOP_poll, &poll) != 0)
760 BUG();
761 }
762}
763
737void xen_irq_resume(void) 764void xen_irq_resume(void)
738{ 765{
739 unsigned int cpu, irq, evtchn; 766 unsigned int cpu, irq, evtchn;
diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c
index 5b546e365f00..a5bc91ae6ff6 100644
--- a/drivers/xen/manage.c
+++ b/drivers/xen/manage.c
@@ -63,11 +63,12 @@ static int xen_suspend(void *data)
63 gnttab_resume(); 63 gnttab_resume();
64 xen_mm_unpin_all(); 64 xen_mm_unpin_all();
65 65
66 device_power_up(); 66 device_power_up(PMSG_RESUME);
67 67
68 if (!*cancelled) { 68 if (!*cancelled) {
69 xen_irq_resume(); 69 xen_irq_resume();
70 xen_console_resume(); 70 xen_console_resume();
71 xen_timer_resume();
71 } 72 }
72 73
73 return 0; 74 return 0;
@@ -107,12 +108,13 @@ static void do_suspend(void)
107 goto out; 108 goto out;
108 } 109 }
109 110
110 if (!cancelled) 111 if (!cancelled) {
112 xen_arch_resume();
111 xenbus_resume(); 113 xenbus_resume();
112 else 114 } else
113 xenbus_suspend_cancel(); 115 xenbus_suspend_cancel();
114 116
115 device_resume(); 117 device_resume(PMSG_RESUME);
116 118
117 /* Make sure timer events get retriggered on all CPUs */ 119 /* Make sure timer events get retriggered on all CPUs */
118 clock_was_set(); 120 clock_was_set();