diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
commit | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch) | |
tree | a8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /drivers/misc/sgi-xp | |
parent | 406089d01562f1e2bf9f089fd7637009ebaad589 (diff) |
Patched in Tegra support.
Diffstat (limited to 'drivers/misc/sgi-xp')
-rw-r--r-- | drivers/misc/sgi-xp/xp.h | 1 | ||||
-rw-r--r-- | drivers/misc/sgi-xp/xpc_main.c | 34 | ||||
-rw-r--r-- | drivers/misc/sgi-xp/xpc_uv.c | 88 | ||||
-rw-r--r-- | drivers/misc/sgi-xp/xpnet.c | 2 |
4 files changed, 25 insertions, 100 deletions
diff --git a/drivers/misc/sgi-xp/xp.h b/drivers/misc/sgi-xp/xp.h index c862cd4583c..851b2f25ce0 100644 --- a/drivers/misc/sgi-xp/xp.h +++ b/drivers/misc/sgi-xp/xp.h | |||
@@ -25,6 +25,7 @@ | |||
25 | #endif | 25 | #endif |
26 | 26 | ||
27 | #if defined CONFIG_IA64 | 27 | #if defined CONFIG_IA64 |
28 | #include <asm/system.h> | ||
28 | #include <asm/sn/arch.h> /* defines is_shub1() and is_shub2() */ | 29 | #include <asm/sn/arch.h> /* defines is_shub1() and is_shub2() */ |
29 | #define is_shub() ia64_platform_is("sn2") | 30 | #define is_shub() ia64_platform_is("sn2") |
30 | #endif | 31 | #endif |
diff --git a/drivers/misc/sgi-xp/xpc_main.c b/drivers/misc/sgi-xp/xpc_main.c index d971817182f..8d082b46426 100644 --- a/drivers/misc/sgi-xp/xpc_main.c +++ b/drivers/misc/sgi-xp/xpc_main.c | |||
@@ -53,10 +53,6 @@ | |||
53 | #include <linux/kthread.h> | 53 | #include <linux/kthread.h> |
54 | #include "xpc.h" | 54 | #include "xpc.h" |
55 | 55 | ||
56 | #ifdef CONFIG_X86_64 | ||
57 | #include <asm/traps.h> | ||
58 | #endif | ||
59 | |||
60 | /* define two XPC debug device structures to be used with dev_dbg() et al */ | 56 | /* define two XPC debug device structures to be used with dev_dbg() et al */ |
61 | 57 | ||
62 | struct device_driver xpc_dbg_name = { | 58 | struct device_driver xpc_dbg_name = { |
@@ -1083,9 +1079,6 @@ xpc_system_reboot(struct notifier_block *nb, unsigned long event, void *unused) | |||
1083 | return NOTIFY_DONE; | 1079 | return NOTIFY_DONE; |
1084 | } | 1080 | } |
1085 | 1081 | ||
1086 | /* Used to only allow one cpu to complete disconnect */ | ||
1087 | static unsigned int xpc_die_disconnecting; | ||
1088 | |||
1089 | /* | 1082 | /* |
1090 | * Notify other partitions to deactivate from us by first disengaging from all | 1083 | * Notify other partitions to deactivate from us by first disengaging from all |
1091 | * references to our memory. | 1084 | * references to our memory. |
@@ -1099,9 +1092,6 @@ xpc_die_deactivate(void) | |||
1099 | long keep_waiting; | 1092 | long keep_waiting; |
1100 | long wait_to_print; | 1093 | long wait_to_print; |
1101 | 1094 | ||
1102 | if (cmpxchg(&xpc_die_disconnecting, 0, 1)) | ||
1103 | return; | ||
1104 | |||
1105 | /* keep xpc_hb_checker thread from doing anything (just in case) */ | 1095 | /* keep xpc_hb_checker thread from doing anything (just in case) */ |
1106 | xpc_exiting = 1; | 1096 | xpc_exiting = 1; |
1107 | 1097 | ||
@@ -1169,7 +1159,7 @@ xpc_die_deactivate(void) | |||
1169 | * about the lack of a heartbeat. | 1159 | * about the lack of a heartbeat. |
1170 | */ | 1160 | */ |
1171 | static int | 1161 | static int |
1172 | xpc_system_die(struct notifier_block *nb, unsigned long event, void *_die_args) | 1162 | xpc_system_die(struct notifier_block *nb, unsigned long event, void *unused) |
1173 | { | 1163 | { |
1174 | #ifdef CONFIG_IA64 /* !!! temporary kludge */ | 1164 | #ifdef CONFIG_IA64 /* !!! temporary kludge */ |
1175 | switch (event) { | 1165 | switch (event) { |
@@ -1201,27 +1191,7 @@ xpc_system_die(struct notifier_block *nb, unsigned long event, void *_die_args) | |||
1201 | break; | 1191 | break; |
1202 | } | 1192 | } |
1203 | #else | 1193 | #else |
1204 | struct die_args *die_args = _die_args; | 1194 | xpc_die_deactivate(); |
1205 | |||
1206 | switch (event) { | ||
1207 | case DIE_TRAP: | ||
1208 | if (die_args->trapnr == X86_TRAP_DF) | ||
1209 | xpc_die_deactivate(); | ||
1210 | |||
1211 | if (((die_args->trapnr == X86_TRAP_MF) || | ||
1212 | (die_args->trapnr == X86_TRAP_XF)) && | ||
1213 | !user_mode_vm(die_args->regs)) | ||
1214 | xpc_die_deactivate(); | ||
1215 | |||
1216 | break; | ||
1217 | case DIE_INT3: | ||
1218 | case DIE_DEBUG: | ||
1219 | break; | ||
1220 | case DIE_OOPS: | ||
1221 | case DIE_GPF: | ||
1222 | default: | ||
1223 | xpc_die_deactivate(); | ||
1224 | } | ||
1225 | #endif | 1195 | #endif |
1226 | 1196 | ||
1227 | return NOTIFY_DONE; | 1197 | return NOTIFY_DONE; |
diff --git a/drivers/misc/sgi-xp/xpc_uv.c b/drivers/misc/sgi-xp/xpc_uv.c index b9e2000969f..17bbacb1b4b 100644 --- a/drivers/misc/sgi-xp/xpc_uv.c +++ b/drivers/misc/sgi-xp/xpc_uv.c | |||
@@ -18,8 +18,6 @@ | |||
18 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
19 | #include <linux/delay.h> | 19 | #include <linux/delay.h> |
20 | #include <linux/device.h> | 20 | #include <linux/device.h> |
21 | #include <linux/cpu.h> | ||
22 | #include <linux/module.h> | ||
23 | #include <linux/err.h> | 21 | #include <linux/err.h> |
24 | #include <linux/slab.h> | 22 | #include <linux/slab.h> |
25 | #include <asm/uv/uv_hub.h> | 23 | #include <asm/uv/uv_hub.h> |
@@ -61,8 +59,6 @@ static struct xpc_heartbeat_uv *xpc_heartbeat_uv; | |||
61 | XPC_NOTIFY_MSG_SIZE_UV) | 59 | XPC_NOTIFY_MSG_SIZE_UV) |
62 | #define XPC_NOTIFY_IRQ_NAME "xpc_notify" | 60 | #define XPC_NOTIFY_IRQ_NAME "xpc_notify" |
63 | 61 | ||
64 | static int xpc_mq_node = -1; | ||
65 | |||
66 | static struct xpc_gru_mq_uv *xpc_activate_mq_uv; | 62 | static struct xpc_gru_mq_uv *xpc_activate_mq_uv; |
67 | static struct xpc_gru_mq_uv *xpc_notify_mq_uv; | 63 | static struct xpc_gru_mq_uv *xpc_notify_mq_uv; |
68 | 64 | ||
@@ -113,8 +109,11 @@ xpc_get_gru_mq_irq_uv(struct xpc_gru_mq_uv *mq, int cpu, char *irq_name) | |||
113 | #if defined CONFIG_X86_64 | 109 | #if defined CONFIG_X86_64 |
114 | mq->irq = uv_setup_irq(irq_name, cpu, mq->mmr_blade, mq->mmr_offset, | 110 | mq->irq = uv_setup_irq(irq_name, cpu, mq->mmr_blade, mq->mmr_offset, |
115 | UV_AFFINITY_CPU); | 111 | UV_AFFINITY_CPU); |
116 | if (mq->irq < 0) | 112 | if (mq->irq < 0) { |
113 | dev_err(xpc_part, "uv_setup_irq() returned error=%d\n", | ||
114 | -mq->irq); | ||
117 | return mq->irq; | 115 | return mq->irq; |
116 | } | ||
118 | 117 | ||
119 | mq->mmr_value = uv_read_global_mmr64(mmr_pnode, mq->mmr_offset); | 118 | mq->mmr_value = uv_read_global_mmr64(mmr_pnode, mq->mmr_offset); |
120 | 119 | ||
@@ -239,9 +238,8 @@ xpc_create_gru_mq_uv(unsigned int mq_size, int cpu, char *irq_name, | |||
239 | mq->mmr_blade = uv_cpu_to_blade_id(cpu); | 238 | mq->mmr_blade = uv_cpu_to_blade_id(cpu); |
240 | 239 | ||
241 | nid = cpu_to_node(cpu); | 240 | nid = cpu_to_node(cpu); |
242 | page = alloc_pages_exact_node(nid, | 241 | page = alloc_pages_exact_node(nid, GFP_KERNEL | __GFP_ZERO | GFP_THISNODE, |
243 | GFP_KERNEL | __GFP_ZERO | GFP_THISNODE, | 242 | pg_order); |
244 | pg_order); | ||
245 | if (page == NULL) { | 243 | if (page == NULL) { |
246 | dev_err(xpc_part, "xpc_create_gru_mq_uv() failed to alloc %d " | 244 | dev_err(xpc_part, "xpc_create_gru_mq_uv() failed to alloc %d " |
247 | "bytes of memory on nid=%d for GRU mq\n", mq_size, nid); | 245 | "bytes of memory on nid=%d for GRU mq\n", mq_size, nid); |
@@ -454,9 +452,9 @@ xpc_handle_activate_mq_msg_uv(struct xpc_partition *part, | |||
454 | 452 | ||
455 | if (msg->activate_gru_mq_desc_gpa != | 453 | if (msg->activate_gru_mq_desc_gpa != |
456 | part_uv->activate_gru_mq_desc_gpa) { | 454 | part_uv->activate_gru_mq_desc_gpa) { |
457 | spin_lock(&part_uv->flags_lock); | 455 | spin_lock_irqsave(&part_uv->flags_lock, irq_flags); |
458 | part_uv->flags &= ~XPC_P_CACHED_ACTIVATE_GRU_MQ_DESC_UV; | 456 | part_uv->flags &= ~XPC_P_CACHED_ACTIVATE_GRU_MQ_DESC_UV; |
459 | spin_unlock(&part_uv->flags_lock); | 457 | spin_unlock_irqrestore(&part_uv->flags_lock, irq_flags); |
460 | part_uv->activate_gru_mq_desc_gpa = | 458 | part_uv->activate_gru_mq_desc_gpa = |
461 | msg->activate_gru_mq_desc_gpa; | 459 | msg->activate_gru_mq_desc_gpa; |
462 | } | 460 | } |
@@ -1733,50 +1731,9 @@ static struct xpc_arch_operations xpc_arch_ops_uv = { | |||
1733 | .notify_senders_of_disconnect = xpc_notify_senders_of_disconnect_uv, | 1731 | .notify_senders_of_disconnect = xpc_notify_senders_of_disconnect_uv, |
1734 | }; | 1732 | }; |
1735 | 1733 | ||
1736 | static int | ||
1737 | xpc_init_mq_node(int nid) | ||
1738 | { | ||
1739 | int cpu; | ||
1740 | |||
1741 | get_online_cpus(); | ||
1742 | |||
1743 | for_each_cpu(cpu, cpumask_of_node(nid)) { | ||
1744 | xpc_activate_mq_uv = | ||
1745 | xpc_create_gru_mq_uv(XPC_ACTIVATE_MQ_SIZE_UV, nid, | ||
1746 | XPC_ACTIVATE_IRQ_NAME, | ||
1747 | xpc_handle_activate_IRQ_uv); | ||
1748 | if (!IS_ERR(xpc_activate_mq_uv)) | ||
1749 | break; | ||
1750 | } | ||
1751 | if (IS_ERR(xpc_activate_mq_uv)) { | ||
1752 | put_online_cpus(); | ||
1753 | return PTR_ERR(xpc_activate_mq_uv); | ||
1754 | } | ||
1755 | |||
1756 | for_each_cpu(cpu, cpumask_of_node(nid)) { | ||
1757 | xpc_notify_mq_uv = | ||
1758 | xpc_create_gru_mq_uv(XPC_NOTIFY_MQ_SIZE_UV, nid, | ||
1759 | XPC_NOTIFY_IRQ_NAME, | ||
1760 | xpc_handle_notify_IRQ_uv); | ||
1761 | if (!IS_ERR(xpc_notify_mq_uv)) | ||
1762 | break; | ||
1763 | } | ||
1764 | if (IS_ERR(xpc_notify_mq_uv)) { | ||
1765 | xpc_destroy_gru_mq_uv(xpc_activate_mq_uv); | ||
1766 | put_online_cpus(); | ||
1767 | return PTR_ERR(xpc_notify_mq_uv); | ||
1768 | } | ||
1769 | |||
1770 | put_online_cpus(); | ||
1771 | return 0; | ||
1772 | } | ||
1773 | |||
1774 | int | 1734 | int |
1775 | xpc_init_uv(void) | 1735 | xpc_init_uv(void) |
1776 | { | 1736 | { |
1777 | int nid; | ||
1778 | int ret = 0; | ||
1779 | |||
1780 | xpc_arch_ops = xpc_arch_ops_uv; | 1737 | xpc_arch_ops = xpc_arch_ops_uv; |
1781 | 1738 | ||
1782 | if (sizeof(struct xpc_notify_mq_msghdr_uv) > XPC_MSG_HDR_MAX_SIZE) { | 1739 | if (sizeof(struct xpc_notify_mq_msghdr_uv) > XPC_MSG_HDR_MAX_SIZE) { |
@@ -1785,21 +1742,21 @@ xpc_init_uv(void) | |||
1785 | return -E2BIG; | 1742 | return -E2BIG; |
1786 | } | 1743 | } |
1787 | 1744 | ||
1788 | if (xpc_mq_node < 0) | 1745 | xpc_activate_mq_uv = xpc_create_gru_mq_uv(XPC_ACTIVATE_MQ_SIZE_UV, 0, |
1789 | for_each_online_node(nid) { | 1746 | XPC_ACTIVATE_IRQ_NAME, |
1790 | ret = xpc_init_mq_node(nid); | 1747 | xpc_handle_activate_IRQ_uv); |
1791 | 1748 | if (IS_ERR(xpc_activate_mq_uv)) | |
1792 | if (!ret) | 1749 | return PTR_ERR(xpc_activate_mq_uv); |
1793 | break; | ||
1794 | } | ||
1795 | else | ||
1796 | ret = xpc_init_mq_node(xpc_mq_node); | ||
1797 | 1750 | ||
1798 | if (ret < 0) | 1751 | xpc_notify_mq_uv = xpc_create_gru_mq_uv(XPC_NOTIFY_MQ_SIZE_UV, 0, |
1799 | dev_err(xpc_part, "xpc_init_mq_node() returned error=%d\n", | 1752 | XPC_NOTIFY_IRQ_NAME, |
1800 | -ret); | 1753 | xpc_handle_notify_IRQ_uv); |
1754 | if (IS_ERR(xpc_notify_mq_uv)) { | ||
1755 | xpc_destroy_gru_mq_uv(xpc_activate_mq_uv); | ||
1756 | return PTR_ERR(xpc_notify_mq_uv); | ||
1757 | } | ||
1801 | 1758 | ||
1802 | return ret; | 1759 | return 0; |
1803 | } | 1760 | } |
1804 | 1761 | ||
1805 | void | 1762 | void |
@@ -1808,6 +1765,3 @@ xpc_exit_uv(void) | |||
1808 | xpc_destroy_gru_mq_uv(xpc_notify_mq_uv); | 1765 | xpc_destroy_gru_mq_uv(xpc_notify_mq_uv); |
1809 | xpc_destroy_gru_mq_uv(xpc_activate_mq_uv); | 1766 | xpc_destroy_gru_mq_uv(xpc_activate_mq_uv); |
1810 | } | 1767 | } |
1811 | |||
1812 | module_param(xpc_mq_node, int, 0); | ||
1813 | MODULE_PARM_DESC(xpc_mq_node, "Node number on which to allocate message queues."); | ||
diff --git a/drivers/misc/sgi-xp/xpnet.c b/drivers/misc/sgi-xp/xpnet.c index 3fac67a5204..42f067347bc 100644 --- a/drivers/misc/sgi-xp/xpnet.c +++ b/drivers/misc/sgi-xp/xpnet.c | |||
@@ -576,7 +576,7 @@ xpnet_init(void) | |||
576 | * report an error if the data is not retrievable and the | 576 | * report an error if the data is not retrievable and the |
577 | * packet will be dropped. | 577 | * packet will be dropped. |
578 | */ | 578 | */ |
579 | xpnet_device->features = NETIF_F_HW_CSUM; | 579 | xpnet_device->features = NETIF_F_NO_CSUM; |
580 | 580 | ||
581 | result = register_netdev(xpnet_device); | 581 | result = register_netdev(xpnet_device); |
582 | if (result != 0) { | 582 | if (result != 0) { |