On Tue, 11 Nov 2008 18:41:49 +0900 FUJITA Tomonori <fujita.tomonori@xxxxxxxxxxxxx> wrote: > > + req_sg_cnt = dma_map_sg(&ha->pdev->dev, service->sg_req, > > + service->req_sg_cnt, DMA_TO_DEVICE); > > + if (!req_sg_cnt) > > + goto pt_error1; > > + rsp_sg_cnt = dma_map_sg(&ha->pdev->dev, service->sg_rsp, > > + service->rsp_sg_cnt, DMA_FROM_DEVICE); > > + if (!rsp_sg_cnt) > > + goto pt_error2; > > + > > + copy_size = sg_copy_to_buffer(service->sg_req, req_sg_cnt, > > + els_pkt, 20); > > You need to use service->sg_rsp instead of req_sg_cnt here. Oops, I meant that you need to use service->req_sg_cnt instead of req_sg_cnt (the returned value of dma_map_sg). > sg_copy_to_buffer takes the number entry of scatter gather. dma_map_sg > returns the number of physical segments mapped. They could be > different (when IOMMU merges the entries). -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html