.. | .. |
---|
22 | 22 | #include <linux/module.h> |
---|
23 | 23 | #include <linux/err.h> |
---|
24 | 24 | #include <linux/slab.h> |
---|
| 25 | +#include <linux/numa.h> |
---|
25 | 26 | #include <asm/uv/uv_hub.h> |
---|
26 | 27 | #if defined CONFIG_X86_64 |
---|
27 | 28 | #include <asm/uv/bios.h> |
---|
28 | 29 | #include <asm/uv/uv_irq.h> |
---|
29 | | -#elif defined CONFIG_IA64_GENERIC || defined CONFIG_IA64_SGI_UV |
---|
| 30 | +#elif defined CONFIG_IA64_SGI_UV |
---|
30 | 31 | #include <asm/sn/intr.h> |
---|
31 | 32 | #include <asm/sn/sn_sal.h> |
---|
32 | 33 | #endif |
---|
.. | .. |
---|
34 | 35 | #include "../sgi-gru/grukservices.h" |
---|
35 | 36 | #include "xpc.h" |
---|
36 | 37 | |
---|
37 | | -#if defined CONFIG_IA64_GENERIC || defined CONFIG_IA64_SGI_UV |
---|
| 38 | +#if defined CONFIG_IA64_SGI_UV |
---|
38 | 39 | struct uv_IO_APIC_route_entry { |
---|
39 | 40 | __u64 vector : 8, |
---|
40 | 41 | delivery_mode : 3, |
---|
.. | .. |
---|
47 | 48 | __reserved_2 : 15, |
---|
48 | 49 | dest : 32; |
---|
49 | 50 | }; |
---|
| 51 | + |
---|
| 52 | +#define sn_partition_id 0 |
---|
50 | 53 | #endif |
---|
51 | 54 | |
---|
52 | 55 | static struct xpc_heartbeat_uv *xpc_heartbeat_uv; |
---|
.. | .. |
---|
61 | 64 | XPC_NOTIFY_MSG_SIZE_UV) |
---|
62 | 65 | #define XPC_NOTIFY_IRQ_NAME "xpc_notify" |
---|
63 | 66 | |
---|
64 | | -static int xpc_mq_node = -1; |
---|
| 67 | +static int xpc_mq_node = NUMA_NO_NODE; |
---|
65 | 68 | |
---|
66 | 69 | static struct xpc_gru_mq_uv *xpc_activate_mq_uv; |
---|
67 | 70 | static struct xpc_gru_mq_uv *xpc_notify_mq_uv; |
---|
.. | .. |
---|
118 | 121 | |
---|
119 | 122 | mq->mmr_value = uv_read_global_mmr64(mmr_pnode, mq->mmr_offset); |
---|
120 | 123 | |
---|
121 | | -#elif defined CONFIG_IA64_GENERIC || defined CONFIG_IA64_SGI_UV |
---|
| 124 | +#elif defined CONFIG_IA64_SGI_UV |
---|
122 | 125 | if (strcmp(irq_name, XPC_ACTIVATE_IRQ_NAME) == 0) |
---|
123 | 126 | mq->irq = SGI_XPC_ACTIVATE; |
---|
124 | 127 | else if (strcmp(irq_name, XPC_NOTIFY_IRQ_NAME) == 0) |
---|
.. | .. |
---|
141 | 144 | #if defined CONFIG_X86_64 |
---|
142 | 145 | uv_teardown_irq(mq->irq); |
---|
143 | 146 | |
---|
144 | | -#elif defined CONFIG_IA64_GENERIC || defined CONFIG_IA64_SGI_UV |
---|
| 147 | +#elif defined CONFIG_IA64_SGI_UV |
---|
145 | 148 | int mmr_pnode; |
---|
146 | 149 | unsigned long mmr_value; |
---|
147 | 150 | |
---|
.. | .. |
---|
159 | 162 | { |
---|
160 | 163 | int ret; |
---|
161 | 164 | |
---|
162 | | -#if defined CONFIG_IA64_GENERIC || defined CONFIG_IA64_SGI_UV |
---|
| 165 | +#if defined CONFIG_IA64_SGI_UV |
---|
163 | 166 | int mmr_pnode = uv_blade_to_pnode(mq->mmr_blade); |
---|
164 | 167 | |
---|
165 | 168 | ret = sn_mq_watchlist_alloc(mmr_pnode, (void *)uv_gpa(mq->address), |
---|
.. | .. |
---|
194 | 197 | #if defined CONFIG_X86_64 |
---|
195 | 198 | ret = uv_bios_mq_watchlist_free(mmr_pnode, mq->watchlist_num); |
---|
196 | 199 | BUG_ON(ret != BIOS_STATUS_SUCCESS); |
---|
197 | | -#elif defined CONFIG_IA64_GENERIC || defined CONFIG_IA64_SGI_UV |
---|
| 200 | +#elif defined CONFIG_IA64_SGI_UV |
---|
198 | 201 | ret = sn_mq_watchlist_free(mmr_pnode, mq->watchlist_num); |
---|
199 | 202 | BUG_ON(ret != SALRET_OK); |
---|
200 | 203 | #else |
---|
.. | .. |
---|
571 | 574 | |
---|
572 | 575 | xpc_wakeup_channel_mgr(part); |
---|
573 | 576 | } |
---|
| 577 | + fallthrough; |
---|
574 | 578 | case XPC_ACTIVATE_MQ_MSG_MARK_ENGAGED_UV: |
---|
575 | 579 | spin_lock_irqsave(&part_uv->flags_lock, irq_flags); |
---|
576 | 580 | part_uv->flags |= XPC_P_ENGAGED_UV; |
---|
.. | .. |
---|
692 | 696 | if (gru_mq_desc == NULL) { |
---|
693 | 697 | gru_mq_desc = kmalloc(sizeof(struct |
---|
694 | 698 | gru_message_queue_desc), |
---|
695 | | - GFP_KERNEL); |
---|
| 699 | + GFP_ATOMIC); |
---|
696 | 700 | if (gru_mq_desc == NULL) { |
---|
697 | 701 | ret = xpNoMemory; |
---|
698 | 702 | goto done; |
---|
.. | .. |
---|
792 | 796 | else |
---|
793 | 797 | ret = xpBiosError; |
---|
794 | 798 | |
---|
795 | | -#elif defined CONFIG_IA64_GENERIC || defined CONFIG_IA64_SGI_UV |
---|
| 799 | +#elif defined CONFIG_IA64_SGI_UV |
---|
796 | 800 | status = sn_partition_reserved_page_pa((u64)buf, cookie, rp_pa, len); |
---|
797 | 801 | if (status == SALRET_OK) |
---|
798 | 802 | ret = xpSuccess; |
---|
.. | .. |
---|
1183 | 1187 | { |
---|
1184 | 1188 | struct xpc_channel_uv *ch_uv = &ch->sn.uv; |
---|
1185 | 1189 | |
---|
1186 | | - DBUG_ON(!spin_is_locked(&ch->lock)); |
---|
| 1190 | + lockdep_assert_held(&ch->lock); |
---|
1187 | 1191 | |
---|
1188 | 1192 | kfree(ch_uv->cached_notify_gru_mq_desc); |
---|
1189 | 1193 | ch_uv->cached_notify_gru_mq_desc = NULL; |
---|
.. | .. |
---|
1676 | 1680 | XPC_DEACTIVATE_PARTITION(&xpc_partitions[ch->partid], ret); |
---|
1677 | 1681 | } |
---|
1678 | 1682 | |
---|
1679 | | -static struct xpc_arch_operations xpc_arch_ops_uv = { |
---|
| 1683 | +static const struct xpc_arch_operations xpc_arch_ops_uv = { |
---|
1680 | 1684 | .setup_partitions = xpc_setup_partitions_uv, |
---|
1681 | 1685 | .teardown_partitions = xpc_teardown_partitions_uv, |
---|
1682 | 1686 | .process_activate_IRQ_rcvd = xpc_process_activate_IRQ_rcvd_uv, |
---|