From: Jens Axboe <jens.axboe@oracle.com>
To: FUJITA Tomonori <tomof@acm.org>
Cc: jeff@garzik.org, akpm@linux-foundation.org,
linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org,
James.Bottomley@SteelEye.com, fujita.tomonori@lab.ntt.co.jp
Subject: Re: [PATCH -mm 09/11] call blk_queue_segment_boundary in __scsi_alloc_queue
Date: Wed, 24 Oct 2007 16:28:11 +0200 [thread overview]
Message-ID: <20071024142811.GD14671@kernel.dk> (raw)
In-Reply-To: <20071024231724T.tomof@acm.org>
On Wed, Oct 24 2007, FUJITA Tomonori wrote:
> On Wed, 24 Oct 2007 07:39:16 -0400
> Jeff Garzik <jeff@garzik.org> wrote:
>
> > FUJITA Tomonori wrote:
> > > 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));
> > > +
> >
> > it would be nice to have something more general that's useable in
> > drivers/block/sx8.c (for example), something like
> >
> > static inline void
> > dev_blk_associate(struct device *dev, request_queue *q)
> > {
> > blk_queue_max_segment_size(q,
> > dma_get_max_seg_size(dev));
> > }
> >
> > still, I will ACK the above patch (#9) in case you wish that to become a
> > future cleanup, or others dislike this suggestion
>
> Yeah, I thought about something like that. But I can't find many
> non-scsi drivers (ide, sx8, mmc/card/, anymore?) doing dma and having
> the restrictions so I just call blk_queue_max_segment_size here.
>
> Either is ok with me. I'll modify the patch if Jens prefers such
> function. Jens?
If there's a use for it, sure.
--
Jens Axboe
next prev parent reply other threads:[~2007-10-24 14:28 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 ` [PATCH -mm 09/11] call blk_queue_segment_boundary in __scsi_alloc_queue FUJITA Tomonori
2007-10-24 11:39 ` Jeff Garzik
2007-10-24 14:15 ` FUJITA Tomonori
2007-10-24 14:28 ` Jens Axboe [this message]
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=20071024142811.GD14671@kernel.dk \
--to=jens.axboe@oracle.com \
--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 \
--cc=tomof@acm.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;
as well as URLs for NNTP newsgroup(s).