Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 19081f31 authored by David Dillow's avatar David Dillow Committed by Roland Dreier
Browse files

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: default avatarDavid Dillow <dillowda@ornl.gov>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 21c1a907
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1442,6 +1442,7 @@ static int srp_cm_handler(struct ib_cm_id *cm_id, struct ib_cm_event *event)
static int srp_send_tsk_mgmt(struct srp_target_port *target,
			     struct srp_request *req, u8 func)
{
	struct ib_device *dev = target->srp_host->srp_dev->dev;
	struct srp_iu *iu;
	struct srp_tsk_mgmt *tsk_mgmt;

@@ -1459,6 +1460,8 @@ static int srp_send_tsk_mgmt(struct srp_target_port *target,
	if (!iu)
		goto out;

	ib_dma_sync_single_for_cpu(dev, iu->dma, sizeof *tsk_mgmt,
				   DMA_TO_DEVICE);
	tsk_mgmt = iu->buf;
	memset(tsk_mgmt, 0, sizeof *tsk_mgmt);

@@ -1468,6 +1471,8 @@ static int srp_send_tsk_mgmt(struct srp_target_port *target,
	tsk_mgmt->tsk_mgmt_func = func;
	tsk_mgmt->task_tag 	= req->index;

	ib_dma_sync_single_for_device(dev, iu->dma, sizeof *tsk_mgmt,
				      DMA_TO_DEVICE);
	if (__srp_post_send(target, iu, sizeof *tsk_mgmt))
		goto out;