From: James Bottomley <James.Bottomley@SteelEye.com>
To: Kay Sievers <kay.sievers@vrfy.org>
Cc: Greg KH <gregkh@suse.de>, Matthew Wilcox <matthew@wil.cx>,
FUJITA Tomonori <tomof@acm.org>,
jens.axboe@oracle.com, hch@infradead.org, jeff@garzik.org,
hare@suse.de, linux-scsi@vger.kernel.org,
fujita.tomonori@lab.ntt.co.jp
Subject: Re: [PATCH 3/5] add sg segment limitation info to device structure
Date: Tue, 02 Oct 2007 10:14:32 -0500 [thread overview]
Message-ID: <1191338072.3530.77.camel@localhost.localdomain> (raw)
In-Reply-To: <1191337830.4093.19.camel@lov.localdomain>
On Tue, 2007-10-02 at 17:10 +0200, Kay Sievers wrote:
> On Tue, 2007-10-02 at 10:05 -0500, James Bottomley wrote:
> > On Tue, 2007-10-02 at 17:02 +0200, Kay Sievers wrote:
> > > On 10/2/07, James Bottomley <James.Bottomley@steeleye.com> wrote:
> > > > On Mon, 2007-10-01 at 21:22 -0700, Greg KH wrote:
> > > > > On Mon, Oct 01, 2007 at 07:39:02PM -0600, Matthew Wilcox wrote:
> > > > > > On Mon, Oct 01, 2007 at 07:36:10PM -0400, James Bottomley wrote:
> > > > > > > One possibility we could do is to add a
> > > > > > >
> > > > > > > struct dma_device {
> > > > > > > struct device dev;
> > > > > > > u64 dma_mask;
> > > > > > > u64 coherent_dma_mask;
> > > > > > > unsigned int max_segment_size;
> > > > > > > /* plus any other DMA parameters */
> > > > > > > };
> > > > > > >
> > > > > > > but then every bus that can do DMA would need to include a struct
> > > > > > > dma_device instead of the struct device they do now. Then the IOMMU
> > > > > > > would know it could cast out from struct device to struct dma_device,
> > > > > > > but this would be a lot of work to thread through the current
> > > > > > > infrastructure.
> > > > >
> > > > > Why not just hang these fields off of a struct device, that way if the
> > > > > device doesn't/can't do dma, it only has the "loss" of a single pointer,
> > > > > not all of these fields?
> > > >
> > > > Well, that's just a bit ugly ... I assume you're thinking of adding a
> > > > struct device_dma_parameters, and then defining the platform device as
> > > >
> > > > struct pci_dev {
> > > > ...
> > > > struct device dev;
> > > > struct device_dma_parameters dma_parms;
> > > > ...
> > > > };
> > > >
> > > > and then setting up the pointer?
> > >
> > > I guess Greg means:
> > > struct device {
> > > ...
> > > struct device_dma_parameters *dma_parms;
> > > }
> > >
> > > and allocate dma_parms on demand.
> >
> > But they're demanded by every bus (with the possible exception of
> > PCMCIA) because they'll be holding the dma mask. Sure, we could do a
> > separate allocation in every bus device creation routine, but isn't that
> > even more complex than sticking them in the global allocation of the bus
> > device because the failure modes are now more complex?
>
> Hmm, SCSI devices are bus devices too, will they need it?
Actually, I don't think of SCSI devices as bus devices ... but the
answer's no, they don't. Only devices on a DMA'able bus (like PCI,
parisc, sbus etc.)
James
next prev parent reply other threads:[~2007-10-02 15:14 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-26 8:58 [PATCH 3/5] add sg segment limitation info to device structure FUJITA Tomonori
2007-09-26 16:05 ` Greg KH
2007-09-27 0:37 ` FUJITA Tomonori
2007-10-01 23:36 ` James Bottomley
2007-10-02 1:39 ` Matthew Wilcox
2007-10-02 4:22 ` Greg KH
2007-10-02 14:45 ` James Bottomley
2007-10-02 15:02 ` Kay Sievers
2007-10-02 15:05 ` James Bottomley
2007-10-02 15:10 ` Kay Sievers
2007-10-02 15:14 ` James Bottomley [this message]
2007-10-02 15:23 ` Kay Sievers
2007-10-02 15:25 ` Matthew Wilcox
2007-10-02 16:44 ` Greg KH
2007-10-03 14:19 ` FUJITA Tomonori
2007-10-03 17:57 ` Jeff Garzik
2007-10-03 21:50 ` Greg KH
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=1191338072.3530.77.camel@localhost.localdomain \
--to=james.bottomley@steeleye.com \
--cc=fujita.tomonori@lab.ntt.co.jp \
--cc=gregkh@suse.de \
--cc=hare@suse.de \
--cc=hch@infradead.org \
--cc=jeff@garzik.org \
--cc=jens.axboe@oracle.com \
--cc=kay.sievers@vrfy.org \
--cc=linux-scsi@vger.kernel.org \
--cc=matthew@wil.cx \
--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