diff options
Diffstat (limited to 'drivers/misc/sgi-xp')
-rw-r--r-- | drivers/misc/sgi-xp/xpc.h | 5 | ||||
-rw-r--r-- | drivers/misc/sgi-xp/xpc_channel.c | 3 | ||||
-rw-r--r-- | drivers/misc/sgi-xp/xpc_sn2.c | 34 | ||||
-rw-r--r-- | drivers/misc/sgi-xp/xpc_uv.c | 13 | ||||
-rw-r--r-- | drivers/misc/sgi-xp/xpnet.c | 3 |
5 files changed, 33 insertions, 25 deletions
diff --git a/drivers/misc/sgi-xp/xpc.h b/drivers/misc/sgi-xp/xpc.h index a5bd658c2e83..275b78896a73 100644 --- a/drivers/misc/sgi-xp/xpc.h +++ b/drivers/misc/sgi-xp/xpc.h | |||
@@ -3,7 +3,7 @@ | |||
3 | * License. See the file "COPYING" in the main directory of this archive | 3 | * License. See the file "COPYING" in the main directory of this archive |
4 | * for more details. | 4 | * for more details. |
5 | * | 5 | * |
6 | * Copyright (c) 2004-2008 Silicon Graphics, Inc. All Rights Reserved. | 6 | * Copyright (c) 2004-2009 Silicon Graphics, Inc. All Rights Reserved. |
7 | */ | 7 | */ |
8 | 8 | ||
9 | /* | 9 | /* |
@@ -514,7 +514,8 @@ struct xpc_channel_uv { | |||
514 | /* partition's notify mq */ | 514 | /* partition's notify mq */ |
515 | 515 | ||
516 | struct xpc_send_msg_slot_uv *send_msg_slots; | 516 | struct xpc_send_msg_slot_uv *send_msg_slots; |
517 | struct xpc_notify_mq_msg_uv *recv_msg_slots; | 517 | void *recv_msg_slots; /* each slot will hold a xpc_notify_mq_msg_uv */ |
518 | /* structure plus the user's payload */ | ||
518 | 519 | ||
519 | struct xpc_fifo_head_uv msg_slot_free_list; | 520 | struct xpc_fifo_head_uv msg_slot_free_list; |
520 | struct xpc_fifo_head_uv recv_msg_list; /* deliverable payloads */ | 521 | struct xpc_fifo_head_uv recv_msg_list; /* deliverable payloads */ |
diff --git a/drivers/misc/sgi-xp/xpc_channel.c b/drivers/misc/sgi-xp/xpc_channel.c index 9cd2ebe2a3b6..45fd653dbe31 100644 --- a/drivers/misc/sgi-xp/xpc_channel.c +++ b/drivers/misc/sgi-xp/xpc_channel.c | |||
@@ -49,9 +49,6 @@ xpc_process_connect(struct xpc_channel *ch, unsigned long *irq_flags) | |||
49 | 49 | ||
50 | if (ch->flags & (XPC_C_CONNECTED | XPC_C_DISCONNECTING)) | 50 | if (ch->flags & (XPC_C_CONNECTED | XPC_C_DISCONNECTING)) |
51 | return; | 51 | return; |
52 | |||
53 | DBUG_ON(ch->local_msgqueue == NULL); | ||
54 | DBUG_ON(ch->remote_msgqueue == NULL); | ||
55 | } | 52 | } |
56 | 53 | ||
57 | if (!(ch->flags & XPC_C_OPENREPLY)) { | 54 | if (!(ch->flags & XPC_C_OPENREPLY)) { |
diff --git a/drivers/misc/sgi-xp/xpc_sn2.c b/drivers/misc/sgi-xp/xpc_sn2.c index 82fb9958f22f..2e975762c32b 100644 --- a/drivers/misc/sgi-xp/xpc_sn2.c +++ b/drivers/misc/sgi-xp/xpc_sn2.c | |||
@@ -1106,8 +1106,6 @@ xpc_process_activate_IRQ_rcvd_sn2(void) | |||
1106 | int n_IRQs_expected; | 1106 | int n_IRQs_expected; |
1107 | int n_IRQs_detected; | 1107 | int n_IRQs_detected; |
1108 | 1108 | ||
1109 | DBUG_ON(xpc_activate_IRQ_rcvd == 0); | ||
1110 | |||
1111 | spin_lock_irqsave(&xpc_activate_IRQ_rcvd_lock, irq_flags); | 1109 | spin_lock_irqsave(&xpc_activate_IRQ_rcvd_lock, irq_flags); |
1112 | n_IRQs_expected = xpc_activate_IRQ_rcvd; | 1110 | n_IRQs_expected = xpc_activate_IRQ_rcvd; |
1113 | xpc_activate_IRQ_rcvd = 0; | 1111 | xpc_activate_IRQ_rcvd = 0; |
@@ -1726,6 +1724,7 @@ xpc_clear_local_msgqueue_flags_sn2(struct xpc_channel *ch) | |||
1726 | msg = (struct xpc_msg_sn2 *)((u64)ch_sn2->local_msgqueue + | 1724 | msg = (struct xpc_msg_sn2 *)((u64)ch_sn2->local_msgqueue + |
1727 | (get % ch->local_nentries) * | 1725 | (get % ch->local_nentries) * |
1728 | ch->entry_size); | 1726 | ch->entry_size); |
1727 | DBUG_ON(!(msg->flags & XPC_M_SN2_READY)); | ||
1729 | msg->flags = 0; | 1728 | msg->flags = 0; |
1730 | } while (++get < ch_sn2->remote_GP.get); | 1729 | } while (++get < ch_sn2->remote_GP.get); |
1731 | } | 1730 | } |
@@ -1740,11 +1739,18 @@ xpc_clear_remote_msgqueue_flags_sn2(struct xpc_channel *ch) | |||
1740 | struct xpc_msg_sn2 *msg; | 1739 | struct xpc_msg_sn2 *msg; |
1741 | s64 put; | 1740 | s64 put; |
1742 | 1741 | ||
1743 | put = ch_sn2->w_remote_GP.put; | 1742 | /* flags are zeroed when the buffer is allocated */ |
1743 | if (ch_sn2->remote_GP.put < ch->remote_nentries) | ||
1744 | return; | ||
1745 | |||
1746 | put = max(ch_sn2->w_remote_GP.put, ch->remote_nentries); | ||
1744 | do { | 1747 | do { |
1745 | msg = (struct xpc_msg_sn2 *)((u64)ch_sn2->remote_msgqueue + | 1748 | msg = (struct xpc_msg_sn2 *)((u64)ch_sn2->remote_msgqueue + |
1746 | (put % ch->remote_nentries) * | 1749 | (put % ch->remote_nentries) * |
1747 | ch->entry_size); | 1750 | ch->entry_size); |
1751 | DBUG_ON(!(msg->flags & XPC_M_SN2_READY)); | ||
1752 | DBUG_ON(!(msg->flags & XPC_M_SN2_DONE)); | ||
1753 | DBUG_ON(msg->number != put - ch->remote_nentries); | ||
1748 | msg->flags = 0; | 1754 | msg->flags = 0; |
1749 | } while (++put < ch_sn2->remote_GP.put); | 1755 | } while (++put < ch_sn2->remote_GP.put); |
1750 | } | 1756 | } |
@@ -1836,6 +1842,7 @@ xpc_process_msg_chctl_flags_sn2(struct xpc_partition *part, int ch_number) | |||
1836 | */ | 1842 | */ |
1837 | xpc_clear_remote_msgqueue_flags_sn2(ch); | 1843 | xpc_clear_remote_msgqueue_flags_sn2(ch); |
1838 | 1844 | ||
1845 | smp_wmb(); /* ensure flags have been cleared before bte_copy */ | ||
1839 | ch_sn2->w_remote_GP.put = ch_sn2->remote_GP.put; | 1846 | ch_sn2->w_remote_GP.put = ch_sn2->remote_GP.put; |
1840 | 1847 | ||
1841 | dev_dbg(xpc_chan, "w_remote_GP.put changed to %ld, partid=%d, " | 1848 | dev_dbg(xpc_chan, "w_remote_GP.put changed to %ld, partid=%d, " |
@@ -1934,7 +1941,7 @@ xpc_get_deliverable_payload_sn2(struct xpc_channel *ch) | |||
1934 | break; | 1941 | break; |
1935 | 1942 | ||
1936 | get = ch_sn2->w_local_GP.get; | 1943 | get = ch_sn2->w_local_GP.get; |
1937 | rmb(); /* guarantee that .get loads before .put */ | 1944 | smp_rmb(); /* guarantee that .get loads before .put */ |
1938 | if (get == ch_sn2->w_remote_GP.put) | 1945 | if (get == ch_sn2->w_remote_GP.put) |
1939 | break; | 1946 | break; |
1940 | 1947 | ||
@@ -1956,11 +1963,13 @@ xpc_get_deliverable_payload_sn2(struct xpc_channel *ch) | |||
1956 | 1963 | ||
1957 | msg = xpc_pull_remote_msg_sn2(ch, get); | 1964 | msg = xpc_pull_remote_msg_sn2(ch, get); |
1958 | 1965 | ||
1959 | DBUG_ON(msg != NULL && msg->number != get); | 1966 | if (msg != NULL) { |
1960 | DBUG_ON(msg != NULL && (msg->flags & XPC_M_SN2_DONE)); | 1967 | DBUG_ON(msg->number != get); |
1961 | DBUG_ON(msg != NULL && !(msg->flags & XPC_M_SN2_READY)); | 1968 | DBUG_ON(msg->flags & XPC_M_SN2_DONE); |
1969 | DBUG_ON(!(msg->flags & XPC_M_SN2_READY)); | ||
1962 | 1970 | ||
1963 | payload = &msg->payload; | 1971 | payload = &msg->payload; |
1972 | } | ||
1964 | break; | 1973 | break; |
1965 | } | 1974 | } |
1966 | 1975 | ||
@@ -2053,7 +2062,7 @@ xpc_allocate_msg_sn2(struct xpc_channel *ch, u32 flags, | |||
2053 | while (1) { | 2062 | while (1) { |
2054 | 2063 | ||
2055 | put = ch_sn2->w_local_GP.put; | 2064 | put = ch_sn2->w_local_GP.put; |
2056 | rmb(); /* guarantee that .put loads before .get */ | 2065 | smp_rmb(); /* guarantee that .put loads before .get */ |
2057 | if (put - ch_sn2->w_remote_GP.get < ch->local_nentries) { | 2066 | if (put - ch_sn2->w_remote_GP.get < ch->local_nentries) { |
2058 | 2067 | ||
2059 | /* There are available message entries. We need to try | 2068 | /* There are available message entries. We need to try |
@@ -2186,7 +2195,7 @@ xpc_send_payload_sn2(struct xpc_channel *ch, u32 flags, void *payload, | |||
2186 | * The preceding store of msg->flags must occur before the following | 2195 | * The preceding store of msg->flags must occur before the following |
2187 | * load of local_GP->put. | 2196 | * load of local_GP->put. |
2188 | */ | 2197 | */ |
2189 | mb(); | 2198 | smp_mb(); |
2190 | 2199 | ||
2191 | /* see if the message is next in line to be sent, if so send it */ | 2200 | /* see if the message is next in line to be sent, if so send it */ |
2192 | 2201 | ||
@@ -2277,8 +2286,9 @@ xpc_received_payload_sn2(struct xpc_channel *ch, void *payload) | |||
2277 | dev_dbg(xpc_chan, "msg=0x%p, msg_number=%ld, partid=%d, channel=%d\n", | 2286 | dev_dbg(xpc_chan, "msg=0x%p, msg_number=%ld, partid=%d, channel=%d\n", |
2278 | (void *)msg, msg_number, ch->partid, ch->number); | 2287 | (void *)msg, msg_number, ch->partid, ch->number); |
2279 | 2288 | ||
2280 | DBUG_ON((((u64)msg - (u64)ch->remote_msgqueue) / ch->entry_size) != | 2289 | DBUG_ON((((u64)msg - (u64)ch->sn.sn2.remote_msgqueue) / ch->entry_size) != |
2281 | msg_number % ch->remote_nentries); | 2290 | msg_number % ch->remote_nentries); |
2291 | DBUG_ON(!(msg->flags & XPC_M_SN2_READY)); | ||
2282 | DBUG_ON(msg->flags & XPC_M_SN2_DONE); | 2292 | DBUG_ON(msg->flags & XPC_M_SN2_DONE); |
2283 | 2293 | ||
2284 | msg->flags |= XPC_M_SN2_DONE; | 2294 | msg->flags |= XPC_M_SN2_DONE; |
@@ -2287,7 +2297,7 @@ xpc_received_payload_sn2(struct xpc_channel *ch, void *payload) | |||
2287 | * The preceding store of msg->flags must occur before the following | 2297 | * The preceding store of msg->flags must occur before the following |
2288 | * load of local_GP->get. | 2298 | * load of local_GP->get. |
2289 | */ | 2299 | */ |
2290 | mb(); | 2300 | smp_mb(); |
2291 | 2301 | ||
2292 | /* | 2302 | /* |
2293 | * See if this message is next in line to be acknowledged as having | 2303 | * See if this message is next in line to be acknowledged as having |
diff --git a/drivers/misc/sgi-xp/xpc_uv.c b/drivers/misc/sgi-xp/xpc_uv.c index 91a55b1b1037..29c0502a96b2 100644 --- a/drivers/misc/sgi-xp/xpc_uv.c +++ b/drivers/misc/sgi-xp/xpc_uv.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * License. See the file "COPYING" in the main directory of this archive | 3 | * License. See the file "COPYING" in the main directory of this archive |
4 | * for more details. | 4 | * for more details. |
5 | * | 5 | * |
6 | * Copyright (c) 2008 Silicon Graphics, Inc. All Rights Reserved. | 6 | * Copyright (c) 2008-2009 Silicon Graphics, Inc. All Rights Reserved. |
7 | */ | 7 | */ |
8 | 8 | ||
9 | /* | 9 | /* |
@@ -1010,8 +1010,8 @@ xpc_allocate_recv_msg_slot_uv(struct xpc_channel *ch) | |||
1010 | continue; | 1010 | continue; |
1011 | 1011 | ||
1012 | for (entry = 0; entry < nentries; entry++) { | 1012 | for (entry = 0; entry < nentries; entry++) { |
1013 | msg_slot = ch_uv->recv_msg_slots + entry * | 1013 | msg_slot = ch_uv->recv_msg_slots + |
1014 | ch->entry_size; | 1014 | entry * ch->entry_size; |
1015 | 1015 | ||
1016 | msg_slot->hdr.msg_slot_number = entry; | 1016 | msg_slot->hdr.msg_slot_number = entry; |
1017 | } | 1017 | } |
@@ -1308,9 +1308,8 @@ xpc_handle_notify_mq_msg_uv(struct xpc_partition *part, | |||
1308 | /* we're dealing with a normal message sent via the notify_mq */ | 1308 | /* we're dealing with a normal message sent via the notify_mq */ |
1309 | ch_uv = &ch->sn.uv; | 1309 | ch_uv = &ch->sn.uv; |
1310 | 1310 | ||
1311 | msg_slot = (struct xpc_notify_mq_msg_uv *)((u64)ch_uv->recv_msg_slots + | 1311 | msg_slot = ch_uv->recv_msg_slots + |
1312 | (msg->hdr.msg_slot_number % ch->remote_nentries) * | 1312 | (msg->hdr.msg_slot_number % ch->remote_nentries) * ch->entry_size; |
1313 | ch->entry_size); | ||
1314 | 1313 | ||
1315 | BUG_ON(msg->hdr.msg_slot_number != msg_slot->hdr.msg_slot_number); | 1314 | BUG_ON(msg->hdr.msg_slot_number != msg_slot->hdr.msg_slot_number); |
1316 | BUG_ON(msg_slot->hdr.size != 0); | 1315 | BUG_ON(msg_slot->hdr.size != 0); |
@@ -1423,7 +1422,7 @@ xpc_send_payload_uv(struct xpc_channel *ch, u32 flags, void *payload, | |||
1423 | atomic_inc(&ch->n_to_notify); | 1422 | atomic_inc(&ch->n_to_notify); |
1424 | 1423 | ||
1425 | msg_slot->key = key; | 1424 | msg_slot->key = key; |
1426 | wmb(); /* a non-NULL func must hit memory after the key */ | 1425 | smp_wmb(); /* a non-NULL func must hit memory after the key */ |
1427 | msg_slot->func = func; | 1426 | msg_slot->func = func; |
1428 | 1427 | ||
1429 | if (ch->flags & XPC_C_DISCONNECTING) { | 1428 | if (ch->flags & XPC_C_DISCONNECTING) { |
diff --git a/drivers/misc/sgi-xp/xpnet.c b/drivers/misc/sgi-xp/xpnet.c index 7957f525b2f4..6faefcffcb53 100644 --- a/drivers/misc/sgi-xp/xpnet.c +++ b/drivers/misc/sgi-xp/xpnet.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * License. See the file "COPYING" in the main directory of this archive | 3 | * License. See the file "COPYING" in the main directory of this archive |
4 | * for more details. | 4 | * for more details. |
5 | * | 5 | * |
6 | * Copyright (C) 1999-2008 Silicon Graphics, Inc. All rights reserved. | 6 | * Copyright (C) 1999-2009 Silicon Graphics, Inc. All rights reserved. |
7 | */ | 7 | */ |
8 | 8 | ||
9 | /* | 9 | /* |
@@ -551,6 +551,7 @@ xpnet_init(void) | |||
551 | 551 | ||
552 | netif_carrier_off(xpnet_device); | 552 | netif_carrier_off(xpnet_device); |
553 | 553 | ||
554 | xpnet_device->netdev_ops = &xpnet_netdev_ops; | ||
554 | xpnet_device->mtu = XPNET_DEF_MTU; | 555 | xpnet_device->mtu = XPNET_DEF_MTU; |
555 | 556 | ||
556 | /* | 557 | /* |