diff options
author | David Dillow <dillowda@ornl.gov> | 2010-10-18 08:54:49 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2010-10-25 01:14:23 -0400 |
commit | 19081f31ce941a22bfc681d18ae2d31e31084df5 (patch) | |
tree | c544fc751f6e4fa056f8ad64e3700fc6c8caa787 /drivers/infiniband/ulp | |
parent | 21c1a90769e680e7c1f49bae4c5804cf0c7bc814 (diff) |
IB/srp: Sync buffer before posting send
srp_send_tsk_mgmt() was missing the proper DMA sync calls before posting
the buffer to the device.
Signed-off-by: David Dillow <dillowda@ornl.gov>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/ulp')
-rw-r--r-- | drivers/infiniband/ulp/srp/ib_srp.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 9b4bc5ae5b10..cfc1d65c4577 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c | |||
@@ -1442,6 +1442,7 @@ static int srp_cm_handler(struct ib_cm_id *cm_id, struct ib_cm_event *event) | |||
1442 | static int srp_send_tsk_mgmt(struct srp_target_port *target, | 1442 | static int srp_send_tsk_mgmt(struct srp_target_port *target, |
1443 | struct srp_request *req, u8 func) | 1443 | struct srp_request *req, u8 func) |
1444 | { | 1444 | { |
1445 | struct ib_device *dev = target->srp_host->srp_dev->dev; | ||
1445 | struct srp_iu *iu; | 1446 | struct srp_iu *iu; |
1446 | struct srp_tsk_mgmt *tsk_mgmt; | 1447 | struct srp_tsk_mgmt *tsk_mgmt; |
1447 | 1448 | ||
@@ -1459,6 +1460,8 @@ static int srp_send_tsk_mgmt(struct srp_target_port *target, | |||
1459 | if (!iu) | 1460 | if (!iu) |
1460 | goto out; | 1461 | goto out; |
1461 | 1462 | ||
1463 | ib_dma_sync_single_for_cpu(dev, iu->dma, sizeof *tsk_mgmt, | ||
1464 | DMA_TO_DEVICE); | ||
1462 | tsk_mgmt = iu->buf; | 1465 | tsk_mgmt = iu->buf; |
1463 | memset(tsk_mgmt, 0, sizeof *tsk_mgmt); | 1466 | memset(tsk_mgmt, 0, sizeof *tsk_mgmt); |
1464 | 1467 | ||
@@ -1468,6 +1471,8 @@ static int srp_send_tsk_mgmt(struct srp_target_port *target, | |||
1468 | tsk_mgmt->tsk_mgmt_func = func; | 1471 | tsk_mgmt->tsk_mgmt_func = func; |
1469 | tsk_mgmt->task_tag = req->index; | 1472 | tsk_mgmt->task_tag = req->index; |
1470 | 1473 | ||
1474 | ib_dma_sync_single_for_device(dev, iu->dma, sizeof *tsk_mgmt, | ||
1475 | DMA_TO_DEVICE); | ||
1471 | if (__srp_post_send(target, iu, sizeof *tsk_mgmt)) | 1476 | if (__srp_post_send(target, iu, sizeof *tsk_mgmt)) |
1472 | goto out; | 1477 | goto out; |
1473 | 1478 | ||