scsi: wd719x: Stop using the SCSI pointer
Move the DMA handle into the per-command private data instead of using the SCSI pointer from struct scsi_cmnd. This patch prepares for removal of the SCSI pointer from struct scsi_cmnd. Link: https://lore.kernel.org/r/20220218195117.25689-47-bvanassche@acm.org Cc: Ondrej Zary <linux@zary.sk> Cc: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
Родитель
5dfcf1ad93
Коммит
70d1b920af
|
@ -196,7 +196,7 @@ static void wd719x_finish_cmd(struct wd719x_scb *scb, int result)
|
|||
dma_unmap_single(&wd->pdev->dev, scb->phys,
|
||||
sizeof(struct wd719x_scb), DMA_BIDIRECTIONAL);
|
||||
scsi_dma_unmap(cmd);
|
||||
dma_unmap_single(&wd->pdev->dev, cmd->SCp.dma_handle,
|
||||
dma_unmap_single(&wd->pdev->dev, scb->dma_handle,
|
||||
SCSI_SENSE_BUFFERSIZE, DMA_FROM_DEVICE);
|
||||
|
||||
cmd->result = result << 16;
|
||||
|
@ -229,11 +229,11 @@ static int wd719x_queuecommand(struct Scsi_Host *sh, struct scsi_cmnd *cmd)
|
|||
|
||||
/* map sense buffer */
|
||||
scb->sense_buf_length = SCSI_SENSE_BUFFERSIZE;
|
||||
cmd->SCp.dma_handle = dma_map_single(&wd->pdev->dev, cmd->sense_buffer,
|
||||
SCSI_SENSE_BUFFERSIZE, DMA_FROM_DEVICE);
|
||||
if (dma_mapping_error(&wd->pdev->dev, cmd->SCp.dma_handle))
|
||||
scb->dma_handle = dma_map_single(&wd->pdev->dev, cmd->sense_buffer,
|
||||
SCSI_SENSE_BUFFERSIZE, DMA_FROM_DEVICE);
|
||||
if (dma_mapping_error(&wd->pdev->dev, scb->dma_handle))
|
||||
goto out_unmap_scb;
|
||||
scb->sense_buf = cpu_to_le32(cmd->SCp.dma_handle);
|
||||
scb->sense_buf = cpu_to_le32(scb->dma_handle);
|
||||
|
||||
/* request autosense */
|
||||
scb->SCB_options |= WD719X_SCB_FLAGS_AUTO_REQUEST_SENSE;
|
||||
|
@ -288,7 +288,7 @@ static int wd719x_queuecommand(struct Scsi_Host *sh, struct scsi_cmnd *cmd)
|
|||
return 0;
|
||||
|
||||
out_unmap_sense:
|
||||
dma_unmap_single(&wd->pdev->dev, cmd->SCp.dma_handle,
|
||||
dma_unmap_single(&wd->pdev->dev, scb->dma_handle,
|
||||
SCSI_SENSE_BUFFERSIZE, DMA_FROM_DEVICE);
|
||||
out_unmap_scb:
|
||||
dma_unmap_single(&wd->pdev->dev, scb->phys, sizeof(*scb),
|
||||
|
|
|
@ -56,6 +56,7 @@ struct wd719x_scb {
|
|||
u8 flags[2]; /* 62-63 SCB specific flags (local to each thread) */
|
||||
/* everything below is for driver use (not used by card) */
|
||||
dma_addr_t phys; /* bus address of the SCB */
|
||||
dma_addr_t dma_handle;
|
||||
struct scsi_cmnd *cmd; /* a copy of the pointer we were passed */
|
||||
struct list_head list;
|
||||
struct wd719x_sglist sg_list[WD719X_SG] __aligned(8); /* SG list */
|
||||
|
|
Загрузка…
Ссылка в новой задаче