Skip to content

Commit 6f381fa

Browse files
Lin MingJames Bottomley
authored andcommitted
[SCSI] scsi_lib: use correct DMA device in __scsi_alloc_queue
Currently, __scsi_alloc_queue uses SCSI host's parent device as DMA device to set segment boundary. But the parent device may not refer to the DMA device. For example, for ATA disk, SCSI host's parent device now refers to ATA port. Since commit d139b9b([SCSI] scsi_lib_dma: fix bug with dma maps on nested scsi objects), a new field Scsi_Host->dma_dev was introduced to refer to the real DMA device. Use ->dma_dev in __scsi_alloc_queue to correctly set segment boundary. Bug report: http://marc.info/?l=linux-ide&m=133177818318187&w=2 Reported-and-tested-by: Jörg Sommer <[email protected]> Signed-off-by: Lin Ming <[email protected]> Signed-off-by: James Bottomley <[email protected]>
1 parent c6f5c93 commit 6f381fa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/scsi/scsi_lib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1638,7 +1638,7 @@ struct request_queue *__scsi_alloc_queue(struct Scsi_Host *shost,
16381638
request_fn_proc *request_fn)
16391639
{
16401640
struct request_queue *q;
1641-
struct device *dev = shost->shost_gendev.parent;
1641+
struct device *dev = shost->dma_dev;
16421642

16431643
q = blk_init_queue(request_fn, NULL);
16441644
if (!q)

0 commit comments

Comments
 (0)