Skip to contentSkip to conversation

: Use correct DMA device in SCSI/libata

PATCH RESEND In review Lin Ming 2 participants 5 messages Apr 12, 2012 – Apr 21, 2012

Subsystems (2)
lore
Share & tools
lore

Lin Ming

author
#0 lore raw

cover : Use correct DMA device in SCSI/libata

Hi,

RESEND: add Jeff's ACK.

These 2 patches fix bug report at:

http://marc.info/?l=linux-ide&m=133177818318187&w=2

Please see the patches for more detail.

[PATCH 1/2] [SCSI] scsi_lib: use correct DMA device in __scsi_alloc_queue [PATCH 2/2] libata: Pass correct DMA device to scsi host

 drivers/ata/libata-scsi.c |    3 ++-
 drivers/scsi/scsi_lib.c   |    2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

Thanks,
Lin Ming

author
#1 lore raw

PATCH RESEND 1/2 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

---
 drivers/scsi/scsi_lib.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/scsi/scsi_lib.c +1 -1
index ead6405..5dfd749 100644
@@ -1638,7 +1638,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)
Signature · 6 lines
1.7.2.5

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
author
#2 lore raw

PATCH RESEND 2/2 libata: Pass correct DMA device to scsi host

In reply to Lin Ming

Use scsi_add_host_with_dma in ata_scsi_add_hosts to pass in the correct DMA device(ATA host).

Bug report: http://marc.info/?l=linux-ide&m=133177818318187&w=2

---
 drivers/ata/libata-scsi.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/ata/libata-scsi.c +2 -1
index 1ee00c8..dae08a6 100644
@@ -3399,7 +3399,8 @@ int ata_scsi_add_hosts(struct ata_host *host, struct scsi_host_template *sht)
 		 */
 		shost->max_host_blocked = 1;
 
-		rc = scsi_add_host(ap->scsi_host, &ap->tdev);
+		rc = scsi_add_host_with_dma(ap->scsi_host,
+						&ap->tdev, ap->host->dev);
 		if (rc)
 			goto err_add;
 	}
Signature · 1 line
1.7.2.5
author
#3 lore raw
In reply to Lin Ming
Quoted 3 lines · Lin Ming

Hi,

RESEND: add Jeff's ACK.

James, ping?

Lin Ming

Quoted 10 lines

These 2 patches fix bug report at:

http://marc.info/?l=linux-ide&m=133177818318187&w=2

Please see the patches for more detail.

[PATCH 1/2] [SCSI] scsi_lib: use correct DMA device in __scsi_alloc_queue [PATCH 2/2] libata: Pass correct DMA device to scsi host

Quoted 6 lines

 drivers/ata/libata-scsi.c |    3 ++-
 drivers/scsi/scsi_lib.c   |    2 +-

 2 files changed, 3 insertions(+), 2 deletions(-)

Thanks,
Lin Ming

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw
Quoted 22 lines · Lin Ming
Quoted 3 lines · Lin Ming

Hi,

RESEND: add Jeff's ACK.

James, ping?

Lin Ming

Quoted 13 lines

These 2 patches fix bug report at:

http://marc.info/?l=linux-ide&m=133177818318187&w=2

Please see the patches for more detail.

[PATCH 1/2] [SCSI] scsi_lib: use correct DMA device in __scsi_alloc_queue [PATCH 2/2] libata: Pass correct DMA device to scsi host

  drivers/ata/libata-scsi.c |    3 ++-
  drivers/scsi/scsi_lib.c   |    2 +-
  2 files changed, 3 insertions(+), 2 deletions(-)

James, ping ping?

These simple bug fixes have been sent to you and linux-scsi, and ACK'd several times.

Should I send directly to Linus?

Jeff