public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: FUJITA Tomonori <tomof@acm.org>
To: akpm@linux-foundation.org
Cc: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org,
	James.Bottomley@SteelEye.com, jeff@garzik.org,
	fujita.tomonori@lab.ntt.co.jp
Subject: [PATCH -mm 09/11] call blk_queue_segment_boundary in __scsi_alloc_queue
Date: Wed, 24 Oct 2007 19:48:30 +0900	[thread overview]
Message-ID: <20071024172611B.tomof@acm.org> (raw)
In-Reply-To: <67bb10d9f4e9473ddc84d9839114602c1966f19f.tomof@acm.org>

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


  parent reply	other threads:[~2007-10-24 10:49 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-24 10:47 [PATCH -mm 0/11] fix iommu sg merging problem FUJITA Tomonori
2007-10-24 10:48 ` [PATCH -mm 01/11] add device_dma_parameters structure FUJITA Tomonori
2007-10-24 11:33   ` Jeff Garzik
2007-10-24 10:48 ` [PATCH -mm 02/11] PCI: add device_dma_parameters support FUJITA Tomonori
2007-10-24 11:34   ` Jeff Garzik
2007-10-24 13:41     ` FUJITA Tomonori
2007-10-24 10:48 ` [PATCH -mm 03/11] x86: make pci-gart iommu respect the segment size limits FUJITA Tomonori
2007-10-24 10:48 ` [PATCH -mm 04/11] ppc: make " FUJITA Tomonori
2007-10-24 10:48 ` [PATCH -mm 05/11] IA64: make sba_iommu " FUJITA Tomonori
2007-10-24 10:48 ` [PATCH -mm 06/11] alpha: make pci_iommu " FUJITA Tomonori
2007-10-24 10:48 ` [PATCH -mm 07/11] sparc64: make iommu " FUJITA Tomonori
2007-10-24 10:48 ` [PATCH -mm 08/11] parisc: " FUJITA Tomonori
2007-10-24 11:35   ` Jeff Garzik
2007-10-24 10:48 ` FUJITA Tomonori [this message]
2007-10-24 11:39   ` [PATCH -mm 09/11] call blk_queue_segment_boundary in __scsi_alloc_queue Jeff Garzik
2007-10-24 14:15     ` FUJITA Tomonori
2007-10-24 14:28       ` Jens Axboe
2007-10-24 14:36         ` FUJITA Tomonori
2007-10-24 14:34       ` Jeff Garzik
2007-10-24 10:48 ` [PATCH -mm 10/11] sata_inic162x: use pci_set_dma_max_seg_size FUJITA Tomonori
2007-10-24 11:39   ` Jeff Garzik
2007-10-24 10:48 ` [PATCH -mm 11/11] aacraid: " FUJITA Tomonori
2007-10-24 11:31   ` Jeff Garzik
2007-10-24 11:35     ` FUJITA Tomonori
2007-10-24 13:34     ` Salyzyn, Mark
2007-10-24 13:34   ` Salyzyn, Mark
2007-10-24 16:21     ` FUJITA Tomonori
2007-10-24 16:25       ` Salyzyn, Mark
2007-10-24 11:40 ` [PATCH -mm 0/11] fix iommu sg merging problem Jeff Garzik
2007-10-24 14:32   ` FUJITA Tomonori
2007-10-24 13:24 ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071024172611B.tomof@acm.org \
    --to=tomof@acm.org \
    --cc=James.Bottomley@SteelEye.com \
    --cc=akpm@linux-foundation.org \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=jeff@garzik.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox