Thread (3 messages) 3 messages, 2 authors, 2012-03-22

Re: [PATCH] [SCSI] scsi_lib: use correct DMA device in __scsi_alloc_queue

From: Lin Ming <hidden>
Date: 2012-03-22 15:28:53
Also in: linux-scsi

On Thu, Mar 22, 2012 at 7:24 PM, Sergei Shtylyov [off-list ref] wrote:
Hello.


On 22-03-2012 9:52, Lin Ming wrote:
quoted
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.
quoted
Since commit d139b9b([SCSI] scsi_lib_dma: fix bug with dma maps on
nested scsi objects), a new field Scsi_Host->dma_device was introduced

  Only the field is named 'dma_dev', isn't it?
Yes, my typo.
quoted
to refer to the real DMA device.
quoted
Use ->dma_device in __scsi_alloc_queue to correctly set segment
boundary.
quoted
And use scsi_add_host_with_dma in ata_scsi_add_hosts to pass in the
correct DMA device.

  Perhaps this should be split into two patches.
Good idea.

Will split and resend.

Thanks,
Lin Ming
quoted
Bug report: http://marc.info/?l=linux-ide&m=133177818318187&w=2
quoted
Reported-and-tested-by: Jörg Sommer<redacted>
Signed-off-by: Lin Ming<redacted>
[...]

quoted
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index f85cfa6..486088b 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1642,7 +1642,7 @@ struct request_queue *__scsi_alloc_queue(struct
Scsi_Host *shost,
                                        request_fn_proc *request_fn)
 {
       struct request_queue *q;
-       struct device *dev = shost->shost_gendev.parent;
+       struct device *dev = shost->dma_dev;

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

WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help