Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 271118
b: refs/heads/master
c: 69ca216
h: refs/heads/master
v: v3
  • Loading branch information
Manish Rangankar authored and James Bottomley committed Oct 16, 2011
1 parent 2dc3aeb commit a49e284
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f922da79fd602dddb169f89471e3266cc692750a
refs/heads/master: 69ca216e9bbbe2baf7f441ab57c5d791f439f775
1 change: 1 addition & 0 deletions trunk/drivers/scsi/qla4xxx/ql4_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,7 @@ struct ql4_task_data {
dma_addr_t data_dma;
void *req_buffer;
dma_addr_t req_dma;
uint32_t req_len;
void *resp_buffer;
dma_addr_t resp_dma;
uint32_t resp_len;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/scsi/qla4xxx/ql4_iocb.c
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ int qla4xxx_send_passthru0(struct iscsi_task *task)
passthru_iocb->timeout = cpu_to_le16(PT_DEFAULT_TIMEOUT);

/* Setup the out & in DSDs */
if (task->data_count) {
if (task_data->req_len) {
memcpy((uint8_t *)task_data->req_buffer +
sizeof(struct iscsi_hdr), task->data, task->data_count);
ctrl_flags |= PT_FLAG_SEND_BUFFER;
Expand Down
9 changes: 5 additions & 4 deletions trunk/drivers/scsi/qla4xxx/ql4_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -1272,16 +1272,17 @@ static int qla4xxx_alloc_pdu(struct iscsi_task *task, uint8_t opcode)
DEBUG2(ql4_printk(KERN_INFO, ha, "%s: MaxRecvLen %u, iscsi hrd %d\n",
__func__, task->conn->max_recv_dlength, hdr_len));

task_data->resp_len = task->conn->max_recv_dlength;
task_data->resp_len = task->conn->max_recv_dlength + hdr_len;
task_data->resp_buffer = dma_alloc_coherent(&ha->pdev->dev,
task_data->resp_len,
&task_data->resp_dma,
GFP_ATOMIC);
if (!task_data->resp_buffer)
goto exit_alloc_pdu;

task_data->req_len = task->data_count + hdr_len;
task_data->req_buffer = dma_alloc_coherent(&ha->pdev->dev,
task->data_count + hdr_len,
task_data->req_len,
&task_data->req_dma,
GFP_ATOMIC);
if (!task_data->req_buffer)
Expand All @@ -1299,7 +1300,7 @@ static int qla4xxx_alloc_pdu(struct iscsi_task *task, uint8_t opcode)
task_data->resp_buffer, task_data->resp_dma);

if (task_data->req_buffer)
dma_free_coherent(&ha->pdev->dev, task->data_count + hdr_len,
dma_free_coherent(&ha->pdev->dev, task_data->req_len,
task_data->req_buffer, task_data->req_dma);
return -ENOMEM;
}
Expand Down Expand Up @@ -1328,7 +1329,7 @@ static void qla4xxx_task_cleanup(struct iscsi_task *task)

dma_free_coherent(&ha->pdev->dev, task_data->resp_len,
task_data->resp_buffer, task_data->resp_dma);
dma_free_coherent(&ha->pdev->dev, task->data_count + hdr_len,
dma_free_coherent(&ha->pdev->dev, task_data->req_len,
task_data->req_buffer, task_data->req_dma);
return;
}
Expand Down

0 comments on commit a49e284

Please sign in to comment.