2 * Intel MIC Platform Software Stack (MPSS)
4 * Copyright(c) 2015 Intel Corporation.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License, version 2, as
8 * published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
19 #include "scif_main.h"
22 * scif_recv_mark: Handle SCIF_MARK request
23 * @msg: Interrupt message
25 * The peer has requested a mark.
27 void scif_recv_mark(struct scif_dev
*scifdev
, struct scifmsg
*msg
)
29 struct scif_endpt
*ep
= (struct scif_endpt
*)msg
->payload
[0];
33 err
= _scif_fence_mark(ep
, &mark
);
35 msg
->uop
= SCIF_MARK_NACK
;
37 msg
->uop
= SCIF_MARK_ACK
;
38 msg
->payload
[0] = ep
->remote_ep
;
39 msg
->payload
[2] = mark
;
40 scif_nodeqp_send(ep
->remote_dev
, msg
);
44 * scif_recv_mark_resp: Handle SCIF_MARK_(N)ACK messages.
45 * @msg: Interrupt message
47 * The peer has responded to a SCIF_MARK message.
49 void scif_recv_mark_resp(struct scif_dev
*scifdev
, struct scifmsg
*msg
)
51 struct scif_endpt
*ep
= (struct scif_endpt
*)msg
->payload
[0];
52 struct scif_fence_info
*fence_req
=
53 (struct scif_fence_info
*)msg
->payload
[1];
55 mutex_lock(&ep
->rma_info
.rma_lock
);
56 if (msg
->uop
== SCIF_MARK_ACK
) {
57 fence_req
->state
= OP_COMPLETED
;
58 fence_req
->dma_mark
= (int)msg
->payload
[2];
60 fence_req
->state
= OP_FAILED
;
62 mutex_unlock(&ep
->rma_info
.rma_lock
);
63 complete(&fence_req
->comp
);
67 * scif_recv_wait: Handle SCIF_WAIT request
68 * @msg: Interrupt message
70 * The peer has requested waiting on a fence.
72 void scif_recv_wait(struct scif_dev
*scifdev
, struct scifmsg
*msg
)
74 struct scif_endpt
*ep
= (struct scif_endpt
*)msg
->payload
[0];
75 struct scif_remote_fence_info
*fence
;
78 * Allocate structure for remote fence information and
79 * send a NACK if the allocation failed. The peer will
80 * return ENOMEM upon receiving a NACK.
82 fence
= kmalloc(sizeof(*fence
), GFP_KERNEL
);
84 msg
->payload
[0] = ep
->remote_ep
;
85 msg
->uop
= SCIF_WAIT_NACK
;
86 scif_nodeqp_send(ep
->remote_dev
, msg
);
90 /* Prepare the fence request */
91 memcpy(&fence
->msg
, msg
, sizeof(struct scifmsg
));
92 INIT_LIST_HEAD(&fence
->list
);
94 /* Insert to the global remote fence request list */
95 mutex_lock(&scif_info
.fencelock
);
96 atomic_inc(&ep
->rma_info
.fence_refcount
);
97 list_add_tail(&fence
->list
, &scif_info
.fence
);
98 mutex_unlock(&scif_info
.fencelock
);
100 schedule_work(&scif_info
.misc_work
);
104 * scif_recv_wait_resp: Handle SCIF_WAIT_(N)ACK messages.
105 * @msg: Interrupt message
107 * The peer has responded to a SCIF_WAIT message.
109 void scif_recv_wait_resp(struct scif_dev
*scifdev
, struct scifmsg
*msg
)
111 struct scif_endpt
*ep
= (struct scif_endpt
*)msg
->payload
[0];
112 struct scif_fence_info
*fence_req
=
113 (struct scif_fence_info
*)msg
->payload
[1];
115 mutex_lock(&ep
->rma_info
.rma_lock
);
116 if (msg
->uop
== SCIF_WAIT_ACK
)
117 fence_req
->state
= OP_COMPLETED
;
119 fence_req
->state
= OP_FAILED
;
120 mutex_unlock(&ep
->rma_info
.rma_lock
);
121 complete(&fence_req
->comp
);
125 * scif_recv_sig_local: Handle SCIF_SIG_LOCAL request
126 * @msg: Interrupt message
128 * The peer has requested a signal on a local offset.
130 void scif_recv_sig_local(struct scif_dev
*scifdev
, struct scifmsg
*msg
)
132 struct scif_endpt
*ep
= (struct scif_endpt
*)msg
->payload
[0];
135 err
= scif_prog_signal(ep
, msg
->payload
[1], msg
->payload
[2],
138 msg
->uop
= SCIF_SIG_NACK
;
140 msg
->uop
= SCIF_SIG_ACK
;
141 msg
->payload
[0] = ep
->remote_ep
;
142 scif_nodeqp_send(ep
->remote_dev
, msg
);
146 * scif_recv_sig_remote: Handle SCIF_SIGNAL_REMOTE request
147 * @msg: Interrupt message
149 * The peer has requested a signal on a remote offset.
151 void scif_recv_sig_remote(struct scif_dev
*scifdev
, struct scifmsg
*msg
)
153 struct scif_endpt
*ep
= (struct scif_endpt
*)msg
->payload
[0];
156 err
= scif_prog_signal(ep
, msg
->payload
[1], msg
->payload
[2],
159 msg
->uop
= SCIF_SIG_NACK
;
161 msg
->uop
= SCIF_SIG_ACK
;
162 msg
->payload
[0] = ep
->remote_ep
;
163 scif_nodeqp_send(ep
->remote_dev
, msg
);
167 * scif_recv_sig_resp: Handle SCIF_SIG_(N)ACK messages.
168 * @msg: Interrupt message
170 * The peer has responded to a signal request.
172 void scif_recv_sig_resp(struct scif_dev
*scifdev
, struct scifmsg
*msg
)
174 struct scif_endpt
*ep
= (struct scif_endpt
*)msg
->payload
[0];
175 struct scif_fence_info
*fence_req
=
176 (struct scif_fence_info
*)msg
->payload
[3];
178 mutex_lock(&ep
->rma_info
.rma_lock
);
179 if (msg
->uop
== SCIF_SIG_ACK
)
180 fence_req
->state
= OP_COMPLETED
;
182 fence_req
->state
= OP_FAILED
;
183 mutex_unlock(&ep
->rma_info
.rma_lock
);
184 complete(&fence_req
->comp
);
187 static inline void *scif_get_local_va(off_t off
, struct scif_window
*window
)
189 struct page
**pages
= window
->pinned_pages
->pages
;
190 int page_nr
= (off
- window
->offset
) >> PAGE_SHIFT
;
191 off_t page_off
= off
& ~PAGE_MASK
;
193 return page_address(pages
[page_nr
]) + page_off
;
196 static void scif_prog_signal_cb(void *arg
)
198 struct scif_cb_arg
*cb_arg
= arg
;
200 dma_pool_free(cb_arg
->ep
->remote_dev
->signal_pool
, cb_arg
->status
,
201 cb_arg
->src_dma_addr
);
205 static int _scif_prog_signal(scif_epd_t epd
, dma_addr_t dst
, u64 val
)
207 struct scif_endpt
*ep
= (struct scif_endpt
*)epd
;
208 struct dma_chan
*chan
= ep
->rma_info
.dma_chan
;
209 struct dma_device
*ddev
= chan
->device
;
210 bool x100
= !is_dma_copy_aligned(chan
->device
, 1, 1, 1);
211 struct dma_async_tx_descriptor
*tx
;
212 struct scif_status
*status
= NULL
;
213 struct scif_cb_arg
*cb_arg
= NULL
;
218 tx
= ddev
->device_prep_dma_memcpy(chan
, 0, 0, 0, DMA_PREP_FENCE
);
221 dev_err(&ep
->remote_dev
->sdev
->dev
, "%s %d err %d\n",
222 __func__
, __LINE__
, err
);
225 cookie
= tx
->tx_submit(tx
);
226 if (dma_submit_error(cookie
)) {
228 dev_err(&ep
->remote_dev
->sdev
->dev
, "%s %d err %d\n",
229 __func__
, __LINE__
, err
);
232 dma_async_issue_pending(chan
);
235 * For X100 use the status descriptor to write the value to
238 tx
= ddev
->device_prep_dma_imm_data(chan
, dst
, val
, 0);
240 status
= dma_pool_alloc(ep
->remote_dev
->signal_pool
, GFP_KERNEL
,
244 dev_err(&ep
->remote_dev
->sdev
->dev
, "%s %d err %d\n",
245 __func__
, __LINE__
, err
);
249 status
->src_dma_addr
= src
;
251 src
+= offsetof(struct scif_status
, val
);
252 tx
= ddev
->device_prep_dma_memcpy(chan
, dst
, src
, sizeof(val
),
257 dev_err(&ep
->remote_dev
->sdev
->dev
, "%s %d err %d\n",
258 __func__
, __LINE__
, err
);
262 cb_arg
= kmalloc(sizeof(*cb_arg
), GFP_KERNEL
);
267 cb_arg
->src_dma_addr
= src
;
268 cb_arg
->status
= status
;
270 tx
->callback
= scif_prog_signal_cb
;
271 tx
->callback_param
= cb_arg
;
273 cookie
= tx
->tx_submit(tx
);
274 if (dma_submit_error(cookie
)) {
276 dev_err(&ep
->remote_dev
->sdev
->dev
, "%s %d err %d\n",
277 __func__
, __LINE__
, err
);
280 dma_async_issue_pending(chan
);
284 dma_pool_free(ep
->remote_dev
->signal_pool
, status
,
285 src
- offsetof(struct scif_status
, val
));
294 * @epd - Endpoint Descriptor
295 * @offset - registered address to write @val to
296 * @val - Value to be written at @offset
297 * @type - Type of the window.
299 * Arrange to write a value to the registered offset after ensuring that the
300 * offset provided is indeed valid.
302 int scif_prog_signal(scif_epd_t epd
, off_t offset
, u64 val
,
303 enum scif_window_type type
)
305 struct scif_endpt
*ep
= (struct scif_endpt
*)epd
;
306 struct scif_window
*window
= NULL
;
307 struct scif_rma_req req
;
308 dma_addr_t dst_dma_addr
;
311 mutex_lock(&ep
->rma_info
.rma_lock
);
312 req
.out_window
= &window
;
314 req
.nr_bytes
= sizeof(u64
);
315 req
.prot
= SCIF_PROT_WRITE
;
316 req
.type
= SCIF_WINDOW_SINGLE
;
317 if (type
== SCIF_WINDOW_SELF
)
318 req
.head
= &ep
->rma_info
.reg_list
;
320 req
.head
= &ep
->rma_info
.remote_reg_list
;
321 /* Does a valid window exist? */
322 err
= scif_query_window(&req
);
324 dev_err(scif_info
.mdev
.this_device
,
325 "%s %d err %d\n", __func__
, __LINE__
, err
);
329 if (scif_is_mgmt_node() && scifdev_self(ep
->remote_dev
)) {
332 if (type
== SCIF_WINDOW_SELF
)
333 dst_virt
= scif_get_local_va(offset
, window
);
336 scif_get_local_va(offset
, (struct scif_window
*)
337 window
->peer_window
);
340 dst_dma_addr
= __scif_off_to_dma_addr(window
, offset
);
341 err
= _scif_prog_signal(epd
, dst_dma_addr
, val
);
344 mutex_unlock(&ep
->rma_info
.rma_lock
);
348 static int _scif_fence_wait(scif_epd_t epd
, int mark
)
350 struct scif_endpt
*ep
= (struct scif_endpt
*)epd
;
351 dma_cookie_t cookie
= mark
& ~SCIF_REMOTE_FENCE
;
354 /* Wait for DMA callback in scif_fence_mark_cb(..) */
355 err
= wait_event_interruptible_timeout(ep
->rma_info
.markwq
,
356 dma_async_is_tx_complete(
357 ep
->rma_info
.dma_chan
,
358 cookie
, NULL
, NULL
) ==
360 SCIF_NODE_ALIVE_TIMEOUT
);
369 * scif_rma_handle_remote_fences:
371 * This routine services remote fence requests.
373 void scif_rma_handle_remote_fences(void)
375 struct list_head
*item
, *tmp
;
376 struct scif_remote_fence_info
*fence
;
377 struct scif_endpt
*ep
;
381 mutex_lock(&scif_info
.fencelock
);
382 list_for_each_safe(item
, tmp
, &scif_info
.fence
) {
383 fence
= list_entry(item
, struct scif_remote_fence_info
,
385 /* Remove fence from global list */
386 list_del(&fence
->list
);
388 /* Initiate the fence operation */
389 ep
= (struct scif_endpt
*)fence
->msg
.payload
[0];
390 mark
= fence
->msg
.payload
[2];
391 err
= _scif_fence_wait(ep
, mark
);
393 fence
->msg
.uop
= SCIF_WAIT_NACK
;
395 fence
->msg
.uop
= SCIF_WAIT_ACK
;
396 fence
->msg
.payload
[0] = ep
->remote_ep
;
397 scif_nodeqp_send(ep
->remote_dev
, &fence
->msg
);
399 if (!atomic_sub_return(1, &ep
->rma_info
.fence_refcount
))
400 schedule_work(&scif_info
.misc_work
);
402 mutex_unlock(&scif_info
.fencelock
);
405 static int _scif_send_fence(scif_epd_t epd
, int uop
, int mark
, int *out_mark
)
409 struct scif_fence_info
*fence_req
;
410 struct scif_endpt
*ep
= (struct scif_endpt
*)epd
;
412 fence_req
= kmalloc(sizeof(*fence_req
), GFP_KERNEL
);
418 fence_req
->state
= OP_IN_PROGRESS
;
419 init_completion(&fence_req
->comp
);
423 msg
.payload
[0] = ep
->remote_ep
;
424 msg
.payload
[1] = (u64
)fence_req
;
425 if (uop
== SCIF_WAIT
)
426 msg
.payload
[2] = mark
;
427 spin_lock(&ep
->lock
);
428 if (ep
->state
== SCIFEP_CONNECTED
)
429 err
= scif_nodeqp_send(ep
->remote_dev
, &msg
);
432 spin_unlock(&ep
->lock
);
436 /* Wait for a SCIF_WAIT_(N)ACK message */
437 err
= wait_for_completion_timeout(&fence_req
->comp
,
438 SCIF_NODE_ALIVE_TIMEOUT
);
439 if (!err
&& scifdev_alive(ep
))
445 mutex_lock(&ep
->rma_info
.rma_lock
);
447 if (fence_req
->state
== OP_IN_PROGRESS
)
448 fence_req
->state
= OP_FAILED
;
450 if (fence_req
->state
== OP_FAILED
&& !err
)
452 if (uop
== SCIF_MARK
&& fence_req
->state
== OP_COMPLETED
)
453 *out_mark
= SCIF_REMOTE_FENCE
| fence_req
->dma_mark
;
454 mutex_unlock(&ep
->rma_info
.rma_lock
);
462 * scif_send_fence_mark:
463 * @epd: end point descriptor.
464 * @out_mark: Output DMA mark reported by peer.
466 * Send a remote fence mark request.
468 static int scif_send_fence_mark(scif_epd_t epd
, int *out_mark
)
470 return _scif_send_fence(epd
, SCIF_MARK
, 0, out_mark
);
474 * scif_send_fence_wait:
475 * @epd: end point descriptor.
476 * @mark: DMA mark to wait for.
478 * Send a remote fence wait request.
480 static int scif_send_fence_wait(scif_epd_t epd
, int mark
)
482 return _scif_send_fence(epd
, SCIF_WAIT
, mark
, NULL
);
485 static int _scif_send_fence_signal_wait(struct scif_endpt
*ep
,
486 struct scif_fence_info
*fence_req
)
491 /* Wait for a SCIF_SIG_(N)ACK message */
492 err
= wait_for_completion_timeout(&fence_req
->comp
,
493 SCIF_NODE_ALIVE_TIMEOUT
);
494 if (!err
&& scifdev_alive(ep
))
501 mutex_lock(&ep
->rma_info
.rma_lock
);
502 if (fence_req
->state
== OP_IN_PROGRESS
)
503 fence_req
->state
= OP_FAILED
;
504 mutex_unlock(&ep
->rma_info
.rma_lock
);
506 if (fence_req
->state
== OP_FAILED
&& !err
)
512 * scif_send_fence_signal:
513 * @epd - endpoint descriptor
514 * @loff - local offset
515 * @lval - local value to write to loffset
516 * @roff - remote offset
517 * @rval - remote value to write to roffset
520 * Sends a remote fence signal request
522 static int scif_send_fence_signal(scif_epd_t epd
, off_t roff
, u64 rval
,
523 off_t loff
, u64 lval
, int flags
)
527 struct scif_fence_info
*fence_req
;
528 struct scif_endpt
*ep
= (struct scif_endpt
*)epd
;
530 fence_req
= kmalloc(sizeof(*fence_req
), GFP_KERNEL
);
536 fence_req
->state
= OP_IN_PROGRESS
;
537 init_completion(&fence_req
->comp
);
539 if (flags
& SCIF_SIGNAL_LOCAL
) {
540 msg
.uop
= SCIF_SIG_LOCAL
;
541 msg
.payload
[0] = ep
->remote_ep
;
542 msg
.payload
[1] = roff
;
543 msg
.payload
[2] = rval
;
544 msg
.payload
[3] = (u64
)fence_req
;
545 spin_lock(&ep
->lock
);
546 if (ep
->state
== SCIFEP_CONNECTED
)
547 err
= scif_nodeqp_send(ep
->remote_dev
, &msg
);
550 spin_unlock(&ep
->lock
);
553 err
= _scif_send_fence_signal_wait(ep
, fence_req
);
557 fence_req
->state
= OP_IN_PROGRESS
;
559 if (flags
& SCIF_SIGNAL_REMOTE
) {
560 msg
.uop
= SCIF_SIG_REMOTE
;
561 msg
.payload
[0] = ep
->remote_ep
;
562 msg
.payload
[1] = loff
;
563 msg
.payload
[2] = lval
;
564 msg
.payload
[3] = (u64
)fence_req
;
565 spin_lock(&ep
->lock
);
566 if (ep
->state
== SCIFEP_CONNECTED
)
567 err
= scif_nodeqp_send(ep
->remote_dev
, &msg
);
570 spin_unlock(&ep
->lock
);
573 err
= _scif_send_fence_signal_wait(ep
, fence_req
);
581 static void scif_fence_mark_cb(void *arg
)
583 struct scif_endpt
*ep
= (struct scif_endpt
*)arg
;
585 wake_up_interruptible(&ep
->rma_info
.markwq
);
586 atomic_dec(&ep
->rma_info
.fence_refcount
);
592 * @epd - endpoint descriptor
593 * Set up a mark for this endpoint and return the value of the mark.
595 int _scif_fence_mark(scif_epd_t epd
, int *mark
)
597 struct scif_endpt
*ep
= (struct scif_endpt
*)epd
;
598 struct dma_chan
*chan
= ep
->rma_info
.dma_chan
;
599 struct dma_device
*ddev
= chan
->device
;
600 struct dma_async_tx_descriptor
*tx
;
604 tx
= ddev
->device_prep_dma_memcpy(chan
, 0, 0, 0, DMA_PREP_FENCE
);
607 dev_err(&ep
->remote_dev
->sdev
->dev
, "%s %d err %d\n",
608 __func__
, __LINE__
, err
);
611 cookie
= tx
->tx_submit(tx
);
612 if (dma_submit_error(cookie
)) {
614 dev_err(&ep
->remote_dev
->sdev
->dev
, "%s %d err %d\n",
615 __func__
, __LINE__
, err
);
618 dma_async_issue_pending(chan
);
619 tx
= ddev
->device_prep_dma_interrupt(chan
, DMA_PREP_INTERRUPT
);
622 dev_err(&ep
->remote_dev
->sdev
->dev
, "%s %d err %d\n",
623 __func__
, __LINE__
, err
);
626 tx
->callback
= scif_fence_mark_cb
;
627 tx
->callback_param
= ep
;
628 *mark
= cookie
= tx
->tx_submit(tx
);
629 if (dma_submit_error(cookie
)) {
631 dev_err(&ep
->remote_dev
->sdev
->dev
, "%s %d err %d\n",
632 __func__
, __LINE__
, err
);
635 atomic_inc(&ep
->rma_info
.fence_refcount
);
636 dma_async_issue_pending(chan
);
640 #define SCIF_LOOPB_MAGIC_MARK 0xdead
642 int scif_fence_mark(scif_epd_t epd
, int flags
, int *mark
)
644 struct scif_endpt
*ep
= (struct scif_endpt
*)epd
;
647 dev_dbg(scif_info
.mdev
.this_device
,
648 "SCIFAPI fence_mark: ep %p flags 0x%x mark 0x%x\n",
650 err
= scif_verify_epd(ep
);
655 if (flags
& ~(SCIF_FENCE_INIT_SELF
| SCIF_FENCE_INIT_PEER
))
658 /* At least one of init self or peer RMA should be set */
659 if (!(flags
& (SCIF_FENCE_INIT_SELF
| SCIF_FENCE_INIT_PEER
)))
662 /* Exactly one of init self or peer RMA should be set but not both */
663 if ((flags
& SCIF_FENCE_INIT_SELF
) && (flags
& SCIF_FENCE_INIT_PEER
))
667 * Management node loopback does not need to use DMA.
668 * Return a valid mark to be symmetric.
670 if (scifdev_self(ep
->remote_dev
) && scif_is_mgmt_node()) {
671 *mark
= SCIF_LOOPB_MAGIC_MARK
;
675 if (flags
& SCIF_FENCE_INIT_SELF
)
676 err
= _scif_fence_mark(epd
, mark
);
678 err
= scif_send_fence_mark(ep
, mark
);
681 dev_err(scif_info
.mdev
.this_device
,
682 "%s %d err %d\n", __func__
, __LINE__
, err
);
683 dev_dbg(scif_info
.mdev
.this_device
,
684 "SCIFAPI fence_mark: ep %p flags 0x%x mark 0x%x err %d\n",
685 ep
, flags
, *mark
, err
);
688 EXPORT_SYMBOL_GPL(scif_fence_mark
);
690 int scif_fence_wait(scif_epd_t epd
, int mark
)
692 struct scif_endpt
*ep
= (struct scif_endpt
*)epd
;
695 dev_dbg(scif_info
.mdev
.this_device
,
696 "SCIFAPI fence_wait: ep %p mark 0x%x\n",
698 err
= scif_verify_epd(ep
);
702 * Management node loopback does not need to use DMA.
703 * The only valid mark provided is 0 so simply
704 * return success if the mark is valid.
706 if (scifdev_self(ep
->remote_dev
) && scif_is_mgmt_node()) {
707 if (mark
== SCIF_LOOPB_MAGIC_MARK
)
712 if (mark
& SCIF_REMOTE_FENCE
)
713 err
= scif_send_fence_wait(epd
, mark
);
715 err
= _scif_fence_wait(epd
, mark
);
717 dev_err(scif_info
.mdev
.this_device
,
718 "%s %d err %d\n", __func__
, __LINE__
, err
);
721 EXPORT_SYMBOL_GPL(scif_fence_wait
);
723 int scif_fence_signal(scif_epd_t epd
, off_t loff
, u64 lval
,
724 off_t roff
, u64 rval
, int flags
)
726 struct scif_endpt
*ep
= (struct scif_endpt
*)epd
;
729 dev_dbg(scif_info
.mdev
.this_device
,
730 "SCIFAPI fence_signal: ep %p loff 0x%lx lval 0x%llx roff 0x%lx rval 0x%llx flags 0x%x\n",
731 ep
, loff
, lval
, roff
, rval
, flags
);
732 err
= scif_verify_epd(ep
);
737 if (flags
& ~(SCIF_FENCE_INIT_SELF
| SCIF_FENCE_INIT_PEER
|
738 SCIF_SIGNAL_LOCAL
| SCIF_SIGNAL_REMOTE
))
741 /* At least one of init self or peer RMA should be set */
742 if (!(flags
& (SCIF_FENCE_INIT_SELF
| SCIF_FENCE_INIT_PEER
)))
745 /* Exactly one of init self or peer RMA should be set but not both */
746 if ((flags
& SCIF_FENCE_INIT_SELF
) && (flags
& SCIF_FENCE_INIT_PEER
))
749 /* At least one of SCIF_SIGNAL_LOCAL or SCIF_SIGNAL_REMOTE required */
750 if (!(flags
& (SCIF_SIGNAL_LOCAL
| SCIF_SIGNAL_REMOTE
)))
753 /* Only Dword offsets allowed */
754 if ((flags
& SCIF_SIGNAL_LOCAL
) && (loff
& (sizeof(u32
) - 1)))
757 /* Only Dword aligned offsets allowed */
758 if ((flags
& SCIF_SIGNAL_REMOTE
) && (roff
& (sizeof(u32
) - 1)))
761 if (flags
& SCIF_FENCE_INIT_PEER
) {
762 err
= scif_send_fence_signal(epd
, roff
, rval
, loff
,
765 /* Local Signal in Local RAS */
766 if (flags
& SCIF_SIGNAL_LOCAL
) {
767 err
= scif_prog_signal(epd
, loff
, lval
,
773 /* Signal in Remote RAS */
774 if (flags
& SCIF_SIGNAL_REMOTE
)
775 err
= scif_prog_signal(epd
, roff
,
776 rval
, SCIF_WINDOW_PEER
);
780 dev_err(scif_info
.mdev
.this_device
,
781 "%s %d err %d\n", __func__
, __LINE__
, err
);
784 EXPORT_SYMBOL_GPL(scif_fence_signal
);