* Re: [linux-usb-devel] Re: "sr: unaligned transfer" in 2.5.2-pre1
2001-12-31 22:54 ` [linux-usb-devel] " Matthew Dharm
@ 2001-12-31 23:59 ` Andre Hedrick
2002-01-01 17:39 ` Jens Axboe
2002-01-01 17:40 ` Jens Axboe
2002-01-01 19:53 ` David Brownell
2 siblings, 1 reply; 34+ messages in thread
From: Andre Hedrick @ 2001-12-31 23:59 UTC (permalink / raw)
To: Matthew Dharm; +Cc: linux-kernel, linux-usb-devel
Matt,
This was a point I tried to make but failed.
Not all SCB/SRB's are highmem tested but OEM's claim support.
This I tried to have BIO change to do highmen drop to the lowmem window
upon entry of the request and this would have prevent most form breaking,
but this did not seem to get warm acceptance.
Regards,
Andre Hedrick
Linux ATA Development
On Mon, 31 Dec 2001, Matthew Dharm wrote:
> Jens --
>
> Thanks for the info. It may have been discussed 'here' (tho, this is
> crosposted to two different lists), but I've been focused on 2.4 bugs (one
> more left!) and hadn't seen this item.
>
> I think for the first 2.5 kernels, we'll o with your 'vaddr' line, but I
> think that being able to set highmem_io is a worthwhile thing. Which leads
> me to two questions:
> (1) Do the USB HCDs support highmem? I seem to recall they do, but I'm not
> certain.
> (2) How do I pass a highmem address to the HCDs? The URB structures we use
> don't seem particularly well-suited for this.
>
> Matt
>
> On Mon, Dec 31, 2001 at 12:51:57PM +0100, Jens Axboe wrote:
> > On Sun, Dec 30 2001, Matthew Dharm wrote:
> > > If it shouldn't be used, it should be removed from the structure to force
> > > people to change.
> >
> > It will be soonish. Davem has practically finished this already.
> >
> > > This is probably why usb-storage broke, and it wasn't obvious to me what
> > > went wrong.
> >
> > It's been discussed here before, both wrt 2.5 and 2.4 with the block
> > highmem patches.
> >
> > > So now I guess I need to either (a) compute the address for the USB layer,
> > > or (b) figure out how to pass the memory parameters directly, so we can use
> > > highmem.
> >
> > If you don't set highmem_io in the scsi host structure, then you can
> > always do
> >
> > vaddr = page_address(sg->page) + sg->offset;
> >
> > --
> > Jens Axboe
> >
> >
> > _______________________________________________
> > linux-usb-devel@lists.sourceforge.net
> > To unsubscribe, use the last form field at:
> > https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
>
> --
> Matthew Dharm Home: mdharm-usb@one-eyed-alien.net
> Maintainer, Linux USB Mass Storage Driver
>
> My mother not mind to die for stoppink Windows NT! She is rememberink
> Stalin!
> -- Pitr
> User Friendly, 9/6/1998
>
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [linux-usb-devel] Re: "sr: unaligned transfer" in 2.5.2-pre1
2001-12-31 23:59 ` Andre Hedrick
@ 2002-01-01 17:39 ` Jens Axboe
0 siblings, 0 replies; 34+ messages in thread
From: Jens Axboe @ 2002-01-01 17:39 UTC (permalink / raw)
To: Andre Hedrick; +Cc: Matthew Dharm, linux-kernel, linux-usb-devel
On Mon, Dec 31 2001, Andre Hedrick wrote:
>
> Matt,
>
> This was a point I tried to make but failed.
> Not all SCB/SRB's are highmem tested but OEM's claim support.
> This I tried to have BIO change to do highmen drop to the lowmem window
> upon entry of the request and this would have prevent most form breaking,
> but this did not seem to get warm acceptance.
default behaviour is to bounce any highmem page, nothings changed there.
if you are talking about mapping highmem pages temporarily like
mentioned in an email a few days back, then that's clearly a bad idea.
--
Jens Axboe
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [linux-usb-devel] Re: "sr: unaligned transfer" in 2.5.2-pre1
2001-12-31 22:54 ` [linux-usb-devel] " Matthew Dharm
2001-12-31 23:59 ` Andre Hedrick
@ 2002-01-01 17:40 ` Jens Axboe
2002-01-01 19:53 ` David Brownell
2 siblings, 0 replies; 34+ messages in thread
From: Jens Axboe @ 2002-01-01 17:40 UTC (permalink / raw)
To: Peter Osterlund, Greg KH, linux-kernel, linux-usb-devel
On Mon, Dec 31 2001, Matthew Dharm wrote:
> Jens --
>
> Thanks for the info. It may have been discussed 'here' (tho, this is
> crosposted to two different lists), but I've been focused on 2.4 bugs (one
> more left!) and hadn't seen this item.
oh sorry, 'here' means linux-kernel to me :-)
> I think for the first 2.5 kernels, we'll o with your 'vaddr' line, but I
> think that being able to set highmem_io is a worthwhile thing. Which leads
> me to two questions:
indeed
> (1) Do the USB HCDs support highmem? I seem to recall they do, but I'm not
> certain.
most likely, I don't know though. I would imagine they support full
32-bit dma.
> (2) How do I pass a highmem address to the HCDs? The URB structures we use
> don't seem particularly well-suited for this.
you need to use the pci dma mapping interface, see
Documentation/DMA-mapping.txt
--
Jens Axboe
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [linux-usb-devel] Re: "sr: unaligned transfer" in 2.5.2-pre1
2001-12-31 22:54 ` [linux-usb-devel] " Matthew Dharm
2001-12-31 23:59 ` Andre Hedrick
2002-01-01 17:40 ` Jens Axboe
@ 2002-01-01 19:53 ` David Brownell
2002-01-01 22:34 ` Jens Axboe
2 siblings, 1 reply; 34+ messages in thread
From: David Brownell @ 2002-01-01 19:53 UTC (permalink / raw)
To: linux-kernel, linux-usb-devel; +Cc: Jens Axboe, Matthew Dharm, Greg KH
> (2) How do I pass a highmem address to the HCDs? The URB structures we use
> don't seem particularly well-suited for this.
The urb->transfer_buffer is required to be normal DMA-able memory,
following the rules in Documentation/DMA-mapping.txt ... that got cleared
up somewhere around the 2.4.5 timeframe, all the HCDs now use the
pci_map_single() calls with those buffers. kmalloc() is fine, not vmalloc(),
and so on.
Not that I've seen a writeup about highmem (linux/Documentation doesn't
seem to have one anyway) but if I infer correctly from that DMA-mapping.txt
writeup, URBs don't support it because there's no way to specify buffers as
a "struct page *" or an array of "struct scatterlist". That's the only way that
document identifies to access "highmem memory".
> (1) Do the USB HCDs support highmem? I seem to recall they do, but I'm not
> certain.
If URBs can't describe highmem, the HCD's won't support them per se;
you'd have to turn highmem to "lowmem" or whatever it's called, and
then let the HCDs manage the lowmem-to-dma_addr_t mappings.
Alternatively, in 2.5 we might add "highmem" support to USB. Now that
I've looked at it a few minutes, I suspect we must -- just to support block
devices (usb-storage) fully. Is there more to it than adding page+offset
as an alternative way to describe the transfer_buffer? (And making all
the "single" mapping calls in the HCDs use page mappings.)
- Dave
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [linux-usb-devel] Re: "sr: unaligned transfer" in 2.5.2-pre1
2002-01-01 19:53 ` David Brownell
@ 2002-01-01 22:34 ` Jens Axboe
2002-01-01 23:28 ` Matthew Dharm
2002-01-02 5:27 ` [linux-usb-devel] Re: highmem and usb [was "sr: unaligned transfer" in 2.5.2-pre1] David Brownell
0 siblings, 2 replies; 34+ messages in thread
From: Jens Axboe @ 2002-01-01 22:34 UTC (permalink / raw)
To: David Brownell; +Cc: linux-kernel, linux-usb-devel, Matthew Dharm, Greg KH
On Tue, Jan 01 2002, David Brownell wrote:
> Not that I've seen a writeup about highmem (linux/Documentation
> doesn't seem to have one anyway) but if I infer correctly from that
> DMA-mapping.txt writeup, URBs don't support it because there's no way
> to specify buffers as a "struct page *" or an array of "struct
> scatterlist". That's the only way that document identifies to access
> "highmem memory".
What kind of mapping does URBs require? A virtual mapping?
> > (1) Do the USB HCDs support highmem? I seem to recall they do, but
> > I'm not certain.
>
> If URBs can't describe highmem, the HCD's won't support them per se;
> you'd have to turn highmem to "lowmem" or whatever it's called, and
> then let the HCDs manage the lowmem-to-dma_addr_t mappings.
>
> Alternatively, in 2.5 we might add "highmem" support to USB. Now that
> I've looked at it a few minutes, I suspect we must -- just to support
> block devices (usb-storage) fully. Is there more to it than adding
No, you can always ask to get pages low mem bounced. Highmem is no
requirement, and if your device really can't support it there's no point
in attempting to support it.
> page+offset as an alternative way to describe the transfer_buffer?
no
> (And making all the "single" mapping calls in the HCDs use page
> mappings.)
exactly
--
Jens Axboe
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [linux-usb-devel] Re: "sr: unaligned transfer" in 2.5.2-pre1
2002-01-01 22:34 ` Jens Axboe
@ 2002-01-01 23:28 ` Matthew Dharm
2002-01-02 5:40 ` [linux-usb-devel] Re: highmem and usb [was: "sr: unaligned transfer" in 2.5.2-pre1] David Brownell
2002-01-02 9:30 ` [linux-usb-devel] Re: "sr: unaligned transfer" in 2.5.2-pre1 Jens Axboe
2002-01-02 5:27 ` [linux-usb-devel] Re: highmem and usb [was "sr: unaligned transfer" in 2.5.2-pre1] David Brownell
1 sibling, 2 replies; 34+ messages in thread
From: Matthew Dharm @ 2002-01-01 23:28 UTC (permalink / raw)
To: Jens Axboe; +Cc: David Brownell, linux-kernel, linux-usb-devel, Greg KH
[-- Attachment #1: Type: text/plain, Size: 2183 bytes --]
On Tue, Jan 01, 2002 at 11:34:23PM +0100, Jens Axboe wrote:
> On Tue, Jan 01 2002, David Brownell wrote:
> > Not that I've seen a writeup about highmem (linux/Documentation
> > doesn't seem to have one anyway) but if I infer correctly from that
> > DMA-mapping.txt writeup, URBs don't support it because there's no way
> > to specify buffers as a "struct page *" or an array of "struct
> > scatterlist". That's the only way that document identifies to access
> > "highmem memory".
This sounds like another good reason to have URBs take scatterlists
directly, oddly enough. :)
> > > (1) Do the USB HCDs support highmem? I seem to recall they do, but
> > > I'm not certain.
> >
> > If URBs can't describe highmem, the HCD's won't support them per se;
> > you'd have to turn highmem to "lowmem" or whatever it's called, and
> > then let the HCDs manage the lowmem-to-dma_addr_t mappings.
> >
> > Alternatively, in 2.5 we might add "highmem" support to USB. Now that
> > I've looked at it a few minutes, I suspect we must -- just to support
> > block devices (usb-storage) fully. Is there more to it than adding
>
> No, you can always ask to get pages low mem bounced. Highmem is no
> requirement, and if your device really can't support it there's no point
> in attempting to support it.
I presume there is some overhead in bouncing to lowmem? I imagine that
highmem support for the HCDs wouldn't be that difficult -- they are just
PCI devices, after all.
I'd rather eliminate as much overhead as possible -- I already get
complaints from performance fanatics about the inability of usb-storage to
get past 92% bus saturation (sustained), and the problem will only get
worse on USB 2.0
> > page+offset as an alternative way to describe the transfer_buffer?
>
> no
Hrm... isn't that what one of the patches sent did? Or does that only work
for lowmem allocations described by the structure?
Matt
--
Matthew Dharm Home: mdharm-usb@one-eyed-alien.net
Maintainer, Linux USB Mass Storage Driver
Umm, these aren't the droids you're looking for.
-- Bill Gates
User Friendly, 11/14/1998
[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [linux-usb-devel] Re: highmem and usb [was: "sr: unaligned transfer" in 2.5.2-pre1]
2002-01-01 23:28 ` Matthew Dharm
@ 2002-01-02 5:40 ` David Brownell
2002-01-02 9:27 ` [linux-usb-devel] Re: highmem and usb [was:"sr: unalignedtransfer" " Oliver.Neukum
2002-01-02 9:31 ` [linux-usb-devel] Re: highmem and usb [was: "sr: unaligned transfer" " Jens Axboe
2002-01-02 9:30 ` [linux-usb-devel] Re: "sr: unaligned transfer" in 2.5.2-pre1 Jens Axboe
1 sibling, 2 replies; 34+ messages in thread
From: David Brownell @ 2002-01-02 5:40 UTC (permalink / raw)
To: Matthew Dharm, Jens Axboe; +Cc: linux-kernel, linux-usb-devel, Greg KH
> > > Not that I've seen a writeup about highmem (linux/Documentation
> > > doesn't seem to have one anyway) but if I infer correctly from that
> > > DMA-mapping.txt writeup, URBs don't support it because there's no way
> > > to specify buffers as a "struct page *" or an array of "struct
> > > scatterlist". That's the only way that document identifies to access
> > > "highmem memory".
>
> This sounds like another good reason to have URBs take scatterlists
> directly, oddly enough. :)
If it's got to be done, I'd much rather it were "page + offset", so that the
usbcore code can be simpler. We know how to turn scatterlists into
bulk queued requests, so there's no need for anything more ... :)
> > No, you can always ask to get pages low mem bounced. Highmem is no
> > requirement, and if your device really can't support it there's no point
> > in attempting to support it.
>
> I presume there is some overhead in bouncing to lowmem? I imagine that
> highmem support for the HCDs wouldn't be that difficult -- they are just
> PCI devices, after all.
I'm unclear on what "bouncing to lowmem" involves, but I'd rather avoid
teaching all three HCDs a second model for addressing transfer buffers.
At least until later in the 2.5 series, when we believe they'll share a lot
more common code and so that new model can be taught to just ONE
piece of code. Fixing bugs in one place easier than in three!
> I'd rather eliminate as much overhead as possible -- I already get
> complaints from performance fanatics about the inability of usb-storage to
> get past 92% bus saturation (sustained), and the problem will only get
> worse on USB 2.0
Well then you'll be glad to see a patch from me, soonish, that teaches
the usb-storage "transport" code to use bulk queueing. That'll get the
bandwidth utilization up as high as it can get. It won't address any of
these highmem issues though.
- Dave
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [linux-usb-devel] Re: highmem and usb [was:"sr: unalignedtransfer" in 2.5.2-pre1]
2002-01-02 5:40 ` [linux-usb-devel] Re: highmem and usb [was: "sr: unaligned transfer" in 2.5.2-pre1] David Brownell
@ 2002-01-02 9:27 ` Oliver.Neukum
2002-01-02 18:43 ` David Brownell
2002-01-02 9:31 ` [linux-usb-devel] Re: highmem and usb [was: "sr: unaligned transfer" " Jens Axboe
1 sibling, 1 reply; 34+ messages in thread
From: Oliver.Neukum @ 2002-01-02 9:27 UTC (permalink / raw)
To: David Brownell
Cc: Matthew Dharm, Jens Axboe, linux-kernel, linux-usb-devel, Greg KH
> > I presume there is some overhead in bouncing to lowmem? I imagine that
> > highmem support for the HCDs wouldn't be that difficult -- they are just
> > PCI devices, after all.
>
> I'm unclear on what "bouncing to lowmem" involves, but I'd rather avoid
> teaching all three HCDs a second model for addressing transfer buffers.
AFAIK bouncing means a plain, physical copy.
Either the HCDs can do 64bit DMA or they can't.
Do you really expect there to be a significant number of 32bit machines
whose HCD can do 64bit DMA ?
If not, it's IMHO not worth doing it as you'd have either two kinds of
urbs or overhead in the common case.
On 64Bit machines we might have to deal with HCDs who can do 32Bit DMA
only. Perhaps there should be a gfp field in the usb_device struct
to export knowledge about the memory the HCD can cope with.
> > I'd rather eliminate as much overhead as possible -- I already get
> > complaints from performance fanatics about the inability of usb-storage to
> > get past 92% bus saturation (sustained), and the problem will only get
> > worse on USB 2.0
>
> Well then you'll be glad to see a patch from me, soonish, that teaches
> the usb-storage "transport" code to use bulk queueing. That'll get the
> bandwidth utilization up as high as it can get. It won't address any of
> these highmem issues though.
And there's the overhead of sleeping and waking a kernel thread. Larger io
requests might help, but I am not sure.
Regards
Oliver
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [linux-usb-devel] Re: highmem and usb [was:"sr: unalignedtransfer" in 2.5.2-pre1]
2002-01-02 9:27 ` [linux-usb-devel] Re: highmem and usb [was:"sr: unalignedtransfer" " Oliver.Neukum
@ 2002-01-02 18:43 ` David Brownell
0 siblings, 0 replies; 34+ messages in thread
From: David Brownell @ 2002-01-02 18:43 UTC (permalink / raw)
To: Oliver.Neukum
Cc: Matthew Dharm, Jens Axboe, linux-kernel, linux-usb-devel, Greg KH
> > > I'd rather eliminate as much overhead as possible -- I already get
> > > complaints from performance fanatics about the inability of usb-storage to
> > > get past 92% bus saturation (sustained), and the problem will only get
> > > worse on USB 2.0
> >
> > Well then you'll be glad to see a patch from me, soonish, that teaches
> > the usb-storage "transport" code to use bulk queueing. That'll get the
> > bandwidth utilization up as high as it can get. It won't address any of
> > these highmem issues though.
>
> And there's the overhead of sleeping and waking a kernel thread. Larger io
> requests might help, but I am not sure.
Yes, it's that sleep/wake between scatterlist segments that's creating
that 92% (at 12 Mbit/sec) or about 20% (at 480 Mbit/sec :) bottleneck ...
Convert those calls to use bulk queuing, and those delays vanish.
- Dave
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [linux-usb-devel] Re: highmem and usb [was: "sr: unaligned transfer" in 2.5.2-pre1]
2002-01-02 5:40 ` [linux-usb-devel] Re: highmem and usb [was: "sr: unaligned transfer" in 2.5.2-pre1] David Brownell
2002-01-02 9:27 ` [linux-usb-devel] Re: highmem and usb [was:"sr: unalignedtransfer" " Oliver.Neukum
@ 2002-01-02 9:31 ` Jens Axboe
1 sibling, 0 replies; 34+ messages in thread
From: Jens Axboe @ 2002-01-02 9:31 UTC (permalink / raw)
To: David Brownell; +Cc: Matthew Dharm, linux-kernel, linux-usb-devel, Greg KH
On Tue, Jan 01 2002, David Brownell wrote:
> > > No, you can always ask to get pages low mem bounced. Highmem is no
> > > requirement, and if your device really can't support it there's no point
> > > in attempting to support it.
> >
> > I presume there is some overhead in bouncing to lowmem? I imagine that
> > highmem support for the HCDs wouldn't be that difficult -- they are just
> > PCI devices, after all.
>
> I'm unclear on what "bouncing to lowmem" involves, but I'd rather avoid
> teaching all three HCDs a second model for addressing transfer buffers.
>
> At least until later in the 2.5 series, when we believe they'll share a lot
> more common code and so that new model can be taught to just ONE
> piece of code. Fixing bugs in one place easier than in three!
Ehm I was discussing 2.5, 2.4 will always bounce the high mem pages for
you so it's moot there.
--
Jens Axboe
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [linux-usb-devel] Re: "sr: unaligned transfer" in 2.5.2-pre1
2002-01-01 23:28 ` Matthew Dharm
2002-01-02 5:40 ` [linux-usb-devel] Re: highmem and usb [was: "sr: unaligned transfer" in 2.5.2-pre1] David Brownell
@ 2002-01-02 9:30 ` Jens Axboe
1 sibling, 0 replies; 34+ messages in thread
From: Jens Axboe @ 2002-01-02 9:30 UTC (permalink / raw)
To: David Brownell, linux-kernel, linux-usb-devel, Greg KH
On Tue, Jan 01 2002, Matthew Dharm wrote:
> On Tue, Jan 01, 2002 at 11:34:23PM +0100, Jens Axboe wrote:
> > On Tue, Jan 01 2002, David Brownell wrote:
> > > Not that I've seen a writeup about highmem (linux/Documentation
> > > doesn't seem to have one anyway) but if I infer correctly from that
> > > DMA-mapping.txt writeup, URBs don't support it because there's no way
> > > to specify buffers as a "struct page *" or an array of "struct
> > > scatterlist". That's the only way that document identifies to access
> > > "highmem memory".
>
> This sounds like another good reason to have URBs take scatterlists
> directly, oddly enough. :)
Or at least a derived structure, however it might as well just use
scatterlist (address member is soon gone). So yes.
> > > > (1) Do the USB HCDs support highmem? I seem to recall they do, but
> > > > I'm not certain.
> > >
> > > If URBs can't describe highmem, the HCD's won't support them per se;
> > > you'd have to turn highmem to "lowmem" or whatever it's called, and
> > > then let the HCDs manage the lowmem-to-dma_addr_t mappings.
> > >
> > > Alternatively, in 2.5 we might add "highmem" support to USB. Now that
> > > I've looked at it a few minutes, I suspect we must -- just to support
> > > block devices (usb-storage) fully. Is there more to it than adding
> >
> > No, you can always ask to get pages low mem bounced. Highmem is no
> > requirement, and if your device really can't support it there's no point
> > in attempting to support it.
>
> I presume there is some overhead in bouncing to lowmem? I imagine that
> highmem support for the HCDs wouldn't be that difficult -- they are just
> PCI devices, after all.
Lots of overhead required for copying data back and forth between low
and high page (both the memcpy, but also the highmem kmap). In addition
it puts added pressure on the memory allocator.
> I'd rather eliminate as much overhead as possible -- I already get
> complaints from performance fanatics about the inability of usb-storage to
> get past 92% bus saturation (sustained), and the problem will only get
> worse on USB 2.0
Then you should move the the page/len/offset construct.
>
> > > page+offset as an alternative way to describe the transfer_buffer?
> >
> > no
>
> Hrm... isn't that what one of the patches sent did? Or does that only work
> for lowmem allocations described by the structure?
Hmmm no, I don't think so. It only worked for low mem pages, since it
used page_address to 'map' the page.
--
Jens Axboe
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [linux-usb-devel] Re: highmem and usb [was "sr: unaligned transfer" in 2.5.2-pre1]
2002-01-01 22:34 ` Jens Axboe
2002-01-01 23:28 ` Matthew Dharm
@ 2002-01-02 5:27 ` David Brownell
2002-01-02 9:32 ` Jens Axboe
1 sibling, 1 reply; 34+ messages in thread
From: David Brownell @ 2002-01-02 5:27 UTC (permalink / raw)
To: Jens Axboe; +Cc: linux-kernel, linux-usb-devel, Matthew Dharm, Greg KH
> > Not that I've seen a writeup about highmem (linux/Documentation
> > doesn't seem to have one anyway) but if I infer correctly from that
> > DMA-mapping.txt writeup, URBs don't support it because there's no way
> > to specify buffers as a "struct page *" or an array of "struct
> > scatterlist". That's the only way that document identifies to access
> > "highmem memory".
>
> What kind of mapping does URBs require? A virtual mapping?
Each URB points to one transfer buffer, address plus length, where
the USB device drivers directly read/write those addresses. The
requirement for drivers is that the transfer buffers can be passed to
pci_map_single() calls by the Host Controller Drivers (HCDs). The
device drivers, and URBs, don't expose such mappings, they only
require that they can be created/destroyed.
I'd be inclined to say transfer buffers must not be "virtual" mappings,
but since terminology can differ I'll let you draw your conclusion.
> > > (1) Do the USB HCDs support highmem? I seem to recall they do, but
> > > I'm not certain.
> >
> > If URBs can't describe highmem, the HCD's won't support them per se;
> > you'd have to turn highmem to "lowmem" or whatever it's called, and
> > then let the HCDs manage the lowmem-to-dma_addr_t mappings.
> >
> > Alternatively, in 2.5 we might add "highmem" support to USB. Now that
> > I've looked at it a few minutes, I suspect we must -- just to support
> > block devices (usb-storage) fully. Is there more to it than adding
>
> No, you can always ask to get pages low mem bounced. Highmem is no
> requirement, and if your device really can't support it there's no point
> in attempting to support it.
Standard HC hardware (EHCI, OHCI, UHCI) can use 32bit addresses
for their PCI DMA. EHCI can also, in some implementations, handle 64bit
addresses.
> > page+offset as an alternative way to describe the transfer_buffer?
>
> no
>
> > (And making all the "single" mapping calls in the HCDs use page
> > mappings.)
>
> exactly
So you're saying that pci_map_page() is not necessary? And that
highmem buffers (page+offset, or scatterlist thereof) can be turned
into the form needed by URBs using some other mechanism?
I'd certainly rather that be the case for the moment, for simplicity.
Keep in mind that usb-storage seems to be the only driver that'd
run into that issue.
- Dave
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [linux-usb-devel] Re: highmem and usb [was "sr: unaligned transfer" in 2.5.2-pre1]
2002-01-02 5:27 ` [linux-usb-devel] Re: highmem and usb [was "sr: unaligned transfer" in 2.5.2-pre1] David Brownell
@ 2002-01-02 9:32 ` Jens Axboe
2002-01-02 18:37 ` David Brownell
0 siblings, 1 reply; 34+ messages in thread
From: Jens Axboe @ 2002-01-02 9:32 UTC (permalink / raw)
To: David Brownell; +Cc: linux-kernel, linux-usb-devel, Matthew Dharm, Greg KH
On Tue, Jan 01 2002, David Brownell wrote:
> > > Not that I've seen a writeup about highmem (linux/Documentation
> > > doesn't seem to have one anyway) but if I infer correctly from that
> > > DMA-mapping.txt writeup, URBs don't support it because there's no way
> > > to specify buffers as a "struct page *" or an array of "struct
> > > scatterlist". That's the only way that document identifies to access
> > > "highmem memory".
> >
> > What kind of mapping does URBs require? A virtual mapping?
>
> Each URB points to one transfer buffer, address plus length, where
> the USB device drivers directly read/write those addresses. The
> requirement for drivers is that the transfer buffers can be passed to
> pci_map_single() calls by the Host Controller Drivers (HCDs). The
> device drivers, and URBs, don't expose such mappings, they only
> require that they can be created/destroyed.
.. which is the requirement that you want to change to use pci_map_page
or pci_map_sg
> I'd be inclined to say transfer buffers must not be "virtual" mappings,
> but since terminology can differ I'll let you draw your conclusion.
They must not be, currently they are.
> Standard HC hardware (EHCI, OHCI, UHCI) can use 32bit addresses
> for their PCI DMA. EHCI can also, in some implementations, handle 64bit
> addresses.
Good
> > > (And making all the "single" mapping calls in the HCDs use page
> > > mappings.)
> >
> > exactly
>
> So you're saying that pci_map_page() is not necessary? And that
> highmem buffers (page+offset, or scatterlist thereof) can be turned
> into the form needed by URBs using some other mechanism?
Sorry if I wasn't clear, no that's not what I meant. See above.
pci_map_single requires a virtual mapping so it simply cannot support
highmem.
--
Jens Axboe
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [linux-usb-devel] Re: highmem and usb [was "sr: unaligned transfer" in 2.5.2-pre1]
2002-01-02 9:32 ` Jens Axboe
@ 2002-01-02 18:37 ` David Brownell
2002-01-02 18:44 ` Jens Axboe
0 siblings, 1 reply; 34+ messages in thread
From: David Brownell @ 2002-01-02 18:37 UTC (permalink / raw)
To: Jens Axboe; +Cc: linux-kernel, linux-usb-devel, Matthew Dharm, Greg KH
> > requirement for drivers is that the transfer buffers can be passed to
> > pci_map_single() calls by the Host Controller Drivers (HCDs). The
> > device drivers, and URBs, don't expose such mappings, they only
> > require that they can be created/destroyed.
>
> .. which is the requirement that you want to change to use pci_map_page
> or pci_map_sg
OK, I think I'm clear on this much then: in 2.5, to support block drivers
over USB (usb-storage only, for now) there needs to be an addition to
the buffer addressing model in usbcore, as exposed by URBs.
- Current "transfer_buffer" + "transfer_buffer_length" mode needs to
stay, since most drivers aren't block drivers.
- Add some kind of "page + offset" addressing model.
Discussion of details can be taken off LKML, it'd seem. Though I'm
curious when the scatterlist->address field will vanish, making these
changes a requirement. Is that a 2.5.2 thing?
Also, I noticed that include/asm-sparc/pci.h doesn't include the
standard pci_map_page() call ... what's up with that? That surely
causes portability problems.
- Dave
^ permalink raw reply [flat|nested] 34+ messages in thread* Re: [linux-usb-devel] Re: highmem and usb [was "sr: unaligned transfer" in 2.5.2-pre1]
2002-01-02 18:37 ` David Brownell
@ 2002-01-02 18:44 ` Jens Axboe
2002-01-02 18:55 ` David Brownell
2002-01-02 22:32 ` [linux-usb-devel] Re: highmem and usb [was "sr: unalignedtransfer" " Oliver.Neukum
0 siblings, 2 replies; 34+ messages in thread
From: Jens Axboe @ 2002-01-02 18:44 UTC (permalink / raw)
To: David Brownell; +Cc: linux-kernel, linux-usb-devel, Matthew Dharm, Greg KH
On Wed, Jan 02 2002, David Brownell wrote:
> > > requirement for drivers is that the transfer buffers can be passed to
> > > pci_map_single() calls by the Host Controller Drivers (HCDs). The
> > > device drivers, and URBs, don't expose such mappings, they only
> > > require that they can be created/destroyed.
> >
> > .. which is the requirement that you want to change to use pci_map_page
> > or pci_map_sg
>
> OK, I think I'm clear on this much then: in 2.5, to support block drivers
> over USB (usb-storage only, for now) there needs to be an addition to
> the buffer addressing model in usbcore, as exposed by URBs.
>
> - Current "transfer_buffer" + "transfer_buffer_length" mode needs to
> stay, since most drivers aren't block drivers.
Why? Surely USB block drivers are not the only ones that want to support
highmem.
> - Add some kind of "page + offset" addressing model.
Yes
> Discussion of details can be taken off LKML, it'd seem. Though I'm
> curious when the scatterlist->address field will vanish, making these
> changes a requirement. Is that a 2.5.2 thing?
Maybe 2.5.3, dunno for sure.
> Also, I noticed that include/asm-sparc/pci.h doesn't include the
> standard pci_map_page() call ... what's up with that? That surely
> causes portability problems.
It probably isn't up to snuff yet.
--
Jens Axboe
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [linux-usb-devel] Re: highmem and usb [was "sr: unaligned transfer" in 2.5.2-pre1]
2002-01-02 18:44 ` Jens Axboe
@ 2002-01-02 18:55 ` David Brownell
2002-01-02 20:23 ` Jens Axboe
2002-01-02 22:32 ` [linux-usb-devel] Re: highmem and usb [was "sr: unalignedtransfer" " Oliver.Neukum
1 sibling, 1 reply; 34+ messages in thread
From: David Brownell @ 2002-01-02 18:55 UTC (permalink / raw)
To: Jens Axboe; +Cc: linux-kernel, linux-usb-devel, Matthew Dharm, Greg KH
> > OK, I think I'm clear on this much then: in 2.5, to support block drivers
> > over USB (usb-storage only, for now) there needs to be an addition to
> > the buffer addressing model in usbcore, as exposed by URBs.
> >
> > - Current "transfer_buffer" + "transfer_buffer_length" mode needs to
> > stay, since most drivers aren't block drivers.
>
> Why? Surely USB block drivers are not the only ones that want to support
> highmem.
Once the capability is there, it'll find other uses. But allowing them is not
the same as requiring them. Getting rid of the current model would break
every USB driver, rather than just ones that want to support highmem.
> > - Add some kind of "page + offset" addressing model.
>
> Yes
>
> > Discussion of details can be taken off LKML, it'd seem. Though I'm
> > curious when the scatterlist->address field will vanish, making these
> > changes a requirement. Is that a 2.5.2 thing?
>
> Maybe 2.5.3, dunno for sure.
A bit of a delay would make things a bit easier ... :)
Of course, if scatterlist->address doesn't work any more,
it won't matter much.
- Dave
> > Also, I noticed that include/asm-sparc/pci.h doesn't include the
> > standard pci_map_page() call ... what's up with that? That surely
> > causes portability problems.
>
> It probably isn't up to snuff yet.
>
> --
> Jens Axboe
>
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [linux-usb-devel] Re: highmem and usb [was "sr: unaligned transfer" in 2.5.2-pre1]
2002-01-02 18:55 ` David Brownell
@ 2002-01-02 20:23 ` Jens Axboe
0 siblings, 0 replies; 34+ messages in thread
From: Jens Axboe @ 2002-01-02 20:23 UTC (permalink / raw)
To: David Brownell; +Cc: linux-kernel, linux-usb-devel, Matthew Dharm, Greg KH
On Wed, Jan 02 2002, David Brownell wrote:
> > > OK, I think I'm clear on this much then: in 2.5, to support block drivers
> > > over USB (usb-storage only, for now) there needs to be an addition to
> > > the buffer addressing model in usbcore, as exposed by URBs.
> > >
> > > - Current "transfer_buffer" + "transfer_buffer_length" mode needs to
> > > stay, since most drivers aren't block drivers.
> >
> > Why? Surely USB block drivers are not the only ones that want to support
> > highmem.
>
> Once the capability is there, it'll find other uses. But allowing
> them is not the same as requiring them. Getting rid of the current
> model would break every USB driver, rather than just ones that want to
> support highmem.
So? Either you want to fix this now, or leave it that way forever. Just
IMO of course, but you might as well just make a clean break.
> > > - Add some kind of "page + offset" addressing model.
> >
> > Yes
> >
> > > Discussion of details can be taken off LKML, it'd seem. Though
> > > I'm curious when the scatterlist->address field will vanish,
> > > making these changes a requirement. Is that a 2.5.2 thing?
> >
> > Maybe 2.5.3, dunno for sure.
>
> A bit of a delay would make things a bit easier ... :) Of course, if
> scatterlist->address doesn't work any more, it won't matter much.
A bit of delay will only make things worse, afaics.
--
Jens Axboe
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [linux-usb-devel] Re: highmem and usb [was "sr: unalignedtransfer" in 2.5.2-pre1]
2002-01-02 18:44 ` Jens Axboe
2002-01-02 18:55 ` David Brownell
@ 2002-01-02 22:32 ` Oliver.Neukum
1 sibling, 0 replies; 34+ messages in thread
From: Oliver.Neukum @ 2002-01-02 22:32 UTC (permalink / raw)
To: Jens Axboe
Cc: David Brownell, linux-kernel, linux-usb-devel, Matthew Dharm,
Greg KH
On Wed, 2 Jan 2002, Jens Axboe wrote:
> On Wed, Jan 02 2002, David Brownell wrote:
> > > > requirement for drivers is that the transfer buffers can be passed to
> > > > pci_map_single() calls by the Host Controller Drivers (HCDs). The
> > > > device drivers, and URBs, don't expose such mappings, they only
> > > > require that they can be created/destroyed.
> > >
> > > .. which is the requirement that you want to change to use pci_map_page
> > > or pci_map_sg
> >
> > OK, I think I'm clear on this much then: in 2.5, to support block drivers
> > over USB (usb-storage only, for now) there needs to be an addition to
> > the buffer addressing model in usbcore, as exposed by URBs.
> >
> > - Current "transfer_buffer" + "transfer_buffer_length" mode needs to
> > stay, since most drivers aren't block drivers.
>
> Why? Surely USB block drivers are not the only ones that want to support
> highmem.
Probably for a long time they'll be the only ones.
All the char drivers will mainly do a copy_to/from_user
or want memory they can manipulate directly.
Regards
Oliver
^ permalink raw reply [flat|nested] 34+ messages in thread