[PATCH -mm 09/11] call blk_queue_segment_boundary in __scsi_alloc_queue

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: FUJITA Tomonori
Date: Wednesday, October 24, 2007 - 3:48 am

request_queue and device struct must have the same value of a segment
size limit. This patch adds blk_queue_segment_boundary in
__scsi_alloc_queue so LLDs don't need to call both
blk_queue_segment_boundary and set_dma_max_seg_size. A LLD can change
the default value (64KB) can call device_dma_parameters accessors like
pci_set_dma_max_seg_size when allocating scsi_host.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
---
 drivers/scsi/scsi_lib.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 61fdaf0..23a30ab 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1645,6 +1645,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;
 
 	q = blk_init_queue(request_fn, NULL);
 	if (!q)
@@ -1673,6 +1674,8 @@ struct request_queue *__scsi_alloc_queue(struct Scsi_Host *shost,
 	blk_queue_bounce_limit(q, scsi_calculate_bounce_limit(shost));
 	blk_queue_segment_boundary(q, shost->dma_boundary);
 
+	blk_queue_max_segment_size(q, dma_get_max_seg_size(dev));
+
 	if (!shost->use_clustering)
 		clear_bit(QUEUE_FLAG_CLUSTER, &q->queue_flags);
 	return q;
-- 
1.5.2.4

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH -mm 0/11] fix iommu sg merging problem, FUJITA Tomonori, (Wed Oct 24, 3:47 am)
[PATCH -mm 01/11] add device_dma_parameters structure, FUJITA Tomonori, (Wed Oct 24, 3:48 am)
[PATCH -mm 02/11] PCI: add device_dma_parameters support, FUJITA Tomonori, (Wed Oct 24, 3:48 am)
[PATCH -mm 09/11] call blk_queue_segment_boundary in __scs ..., FUJITA Tomonori, (Wed Oct 24, 3:48 am)
[PATCH -mm 11/11] aacraid: use pci_set_dma_max_seg_size, FUJITA Tomonori, (Wed Oct 24, 3:48 am)
Re: [PATCH -mm 11/11] aacraid: use pci_set_dma_max_seg_size, FUJITA Tomonori, (Wed Oct 24, 4:35 am)
Re: [PATCH -mm 0/11] fix iommu sg merging problem, Jeff Garzik, (Wed Oct 24, 4:40 am)
Re: [PATCH -mm 0/11] fix iommu sg merging problem, Jens Axboe, (Wed Oct 24, 6:24 am)
Re: [PATCH -mm 02/11] PCI: add device_dma_parameters support, FUJITA Tomonori, (Wed Oct 24, 6:41 am)
Re: [PATCH -mm 0/11] fix iommu sg merging problem, FUJITA Tomonori, (Wed Oct 24, 7:32 am)
Re: [PATCH -mm 09/11] call blk_queue_segment_boundary in ..., FUJITA Tomonori, (Wed Oct 24, 7:36 am)
RE: [PATCH -mm 11/11] aacraid: use pci_set_dma_max_seg_size, FUJITA Tomonori, (Wed Oct 24, 9:21 am)