All of lore.kernel.org
 help / color / mirror / Atom feed
* USB transfer_buffer allocations on 64bit systems
@ 2010-04-07  9:06 ` Daniel Mack
  0 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-07  9:06 UTC (permalink / raw)
  To: linux-kernel
  Cc: Pedro Ribeiro, akpm, Greg KH, Alan Stern, alsa-devel, linux-usb

Hi,

I was pointed to https://bugzilla.kernel.org/show_bug.cgi?id=15580 by
Pedro Ribeiro, and unfortunately I'm pretty late in the game. I wasn't
aware of that thread until yesterday.

While the report is quite confusing, the reason seams pretty clear to me
as I've been thru quite some time-demanding debugging of a very similar
issue on Mac OS X. But I'm not totally sure whether we really hit the
same issue here, so I'd like to have your opinions first.

The problem is appearantly the way the transfer buffer is allocated in
the drivers. In the snd-usb-caiaq driver, I used kzalloc() to get memory
which works fine on 32bit systems. On x86_64, however, it seems that
kzalloc() hands out memory beyond the 32bit addressable boundary, which
the DMA controller of the 32bit PCI-connected EHCI controller is unable
to write to or read from. Am I correct on this conclusion?

Depending on the condition of the memory management, things might work
or not, and especially right after a reboot, there's a better chance to
get lower memory.

The fix is to use usb_buffer_alloc() for that purpose which ensures
memory that is suitable for DMA. And on x86_64, this also means that the
upper 32 bits of the address returned are all 0's.

If what I've stated is true, there are quite some more drivers affected
by this issue. I collected a list of places where similar fixes are
needed, and I can send patches if I get a thumbs-up.

Pedro is currently testing a patch I sent out yesterday.

Thanks,
Daniel


^ permalink raw reply	[flat|nested] 221+ messages in thread

* USB transfer_buffer allocations on 64bit systems
@ 2010-04-07  9:06 ` Daniel Mack
  0 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-07  9:06 UTC (permalink / raw)
  To: linux-kernel
  Cc: alsa-devel, linux-usb, Greg KH, Alan Stern, Pedro Ribeiro, akpm

Hi,

I was pointed to https://bugzilla.kernel.org/show_bug.cgi?id=15580 by
Pedro Ribeiro, and unfortunately I'm pretty late in the game. I wasn't
aware of that thread until yesterday.

While the report is quite confusing, the reason seams pretty clear to me
as I've been thru quite some time-demanding debugging of a very similar
issue on Mac OS X. But I'm not totally sure whether we really hit the
same issue here, so I'd like to have your opinions first.

The problem is appearantly the way the transfer buffer is allocated in
the drivers. In the snd-usb-caiaq driver, I used kzalloc() to get memory
which works fine on 32bit systems. On x86_64, however, it seems that
kzalloc() hands out memory beyond the 32bit addressable boundary, which
the DMA controller of the 32bit PCI-connected EHCI controller is unable
to write to or read from. Am I correct on this conclusion?

Depending on the condition of the memory management, things might work
or not, and especially right after a reboot, there's a better chance to
get lower memory.

The fix is to use usb_buffer_alloc() for that purpose which ensures
memory that is suitable for DMA. And on x86_64, this also means that the
upper 32 bits of the address returned are all 0's.

If what I've stated is true, there are quite some more drivers affected
by this issue. I collected a list of places where similar fixes are
needed, and I can send patches if I get a thumbs-up.

Pedro is currently testing a patch I sent out yesterday.

Thanks,
Daniel

^ permalink raw reply	[flat|nested] 221+ messages in thread

* USB HID gadget driver (was: Re: USB transfer_buffer allocations on 64bit systems)
       [not found] ` <p2g581ef6d61004070220z1153d40ez955b356e01220848@mail.gmail.com>
@ 2010-04-07  9:26     ` Daniel Mack
  0 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-07  9:26 UTC (permalink / raw)
  To: suman
  Cc: linux-kernel, Pedro Ribeiro, akpm, Greg KH, Alan Stern,
	alsa-devel, linux-usb

On Wed, Apr 07, 2010 at 06:20:53PM +0900, suman wrote:
> I am sorry if this is a lame question, I am in Ignorance. I have little time
> to make a USB driver.

1. Please do not hijack email threads for unrelated subjects. Your
question has nothing to do with the original topic and you copy the
wrong people for your question. Start a new thread for that.

2. Do not reply on top.

> I need to make a board work in device mode which acts as a keyboard and
> mouse device, So when my device is connected to a windows system it
> will recognize as a keyboard and a mouse device. I need a pointer for it. I
> do not find much documentation on it other than gadget driver which belongs
> to bulk class driver.
> I know my USB controller supports OTG and supports both device and host
> mode.

You need to write your own gadget driver for that. See the ones that
already exist in the tree and see which parts you can recycle for your
purpose. The protocol you want to talk is HID.

Daniel



> If you have any pointer can you please give. I'm all ears.
> 
> On Wed, Apr 7, 2010 at 6:06 PM, Daniel Mack <daniel@caiaq.de> wrote:
> 
> > Hi,
> >
> > I was pointed to https://bugzilla.kernel.org/show_bug.cgi?id=15580 by
> > Pedro Ribeiro, and unfortunately I'm pretty late in the game. I wasn't
> > aware of that thread until yesterday.
> >
> > While the report is quite confusing, the reason seams pretty clear to me
> > as I've been thru quite some time-demanding debugging of a very similar
> > issue on Mac OS X. But I'm not totally sure whether we really hit the
> > same issue here, so I'd like to have your opinions first.
> >
> > The problem is appearantly the way the transfer buffer is allocated in
> > the drivers. In the snd-usb-caiaq driver, I used kzalloc() to get memory
> > which works fine on 32bit systems. On x86_64, however, it seems that
> > kzalloc() hands out memory beyond the 32bit addressable boundary, which
> > the DMA controller of the 32bit PCI-connected EHCI controller is unable
> > to write to or read from. Am I correct on this conclusion?
> >
> > Depending on the condition of the memory management, things might work
> > or not, and especially right after a reboot, there's a better chance to
> > get lower memory.
> >
> > The fix is to use usb_buffer_alloc() for that purpose which ensures
> > memory that is suitable for DMA. And on x86_64, this also means that the
> > upper 32 bits of the address returned are all 0's.
> >
> > If what I've stated is true, there are quite some more drivers affected
> > by this issue. I collected a list of places where similar fixes are
> > needed, and I can send patches if I get a thumbs-up.
> >
> > Pedro is currently testing a patch I sent out yesterday.
> >
> > Thanks,
> > Daniel
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> >
> 
> 
> 
> -- 
> Rgds
> Vijayendra Suman
> 
> The only basis for a true and lasting unity of all humanity is the religion
> of the heart. The religion of the heart is the religion of love. People can
> only be united if they are free from jealousy, hatred and petty-mindedness.
> Purify your heart first. Meet hatred with love and malice with goodwill. The
> purer you make your heart, the greater will be the power of your love.

^ permalink raw reply	[flat|nested] 221+ messages in thread

* USB HID gadget driver (was: Re: USB transfer_buffer allocations on 64bit systems)
@ 2010-04-07  9:26     ` Daniel Mack
  0 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-07  9:26 UTC (permalink / raw)
  To: suman
  Cc: alsa-devel, linux-usb, Greg KH, linux-kernel, Alan Stern,
	Pedro Ribeiro, akpm

On Wed, Apr 07, 2010 at 06:20:53PM +0900, suman wrote:
> I am sorry if this is a lame question, I am in Ignorance. I have little time
> to make a USB driver.

1. Please do not hijack email threads for unrelated subjects. Your
question has nothing to do with the original topic and you copy the
wrong people for your question. Start a new thread for that.

2. Do not reply on top.

> I need to make a board work in device mode which acts as a keyboard and
> mouse device, So when my device is connected to a windows system it
> will recognize as a keyboard and a mouse device. I need a pointer for it. I
> do not find much documentation on it other than gadget driver which belongs
> to bulk class driver.
> I know my USB controller supports OTG and supports both device and host
> mode.

You need to write your own gadget driver for that. See the ones that
already exist in the tree and see which parts you can recycle for your
purpose. The protocol you want to talk is HID.

Daniel



> If you have any pointer can you please give. I'm all ears.
> 
> On Wed, Apr 7, 2010 at 6:06 PM, Daniel Mack <daniel@caiaq.de> wrote:
> 
> > Hi,
> >
> > I was pointed to https://bugzilla.kernel.org/show_bug.cgi?id=15580 by
> > Pedro Ribeiro, and unfortunately I'm pretty late in the game. I wasn't
> > aware of that thread until yesterday.
> >
> > While the report is quite confusing, the reason seams pretty clear to me
> > as I've been thru quite some time-demanding debugging of a very similar
> > issue on Mac OS X. But I'm not totally sure whether we really hit the
> > same issue here, so I'd like to have your opinions first.
> >
> > The problem is appearantly the way the transfer buffer is allocated in
> > the drivers. In the snd-usb-caiaq driver, I used kzalloc() to get memory
> > which works fine on 32bit systems. On x86_64, however, it seems that
> > kzalloc() hands out memory beyond the 32bit addressable boundary, which
> > the DMA controller of the 32bit PCI-connected EHCI controller is unable
> > to write to or read from. Am I correct on this conclusion?
> >
> > Depending on the condition of the memory management, things might work
> > or not, and especially right after a reboot, there's a better chance to
> > get lower memory.
> >
> > The fix is to use usb_buffer_alloc() for that purpose which ensures
> > memory that is suitable for DMA. And on x86_64, this also means that the
> > upper 32 bits of the address returned are all 0's.
> >
> > If what I've stated is true, there are quite some more drivers affected
> > by this issue. I collected a list of places where similar fixes are
> > needed, and I can send patches if I get a thumbs-up.
> >
> > Pedro is currently testing a patch I sent out yesterday.
> >
> > Thanks,
> > Daniel
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> >
> 
> 
> 
> -- 
> Rgds
> Vijayendra Suman
> 
> The only basis for a true and lasting unity of all humanity is the religion
> of the heart. The religion of the heart is the religion of love. People can
> only be united if they are free from jealousy, hatred and petty-mindedness.
> Purify your heart first. Meet hatred with love and malice with goodwill. The
> purer you make your heart, the greater will be the power of your love.

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-07  9:06 ` Daniel Mack
@ 2010-04-07 14:59   ` Alan Stern
  -1 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-07 14:59 UTC (permalink / raw)
  To: Daniel Mack
  Cc: linux-kernel, Pedro Ribeiro, akpm, Greg KH, alsa-devel, linux-usb

On Wed, 7 Apr 2010, Daniel Mack wrote:

> Hi,
> 
> I was pointed to https://bugzilla.kernel.org/show_bug.cgi?id=15580 by
> Pedro Ribeiro, and unfortunately I'm pretty late in the game. I wasn't
> aware of that thread until yesterday.
> 
> While the report is quite confusing, the reason seams pretty clear to me
> as I've been thru quite some time-demanding debugging of a very similar
> issue on Mac OS X. But I'm not totally sure whether we really hit the
> same issue here, so I'd like to have your opinions first.
> 
> The problem is appearantly the way the transfer buffer is allocated in
> the drivers. In the snd-usb-caiaq driver, I used kzalloc() to get memory
> which works fine on 32bit systems. On x86_64, however, it seems that
> kzalloc() hands out memory beyond the 32bit addressable boundary, which
> the DMA controller of the 32bit PCI-connected EHCI controller is unable
> to write to or read from. Am I correct on this conclusion?

That seems like the right answer.  You are correct that an EHCI 
controller capable only of 32-bit memory accesses would not be able to 
use a buffer above the 4 GB line.

> Depending on the condition of the memory management, things might work
> or not, and especially right after a reboot, there's a better chance to
> get lower memory.
> 
> The fix is to use usb_buffer_alloc() for that purpose which ensures
> memory that is suitable for DMA. And on x86_64, this also means that the
> upper 32 bits of the address returned are all 0's.

That is not a good fix.  usb_buffer_alloc() provides coherent memory, 
which is not what we want.  I believe the correct fix is to specify the 
GFP_DMA32 flag in the kzalloc() call.

Of course, some EHCI hardware _is_ capable of using 64-bit addresses.  
But not all, and other controller types aren't.  In principle we could
create a new allocation routine, which would take a pointer to the USB
bus as an additional argument and use it to decide whether the memory 
needs to lie below 4 GB.  I'm not sure adding this extra complexity 
would be worthwhile.

> If what I've stated is true, there are quite some more drivers affected
> by this issue.

Practically every USB driver, I should think.  And maybe a lot of 
non-USB drivers too.

> I collected a list of places where similar fixes are
> needed, and I can send patches if I get a thumbs-up.
> 
> Pedro is currently testing a patch I sent out yesterday.

Good work -- it certainly would have taken me a long time to figure 
this out.

Alan Stern


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-07 14:59   ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-07 14:59 UTC (permalink / raw)
  To: Daniel Mack
  Cc: linux-kernel, Pedro Ribeiro, akpm, Greg KH, alsa-devel, linux-usb

On Wed, 7 Apr 2010, Daniel Mack wrote:

> Hi,
> 
> I was pointed to https://bugzilla.kernel.org/show_bug.cgi?id=15580 by
> Pedro Ribeiro, and unfortunately I'm pretty late in the game. I wasn't
> aware of that thread until yesterday.
> 
> While the report is quite confusing, the reason seams pretty clear to me
> as I've been thru quite some time-demanding debugging of a very similar
> issue on Mac OS X. But I'm not totally sure whether we really hit the
> same issue here, so I'd like to have your opinions first.
> 
> The problem is appearantly the way the transfer buffer is allocated in
> the drivers. In the snd-usb-caiaq driver, I used kzalloc() to get memory
> which works fine on 32bit systems. On x86_64, however, it seems that
> kzalloc() hands out memory beyond the 32bit addressable boundary, which
> the DMA controller of the 32bit PCI-connected EHCI controller is unable
> to write to or read from. Am I correct on this conclusion?

That seems like the right answer.  You are correct that an EHCI 
controller capable only of 32-bit memory accesses would not be able to 
use a buffer above the 4 GB line.

> Depending on the condition of the memory management, things might work
> or not, and especially right after a reboot, there's a better chance to
> get lower memory.
> 
> The fix is to use usb_buffer_alloc() for that purpose which ensures
> memory that is suitable for DMA. And on x86_64, this also means that the
> upper 32 bits of the address returned are all 0's.

That is not a good fix.  usb_buffer_alloc() provides coherent memory, 
which is not what we want.  I believe the correct fix is to specify the 
GFP_DMA32 flag in the kzalloc() call.

Of course, some EHCI hardware _is_ capable of using 64-bit addresses.  
But not all, and other controller types aren't.  In principle we could
create a new allocation routine, which would take a pointer to the USB
bus as an additional argument and use it to decide whether the memory 
needs to lie below 4 GB.  I'm not sure adding this extra complexity 
would be worthwhile.

> If what I've stated is true, there are quite some more drivers affected
> by this issue.

Practically every USB driver, I should think.  And maybe a lot of 
non-USB drivers too.

> I collected a list of places where similar fixes are
> needed, and I can send patches if I get a thumbs-up.
> 
> Pedro is currently testing a patch I sent out yesterday.

Good work -- it certainly would have taken me a long time to figure 
this out.

Alan Stern

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-07 14:59   ` Alan Stern
@ 2010-04-07 15:11     ` Daniel Mack
  -1 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-07 15:11 UTC (permalink / raw)
  To: Alan Stern
  Cc: linux-kernel, Pedro Ribeiro, akpm, Greg KH, alsa-devel, linux-usb

On Wed, Apr 07, 2010 at 10:59:47AM -0400, Alan Stern wrote:
> On Wed, 7 Apr 2010, Daniel Mack wrote:
> > Depending on the condition of the memory management, things might work
> > or not, and especially right after a reboot, there's a better chance to
> > get lower memory.
> > 
> > The fix is to use usb_buffer_alloc() for that purpose which ensures
> > memory that is suitable for DMA. And on x86_64, this also means that the
> > upper 32 bits of the address returned are all 0's.
> 
> That is not a good fix.  usb_buffer_alloc() provides coherent memory, 
> which is not what we want.  I believe the correct fix is to specify the 
> GFP_DMA32 flag in the kzalloc() call.
> 
> Of course, some EHCI hardware _is_ capable of using 64-bit addresses.  
> But not all, and other controller types aren't.  In principle we could
> create a new allocation routine, which would take a pointer to the USB
> bus as an additional argument and use it to decide whether the memory 
> needs to lie below 4 GB.  I'm not sure adding this extra complexity 
> would be worthwhile.

Well, I thought this is exactly what the usb_buffer_alloc() abstraction
functions are there for. We already pass a pointer to a struct
usb_device, so the routine knows which host controller it operates on.
So we can safely dispatch all the magic inside this function, no?

If not, I would rather introduce a new function than adding GFP_ flags
to all existing drivers.

I vote for a clean solution, a fixup of existing implementations and
a clear note about how to allocate buffers for USB drivers. I believe
faulty allocations of this kind can explain quite a lot of problems on
x86_64 machines.

> > If what I've stated is true, there are quite some more drivers affected
> > by this issue.
> 
> Practically every USB driver, I should think.  And maybe a lot of 
> non-USB drivers too.

I found many such problems in drivers/media/{dvb,video},
drivers/usb/serial, sound/usb and even in the USB core. If we agree on
how to fix that nicely, I can take some of them.

Daniel

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-07 15:11     ` Daniel Mack
  0 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-07 15:11 UTC (permalink / raw)
  To: Alan Stern
  Cc: alsa-devel, linux-usb, Greg KH, linux-kernel, Pedro Ribeiro, akpm

On Wed, Apr 07, 2010 at 10:59:47AM -0400, Alan Stern wrote:
> On Wed, 7 Apr 2010, Daniel Mack wrote:
> > Depending on the condition of the memory management, things might work
> > or not, and especially right after a reboot, there's a better chance to
> > get lower memory.
> > 
> > The fix is to use usb_buffer_alloc() for that purpose which ensures
> > memory that is suitable for DMA. And on x86_64, this also means that the
> > upper 32 bits of the address returned are all 0's.
> 
> That is not a good fix.  usb_buffer_alloc() provides coherent memory, 
> which is not what we want.  I believe the correct fix is to specify the 
> GFP_DMA32 flag in the kzalloc() call.
> 
> Of course, some EHCI hardware _is_ capable of using 64-bit addresses.  
> But not all, and other controller types aren't.  In principle we could
> create a new allocation routine, which would take a pointer to the USB
> bus as an additional argument and use it to decide whether the memory 
> needs to lie below 4 GB.  I'm not sure adding this extra complexity 
> would be worthwhile.

Well, I thought this is exactly what the usb_buffer_alloc() abstraction
functions are there for. We already pass a pointer to a struct
usb_device, so the routine knows which host controller it operates on.
So we can safely dispatch all the magic inside this function, no?

If not, I would rather introduce a new function than adding GFP_ flags
to all existing drivers.

I vote for a clean solution, a fixup of existing implementations and
a clear note about how to allocate buffers for USB drivers. I believe
faulty allocations of this kind can explain quite a lot of problems on
x86_64 machines.

> > If what I've stated is true, there are quite some more drivers affected
> > by this issue.
> 
> Practically every USB driver, I should think.  And maybe a lot of 
> non-USB drivers too.

I found many such problems in drivers/media/{dvb,video},
drivers/usb/serial, sound/usb and even in the USB core. If we agree on
how to fix that nicely, I can take some of them.

Daniel

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-07 15:11     ` Daniel Mack
@ 2010-04-07 15:31       ` Greg KH
  -1 siblings, 0 replies; 221+ messages in thread
From: Greg KH @ 2010-04-07 15:31 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Alan Stern, linux-kernel, Pedro Ribeiro, akpm, Greg KH,
	alsa-devel, linux-usb

On Wed, Apr 07, 2010 at 05:11:25PM +0200, Daniel Mack wrote:
> On Wed, Apr 07, 2010 at 10:59:47AM -0400, Alan Stern wrote:
> > On Wed, 7 Apr 2010, Daniel Mack wrote:
> > > Depending on the condition of the memory management, things might work
> > > or not, and especially right after a reboot, there's a better chance to
> > > get lower memory.
> > > 
> > > The fix is to use usb_buffer_alloc() for that purpose which ensures
> > > memory that is suitable for DMA. And on x86_64, this also means that the
> > > upper 32 bits of the address returned are all 0's.
> > 
> > That is not a good fix.  usb_buffer_alloc() provides coherent memory, 
> > which is not what we want.  I believe the correct fix is to specify the 
> > GFP_DMA32 flag in the kzalloc() call.
> > 
> > Of course, some EHCI hardware _is_ capable of using 64-bit addresses.  
> > But not all, and other controller types aren't.  In principle we could
> > create a new allocation routine, which would take a pointer to the USB
> > bus as an additional argument and use it to decide whether the memory 
> > needs to lie below 4 GB.  I'm not sure adding this extra complexity 
> > would be worthwhile.
> 
> Well, I thought this is exactly what the usb_buffer_alloc() abstraction
> functions are there for. We already pass a pointer to a struct
> usb_device, so the routine knows which host controller it operates on.
> So we can safely dispatch all the magic inside this function, no?

Hm, yeah, I thought that is what it was for too.  If not, why can't we
use it like this?

> If not, I would rather introduce a new function than adding GFP_ flags
> to all existing drivers.

I agree.

> I vote for a clean solution, a fixup of existing implementations and
> a clear note about how to allocate buffers for USB drivers. I believe
> faulty allocations of this kind can explain quite a lot of problems on
> x86_64 machines.

Yeah, I really don't want to have to change every driver in different
ways just depending on if someone thinks it is going to need to run on
this wierd hardware.

Alan, any objection to just using usb_buffer_alloc() for every driver?
Or is that too much overhead?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-07 15:31       ` Greg KH
  0 siblings, 0 replies; 221+ messages in thread
From: Greg KH @ 2010-04-07 15:31 UTC (permalink / raw)
  To: Daniel Mack
  Cc: alsa-devel, linux-usb, Greg KH, linux-kernel, Alan Stern,
	Pedro Ribeiro, akpm

On Wed, Apr 07, 2010 at 05:11:25PM +0200, Daniel Mack wrote:
> On Wed, Apr 07, 2010 at 10:59:47AM -0400, Alan Stern wrote:
> > On Wed, 7 Apr 2010, Daniel Mack wrote:
> > > Depending on the condition of the memory management, things might work
> > > or not, and especially right after a reboot, there's a better chance to
> > > get lower memory.
> > > 
> > > The fix is to use usb_buffer_alloc() for that purpose which ensures
> > > memory that is suitable for DMA. And on x86_64, this also means that the
> > > upper 32 bits of the address returned are all 0's.
> > 
> > That is not a good fix.  usb_buffer_alloc() provides coherent memory, 
> > which is not what we want.  I believe the correct fix is to specify the 
> > GFP_DMA32 flag in the kzalloc() call.
> > 
> > Of course, some EHCI hardware _is_ capable of using 64-bit addresses.  
> > But not all, and other controller types aren't.  In principle we could
> > create a new allocation routine, which would take a pointer to the USB
> > bus as an additional argument and use it to decide whether the memory 
> > needs to lie below 4 GB.  I'm not sure adding this extra complexity 
> > would be worthwhile.
> 
> Well, I thought this is exactly what the usb_buffer_alloc() abstraction
> functions are there for. We already pass a pointer to a struct
> usb_device, so the routine knows which host controller it operates on.
> So we can safely dispatch all the magic inside this function, no?

Hm, yeah, I thought that is what it was for too.  If not, why can't we
use it like this?

> If not, I would rather introduce a new function than adding GFP_ flags
> to all existing drivers.

I agree.

> I vote for a clean solution, a fixup of existing implementations and
> a clear note about how to allocate buffers for USB drivers. I believe
> faulty allocations of this kind can explain quite a lot of problems on
> x86_64 machines.

Yeah, I really don't want to have to change every driver in different
ways just depending on if someone thinks it is going to need to run on
this wierd hardware.

Alan, any objection to just using usb_buffer_alloc() for every driver?
Or is that too much overhead?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-07 15:31       ` Greg KH
@ 2010-04-07 15:35         ` Daniel Mack
  -1 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-07 15:35 UTC (permalink / raw)
  To: Greg KH
  Cc: Alan Stern, linux-kernel, Pedro Ribeiro, akpm, Greg KH,
	alsa-devel, linux-usb

On Wed, Apr 07, 2010 at 08:31:54AM -0700, Greg KH wrote:
> On Wed, Apr 07, 2010 at 05:11:25PM +0200, Daniel Mack wrote:
> > I vote for a clean solution, a fixup of existing implementations and
> > a clear note about how to allocate buffers for USB drivers. I believe
> > faulty allocations of this kind can explain quite a lot of problems on
> > x86_64 machines.
> 
> Yeah, I really don't want to have to change every driver in different
> ways just depending on if someone thinks it is going to need to run on
> this wierd hardware.
> 
> Alan, any objection to just using usb_buffer_alloc() for every driver?
> Or is that too much overhead?

FWIW, most drivers I've seen in the past hours use a wild mix of
kmalloc(), kzalloc(), kcalloc() and usb_buffer_alloc(). That should
really be unified.

Daniel


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-07 15:35         ` Daniel Mack
  0 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-07 15:35 UTC (permalink / raw)
  To: Greg KH
  Cc: alsa-devel, linux-usb, Greg KH, linux-kernel, Alan Stern,
	Pedro Ribeiro, akpm

On Wed, Apr 07, 2010 at 08:31:54AM -0700, Greg KH wrote:
> On Wed, Apr 07, 2010 at 05:11:25PM +0200, Daniel Mack wrote:
> > I vote for a clean solution, a fixup of existing implementations and
> > a clear note about how to allocate buffers for USB drivers. I believe
> > faulty allocations of this kind can explain quite a lot of problems on
> > x86_64 machines.
> 
> Yeah, I really don't want to have to change every driver in different
> ways just depending on if someone thinks it is going to need to run on
> this wierd hardware.
> 
> Alan, any objection to just using usb_buffer_alloc() for every driver?
> Or is that too much overhead?

FWIW, most drivers I've seen in the past hours use a wild mix of
kmalloc(), kzalloc(), kcalloc() and usb_buffer_alloc(). That should
really be unified.

Daniel

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-07 15:11     ` Daniel Mack
@ 2010-04-07 15:46       ` Alan Stern
  -1 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-07 15:46 UTC (permalink / raw)
  To: Daniel Mack
  Cc: linux-kernel, Pedro Ribeiro, akpm, Greg KH, alsa-devel, linux-usb

On Wed, 7 Apr 2010, Daniel Mack wrote:

> > > The fix is to use usb_buffer_alloc() for that purpose which ensures
> > > memory that is suitable for DMA. And on x86_64, this also means that the
> > > upper 32 bits of the address returned are all 0's.
> > 
> > That is not a good fix.  usb_buffer_alloc() provides coherent memory, 
> > which is not what we want.  I believe the correct fix is to specify the 
> > GFP_DMA32 flag in the kzalloc() call.
> > 
> > Of course, some EHCI hardware _is_ capable of using 64-bit addresses.  
> > But not all, and other controller types aren't.  In principle we could
> > create a new allocation routine, which would take a pointer to the USB
> > bus as an additional argument and use it to decide whether the memory 
> > needs to lie below 4 GB.  I'm not sure adding this extra complexity 
> > would be worthwhile.
> 
> Well, I thought this is exactly what the usb_buffer_alloc() abstraction
> functions are there for. We already pass a pointer to a struct
> usb_device, so the routine knows which host controller it operates on.
> So we can safely dispatch all the magic inside this function, no?

No.  It says so right in the title line of the kerneldoc:

 * usb_buffer_alloc - allocate dma-consistent buffer for URB_NO_xxx_DMA_MAP

That is not what people want when they call kzalloc or kmalloc.

> If not, I would rather introduce a new function than adding GFP_ flags
> to all existing drivers.

All right.  But there would have to be _two_ new functions: one acting 
like kmalloc and another acting like kzalloc.  I guess they should take 
a pointer to struct usb_device as an argument, like usb_buffer_alloc.

> I vote for a clean solution, a fixup of existing implementations and
> a clear note about how to allocate buffers for USB drivers. I believe
> faulty allocations of this kind can explain quite a lot of problems on
> x86_64 machines.

There is one awkward aspect of usb_buffer_alloc which perhaps could
be fixed at the same time.  Under some conditions (for example, if the
controller needs to use internal bounce buffers) it will return
ordinary memory obtained using kmalloc rather than consistent memory.  
But it doesn't tell the caller when it has done so, and consequently
the caller will always specify URB_NO_TRANSFER_DMA_MAP when using the
buffer.  The proper flag to use should be returned to the caller.

Or alternatively, instead of allocating regular memory the routine
could simply fail.  Then the caller would be responsible for checking
and using regular memory instead of dma-consistent memory.  Of course,
that would put an even larger burden on the caller than just forcing it
to keep track of what flag to use.

> > > If what I've stated is true, there are quite some more drivers affected
> > > by this issue.
> > 
> > Practically every USB driver, I should think.  And maybe a lot of 
> > non-USB drivers too.
> 
> I found many such problems in drivers/media/{dvb,video},
> drivers/usb/serial, sound/usb and even in the USB core. If we agree on
> how to fix that nicely, I can take some of them.

I guess we could rename usb_buffer_alloc().  A more accurate name would
be something like usb_alloc_consistent() (except for the fact that
the routine falls back to regular memory if the controller can't use
consistent memory.)  Then we could have usb_malloc() and usb_zalloc()
in addition.

Alan Stern


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-07 15:46       ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-07 15:46 UTC (permalink / raw)
  To: Daniel Mack
  Cc: linux-kernel, Pedro Ribeiro, akpm, Greg KH, alsa-devel, linux-usb

On Wed, 7 Apr 2010, Daniel Mack wrote:

> > > The fix is to use usb_buffer_alloc() for that purpose which ensures
> > > memory that is suitable for DMA. And on x86_64, this also means that the
> > > upper 32 bits of the address returned are all 0's.
> > 
> > That is not a good fix.  usb_buffer_alloc() provides coherent memory, 
> > which is not what we want.  I believe the correct fix is to specify the 
> > GFP_DMA32 flag in the kzalloc() call.
> > 
> > Of course, some EHCI hardware _is_ capable of using 64-bit addresses.  
> > But not all, and other controller types aren't.  In principle we could
> > create a new allocation routine, which would take a pointer to the USB
> > bus as an additional argument and use it to decide whether the memory 
> > needs to lie below 4 GB.  I'm not sure adding this extra complexity 
> > would be worthwhile.
> 
> Well, I thought this is exactly what the usb_buffer_alloc() abstraction
> functions are there for. We already pass a pointer to a struct
> usb_device, so the routine knows which host controller it operates on.
> So we can safely dispatch all the magic inside this function, no?

No.  It says so right in the title line of the kerneldoc:

 * usb_buffer_alloc - allocate dma-consistent buffer for URB_NO_xxx_DMA_MAP

That is not what people want when they call kzalloc or kmalloc.

> If not, I would rather introduce a new function than adding GFP_ flags
> to all existing drivers.

All right.  But there would have to be _two_ new functions: one acting 
like kmalloc and another acting like kzalloc.  I guess they should take 
a pointer to struct usb_device as an argument, like usb_buffer_alloc.

> I vote for a clean solution, a fixup of existing implementations and
> a clear note about how to allocate buffers for USB drivers. I believe
> faulty allocations of this kind can explain quite a lot of problems on
> x86_64 machines.

There is one awkward aspect of usb_buffer_alloc which perhaps could
be fixed at the same time.  Under some conditions (for example, if the
controller needs to use internal bounce buffers) it will return
ordinary memory obtained using kmalloc rather than consistent memory.  
But it doesn't tell the caller when it has done so, and consequently
the caller will always specify URB_NO_TRANSFER_DMA_MAP when using the
buffer.  The proper flag to use should be returned to the caller.

Or alternatively, instead of allocating regular memory the routine
could simply fail.  Then the caller would be responsible for checking
and using regular memory instead of dma-consistent memory.  Of course,
that would put an even larger burden on the caller than just forcing it
to keep track of what flag to use.

> > > If what I've stated is true, there are quite some more drivers affected
> > > by this issue.
> > 
> > Practically every USB driver, I should think.  And maybe a lot of 
> > non-USB drivers too.
> 
> I found many such problems in drivers/media/{dvb,video},
> drivers/usb/serial, sound/usb and even in the USB core. If we agree on
> how to fix that nicely, I can take some of them.

I guess we could rename usb_buffer_alloc().  A more accurate name would
be something like usb_alloc_consistent() (except for the fact that
the routine falls back to regular memory if the controller can't use
consistent memory.)  Then we could have usb_malloc() and usb_zalloc()
in addition.

Alan Stern

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-07 15:35         ` Daniel Mack
@ 2010-04-07 15:51           ` Greg KH
  -1 siblings, 0 replies; 221+ messages in thread
From: Greg KH @ 2010-04-07 15:51 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Alan Stern, linux-kernel, Pedro Ribeiro, akpm, Greg KH,
	alsa-devel, linux-usb

On Wed, Apr 07, 2010 at 05:35:51PM +0200, Daniel Mack wrote:
> On Wed, Apr 07, 2010 at 08:31:54AM -0700, Greg KH wrote:
> > On Wed, Apr 07, 2010 at 05:11:25PM +0200, Daniel Mack wrote:
> > > I vote for a clean solution, a fixup of existing implementations and
> > > a clear note about how to allocate buffers for USB drivers. I believe
> > > faulty allocations of this kind can explain quite a lot of problems on
> > > x86_64 machines.
> > 
> > Yeah, I really don't want to have to change every driver in different
> > ways just depending on if someone thinks it is going to need to run on
> > this wierd hardware.
> > 
> > Alan, any objection to just using usb_buffer_alloc() for every driver?
> > Or is that too much overhead?
> 
> FWIW, most drivers I've seen in the past hours use a wild mix of
> kmalloc(), kzalloc(), kcalloc() and usb_buffer_alloc(). That should
> really be unified.

Yes, if it is necessary that we have to handle this type of crappy
hardware, then it all needs to be unified.  Or at least unified into 2
types of calls, one that needs the bounce buffer fun (what
usb_buffer_alloc() does today), and one that doesn't (usb_kzalloc()
perhaps?)

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-07 15:51           ` Greg KH
  0 siblings, 0 replies; 221+ messages in thread
From: Greg KH @ 2010-04-07 15:51 UTC (permalink / raw)
  To: Daniel Mack
  Cc: alsa-devel, linux-usb, Greg KH, linux-kernel, Alan Stern,
	Pedro Ribeiro, akpm

On Wed, Apr 07, 2010 at 05:35:51PM +0200, Daniel Mack wrote:
> On Wed, Apr 07, 2010 at 08:31:54AM -0700, Greg KH wrote:
> > On Wed, Apr 07, 2010 at 05:11:25PM +0200, Daniel Mack wrote:
> > > I vote for a clean solution, a fixup of existing implementations and
> > > a clear note about how to allocate buffers for USB drivers. I believe
> > > faulty allocations of this kind can explain quite a lot of problems on
> > > x86_64 machines.
> > 
> > Yeah, I really don't want to have to change every driver in different
> > ways just depending on if someone thinks it is going to need to run on
> > this wierd hardware.
> > 
> > Alan, any objection to just using usb_buffer_alloc() for every driver?
> > Or is that too much overhead?
> 
> FWIW, most drivers I've seen in the past hours use a wild mix of
> kmalloc(), kzalloc(), kcalloc() and usb_buffer_alloc(). That should
> really be unified.

Yes, if it is necessary that we have to handle this type of crappy
hardware, then it all needs to be unified.  Or at least unified into 2
types of calls, one that needs the bounce buffer fun (what
usb_buffer_alloc() does today), and one that doesn't (usb_kzalloc()
perhaps?)

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-07 15:31       ` Greg KH
@ 2010-04-07 15:55         ` Alan Stern
  -1 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-07 15:55 UTC (permalink / raw)
  To: Greg KH
  Cc: Daniel Mack, linux-kernel, Pedro Ribeiro, akpm, Greg KH,
	alsa-devel, linux-usb

On Wed, 7 Apr 2010, Greg KH wrote:

> Yeah, I really don't want to have to change every driver in different
> ways just depending on if someone thinks it is going to need to run on
> this wierd hardware.

It's not weird hardware, as far as I know.  It's just a 64-bit system
with a 32-bit USB host controller.

(And remember, while there are 64-bit EHCI controllers, there are not 
any 64-bit OHCI or UHCI controllers.  So whenever somebody plugs a 
full-speed or low-speed device into a 64-bit machine, they will face 
this problem.  It's like the old problem of ISA devices that could 
only do DMA to addresses in the first 16 MB of memory -- what the 
original GFP_DMA flag was intended for.)

> Alan, any objection to just using usb_buffer_alloc() for every driver?
> Or is that too much overhead?

I don't know what the overhead is.  But usb_buffer_alloc() requires the 
caller to keep track of the buffer's DMA address, so it's not a simple 
plug-in replacement.  In addition, the consistent memory that 
usb_buffer_alloc() provides is a scarce resource on some platforms.

Writing new functions is the way to go.

Alan Stern


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-07 15:55         ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-07 15:55 UTC (permalink / raw)
  To: Greg KH
  Cc: Daniel Mack, linux-kernel, Pedro Ribeiro, akpm, Greg KH,
	alsa-devel, linux-usb

On Wed, 7 Apr 2010, Greg KH wrote:

> Yeah, I really don't want to have to change every driver in different
> ways just depending on if someone thinks it is going to need to run on
> this wierd hardware.

It's not weird hardware, as far as I know.  It's just a 64-bit system
with a 32-bit USB host controller.

(And remember, while there are 64-bit EHCI controllers, there are not 
any 64-bit OHCI or UHCI controllers.  So whenever somebody plugs a 
full-speed or low-speed device into a 64-bit machine, they will face 
this problem.  It's like the old problem of ISA devices that could 
only do DMA to addresses in the first 16 MB of memory -- what the 
original GFP_DMA flag was intended for.)

> Alan, any objection to just using usb_buffer_alloc() for every driver?
> Or is that too much overhead?

I don't know what the overhead is.  But usb_buffer_alloc() requires the 
caller to keep track of the buffer's DMA address, so it's not a simple 
plug-in replacement.  In addition, the consistent memory that 
usb_buffer_alloc() provides is a scarce resource on some platforms.

Writing new functions is the way to go.

Alan Stern

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-07 16:04             ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-07 16:04 UTC (permalink / raw)
  To: Greg KH
  Cc: Daniel Mack, linux-kernel, Pedro Ribeiro, akpm, Greg KH,
	alsa-devel, linux-usb

On Wed, 7 Apr 2010, Greg KH wrote:

> > FWIW, most drivers I've seen in the past hours use a wild mix of
> > kmalloc(), kzalloc(), kcalloc() and usb_buffer_alloc(). That should
> > really be unified.

Well, kcalloc can easily be replaced by kzalloc, right?  Or the 
equivalent.

The extra overhead of initializing the memory to 0 isn't present in 
kmalloc, so we need to maintain the distinction between kmalloc and 
kzalloc.

However usb_buffer_alloc is fundmentally different from all the others.

> Yes, if it is necessary that we have to handle this type of crappy
> hardware, then it all needs to be unified.  Or at least unified into 2
> types of calls, one that needs the bounce buffer fun (what
> usb_buffer_alloc() does today), and one that doesn't (usb_kzalloc()
> perhaps?)

usb_buffer_alloc has very little to do with bounce buffers.  Its 
purpose is to allocate dma-consistent memory, that it, memory which 
does not need to be mapped for DMA before each I/O operation and 
unmapped afterward.

The mapping and unmapping operations aren't extremely time consuming,
so in general it makes sense to avoid them only when the _same_ buffer
is going to be used for many I/O operations during a short period of
time.  For instance, it makes sense for audio and video, where all the
data streams through a small set of buffers arranged in a ring.

But for most other uses it makes no sense.  Especially since some 
platforms have limited amounts of consistent memory available.

Alan Stern


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-07 16:04             ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-07 16:04 UTC (permalink / raw)
  To: Greg KH
  Cc: Daniel Mack, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Pedro Ribeiro,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b, Greg KH,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-usb-u79uwXL29TY76Z2rM5mHXA

On Wed, 7 Apr 2010, Greg KH wrote:

> > FWIW, most drivers I've seen in the past hours use a wild mix of
> > kmalloc(), kzalloc(), kcalloc() and usb_buffer_alloc(). That should
> > really be unified.

Well, kcalloc can easily be replaced by kzalloc, right?  Or the 
equivalent.

The extra overhead of initializing the memory to 0 isn't present in 
kmalloc, so we need to maintain the distinction between kmalloc and 
kzalloc.

However usb_buffer_alloc is fundmentally different from all the others.

> Yes, if it is necessary that we have to handle this type of crappy
> hardware, then it all needs to be unified.  Or at least unified into 2
> types of calls, one that needs the bounce buffer fun (what
> usb_buffer_alloc() does today), and one that doesn't (usb_kzalloc()
> perhaps?)

usb_buffer_alloc has very little to do with bounce buffers.  Its 
purpose is to allocate dma-consistent memory, that it, memory which 
does not need to be mapped for DMA before each I/O operation and 
unmapped afterward.

The mapping and unmapping operations aren't extremely time consuming,
so in general it makes sense to avoid them only when the _same_ buffer
is going to be used for many I/O operations during a short period of
time.  For instance, it makes sense for audio and video, where all the
data streams through a small set of buffers arranged in a ring.

But for most other uses it makes no sense.  Especially since some 
platforms have limited amounts of consistent memory available.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-07 15:55         ` Alan Stern
@ 2010-04-07 16:16           ` Daniel Mack
  -1 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-07 16:16 UTC (permalink / raw)
  To: Alan Stern
  Cc: Greg KH, linux-kernel, Pedro Ribeiro, akpm, Greg KH, alsa-devel,
	linux-usb

On Wed, Apr 07, 2010 at 11:55:19AM -0400, Alan Stern wrote:
> On Wed, 7 Apr 2010, Greg KH wrote:
> 
> > Alan, any objection to just using usb_buffer_alloc() for every driver?
> > Or is that too much overhead?
> 
> I don't know what the overhead is.  But usb_buffer_alloc() requires the 
> caller to keep track of the buffer's DMA address, so it's not a simple 
> plug-in replacement.  In addition, the consistent memory that 
> usb_buffer_alloc() provides is a scarce resource on some platforms.
> 
> Writing new functions is the way to go.

Ok, I'll write some dummies for usb_malloc() and usb_zalloc() which
will just call kmalloc() with GFP_DMA32 for now. And while at it,
usb_alloc_buffer() will be renamed to usb_alloc_consistent(). Then I'll
try to clean up all existing drivers to use this new interface and
follow the changes.

In a next step, we should fine-tune when GFP_DMA32 is really needed.
And I'll leave all occurances of usb_alloc_consistent() as they are now.

Does that sound ok?

Thanks,
Daniel


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-07 16:16           ` Daniel Mack
  0 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-07 16:16 UTC (permalink / raw)
  To: Alan Stern
  Cc: alsa-devel, linux-usb, Greg KH, Greg KH, linux-kernel,
	Pedro Ribeiro, akpm

On Wed, Apr 07, 2010 at 11:55:19AM -0400, Alan Stern wrote:
> On Wed, 7 Apr 2010, Greg KH wrote:
> 
> > Alan, any objection to just using usb_buffer_alloc() for every driver?
> > Or is that too much overhead?
> 
> I don't know what the overhead is.  But usb_buffer_alloc() requires the 
> caller to keep track of the buffer's DMA address, so it's not a simple 
> plug-in replacement.  In addition, the consistent memory that 
> usb_buffer_alloc() provides is a scarce resource on some platforms.
> 
> Writing new functions is the way to go.

Ok, I'll write some dummies for usb_malloc() and usb_zalloc() which
will just call kmalloc() with GFP_DMA32 for now. And while at it,
usb_alloc_buffer() will be renamed to usb_alloc_consistent(). Then I'll
try to clean up all existing drivers to use this new interface and
follow the changes.

In a next step, we should fine-tune when GFP_DMA32 is really needed.
And I'll leave all occurances of usb_alloc_consistent() as they are now.

Does that sound ok?

Thanks,
Daniel

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-07 16:16           ` Daniel Mack
@ 2010-04-07 16:47             ` Alan Stern
  -1 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-07 16:47 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Greg KH, linux-kernel, Pedro Ribeiro, akpm, Greg KH, alsa-devel,
	linux-usb

On Wed, 7 Apr 2010, Daniel Mack wrote:

> Ok, I'll write some dummies for usb_malloc() and usb_zalloc() which
> will just call kmalloc() with GFP_DMA32 for now. And while at it,
> usb_alloc_buffer() will be renamed to usb_alloc_consistent(). Then I'll
> try to clean up all existing drivers to use this new interface and
> follow the changes.
> 
> In a next step, we should fine-tune when GFP_DMA32 is really needed.
> And I'll leave all occurances of usb_alloc_consistent() as they are now.
> 
> Does that sound ok?

Yes, that should work out well.

Alan Stern


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-07 16:47             ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-07 16:47 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Greg KH, linux-kernel, Pedro Ribeiro, akpm, Greg KH, alsa-devel,
	linux-usb

On Wed, 7 Apr 2010, Daniel Mack wrote:

> Ok, I'll write some dummies for usb_malloc() and usb_zalloc() which
> will just call kmalloc() with GFP_DMA32 for now. And while at it,
> usb_alloc_buffer() will be renamed to usb_alloc_consistent(). Then I'll
> try to clean up all existing drivers to use this new interface and
> follow the changes.
> 
> In a next step, we should fine-tune when GFP_DMA32 is really needed.
> And I'll leave all occurances of usb_alloc_consistent() as they are now.
> 
> Does that sound ok?

Yes, that should work out well.

Alan Stern

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-07 16:54     ` Oliver Neukum
  0 siblings, 0 replies; 221+ messages in thread
From: Oliver Neukum @ 2010-04-07 16:54 UTC (permalink / raw)
  To: Alan Stern
  Cc: Daniel Mack, linux-kernel, Pedro Ribeiro, akpm, Greg KH,
	alsa-devel, linux-usb

Am Mittwoch, 7. April 2010 16:59:47 schrieb Alan Stern:
> > The fix is to use usb_buffer_alloc() for that purpose which ensures
> > memory that is suitable for DMA. And on x86_64, this also means that the
> > upper 32 bits of the address returned are all 0's.
> 
> That is not a good fix.  usb_buffer_alloc() provides coherent memory, 
> which is not what we want.  I believe the correct fix is to specify the 
> GFP_DMA32 flag in the kzalloc() call.
> 
> Of course, some EHCI hardware is capable of using 64-bit addresses.  
> But not all, and other controller types aren't.  In principle we could
> create a new allocation routine, which would take a pointer to the USB
> bus as an additional argument and use it to decide whether the memory 
> needs to lie below 4 GB.  I'm not sure adding this extra complexity 
> would be worthwhile.

What about XHCI? Do you really want to limit it to 32bits?

	Regards
		Oliver

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-07 16:54     ` Oliver Neukum
  0 siblings, 0 replies; 221+ messages in thread
From: Oliver Neukum @ 2010-04-07 16:54 UTC (permalink / raw)
  To: Alan Stern
  Cc: Daniel Mack, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Pedro Ribeiro,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b, Greg KH,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-usb-u79uwXL29TY76Z2rM5mHXA

Am Mittwoch, 7. April 2010 16:59:47 schrieb Alan Stern:
> > The fix is to use usb_buffer_alloc() for that purpose which ensures
> > memory that is suitable for DMA. And on x86_64, this also means that the
> > upper 32 bits of the address returned are all 0's.
> 
> That is not a good fix.  usb_buffer_alloc() provides coherent memory, 
> which is not what we want.  I believe the correct fix is to specify the 
> GFP_DMA32 flag in the kzalloc() call.
> 
> Of course, some EHCI hardware is capable of using 64-bit addresses.  
> But not all, and other controller types aren't.  In principle we could
> create a new allocation routine, which would take a pointer to the USB
> bus as an additional argument and use it to decide whether the memory 
> needs to lie below 4 GB.  I'm not sure adding this extra complexity 
> would be worthwhile.

What about XHCI? Do you really want to limit it to 32bits?

	Regards
		Oliver
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-07 17:00       ` Daniel Mack
  0 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-07 17:00 UTC (permalink / raw)
  To: Oliver Neukum
  Cc: Alan Stern, linux-kernel, Pedro Ribeiro, akpm, Greg KH,
	alsa-devel, linux-usb

On Wed, Apr 07, 2010 at 06:54:55PM +0200, Oliver Neukum wrote:
> Am Mittwoch, 7. April 2010 16:59:47 schrieb Alan Stern:
> > > The fix is to use usb_buffer_alloc() for that purpose which ensures
> > > memory that is suitable for DMA. And on x86_64, this also means that the
> > > upper 32 bits of the address returned are all 0's.
> > 
> > That is not a good fix.  usb_buffer_alloc() provides coherent memory, 
> > which is not what we want.  I believe the correct fix is to specify the 
> > GFP_DMA32 flag in the kzalloc() call.
> > 
> > Of course, some EHCI hardware is capable of using 64-bit addresses.  
> > But not all, and other controller types aren't.  In principle we could
> > create a new allocation routine, which would take a pointer to the USB
> > bus as an additional argument and use it to decide whether the memory 
> > needs to lie below 4 GB.  I'm not sure adding this extra complexity 
> > would be worthwhile.
> 
> What about XHCI? Do you really want to limit it to 32bits?

No. Once we have the abstraction functions, we can well decide what to
do in there, depending on the actual controller we're running on.

Daniel


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-07 17:00       ` Daniel Mack
  0 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-07 17:00 UTC (permalink / raw)
  To: Oliver Neukum
  Cc: Alan Stern, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Pedro Ribeiro,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b, Greg KH,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-usb-u79uwXL29TY76Z2rM5mHXA

On Wed, Apr 07, 2010 at 06:54:55PM +0200, Oliver Neukum wrote:
> Am Mittwoch, 7. April 2010 16:59:47 schrieb Alan Stern:
> > > The fix is to use usb_buffer_alloc() for that purpose which ensures
> > > memory that is suitable for DMA. And on x86_64, this also means that the
> > > upper 32 bits of the address returned are all 0's.
> > 
> > That is not a good fix.  usb_buffer_alloc() provides coherent memory, 
> > which is not what we want.  I believe the correct fix is to specify the 
> > GFP_DMA32 flag in the kzalloc() call.
> > 
> > Of course, some EHCI hardware is capable of using 64-bit addresses.  
> > But not all, and other controller types aren't.  In principle we could
> > create a new allocation routine, which would take a pointer to the USB
> > bus as an additional argument and use it to decide whether the memory 
> > needs to lie below 4 GB.  I'm not sure adding this extra complexity 
> > would be worthwhile.
> 
> What about XHCI? Do you really want to limit it to 32bits?

No. Once we have the abstraction functions, we can well decide what to
do in there, depending on the actual controller we're running on.

Daniel

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-07 15:55         ` Alan Stern
@ 2010-04-07 17:52           ` Takashi Iwai
  -1 siblings, 0 replies; 221+ messages in thread
From: Takashi Iwai @ 2010-04-07 17:52 UTC (permalink / raw)
  To: Alan Stern
  Cc: Greg KH, Daniel Mack, linux-kernel, Pedro Ribeiro, akpm, Greg KH,
	alsa-devel, linux-usb

At Wed, 7 Apr 2010 11:55:19 -0400 (EDT),
Alan Stern wrote:
> 
> On Wed, 7 Apr 2010, Greg KH wrote:
> 
> > Yeah, I really don't want to have to change every driver in different
> > ways just depending on if someone thinks it is going to need to run on
> > this wierd hardware.
> 
> It's not weird hardware, as far as I know.  It's just a 64-bit system
> with a 32-bit USB host controller.
> 
> (And remember, while there are 64-bit EHCI controllers, there are not 
> any 64-bit OHCI or UHCI controllers.  So whenever somebody plugs a 
> full-speed or low-speed device into a 64-bit machine, they will face 
> this problem.  It's like the old problem of ISA devices that could 
> only do DMA to addresses in the first 16 MB of memory -- what the 
> original GFP_DMA flag was intended for.)
> 
> > Alan, any objection to just using usb_buffer_alloc() for every driver?
> > Or is that too much overhead?
> 
> I don't know what the overhead is.  But usb_buffer_alloc() requires the 
> caller to keep track of the buffer's DMA address, so it's not a simple 
> plug-in replacement.  In addition, the consistent memory that 
> usb_buffer_alloc() provides is a scarce resource on some platforms.

Yeah, also the area is aligned to kernel pages, and it may be much
bigger than the requested (power-of-two).  If not needed, we should
avoid it.


thanks,

Takashi

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-07 17:52           ` Takashi Iwai
  0 siblings, 0 replies; 221+ messages in thread
From: Takashi Iwai @ 2010-04-07 17:52 UTC (permalink / raw)
  To: Alan Stern
  Cc: alsa-devel, linux-usb, Greg KH, Greg KH, linux-kernel,
	Pedro Ribeiro, akpm

At Wed, 7 Apr 2010 11:55:19 -0400 (EDT),
Alan Stern wrote:
> 
> On Wed, 7 Apr 2010, Greg KH wrote:
> 
> > Yeah, I really don't want to have to change every driver in different
> > ways just depending on if someone thinks it is going to need to run on
> > this wierd hardware.
> 
> It's not weird hardware, as far as I know.  It's just a 64-bit system
> with a 32-bit USB host controller.
> 
> (And remember, while there are 64-bit EHCI controllers, there are not 
> any 64-bit OHCI or UHCI controllers.  So whenever somebody plugs a 
> full-speed or low-speed device into a 64-bit machine, they will face 
> this problem.  It's like the old problem of ISA devices that could 
> only do DMA to addresses in the first 16 MB of memory -- what the 
> original GFP_DMA flag was intended for.)
> 
> > Alan, any objection to just using usb_buffer_alloc() for every driver?
> > Or is that too much overhead?
> 
> I don't know what the overhead is.  But usb_buffer_alloc() requires the 
> caller to keep track of the buffer's DMA address, so it's not a simple 
> plug-in replacement.  In addition, the consistent memory that 
> usb_buffer_alloc() provides is a scarce resource on some platforms.

Yeah, also the area is aligned to kernel pages, and it may be much
bigger than the requested (power-of-two).  If not needed, we should
avoid it.


thanks,

Takashi

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-07 16:16           ` Daniel Mack
@ 2010-04-07 17:55             ` Takashi Iwai
  -1 siblings, 0 replies; 221+ messages in thread
From: Takashi Iwai @ 2010-04-07 17:55 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Alan Stern, Greg KH, linux-kernel, Pedro Ribeiro, akpm, Greg KH,
	alsa-devel, linux-usb

At Wed, 7 Apr 2010 18:16:03 +0200,
Daniel Mack wrote:
> 
> On Wed, Apr 07, 2010 at 11:55:19AM -0400, Alan Stern wrote:
> > On Wed, 7 Apr 2010, Greg KH wrote:
> > 
> > > Alan, any objection to just using usb_buffer_alloc() for every driver?
> > > Or is that too much overhead?
> > 
> > I don't know what the overhead is.  But usb_buffer_alloc() requires the 
> > caller to keep track of the buffer's DMA address, so it's not a simple 
> > plug-in replacement.  In addition, the consistent memory that 
> > usb_buffer_alloc() provides is a scarce resource on some platforms.
> > 
> > Writing new functions is the way to go.
> 
> Ok, I'll write some dummies for usb_malloc() and usb_zalloc() which
> will just call kmalloc() with GFP_DMA32 for now.

Can't we provide only zalloc() variant?  Zero'ing doesn't cost much,
and the buffer allocation shouldn't be called too often.

> And while at it,
> usb_alloc_buffer() will be renamed to usb_alloc_consistent().

Most of recent functions are named with "coherent".


thanks,

Takashi

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-07 17:55             ` Takashi Iwai
  0 siblings, 0 replies; 221+ messages in thread
From: Takashi Iwai @ 2010-04-07 17:55 UTC (permalink / raw)
  To: Daniel Mack
  Cc: alsa-devel, linux-usb, Greg KH, Greg KH, linux-kernel,
	Alan Stern, Pedro Ribeiro, akpm

At Wed, 7 Apr 2010 18:16:03 +0200,
Daniel Mack wrote:
> 
> On Wed, Apr 07, 2010 at 11:55:19AM -0400, Alan Stern wrote:
> > On Wed, 7 Apr 2010, Greg KH wrote:
> > 
> > > Alan, any objection to just using usb_buffer_alloc() for every driver?
> > > Or is that too much overhead?
> > 
> > I don't know what the overhead is.  But usb_buffer_alloc() requires the 
> > caller to keep track of the buffer's DMA address, so it's not a simple 
> > plug-in replacement.  In addition, the consistent memory that 
> > usb_buffer_alloc() provides is a scarce resource on some platforms.
> > 
> > Writing new functions is the way to go.
> 
> Ok, I'll write some dummies for usb_malloc() and usb_zalloc() which
> will just call kmalloc() with GFP_DMA32 for now.

Can't we provide only zalloc() variant?  Zero'ing doesn't cost much,
and the buffer allocation shouldn't be called too often.

> And while at it,
> usb_alloc_buffer() will be renamed to usb_alloc_consistent().

Most of recent functions are named with "coherent".


thanks,

Takashi

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-07 17:55             ` Takashi Iwai
@ 2010-04-07 17:59               ` Daniel Mack
  -1 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-07 17:59 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: Alan Stern, Greg KH, linux-kernel, Pedro Ribeiro, akpm, Greg KH,
	alsa-devel, linux-usb

On Wed, Apr 07, 2010 at 07:55:20PM +0200, Takashi Iwai wrote:
> At Wed, 7 Apr 2010 18:16:03 +0200,
> Daniel Mack wrote:
> > 
> > On Wed, Apr 07, 2010 at 11:55:19AM -0400, Alan Stern wrote:
> > > On Wed, 7 Apr 2010, Greg KH wrote:
> > > 
> > > > Alan, any objection to just using usb_buffer_alloc() for every driver?
> > > > Or is that too much overhead?
> > > 
> > > I don't know what the overhead is.  But usb_buffer_alloc() requires the 
> > > caller to keep track of the buffer's DMA address, so it's not a simple 
> > > plug-in replacement.  In addition, the consistent memory that 
> > > usb_buffer_alloc() provides is a scarce resource on some platforms.
> > > 
> > > Writing new functions is the way to go.
> > 
> > Ok, I'll write some dummies for usb_malloc() and usb_zalloc() which
> > will just call kmalloc() with GFP_DMA32 for now.
> 
> Can't we provide only zalloc() variant?  Zero'ing doesn't cost much,
> and the buffer allocation shouldn't be called too often.
> 
> > And while at it,
> > usb_alloc_buffer() will be renamed to usb_alloc_consistent().
> 
> Most of recent functions are named with "coherent".

I agree to both points, will do so unless anyone has a harsh opinion
about that.

Another thing: I guess we don't need a corresponding free() function
that just calls kfree(), right? Or should we introduce it now to be
flexible for future extensions?

Daniel


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-07 17:59               ` Daniel Mack
  0 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-07 17:59 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: alsa-devel, linux-usb, Greg KH, Greg KH, linux-kernel,
	Alan Stern, Pedro Ribeiro, akpm

On Wed, Apr 07, 2010 at 07:55:20PM +0200, Takashi Iwai wrote:
> At Wed, 7 Apr 2010 18:16:03 +0200,
> Daniel Mack wrote:
> > 
> > On Wed, Apr 07, 2010 at 11:55:19AM -0400, Alan Stern wrote:
> > > On Wed, 7 Apr 2010, Greg KH wrote:
> > > 
> > > > Alan, any objection to just using usb_buffer_alloc() for every driver?
> > > > Or is that too much overhead?
> > > 
> > > I don't know what the overhead is.  But usb_buffer_alloc() requires the 
> > > caller to keep track of the buffer's DMA address, so it's not a simple 
> > > plug-in replacement.  In addition, the consistent memory that 
> > > usb_buffer_alloc() provides is a scarce resource on some platforms.
> > > 
> > > Writing new functions is the way to go.
> > 
> > Ok, I'll write some dummies for usb_malloc() and usb_zalloc() which
> > will just call kmalloc() with GFP_DMA32 for now.
> 
> Can't we provide only zalloc() variant?  Zero'ing doesn't cost much,
> and the buffer allocation shouldn't be called too often.
> 
> > And while at it,
> > usb_alloc_buffer() will be renamed to usb_alloc_consistent().
> 
> Most of recent functions are named with "coherent".

I agree to both points, will do so unless anyone has a harsh opinion
about that.

Another thing: I guess we don't need a corresponding free() function
that just calls kfree(), right? Or should we introduce it now to be
flexible for future extensions?

Daniel

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-07 17:59               ` Daniel Mack
@ 2010-04-07 18:06                 ` Takashi Iwai
  -1 siblings, 0 replies; 221+ messages in thread
From: Takashi Iwai @ 2010-04-07 18:06 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Alan Stern, Greg KH, linux-kernel, Pedro Ribeiro, akpm, Greg KH,
	alsa-devel, linux-usb

At Wed, 7 Apr 2010 19:59:35 +0200,
Daniel Mack wrote:
> 
> On Wed, Apr 07, 2010 at 07:55:20PM +0200, Takashi Iwai wrote:
> > At Wed, 7 Apr 2010 18:16:03 +0200,
> > Daniel Mack wrote:
> > > 
> > > On Wed, Apr 07, 2010 at 11:55:19AM -0400, Alan Stern wrote:
> > > > On Wed, 7 Apr 2010, Greg KH wrote:
> > > > 
> > > > > Alan, any objection to just using usb_buffer_alloc() for every driver?
> > > > > Or is that too much overhead?
> > > > 
> > > > I don't know what the overhead is.  But usb_buffer_alloc() requires the 
> > > > caller to keep track of the buffer's DMA address, so it's not a simple 
> > > > plug-in replacement.  In addition, the consistent memory that 
> > > > usb_buffer_alloc() provides is a scarce resource on some platforms.
> > > > 
> > > > Writing new functions is the way to go.
> > > 
> > > Ok, I'll write some dummies for usb_malloc() and usb_zalloc() which
> > > will just call kmalloc() with GFP_DMA32 for now.
> > 
> > Can't we provide only zalloc() variant?  Zero'ing doesn't cost much,
> > and the buffer allocation shouldn't be called too often.
> > 
> > > And while at it,
> > > usb_alloc_buffer() will be renamed to usb_alloc_consistent().
> > 
> > Most of recent functions are named with "coherent".
> 
> I agree to both points, will do so unless anyone has a harsh opinion
> about that.
> 
> Another thing: I guess we don't need a corresponding free() function
> that just calls kfree(), right? Or should we introduce it now to be
> flexible for future extensions?

Well, I would implement the corresponding free.  It could be simply
a macro calling kfree(), but it's saner to provide it for API
uniformity, IMO.


thanks,

Takashi

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-07 18:06                 ` Takashi Iwai
  0 siblings, 0 replies; 221+ messages in thread
From: Takashi Iwai @ 2010-04-07 18:06 UTC (permalink / raw)
  To: Daniel Mack
  Cc: alsa-devel, linux-usb, Greg KH, Greg KH, linux-kernel,
	Alan Stern, Pedro Ribeiro, akpm

At Wed, 7 Apr 2010 19:59:35 +0200,
Daniel Mack wrote:
> 
> On Wed, Apr 07, 2010 at 07:55:20PM +0200, Takashi Iwai wrote:
> > At Wed, 7 Apr 2010 18:16:03 +0200,
> > Daniel Mack wrote:
> > > 
> > > On Wed, Apr 07, 2010 at 11:55:19AM -0400, Alan Stern wrote:
> > > > On Wed, 7 Apr 2010, Greg KH wrote:
> > > > 
> > > > > Alan, any objection to just using usb_buffer_alloc() for every driver?
> > > > > Or is that too much overhead?
> > > > 
> > > > I don't know what the overhead is.  But usb_buffer_alloc() requires the 
> > > > caller to keep track of the buffer's DMA address, so it's not a simple 
> > > > plug-in replacement.  In addition, the consistent memory that 
> > > > usb_buffer_alloc() provides is a scarce resource on some platforms.
> > > > 
> > > > Writing new functions is the way to go.
> > > 
> > > Ok, I'll write some dummies for usb_malloc() and usb_zalloc() which
> > > will just call kmalloc() with GFP_DMA32 for now.
> > 
> > Can't we provide only zalloc() variant?  Zero'ing doesn't cost much,
> > and the buffer allocation shouldn't be called too often.
> > 
> > > And while at it,
> > > usb_alloc_buffer() will be renamed to usb_alloc_consistent().
> > 
> > Most of recent functions are named with "coherent".
> 
> I agree to both points, will do so unless anyone has a harsh opinion
> about that.
> 
> Another thing: I guess we don't need a corresponding free() function
> that just calls kfree(), right? Or should we introduce it now to be
> flexible for future extensions?

Well, I would implement the corresponding free.  It could be simply
a macro calling kfree(), but it's saner to provide it for API
uniformity, IMO.


thanks,

Takashi

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-07 17:55             ` Takashi Iwai
@ 2010-04-07 19:13               ` Alan Stern
  -1 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-07 19:13 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: Daniel Mack, Greg KH, linux-kernel, Pedro Ribeiro, akpm, Greg KH,
	alsa-devel, linux-usb

On Wed, 7 Apr 2010, Takashi Iwai wrote:

> > Ok, I'll write some dummies for usb_malloc() and usb_zalloc() which
> > will just call kmalloc() with GFP_DMA32 for now.
> 
> Can't we provide only zalloc() variant?  Zero'ing doesn't cost much,
> and the buffer allocation shouldn't be called too often.

Linus specifically requested us to avoid using kzalloc in usbfs.  I
can't find the message in the email archives, but Greg KH should be
able to confirm it.

As long as we're imitating kmalloc for one use, we might as well make
it available to all.

> > And while at it,
> > usb_alloc_buffer() will be renamed to usb_alloc_consistent().
> 
> Most of recent functions are named with "coherent".

Yes, the terminology got a little confused between the PCI and DMA
realms.  I agree, "coherent" is better.

BTW, although some EHCI controllers may support 64-bit DMA, the driver 
contains this:

	if (HCC_64BIT_ADDR(hcc_params)) {
		ehci_writel(ehci, 0, &ehci->regs->segment);
#if 0
// this is deeply broken on almost all architectures
		if (!dma_set_mask(hcd->self.controller, DMA_BIT_MASK(64)))
			ehci_info(ehci, "enabled 64bit DMA\n");
#endif
	}

I don't know if the comment is still true, but until the "#if 0" is 
removed, ehci-hcd won't make use of 64-bit DMA.

Note also that just before the lines above, ehci-hcd.c contains this
comment:

	 * pci_pool consistent memory always uses segment zero.

(Nowadays the driver uses dma_pool, not pci_pool.)  As far as I can
tell, this comment isn't true on 64-bit systems, but nevertheless,
ehci-hcd relies on it.  Of course it _is_ true for devices whose DMA
mask indicates they can't use memory above 4 GB -- but if ehci-hcd is
changed to enlarge the DMA mask then how do we force dma_pool memory to
lie below 4 GB?

[Actually it isn't _really_ necessary for the dma_pool to lie below 4 
GB.  But ehci-hcd allocates several pools, and it _is_ necessary for 
all of them to lie in the _same_ 4 GB segment.  The easiest way to do 
that is to put them all in segment 0.]

Alan Stern


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-07 19:13               ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-07 19:13 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: Daniel Mack, Greg KH, linux-kernel, Pedro Ribeiro, akpm, Greg KH,
	alsa-devel, linux-usb

On Wed, 7 Apr 2010, Takashi Iwai wrote:

> > Ok, I'll write some dummies for usb_malloc() and usb_zalloc() which
> > will just call kmalloc() with GFP_DMA32 for now.
> 
> Can't we provide only zalloc() variant?  Zero'ing doesn't cost much,
> and the buffer allocation shouldn't be called too often.

Linus specifically requested us to avoid using kzalloc in usbfs.  I
can't find the message in the email archives, but Greg KH should be
able to confirm it.

As long as we're imitating kmalloc for one use, we might as well make
it available to all.

> > And while at it,
> > usb_alloc_buffer() will be renamed to usb_alloc_consistent().
> 
> Most of recent functions are named with "coherent".

Yes, the terminology got a little confused between the PCI and DMA
realms.  I agree, "coherent" is better.

BTW, although some EHCI controllers may support 64-bit DMA, the driver 
contains this:

	if (HCC_64BIT_ADDR(hcc_params)) {
		ehci_writel(ehci, 0, &ehci->regs->segment);
#if 0
// this is deeply broken on almost all architectures
		if (!dma_set_mask(hcd->self.controller, DMA_BIT_MASK(64)))
			ehci_info(ehci, "enabled 64bit DMA\n");
#endif
	}

I don't know if the comment is still true, but until the "#if 0" is 
removed, ehci-hcd won't make use of 64-bit DMA.

Note also that just before the lines above, ehci-hcd.c contains this
comment:

	 * pci_pool consistent memory always uses segment zero.

(Nowadays the driver uses dma_pool, not pci_pool.)  As far as I can
tell, this comment isn't true on 64-bit systems, but nevertheless,
ehci-hcd relies on it.  Of course it _is_ true for devices whose DMA
mask indicates they can't use memory above 4 GB -- but if ehci-hcd is
changed to enlarge the DMA mask then how do we force dma_pool memory to
lie below 4 GB?

[Actually it isn't _really_ necessary for the dma_pool to lie below 4 
GB.  But ehci-hcd allocates several pools, and it _is_ necessary for 
all of them to lie in the _same_ 4 GB segment.  The easiest way to do 
that is to put them all in segment 0.]

Alan Stern

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-07 23:55     ` Robert Hancock
  0 siblings, 0 replies; 221+ messages in thread
From: Robert Hancock @ 2010-04-07 23:55 UTC (permalink / raw)
  To: Alan Stern
  Cc: Daniel Mack, linux-kernel, Pedro Ribeiro, akpm, Greg KH,
	alsa-devel, linux-usb

On 04/07/2010 08:59 AM, Alan Stern wrote:
> On Wed, 7 Apr 2010, Daniel Mack wrote:
>
>> Hi,
>>
>> I was pointed to https://bugzilla.kernel.org/show_bug.cgi?id=15580 by
>> Pedro Ribeiro, and unfortunately I'm pretty late in the game. I wasn't
>> aware of that thread until yesterday.
>>
>> While the report is quite confusing, the reason seams pretty clear to me
>> as I've been thru quite some time-demanding debugging of a very similar
>> issue on Mac OS X. But I'm not totally sure whether we really hit the
>> same issue here, so I'd like to have your opinions first.
>>
>> The problem is appearantly the way the transfer buffer is allocated in
>> the drivers. In the snd-usb-caiaq driver, I used kzalloc() to get memory
>> which works fine on 32bit systems. On x86_64, however, it seems that
>> kzalloc() hands out memory beyond the 32bit addressable boundary, which
>> the DMA controller of the 32bit PCI-connected EHCI controller is unable
>> to write to or read from. Am I correct on this conclusion?
>
> That seems like the right answer.  You are correct that an EHCI
> controller capable only of 32-bit memory accesses would not be able to
> use a buffer above the 4 GB line.
>
>> Depending on the condition of the memory management, things might work
>> or not, and especially right after a reboot, there's a better chance to
>> get lower memory.
>>
>> The fix is to use usb_buffer_alloc() for that purpose which ensures
>> memory that is suitable for DMA. And on x86_64, this also means that the
>> upper 32 bits of the address returned are all 0's.
>
> That is not a good fix.  usb_buffer_alloc() provides coherent memory,
> which is not what we want.  I believe the correct fix is to specify the
> GFP_DMA32 flag in the kzalloc() call.
>
> Of course, some EHCI hardware _is_ capable of using 64-bit addresses.
> But not all, and other controller types aren't.  In principle we could
> create a new allocation routine, which would take a pointer to the USB
> bus as an additional argument and use it to decide whether the memory
> needs to lie below 4 GB.  I'm not sure adding this extra complexity
> would be worthwhile.

AFAIK, the driver shouldn't have to worry about this at all. When the 
buffer gets DMA-mapped for the controller, the DMA mapping code should 
see that the device has a 32-bit DMA mask and either bounce or IOMMU-map 
the memory so that it appears below 4GB.

Not to say that something might not be sabotaging this somehow, but this 
complexity really shouldn't be needed.

>
>> If what I've stated is true, there are quite some more drivers affected
>> by this issue.
>
> Practically every USB driver, I should think.  And maybe a lot of
> non-USB drivers too.
>
>> I collected a list of places where similar fixes are
>> needed, and I can send patches if I get a thumbs-up.
>>
>> Pedro is currently testing a patch I sent out yesterday.
>
> Good work -- it certainly would have taken me a long time to figure
> this out.
>
> Alan Stern
>


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-07 23:55     ` Robert Hancock
  0 siblings, 0 replies; 221+ messages in thread
From: Robert Hancock @ 2010-04-07 23:55 UTC (permalink / raw)
  To: Alan Stern
  Cc: Daniel Mack, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Pedro Ribeiro,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b, Greg KH,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-usb-u79uwXL29TY76Z2rM5mHXA

On 04/07/2010 08:59 AM, Alan Stern wrote:
> On Wed, 7 Apr 2010, Daniel Mack wrote:
>
>> Hi,
>>
>> I was pointed to https://bugzilla.kernel.org/show_bug.cgi?id=15580 by
>> Pedro Ribeiro, and unfortunately I'm pretty late in the game. I wasn't
>> aware of that thread until yesterday.
>>
>> While the report is quite confusing, the reason seams pretty clear to me
>> as I've been thru quite some time-demanding debugging of a very similar
>> issue on Mac OS X. But I'm not totally sure whether we really hit the
>> same issue here, so I'd like to have your opinions first.
>>
>> The problem is appearantly the way the transfer buffer is allocated in
>> the drivers. In the snd-usb-caiaq driver, I used kzalloc() to get memory
>> which works fine on 32bit systems. On x86_64, however, it seems that
>> kzalloc() hands out memory beyond the 32bit addressable boundary, which
>> the DMA controller of the 32bit PCI-connected EHCI controller is unable
>> to write to or read from. Am I correct on this conclusion?
>
> That seems like the right answer.  You are correct that an EHCI
> controller capable only of 32-bit memory accesses would not be able to
> use a buffer above the 4 GB line.
>
>> Depending on the condition of the memory management, things might work
>> or not, and especially right after a reboot, there's a better chance to
>> get lower memory.
>>
>> The fix is to use usb_buffer_alloc() for that purpose which ensures
>> memory that is suitable for DMA. And on x86_64, this also means that the
>> upper 32 bits of the address returned are all 0's.
>
> That is not a good fix.  usb_buffer_alloc() provides coherent memory,
> which is not what we want.  I believe the correct fix is to specify the
> GFP_DMA32 flag in the kzalloc() call.
>
> Of course, some EHCI hardware _is_ capable of using 64-bit addresses.
> But not all, and other controller types aren't.  In principle we could
> create a new allocation routine, which would take a pointer to the USB
> bus as an additional argument and use it to decide whether the memory
> needs to lie below 4 GB.  I'm not sure adding this extra complexity
> would be worthwhile.

AFAIK, the driver shouldn't have to worry about this at all. When the 
buffer gets DMA-mapped for the controller, the DMA mapping code should 
see that the device has a 32-bit DMA mask and either bounce or IOMMU-map 
the memory so that it appears below 4GB.

Not to say that something might not be sabotaging this somehow, but this 
complexity really shouldn't be needed.

>
>> If what I've stated is true, there are quite some more drivers affected
>> by this issue.
>
> Practically every USB driver, I should think.  And maybe a lot of
> non-USB drivers too.
>
>> I collected a list of places where similar fixes are
>> needed, and I can send patches if I get a thumbs-up.
>>
>> Pedro is currently testing a patch I sent out yesterday.
>
> Good work -- it certainly would have taken me a long time to figure
> this out.
>
> Alan Stern
>

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-07 23:59                 ` Robert Hancock
  0 siblings, 0 replies; 221+ messages in thread
From: Robert Hancock @ 2010-04-07 23:59 UTC (permalink / raw)
  To: Alan Stern
  Cc: Takashi Iwai, Daniel Mack, Greg KH, linux-kernel, Pedro Ribeiro,
	akpm, Greg KH, alsa-devel, linux-usb

On 04/07/2010 01:13 PM, Alan Stern wrote:
> On Wed, 7 Apr 2010, Takashi Iwai wrote:
>
>>> Ok, I'll write some dummies for usb_malloc() and usb_zalloc() which
>>> will just call kmalloc() with GFP_DMA32 for now.
>>
>> Can't we provide only zalloc() variant?  Zero'ing doesn't cost much,
>> and the buffer allocation shouldn't be called too often.
>
> Linus specifically requested us to avoid using kzalloc in usbfs.  I
> can't find the message in the email archives, but Greg KH should be
> able to confirm it.
>
> As long as we're imitating kmalloc for one use, we might as well make
> it available to all.
>
>>> And while at it,
>>> usb_alloc_buffer() will be renamed to usb_alloc_consistent().
>>
>> Most of recent functions are named with "coherent".
>
> Yes, the terminology got a little confused between the PCI and DMA
> realms.  I agree, "coherent" is better.
>
> BTW, although some EHCI controllers may support 64-bit DMA, the driver
> contains this:
>
> 	if (HCC_64BIT_ADDR(hcc_params)) {
> 		ehci_writel(ehci, 0,&ehci->regs->segment);
> #if 0
> // this is deeply broken on almost all architectures
> 		if (!dma_set_mask(hcd->self.controller, DMA_BIT_MASK(64)))
> 			ehci_info(ehci, "enabled 64bit DMA\n");
> #endif
> 	}
>
> I don't know if the comment is still true, but until the "#if 0" is
> removed, ehci-hcd won't make use of 64-bit DMA.

The comment is wrong (or at least outdated or based on an incorrect 
assumption), but you're right, currently 64-bit DMA is not used on any 
EHCI controllers. It could be, but it sounded like the consensus was it 
wasn't worth the risk. Apparently Windows 7 started using it, and then 
had to put out a patch because some NVidia EHCI controllers indicated 
64-bit support but it didn't work properly. So you'd have to blacklist 
those controllers, at least.

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-07 23:59                 ` Robert Hancock
  0 siblings, 0 replies; 221+ messages in thread
From: Robert Hancock @ 2010-04-07 23:59 UTC (permalink / raw)
  To: Alan Stern
  Cc: Takashi Iwai, Daniel Mack, Greg KH,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Pedro Ribeiro,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b, Greg KH,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-usb-u79uwXL29TY76Z2rM5mHXA

On 04/07/2010 01:13 PM, Alan Stern wrote:
> On Wed, 7 Apr 2010, Takashi Iwai wrote:
>
>>> Ok, I'll write some dummies for usb_malloc() and usb_zalloc() which
>>> will just call kmalloc() with GFP_DMA32 for now.
>>
>> Can't we provide only zalloc() variant?  Zero'ing doesn't cost much,
>> and the buffer allocation shouldn't be called too often.
>
> Linus specifically requested us to avoid using kzalloc in usbfs.  I
> can't find the message in the email archives, but Greg KH should be
> able to confirm it.
>
> As long as we're imitating kmalloc for one use, we might as well make
> it available to all.
>
>>> And while at it,
>>> usb_alloc_buffer() will be renamed to usb_alloc_consistent().
>>
>> Most of recent functions are named with "coherent".
>
> Yes, the terminology got a little confused between the PCI and DMA
> realms.  I agree, "coherent" is better.
>
> BTW, although some EHCI controllers may support 64-bit DMA, the driver
> contains this:
>
> 	if (HCC_64BIT_ADDR(hcc_params)) {
> 		ehci_writel(ehci, 0,&ehci->regs->segment);
> #if 0
> // this is deeply broken on almost all architectures
> 		if (!dma_set_mask(hcd->self.controller, DMA_BIT_MASK(64)))
> 			ehci_info(ehci, "enabled 64bit DMA\n");
> #endif
> 	}
>
> I don't know if the comment is still true, but until the "#if 0" is
> removed, ehci-hcd won't make use of 64-bit DMA.

The comment is wrong (or at least outdated or based on an incorrect 
assumption), but you're right, currently 64-bit DMA is not used on any 
EHCI controllers. It could be, but it sounded like the consensus was it 
wasn't worth the risk. Apparently Windows 7 started using it, and then 
had to put out a patch because some NVidia EHCI controllers indicated 
64-bit support but it didn't work properly. So you'd have to blacklist 
those controllers, at least.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-07 19:13               ` Alan Stern
@ 2010-04-08  0:33                 ` Greg KH
  -1 siblings, 0 replies; 221+ messages in thread
From: Greg KH @ 2010-04-08  0:33 UTC (permalink / raw)
  To: Alan Stern
  Cc: Takashi Iwai, Daniel Mack, linux-kernel, Pedro Ribeiro, akpm,
	Greg KH, alsa-devel, linux-usb

On Wed, Apr 07, 2010 at 03:13:11PM -0400, Alan Stern wrote:
> On Wed, 7 Apr 2010, Takashi Iwai wrote:
> 
> > > Ok, I'll write some dummies for usb_malloc() and usb_zalloc() which
> > > will just call kmalloc() with GFP_DMA32 for now.
> > 
> > Can't we provide only zalloc() variant?  Zero'ing doesn't cost much,
> > and the buffer allocation shouldn't be called too often.
> 
> Linus specifically requested us to avoid using kzalloc in usbfs.  I
> can't find the message in the email archives, but Greg KH should be
> able to confirm it.
> 
> As long as we're imitating kmalloc for one use, we might as well make
> it available to all.
> 
> > > And while at it,
> > > usb_alloc_buffer() will be renamed to usb_alloc_consistent().
> > 
> > Most of recent functions are named with "coherent".
> 
> Yes, the terminology got a little confused between the PCI and DMA
> realms.  I agree, "coherent" is better.
> 
> BTW, although some EHCI controllers may support 64-bit DMA, the driver 
> contains this:
> 
> 	if (HCC_64BIT_ADDR(hcc_params)) {
> 		ehci_writel(ehci, 0, &ehci->regs->segment);
> #if 0
> // this is deeply broken on almost all architectures
> 		if (!dma_set_mask(hcd->self.controller, DMA_BIT_MASK(64)))
> 			ehci_info(ehci, "enabled 64bit DMA\n");
> #endif
> 	}
> 
> I don't know if the comment is still true, but until the "#if 0" is 
> removed, ehci-hcd won't make use of 64-bit DMA.

I think someone tried to remove it recently, but I wouldn't let them :)

What a mess, hopefully xhci will just take over and save the world from
this whole thing...

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-08  0:33                 ` Greg KH
  0 siblings, 0 replies; 221+ messages in thread
From: Greg KH @ 2010-04-08  0:33 UTC (permalink / raw)
  To: Alan Stern
  Cc: alsa-devel, linux-usb, Takashi Iwai, Greg KH, linux-kernel,
	Pedro Ribeiro, akpm

On Wed, Apr 07, 2010 at 03:13:11PM -0400, Alan Stern wrote:
> On Wed, 7 Apr 2010, Takashi Iwai wrote:
> 
> > > Ok, I'll write some dummies for usb_malloc() and usb_zalloc() which
> > > will just call kmalloc() with GFP_DMA32 for now.
> > 
> > Can't we provide only zalloc() variant?  Zero'ing doesn't cost much,
> > and the buffer allocation shouldn't be called too often.
> 
> Linus specifically requested us to avoid using kzalloc in usbfs.  I
> can't find the message in the email archives, but Greg KH should be
> able to confirm it.
> 
> As long as we're imitating kmalloc for one use, we might as well make
> it available to all.
> 
> > > And while at it,
> > > usb_alloc_buffer() will be renamed to usb_alloc_consistent().
> > 
> > Most of recent functions are named with "coherent".
> 
> Yes, the terminology got a little confused between the PCI and DMA
> realms.  I agree, "coherent" is better.
> 
> BTW, although some EHCI controllers may support 64-bit DMA, the driver 
> contains this:
> 
> 	if (HCC_64BIT_ADDR(hcc_params)) {
> 		ehci_writel(ehci, 0, &ehci->regs->segment);
> #if 0
> // this is deeply broken on almost all architectures
> 		if (!dma_set_mask(hcd->self.controller, DMA_BIT_MASK(64)))
> 			ehci_info(ehci, "enabled 64bit DMA\n");
> #endif
> 	}
> 
> I don't know if the comment is still true, but until the "#if 0" is 
> removed, ehci-hcd won't make use of 64-bit DMA.

I think someone tried to remove it recently, but I wouldn't let them :)

What a mess, hopefully xhci will just take over and save the world from
this whole thing...

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-08  2:10       ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-08  2:10 UTC (permalink / raw)
  To: Robert Hancock
  Cc: Daniel Mack, linux-kernel, Pedro Ribeiro, akpm, Greg KH,
	alsa-devel, linux-usb

On Wed, 7 Apr 2010, Robert Hancock wrote:

> >> The problem is appearantly the way the transfer buffer is allocated in
> >> the drivers. In the snd-usb-caiaq driver, I used kzalloc() to get memory
> >> which works fine on 32bit systems. On x86_64, however, it seems that
> >> kzalloc() hands out memory beyond the 32bit addressable boundary, which
> >> the DMA controller of the 32bit PCI-connected EHCI controller is unable
> >> to write to or read from. Am I correct on this conclusion?
> >
> > That seems like the right answer.  You are correct that an EHCI
> > controller capable only of 32-bit memory accesses would not be able to
> > use a buffer above the 4 GB line.

> AFAIK, the driver shouldn't have to worry about this at all. When the 
> buffer gets DMA-mapped for the controller, the DMA mapping code should 
> see that the device has a 32-bit DMA mask and either bounce or IOMMU-map 
> the memory so that it appears below 4GB.

That's true.  It would of course be more efficient for the buffer to be
allocated below 4 GB, but it should work okay either way.  Daniel, do
you have any idea why it fails?

Alan Stern


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-08  2:10       ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-08  2:10 UTC (permalink / raw)
  To: Robert Hancock
  Cc: Daniel Mack, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Pedro Ribeiro,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b, Greg KH,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-usb-u79uwXL29TY76Z2rM5mHXA

On Wed, 7 Apr 2010, Robert Hancock wrote:

> >> The problem is appearantly the way the transfer buffer is allocated in
> >> the drivers. In the snd-usb-caiaq driver, I used kzalloc() to get memory
> >> which works fine on 32bit systems. On x86_64, however, it seems that
> >> kzalloc() hands out memory beyond the 32bit addressable boundary, which
> >> the DMA controller of the 32bit PCI-connected EHCI controller is unable
> >> to write to or read from. Am I correct on this conclusion?
> >
> > That seems like the right answer.  You are correct that an EHCI
> > controller capable only of 32-bit memory accesses would not be able to
> > use a buffer above the 4 GB line.

> AFAIK, the driver shouldn't have to worry about this at all. When the 
> buffer gets DMA-mapped for the controller, the DMA mapping code should 
> see that the device has a 32-bit DMA mask and either bounce or IOMMU-map 
> the memory so that it appears below 4GB.

That's true.  It would of course be more efficient for the buffer to be
allocated below 4 GB, but it should work okay either way.  Daniel, do
you have any idea why it fails?

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-07 15:35         ` Daniel Mack
  (?)
  (?)
@ 2010-04-08  6:09         ` Oliver Neukum
  2010-04-08 11:07             ` Daniel Mack
  -1 siblings, 1 reply; 221+ messages in thread
From: Oliver Neukum @ 2010-04-08  6:09 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Greg KH, Alan Stern, linux-kernel, Pedro Ribeiro, akpm, Greg KH,
	alsa-devel, linux-usb

Am Mittwoch, 7. April 2010 17:35:51 schrieb Daniel Mack:
> > Alan, any objection to just using usb_buffer_alloc() for every driver?
> > Or is that too much overhead?
> 
> FWIW, most drivers I've seen in the past hours use a wild mix of
> kmalloc(), kzalloc(), kcalloc() and usb_buffer_alloc(). That should
> really be unified.

kmalloc() & friends != usb_buffer_alloc(). They do different things.
It makes no sense to unify them. If you really need an ordinary
buffer DMA will surely work on, this needs a third primitive.

	Regards
		Oliver

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-07 15:46       ` Alan Stern
  (?)
@ 2010-04-08  6:12       ` Oliver Neukum
  2010-04-08 16:59           ` Alan Stern
  -1 siblings, 1 reply; 221+ messages in thread
From: Oliver Neukum @ 2010-04-08  6:12 UTC (permalink / raw)
  To: Alan Stern
  Cc: Daniel Mack, linux-kernel, Pedro Ribeiro, akpm, Greg KH,
	alsa-devel, linux-usb

Am Mittwoch, 7. April 2010 17:46:17 schrieb Alan Stern:
> Or alternatively, instead of allocating regular memory the routine
> could simply fail.  Then the caller would be responsible for checking
> and using regular memory instead of dma-consistent memory.  Of course,
> that would put an even larger burden on the caller than just forcing it
> to keep track of what flag to use.

Then it would be sensible to pass it a filled URB, modify it or return
an error code.

	Regards
		Oliver

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-08  2:10       ` Alan Stern
@ 2010-04-08  7:30         ` Daniel Mack
  -1 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-08  7:30 UTC (permalink / raw)
  To: Alan Stern
  Cc: Robert Hancock, linux-kernel, Pedro Ribeiro, akpm, Greg KH,
	alsa-devel, linux-usb

On Wed, Apr 07, 2010 at 10:10:17PM -0400, Alan Stern wrote:
> On Wed, 7 Apr 2010, Robert Hancock wrote:
> 
> > >> The problem is appearantly the way the transfer buffer is allocated in
> > >> the drivers. In the snd-usb-caiaq driver, I used kzalloc() to get memory
> > >> which works fine on 32bit systems. On x86_64, however, it seems that
> > >> kzalloc() hands out memory beyond the 32bit addressable boundary, which
> > >> the DMA controller of the 32bit PCI-connected EHCI controller is unable
> > >> to write to or read from. Am I correct on this conclusion?
> > >
> > > That seems like the right answer.  You are correct that an EHCI
> > > controller capable only of 32-bit memory accesses would not be able to
> > > use a buffer above the 4 GB line.
> 
> > AFAIK, the driver shouldn't have to worry about this at all. When the 
> > buffer gets DMA-mapped for the controller, the DMA mapping code should 
> > see that the device has a 32-bit DMA mask and either bounce or IOMMU-map 
> > the memory so that it appears below 4GB.
> 
> That's true.  It would of course be more efficient for the buffer to be
> allocated below 4 GB, but it should work okay either way.  Daniel, do
> you have any idea why it fails?

No, and I can't do real tests as I lack a 64bit machine. I'll do some
more investigation later today, but for now the only explanation I have
is that not the remapped DMA buffer is used eventually by the EHCI code
but the physical address of the original buffer.

It would of course be best to fix the whole problem at this level, if
possible.

Daniel

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-08  7:30         ` Daniel Mack
  0 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-08  7:30 UTC (permalink / raw)
  To: Alan Stern
  Cc: alsa-devel, linux-usb, Greg KH, linux-kernel, Pedro Ribeiro,
	akpm, Robert Hancock

On Wed, Apr 07, 2010 at 10:10:17PM -0400, Alan Stern wrote:
> On Wed, 7 Apr 2010, Robert Hancock wrote:
> 
> > >> The problem is appearantly the way the transfer buffer is allocated in
> > >> the drivers. In the snd-usb-caiaq driver, I used kzalloc() to get memory
> > >> which works fine on 32bit systems. On x86_64, however, it seems that
> > >> kzalloc() hands out memory beyond the 32bit addressable boundary, which
> > >> the DMA controller of the 32bit PCI-connected EHCI controller is unable
> > >> to write to or read from. Am I correct on this conclusion?
> > >
> > > That seems like the right answer.  You are correct that an EHCI
> > > controller capable only of 32-bit memory accesses would not be able to
> > > use a buffer above the 4 GB line.
> 
> > AFAIK, the driver shouldn't have to worry about this at all. When the 
> > buffer gets DMA-mapped for the controller, the DMA mapping code should 
> > see that the device has a 32-bit DMA mask and either bounce or IOMMU-map 
> > the memory so that it appears below 4GB.
> 
> That's true.  It would of course be more efficient for the buffer to be
> allocated below 4 GB, but it should work okay either way.  Daniel, do
> you have any idea why it fails?

No, and I can't do real tests as I lack a 64bit machine. I'll do some
more investigation later today, but for now the only explanation I have
is that not the remapped DMA buffer is used eventually by the EHCI code
but the physical address of the original buffer.

It would of course be best to fix the whole problem at this level, if
possible.

Daniel

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-08 11:07             ` Daniel Mack
  0 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-08 11:07 UTC (permalink / raw)
  To: Oliver Neukum
  Cc: Greg KH, Alan Stern, linux-kernel, Pedro Ribeiro, akpm, Greg KH,
	alsa-devel, linux-usb

On Thu, Apr 08, 2010 at 08:09:11AM +0200, Oliver Neukum wrote:
> Am Mittwoch, 7. April 2010 17:35:51 schrieb Daniel Mack:
> > > Alan, any objection to just using usb_buffer_alloc() for every driver?
> > > Or is that too much overhead?
> > 
> > FWIW, most drivers I've seen in the past hours use a wild mix of
> > kmalloc(), kzalloc(), kcalloc() and usb_buffer_alloc(). That should
> > really be unified.
> 
> kmalloc() & friends != usb_buffer_alloc(). They do different things.

I know. I just believe that many developers used usb_buffer_alloc() even
though they don't really need coherent DMA memory. The function's name
is misleading, and copy'n paste does the rest.

> It makes no sense to unify them. If you really need an ordinary
> buffer DMA will surely work on, this needs a third primitive.

I think it will help a lot to rename usb_buffer_alloc() in the first
place and then reconsider where coherent memory is really needed.

Daniel

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-08 11:07             ` Daniel Mack
  0 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-08 11:07 UTC (permalink / raw)
  To: Oliver Neukum
  Cc: Greg KH, Alan Stern, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	Pedro Ribeiro, akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b, Greg KH,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-usb-u79uwXL29TY76Z2rM5mHXA

On Thu, Apr 08, 2010 at 08:09:11AM +0200, Oliver Neukum wrote:
> Am Mittwoch, 7. April 2010 17:35:51 schrieb Daniel Mack:
> > > Alan, any objection to just using usb_buffer_alloc() for every driver?
> > > Or is that too much overhead?
> > 
> > FWIW, most drivers I've seen in the past hours use a wild mix of
> > kmalloc(), kzalloc(), kcalloc() and usb_buffer_alloc(). That should
> > really be unified.
> 
> kmalloc() & friends != usb_buffer_alloc(). They do different things.

I know. I just believe that many developers used usb_buffer_alloc() even
though they don't really need coherent DMA memory. The function's name
is misleading, and copy'n paste does the rest.

> It makes no sense to unify them. If you really need an ordinary
> buffer DMA will surely work on, this needs a third primitive.

I think it will help a lot to rename usb_buffer_alloc() in the first
place and then reconsider where coherent memory is really needed.

Daniel
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-08 16:57           ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-08 16:57 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Robert Hancock, linux-kernel, Pedro Ribeiro, akpm, Greg KH,
	alsa-devel, linux-usb

On Thu, 8 Apr 2010, Daniel Mack wrote:

> > > AFAIK, the driver shouldn't have to worry about this at all. When the 
> > > buffer gets DMA-mapped for the controller, the DMA mapping code should 
> > > see that the device has a 32-bit DMA mask and either bounce or IOMMU-map 
> > > the memory so that it appears below 4GB.
> > 
> > That's true.  It would of course be more efficient for the buffer to be
> > allocated below 4 GB, but it should work okay either way.  Daniel, do
> > you have any idea why it fails?
> 
> No, and I can't do real tests as I lack a 64bit machine. I'll do some
> more investigation later today, but for now the only explanation I have
> is that not the remapped DMA buffer is used eventually by the EHCI code
> but the physical address of the original buffer.
> 
> It would of course be best to fix the whole problem at this level, if
> possible.

It definitely needs to be fixed at this level.  But I still think it's 
appropriate to have new USB core functions for allocating and 
deallocating I/O memory.  The additional price is small compared to 
constantly bouncing the buffers.

Pedro, in the hope of tracking down the problem, can you apply this 
patch and see what output it produces in the system log when the 
"interference" happens?  (Warning: It will produce quite a lot of 
output whenever you send data to the audio device -- between 500 and 
1000 lines per second.)

Alan Stern



Index: 2.6.33/drivers/usb/core/hcd.c
===================================================================
--- 2.6.33.orig/drivers/usb/core/hcd.c
+++ 2.6.33/drivers/usb/core/hcd.c
@@ -1395,6 +1395,10 @@ int usb_hcd_submit_urb (struct urb *urb,
 		usbmon_urb_submit_error(&hcd->self, urb, status);
 		goto error;
 	}
+	if (usb_endpoint_is_isoc_out(&urb->ep->desc))
+		dev_info(&urb->dev->dev, "Iso xfer %p dma %llx\n",
+				urb->transfer_buffer,
+				(unsigned long long) urb->transfer_dma);
 
 	if (is_root_hub(urb->dev))
 		status = rh_urb_enqueue(hcd, urb);


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-08 16:57           ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-08 16:57 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Robert Hancock, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	Pedro Ribeiro, akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b, Greg KH,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-usb-u79uwXL29TY76Z2rM5mHXA

On Thu, 8 Apr 2010, Daniel Mack wrote:

> > > AFAIK, the driver shouldn't have to worry about this at all. When the 
> > > buffer gets DMA-mapped for the controller, the DMA mapping code should 
> > > see that the device has a 32-bit DMA mask and either bounce or IOMMU-map 
> > > the memory so that it appears below 4GB.
> > 
> > That's true.  It would of course be more efficient for the buffer to be
> > allocated below 4 GB, but it should work okay either way.  Daniel, do
> > you have any idea why it fails?
> 
> No, and I can't do real tests as I lack a 64bit machine. I'll do some
> more investigation later today, but for now the only explanation I have
> is that not the remapped DMA buffer is used eventually by the EHCI code
> but the physical address of the original buffer.
> 
> It would of course be best to fix the whole problem at this level, if
> possible.

It definitely needs to be fixed at this level.  But I still think it's 
appropriate to have new USB core functions for allocating and 
deallocating I/O memory.  The additional price is small compared to 
constantly bouncing the buffers.

Pedro, in the hope of tracking down the problem, can you apply this 
patch and see what output it produces in the system log when the 
"interference" happens?  (Warning: It will produce quite a lot of 
output whenever you send data to the audio device -- between 500 and 
1000 lines per second.)

Alan Stern



Index: 2.6.33/drivers/usb/core/hcd.c
===================================================================
--- 2.6.33.orig/drivers/usb/core/hcd.c
+++ 2.6.33/drivers/usb/core/hcd.c
@@ -1395,6 +1395,10 @@ int usb_hcd_submit_urb (struct urb *urb,
 		usbmon_urb_submit_error(&hcd->self, urb, status);
 		goto error;
 	}
+	if (usb_endpoint_is_isoc_out(&urb->ep->desc))
+		dev_info(&urb->dev->dev, "Iso xfer %p dma %llx\n",
+				urb->transfer_buffer,
+				(unsigned long long) urb->transfer_dma);
 
 	if (is_root_hub(urb->dev))
 		status = rh_urb_enqueue(hcd, urb);

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-08 16:59           ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-08 16:59 UTC (permalink / raw)
  To: Oliver Neukum
  Cc: Daniel Mack, linux-kernel, Pedro Ribeiro, akpm, Greg KH,
	alsa-devel, linux-usb

On Thu, 8 Apr 2010, Oliver Neukum wrote:

> Am Mittwoch, 7. April 2010 17:46:17 schrieb Alan Stern:
> > Or alternatively, instead of allocating regular memory the routine
> > could simply fail.  Then the caller would be responsible for checking
> > and using regular memory instead of dma-consistent memory.  Of course,
> > that would put an even larger burden on the caller than just forcing it
> > to keep track of what flag to use.
> 
> Then it would be sensible to pass it a filled URB, modify it or return
> an error code.

That would work, but it doesn't match the way existing drivers use the
interface.  For example, the audio driver allocates a 16-byte coherent
buffer and then uses four bytes from it for each of four different 
URBs.

Alan Stern


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-08 16:59           ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-08 16:59 UTC (permalink / raw)
  To: Oliver Neukum
  Cc: Daniel Mack, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Pedro Ribeiro,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b, Greg KH,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-usb-u79uwXL29TY76Z2rM5mHXA

On Thu, 8 Apr 2010, Oliver Neukum wrote:

> Am Mittwoch, 7. April 2010 17:46:17 schrieb Alan Stern:
> > Or alternatively, instead of allocating regular memory the routine
> > could simply fail.  Then the caller would be responsible for checking
> > and using regular memory instead of dma-consistent memory.  Of course,
> > that would put an even larger burden on the caller than just forcing it
> > to keep track of what flag to use.
> 
> Then it would be sensible to pass it a filled URB, modify it or return
> an error code.

That would work, but it doesn't match the way existing drivers use the
interface.  For example, the audio driver allocates a 16-byte coherent
buffer and then uses four bytes from it for each of four different 
URBs.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-08 16:57           ` Alan Stern
  (?)
@ 2010-04-08 17:17           ` Pedro Ribeiro
  2010-04-08 18:17             ` Alan Stern
  -1 siblings, 1 reply; 221+ messages in thread
From: Pedro Ribeiro @ 2010-04-08 17:17 UTC (permalink / raw)
  To: Alan Stern
  Cc: Daniel Mack, Robert Hancock, linux-kernel, akpm, Greg KH,
	alsa-devel, linux-usb

On 8 April 2010 17:57, Alan Stern <stern@rowland.harvard.edu> wrote:
> On Thu, 8 Apr 2010, Daniel Mack wrote:
>
>> > > AFAIK, the driver shouldn't have to worry about this at all. When the
>> > > buffer gets DMA-mapped for the controller, the DMA mapping code should
>> > > see that the device has a 32-bit DMA mask and either bounce or IOMMU-map
>> > > the memory so that it appears below 4GB.
>> >
>> > That's true.  It would of course be more efficient for the buffer to be
>> > allocated below 4 GB, but it should work okay either way.  Daniel, do
>> > you have any idea why it fails?
>>
>> No, and I can't do real tests as I lack a 64bit machine. I'll do some
>> more investigation later today, but for now the only explanation I have
>> is that not the remapped DMA buffer is used eventually by the EHCI code
>> but the physical address of the original buffer.
>>
>> It would of course be best to fix the whole problem at this level, if
>> possible.
>
> It definitely needs to be fixed at this level.  But I still think it's
> appropriate to have new USB core functions for allocating and
> deallocating I/O memory.  The additional price is small compared to
> constantly bouncing the buffers.
>
> Pedro, in the hope of tracking down the problem, can you apply this
> patch and see what output it produces in the system log when the
> "interference" happens?  (Warning: It will produce quite a lot of
> output whenever you send data to the audio device -- between 500 and
> 1000 lines per second.)
>
> Alan Stern
>
>
>
> Index: 2.6.33/drivers/usb/core/hcd.c
> ===================================================================
> --- 2.6.33.orig/drivers/usb/core/hcd.c
> +++ 2.6.33/drivers/usb/core/hcd.c
> @@ -1395,6 +1395,10 @@ int usb_hcd_submit_urb (struct urb *urb,
>                usbmon_urb_submit_error(&hcd->self, urb, status);
>                goto error;
>        }
> +       if (usb_endpoint_is_isoc_out(&urb->ep->desc))
> +               dev_info(&urb->dev->dev, "Iso xfer %p dma %llx\n",
> +                               urb->transfer_buffer,
> +                               (unsigned long long) urb->transfer_dma);
>
>        if (is_root_hub(urb->dev))
>                status = rh_urb_enqueue(hcd, urb);
>
>

I'll do it tonight and send you the results tomorrow morning. Do you
want CONFIG_USB_DEBUG enabled or disabled?

Pedro

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-08 17:17           ` Pedro Ribeiro
@ 2010-04-08 18:17             ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-08 18:17 UTC (permalink / raw)
  To: Pedro Ribeiro
  Cc: Daniel Mack, Robert Hancock, Kernel development list,
	Andrew Morton, Greg KH, USB list

On Thu, 8 Apr 2010, Pedro Ribeiro wrote:

> > Pedro, in the hope of tracking down the problem, can you apply this
> > patch and see what output it produces in the system log when the
> > "interference" happens?  (Warning: It will produce quite a lot of
> > output whenever you send data to the audio device -- between 500 and
> > 1000 lines per second.)

> I'll do it tonight and send you the results tomorrow morning. Do you
> want CONFIG_USB_DEBUG enabled or disabled?

It doesn't matter.

Alan Stern


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-08 16:59           ` Alan Stern
  (?)
@ 2010-04-08 21:24           ` Oliver Neukum
  2010-04-08 22:20               ` Alan Stern
  -1 siblings, 1 reply; 221+ messages in thread
From: Oliver Neukum @ 2010-04-08 21:24 UTC (permalink / raw)
  To: Alan Stern
  Cc: Daniel Mack, linux-kernel, Pedro Ribeiro, akpm, Greg KH,
	alsa-devel, linux-usb

Am Donnerstag, 8. April 2010 18:59:38 schrieb Alan Stern:
> On Thu, 8 Apr 2010, Oliver Neukum wrote:
> 
> > Am Mittwoch, 7. April 2010 17:46:17 schrieb Alan Stern:
> > > Or alternatively, instead of allocating regular memory the routine
> > > could simply fail.  Then the caller would be responsible for checking
> > > and using regular memory instead of dma-consistent memory.  Of course,
> > > that would put an even larger burden on the caller than just forcing it
> > > to keep track of what flag to use.
> > 
> > Then it would be sensible to pass it a filled URB, modify it or return
> > an error code.
> 
> That would work, but it doesn't match the way existing drivers use the
> interface.  For example, the audio driver allocates a 16-byte coherent
> buffer and then uses four bytes from it for each of four different 
> URBs.

That will not work with any fallback that does not yield a coherent buffer.

	Regards
		Oliver

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-08 21:24           ` Oliver Neukum
@ 2010-04-08 22:20               ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-08 22:20 UTC (permalink / raw)
  To: Oliver Neukum
  Cc: Daniel Mack, linux-kernel, Pedro Ribeiro, akpm, Greg KH,
	alsa-devel, linux-usb

On Thu, 8 Apr 2010, Oliver Neukum wrote:

> Am Donnerstag, 8. April 2010 18:59:38 schrieb Alan Stern:
> > On Thu, 8 Apr 2010, Oliver Neukum wrote:
> > 
> > > Am Mittwoch, 7. April 2010 17:46:17 schrieb Alan Stern:
> > > > Or alternatively, instead of allocating regular memory the routine
> > > > could simply fail.  Then the caller would be responsible for checking
> > > > and using regular memory instead of dma-consistent memory.  Of course,
> > > > that would put an even larger burden on the caller than just forcing it
> > > > to keep track of what flag to use.
> > > 
> > > Then it would be sensible to pass it a filled URB, modify it or return
> > > an error code.
> > 
> > That would work, but it doesn't match the way existing drivers use the
> > interface.  For example, the audio driver allocates a 16-byte coherent
> > buffer and then uses four bytes from it for each of four different 
> > URBs.
> 
> That will not work with any fallback that does not yield a coherent buffer.

What you mean isn't entirely clear.  But it certainly does work in 
various circumstances that don't yield coherent buffers.  For example, 
it works if the controller uses PIO instead of DMA.  It also works if 
the controller uses DMA and the URBs have to be bounced.

Alan Stern


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-08 22:20               ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-08 22:20 UTC (permalink / raw)
  To: Oliver Neukum
  Cc: Daniel Mack, linux-kernel, Pedro Ribeiro, akpm, Greg KH,
	alsa-devel, linux-usb

On Thu, 8 Apr 2010, Oliver Neukum wrote:

> Am Donnerstag, 8. April 2010 18:59:38 schrieb Alan Stern:
> > On Thu, 8 Apr 2010, Oliver Neukum wrote:
> > 
> > > Am Mittwoch, 7. April 2010 17:46:17 schrieb Alan Stern:
> > > > Or alternatively, instead of allocating regular memory the routine
> > > > could simply fail.  Then the caller would be responsible for checking
> > > > and using regular memory instead of dma-consistent memory.  Of course,
> > > > that would put an even larger burden on the caller than just forcing it
> > > > to keep track of what flag to use.
> > > 
> > > Then it would be sensible to pass it a filled URB, modify it or return
> > > an error code.
> > 
> > That would work, but it doesn't match the way existing drivers use the
> > interface.  For example, the audio driver allocates a 16-byte coherent
> > buffer and then uses four bytes from it for each of four different 
> > URBs.
> 
> That will not work with any fallback that does not yield a coherent buffer.

What you mean isn't entirely clear.  But it certainly does work in 
various circumstances that don't yield coherent buffers.  For example, 
it works if the controller uses PIO instead of DMA.  It also works if 
the controller uses DMA and the URBs have to be bounced.

Alan Stern

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-08 23:13             ` Pedro Ribeiro
  0 siblings, 0 replies; 221+ messages in thread
From: Pedro Ribeiro @ 2010-04-08 23:13 UTC (permalink / raw)
  To: Alan Stern
  Cc: Daniel Mack, Robert Hancock, linux-kernel, akpm, Greg KH,
	alsa-devel, linux-usb

[-- Attachment #1: Type: text/plain, Size: 2484 bytes --]

On 8 April 2010 17:57, Alan Stern <stern@rowland.harvard.edu> wrote:
> On Thu, 8 Apr 2010, Daniel Mack wrote:
>
>> > > AFAIK, the driver shouldn't have to worry about this at all. When the
>> > > buffer gets DMA-mapped for the controller, the DMA mapping code should
>> > > see that the device has a 32-bit DMA mask and either bounce or IOMMU-map
>> > > the memory so that it appears below 4GB.
>> >
>> > That's true.  It would of course be more efficient for the buffer to be
>> > allocated below 4 GB, but it should work okay either way.  Daniel, do
>> > you have any idea why it fails?
>>
>> No, and I can't do real tests as I lack a 64bit machine. I'll do some
>> more investigation later today, but for now the only explanation I have
>> is that not the remapped DMA buffer is used eventually by the EHCI code
>> but the physical address of the original buffer.
>>
>> It would of course be best to fix the whole problem at this level, if
>> possible.
>
> It definitely needs to be fixed at this level.  But I still think it's
> appropriate to have new USB core functions for allocating and
> deallocating I/O memory.  The additional price is small compared to
> constantly bouncing the buffers.
>
> Pedro, in the hope of tracking down the problem, can you apply this
> patch and see what output it produces in the system log when the
> "interference" happens?  (Warning: It will produce quite a lot of
> output whenever you send data to the audio device -- between 500 and
> 1000 lines per second.)
>
> Alan Stern
>
>
>
> Index: 2.6.33/drivers/usb/core/hcd.c
> ===================================================================
> --- 2.6.33.orig/drivers/usb/core/hcd.c
> +++ 2.6.33/drivers/usb/core/hcd.c
> @@ -1395,6 +1395,10 @@ int usb_hcd_submit_urb (struct urb *urb,
>                usbmon_urb_submit_error(&hcd->self, urb, status);
>                goto error;
>        }
> +       if (usb_endpoint_is_isoc_out(&urb->ep->desc))
> +               dev_info(&urb->dev->dev, "Iso xfer %p dma %llx\n",
> +                               urb->transfer_buffer,
> +                               (unsigned long long) urb->transfer_dma);
>
>        if (is_root_hub(urb->dev))
>                status = rh_urb_enqueue(hcd, urb);
>
>

Hi Alan,

here is the output of the patch you sent me when the interference is triggered.

The log is long, 1.3mb in size.

Please let me know if you need anything more.

Regards,
Pedro

[-- Attachment #2: iso.xfer.tar.bz2 --]
[-- Type: application/x-bzip2, Size: 80439 bytes --]

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-08 23:13             ` Pedro Ribeiro
  0 siblings, 0 replies; 221+ messages in thread
From: Pedro Ribeiro @ 2010-04-08 23:13 UTC (permalink / raw)
  To: Alan Stern
  Cc: Daniel Mack, Robert Hancock, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b, Greg KH,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-usb-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 2514 bytes --]

On 8 April 2010 17:57, Alan Stern <stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org> wrote:
> On Thu, 8 Apr 2010, Daniel Mack wrote:
>
>> > > AFAIK, the driver shouldn't have to worry about this at all. When the
>> > > buffer gets DMA-mapped for the controller, the DMA mapping code should
>> > > see that the device has a 32-bit DMA mask and either bounce or IOMMU-map
>> > > the memory so that it appears below 4GB.
>> >
>> > That's true.  It would of course be more efficient for the buffer to be
>> > allocated below 4 GB, but it should work okay either way.  Daniel, do
>> > you have any idea why it fails?
>>
>> No, and I can't do real tests as I lack a 64bit machine. I'll do some
>> more investigation later today, but for now the only explanation I have
>> is that not the remapped DMA buffer is used eventually by the EHCI code
>> but the physical address of the original buffer.
>>
>> It would of course be best to fix the whole problem at this level, if
>> possible.
>
> It definitely needs to be fixed at this level.  But I still think it's
> appropriate to have new USB core functions for allocating and
> deallocating I/O memory.  The additional price is small compared to
> constantly bouncing the buffers.
>
> Pedro, in the hope of tracking down the problem, can you apply this
> patch and see what output it produces in the system log when the
> "interference" happens?  (Warning: It will produce quite a lot of
> output whenever you send data to the audio device -- between 500 and
> 1000 lines per second.)
>
> Alan Stern
>
>
>
> Index: 2.6.33/drivers/usb/core/hcd.c
> ===================================================================
> --- 2.6.33.orig/drivers/usb/core/hcd.c
> +++ 2.6.33/drivers/usb/core/hcd.c
> @@ -1395,6 +1395,10 @@ int usb_hcd_submit_urb (struct urb *urb,
>                usbmon_urb_submit_error(&hcd->self, urb, status);
>                goto error;
>        }
> +       if (usb_endpoint_is_isoc_out(&urb->ep->desc))
> +               dev_info(&urb->dev->dev, "Iso xfer %p dma %llx\n",
> +                               urb->transfer_buffer,
> +                               (unsigned long long) urb->transfer_dma);
>
>        if (is_root_hub(urb->dev))
>                status = rh_urb_enqueue(hcd, urb);
>
>

Hi Alan,

here is the output of the patch you sent me when the interference is triggered.

The log is long, 1.3mb in size.

Please let me know if you need anything more.

Regards,
Pedro

[-- Attachment #2: iso.xfer.tar.bz2 --]
[-- Type: application/x-bzip2, Size: 80439 bytes --]

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-08  0:33                 ` Greg KH
  (?)
@ 2010-04-09  0:01                 ` Robert Hancock
  2010-04-09 16:50                     ` Sarah Sharp
  -1 siblings, 1 reply; 221+ messages in thread
From: Robert Hancock @ 2010-04-09  0:01 UTC (permalink / raw)
  To: Greg KH
  Cc: Alan Stern, alsa-devel, linux-usb, Takashi Iwai, Greg KH,
	linux-kernel, Pedro Ribeiro, akpm, sarah.a.sharp

On 04/07/2010 06:33 PM, Greg KH wrote:
> On Wed, Apr 07, 2010 at 03:13:11PM -0400, Alan Stern wrote:
>> On Wed, 7 Apr 2010, Takashi Iwai wrote:
>>
>>>> Ok, I'll write some dummies for usb_malloc() and usb_zalloc() which
>>>> will just call kmalloc() with GFP_DMA32 for now.
>>>
>>> Can't we provide only zalloc() variant?  Zero'ing doesn't cost much,
>>> and the buffer allocation shouldn't be called too often.
>>
>> Linus specifically requested us to avoid using kzalloc in usbfs.  I
>> can't find the message in the email archives, but Greg KH should be
>> able to confirm it.
>>
>> As long as we're imitating kmalloc for one use, we might as well make
>> it available to all.
>>
>>>> And while at it,
>>>> usb_alloc_buffer() will be renamed to usb_alloc_consistent().
>>>
>>> Most of recent functions are named with "coherent".
>>
>> Yes, the terminology got a little confused between the PCI and DMA
>> realms.  I agree, "coherent" is better.
>>
>> BTW, although some EHCI controllers may support 64-bit DMA, the driver
>> contains this:
>>
>> 	if (HCC_64BIT_ADDR(hcc_params)) {
>> 		ehci_writel(ehci, 0,&ehci->regs->segment);
>> #if 0
>> // this is deeply broken on almost all architectures
>> 		if (!dma_set_mask(hcd->self.controller, DMA_BIT_MASK(64)))
>> 			ehci_info(ehci, "enabled 64bit DMA\n");
>> #endif
>> 	}
>>
>> I don't know if the comment is still true, but until the "#if 0" is
>> removed, ehci-hcd won't make use of 64-bit DMA.
>
> I think someone tried to remove it recently, but I wouldn't let them :)
>
> What a mess, hopefully xhci will just take over and save the world from
> this whole thing...

True.. except for the fact that the xhci driver currently doesn't do 
64-bit DMA either, nor does it support MSI even though the HW supports 
it (surprisingly enough the NEC Windows driver does, MSI-X even). At 
this point only Intel likely knows how to do this properly, though, 
since AFAICS the spec isn't publicly available yet.

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-08 22:20               ` Alan Stern
  (?)
@ 2010-04-09  6:04               ` Oliver Neukum
  2010-04-09 14:41                   ` Alan Stern
  -1 siblings, 1 reply; 221+ messages in thread
From: Oliver Neukum @ 2010-04-09  6:04 UTC (permalink / raw)
  To: Alan Stern
  Cc: Daniel Mack, linux-kernel, Pedro Ribeiro, akpm, Greg KH,
	alsa-devel, linux-usb

Am Freitag, 9. April 2010 00:20:36 schrieb Alan Stern:
> > > That would work, but it doesn't match the way existing drivers use the
> > > interface.  For example, the audio driver allocates a 16-byte coherent
> > > buffer and then uses four bytes from it for each of four different 
> > > URBs.
> > 
> > That will not work with any fallback that does not yield a coherent buffer.
> 
> What you mean isn't entirely clear.  But it certainly does work in 
> various circumstances that don't yield coherent buffers.  For example, 
> it works if the controller uses PIO instead of DMA.  It also works if 
> the controller uses DMA and the URBs have to be bounced.

It'll work on x86. On incoherent architectures this violates the cacheline
rules for DMA-mapping if you have to bounce. So it seems to me that
if you want to share a buffer between URBs, it must be coherent.

	Regards
		Oliver

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-09 14:41                   ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-09 14:41 UTC (permalink / raw)
  To: Oliver Neukum
  Cc: Daniel Mack, linux-kernel, Pedro Ribeiro, akpm, Greg KH,
	alsa-devel, linux-usb

On Fri, 9 Apr 2010, Oliver Neukum wrote:

> Am Freitag, 9. April 2010 00:20:36 schrieb Alan Stern:
> > > > That would work, but it doesn't match the way existing drivers use the
> > > > interface.  For example, the audio driver allocates a 16-byte coherent
> > > > buffer and then uses four bytes from it for each of four different 
> > > > URBs.
> > > 
> > > That will not work with any fallback that does not yield a coherent buffer.
> > 
> > What you mean isn't entirely clear.  But it certainly does work in 
> > various circumstances that don't yield coherent buffers.  For example, 
> > it works if the controller uses PIO instead of DMA.  It also works if 
> > the controller uses DMA and the URBs have to be bounced.
> 
> It'll work on x86. On incoherent architectures this violates the cacheline
> rules for DMA-mapping if you have to bounce.

Not true.  Consider: The driver allocates a 16-byte buffer (xbuf)  
divided up into four sets of four bytes, and sets

	urb[i].transfer_buffer_dma = xbuf_dma + 4*i;

Then usb_submit_urb(urb[i]) will copy the appropriate four bytes to a
bounce buffer and map the bounce buffer.  Accesses to the other parts
of xbuf won't violate the cacheline rules, because xbuf isn't mapped
for DMA -- only the bounce buffer is.  When urb[i] completes, the
bounce buffer contents will be copied back to the original four bytes
in xbuf.  Again, there is no violation of cacheline rules.

> So it seems to me that
> if you want to share a buffer between URBs, it must be coherent.

No.  But it must be allocated via usb_alloc_buffer() (or whatever that 
routine gets renamed to).

Alan Stern


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-09 14:41                   ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-09 14:41 UTC (permalink / raw)
  To: Oliver Neukum
  Cc: Daniel Mack, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Pedro Ribeiro,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b, Greg KH,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-usb-u79uwXL29TY76Z2rM5mHXA

On Fri, 9 Apr 2010, Oliver Neukum wrote:

> Am Freitag, 9. April 2010 00:20:36 schrieb Alan Stern:
> > > > That would work, but it doesn't match the way existing drivers use the
> > > > interface.  For example, the audio driver allocates a 16-byte coherent
> > > > buffer and then uses four bytes from it for each of four different 
> > > > URBs.
> > > 
> > > That will not work with any fallback that does not yield a coherent buffer.
> > 
> > What you mean isn't entirely clear.  But it certainly does work in 
> > various circumstances that don't yield coherent buffers.  For example, 
> > it works if the controller uses PIO instead of DMA.  It also works if 
> > the controller uses DMA and the URBs have to be bounced.
> 
> It'll work on x86. On incoherent architectures this violates the cacheline
> rules for DMA-mapping if you have to bounce.

Not true.  Consider: The driver allocates a 16-byte buffer (xbuf)  
divided up into four sets of four bytes, and sets

	urb[i].transfer_buffer_dma = xbuf_dma + 4*i;

Then usb_submit_urb(urb[i]) will copy the appropriate four bytes to a
bounce buffer and map the bounce buffer.  Accesses to the other parts
of xbuf won't violate the cacheline rules, because xbuf isn't mapped
for DMA -- only the bounce buffer is.  When urb[i] completes, the
bounce buffer contents will be copied back to the original four bytes
in xbuf.  Again, there is no violation of cacheline rules.

> So it seems to me that
> if you want to share a buffer between URBs, it must be coherent.

No.  But it must be allocated via usb_alloc_buffer() (or whatever that 
routine gets renamed to).

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-09 14:50                     ` Oliver Neukum
  0 siblings, 0 replies; 221+ messages in thread
From: Oliver Neukum @ 2010-04-09 14:50 UTC (permalink / raw)
  To: Alan Stern
  Cc: Daniel Mack, linux-kernel, Pedro Ribeiro, akpm, Greg KH,
	alsa-devel, linux-usb

Am Freitag, 9. April 2010 16:41:48 schrieb Alan Stern:
> > It'll work on x86. On incoherent architectures this violates the cacheline
> > rules for DMA-mapping if you have to bounce.
> 
> Not true.  Consider: The driver allocates a 16-byte buffer (xbuf)  
> divided up into four sets of four bytes, and sets
> 
>         urb[i].transfer_buffer_dma = xbuf_dma + 4*i;
> 
> Then usb_submit_urb(urb[i]) will copy the appropriate four bytes to a
> bounce buffer and map the bounce buffer.  Accesses to the other parts
> of xbuf won't violate the cacheline rules, because xbuf isn't mapped
> for DMA -- only the bounce buffer is.  When urb[i] completes, the
> bounce buffer contents will be copied back to the original four bytes
> in xbuf.  Again, there is no violation of cacheline rules.

I think you are assuming that either every or no part of the buffer is mapped
for DMA in place. I don't think you can assume that.

	Regards
		Oliver

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-09 14:50                     ` Oliver Neukum
  0 siblings, 0 replies; 221+ messages in thread
From: Oliver Neukum @ 2010-04-09 14:50 UTC (permalink / raw)
  To: Alan Stern
  Cc: Daniel Mack, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Pedro Ribeiro,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b, Greg KH,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-usb-u79uwXL29TY76Z2rM5mHXA

Am Freitag, 9. April 2010 16:41:48 schrieb Alan Stern:
> > It'll work on x86. On incoherent architectures this violates the cacheline
> > rules for DMA-mapping if you have to bounce.
> 
> Not true.  Consider: The driver allocates a 16-byte buffer (xbuf)  
> divided up into four sets of four bytes, and sets
> 
>         urb[i].transfer_buffer_dma = xbuf_dma + 4*i;
> 
> Then usb_submit_urb(urb[i]) will copy the appropriate four bytes to a
> bounce buffer and map the bounce buffer.  Accesses to the other parts
> of xbuf won't violate the cacheline rules, because xbuf isn't mapped
> for DMA -- only the bounce buffer is.  When urb[i] completes, the
> bounce buffer contents will be copied back to the original four bytes
> in xbuf.  Again, there is no violation of cacheline rules.

I think you are assuming that either every or no part of the buffer is mapped
for DMA in place. I don't think you can assume that.

	Regards
		Oliver
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-09 15:15                       ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-09 15:15 UTC (permalink / raw)
  To: Oliver Neukum
  Cc: Daniel Mack, linux-kernel, Pedro Ribeiro, akpm, Greg KH,
	alsa-devel, linux-usb

On Fri, 9 Apr 2010, Oliver Neukum wrote:

> Am Freitag, 9. April 2010 16:41:48 schrieb Alan Stern:
> > > It'll work on x86. On incoherent architectures this violates the cacheline
> > > rules for DMA-mapping if you have to bounce.
> > 
> > Not true.  Consider: The driver allocates a 16-byte buffer (xbuf)  
> > divided up into four sets of four bytes, and sets
> > 
> >         urb[i].transfer_buffer_dma = xbuf_dma + 4*i;
> > 
> > Then usb_submit_urb(urb[i]) will copy the appropriate four bytes to a
> > bounce buffer and map the bounce buffer.  Accesses to the other parts
> > of xbuf won't violate the cacheline rules, because xbuf isn't mapped
> > for DMA -- only the bounce buffer is.  When urb[i] completes, the
> > bounce buffer contents will be copied back to the original four bytes
> > in xbuf.  Again, there is no violation of cacheline rules.
> 
> I think you are assuming that either every or no part of the buffer is mapped
> for DMA in place. I don't think you can assume that.

Yes I can, because the code that makes this decision is part of 
usbcore and it is under my control.

Alan Stern


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-09 15:15                       ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-09 15:15 UTC (permalink / raw)
  To: Oliver Neukum
  Cc: Daniel Mack, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Pedro Ribeiro,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b, Greg KH,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-usb-u79uwXL29TY76Z2rM5mHXA

On Fri, 9 Apr 2010, Oliver Neukum wrote:

> Am Freitag, 9. April 2010 16:41:48 schrieb Alan Stern:
> > > It'll work on x86. On incoherent architectures this violates the cacheline
> > > rules for DMA-mapping if you have to bounce.
> > 
> > Not true.  Consider: The driver allocates a 16-byte buffer (xbuf)  
> > divided up into four sets of four bytes, and sets
> > 
> >         urb[i].transfer_buffer_dma = xbuf_dma + 4*i;
> > 
> > Then usb_submit_urb(urb[i]) will copy the appropriate four bytes to a
> > bounce buffer and map the bounce buffer.  Accesses to the other parts
> > of xbuf won't violate the cacheline rules, because xbuf isn't mapped
> > for DMA -- only the bounce buffer is.  When urb[i] completes, the
> > bounce buffer contents will be copied back to the original four bytes
> > in xbuf.  Again, there is no violation of cacheline rules.
> 
> I think you are assuming that either every or no part of the buffer is mapped
> for DMA in place. I don't think you can assume that.

Yes I can, because the code that makes this decision is part of 
usbcore and it is under my control.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-08 23:13             ` Pedro Ribeiro
@ 2010-04-09 16:01               ` Alan Stern
  -1 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-09 16:01 UTC (permalink / raw)
  To: Pedro Ribeiro
  Cc: Daniel Mack, Robert Hancock, linux-kernel, akpm, Greg KH,
	alsa-devel, linux-usb

On Fri, 9 Apr 2010, Pedro Ribeiro wrote:

> On 8 April 2010 17:57, Alan Stern <stern@rowland.harvard.edu> wrote:
> > On Thu, 8 Apr 2010, Daniel Mack wrote:
> >
> >> > > AFAIK, the driver shouldn't have to worry about this at all. When the
> >> > > buffer gets DMA-mapped for the controller, the DMA mapping code should
> >> > > see that the device has a 32-bit DMA mask and either bounce or IOMMU-map
> >> > > the memory so that it appears below 4GB.
> >> >
> >> > That's true.  It would of course be more efficient for the buffer to be
> >> > allocated below 4 GB, but it should work okay either way.  Daniel, do
> >> > you have any idea why it fails?
> >>
> >> No, and I can't do real tests as I lack a 64bit machine. I'll do some
> >> more investigation later today, but for now the only explanation I have
> >> is that not the remapped DMA buffer is used eventually by the EHCI code
> >> but the physical address of the original buffer.
> >>
> >> It would of course be best to fix the whole problem at this level, if
> >> possible.
> >
> > It definitely needs to be fixed at this level.  But I still think it's
> > appropriate to have new USB core functions for allocating and
> > deallocating I/O memory.  The additional price is small compared to
> > constantly bouncing the buffers.
> >
> > Pedro, in the hope of tracking down the problem, can you apply this
> > patch and see what output it produces in the system log when the
> > "interference" happens?  (Warning: It will produce quite a lot of
> > output whenever you send data to the audio device -- between 500 and
> > 1000 lines per second.)

> Hi Alan,
> 
> here is the output of the patch you sent me when the interference is triggered.
> 
> The log is long, 1.3mb in size.

I don't see anything suspicious.  The transfer_buffer addresses repeat 
every 32 URBs, and the DMA addresses cycle almost entirely uniformly 
from 0x20000000 to 0x23ffffff in units of 0x2000 (there are a few gaps 
where the interval is a little bigger).

Alan Stern


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-09 16:01               ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-09 16:01 UTC (permalink / raw)
  To: Pedro Ribeiro
  Cc: Daniel Mack, Robert Hancock, linux-kernel, akpm, Greg KH,
	alsa-devel, linux-usb

On Fri, 9 Apr 2010, Pedro Ribeiro wrote:

> On 8 April 2010 17:57, Alan Stern <stern@rowland.harvard.edu> wrote:
> > On Thu, 8 Apr 2010, Daniel Mack wrote:
> >
> >> > > AFAIK, the driver shouldn't have to worry about this at all. When the
> >> > > buffer gets DMA-mapped for the controller, the DMA mapping code should
> >> > > see that the device has a 32-bit DMA mask and either bounce or IOMMU-map
> >> > > the memory so that it appears below 4GB.
> >> >
> >> > That's true.  It would of course be more efficient for the buffer to be
> >> > allocated below 4 GB, but it should work okay either way.  Daniel, do
> >> > you have any idea why it fails?
> >>
> >> No, and I can't do real tests as I lack a 64bit machine. I'll do some
> >> more investigation later today, but for now the only explanation I have
> >> is that not the remapped DMA buffer is used eventually by the EHCI code
> >> but the physical address of the original buffer.
> >>
> >> It would of course be best to fix the whole problem at this level, if
> >> possible.
> >
> > It definitely needs to be fixed at this level.  But I still think it's
> > appropriate to have new USB core functions for allocating and
> > deallocating I/O memory.  The additional price is small compared to
> > constantly bouncing the buffers.
> >
> > Pedro, in the hope of tracking down the problem, can you apply this
> > patch and see what output it produces in the system log when the
> > "interference" happens?  (Warning: It will produce quite a lot of
> > output whenever you send data to the audio device -- between 500 and
> > 1000 lines per second.)

> Hi Alan,
> 
> here is the output of the patch you sent me when the interference is triggered.
> 
> The log is long, 1.3mb in size.

I don't see anything suspicious.  The transfer_buffer addresses repeat 
every 32 URBs, and the DMA addresses cycle almost entirely uniformly 
from 0x20000000 to 0x23ffffff in units of 0x2000 (there are a few gaps 
where the interval is a little bigger).

Alan Stern

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-09 16:50                     ` Sarah Sharp
  0 siblings, 0 replies; 221+ messages in thread
From: Sarah Sharp @ 2010-04-09 16:50 UTC (permalink / raw)
  To: Robert Hancock
  Cc: Greg KH, Alan Stern, alsa-devel, linux-usb, Takashi Iwai,
	Greg KH, linux-kernel, Pedro Ribeiro, akpm

On Thu, Apr 08, 2010 at 06:01:27PM -0600, Robert Hancock wrote:
> On 04/07/2010 06:33 PM, Greg KH wrote:
> >On Wed, Apr 07, 2010 at 03:13:11PM -0400, Alan Stern wrote:
> >>On Wed, 7 Apr 2010, Takashi Iwai wrote:
> >>
> >>>>Ok, I'll write some dummies for usb_malloc() and usb_zalloc() which
> >>>>will just call kmalloc() with GFP_DMA32 for now.
> >>>
> >>>Can't we provide only zalloc() variant?  Zero'ing doesn't cost much,
> >>>and the buffer allocation shouldn't be called too often.
> >>
> >>Linus specifically requested us to avoid using kzalloc in usbfs.  I
> >>can't find the message in the email archives, but Greg KH should be
> >>able to confirm it.
> >>
> >>As long as we're imitating kmalloc for one use, we might as well make
> >>it available to all.
> >>
> >>>>And while at it,
> >>>>usb_alloc_buffer() will be renamed to usb_alloc_consistent().
> >>>
> >>>Most of recent functions are named with "coherent".
> >>
> >>Yes, the terminology got a little confused between the PCI and DMA
> >>realms.  I agree, "coherent" is better.
> >>
> >>BTW, although some EHCI controllers may support 64-bit DMA, the driver
> >>contains this:
> >>
> >>	if (HCC_64BIT_ADDR(hcc_params)) {
> >>		ehci_writel(ehci, 0,&ehci->regs->segment);
> >>#if 0
> >>// this is deeply broken on almost all architectures
> >>		if (!dma_set_mask(hcd->self.controller, DMA_BIT_MASK(64)))
> >>			ehci_info(ehci, "enabled 64bit DMA\n");
> >>#endif
> >>	}
> >>
> >>I don't know if the comment is still true, but until the "#if 0" is
> >>removed, ehci-hcd won't make use of 64-bit DMA.
> >
> >I think someone tried to remove it recently, but I wouldn't let them :)
> >
> >What a mess, hopefully xhci will just take over and save the world from
> >this whole thing...

I hate to break it to you, but 64-bit DMA support is optional for an
xHCI implementation.  There's a bit in HCCPARAMS that tells whether the
host supports it (see the HCC_64BIT_ADDR macro in xhci.h).  The xHCI
driver currently doesn't do anything with that bit, although it should.
All the implementations I've seen do 64-bit DMA.

> True.. except for the fact that the xhci driver currently doesn't do
> 64-bit DMA either

What makes you think that?  I've seen URB buffers with 64-bit DMA
addresses.  I can tell when the debug polling loop runs and I look at
the DMA addresses the xHCI driver is feeding to the hardware:

Dev 1 endpoint ring 0:
xhci_hcd 0000:05:00.0: @71a49800 01000680 00080000 00000008 00000841

So the TRB at address 71a49800 is pointing to a buffer at address
0x0008000001000680.

If I'm setting a DMA mask wrong somewhere, or doing something else to
limit the DMA to 32-bit, then please let me know.

> nor does it support MSI even though the HW
> supports it (surprisingly enough the NEC Windows driver does, MSI-X
> even).

There's a patch from AMD to enable MSI-X.  The code was there, just
commented out because the early prototypes didn't do MSI-X.

> At this point only Intel likely knows how to do this
> properly, though, since AFAICS the spec isn't publicly available
> yet.

I have tried very hard to fix this, and will continue to do so.

Sarah Sharp

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-09 16:50                     ` Sarah Sharp
  0 siblings, 0 replies; 221+ messages in thread
From: Sarah Sharp @ 2010-04-09 16:50 UTC (permalink / raw)
  To: Robert Hancock
  Cc: Greg KH, Alan Stern, alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-usb-u79uwXL29TY76Z2rM5mHXA, Takashi Iwai, Greg KH,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Pedro Ribeiro,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b

On Thu, Apr 08, 2010 at 06:01:27PM -0600, Robert Hancock wrote:
> On 04/07/2010 06:33 PM, Greg KH wrote:
> >On Wed, Apr 07, 2010 at 03:13:11PM -0400, Alan Stern wrote:
> >>On Wed, 7 Apr 2010, Takashi Iwai wrote:
> >>
> >>>>Ok, I'll write some dummies for usb_malloc() and usb_zalloc() which
> >>>>will just call kmalloc() with GFP_DMA32 for now.
> >>>
> >>>Can't we provide only zalloc() variant?  Zero'ing doesn't cost much,
> >>>and the buffer allocation shouldn't be called too often.
> >>
> >>Linus specifically requested us to avoid using kzalloc in usbfs.  I
> >>can't find the message in the email archives, but Greg KH should be
> >>able to confirm it.
> >>
> >>As long as we're imitating kmalloc for one use, we might as well make
> >>it available to all.
> >>
> >>>>And while at it,
> >>>>usb_alloc_buffer() will be renamed to usb_alloc_consistent().
> >>>
> >>>Most of recent functions are named with "coherent".
> >>
> >>Yes, the terminology got a little confused between the PCI and DMA
> >>realms.  I agree, "coherent" is better.
> >>
> >>BTW, although some EHCI controllers may support 64-bit DMA, the driver
> >>contains this:
> >>
> >>	if (HCC_64BIT_ADDR(hcc_params)) {
> >>		ehci_writel(ehci, 0,&ehci->regs->segment);
> >>#if 0
> >>// this is deeply broken on almost all architectures
> >>		if (!dma_set_mask(hcd->self.controller, DMA_BIT_MASK(64)))
> >>			ehci_info(ehci, "enabled 64bit DMA\n");
> >>#endif
> >>	}
> >>
> >>I don't know if the comment is still true, but until the "#if 0" is
> >>removed, ehci-hcd won't make use of 64-bit DMA.
> >
> >I think someone tried to remove it recently, but I wouldn't let them :)
> >
> >What a mess, hopefully xhci will just take over and save the world from
> >this whole thing...

I hate to break it to you, but 64-bit DMA support is optional for an
xHCI implementation.  There's a bit in HCCPARAMS that tells whether the
host supports it (see the HCC_64BIT_ADDR macro in xhci.h).  The xHCI
driver currently doesn't do anything with that bit, although it should.
All the implementations I've seen do 64-bit DMA.

> True.. except for the fact that the xhci driver currently doesn't do
> 64-bit DMA either

What makes you think that?  I've seen URB buffers with 64-bit DMA
addresses.  I can tell when the debug polling loop runs and I look at
the DMA addresses the xHCI driver is feeding to the hardware:

Dev 1 endpoint ring 0:
xhci_hcd 0000:05:00.0: @71a49800 01000680 00080000 00000008 00000841

So the TRB at address 71a49800 is pointing to a buffer at address
0x0008000001000680.

If I'm setting a DMA mask wrong somewhere, or doing something else to
limit the DMA to 32-bit, then please let me know.

> nor does it support MSI even though the HW
> supports it (surprisingly enough the NEC Windows driver does, MSI-X
> even).

There's a patch from AMD to enable MSI-X.  The code was there, just
commented out because the early prototypes didn't do MSI-X.

> At this point only Intel likely knows how to do this
> properly, though, since AFAICS the spec isn't publicly available
> yet.

I have tried very hard to fix this, and will continue to do so.

Sarah Sharp
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-09 16:01               ` Alan Stern
  (?)
@ 2010-04-09 18:09               ` Daniel Mack
  2010-04-09 18:19                   ` Pedro Ribeiro
  -1 siblings, 1 reply; 221+ messages in thread
From: Daniel Mack @ 2010-04-09 18:09 UTC (permalink / raw)
  To: Alan Stern
  Cc: Pedro Ribeiro, Robert Hancock, linux-kernel, akpm, Greg KH,
	alsa-devel, linux-usb

On Fri, Apr 09, 2010 at 12:01:27PM -0400, Alan Stern wrote:
> On Fri, 9 Apr 2010, Pedro Ribeiro wrote:
> > here is the output of the patch you sent me when the interference is triggered.
> > 
> > The log is long, 1.3mb in size.
> 
> I don't see anything suspicious.  The transfer_buffer addresses repeat 
> every 32 URBs, and the DMA addresses cycle almost entirely uniformly 
> from 0x20000000 to 0x23ffffff in units of 0x2000 (there are a few gaps 
> where the interval is a little bigger).

The DMA pointers do indeed look sane. I wanted to take a deeper look at
this and set up a 64bit system today. However, I fail to see the problem
here. Pedro, how much RAM does your machine have installed?

Daniel


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-09 18:19                   ` Pedro Ribeiro
  0 siblings, 0 replies; 221+ messages in thread
From: Pedro Ribeiro @ 2010-04-09 18:19 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Alan Stern, Robert Hancock, linux-kernel, akpm, Greg KH,
	alsa-devel, linux-usb

On 9 April 2010 19:09, Daniel Mack <daniel@caiaq.de> wrote:
> On Fri, Apr 09, 2010 at 12:01:27PM -0400, Alan Stern wrote:
>> On Fri, 9 Apr 2010, Pedro Ribeiro wrote:
>> > here is the output of the patch you sent me when the interference is triggered.
>> >
>> > The log is long, 1.3mb in size.
>>
>> I don't see anything suspicious.  The transfer_buffer addresses repeat
>> every 32 URBs, and the DMA addresses cycle almost entirely uniformly
>> from 0x20000000 to 0x23ffffff in units of 0x2000 (there are a few gaps
>> where the interval is a little bigger).
>
> The DMA pointers do indeed look sane. I wanted to take a deeper look at
> this and set up a 64bit system today. However, I fail to see the problem
> here. Pedro, how much RAM does your machine have installed?
>
> Daniel
>
>

It has 4 GB.

Pedro

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-09 18:19                   ` Pedro Ribeiro
  0 siblings, 0 replies; 221+ messages in thread
From: Pedro Ribeiro @ 2010-04-09 18:19 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Alan Stern, Robert Hancock, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b, Greg KH,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-usb-u79uwXL29TY76Z2rM5mHXA

On 9 April 2010 19:09, Daniel Mack <daniel-rDUAYElUppE@public.gmane.org> wrote:
> On Fri, Apr 09, 2010 at 12:01:27PM -0400, Alan Stern wrote:
>> On Fri, 9 Apr 2010, Pedro Ribeiro wrote:
>> > here is the output of the patch you sent me when the interference is triggered.
>> >
>> > The log is long, 1.3mb in size.
>>
>> I don't see anything suspicious.  The transfer_buffer addresses repeat
>> every 32 URBs, and the DMA addresses cycle almost entirely uniformly
>> from 0x20000000 to 0x23ffffff in units of 0x2000 (there are a few gaps
>> where the interval is a little bigger).
>
> The DMA pointers do indeed look sane. I wanted to take a deeper look at
> this and set up a 64bit system today. However, I fail to see the problem
> here. Pedro, how much RAM does your machine have installed?
>
> Daniel
>
>

It has 4 GB.

Pedro
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-09 19:34                     ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-09 19:34 UTC (permalink / raw)
  To: Pedro Ribeiro
  Cc: Daniel Mack, Robert Hancock, linux-kernel, akpm, Greg KH,
	alsa-devel, linux-usb

On Fri, 9 Apr 2010, Pedro Ribeiro wrote:

> > The DMA pointers do indeed look sane. I wanted to take a deeper look at
> > this and set up a 64bit system today. However, I fail to see the problem
> > here. Pedro, how much RAM does your machine have installed?

> It has 4 GB.

That means DMA mapping cannot be the cause of the problem.  :-(

Alan Stern


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-09 19:34                     ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-09 19:34 UTC (permalink / raw)
  To: Pedro Ribeiro
  Cc: Daniel Mack, Robert Hancock, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b, Greg KH,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-usb-u79uwXL29TY76Z2rM5mHXA

On Fri, 9 Apr 2010, Pedro Ribeiro wrote:

> > The DMA pointers do indeed look sane. I wanted to take a deeper look at
> > this and set up a 64bit system today. However, I fail to see the problem
> > here. Pedro, how much RAM does your machine have installed?

> It has 4 GB.

That means DMA mapping cannot be the cause of the problem.  :-(

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-09 19:34                     ` Alan Stern
@ 2010-04-09 20:14                       ` Daniel Mack
  -1 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-09 20:14 UTC (permalink / raw)
  To: Alan Stern
  Cc: Pedro Ribeiro, Robert Hancock, linux-kernel, akpm, Greg KH,
	alsa-devel, linux-usb

On Fri, Apr 09, 2010 at 03:34:06PM -0400, Alan Stern wrote:
> On Fri, 9 Apr 2010, Pedro Ribeiro wrote:
> 
> > > The DMA pointers do indeed look sane. I wanted to take a deeper look at
> > > this and set up a 64bit system today. However, I fail to see the problem
> > > here. Pedro, how much RAM does your machine have installed?
> 
> > It has 4 GB.
> 
> That means DMA mapping cannot be the cause of the problem.  :-(

FWIW, as I stated in the first message of this thread, I had very
similar bug reports for a Mac OS X driver I'm maintaining, and the
solution that fixed everything was to force memory that has a _physical_
buffer address mask of 0x00000000ffffffff. And all machines I've seen
the bug on had 4GB of RAM or less. So appearantly, without that force
option, memory beyond the 4GB range was provided.

But I can't tell whether this effect also counts for Linux, and I must
admit I lack a deep enough understanding about the kernel's memory
management in 64bit mode and about how the DMA bouncing and remapping
logic works. Does anyone have an idea about how to explain that?

Daniel


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-09 20:14                       ` Daniel Mack
  0 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-09 20:14 UTC (permalink / raw)
  To: Alan Stern
  Cc: alsa-devel, linux-usb, Greg KH, linux-kernel, Pedro Ribeiro,
	akpm, Robert Hancock

On Fri, Apr 09, 2010 at 03:34:06PM -0400, Alan Stern wrote:
> On Fri, 9 Apr 2010, Pedro Ribeiro wrote:
> 
> > > The DMA pointers do indeed look sane. I wanted to take a deeper look at
> > > this and set up a 64bit system today. However, I fail to see the problem
> > > here. Pedro, how much RAM does your machine have installed?
> 
> > It has 4 GB.
> 
> That means DMA mapping cannot be the cause of the problem.  :-(

FWIW, as I stated in the first message of this thread, I had very
similar bug reports for a Mac OS X driver I'm maintaining, and the
solution that fixed everything was to force memory that has a _physical_
buffer address mask of 0x00000000ffffffff. And all machines I've seen
the bug on had 4GB of RAM or less. So appearantly, without that force
option, memory beyond the 4GB range was provided.

But I can't tell whether this effect also counts for Linux, and I must
admit I lack a deep enough understanding about the kernel's memory
management in 64bit mode and about how the DMA bouncing and remapping
logic works. Does anyone have an idea about how to explain that?

Daniel

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [LKML] Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-09 20:25                       ` Konrad Rzeszutek Wilk
  0 siblings, 0 replies; 221+ messages in thread
From: Konrad Rzeszutek Wilk @ 2010-04-09 20:25 UTC (permalink / raw)
  To: Alan Stern
  Cc: Pedro Ribeiro, Daniel Mack, Robert Hancock, linux-kernel, akpm,
	Greg KH, alsa-devel, linux-usb

On Fri, Apr 09, 2010 at 03:34:06PM -0400, Alan Stern wrote:
> On Fri, 9 Apr 2010, Pedro Ribeiro wrote:
> 
> > > The DMA pointers do indeed look sane. I wanted to take a deeper look at
> > > this and set up a 64bit system today. However, I fail to see the problem
> > > here. Pedro, how much RAM does your machine have installed?
> 
> > It has 4 GB.
> 
> That means DMA mapping cannot be the cause of the problem.  :-(

That isn't entirely true. The BIOS usually allocates a 256 MB ACPI/PCI hole
that is under the 4GB.

So end up with 3.7 GB, then the 256MB hole, and then right above the 4GB
you the the remaining memory: 4.3GB.


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [LKML] Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-09 20:25                       ` Konrad Rzeszutek Wilk
  0 siblings, 0 replies; 221+ messages in thread
From: Konrad Rzeszutek Wilk @ 2010-04-09 20:25 UTC (permalink / raw)
  To: Alan Stern
  Cc: Pedro Ribeiro, Daniel Mack, Robert Hancock,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b, Greg KH,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-usb-u79uwXL29TY76Z2rM5mHXA

On Fri, Apr 09, 2010 at 03:34:06PM -0400, Alan Stern wrote:
> On Fri, 9 Apr 2010, Pedro Ribeiro wrote:
> 
> > > The DMA pointers do indeed look sane. I wanted to take a deeper look at
> > > this and set up a 64bit system today. However, I fail to see the problem
> > > here. Pedro, how much RAM does your machine have installed?
> 
> > It has 4 GB.
> 
> That means DMA mapping cannot be the cause of the problem.  :-(

That isn't entirely true. The BIOS usually allocates a 256 MB ACPI/PCI hole
that is under the 4GB.

So end up with 3.7 GB, then the 256MB hole, and then right above the 4GB
you the the remaining memory: 4.3GB.

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-09 20:51                         ` Oliver Neukum
  0 siblings, 0 replies; 221+ messages in thread
From: Oliver Neukum @ 2010-04-09 20:51 UTC (permalink / raw)
  To: Alan Stern
  Cc: Daniel Mack, linux-kernel, Pedro Ribeiro, akpm, Greg KH,
	alsa-devel, linux-usb

Am Freitag, 9. April 2010 17:15:43 schrieb Alan Stern:
> > > Then usb_submit_urb(urb[i]) will copy the appropriate four bytes to a
> > > bounce buffer and map the bounce buffer.  Accesses to the other parts
> > > of xbuf won't violate the cacheline rules, because xbuf isn't mapped
> > > for DMA -- only the bounce buffer is.  When urb[i] completes, the
> > > bounce buffer contents will be copied back to the original four bytes
> > > in xbuf.  Again, there is no violation of cacheline rules.
> > 
> > I think you are assuming that either every or no part of the buffer is mapped
> > for DMA in place. I don't think you can assume that.
> 
> Yes I can, because the code that makes this decision is part of 
> usbcore and it is under m

It seems to me that in usbcore you can positively know that a buffer
will be mapped. However if the mapping is not done in usbcore you
cannot know what the HCD driver will do to a buffer, in particular
you don't know whether it will be processed by PIO or mapped for
DMA.

Maybe I understand this wrongly. Which code exactly were you refering to?

	Regards
		Oliver

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-09 20:51                         ` Oliver Neukum
  0 siblings, 0 replies; 221+ messages in thread
From: Oliver Neukum @ 2010-04-09 20:51 UTC (permalink / raw)
  To: Alan Stern
  Cc: Daniel Mack, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Pedro Ribeiro,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b, Greg KH,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-usb-u79uwXL29TY76Z2rM5mHXA

Am Freitag, 9. April 2010 17:15:43 schrieb Alan Stern:
> > > Then usb_submit_urb(urb[i]) will copy the appropriate four bytes to a
> > > bounce buffer and map the bounce buffer.  Accesses to the other parts
> > > of xbuf won't violate the cacheline rules, because xbuf isn't mapped
> > > for DMA -- only the bounce buffer is.  When urb[i] completes, the
> > > bounce buffer contents will be copied back to the original four bytes
> > > in xbuf.  Again, there is no violation of cacheline rules.
> > 
> > I think you are assuming that either every or no part of the buffer is mapped
> > for DMA in place. I don't think you can assume that.
> 
> Yes I can, because the code that makes this decision is part of 
> usbcore and it is under m

It seems to me that in usbcore you can positively know that a buffer
will be mapped. However if the mapping is not done in usbcore you
cannot know what the HCD driver will do to a buffer, in particular
you don't know whether it will be processed by PIO or mapped for
DMA.

Maybe I understand this wrongly. Which code exactly were you refering to?

	Regards
		Oliver
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-09 20:51                         ` Oliver Neukum
@ 2010-04-09 21:21                           ` Alan Stern
  -1 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-09 21:21 UTC (permalink / raw)
  To: Oliver Neukum
  Cc: Daniel Mack, linux-kernel, Pedro Ribeiro, akpm, Greg KH,
	alsa-devel, linux-usb

On Fri, 9 Apr 2010, Oliver Neukum wrote:

> Am Freitag, 9. April 2010 17:15:43 schrieb Alan Stern:
> > > > Then usb_submit_urb(urb[i]) will copy the appropriate four bytes to a
> > > > bounce buffer and map the bounce buffer.  Accesses to the other parts
> > > > of xbuf won't violate the cacheline rules, because xbuf isn't mapped
> > > > for DMA -- only the bounce buffer is.  When urb[i] completes, the
> > > > bounce buffer contents will be copied back to the original four bytes
> > > > in xbuf.  Again, there is no violation of cacheline rules.
> > > 
> > > I think you are assuming that either every or no part of the buffer is mapped
> > > for DMA in place. I don't think you can assume that.
> > 
> > Yes I can, because the code that makes this decision is part of 
> > usbcore and it is under m
> 
> It seems to me that in usbcore you can positively know that a buffer
> will be mapped. However if the mapping is not done in usbcore you
> cannot know what the HCD driver will do to a buffer, in particular
> you don't know whether it will be processed by PIO or mapped for
> DMA.

The mapping is always done either by usb_buffer_alloc() or by 
map_urb_for_dma().  Both functions are in usbcore.

> Maybe I understand this wrongly. Which code exactly were you refering to?

Search for usages of "syncbuf" and "sync_dma" in sound/usb/usbaudio.c.

Alan Stern


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-09 21:21                           ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-09 21:21 UTC (permalink / raw)
  To: Oliver Neukum
  Cc: Daniel Mack, linux-kernel, Pedro Ribeiro, akpm, Greg KH,
	alsa-devel, linux-usb

On Fri, 9 Apr 2010, Oliver Neukum wrote:

> Am Freitag, 9. April 2010 17:15:43 schrieb Alan Stern:
> > > > Then usb_submit_urb(urb[i]) will copy the appropriate four bytes to a
> > > > bounce buffer and map the bounce buffer.  Accesses to the other parts
> > > > of xbuf won't violate the cacheline rules, because xbuf isn't mapped
> > > > for DMA -- only the bounce buffer is.  When urb[i] completes, the
> > > > bounce buffer contents will be copied back to the original four bytes
> > > > in xbuf.  Again, there is no violation of cacheline rules.
> > > 
> > > I think you are assuming that either every or no part of the buffer is mapped
> > > for DMA in place. I don't think you can assume that.
> > 
> > Yes I can, because the code that makes this decision is part of 
> > usbcore and it is under m
> 
> It seems to me that in usbcore you can positively know that a buffer
> will be mapped. However if the mapping is not done in usbcore you
> cannot know what the HCD driver will do to a buffer, in particular
> you don't know whether it will be processed by PIO or mapped for
> DMA.

The mapping is always done either by usb_buffer_alloc() or by 
map_urb_for_dma().  Both functions are in usbcore.

> Maybe I understand this wrongly. Which code exactly were you refering to?

Search for usages of "syncbuf" and "sync_dma" in sound/usb/usbaudio.c.

Alan Stern

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [LKML] Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-09 21:23                         ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-09 21:23 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk
  Cc: Pedro Ribeiro, Daniel Mack, Robert Hancock, linux-kernel, akpm,
	Greg KH, alsa-devel, linux-usb

On Fri, 9 Apr 2010, Konrad Rzeszutek Wilk wrote:

> On Fri, Apr 09, 2010 at 03:34:06PM -0400, Alan Stern wrote:
> > On Fri, 9 Apr 2010, Pedro Ribeiro wrote:
> > 
> > > > The DMA pointers do indeed look sane. I wanted to take a deeper look at
> > > > this and set up a 64bit system today. However, I fail to see the problem
> > > > here. Pedro, how much RAM does your machine have installed?
> > 
> > > It has 4 GB.
> > 
> > That means DMA mapping cannot be the cause of the problem.  :-(
> 
> That isn't entirely true. The BIOS usually allocates a 256 MB ACPI/PCI hole
> that is under the 4GB.
> 
> So end up with 3.7 GB, then the 256MB hole, and then right above the 4GB
> you the the remaining memory: 4.3GB.

How can Pedro find out what physical addresses are in use on his 
system?

Alan Stern


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [LKML] Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-09 21:23                         ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-09 21:23 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk
  Cc: Pedro Ribeiro, Daniel Mack, Robert Hancock,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b, Greg KH,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-usb-u79uwXL29TY76Z2rM5mHXA

On Fri, 9 Apr 2010, Konrad Rzeszutek Wilk wrote:

> On Fri, Apr 09, 2010 at 03:34:06PM -0400, Alan Stern wrote:
> > On Fri, 9 Apr 2010, Pedro Ribeiro wrote:
> > 
> > > > The DMA pointers do indeed look sane. I wanted to take a deeper look at
> > > > this and set up a 64bit system today. However, I fail to see the problem
> > > > here. Pedro, how much RAM does your machine have installed?
> > 
> > > It has 4 GB.
> > 
> > That means DMA mapping cannot be the cause of the problem.  :-(
> 
> That isn't entirely true. The BIOS usually allocates a 256 MB ACPI/PCI hole
> that is under the 4GB.
> 
> So end up with 3.7 GB, then the 256MB hole, and then right above the 4GB
> you the the remaining memory: 4.3GB.

How can Pedro find out what physical addresses are in use on his 
system?

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [LKML] Re: USB transfer_buffer allocations on 64bit systems
  2010-04-09 21:23                         ` Alan Stern
  (?)
@ 2010-04-09 22:11                         ` Robert Hancock
  2010-04-12 10:48                             ` Daniel Mack
  -1 siblings, 1 reply; 221+ messages in thread
From: Robert Hancock @ 2010-04-09 22:11 UTC (permalink / raw)
  To: Alan Stern
  Cc: Konrad Rzeszutek Wilk, Pedro Ribeiro, Daniel Mack, linux-kernel,
	akpm, Greg KH, alsa-devel, linux-usb

On Fri, Apr 9, 2010 at 3:23 PM, Alan Stern <stern@rowland.harvard.edu> wrote:
> On Fri, 9 Apr 2010, Konrad Rzeszutek Wilk wrote:
>
>> On Fri, Apr 09, 2010 at 03:34:06PM -0400, Alan Stern wrote:
>> > On Fri, 9 Apr 2010, Pedro Ribeiro wrote:
>> >
>> > > > The DMA pointers do indeed look sane. I wanted to take a deeper look at
>> > > > this and set up a 64bit system today. However, I fail to see the problem
>> > > > here. Pedro, how much RAM does your machine have installed?
>> >
>> > > It has 4 GB.
>> >
>> > That means DMA mapping cannot be the cause of the problem.  :-(
>>
>> That isn't entirely true. The BIOS usually allocates a 256 MB ACPI/PCI hole
>> that is under the 4GB.
>>
>> So end up with 3.7 GB, then the 256MB hole, and then right above the 4GB
>> you the the remaining memory: 4.3GB.
>
> How can Pedro find out what physical addresses are in use on his
> system?

If you have 4GB of RAM then almost certainly you have memory located
at addresses over 4GB. If you look at the e820 memory map printed at
the start of dmesg on bootup and see entries with addresses of
100000000 or higher reported as usable, then this is the case.

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-09 16:50                     ` Sarah Sharp
@ 2010-04-09 23:38                       ` Robert Hancock
  -1 siblings, 0 replies; 221+ messages in thread
From: Robert Hancock @ 2010-04-09 23:38 UTC (permalink / raw)
  To: Sarah Sharp
  Cc: Greg KH, Alan Stern, alsa-devel, linux-usb, Takashi Iwai,
	Greg KH, linux-kernel, Pedro Ribeiro, akpm

On Fri, Apr 9, 2010 at 10:50 AM, Sarah Sharp
<sarah.a.sharp@linux.intel.com> wrote:
>> >>I don't know if the comment is still true, but until the "#if 0" is
>> >>removed, ehci-hcd won't make use of 64-bit DMA.
>> >
>> >I think someone tried to remove it recently, but I wouldn't let them :)
>> >
>> >What a mess, hopefully xhci will just take over and save the world from
>> >this whole thing...
>
> I hate to break it to you, but 64-bit DMA support is optional for an
> xHCI implementation.  There's a bit in HCCPARAMS that tells whether the
> host supports it (see the HCC_64BIT_ADDR macro in xhci.h).  The xHCI
> driver currently doesn't do anything with that bit, although it should.
> All the implementations I've seen do 64-bit DMA.
>
>> True.. except for the fact that the xhci driver currently doesn't do
>> 64-bit DMA either
>
> What makes you think that?  I've seen URB buffers with 64-bit DMA
> addresses.  I can tell when the debug polling loop runs and I look at
> the DMA addresses the xHCI driver is feeding to the hardware:
>
> Dev 1 endpoint ring 0:
> xhci_hcd 0000:05:00.0: @71a49800 01000680 00080000 00000008 00000841
>
> So the TRB at address 71a49800 is pointing to a buffer at address
> 0x0008000001000680.

I'm not sure why the address would be that huge, unless it's not
actually a physical address, or there's some kind of remapping going
on?

>
> If I'm setting a DMA mask wrong somewhere, or doing something else to
> limit the DMA to 32-bit, then please let me know.

The DMA mask for the controller isn't being set anywhere (in the
version that's in Linus' current git anyway). In that case it'll
default to 32-bit and any DMA mappings above 4GB will need to be
remapped. The controller driver doesn't do the mapping itself but the
USB core does, passing in the controller device as the one doing the
DMA, so if the controller's DMA mask is set to 32-bit then the buffers
passed in will get remapped/bounced accordingly.

You should likely be setting the DMA mask for the controller device to
64-bit if the HCC_64BIT_ADDR flag is set, similar to the code in
ehci-hcd.c which is currently #if 0'ed out.

You can see the currently set mask in sysfs under
/sys/devices/pci(whatever)/dma_mask_bits.

>
>> nor does it support MSI even though the HW
>> supports it (surprisingly enough the NEC Windows driver does, MSI-X
>> even).
>
> There's a patch from AMD to enable MSI-X.  The code was there, just
> commented out because the early prototypes didn't do MSI-X.

Ah, I see it. That could presumably be tested now (the NEC D720200F1
chip on the Asus U3S6 card I have seems to support MSI-X with 8
vectors).

>
>> At this point only Intel likely knows how to do this
>> properly, though, since AFAICS the spec isn't publicly available
>> yet.
>
> I have tried very hard to fix this, and will continue to do so.
>
> Sarah Sharp
>

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-09 23:38                       ` Robert Hancock
  0 siblings, 0 replies; 221+ messages in thread
From: Robert Hancock @ 2010-04-09 23:38 UTC (permalink / raw)
  To: Sarah Sharp
  Cc: Greg KH, Alan Stern, alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-usb-u79uwXL29TY76Z2rM5mHXA, Takashi Iwai, Greg KH,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Pedro Ribeiro,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b

On Fri, Apr 9, 2010 at 10:50 AM, Sarah Sharp
<sarah.a.sharp-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> wrote:
>> >>I don't know if the comment is still true, but until the "#if 0" is
>> >>removed, ehci-hcd won't make use of 64-bit DMA.
>> >
>> >I think someone tried to remove it recently, but I wouldn't let them :)
>> >
>> >What a mess, hopefully xhci will just take over and save the world from
>> >this whole thing...
>
> I hate to break it to you, but 64-bit DMA support is optional for an
> xHCI implementation.  There's a bit in HCCPARAMS that tells whether the
> host supports it (see the HCC_64BIT_ADDR macro in xhci.h).  The xHCI
> driver currently doesn't do anything with that bit, although it should.
> All the implementations I've seen do 64-bit DMA.
>
>> True.. except for the fact that the xhci driver currently doesn't do
>> 64-bit DMA either
>
> What makes you think that?  I've seen URB buffers with 64-bit DMA
> addresses.  I can tell when the debug polling loop runs and I look at
> the DMA addresses the xHCI driver is feeding to the hardware:
>
> Dev 1 endpoint ring 0:
> xhci_hcd 0000:05:00.0: @71a49800 01000680 00080000 00000008 00000841
>
> So the TRB at address 71a49800 is pointing to a buffer at address
> 0x0008000001000680.

I'm not sure why the address would be that huge, unless it's not
actually a physical address, or there's some kind of remapping going
on?

>
> If I'm setting a DMA mask wrong somewhere, or doing something else to
> limit the DMA to 32-bit, then please let me know.

The DMA mask for the controller isn't being set anywhere (in the
version that's in Linus' current git anyway). In that case it'll
default to 32-bit and any DMA mappings above 4GB will need to be
remapped. The controller driver doesn't do the mapping itself but the
USB core does, passing in the controller device as the one doing the
DMA, so if the controller's DMA mask is set to 32-bit then the buffers
passed in will get remapped/bounced accordingly.

You should likely be setting the DMA mask for the controller device to
64-bit if the HCC_64BIT_ADDR flag is set, similar to the code in
ehci-hcd.c which is currently #if 0'ed out.

You can see the currently set mask in sysfs under
/sys/devices/pci(whatever)/dma_mask_bits.

>
>> nor does it support MSI even though the HW
>> supports it (surprisingly enough the NEC Windows driver does, MSI-X
>> even).
>
> There's a patch from AMD to enable MSI-X.  The code was there, just
> commented out because the early prototypes didn't do MSI-X.

Ah, I see it. That could presumably be tested now (the NEC D720200F1
chip on the Asus U3S6 card I have seems to support MSI-X with 8
vectors).

>
>> At this point only Intel likely knows how to do this
>> properly, though, since AFAICS the spec isn't publicly available
>> yet.
>
> I have tried very hard to fix this, and will continue to do so.
>
> Sarah Sharp
>
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
  2010-04-09 23:38                       ` Robert Hancock
@ 2010-04-10  8:34                         ` Daniel Mack
  -1 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-10  8:34 UTC (permalink / raw)
  To: Robert Hancock
  Cc: Sarah Sharp, alsa-devel, Greg KH, Takashi Iwai, Greg KH,
	linux-usb, linux-kernel, Alan Stern, Pedro Ribeiro, akpm

On Fri, Apr 09, 2010 at 05:38:13PM -0600, Robert Hancock wrote:
> On Fri, Apr 9, 2010 at 10:50 AM, Sarah Sharp
> <sarah.a.sharp@linux.intel.com> wrote:
> > What makes you think that?  I've seen URB buffers with 64-bit DMA
> > addresses.  I can tell when the debug polling loop runs and I look at
> > the DMA addresses the xHCI driver is feeding to the hardware:
> >
> > Dev 1 endpoint ring 0:
> > xhci_hcd 0000:05:00.0: @71a49800 01000680 00080000 00000008 00000841
> >
> > So the TRB at address 71a49800 is pointing to a buffer at address
> > 0x0008000001000680.
> 
> I'm not sure why the address would be that huge, unless it's not
> actually a physical address, or there's some kind of remapping going
> on?
> 
> >
> > If I'm setting a DMA mask wrong somewhere, or doing something else to
> > limit the DMA to 32-bit, then please let me know.
> 
> The DMA mask for the controller isn't being set anywhere (in the
> version that's in Linus' current git anyway). In that case it'll
> default to 32-bit and any DMA mappings above 4GB will need to be
> remapped. The controller driver doesn't do the mapping itself but the
> USB core does, passing in the controller device as the one doing the
> DMA, so if the controller's DMA mask is set to 32-bit then the buffers
> passed in will get remapped/bounced accordingly.

So if we're seeing physical addresses in the log above, and the xHCI
driver does not explicitly allow the USB core to use addresses above
4GB, why shouldn't the same thing be true as well for EHCI?
(Which would then be exactly the case we're seeing)

Daniel

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-10  8:34                         ` Daniel Mack
  0 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-10  8:34 UTC (permalink / raw)
  To: Robert Hancock
  Cc: alsa-devel, linux-usb, Sarah Sharp, Greg KH, Greg KH,
	linux-kernel, Takashi Iwai, Alan Stern, Pedro Ribeiro, akpm

On Fri, Apr 09, 2010 at 05:38:13PM -0600, Robert Hancock wrote:
> On Fri, Apr 9, 2010 at 10:50 AM, Sarah Sharp
> <sarah.a.sharp@linux.intel.com> wrote:
> > What makes you think that?  I've seen URB buffers with 64-bit DMA
> > addresses.  I can tell when the debug polling loop runs and I look at
> > the DMA addresses the xHCI driver is feeding to the hardware:
> >
> > Dev 1 endpoint ring 0:
> > xhci_hcd 0000:05:00.0: @71a49800 01000680 00080000 00000008 00000841
> >
> > So the TRB at address 71a49800 is pointing to a buffer at address
> > 0x0008000001000680.
> 
> I'm not sure why the address would be that huge, unless it's not
> actually a physical address, or there's some kind of remapping going
> on?
> 
> >
> > If I'm setting a DMA mask wrong somewhere, or doing something else to
> > limit the DMA to 32-bit, then please let me know.
> 
> The DMA mask for the controller isn't being set anywhere (in the
> version that's in Linus' current git anyway). In that case it'll
> default to 32-bit and any DMA mappings above 4GB will need to be
> remapped. The controller driver doesn't do the mapping itself but the
> USB core does, passing in the controller device as the one doing the
> DMA, so if the controller's DMA mask is set to 32-bit then the buffers
> passed in will get remapped/bounced accordingly.

So if we're seeing physical addresses in the log above, and the xHCI
driver does not explicitly allow the USB core to use addresses above
4GB, why shouldn't the same thing be true as well for EHCI?
(Which would then be exactly the case we're seeing)

Daniel

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-09 18:19                   ` Pedro Ribeiro
@ 2010-04-10 12:49                     ` Daniel Mack
  -1 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-10 12:49 UTC (permalink / raw)
  To: Pedro Ribeiro
  Cc: Alan Stern, Robert Hancock, linux-kernel, akpm, Greg KH,
	alsa-devel, linux-usb

On Fri, Apr 09, 2010 at 07:19:22PM +0100, Pedro Ribeiro wrote:
> On 9 April 2010 19:09, Daniel Mack <daniel@caiaq.de> wrote:
> > On Fri, Apr 09, 2010 at 12:01:27PM -0400, Alan Stern wrote:
> >> I don't see anything suspicious.  The transfer_buffer addresses repeat
> >> every 32 URBs, and the DMA addresses cycle almost entirely uniformly
> >> from 0x20000000 to 0x23ffffff in units of 0x2000 (there are a few gaps
> >> where the interval is a little bigger).
> >
> > The DMA pointers do indeed look sane. I wanted to take a deeper look at
> > this and set up a 64bit system today. However, I fail to see the problem
> > here. Pedro, how much RAM does your machine have installed?
> >
> > Daniel
> >
> >
> 
> It has 4 GB.

Upgraded my machine now to 4GB, but I still can't reproduce this bug.
Pedro, can you send your config, please?

Daniel

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-10 12:49                     ` Daniel Mack
  0 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-10 12:49 UTC (permalink / raw)
  To: Pedro Ribeiro
  Cc: alsa-devel, linux-usb, Greg KH, linux-kernel, Alan Stern, akpm,
	Robert Hancock

On Fri, Apr 09, 2010 at 07:19:22PM +0100, Pedro Ribeiro wrote:
> On 9 April 2010 19:09, Daniel Mack <daniel@caiaq.de> wrote:
> > On Fri, Apr 09, 2010 at 12:01:27PM -0400, Alan Stern wrote:
> >> I don't see anything suspicious.  The transfer_buffer addresses repeat
> >> every 32 URBs, and the DMA addresses cycle almost entirely uniformly
> >> from 0x20000000 to 0x23ffffff in units of 0x2000 (there are a few gaps
> >> where the interval is a little bigger).
> >
> > The DMA pointers do indeed look sane. I wanted to take a deeper look at
> > this and set up a 64bit system today. However, I fail to see the problem
> > here. Pedro, how much RAM does your machine have installed?
> >
> > Daniel
> >
> >
> 
> It has 4 GB.

Upgraded my machine now to 4GB, but I still can't reproduce this bug.
Pedro, can you send your config, please?

Daniel

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-10 13:21                       ` Pedro Ribeiro
  0 siblings, 0 replies; 221+ messages in thread
From: Pedro Ribeiro @ 2010-04-10 13:21 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Alan Stern, Robert Hancock, linux-kernel, akpm, Greg KH,
	alsa-devel, linux-usb

[-- Attachment #1: Type: text/plain, Size: 1091 bytes --]

On 10 April 2010 13:49, Daniel Mack <daniel@caiaq.de> wrote:
> On Fri, Apr 09, 2010 at 07:19:22PM +0100, Pedro Ribeiro wrote:
>> On 9 April 2010 19:09, Daniel Mack <daniel@caiaq.de> wrote:
>> > On Fri, Apr 09, 2010 at 12:01:27PM -0400, Alan Stern wrote:
>> >> I don't see anything suspicious.  The transfer_buffer addresses repeat
>> >> every 32 URBs, and the DMA addresses cycle almost entirely uniformly
>> >> from 0x20000000 to 0x23ffffff in units of 0x2000 (there are a few gaps
>> >> where the interval is a little bigger).
>> >
>> > The DMA pointers do indeed look sane. I wanted to take a deeper look at
>> > this and set up a 64bit system today. However, I fail to see the problem
>> > here. Pedro, how much RAM does your machine have installed?
>> >
>> > Daniel
>> >
>> >
>>
>> It has 4 GB.
>
> Upgraded my machine now to 4GB, but I still can't reproduce this bug.
> Pedro, can you send your config, please?
>
> Daniel
>

Here it is. It is configured for realtime and TuxOnIce patches.
However, the bug still occurs without these kernel patches.

Pedro

[-- Attachment #2: .config_2.6.33-rt-ToI --]
[-- Type: application/octet-stream, Size: 90819 bytes --]

#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.33-rt4
# Sat Mar 13 10:36:34 2010
#
CONFIG_64BIT=y
# CONFIG_X86_32 is not set
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"
CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"
CONFIG_GENERIC_TIME=y
CONFIG_GENERIC_CMOS_UPDATE=y
CONFIG_CLOCKSOURCE_WATCHDOG=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
CONFIG_MMU=y
CONFIG_ZONE_DMA=y
CONFIG_GENERIC_ISA_DMA=y
CONFIG_GENERIC_IOMAP=y
CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_ARCH_MAY_HAVE_PC_FDC=y
CONFIG_RWSEM_GENERIC_SPINLOCK=y
CONFIG_ASM_SEMAPHORES=y
CONFIG_ARCH_HAS_CPU_IDLE_WAIT=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_GENERIC_TIME_VSYSCALL=y
CONFIG_ARCH_HAS_CPU_RELAX=y
CONFIG_ARCH_HAS_DEFAULT_IDLE=y
CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
CONFIG_HAVE_SETUP_PER_CPU_AREA=y
CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y
CONFIG_HAVE_CPUMASK_OF_CPU_MAP=y
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_ZONE_DMA32=y
CONFIG_ARCH_POPULATES_NODE_MAP=y
CONFIG_AUDIT_ARCH=y
CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y
CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
CONFIG_GENERIC_HARDIRQS=y
CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_GENERIC_PENDING_IRQ=y
CONFIG_USE_GENERIC_SMP_HELPERS=y
CONFIG_X86_64_SMP=y
CONFIG_X86_HT=y
CONFIG_X86_TRAMPOLINE=y
# CONFIG_KTIME_SCALAR is not set
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
CONFIG_CONSTRUCTORS=y

#
# General setup
#
CONFIG_EXPERIMENTAL=y
CONFIG_LOCK_KERNEL=y
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_LOCALVERSION=""
# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_HAVE_KERNEL_GZIP=y
CONFIG_HAVE_KERNEL_BZIP2=y
CONFIG_HAVE_KERNEL_LZMA=y
CONFIG_HAVE_KERNEL_LZO=y
CONFIG_KERNEL_GZIP=y
# CONFIG_KERNEL_BZIP2 is not set
# CONFIG_KERNEL_LZMA is not set
# CONFIG_KERNEL_LZO is not set
CONFIG_SWAP=y
CONFIG_SYSVIPC=y
CONFIG_SYSVIPC_SYSCTL=y
CONFIG_POSIX_MQUEUE=y
CONFIG_POSIX_MQUEUE_SYSCTL=y
CONFIG_BSD_PROCESS_ACCT=y
CONFIG_BSD_PROCESS_ACCT_V3=y
CONFIG_TASKSTATS=y
CONFIG_TASK_DELAY_ACCT=y
CONFIG_TASK_XACCT=y
CONFIG_TASK_IO_ACCOUNTING=y
CONFIG_AUDIT=y
CONFIG_AUDITSYSCALL=y
CONFIG_AUDIT_TREE=y

#
# RCU Subsystem
#
# CONFIG_TREE_RCU is not set
CONFIG_TREE_PREEMPT_RCU=y
# CONFIG_TINY_RCU is not set
# CONFIG_RCU_TRACE is not set
CONFIG_RCU_FANOUT=32
# CONFIG_RCU_FANOUT_EXACT is not set
# CONFIG_TREE_RCU_TRACE is not set
# CONFIG_IKCONFIG is not set
CONFIG_LOG_BUF_SHIFT=17
CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y
CONFIG_GROUP_SCHED=y
CONFIG_FAIR_GROUP_SCHED=y
CONFIG_RT_GROUP_SCHED=y
# CONFIG_USER_SCHED is not set
CONFIG_CGROUP_SCHED=y
CONFIG_CGROUPS=y
# CONFIG_CGROUP_DEBUG is not set
CONFIG_CGROUP_NS=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CPUSETS=y
CONFIG_PROC_PID_CPUSET=y
CONFIG_CGROUP_CPUACCT=y
# CONFIG_RESOURCE_COUNTERS is not set
# CONFIG_SYSFS_DEPRECATED_V2 is not set
CONFIG_RELAY=y
CONFIG_NAMESPACES=y
CONFIG_UTS_NS=y
CONFIG_IPC_NS=y
CONFIG_USER_NS=y
CONFIG_PID_NS=y
CONFIG_NET_NS=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_RD_GZIP=y
CONFIG_RD_BZIP2=y
CONFIG_RD_LZMA=y
CONFIG_RD_LZO=y
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
CONFIG_SYSCTL=y
CONFIG_ANON_INODES=y
# CONFIG_EMBEDDED is not set
CONFIG_UID16=y
CONFIG_SYSCTL_SYSCALL=y
CONFIG_KALLSYMS=y
CONFIG_KALLSYMS_ALL=y
# CONFIG_KALLSYMS_EXTRA_PASS is not set
CONFIG_HOTPLUG=y
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
CONFIG_PCSPKR_PLATFORM=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
CONFIG_EPOLL=y
CONFIG_SIGNALFD=y
CONFIG_TIMERFD=y
CONFIG_EVENTFD=y
CONFIG_SHMEM=y
CONFIG_AIO=y
CONFIG_HAVE_PERF_EVENTS=y

#
# Kernel Performance Events And Counters
#
CONFIG_PERF_EVENTS=y
CONFIG_EVENT_PROFILE=y
# CONFIG_PERF_COUNTERS is not set
# CONFIG_DEBUG_PERF_USE_VMALLOC is not set
CONFIG_VM_EVENT_COUNTERS=y
CONFIG_PCI_QUIRKS=y
# CONFIG_COMPAT_BRK is not set
CONFIG_SLAB=y
# CONFIG_SLUB is not set
# CONFIG_SLOB is not set
CONFIG_PROFILING=y
CONFIG_TRACEPOINTS=y
CONFIG_OPROFILE=m
CONFIG_OPROFILE_IBS=y
# CONFIG_OPROFILE_EVENT_MULTIPLEX is not set
CONFIG_HAVE_OPROFILE=y
CONFIG_PROFILE_NMI=y
# CONFIG_KPROBES is not set
CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
CONFIG_USER_RETURN_NOTIFIER=y
CONFIG_HAVE_IOREMAP_PROT=y
CONFIG_HAVE_KPROBES=y
CONFIG_HAVE_KRETPROBES=y
CONFIG_HAVE_ARCH_TRACEHOOK=y
CONFIG_HAVE_DMA_ATTRS=y
CONFIG_HAVE_DMA_API_DEBUG=y
CONFIG_HAVE_HW_BREAKPOINT=y
CONFIG_HAVE_USER_RETURN_NOTIFIER=y

#
# GCOV-based kernel profiling
#
# CONFIG_GCOV_KERNEL is not set
CONFIG_SLOW_WORK=y
# CONFIG_SLOW_WORK_DEBUG is not set
# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
CONFIG_SLABINFO=y
CONFIG_RT_MUTEXES=y
CONFIG_BASE_SMALL=0
CONFIG_MODULES=y
CONFIG_MODULE_FORCE_LOAD=y
CONFIG_MODULE_UNLOAD=y
CONFIG_MODULE_FORCE_UNLOAD=y
CONFIG_MODVERSIONS=y
# CONFIG_MODULE_SRCVERSION_ALL is not set
CONFIG_STOP_MACHINE=y
CONFIG_BLOCK=y
CONFIG_BLK_DEV_BSG=y
CONFIG_BLK_DEV_INTEGRITY=y
# CONFIG_BLK_CGROUP is not set
CONFIG_BLOCK_COMPAT=y

#
# IO Schedulers
#
CONFIG_IOSCHED_NOOP=y
CONFIG_IOSCHED_DEADLINE=y
CONFIG_IOSCHED_CFQ=y
# CONFIG_CFQ_GROUP_IOSCHED is not set
# CONFIG_DEFAULT_DEADLINE is not set
CONFIG_DEFAULT_CFQ=y
# CONFIG_DEFAULT_NOOP is not set
CONFIG_DEFAULT_IOSCHED="cfq"
CONFIG_PREEMPT_NOTIFIERS=y
# CONFIG_INLINE_SPIN_TRYLOCK is not set
# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
# CONFIG_INLINE_SPIN_LOCK is not set
# CONFIG_INLINE_SPIN_LOCK_BH is not set
# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
# CONFIG_INLINE_SPIN_UNLOCK is not set
# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
# CONFIG_INLINE_SPIN_UNLOCK_IRQ is not set
# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
# CONFIG_INLINE_READ_TRYLOCK is not set
# CONFIG_INLINE_READ_LOCK is not set
# CONFIG_INLINE_READ_LOCK_BH is not set
# CONFIG_INLINE_READ_LOCK_IRQ is not set
# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
# CONFIG_INLINE_READ_UNLOCK is not set
# CONFIG_INLINE_READ_UNLOCK_BH is not set
# CONFIG_INLINE_READ_UNLOCK_IRQ is not set
# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
# CONFIG_INLINE_WRITE_TRYLOCK is not set
# CONFIG_INLINE_WRITE_LOCK is not set
# CONFIG_INLINE_WRITE_LOCK_BH is not set
# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
# CONFIG_INLINE_WRITE_UNLOCK is not set
# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
# CONFIG_INLINE_WRITE_UNLOCK_IRQ is not set
# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
CONFIG_MUTEX_SPIN_ON_OWNER=y
CONFIG_FREEZER=y

#
# Processor type and features
#
CONFIG_TICK_ONESHOT=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
CONFIG_SMP=y
CONFIG_X86_MPPARSE=y
# CONFIG_X86_EXTENDED_PLATFORM is not set
CONFIG_X86_SUPPORTS_MEMORY_FAILURE=y
CONFIG_SCHED_OMIT_FRAME_POINTER=y
# CONFIG_PARAVIRT_GUEST is not set
# CONFIG_MEMTEST is not set
# CONFIG_M386 is not set
# CONFIG_M486 is not set
# CONFIG_M586 is not set
# CONFIG_M586TSC is not set
# CONFIG_M586MMX is not set
# CONFIG_M686 is not set
# CONFIG_MPENTIUMII is not set
# CONFIG_MPENTIUMIII is not set
# CONFIG_MPENTIUMM is not set
# CONFIG_MPENTIUM4 is not set
# CONFIG_MK6 is not set
# CONFIG_MK7 is not set
# CONFIG_MK8 is not set
# CONFIG_MCRUSOE is not set
# CONFIG_MEFFICEON is not set
# CONFIG_MWINCHIPC6 is not set
# CONFIG_MWINCHIP3D is not set
# CONFIG_MGEODEGX1 is not set
# CONFIG_MGEODE_LX is not set
# CONFIG_MCYRIXIII is not set
# CONFIG_MVIAC3_2 is not set
# CONFIG_MVIAC7 is not set
# CONFIG_MPSC is not set
CONFIG_MCORE2=y
# CONFIG_MATOM is not set
# CONFIG_GENERIC_CPU is not set
CONFIG_X86_CPU=y
CONFIG_X86_INTERNODE_CACHE_SHIFT=6
CONFIG_X86_CMPXCHG=y
CONFIG_X86_L1_CACHE_SHIFT=6
CONFIG_X86_WP_WORKS_OK=y
CONFIG_X86_INTEL_USERCOPY=y
CONFIG_X86_USE_PPRO_CHECKSUM=y
CONFIG_X86_P6_NOP=y
CONFIG_X86_TSC=y
CONFIG_X86_CMPXCHG64=y
CONFIG_X86_CMOV=y
CONFIG_X86_MINIMUM_CPU_FAMILY=64
CONFIG_X86_DEBUGCTLMSR=y
CONFIG_CPU_SUP_INTEL=y
CONFIG_CPU_SUP_AMD=y
CONFIG_CPU_SUP_CENTAUR=y
# CONFIG_X86_DS is not set
CONFIG_HPET_TIMER=y
CONFIG_HPET_EMULATE_RTC=y
CONFIG_DMI=y
CONFIG_GART_IOMMU=y
# CONFIG_CALGARY_IOMMU is not set
# CONFIG_AMD_IOMMU is not set
CONFIG_SWIOTLB=y
CONFIG_IOMMU_HELPER=y
# CONFIG_IOMMU_API is not set
CONFIG_NR_CPUS=4
# CONFIG_SCHED_SMT is not set
CONFIG_SCHED_MC=y
# CONFIG_PREEMPT_NONE is not set
# CONFIG_PREEMPT_VOLUNTARY is not set
# CONFIG_PREEMPT_DESKTOP is not set
CONFIG_PREEMPT_RT=y
CONFIG_PREEMPT=y
CONFIG_PREEMPT_SOFTIRQS=y
CONFIG_PREEMPT_HARDIRQS=y
CONFIG_X86_LOCAL_APIC=y
CONFIG_X86_IO_APIC=y
CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS=y
CONFIG_X86_MCE=y
CONFIG_X86_MCE_INTEL=y
# CONFIG_X86_MCE_AMD is not set
CONFIG_X86_MCE_THRESHOLD=y
# CONFIG_X86_MCE_INJECT is not set
CONFIG_X86_THERMAL_VECTOR=y
# CONFIG_I8K is not set
CONFIG_MICROCODE=m
CONFIG_MICROCODE_INTEL=y
# CONFIG_MICROCODE_AMD is not set
CONFIG_MICROCODE_OLD_INTERFACE=y
CONFIG_X86_MSR=m
CONFIG_X86_CPUID=m
CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
CONFIG_DIRECT_GBPAGES=y
# CONFIG_NUMA is not set
CONFIG_ARCH_PROC_KCORE_TEXT=y
CONFIG_ARCH_SPARSEMEM_DEFAULT=y
CONFIG_ARCH_SPARSEMEM_ENABLE=y
CONFIG_ARCH_SELECT_MEMORY_MODEL=y
CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
CONFIG_SELECT_MEMORY_MODEL=y
# CONFIG_FLATMEM_MANUAL is not set
# CONFIG_DISCONTIGMEM_MANUAL is not set
CONFIG_SPARSEMEM_MANUAL=y
CONFIG_SPARSEMEM=y
CONFIG_HAVE_MEMORY_PRESENT=y
CONFIG_SPARSEMEM_EXTREME=y
CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
CONFIG_SPARSEMEM_VMEMMAP=y
# CONFIG_MEMORY_HOTPLUG is not set
CONFIG_PAGEFLAGS_EXTENDED=y
CONFIG_SPLIT_PTLOCK_CPUS=4
CONFIG_PHYS_ADDR_T_64BIT=y
CONFIG_ZONE_DMA_FLAG=1
CONFIG_BOUNCE=y
CONFIG_VIRT_TO_BUS=y
CONFIG_MMU_NOTIFIER=y
CONFIG_KSM=y
CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y
# CONFIG_MEMORY_FAILURE is not set
# CONFIG_X86_CHECK_BIOS_CORRUPTION is not set
CONFIG_X86_RESERVE_LOW_64K=y
CONFIG_MTRR=y
CONFIG_MTRR_SANITIZER=y
CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=0
CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT=1
CONFIG_X86_PAT=y
CONFIG_ARCH_USES_PG_UNCACHED=y
CONFIG_EFI=y
CONFIG_SECCOMP=y
# CONFIG_CC_STACKPROTECTOR is not set
# CONFIG_HZ_100 is not set
# CONFIG_HZ_250 is not set
# CONFIG_HZ_300 is not set
CONFIG_HZ_1000=y
CONFIG_HZ=1000
CONFIG_SCHED_HRTICK=y
CONFIG_KEXEC=y
# CONFIG_CRASH_DUMP is not set
# CONFIG_KEXEC_JUMP is not set
CONFIG_PHYSICAL_START=0x1000000
CONFIG_RELOCATABLE=y
CONFIG_PHYSICAL_ALIGN=0x1000000
CONFIG_HOTPLUG_CPU=y
# CONFIG_COMPAT_VDSO is not set
# CONFIG_CMDLINE_BOOL is not set
CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y

#
# Power management and ACPI options
#
CONFIG_ARCH_HIBERNATION_HEADER=y
CONFIG_PM=y
# CONFIG_PM_DEBUG is not set
CONFIG_PM_SLEEP_SMP=y
CONFIG_PM_SLEEP=y
CONFIG_SUSPEND=y
CONFIG_SUSPEND_FREEZER=y
CONFIG_HIBERNATION_NVS=y
CONFIG_HIBERNATION=y
CONFIG_PM_STD_PARTITION=""
CONFIG_TOI_CORE=y

#
# Image Storage (you need at least one allocator)
#
CONFIG_TOI_FILE=y
CONFIG_TOI_SWAP=y

#
# General Options
#
CONFIG_TOI_CRYPTO=y
CONFIG_TOI_USERUI=y
CONFIG_TOI_USERUI_DEFAULT_PATH="/usr/local/sbin/tuxoniceui_text"
# CONFIG_TOI_KEEP_IMAGE is not set
CONFIG_TOI_REPLACE_SWSUSP=y
CONFIG_TOI_IGNORE_LATE_INITCALL=y
CONFIG_TOI_DEFAULT_WAIT=25
CONFIG_TOI_DEFAULT_EXTRA_PAGES_ALLOWANCE=2000
# CONFIG_TOI_CHECKSUM is not set
CONFIG_TOI=y
CONFIG_PM_RUNTIME=y
CONFIG_ACPI=y
CONFIG_ACPI_SLEEP=y
CONFIG_ACPI_PROCFS=y
# CONFIG_ACPI_PROCFS_POWER is not set
# CONFIG_ACPI_POWER_METER is not set
CONFIG_ACPI_SYSFS_POWER=y
# CONFIG_ACPI_PROC_EVENT is not set
CONFIG_ACPI_AC=m
CONFIG_ACPI_BATTERY=m
CONFIG_ACPI_BUTTON=m
CONFIG_ACPI_VIDEO=m
CONFIG_ACPI_FAN=m
CONFIG_ACPI_DOCK=y
CONFIG_ACPI_PROCESSOR=m
CONFIG_ACPI_HOTPLUG_CPU=y
CONFIG_ACPI_PROCESSOR_AGGREGATOR=m
CONFIG_ACPI_THERMAL=m
# CONFIG_ACPI_CUSTOM_DSDT is not set
CONFIG_ACPI_BLACKLIST_YEAR=0
# CONFIG_ACPI_DEBUG is not set
CONFIG_ACPI_PCI_SLOT=m
CONFIG_X86_PM_TIMER=y
CONFIG_ACPI_CONTAINER=m
CONFIG_ACPI_SBS=m
# CONFIG_SFI is not set

#
# CPU Frequency scaling
#
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_TABLE=y
# CONFIG_CPU_FREQ_DEBUG is not set
CONFIG_CPU_FREQ_STAT=m
# CONFIG_CPU_FREQ_STAT_DETAILS is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
CONFIG_CPU_FREQ_GOV_USERSPACE=m
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set

#
# CPUFreq processor drivers
#
CONFIG_X86_ACPI_CPUFREQ=m
# CONFIG_X86_POWERNOW_K8 is not set
# CONFIG_X86_SPEEDSTEP_CENTRINO is not set
# CONFIG_X86_P4_CLOCKMOD is not set

#
# shared options
#
# CONFIG_X86_SPEEDSTEP_LIB is not set
CONFIG_CPU_IDLE=y
CONFIG_CPU_IDLE_GOV_LADDER=y
CONFIG_CPU_IDLE_GOV_MENU=y

#
# Memory power savings
#
# CONFIG_I7300_IDLE is not set

#
# Bus options (PCI etc.)
#
CONFIG_PCI=y
CONFIG_PCI_DIRECT=y
CONFIG_PCI_MMCONFIG=y
CONFIG_PCI_DOMAINS=y
CONFIG_PCIEPORTBUS=y
CONFIG_HOTPLUG_PCI_PCIE=m
CONFIG_PCIEAER=y
# CONFIG_PCIE_ECRC is not set
# CONFIG_PCIEAER_INJECT is not set
CONFIG_PCIEASPM=y
# CONFIG_PCIEASPM_DEBUG is not set
CONFIG_ARCH_SUPPORTS_MSI=y
CONFIG_PCI_MSI=y
CONFIG_PCI_LEGACY=y
# CONFIG_PCI_DEBUG is not set
CONFIG_PCI_STUB=m
CONFIG_HT_IRQ=y
CONFIG_PCI_IOV=y
CONFIG_PCI_IOAPIC=y
CONFIG_ISA_DMA_API=y
CONFIG_K8_NB=y
CONFIG_PCCARD=m
CONFIG_PCMCIA=m
CONFIG_PCMCIA_LOAD_CIS=y
# CONFIG_PCMCIA_IOCTL is not set
CONFIG_CARDBUS=y

#
# PC-card bridges
#
CONFIG_YENTA=m
CONFIG_YENTA_O2=y
CONFIG_YENTA_RICOH=y
CONFIG_YENTA_TI=y
CONFIG_YENTA_ENE_TUNE=y
CONFIG_YENTA_TOSHIBA=y
CONFIG_PD6729=m
CONFIG_I82092=m
CONFIG_PCCARD_NONSTATIC=m
CONFIG_HOTPLUG_PCI=m
CONFIG_HOTPLUG_PCI_FAKE=m
CONFIG_HOTPLUG_PCI_ACPI=m
CONFIG_HOTPLUG_PCI_ACPI_IBM=m
# CONFIG_HOTPLUG_PCI_CPCI is not set
CONFIG_HOTPLUG_PCI_SHPC=m

#
# Executable file formats / Emulations
#
CONFIG_BINFMT_ELF=y
CONFIG_COMPAT_BINFMT_ELF=y
CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
# CONFIG_HAVE_AOUT is not set
CONFIG_BINFMT_MISC=m
CONFIG_IA32_EMULATION=y
CONFIG_IA32_AOUT=y
CONFIG_COMPAT=y
CONFIG_COMPAT_FOR_U64_ALIGNMENT=y
CONFIG_SYSVIPC_COMPAT=y
CONFIG_NET=y
CONFIG_COMPAT_NETLINK_MESSAGES=y

#
# Networking options
#
CONFIG_PACKET=y
CONFIG_PACKET_MMAP=y
CONFIG_UNIX=y
CONFIG_XFRM=y
CONFIG_XFRM_USER=m
# CONFIG_XFRM_SUB_POLICY is not set
# CONFIG_XFRM_MIGRATE is not set
# CONFIG_XFRM_STATISTICS is not set
CONFIG_XFRM_IPCOMP=m
CONFIG_NET_KEY=m
# CONFIG_NET_KEY_MIGRATE is not set
CONFIG_INET=y
CONFIG_IP_MULTICAST=y
CONFIG_IP_ADVANCED_ROUTER=y
CONFIG_ASK_IP_FIB_HASH=y
# CONFIG_IP_FIB_TRIE is not set
CONFIG_IP_FIB_HASH=y
CONFIG_IP_MULTIPLE_TABLES=y
CONFIG_IP_ROUTE_MULTIPATH=y
CONFIG_IP_ROUTE_VERBOSE=y
# CONFIG_IP_PNP is not set
CONFIG_NET_IPIP=m
CONFIG_NET_IPGRE=m
CONFIG_NET_IPGRE_BROADCAST=y
CONFIG_IP_MROUTE=y
CONFIG_IP_PIMSM_V1=y
CONFIG_IP_PIMSM_V2=y
# CONFIG_ARPD is not set
CONFIG_SYN_COOKIES=y
CONFIG_INET_AH=m
CONFIG_INET_ESP=m
CONFIG_INET_IPCOMP=m
CONFIG_INET_XFRM_TUNNEL=m
CONFIG_INET_TUNNEL=m
CONFIG_INET_XFRM_MODE_TRANSPORT=m
CONFIG_INET_XFRM_MODE_TUNNEL=m
CONFIG_INET_XFRM_MODE_BEET=m
CONFIG_INET_LRO=y
CONFIG_INET_DIAG=m
CONFIG_INET_TCP_DIAG=m
CONFIG_TCP_CONG_ADVANCED=y
CONFIG_TCP_CONG_BIC=m
CONFIG_TCP_CONG_CUBIC=y
CONFIG_TCP_CONG_WESTWOOD=m
CONFIG_TCP_CONG_HTCP=m
CONFIG_TCP_CONG_HSTCP=m
CONFIG_TCP_CONG_HYBLA=m
CONFIG_TCP_CONG_VEGAS=m
CONFIG_TCP_CONG_SCALABLE=m
CONFIG_TCP_CONG_LP=m
CONFIG_TCP_CONG_VENO=m
CONFIG_TCP_CONG_YEAH=m
CONFIG_TCP_CONG_ILLINOIS=m
# CONFIG_DEFAULT_BIC is not set
CONFIG_DEFAULT_CUBIC=y
# CONFIG_DEFAULT_HTCP is not set
# CONFIG_DEFAULT_VEGAS is not set
# CONFIG_DEFAULT_WESTWOOD is not set
# CONFIG_DEFAULT_RENO is not set
CONFIG_DEFAULT_TCP_CONG="cubic"
CONFIG_TCP_MD5SIG=y
CONFIG_IPV6=m
CONFIG_IPV6_PRIVACY=y
CONFIG_IPV6_ROUTER_PREF=y
CONFIG_IPV6_ROUTE_INFO=y
CONFIG_IPV6_OPTIMISTIC_DAD=y
CONFIG_INET6_AH=m
CONFIG_INET6_ESP=m
CONFIG_INET6_IPCOMP=m
CONFIG_IPV6_MIP6=m
CONFIG_INET6_XFRM_TUNNEL=m
CONFIG_INET6_TUNNEL=m
CONFIG_INET6_XFRM_MODE_TRANSPORT=m
CONFIG_INET6_XFRM_MODE_TUNNEL=m
CONFIG_INET6_XFRM_MODE_BEET=m
CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m
CONFIG_IPV6_SIT=m
# CONFIG_IPV6_SIT_6RD is not set
CONFIG_IPV6_NDISC_NODETYPE=y
CONFIG_IPV6_TUNNEL=m
CONFIG_IPV6_MULTIPLE_TABLES=y
CONFIG_IPV6_SUBTREES=y
CONFIG_IPV6_MROUTE=y
CONFIG_IPV6_PIMSM_V2=y
# CONFIG_NETLABEL is not set
CONFIG_NETWORK_SECMARK=y
CONFIG_NETFILTER=y
# CONFIG_NETFILTER_DEBUG is not set
CONFIG_NETFILTER_ADVANCED=y
CONFIG_BRIDGE_NETFILTER=y

#
# Core Netfilter Configuration
#
CONFIG_NETFILTER_NETLINK=m
CONFIG_NETFILTER_NETLINK_QUEUE=m
CONFIG_NETFILTER_NETLINK_LOG=m
CONFIG_NF_CONNTRACK=m
CONFIG_NF_CT_ACCT=y
CONFIG_NF_CONNTRACK_MARK=y
CONFIG_NF_CONNTRACK_SECMARK=y
CONFIG_NF_CONNTRACK_EVENTS=y
CONFIG_NF_CT_PROTO_DCCP=m
CONFIG_NF_CT_PROTO_GRE=m
CONFIG_NF_CT_PROTO_SCTP=m
CONFIG_NF_CT_PROTO_UDPLITE=m
CONFIG_NF_CONNTRACK_AMANDA=m
CONFIG_NF_CONNTRACK_FTP=m
CONFIG_NF_CONNTRACK_H323=m
CONFIG_NF_CONNTRACK_IRC=m
CONFIG_NF_CONNTRACK_NETBIOS_NS=m
CONFIG_NF_CONNTRACK_PPTP=m
CONFIG_NF_CONNTRACK_SANE=m
CONFIG_NF_CONNTRACK_SIP=m
CONFIG_NF_CONNTRACK_TFTP=m
CONFIG_NF_CT_NETLINK=m
CONFIG_NETFILTER_TPROXY=m
CONFIG_NETFILTER_XTABLES=m
CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m
CONFIG_NETFILTER_XT_TARGET_DSCP=m
CONFIG_NETFILTER_XT_TARGET_HL=m
CONFIG_NETFILTER_XT_TARGET_LED=m
CONFIG_NETFILTER_XT_TARGET_MARK=m
CONFIG_NETFILTER_XT_TARGET_NFLOG=m
CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
CONFIG_NETFILTER_XT_TARGET_RATEEST=m
CONFIG_NETFILTER_XT_TARGET_TPROXY=m
CONFIG_NETFILTER_XT_TARGET_TRACE=m
CONFIG_NETFILTER_XT_TARGET_SECMARK=m
CONFIG_NETFILTER_XT_TARGET_TCPMSS=m
CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP=m
CONFIG_NETFILTER_XT_MATCH_CLUSTER=m
CONFIG_NETFILTER_XT_MATCH_COMMENT=m
CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m
CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
CONFIG_NETFILTER_XT_MATCH_DCCP=m
CONFIG_NETFILTER_XT_MATCH_DSCP=m
CONFIG_NETFILTER_XT_MATCH_ESP=m
CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
CONFIG_NETFILTER_XT_MATCH_HELPER=m
CONFIG_NETFILTER_XT_MATCH_HL=m
CONFIG_NETFILTER_XT_MATCH_IPRANGE=m
CONFIG_NETFILTER_XT_MATCH_LENGTH=m
CONFIG_NETFILTER_XT_MATCH_LIMIT=m
CONFIG_NETFILTER_XT_MATCH_MAC=m
CONFIG_NETFILTER_XT_MATCH_MARK=m
CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
CONFIG_NETFILTER_XT_MATCH_OWNER=m
CONFIG_NETFILTER_XT_MATCH_POLICY=m
CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m
CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
CONFIG_NETFILTER_XT_MATCH_QUOTA=m
CONFIG_NETFILTER_XT_MATCH_RATEEST=m
CONFIG_NETFILTER_XT_MATCH_REALM=m
CONFIG_NETFILTER_XT_MATCH_RECENT=m
# CONFIG_NETFILTER_XT_MATCH_RECENT_PROC_COMPAT is not set
CONFIG_NETFILTER_XT_MATCH_SCTP=m
CONFIG_NETFILTER_XT_MATCH_SOCKET=m
CONFIG_NETFILTER_XT_MATCH_STATE=m
CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
CONFIG_NETFILTER_XT_MATCH_STRING=m
CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
CONFIG_NETFILTER_XT_MATCH_TIME=m
CONFIG_NETFILTER_XT_MATCH_U32=m
CONFIG_NETFILTER_XT_MATCH_OSF=m
CONFIG_IP_VS=m
# CONFIG_IP_VS_IPV6 is not set
# CONFIG_IP_VS_DEBUG is not set
CONFIG_IP_VS_TAB_BITS=12

#
# IPVS transport protocol load balancing support
#
CONFIG_IP_VS_PROTO_TCP=y
CONFIG_IP_VS_PROTO_UDP=y
CONFIG_IP_VS_PROTO_AH_ESP=y
CONFIG_IP_VS_PROTO_ESP=y
CONFIG_IP_VS_PROTO_AH=y

#
# IPVS scheduler
#
CONFIG_IP_VS_RR=m
CONFIG_IP_VS_WRR=m
CONFIG_IP_VS_LC=m
CONFIG_IP_VS_WLC=m
CONFIG_IP_VS_LBLC=m
CONFIG_IP_VS_LBLCR=m
CONFIG_IP_VS_DH=m
CONFIG_IP_VS_SH=m
CONFIG_IP_VS_SED=m
CONFIG_IP_VS_NQ=m

#
# IPVS application helper
#
CONFIG_IP_VS_FTP=m

#
# IP: Netfilter Configuration
#
CONFIG_NF_DEFRAG_IPV4=m
CONFIG_NF_CONNTRACK_IPV4=m
CONFIG_NF_CONNTRACK_PROC_COMPAT=y
CONFIG_IP_NF_QUEUE=m
CONFIG_IP_NF_IPTABLES=m
CONFIG_IP_NF_MATCH_ADDRTYPE=m
CONFIG_IP_NF_MATCH_AH=m
CONFIG_IP_NF_MATCH_ECN=m
CONFIG_IP_NF_MATCH_TTL=m
CONFIG_IP_NF_FILTER=m
CONFIG_IP_NF_TARGET_REJECT=m
CONFIG_IP_NF_TARGET_LOG=m
CONFIG_IP_NF_TARGET_ULOG=m
CONFIG_NF_NAT=m
CONFIG_NF_NAT_NEEDED=y
CONFIG_IP_NF_TARGET_MASQUERADE=m
CONFIG_IP_NF_TARGET_NETMAP=m
CONFIG_IP_NF_TARGET_REDIRECT=m
CONFIG_NF_NAT_SNMP_BASIC=m
CONFIG_NF_NAT_PROTO_DCCP=m
CONFIG_NF_NAT_PROTO_GRE=m
CONFIG_NF_NAT_PROTO_UDPLITE=m
CONFIG_NF_NAT_PROTO_SCTP=m
CONFIG_NF_NAT_FTP=m
CONFIG_NF_NAT_IRC=m
CONFIG_NF_NAT_TFTP=m
CONFIG_NF_NAT_AMANDA=m
CONFIG_NF_NAT_PPTP=m
CONFIG_NF_NAT_H323=m
CONFIG_NF_NAT_SIP=m
CONFIG_IP_NF_MANGLE=m
CONFIG_IP_NF_TARGET_CLUSTERIP=m
CONFIG_IP_NF_TARGET_ECN=m
CONFIG_IP_NF_TARGET_TTL=m
CONFIG_IP_NF_RAW=m
CONFIG_IP_NF_SECURITY=m
CONFIG_IP_NF_ARPTABLES=m
CONFIG_IP_NF_ARPFILTER=m
CONFIG_IP_NF_ARP_MANGLE=m

#
# IPv6: Netfilter Configuration
#
CONFIG_NF_CONNTRACK_IPV6=m
CONFIG_IP6_NF_QUEUE=m
CONFIG_IP6_NF_IPTABLES=m
CONFIG_IP6_NF_MATCH_AH=m
CONFIG_IP6_NF_MATCH_EUI64=m
CONFIG_IP6_NF_MATCH_FRAG=m
CONFIG_IP6_NF_MATCH_OPTS=m
CONFIG_IP6_NF_MATCH_HL=m
CONFIG_IP6_NF_MATCH_IPV6HEADER=m
CONFIG_IP6_NF_MATCH_MH=m
CONFIG_IP6_NF_MATCH_RT=m
CONFIG_IP6_NF_TARGET_HL=m
CONFIG_IP6_NF_TARGET_LOG=m
CONFIG_IP6_NF_FILTER=m
CONFIG_IP6_NF_TARGET_REJECT=m
CONFIG_IP6_NF_MANGLE=m
CONFIG_IP6_NF_RAW=m
CONFIG_IP6_NF_SECURITY=m
CONFIG_BRIDGE_NF_EBTABLES=m
CONFIG_BRIDGE_EBT_BROUTE=m
CONFIG_BRIDGE_EBT_T_FILTER=m
CONFIG_BRIDGE_EBT_T_NAT=m
CONFIG_BRIDGE_EBT_802_3=m
CONFIG_BRIDGE_EBT_AMONG=m
CONFIG_BRIDGE_EBT_ARP=m
CONFIG_BRIDGE_EBT_IP=m
CONFIG_BRIDGE_EBT_IP6=m
CONFIG_BRIDGE_EBT_LIMIT=m
CONFIG_BRIDGE_EBT_MARK=m
CONFIG_BRIDGE_EBT_PKTTYPE=m
CONFIG_BRIDGE_EBT_STP=m
CONFIG_BRIDGE_EBT_VLAN=m
CONFIG_BRIDGE_EBT_ARPREPLY=m
CONFIG_BRIDGE_EBT_DNAT=m
CONFIG_BRIDGE_EBT_MARK_T=m
CONFIG_BRIDGE_EBT_REDIRECT=m
CONFIG_BRIDGE_EBT_SNAT=m
CONFIG_BRIDGE_EBT_LOG=m
CONFIG_BRIDGE_EBT_ULOG=m
CONFIG_BRIDGE_EBT_NFLOG=m
# CONFIG_IP_DCCP is not set
CONFIG_IP_SCTP=m
# CONFIG_SCTP_DBG_MSG is not set
# CONFIG_SCTP_DBG_OBJCNT is not set
# CONFIG_SCTP_HMAC_NONE is not set
# CONFIG_SCTP_HMAC_SHA1 is not set
CONFIG_SCTP_HMAC_MD5=y
CONFIG_RDS=m
CONFIG_RDS_TCP=m
# CONFIG_RDS_DEBUG is not set
# CONFIG_TIPC is not set
# CONFIG_ATM is not set
CONFIG_STP=m
CONFIG_GARP=m
CONFIG_BRIDGE=m
# CONFIG_NET_DSA is not set
CONFIG_VLAN_8021Q=m
CONFIG_VLAN_8021Q_GVRP=y
# CONFIG_DECNET is not set
CONFIG_LLC=m
CONFIG_LLC2=m
CONFIG_IPX=m
# CONFIG_IPX_INTERN is not set
CONFIG_ATALK=m
CONFIG_DEV_APPLETALK=m
CONFIG_IPDDP=m
CONFIG_IPDDP_ENCAP=y
CONFIG_IPDDP_DECAP=y
# CONFIG_X25 is not set
# CONFIG_LAPB is not set
# CONFIG_ECONET is not set
CONFIG_WAN_ROUTER=m
# CONFIG_PHONET is not set
# CONFIG_IEEE802154 is not set
CONFIG_NET_SCHED=y

#
# Queueing/Scheduling
#
CONFIG_NET_SCH_CBQ=m
CONFIG_NET_SCH_HTB=m
CONFIG_NET_SCH_HFSC=m
CONFIG_NET_SCH_PRIO=m
CONFIG_NET_SCH_MULTIQ=m
CONFIG_NET_SCH_RED=m
CONFIG_NET_SCH_SFQ=m
CONFIG_NET_SCH_TEQL=m
CONFIG_NET_SCH_TBF=m
CONFIG_NET_SCH_GRED=m
CONFIG_NET_SCH_DSMARK=m
CONFIG_NET_SCH_NETEM=m
CONFIG_NET_SCH_DRR=m
CONFIG_NET_SCH_INGRESS=m

#
# Classification
#
CONFIG_NET_CLS=y
CONFIG_NET_CLS_BASIC=m
CONFIG_NET_CLS_TCINDEX=m
CONFIG_NET_CLS_ROUTE4=m
CONFIG_NET_CLS_ROUTE=y
CONFIG_NET_CLS_FW=m
CONFIG_NET_CLS_U32=m
CONFIG_CLS_U32_PERF=y
CONFIG_CLS_U32_MARK=y
CONFIG_NET_CLS_RSVP=m
CONFIG_NET_CLS_RSVP6=m
CONFIG_NET_CLS_FLOW=m
CONFIG_NET_CLS_CGROUP=y
CONFIG_NET_EMATCH=y
CONFIG_NET_EMATCH_STACK=32
CONFIG_NET_EMATCH_CMP=m
CONFIG_NET_EMATCH_NBYTE=m
CONFIG_NET_EMATCH_U32=m
CONFIG_NET_EMATCH_META=m
CONFIG_NET_EMATCH_TEXT=m
CONFIG_NET_CLS_ACT=y
CONFIG_NET_ACT_POLICE=m
CONFIG_NET_ACT_GACT=m
CONFIG_GACT_PROB=y
CONFIG_NET_ACT_MIRRED=m
CONFIG_NET_ACT_IPT=m
CONFIG_NET_ACT_NAT=m
CONFIG_NET_ACT_PEDIT=m
CONFIG_NET_ACT_SIMP=m
CONFIG_NET_ACT_SKBEDIT=m
CONFIG_NET_CLS_IND=y
CONFIG_NET_SCH_FIFO=y
CONFIG_DCB=y

#
# Network testing
#
CONFIG_NET_PKTGEN=m
# CONFIG_NET_DROP_MONITOR is not set
# CONFIG_HAMRADIO is not set
# CONFIG_CAN is not set
# CONFIG_IRDA is not set
CONFIG_BT=m
CONFIG_BT_L2CAP=m
CONFIG_BT_SCO=m
CONFIG_BT_RFCOMM=m
CONFIG_BT_RFCOMM_TTY=y
CONFIG_BT_BNEP=m
CONFIG_BT_BNEP_MC_FILTER=y
CONFIG_BT_BNEP_PROTO_FILTER=y
CONFIG_BT_HIDP=m

#
# Bluetooth device drivers
#
CONFIG_BT_HCIBTUSB=m
CONFIG_BT_HCIBTSDIO=m
CONFIG_BT_HCIUART=m
CONFIG_BT_HCIUART_H4=y
CONFIG_BT_HCIUART_BCSP=y
CONFIG_BT_HCIUART_LL=y
CONFIG_BT_HCIBCM203X=m
CONFIG_BT_HCIBPA10X=m
CONFIG_BT_HCIBFUSB=m
CONFIG_BT_HCIDTL1=m
CONFIG_BT_HCIBT3C=m
CONFIG_BT_HCIBLUECARD=m
CONFIG_BT_HCIBTUART=m
CONFIG_BT_HCIVHCI=m
CONFIG_BT_MRVL=m
CONFIG_BT_MRVL_SDIO=m
CONFIG_BT_ATH3K=m
CONFIG_AF_RXRPC=m
# CONFIG_AF_RXRPC_DEBUG is not set
CONFIG_RXKAD=m
CONFIG_FIB_RULES=y
CONFIG_WIRELESS=y
CONFIG_WIRELESS_EXT=y
CONFIG_WEXT_CORE=y
CONFIG_WEXT_PROC=y
CONFIG_WEXT_SPY=y
CONFIG_WEXT_PRIV=y
CONFIG_CFG80211=m
# CONFIG_NL80211_TESTMODE is not set
# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set
# CONFIG_CFG80211_REG_DEBUG is not set
CONFIG_CFG80211_DEFAULT_PS=y
# CONFIG_CFG80211_DEBUGFS is not set
CONFIG_WIRELESS_OLD_REGULATORY=y
CONFIG_CFG80211_WEXT=y
# CONFIG_WIRELESS_EXT_SYSFS is not set
CONFIG_LIB80211=m
CONFIG_LIB80211_CRYPT_WEP=m
CONFIG_LIB80211_CRYPT_CCMP=m
CONFIG_LIB80211_CRYPT_TKIP=m
# CONFIG_LIB80211_DEBUG is not set
CONFIG_MAC80211=m
CONFIG_MAC80211_RC_MINSTREL=y
# CONFIG_MAC80211_RC_DEFAULT_PID is not set
CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y
CONFIG_MAC80211_RC_DEFAULT="minstrel"
# CONFIG_MAC80211_MESH is not set
CONFIG_MAC80211_LEDS=y
# CONFIG_MAC80211_DEBUGFS is not set
# CONFIG_MAC80211_DEBUG_MENU is not set
CONFIG_WIMAX=m
CONFIG_WIMAX_DEBUG_LEVEL=8
CONFIG_RFKILL=m
CONFIG_RFKILL_LEDS=y
CONFIG_RFKILL_INPUT=y
# CONFIG_NET_9P is not set

#
# Device Drivers
#

#
# Generic Driver Options
#
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
# CONFIG_DEVTMPFS is not set
CONFIG_STANDALONE=y
CONFIG_PREVENT_FIRMWARE_BUILD=y
CONFIG_FW_LOADER=y
# CONFIG_FIRMWARE_IN_KERNEL is not set
CONFIG_EXTRA_FIRMWARE=""
# CONFIG_DEBUG_DRIVER is not set
# CONFIG_DEBUG_DEVRES is not set
# CONFIG_SYS_HYPERVISOR is not set
CONFIG_CONNECTOR=m
CONFIG_MTD=m
# CONFIG_MTD_DEBUG is not set
# CONFIG_MTD_TESTS is not set
CONFIG_MTD_CONCAT=m
CONFIG_MTD_PARTITIONS=y
CONFIG_MTD_REDBOOT_PARTS=m
CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set
CONFIG_MTD_AR7_PARTS=m

#
# User Modules And Translation Layers
#
CONFIG_MTD_CHAR=m
CONFIG_MTD_BLKDEVS=m
CONFIG_MTD_BLOCK=m
CONFIG_MTD_BLOCK_RO=m
CONFIG_FTL=m
CONFIG_NFTL=m
CONFIG_NFTL_RW=y
CONFIG_INFTL=m
CONFIG_RFD_FTL=m
CONFIG_SSFDC=m
CONFIG_MTD_OOPS=m

#
# RAM/ROM/Flash chip drivers
#
CONFIG_MTD_CFI=m
CONFIG_MTD_JEDECPROBE=m
CONFIG_MTD_GEN_PROBE=m
# CONFIG_MTD_CFI_ADV_OPTIONS is not set
CONFIG_MTD_MAP_BANK_WIDTH_1=y
CONFIG_MTD_MAP_BANK_WIDTH_2=y
CONFIG_MTD_MAP_BANK_WIDTH_4=y
# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
CONFIG_MTD_CFI_I1=y
CONFIG_MTD_CFI_I2=y
# CONFIG_MTD_CFI_I4 is not set
# CONFIG_MTD_CFI_I8 is not set
CONFIG_MTD_CFI_INTELEXT=m
CONFIG_MTD_CFI_AMDSTD=m
CONFIG_MTD_CFI_STAA=m
CONFIG_MTD_CFI_UTIL=m
CONFIG_MTD_RAM=m
CONFIG_MTD_ROM=m
CONFIG_MTD_ABSENT=m

#
# Mapping drivers for chip access
#
CONFIG_MTD_COMPLEX_MAPPINGS=y
CONFIG_MTD_PHYSMAP=m
# CONFIG_MTD_PHYSMAP_COMPAT is not set
CONFIG_MTD_SC520CDP=m
CONFIG_MTD_NETSC520=m
CONFIG_MTD_TS5500=m
CONFIG_MTD_SBC_GXX=m
# CONFIG_MTD_AMD76XROM is not set
# CONFIG_MTD_ICHXROM is not set
# CONFIG_MTD_ESB2ROM is not set
# CONFIG_MTD_CK804XROM is not set
# CONFIG_MTD_SCB2_FLASH is not set
CONFIG_MTD_NETtel=m
# CONFIG_MTD_L440GX is not set
CONFIG_MTD_PCI=m
CONFIG_MTD_INTEL_VR_NOR=m
CONFIG_MTD_PLATRAM=m

#
# Self-contained MTD device drivers
#
CONFIG_MTD_PMC551=m
# CONFIG_MTD_PMC551_BUGFIX is not set
# CONFIG_MTD_PMC551_DEBUG is not set
CONFIG_MTD_DATAFLASH=m
# CONFIG_MTD_DATAFLASH_WRITE_VERIFY is not set
# CONFIG_MTD_DATAFLASH_OTP is not set
CONFIG_MTD_M25P80=m
CONFIG_M25PXX_USE_FAST_READ=y
CONFIG_MTD_SST25L=m
CONFIG_MTD_SLRAM=m
CONFIG_MTD_PHRAM=m
CONFIG_MTD_MTDRAM=m
CONFIG_MTDRAM_TOTAL_SIZE=4096
CONFIG_MTDRAM_ERASE_SIZE=128
CONFIG_MTD_BLOCK2MTD=m

#
# Disk-On-Chip Device Drivers
#
CONFIG_MTD_DOC2000=m
CONFIG_MTD_DOC2001=m
CONFIG_MTD_DOC2001PLUS=m
CONFIG_MTD_DOCPROBE=m
CONFIG_MTD_DOCECC=m
# CONFIG_MTD_DOCPROBE_ADVANCED is not set
CONFIG_MTD_DOCPROBE_ADDRESS=0
CONFIG_MTD_NAND=m
# CONFIG_MTD_NAND_VERIFY_WRITE is not set
# CONFIG_MTD_NAND_ECC_SMC is not set
# CONFIG_MTD_NAND_MUSEUM_IDS is not set
CONFIG_MTD_NAND_IDS=m
CONFIG_MTD_NAND_DISKONCHIP=m
# CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADVANCED is not set
CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADDRESS=0
# CONFIG_MTD_NAND_DISKONCHIP_BBTWRITE is not set
CONFIG_MTD_NAND_CAFE=m
CONFIG_MTD_NAND_NANDSIM=m
CONFIG_MTD_NAND_PLATFORM=m
CONFIG_MTD_ALAUDA=m
CONFIG_MTD_ONENAND=m
CONFIG_MTD_ONENAND_VERIFY_WRITE=y
CONFIG_MTD_ONENAND_GENERIC=m
# CONFIG_MTD_ONENAND_OTP is not set
CONFIG_MTD_ONENAND_2X_PROGRAM=y
CONFIG_MTD_ONENAND_SIM=m

#
# LPDDR flash memory drivers
#
CONFIG_MTD_LPDDR=m
CONFIG_MTD_QINFO_PROBE=m

#
# UBI - Unsorted block images
#
CONFIG_MTD_UBI=m
CONFIG_MTD_UBI_WL_THRESHOLD=4096
CONFIG_MTD_UBI_BEB_RESERVE=1
# CONFIG_MTD_UBI_GLUEBI is not set

#
# UBI debugging options
#
# CONFIG_MTD_UBI_DEBUG is not set
# CONFIG_PARPORT is not set
CONFIG_PNP=y
# CONFIG_PNP_DEBUG_MESSAGES is not set

#
# Protocols
#
CONFIG_PNPACPI=y
CONFIG_BLK_DEV=y
# CONFIG_BLK_DEV_FD is not set
# CONFIG_BLK_CPQ_DA is not set
# CONFIG_BLK_CPQ_CISS_DA is not set
# CONFIG_BLK_DEV_DAC960 is not set
# CONFIG_BLK_DEV_UMEM is not set
# CONFIG_BLK_DEV_COW_COMMON is not set
CONFIG_BLK_DEV_LOOP=m
CONFIG_BLK_DEV_CRYPTOLOOP=m
# CONFIG_BLK_DEV_DRBD is not set
CONFIG_BLK_DEV_NBD=m
CONFIG_BLK_DEV_OSD=m
# CONFIG_BLK_DEV_SX8 is not set
# CONFIG_BLK_DEV_UB is not set
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_COUNT=16
CONFIG_BLK_DEV_RAM_SIZE=8192
# CONFIG_BLK_DEV_XIP is not set
CONFIG_CDROM_PKTCDVD=m
CONFIG_CDROM_PKTCDVD_BUFFERS=8
# CONFIG_CDROM_PKTCDVD_WCACHE is not set
CONFIG_ATA_OVER_ETH=m
CONFIG_VIRTIO_BLK=m
# CONFIG_BLK_DEV_HD is not set
CONFIG_MISC_DEVICES=y
# CONFIG_AD525X_DPOT is not set
# CONFIG_IBM_ASM is not set
CONFIG_HWLAT_DETECTOR=m
# CONFIG_PHANTOM is not set
# CONFIG_SGI_IOC4 is not set
CONFIG_TIFM_CORE=m
# CONFIG_TIFM_7XX1 is not set
# CONFIG_ICS932S401 is not set
CONFIG_ENCLOSURE_SERVICES=m
# CONFIG_CS5535_MFGPT is not set
# CONFIG_HP_ILO is not set
# CONFIG_ISL29003 is not set
CONFIG_DS1682=m
# CONFIG_TI_DAC7512 is not set
# CONFIG_C2PORT is not set

#
# EEPROM support
#
CONFIG_EEPROM_AT24=m
CONFIG_EEPROM_AT25=m
CONFIG_EEPROM_LEGACY=m
CONFIG_EEPROM_MAX6875=m
CONFIG_EEPROM_93CX6=m
CONFIG_CB710_CORE=m
# CONFIG_CB710_DEBUG is not set
CONFIG_CB710_DEBUG_ASSUMPTIONS=y
CONFIG_IWMC3200TOP=m
# CONFIG_IWMC3200TOP_DEBUG is not set
# CONFIG_IWMC3200TOP_DEBUGFS is not set
CONFIG_HAVE_IDE=y
CONFIG_IDE=m

#
# Please see Documentation/ide/ide.txt for help/info on IDE drives
#
CONFIG_IDE_XFER_MODE=y
CONFIG_IDE_ATAPI=y
# CONFIG_BLK_DEV_IDE_SATA is not set
CONFIG_IDE_GD=m
CONFIG_IDE_GD_ATA=y
CONFIG_IDE_GD_ATAPI=y
CONFIG_BLK_DEV_IDECS=m
CONFIG_BLK_DEV_DELKIN=m
CONFIG_BLK_DEV_IDECD=m
CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS=y
CONFIG_BLK_DEV_IDETAPE=m
CONFIG_BLK_DEV_IDEACPI=y
# CONFIG_IDE_TASK_IOCTL is not set
CONFIG_IDE_PROC_FS=y

#
# IDE chipset support/bugfixes
#
# CONFIG_IDE_GENERIC is not set
# CONFIG_BLK_DEV_PLATFORM is not set
# CONFIG_BLK_DEV_CMD640 is not set
# CONFIG_BLK_DEV_IDEPNP is not set
CONFIG_BLK_DEV_IDEDMA_SFF=y

#
# PCI IDE chipsets support
#
CONFIG_BLK_DEV_IDEPCI=y
# CONFIG_BLK_DEV_GENERIC is not set
# CONFIG_BLK_DEV_OPTI621 is not set
# CONFIG_BLK_DEV_RZ1000 is not set
CONFIG_BLK_DEV_IDEDMA_PCI=y
# CONFIG_BLK_DEV_AEC62XX is not set
# CONFIG_BLK_DEV_ALI15X3 is not set
# CONFIG_BLK_DEV_AMD74XX is not set
# CONFIG_BLK_DEV_ATIIXP is not set
# CONFIG_BLK_DEV_CMD64X is not set
# CONFIG_BLK_DEV_TRIFLEX is not set
# CONFIG_BLK_DEV_CS5520 is not set
# CONFIG_BLK_DEV_CS5530 is not set
# CONFIG_BLK_DEV_HPT366 is not set
# CONFIG_BLK_DEV_JMICRON is not set
# CONFIG_BLK_DEV_SC1200 is not set
CONFIG_BLK_DEV_PIIX=m
# CONFIG_BLK_DEV_IT8172 is not set
# CONFIG_BLK_DEV_IT8213 is not set
# CONFIG_BLK_DEV_IT821X is not set
# CONFIG_BLK_DEV_NS87415 is not set
# CONFIG_BLK_DEV_PDC202XX_OLD is not set
# CONFIG_BLK_DEV_PDC202XX_NEW is not set
# CONFIG_BLK_DEV_SVWKS is not set
# CONFIG_BLK_DEV_SIIMAGE is not set
# CONFIG_BLK_DEV_SIS5513 is not set
# CONFIG_BLK_DEV_SLC90E66 is not set
# CONFIG_BLK_DEV_TRM290 is not set
# CONFIG_BLK_DEV_VIA82CXXX is not set
# CONFIG_BLK_DEV_TC86C001 is not set
CONFIG_BLK_DEV_IDEDMA=y

#
# SCSI device support
#
CONFIG_RAID_ATTRS=m
CONFIG_SCSI=m
CONFIG_SCSI_DMA=y
CONFIG_SCSI_TGT=m
CONFIG_SCSI_NETLINK=y
# CONFIG_SCSI_PROC_FS is not set

#
# SCSI support type (disk, tape, CD-ROM)
#
CONFIG_BLK_DEV_SD=m
CONFIG_CHR_DEV_ST=m
CONFIG_CHR_DEV_OSST=m
CONFIG_BLK_DEV_SR=m
CONFIG_BLK_DEV_SR_VENDOR=y
CONFIG_CHR_DEV_SG=m
CONFIG_CHR_DEV_SCH=m
CONFIG_SCSI_ENCLOSURE=m
CONFIG_SCSI_MULTI_LUN=y
CONFIG_SCSI_CONSTANTS=y
CONFIG_SCSI_LOGGING=y
CONFIG_SCSI_SCAN_ASYNC=y
CONFIG_SCSI_WAIT_SCAN=m

#
# SCSI Transports
#
CONFIG_SCSI_SPI_ATTRS=m
CONFIG_SCSI_FC_ATTRS=m
CONFIG_SCSI_FC_TGT_ATTRS=y
CONFIG_SCSI_ISCSI_ATTRS=m
CONFIG_SCSI_SAS_ATTRS=m
CONFIG_SCSI_SAS_LIBSAS=m
CONFIG_SCSI_SAS_ATA=y
CONFIG_SCSI_SAS_HOST_SMP=y
# CONFIG_SCSI_SAS_LIBSAS_DEBUG is not set
CONFIG_SCSI_SRP_ATTRS=m
CONFIG_SCSI_SRP_TGT_ATTRS=y
CONFIG_SCSI_LOWLEVEL=y
# CONFIG_ISCSI_TCP is not set
# CONFIG_SCSI_BNX2_ISCSI is not set
# CONFIG_BE2ISCSI is not set
# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
# CONFIG_SCSI_HPSA is not set
# CONFIG_SCSI_3W_9XXX is not set
# CONFIG_SCSI_3W_SAS is not set
# CONFIG_SCSI_ACARD is not set
# CONFIG_SCSI_AACRAID is not set
# CONFIG_SCSI_AIC7XXX is not set
# CONFIG_SCSI_AIC7XXX_OLD is not set
# CONFIG_SCSI_AIC79XX is not set
# CONFIG_SCSI_AIC94XX is not set
# CONFIG_SCSI_MVSAS is not set
# CONFIG_SCSI_DPT_I2O is not set
# CONFIG_SCSI_ADVANSYS is not set
# CONFIG_SCSI_ARCMSR is not set
# CONFIG_MEGARAID_NEWGEN is not set
# CONFIG_MEGARAID_LEGACY is not set
# CONFIG_MEGARAID_SAS is not set
# CONFIG_SCSI_MPT2SAS is not set
# CONFIG_SCSI_HPTIOP is not set
# CONFIG_SCSI_BUSLOGIC is not set
CONFIG_VMWARE_PVSCSI=m
CONFIG_LIBFC=m
CONFIG_LIBFCOE=m
# CONFIG_FCOE is not set
# CONFIG_FCOE_FNIC is not set
# CONFIG_SCSI_DMX3191D is not set
# CONFIG_SCSI_EATA is not set
# CONFIG_SCSI_FUTURE_DOMAIN is not set
# CONFIG_SCSI_GDTH is not set
# CONFIG_SCSI_IPS is not set
# CONFIG_SCSI_INITIO is not set
# CONFIG_SCSI_INIA100 is not set
# CONFIG_SCSI_STEX is not set
# CONFIG_SCSI_SYM53C8XX_2 is not set
# CONFIG_SCSI_IPR is not set
# CONFIG_SCSI_QLOGIC_1280 is not set
# CONFIG_SCSI_QLA_FC is not set
# CONFIG_SCSI_QLA_ISCSI is not set
# CONFIG_SCSI_LPFC is not set
# CONFIG_SCSI_DC395x is not set
# CONFIG_SCSI_DC390T is not set
CONFIG_SCSI_DEBUG=m
# CONFIG_SCSI_PMCRAID is not set
# CONFIG_SCSI_PM8001 is not set
CONFIG_SCSI_SRP=m
# CONFIG_SCSI_BFA_FC is not set
CONFIG_SCSI_LOWLEVEL_PCMCIA=y
CONFIG_PCMCIA_FDOMAIN=m
CONFIG_PCMCIA_QLOGIC=m
CONFIG_PCMCIA_SYM53C500=m
CONFIG_SCSI_DH=m
CONFIG_SCSI_DH_RDAC=m
CONFIG_SCSI_DH_HP_SW=m
CONFIG_SCSI_DH_EMC=m
CONFIG_SCSI_DH_ALUA=m
CONFIG_SCSI_OSD_INITIATOR=m
CONFIG_SCSI_OSD_ULD=m
CONFIG_SCSI_OSD_DPRINT_SENSE=1
# CONFIG_SCSI_OSD_DEBUG is not set
CONFIG_ATA=m
# CONFIG_ATA_NONSTANDARD is not set
CONFIG_ATA_VERBOSE_ERROR=y
CONFIG_ATA_ACPI=y
CONFIG_SATA_PMP=y
CONFIG_SATA_AHCI=m
# CONFIG_SATA_SIL24 is not set
CONFIG_ATA_SFF=y
# CONFIG_SATA_SVW is not set
# CONFIG_ATA_PIIX is not set
# CONFIG_SATA_MV is not set
# CONFIG_SATA_NV is not set
# CONFIG_PDC_ADMA is not set
# CONFIG_SATA_QSTOR is not set
# CONFIG_SATA_PROMISE is not set
# CONFIG_SATA_SX4 is not set
# CONFIG_SATA_SIL is not set
# CONFIG_SATA_SIS is not set
# CONFIG_SATA_ULI is not set
# CONFIG_SATA_VIA is not set
# CONFIG_SATA_VITESSE is not set
# CONFIG_SATA_INIC162X is not set
# CONFIG_PATA_ACPI is not set
# CONFIG_PATA_ALI is not set
# CONFIG_PATA_AMD is not set
# CONFIG_PATA_ARTOP is not set
# CONFIG_PATA_ATP867X is not set
# CONFIG_PATA_ATIIXP is not set
# CONFIG_PATA_CMD640_PCI is not set
# CONFIG_PATA_CMD64X is not set
# CONFIG_PATA_CS5520 is not set
# CONFIG_PATA_CS5530 is not set
# CONFIG_PATA_CYPRESS is not set
# CONFIG_PATA_EFAR is not set
CONFIG_ATA_GENERIC=m
# CONFIG_PATA_HPT366 is not set
# CONFIG_PATA_HPT37X is not set
# CONFIG_PATA_HPT3X2N is not set
# CONFIG_PATA_HPT3X3 is not set
# CONFIG_PATA_IT821X is not set
# CONFIG_PATA_IT8213 is not set
# CONFIG_PATA_JMICRON is not set
# CONFIG_PATA_TRIFLEX is not set
# CONFIG_PATA_MARVELL is not set
# CONFIG_PATA_MPIIX is not set
# CONFIG_PATA_OLDPIIX is not set
# CONFIG_PATA_NETCELL is not set
# CONFIG_PATA_NINJA32 is not set
# CONFIG_PATA_NS87410 is not set
# CONFIG_PATA_NS87415 is not set
# CONFIG_PATA_OPTI is not set
# CONFIG_PATA_OPTIDMA is not set
CONFIG_PATA_PCMCIA=m
# CONFIG_PATA_PDC2027X is not set
# CONFIG_PATA_PDC_OLD is not set
# CONFIG_PATA_RADISYS is not set
# CONFIG_PATA_RDC is not set
# CONFIG_PATA_RZ1000 is not set
# CONFIG_PATA_SC1200 is not set
# CONFIG_PATA_SERVERWORKS is not set
# CONFIG_PATA_SIL680 is not set
# CONFIG_PATA_SIS is not set
# CONFIG_PATA_TOSHIBA is not set
# CONFIG_PATA_VIA is not set
# CONFIG_PATA_WINBOND is not set
# CONFIG_PATA_SCH is not set
CONFIG_MD=y
# CONFIG_BLK_DEV_MD is not set
CONFIG_BLK_DEV_DM=m
# CONFIG_DM_DEBUG is not set
CONFIG_DM_CRYPT=m
CONFIG_DM_SNAPSHOT=m
CONFIG_DM_MIRROR=m
# CONFIG_DM_LOG_USERSPACE is not set
CONFIG_DM_ZERO=m
CONFIG_DM_MULTIPATH=m
# CONFIG_DM_MULTIPATH_QL is not set
# CONFIG_DM_MULTIPATH_ST is not set
CONFIG_DM_DELAY=m
CONFIG_DM_UEVENT=y
# CONFIG_FUSION is not set

#
# IEEE 1394 (FireWire) support
#

#
# You can enable one or both FireWire driver stacks.
#

#
# The newer stack is recommended.
#
# CONFIG_FIREWIRE is not set
CONFIG_IEEE1394=m
CONFIG_IEEE1394_OHCI1394=m
# CONFIG_IEEE1394_PCILYNX is not set
CONFIG_IEEE1394_SBP2=m
# CONFIG_IEEE1394_SBP2_PHYS_DMA is not set
CONFIG_IEEE1394_ETH1394_ROM_ENTRY=y
CONFIG_IEEE1394_ETH1394=m
CONFIG_IEEE1394_RAWIO=m
CONFIG_IEEE1394_VIDEO1394=m
# CONFIG_IEEE1394_DV1394 is not set
# CONFIG_IEEE1394_VERBOSEDEBUG is not set
CONFIG_I2O=m
CONFIG_I2O_LCT_NOTIFY_ON_CHANGES=y
CONFIG_I2O_EXT_ADAPTEC=y
CONFIG_I2O_EXT_ADAPTEC_DMA64=y
CONFIG_I2O_CONFIG=m
CONFIG_I2O_CONFIG_OLD_IOCTL=y
CONFIG_I2O_BUS=m
CONFIG_I2O_BLOCK=m
CONFIG_I2O_SCSI=m
CONFIG_I2O_PROC=m
# CONFIG_MACINTOSH_DRIVERS is not set
CONFIG_NETDEVICES=y
CONFIG_IFB=m
CONFIG_DUMMY=m
CONFIG_BONDING=m
CONFIG_MACVLAN=m
CONFIG_EQUALIZER=m
CONFIG_TUN=m
CONFIG_VETH=m
# CONFIG_NET_SB1000 is not set
# CONFIG_ARCNET is not set
CONFIG_PHYLIB=m

#
# MII PHY device drivers
#
CONFIG_MARVELL_PHY=m
CONFIG_DAVICOM_PHY=m
CONFIG_QSEMI_PHY=m
CONFIG_LXT_PHY=m
CONFIG_CICADA_PHY=m
CONFIG_VITESSE_PHY=m
CONFIG_SMSC_PHY=m
CONFIG_BROADCOM_PHY=m
CONFIG_ICPLUS_PHY=m
CONFIG_REALTEK_PHY=m
CONFIG_NATIONAL_PHY=m
CONFIG_STE10XP=m
CONFIG_LSI_ET1011C_PHY=m
CONFIG_MDIO_BITBANG=m
# CONFIG_NET_ETHERNET is not set
CONFIG_MII=m
CONFIG_NETDEV_1000=y
CONFIG_ACENIC=m
# CONFIG_ACENIC_OMIT_TIGON_I is not set
CONFIG_DL2K=m
CONFIG_E1000=m
CONFIG_E1000E=m
CONFIG_IP1000=m
CONFIG_IGB=m
CONFIG_IGBVF=m
CONFIG_NS83820=m
CONFIG_HAMACHI=m
CONFIG_YELLOWFIN=m
CONFIG_R8169=m
CONFIG_R8169_VLAN=y
CONFIG_SIS190=m
CONFIG_SKGE=m
# CONFIG_SKGE_DEBUG is not set
CONFIG_SKY2=m
# CONFIG_SKY2_DEBUG is not set
CONFIG_VIA_VELOCITY=m
CONFIG_TIGON3=m
CONFIG_BNX2=m
# CONFIG_CNIC is not set
CONFIG_QLA3XXX=m
CONFIG_ATL1=m
CONFIG_ATL1E=m
CONFIG_ATL1C=m
CONFIG_JME=m
# CONFIG_NETDEV_10000 is not set
# CONFIG_TR is not set
CONFIG_WLAN=y
CONFIG_PCMCIA_RAYCS=m
CONFIG_LIBERTAS_THINFIRM=m
CONFIG_LIBERTAS_THINFIRM_USB=m
CONFIG_AIRO=m
CONFIG_ATMEL=m
CONFIG_PCI_ATMEL=m
CONFIG_PCMCIA_ATMEL=m
CONFIG_AT76C50X_USB=m
CONFIG_AIRO_CS=m
CONFIG_PCMCIA_WL3501=m
# CONFIG_PRISM54 is not set
CONFIG_USB_ZD1201=m
CONFIG_USB_NET_RNDIS_WLAN=m
CONFIG_RTL8180=m
CONFIG_RTL8187=m
CONFIG_RTL8187_LEDS=y
CONFIG_ADM8211=m
CONFIG_MAC80211_HWSIM=m
CONFIG_MWL8K=m
CONFIG_ATH_COMMON=m
# CONFIG_ATH_DEBUG is not set
CONFIG_ATH5K=m
# CONFIG_ATH5K_DEBUG is not set
CONFIG_ATH9K_HW=m
CONFIG_ATH9K_COMMON=m
CONFIG_ATH9K=m
# CONFIG_ATH9K_DEBUGFS is not set
CONFIG_AR9170_USB=m
CONFIG_AR9170_LEDS=y
CONFIG_B43=m
CONFIG_B43_PCI_AUTOSELECT=y
CONFIG_B43_PCICORE_AUTOSELECT=y
CONFIG_B43_PCMCIA=y
CONFIG_B43_SDIO=y
CONFIG_B43_PIO=y
CONFIG_B43_PHY_LP=y
CONFIG_B43_LEDS=y
CONFIG_B43_HWRNG=y
# CONFIG_B43_DEBUG is not set
CONFIG_B43LEGACY=m
CONFIG_B43LEGACY_PCI_AUTOSELECT=y
CONFIG_B43LEGACY_PCICORE_AUTOSELECT=y
CONFIG_B43LEGACY_LEDS=y
CONFIG_B43LEGACY_HWRNG=y
CONFIG_B43LEGACY_DEBUG=y
CONFIG_B43LEGACY_DMA=y
CONFIG_B43LEGACY_PIO=y
CONFIG_B43LEGACY_DMA_AND_PIO_MODE=y
# CONFIG_B43LEGACY_DMA_MODE is not set
# CONFIG_B43LEGACY_PIO_MODE is not set
CONFIG_HOSTAP=m
CONFIG_HOSTAP_FIRMWARE=y
# CONFIG_HOSTAP_FIRMWARE_NVRAM is not set
CONFIG_HOSTAP_PLX=m
CONFIG_HOSTAP_PCI=m
CONFIG_HOSTAP_CS=m
CONFIG_IPW2100=m
CONFIG_IPW2100_MONITOR=y
# CONFIG_IPW2100_DEBUG is not set
CONFIG_IPW2200=m
CONFIG_IPW2200_MONITOR=y
CONFIG_IPW2200_RADIOTAP=y
CONFIG_IPW2200_PROMISCUOUS=y
CONFIG_IPW2200_QOS=y
# CONFIG_IPW2200_DEBUG is not set
CONFIG_LIBIPW=m
# CONFIG_LIBIPW_DEBUG is not set
CONFIG_IWLWIFI=m
CONFIG_IWLWIFI_SPECTRUM_MEASUREMENT=y
# CONFIG_IWLWIFI_DEBUG is not set
# CONFIG_IWLWIFI_DEVICE_TRACING is not set
CONFIG_IWLAGN=m
CONFIG_IWL4965=y
CONFIG_IWL5000=y
CONFIG_IWL3945=m
CONFIG_IWL3945_SPECTRUM_MEASUREMENT=y
CONFIG_IWM=m
# CONFIG_IWM_DEBUG is not set
CONFIG_LIBERTAS=m
CONFIG_LIBERTAS_USB=m
CONFIG_LIBERTAS_CS=m
CONFIG_LIBERTAS_SDIO=m
CONFIG_LIBERTAS_SPI=m
# CONFIG_LIBERTAS_DEBUG is not set
CONFIG_HERMES=m
CONFIG_HERMES_CACHE_FW_ON_INIT=y
CONFIG_PLX_HERMES=m
CONFIG_TMD_HERMES=m
CONFIG_NORTEL_HERMES=m
CONFIG_PCI_HERMES=m
CONFIG_PCMCIA_HERMES=m
CONFIG_PCMCIA_SPECTRUM=m
CONFIG_P54_COMMON=m
CONFIG_P54_USB=m
CONFIG_P54_PCI=m
CONFIG_P54_SPI=m
CONFIG_P54_LEDS=y
CONFIG_RT2X00=m
CONFIG_RT2400PCI=m
CONFIG_RT2500PCI=m
CONFIG_RT61PCI=m
CONFIG_RT2800PCI_PCI=m
CONFIG_RT2800PCI=m
CONFIG_RT2500USB=m
CONFIG_RT73USB=m
CONFIG_RT2800USB=m
CONFIG_RT2800_LIB=m
CONFIG_RT2X00_LIB_PCI=m
CONFIG_RT2X00_LIB_USB=m
CONFIG_RT2X00_LIB=m
CONFIG_RT2X00_LIB_HT=y
CONFIG_RT2X00_LIB_FIRMWARE=y
CONFIG_RT2X00_LIB_CRYPTO=y
CONFIG_RT2X00_LIB_LEDS=y
# CONFIG_RT2X00_DEBUG is not set
CONFIG_WL12XX=m
CONFIG_WL1251=m
CONFIG_WL1251_SPI=m
CONFIG_WL1251_SDIO=m
CONFIG_WL1271=m
CONFIG_ZD1211RW=m
# CONFIG_ZD1211RW_DEBUG is not set

#
# WiMAX Wireless Broadband devices
#
CONFIG_WIMAX_I2400M=m
CONFIG_WIMAX_I2400M_USB=m
CONFIG_WIMAX_I2400M_SDIO=m
# CONFIG_WIMAX_IWMC3200_SDIO is not set
CONFIG_WIMAX_I2400M_DEBUG_LEVEL=8

#
# USB Network Adapters
#
CONFIG_USB_CATC=m
CONFIG_USB_KAWETH=m
CONFIG_USB_PEGASUS=m
CONFIG_USB_RTL8150=m
CONFIG_USB_USBNET=m
CONFIG_USB_NET_AX8817X=m
CONFIG_USB_NET_CDCETHER=m
CONFIG_USB_NET_CDC_EEM=m
CONFIG_USB_NET_DM9601=m
CONFIG_USB_NET_SMSC95XX=m
CONFIG_USB_NET_GL620A=m
CONFIG_USB_NET_NET1080=m
CONFIG_USB_NET_PLUSB=m
CONFIG_USB_NET_MCS7830=m
CONFIG_USB_NET_RNDIS_HOST=m
CONFIG_USB_NET_CDC_SUBSET=m
CONFIG_USB_ALI_M5632=y
CONFIG_USB_AN2720=y
CONFIG_USB_BELKIN=y
CONFIG_USB_ARMLINUX=y
CONFIG_USB_EPSON2888=y
CONFIG_USB_KC2190=y
CONFIG_USB_NET_ZAURUS=m
CONFIG_USB_HSO=m
CONFIG_USB_NET_INT51X1=m
CONFIG_NET_PCMCIA=y
CONFIG_PCMCIA_3C589=m
CONFIG_PCMCIA_3C574=m
CONFIG_PCMCIA_FMVJ18X=m
CONFIG_PCMCIA_PCNET=m
CONFIG_PCMCIA_NMCLAN=m
CONFIG_PCMCIA_SMC91C92=m
CONFIG_PCMCIA_XIRC2PS=m
CONFIG_PCMCIA_AXNET=m
# CONFIG_WAN is not set
# CONFIG_FDDI is not set
# CONFIG_HIPPI is not set
CONFIG_PPP=m
CONFIG_PPP_MULTILINK=y
CONFIG_PPP_FILTER=y
CONFIG_PPP_ASYNC=m
CONFIG_PPP_SYNC_TTY=m
CONFIG_PPP_DEFLATE=m
CONFIG_PPP_BSDCOMP=m
CONFIG_PPP_MPPE=m
CONFIG_PPPOE=m
CONFIG_PPPOL2TP=m
CONFIG_SLIP=m
CONFIG_SLIP_COMPRESSED=y
CONFIG_SLHC=m
CONFIG_SLIP_SMART=y
CONFIG_SLIP_MODE_SLIP6=y
CONFIG_NET_FC=y
CONFIG_NETCONSOLE=m
CONFIG_NETCONSOLE_DYNAMIC=y
CONFIG_NETPOLL=y
# CONFIG_NETPOLL_TRAP is not set
CONFIG_NET_POLL_CONTROLLER=y
CONFIG_VIRTIO_NET=m
CONFIG_VMXNET3=m
# CONFIG_ISDN is not set
# CONFIG_PHONE is not set

#
# Input device support
#
CONFIG_INPUT=y
CONFIG_INPUT_FF_MEMLESS=m
CONFIG_INPUT_POLLDEV=m
# CONFIG_INPUT_SPARSEKMAP is not set

#
# Userland interfaces
#
CONFIG_INPUT_MOUSEDEV=y
CONFIG_INPUT_MOUSEDEV_PSAUX=y
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1280
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=800
CONFIG_INPUT_JOYDEV=m
CONFIG_INPUT_EVDEV=m
# CONFIG_INPUT_EVBUG is not set

#
# Input Device Drivers
#
CONFIG_INPUT_KEYBOARD=y
# CONFIG_KEYBOARD_ADP5588 is not set
CONFIG_KEYBOARD_ATKBD=y
# CONFIG_QT2160 is not set
# CONFIG_KEYBOARD_LKKBD is not set
# CONFIG_KEYBOARD_LM8323 is not set
# CONFIG_KEYBOARD_MAX7359 is not set
# CONFIG_KEYBOARD_NEWTON is not set
# CONFIG_KEYBOARD_OPENCORES is not set
# CONFIG_KEYBOARD_STOWAWAY is not set
# CONFIG_KEYBOARD_SUNKBD is not set
# CONFIG_KEYBOARD_XTKBD is not set
CONFIG_INPUT_MOUSE=y
CONFIG_MOUSE_PS2=m
CONFIG_MOUSE_PS2_ALPS=y
CONFIG_MOUSE_PS2_LOGIPS2PP=y
CONFIG_MOUSE_PS2_SYNAPTICS=y
CONFIG_MOUSE_PS2_LIFEBOOK=y
CONFIG_MOUSE_PS2_TRACKPOINT=y
# CONFIG_MOUSE_PS2_ELANTECH is not set
# CONFIG_MOUSE_PS2_SENTELIC is not set
# CONFIG_MOUSE_PS2_TOUCHKIT is not set
CONFIG_MOUSE_SERIAL=m
# CONFIG_MOUSE_APPLETOUCH is not set
# CONFIG_MOUSE_BCM5974 is not set
# CONFIG_MOUSE_VSXXXAA is not set
CONFIG_MOUSE_SYNAPTICS_I2C=m
CONFIG_INPUT_JOYSTICK=y
CONFIG_JOYSTICK_ANALOG=m
CONFIG_JOYSTICK_A3D=m
CONFIG_JOYSTICK_ADI=m
CONFIG_JOYSTICK_COBRA=m
CONFIG_JOYSTICK_GF2K=m
CONFIG_JOYSTICK_GRIP=m
CONFIG_JOYSTICK_GRIP_MP=m
CONFIG_JOYSTICK_GUILLEMOT=m
CONFIG_JOYSTICK_INTERACT=m
CONFIG_JOYSTICK_SIDEWINDER=m
CONFIG_JOYSTICK_TMDC=m
CONFIG_JOYSTICK_IFORCE=m
CONFIG_JOYSTICK_IFORCE_USB=y
CONFIG_JOYSTICK_IFORCE_232=y
CONFIG_JOYSTICK_WARRIOR=m
CONFIG_JOYSTICK_MAGELLAN=m
CONFIG_JOYSTICK_SPACEORB=m
CONFIG_JOYSTICK_SPACEBALL=m
CONFIG_JOYSTICK_STINGER=m
CONFIG_JOYSTICK_TWIDJOY=m
CONFIG_JOYSTICK_ZHENHUA=m
CONFIG_JOYSTICK_JOYDUMP=m
CONFIG_JOYSTICK_XPAD=m
CONFIG_JOYSTICK_XPAD_FF=y
CONFIG_JOYSTICK_XPAD_LEDS=y
# CONFIG_INPUT_TABLET is not set
# CONFIG_INPUT_TOUCHSCREEN is not set
CONFIG_INPUT_MISC=y
CONFIG_INPUT_PCSPKR=m
# CONFIG_INPUT_APANEL is not set
CONFIG_INPUT_ATLAS_BTNS=m
CONFIG_INPUT_ATI_REMOTE=m
CONFIG_INPUT_ATI_REMOTE2=m
CONFIG_INPUT_KEYSPAN_REMOTE=m
# CONFIG_INPUT_POWERMATE is not set
# CONFIG_INPUT_YEALINK is not set
# CONFIG_INPUT_CM109 is not set
CONFIG_INPUT_UINPUT=m
CONFIG_INPUT_WINBOND_CIR=m
# CONFIG_INPUT_PCF50633_PMU is not set

#
# Hardware I/O ports
#
CONFIG_SERIO=y
CONFIG_SERIO_I8042=y
CONFIG_SERIO_SERPORT=m
# CONFIG_SERIO_CT82C710 is not set
CONFIG_SERIO_PCIPS2=m
CONFIG_SERIO_LIBPS2=y
CONFIG_SERIO_RAW=m
# CONFIG_SERIO_ALTERA_PS2 is not set
CONFIG_GAMEPORT=m
# CONFIG_GAMEPORT_NS558 is not set
# CONFIG_GAMEPORT_L4 is not set
# CONFIG_GAMEPORT_EMU10K1 is not set
# CONFIG_GAMEPORT_FM801 is not set

#
# Character devices
#
CONFIG_VT=y
CONFIG_CONSOLE_TRANSLATIONS=y
CONFIG_VT_CONSOLE=y
CONFIG_HW_CONSOLE=y
# CONFIG_VT_HW_CONSOLE_BINDING is not set
CONFIG_DEVKMEM=y
# CONFIG_SERIAL_NONSTANDARD is not set
CONFIG_NOZOMI=m

#
# Serial drivers
#
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_FIX_EARLYCON_MEM=y
CONFIG_SERIAL_8250_PCI=y
CONFIG_SERIAL_8250_PNP=y
CONFIG_SERIAL_8250_CS=m
CONFIG_SERIAL_8250_NR_UARTS=32
CONFIG_SERIAL_8250_RUNTIME_UARTS=4
CONFIG_SERIAL_8250_EXTENDED=y
CONFIG_SERIAL_8250_MANY_PORTS=y
CONFIG_SERIAL_8250_SHARE_IRQ=y
# CONFIG_SERIAL_8250_DETECT_IRQ is not set
CONFIG_SERIAL_8250_RSA=y

#
# Non-8250 serial port support
#
CONFIG_SERIAL_MAX3100=m
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
# CONFIG_SERIAL_JSM is not set
CONFIG_UNIX98_PTYS=y
CONFIG_DEVPTS_MULTIPLE_INSTANCES=y
# CONFIG_LEGACY_PTYS is not set
# CONFIG_VIRTIO_CONSOLE is not set
CONFIG_IPMI_HANDLER=m
# CONFIG_IPMI_PANIC_EVENT is not set
CONFIG_IPMI_DEVICE_INTERFACE=m
CONFIG_IPMI_SI=m
CONFIG_IPMI_WATCHDOG=m
CONFIG_IPMI_POWEROFF=m
CONFIG_HW_RANDOM=m
CONFIG_HW_RANDOM_TIMERIOMEM=m
# CONFIG_HW_RANDOM_INTEL is not set
# CONFIG_HW_RANDOM_AMD is not set
# CONFIG_HW_RANDOM_VIA is not set
# CONFIG_HW_RANDOM_VIRTIO is not set
CONFIG_NVRAM=m
# CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set

#
# PCMCIA character devices
#
CONFIG_SYNCLINK_CS=m
CONFIG_CARDMAN_4000=m
CONFIG_CARDMAN_4040=m
CONFIG_IPWIRELESS=m
# CONFIG_MWAVE is not set
# CONFIG_PC8736x_GPIO is not set
CONFIG_RAW_DRIVER=m
CONFIG_MAX_RAW_DEVS=256
CONFIG_HPET=y
CONFIG_HPET_MMAP=y
CONFIG_HANGCHECK_TIMER=m
# CONFIG_TCG_TPM is not set
# CONFIG_TELCLOCK is not set
CONFIG_DEVPORT=y
CONFIG_I2C=m
CONFIG_I2C_BOARDINFO=y
CONFIG_I2C_COMPAT=y
CONFIG_I2C_CHARDEV=m
CONFIG_I2C_HELPER_AUTO=y
CONFIG_I2C_ALGOBIT=m
CONFIG_I2C_ALGOPCA=m

#
# I2C Hardware Bus support
#

#
# PC SMBus host controller drivers
#
CONFIG_I2C_ALI1535=m
CONFIG_I2C_ALI1563=m
CONFIG_I2C_ALI15X3=m
CONFIG_I2C_AMD756=m
CONFIG_I2C_AMD756_S4882=m
CONFIG_I2C_AMD8111=m
CONFIG_I2C_I801=m
CONFIG_I2C_ISCH=m
CONFIG_I2C_PIIX4=m
CONFIG_I2C_NFORCE2=m
CONFIG_I2C_NFORCE2_S4985=m
CONFIG_I2C_SIS5595=m
CONFIG_I2C_SIS630=m
CONFIG_I2C_SIS96X=m
CONFIG_I2C_VIA=m
CONFIG_I2C_VIAPRO=m

#
# ACPI drivers
#
CONFIG_I2C_SCMI=m

#
# I2C system bus drivers (mostly embedded / system-on-chip)
#
CONFIG_I2C_OCORES=m
CONFIG_I2C_SIMTEC=m

#
# External I2C/SMBus adapter drivers
#
CONFIG_I2C_PARPORT_LIGHT=m
CONFIG_I2C_TAOS_EVM=m
CONFIG_I2C_TINY_USB=m

#
# Other I2C/SMBus bus drivers
#
CONFIG_I2C_PCA_PLATFORM=m
CONFIG_I2C_STUB=m

#
# Miscellaneous I2C Chip support
#
CONFIG_SENSORS_TSL2550=m
# CONFIG_I2C_DEBUG_CORE is not set
# CONFIG_I2C_DEBUG_ALGO is not set
# CONFIG_I2C_DEBUG_BUS is not set
# CONFIG_I2C_DEBUG_CHIP is not set
CONFIG_SPI=y
# CONFIG_SPI_DEBUG is not set
CONFIG_SPI_MASTER=y

#
# SPI Master Controller Drivers
#
CONFIG_SPI_BITBANG=m
# CONFIG_SPI_XILINX is not set
# CONFIG_SPI_DESIGNWARE is not set

#
# SPI Protocol Masters
#
CONFIG_SPI_SPIDEV=m
# CONFIG_SPI_TLE62X0 is not set

#
# PPS support
#
# CONFIG_PPS is not set
CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
# CONFIG_GPIOLIB is not set
CONFIG_W1=m
CONFIG_W1_CON=y

#
# 1-wire Bus Masters
#
CONFIG_W1_MASTER_MATROX=m
CONFIG_W1_MASTER_DS2490=m
CONFIG_W1_MASTER_DS2482=m

#
# 1-wire Slaves
#
CONFIG_W1_SLAVE_THERM=m
CONFIG_W1_SLAVE_SMEM=m
CONFIG_W1_SLAVE_DS2431=m
CONFIG_W1_SLAVE_DS2433=m
# CONFIG_W1_SLAVE_DS2433_CRC is not set
CONFIG_W1_SLAVE_DS2760=m
CONFIG_W1_SLAVE_BQ27000=m
CONFIG_POWER_SUPPLY=y
# CONFIG_POWER_SUPPLY_DEBUG is not set
CONFIG_PDA_POWER=m
CONFIG_WM8350_POWER=m
CONFIG_BATTERY_DS2760=m
# CONFIG_BATTERY_DS2782 is not set
CONFIG_BATTERY_BQ27x00=m
# CONFIG_BATTERY_MAX17040 is not set
CONFIG_CHARGER_PCF50633=m
CONFIG_HWMON=y
CONFIG_HWMON_VID=m
# CONFIG_HWMON_DEBUG_CHIP is not set

#
# Native drivers
#
CONFIG_SENSORS_ABITUGURU=m
CONFIG_SENSORS_ABITUGURU3=m
CONFIG_SENSORS_AD7414=m
CONFIG_SENSORS_AD7418=m
CONFIG_SENSORS_ADCXX=m
CONFIG_SENSORS_ADM1021=m
CONFIG_SENSORS_ADM1025=m
CONFIG_SENSORS_ADM1026=m
CONFIG_SENSORS_ADM1029=m
CONFIG_SENSORS_ADM1031=m
CONFIG_SENSORS_ADM9240=m
CONFIG_SENSORS_ADT7462=m
CONFIG_SENSORS_ADT7470=m
CONFIG_SENSORS_ADT7473=m
CONFIG_SENSORS_ADT7475=m
CONFIG_SENSORS_K8TEMP=m
# CONFIG_SENSORS_K10TEMP is not set
CONFIG_SENSORS_ASB100=m
CONFIG_SENSORS_ATXP1=m
CONFIG_SENSORS_DS1621=m
CONFIG_SENSORS_I5K_AMB=m
CONFIG_SENSORS_F71805F=m
CONFIG_SENSORS_F71882FG=m
CONFIG_SENSORS_F75375S=m
CONFIG_SENSORS_FSCHMD=m
CONFIG_SENSORS_G760A=m
CONFIG_SENSORS_GL518SM=m
CONFIG_SENSORS_GL520SM=m
CONFIG_SENSORS_CORETEMP=m
CONFIG_SENSORS_IBMAEM=m
CONFIG_SENSORS_IBMPEX=m
CONFIG_SENSORS_IT87=m
CONFIG_SENSORS_LM63=m
CONFIG_SENSORS_LM70=m
CONFIG_SENSORS_LM73=m
CONFIG_SENSORS_LM75=m
CONFIG_SENSORS_LM77=m
CONFIG_SENSORS_LM78=m
CONFIG_SENSORS_LM80=m
CONFIG_SENSORS_LM83=m
CONFIG_SENSORS_LM85=m
CONFIG_SENSORS_LM87=m
CONFIG_SENSORS_LM90=m
CONFIG_SENSORS_LM92=m
CONFIG_SENSORS_LM93=m
CONFIG_SENSORS_LTC4215=m
CONFIG_SENSORS_LTC4245=m
CONFIG_SENSORS_LM95241=m
CONFIG_SENSORS_MAX1111=m
CONFIG_SENSORS_MAX1619=m
CONFIG_SENSORS_MAX6650=m
CONFIG_SENSORS_PC87360=m
CONFIG_SENSORS_PC87427=m
CONFIG_SENSORS_PCF8591=m
CONFIG_SENSORS_SIS5595=m
CONFIG_SENSORS_DME1737=m
CONFIG_SENSORS_SMSC47M1=m
CONFIG_SENSORS_SMSC47M192=m
CONFIG_SENSORS_SMSC47B397=m
CONFIG_SENSORS_ADS7828=m
CONFIG_SENSORS_AMC6821=m
CONFIG_SENSORS_THMC50=m
CONFIG_SENSORS_TMP401=m
CONFIG_SENSORS_TMP421=m
# CONFIG_SENSORS_VIA_CPUTEMP is not set
CONFIG_SENSORS_VIA686A=m
CONFIG_SENSORS_VT1211=m
CONFIG_SENSORS_VT8231=m
CONFIG_SENSORS_W83781D=m
CONFIG_SENSORS_W83791D=m
CONFIG_SENSORS_W83792D=m
CONFIG_SENSORS_W83793=m
CONFIG_SENSORS_W83L785TS=m
CONFIG_SENSORS_W83L786NG=m
CONFIG_SENSORS_W83627HF=m
CONFIG_SENSORS_W83627EHF=m
CONFIG_SENSORS_WM8350=m
CONFIG_SENSORS_HDAPS=m
# CONFIG_SENSORS_LIS3_I2C is not set
CONFIG_SENSORS_APPLESMC=m
# CONFIG_SENSORS_MC13783_ADC is not set

#
# ACPI drivers
#
CONFIG_SENSORS_ATK0110=m
CONFIG_SENSORS_LIS3LV02D=m
CONFIG_THERMAL=m
CONFIG_THERMAL_HWMON=y
# CONFIG_WATCHDOG is not set
CONFIG_SSB_POSSIBLE=y

#
# Sonics Silicon Backplane
#
CONFIG_SSB=m
CONFIG_SSB_SPROM=y
CONFIG_SSB_BLOCKIO=y
CONFIG_SSB_PCIHOST_POSSIBLE=y
CONFIG_SSB_PCIHOST=y
CONFIG_SSB_B43_PCI_BRIDGE=y
CONFIG_SSB_PCMCIAHOST_POSSIBLE=y
CONFIG_SSB_PCMCIAHOST=y
CONFIG_SSB_SDIOHOST_POSSIBLE=y
CONFIG_SSB_SDIOHOST=y
# CONFIG_SSB_DEBUG is not set
CONFIG_SSB_DRIVER_PCICORE_POSSIBLE=y
CONFIG_SSB_DRIVER_PCICORE=y

#
# Multifunction device drivers
#
CONFIG_MFD_CORE=m
CONFIG_MFD_SM501=m
CONFIG_HTC_PASIC3=m
# CONFIG_MFD_TMIO is not set
CONFIG_MFD_WM8400=m
CONFIG_MFD_WM8350=m
CONFIG_MFD_WM8350_I2C=m
CONFIG_MFD_PCF50633=m
CONFIG_MFD_MC13783=m
CONFIG_PCF50633_ADC=m
CONFIG_PCF50633_GPIO=m
# CONFIG_AB3100_CORE is not set
# CONFIG_EZX_PCAP is not set
# CONFIG_AB4500_CORE is not set
# CONFIG_REGULATOR is not set
CONFIG_MEDIA_SUPPORT=m

#
# Multimedia core support
#
CONFIG_VIDEO_DEV=m
CONFIG_VIDEO_V4L2_COMMON=m
CONFIG_VIDEO_ALLOW_V4L1=y
CONFIG_VIDEO_V4L1_COMPAT=y
CONFIG_DVB_CORE=m
CONFIG_VIDEO_MEDIA=m

#
# Multimedia drivers
#
CONFIG_VIDEO_SAA7146=m
CONFIG_VIDEO_SAA7146_VV=m
CONFIG_IR_CORE=m
CONFIG_VIDEO_IR=m
CONFIG_MEDIA_ATTACH=y
CONFIG_MEDIA_TUNER=m
# CONFIG_MEDIA_TUNER_CUSTOMISE is not set
CONFIG_MEDIA_TUNER_SIMPLE=m
CONFIG_MEDIA_TUNER_TDA8290=m
CONFIG_MEDIA_TUNER_TDA827X=m
CONFIG_MEDIA_TUNER_TDA18271=m
CONFIG_MEDIA_TUNER_TDA9887=m
CONFIG_MEDIA_TUNER_TEA5761=m
CONFIG_MEDIA_TUNER_TEA5767=m
CONFIG_MEDIA_TUNER_MT20XX=m
CONFIG_MEDIA_TUNER_MT2060=m
CONFIG_MEDIA_TUNER_MT2266=m
CONFIG_MEDIA_TUNER_MT2131=m
CONFIG_MEDIA_TUNER_QT1010=m
CONFIG_MEDIA_TUNER_XC2028=m
CONFIG_MEDIA_TUNER_XC5000=m
CONFIG_MEDIA_TUNER_MXL5005S=m
CONFIG_MEDIA_TUNER_MXL5007T=m
CONFIG_MEDIA_TUNER_MC44S803=m
CONFIG_MEDIA_TUNER_MAX2165=m
CONFIG_VIDEO_V4L2=m
CONFIG_VIDEO_V4L1=m
CONFIG_VIDEOBUF_GEN=m
CONFIG_VIDEOBUF_DMA_SG=m
CONFIG_VIDEOBUF_VMALLOC=m
CONFIG_VIDEOBUF_DVB=m
CONFIG_VIDEO_BTCX=m
CONFIG_VIDEO_TVEEPROM=m
CONFIG_VIDEO_TUNER=m
CONFIG_VIDEO_CAPTURE_DRIVERS=y
# CONFIG_VIDEO_ADV_DEBUG is not set
# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
CONFIG_VIDEO_IR_I2C=m
CONFIG_VIDEO_TVAUDIO=m
CONFIG_VIDEO_TDA7432=m
CONFIG_VIDEO_TDA9840=m
CONFIG_VIDEO_TEA6415C=m
CONFIG_VIDEO_TEA6420=m
CONFIG_VIDEO_MSP3400=m
CONFIG_VIDEO_CS5345=m
CONFIG_VIDEO_CS53L32A=m
CONFIG_VIDEO_M52790=m
CONFIG_VIDEO_WM8775=m
CONFIG_VIDEO_WM8739=m
CONFIG_VIDEO_VP27SMPX=m
CONFIG_VIDEO_SAA6588=m
CONFIG_VIDEO_BT819=m
CONFIG_VIDEO_BT856=m
CONFIG_VIDEO_BT866=m
CONFIG_VIDEO_KS0127=m
CONFIG_VIDEO_OV7670=m
CONFIG_VIDEO_MT9V011=m
CONFIG_VIDEO_SAA7110=m
CONFIG_VIDEO_SAA711X=m
CONFIG_VIDEO_SAA717X=m
CONFIG_VIDEO_TVP5150=m
CONFIG_VIDEO_VPX3220=m
CONFIG_VIDEO_CX25840=m
CONFIG_VIDEO_CX2341X=m
CONFIG_VIDEO_SAA7127=m
CONFIG_VIDEO_SAA7185=m
CONFIG_VIDEO_ADV7170=m
CONFIG_VIDEO_ADV7175=m
CONFIG_VIDEO_UPD64031A=m
CONFIG_VIDEO_UPD64083=m
CONFIG_VIDEO_VIVI=m
CONFIG_VIDEO_BT848=m
CONFIG_VIDEO_BT848_DVB=y
CONFIG_VIDEO_CPIA=m
CONFIG_VIDEO_CPIA_USB=m
CONFIG_VIDEO_CPIA2=m
CONFIG_VIDEO_SAA5246A=m
CONFIG_VIDEO_SAA5249=m
CONFIG_VIDEO_STRADIS=m
CONFIG_VIDEO_ZORAN=m
CONFIG_VIDEO_ZORAN_DC30=m
CONFIG_VIDEO_ZORAN_ZR36060=m
CONFIG_VIDEO_ZORAN_BUZ=m
CONFIG_VIDEO_ZORAN_DC10=m
CONFIG_VIDEO_ZORAN_LML33=m
CONFIG_VIDEO_ZORAN_LML33R10=m
CONFIG_VIDEO_ZORAN_AVS6EYES=m
CONFIG_VIDEO_SAA7134=m
CONFIG_VIDEO_SAA7134_ALSA=m
CONFIG_VIDEO_SAA7134_DVB=m
CONFIG_VIDEO_MXB=m
CONFIG_VIDEO_HEXIUM_ORION=m
CONFIG_VIDEO_HEXIUM_GEMINI=m
CONFIG_VIDEO_CX88=m
CONFIG_VIDEO_CX88_ALSA=m
CONFIG_VIDEO_CX88_BLACKBIRD=m
CONFIG_VIDEO_CX88_DVB=m
CONFIG_VIDEO_CX88_MPEG=m
CONFIG_VIDEO_CX88_VP3054=m
CONFIG_VIDEO_CX23885=m
CONFIG_VIDEO_AU0828=m
CONFIG_VIDEO_IVTV=m
CONFIG_VIDEO_FB_IVTV=m
CONFIG_VIDEO_CX18=m
CONFIG_VIDEO_SAA7164=m
CONFIG_VIDEO_CAFE_CCIC=m
CONFIG_SOC_CAMERA=m
CONFIG_SOC_CAMERA_MT9M001=m
CONFIG_SOC_CAMERA_MT9M111=m
CONFIG_SOC_CAMERA_MT9T031=m
CONFIG_SOC_CAMERA_MT9T112=m
CONFIG_SOC_CAMERA_MT9V022=m
CONFIG_SOC_CAMERA_RJ54N1=m
CONFIG_SOC_CAMERA_TW9910=m
CONFIG_SOC_CAMERA_PLATFORM=m
CONFIG_SOC_CAMERA_OV772X=m
CONFIG_SOC_CAMERA_OV9640=m
CONFIG_V4L_USB_DRIVERS=y
CONFIG_USB_VIDEO_CLASS=m
CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y
CONFIG_USB_GSPCA=m
CONFIG_USB_M5602=m
CONFIG_USB_STV06XX=m
CONFIG_USB_GL860=m
CONFIG_USB_GSPCA_CONEX=m
CONFIG_USB_GSPCA_ETOMS=m
CONFIG_USB_GSPCA_FINEPIX=m
CONFIG_USB_GSPCA_JEILINJ=m
CONFIG_USB_GSPCA_MARS=m
CONFIG_USB_GSPCA_MR97310A=m
CONFIG_USB_GSPCA_OV519=m
CONFIG_USB_GSPCA_OV534=m
CONFIG_USB_GSPCA_PAC207=m
CONFIG_USB_GSPCA_PAC7302=m
CONFIG_USB_GSPCA_PAC7311=m
CONFIG_USB_GSPCA_SN9C20X=m
# CONFIG_USB_GSPCA_SN9C20X_EVDEV is not set
CONFIG_USB_GSPCA_SONIXB=m
CONFIG_USB_GSPCA_SONIXJ=m
CONFIG_USB_GSPCA_SPCA500=m
CONFIG_USB_GSPCA_SPCA501=m
CONFIG_USB_GSPCA_SPCA505=m
CONFIG_USB_GSPCA_SPCA506=m
CONFIG_USB_GSPCA_SPCA508=m
CONFIG_USB_GSPCA_SPCA561=m
CONFIG_USB_GSPCA_SQ905=m
CONFIG_USB_GSPCA_SQ905C=m
CONFIG_USB_GSPCA_STK014=m
CONFIG_USB_GSPCA_STV0680=m
CONFIG_USB_GSPCA_SUNPLUS=m
CONFIG_USB_GSPCA_T613=m
CONFIG_USB_GSPCA_TV8532=m
CONFIG_USB_GSPCA_VC032X=m
CONFIG_USB_GSPCA_ZC3XX=m
CONFIG_VIDEO_PVRUSB2=m
CONFIG_VIDEO_PVRUSB2_SYSFS=y
CONFIG_VIDEO_PVRUSB2_DVB=y
# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set
CONFIG_VIDEO_HDPVR=m
CONFIG_VIDEO_EM28XX=m
CONFIG_VIDEO_EM28XX_ALSA=m
CONFIG_VIDEO_EM28XX_DVB=m
CONFIG_VIDEO_CX231XX=m
CONFIG_VIDEO_CX231XX_ALSA=m
CONFIG_VIDEO_CX231XX_DVB=m
CONFIG_VIDEO_USBVISION=m
CONFIG_VIDEO_USBVIDEO=m
CONFIG_USB_VICAM=m
CONFIG_USB_IBMCAM=m
CONFIG_USB_KONICAWC=m
CONFIG_USB_QUICKCAM_MESSENGER=m
CONFIG_USB_ET61X251=m
CONFIG_VIDEO_OVCAMCHIP=m
# CONFIG_USB_W9968CF is not set
CONFIG_USB_OV511=m
CONFIG_USB_SE401=m
CONFIG_USB_SN9C102=m
CONFIG_USB_STV680=m
CONFIG_USB_ZC0301=m
CONFIG_USB_PWC=m
# CONFIG_USB_PWC_DEBUG is not set
CONFIG_USB_PWC_INPUT_EVDEV=y
CONFIG_USB_ZR364XX=m
CONFIG_USB_STKWEBCAM=m
CONFIG_USB_S2255=m
CONFIG_RADIO_ADAPTERS=y
CONFIG_RADIO_GEMTEK_PCI=m
CONFIG_RADIO_MAXIRADIO=m
CONFIG_RADIO_MAESTRO=m
CONFIG_I2C_SI4713=m
CONFIG_RADIO_SI4713=m
CONFIG_USB_DSBR=m
# CONFIG_RADIO_SI470X is not set
CONFIG_USB_MR800=m
CONFIG_RADIO_TEA5764=m
CONFIG_RADIO_TEF6862=m
CONFIG_DVB_MAX_ADAPTERS=8
# CONFIG_DVB_DYNAMIC_MINORS is not set
CONFIG_DVB_CAPTURE_DRIVERS=y

#
# Supported SAA7146 based PCI Adapters
#
CONFIG_TTPCI_EEPROM=m
CONFIG_DVB_AV7110=m
CONFIG_DVB_AV7110_OSD=y
CONFIG_DVB_BUDGET_CORE=m
CONFIG_DVB_BUDGET=m
CONFIG_DVB_BUDGET_CI=m
CONFIG_DVB_BUDGET_AV=m
CONFIG_DVB_BUDGET_PATCH=m

#
# Supported USB Adapters
#
CONFIG_DVB_USB=m
# CONFIG_DVB_USB_DEBUG is not set
CONFIG_DVB_USB_A800=m
CONFIG_DVB_USB_DIBUSB_MB=m
CONFIG_DVB_USB_DIBUSB_MB_FAULTY=y
CONFIG_DVB_USB_DIBUSB_MC=m
CONFIG_DVB_USB_DIB0700=m
CONFIG_DVB_USB_UMT_010=m
CONFIG_DVB_USB_CXUSB=m
CONFIG_DVB_USB_M920X=m
CONFIG_DVB_USB_GL861=m
CONFIG_DVB_USB_AU6610=m
CONFIG_DVB_USB_DIGITV=m
CONFIG_DVB_USB_VP7045=m
CONFIG_DVB_USB_VP702X=m
CONFIG_DVB_USB_GP8PSK=m
CONFIG_DVB_USB_NOVA_T_USB2=m
CONFIG_DVB_USB_TTUSB2=m
CONFIG_DVB_USB_DTT200U=m
CONFIG_DVB_USB_OPERA1=m
CONFIG_DVB_USB_AF9005=m
CONFIG_DVB_USB_AF9005_REMOTE=m
CONFIG_DVB_USB_DW2102=m
CONFIG_DVB_USB_CINERGY_T2=m
CONFIG_DVB_USB_ANYSEE=m
CONFIG_DVB_USB_DTV5100=m
CONFIG_DVB_USB_AF9015=m
CONFIG_DVB_USB_CE6230=m
CONFIG_DVB_USB_FRIIO=m
CONFIG_DVB_USB_EC168=m
CONFIG_DVB_TTUSB_BUDGET=m
CONFIG_DVB_TTUSB_DEC=m
# CONFIG_SMS_SIANO_MDTV is not set

#
# Supported FlexCopII (B2C2) Adapters
#
CONFIG_DVB_B2C2_FLEXCOP=m
CONFIG_DVB_B2C2_FLEXCOP_PCI=m
CONFIG_DVB_B2C2_FLEXCOP_USB=m
# CONFIG_DVB_B2C2_FLEXCOP_DEBUG is not set

#
# Supported BT878 Adapters
#
CONFIG_DVB_BT8XX=m

#
# Supported Pluto2 Adapters
#
CONFIG_DVB_PLUTO2=m

#
# Supported SDMC DM1105 Adapters
#
CONFIG_DVB_DM1105=m

#
# Supported FireWire (IEEE 1394) Adapters
#
# CONFIG_DVB_FIREDTV is not set

#
# Supported Earthsoft PT1 Adapters
#
CONFIG_DVB_PT1=m

#
# Supported Mantis Adapters
#
# CONFIG_MANTIS_CORE is not set

#
# Supported DVB Frontends
#
# CONFIG_DVB_FE_CUSTOMISE is not set
CONFIG_DVB_STB0899=m
CONFIG_DVB_STB6100=m
CONFIG_DVB_CX24110=m
CONFIG_DVB_CX24123=m
CONFIG_DVB_MT312=m
CONFIG_DVB_ZL10036=m
CONFIG_DVB_ZL10039=m
CONFIG_DVB_S5H1420=m
CONFIG_DVB_STV0288=m
CONFIG_DVB_STB6000=m
CONFIG_DVB_STV0299=m
CONFIG_DVB_STV6110=m
CONFIG_DVB_STV0900=m
CONFIG_DVB_TDA8083=m
CONFIG_DVB_TDA10086=m
CONFIG_DVB_TDA8261=m
CONFIG_DVB_VES1X93=m
CONFIG_DVB_TUNER_ITD1000=m
CONFIG_DVB_TUNER_CX24113=m
CONFIG_DVB_TDA826X=m
CONFIG_DVB_TUA6100=m
CONFIG_DVB_CX24116=m
CONFIG_DVB_SI21XX=m
CONFIG_DVB_DS3000=m
CONFIG_DVB_SP8870=m
CONFIG_DVB_SP887X=m
CONFIG_DVB_CX22700=m
CONFIG_DVB_CX22702=m
CONFIG_DVB_L64781=m
CONFIG_DVB_TDA1004X=m
CONFIG_DVB_NXT6000=m
CONFIG_DVB_MT352=m
CONFIG_DVB_ZL10353=m
CONFIG_DVB_DIB3000MB=m
CONFIG_DVB_DIB3000MC=m
CONFIG_DVB_DIB7000M=m
CONFIG_DVB_DIB7000P=m
CONFIG_DVB_TDA10048=m
CONFIG_DVB_AF9013=m
CONFIG_DVB_EC100=m
CONFIG_DVB_VES1820=m
CONFIG_DVB_TDA10021=m
CONFIG_DVB_TDA10023=m
CONFIG_DVB_STV0297=m
CONFIG_DVB_NXT200X=m
CONFIG_DVB_OR51211=m
CONFIG_DVB_OR51132=m
CONFIG_DVB_BCM3510=m
CONFIG_DVB_LGDT330X=m
CONFIG_DVB_LGDT3305=m
CONFIG_DVB_S5H1409=m
CONFIG_DVB_AU8522=m
CONFIG_DVB_S5H1411=m
CONFIG_DVB_DIB8000=m
CONFIG_DVB_PLL=m
CONFIG_DVB_TUNER_DIB0070=m
CONFIG_DVB_LNBP21=m
CONFIG_DVB_ISL6405=m
CONFIG_DVB_ISL6421=m
CONFIG_DVB_LGS8GXX=m
CONFIG_DVB_ATBM8830=m
CONFIG_DAB=y
CONFIG_USB_DABUSB=m

#
# Graphics support
#
CONFIG_AGP=m
CONFIG_AGP_AMD64=m
CONFIG_AGP_INTEL=m
# CONFIG_AGP_SIS is not set
# CONFIG_AGP_VIA is not set
CONFIG_VGA_ARB=y
CONFIG_DRM=m
CONFIG_DRM_KMS_HELPER=m
# CONFIG_DRM_TDFX is not set
# CONFIG_DRM_R128 is not set
# CONFIG_DRM_RADEON is not set
# CONFIG_DRM_I810 is not set
# CONFIG_DRM_I830 is not set
CONFIG_DRM_I915=m
CONFIG_DRM_I915_KMS=y
# CONFIG_DRM_MGA is not set
# CONFIG_DRM_SIS is not set
# CONFIG_DRM_VIA is not set
# CONFIG_DRM_SAVAGE is not set
CONFIG_VGASTATE=m
CONFIG_VIDEO_OUTPUT_CONTROL=m
CONFIG_FB=y
CONFIG_FIRMWARE_EDID=y
# CONFIG_FB_DDC is not set
CONFIG_FB_BOOT_VESA_SUPPORT=y
CONFIG_FB_CFB_FILLRECT=y
CONFIG_FB_CFB_COPYAREA=y
CONFIG_FB_CFB_IMAGEBLIT=y
# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
# CONFIG_FB_SYS_FILLRECT is not set
# CONFIG_FB_SYS_COPYAREA is not set
# CONFIG_FB_SYS_IMAGEBLIT is not set
# CONFIG_FB_FOREIGN_ENDIAN is not set
# CONFIG_FB_SYS_FOPS is not set
# CONFIG_FB_SVGALIB is not set
# CONFIG_FB_MACMODES is not set
# CONFIG_FB_BACKLIGHT is not set
CONFIG_FB_MODE_HELPERS=y
CONFIG_FB_TILEBLITTING=y

#
# Frame buffer hardware drivers
#
# CONFIG_FB_CIRRUS is not set
# CONFIG_FB_PM2 is not set
# CONFIG_FB_CYBER2000 is not set
# CONFIG_FB_ARC is not set
# CONFIG_FB_ASILIANT is not set
# CONFIG_FB_IMSTT is not set
CONFIG_FB_VGA16=m
CONFIG_FB_UVESA=m
CONFIG_FB_VESA=y
CONFIG_FB_EFI=y
# CONFIG_FB_N411 is not set
# CONFIG_FB_HGA is not set
# CONFIG_FB_S1D13XXX is not set
# CONFIG_FB_NVIDIA is not set
# CONFIG_FB_RIVA is not set
# CONFIG_FB_LE80578 is not set
# CONFIG_FB_MATROX is not set
# CONFIG_FB_RADEON is not set
# CONFIG_FB_ATY128 is not set
# CONFIG_FB_ATY is not set
# CONFIG_FB_S3 is not set
# CONFIG_FB_SAVAGE is not set
# CONFIG_FB_SIS is not set
# CONFIG_FB_VIA is not set
# CONFIG_FB_NEOMAGIC is not set
# CONFIG_FB_KYRO is not set
# CONFIG_FB_3DFX is not set
# CONFIG_FB_VOODOO1 is not set
# CONFIG_FB_VT8623 is not set
# CONFIG_FB_TRIDENT is not set
# CONFIG_FB_ARK is not set
# CONFIG_FB_PM3 is not set
# CONFIG_FB_CARMINE is not set
# CONFIG_FB_GEODE is not set
# CONFIG_FB_TMIO is not set
# CONFIG_FB_SM501 is not set
# CONFIG_FB_VIRTUAL is not set
# CONFIG_FB_METRONOME is not set
# CONFIG_FB_MB862XX is not set
# CONFIG_FB_BROADSHEET is not set
CONFIG_BACKLIGHT_LCD_SUPPORT=y
# CONFIG_LCD_CLASS_DEVICE is not set
CONFIG_BACKLIGHT_CLASS_DEVICE=y
# CONFIG_BACKLIGHT_GENERIC is not set
# CONFIG_BACKLIGHT_PROGEAR is not set
# CONFIG_BACKLIGHT_MBP_NVIDIA is not set
# CONFIG_BACKLIGHT_SAHARA is not set

#
# Display device support
#
CONFIG_DISPLAY_SUPPORT=m

#
# Display hardware drivers
#

#
# Console display driver support
#
CONFIG_VGA_CONSOLE=y
# CONFIG_VGACON_SOFT_SCROLLBACK is not set
CONFIG_DUMMY_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE=y
# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
# CONFIG_FONTS is not set
CONFIG_FONT_8x8=y
CONFIG_FONT_8x16=y
# CONFIG_LOGO is not set
CONFIG_SOUND=m
CONFIG_SOUND_OSS_CORE=y
CONFIG_SOUND_OSS_CORE_PRECLAIM=y
CONFIG_SND=m
CONFIG_SND_TIMER=m
CONFIG_SND_PCM=m
CONFIG_SND_HWDEP=m
CONFIG_SND_RAWMIDI=m
CONFIG_SND_JACK=y
CONFIG_SND_SEQUENCER=m
CONFIG_SND_SEQ_DUMMY=m
CONFIG_SND_OSSEMUL=y
CONFIG_SND_MIXER_OSS=m
CONFIG_SND_PCM_OSS=m
CONFIG_SND_PCM_OSS_PLUGINS=y
CONFIG_SND_SEQUENCER_OSS=y
CONFIG_SND_HRTIMER=m
CONFIG_SND_SEQ_HRTIMER_DEFAULT=y
# CONFIG_SND_DYNAMIC_MINORS is not set
CONFIG_SND_SUPPORT_OLD_API=y
CONFIG_SND_VERBOSE_PROCFS=y
# CONFIG_SND_VERBOSE_PRINTK is not set
# CONFIG_SND_DEBUG is not set
CONFIG_SND_VMASTER=y
CONFIG_SND_DMA_SGBUF=y
CONFIG_SND_RAWMIDI_SEQ=m
# CONFIG_SND_OPL3_LIB_SEQ is not set
# CONFIG_SND_OPL4_LIB_SEQ is not set
# CONFIG_SND_SBAWE_SEQ is not set
# CONFIG_SND_EMU10K1_SEQ is not set
CONFIG_SND_DRIVERS=y
# CONFIG_SND_PCSP is not set
CONFIG_SND_DUMMY=m
CONFIG_SND_VIRMIDI=m
# CONFIG_SND_MTPAV is not set
# CONFIG_SND_SERIAL_U16550 is not set
# CONFIG_SND_MPU401 is not set
CONFIG_SND_PCI=y
# CONFIG_SND_AD1889 is not set
# CONFIG_SND_ALS300 is not set
# CONFIG_SND_ALS4000 is not set
# CONFIG_SND_ALI5451 is not set
# CONFIG_SND_ATIIXP is not set
# CONFIG_SND_ATIIXP_MODEM is not set
# CONFIG_SND_AU8810 is not set
# CONFIG_SND_AU8820 is not set
# CONFIG_SND_AU8830 is not set
# CONFIG_SND_AW2 is not set
# CONFIG_SND_AZT3328 is not set
# CONFIG_SND_BT87X is not set
# CONFIG_SND_CA0106 is not set
# CONFIG_SND_CMIPCI is not set
# CONFIG_SND_OXYGEN is not set
# CONFIG_SND_CS4281 is not set
# CONFIG_SND_CS46XX is not set
# CONFIG_SND_CS5530 is not set
# CONFIG_SND_CS5535AUDIO is not set
# CONFIG_SND_CTXFI is not set
# CONFIG_SND_DARLA20 is not set
# CONFIG_SND_GINA20 is not set
# CONFIG_SND_LAYLA20 is not set
# CONFIG_SND_DARLA24 is not set
# CONFIG_SND_GINA24 is not set
# CONFIG_SND_LAYLA24 is not set
# CONFIG_SND_MONA is not set
# CONFIG_SND_MIA is not set
# CONFIG_SND_ECHO3G is not set
# CONFIG_SND_INDIGO is not set
# CONFIG_SND_INDIGOIO is not set
# CONFIG_SND_INDIGODJ is not set
# CONFIG_SND_INDIGOIOX is not set
# CONFIG_SND_INDIGODJX is not set
# CONFIG_SND_EMU10K1 is not set
# CONFIG_SND_EMU10K1X is not set
# CONFIG_SND_ENS1370 is not set
# CONFIG_SND_ENS1371 is not set
# CONFIG_SND_ES1938 is not set
# CONFIG_SND_ES1968 is not set
# CONFIG_SND_FM801 is not set
CONFIG_SND_HDA_INTEL=m
CONFIG_SND_HDA_HWDEP=y
CONFIG_SND_HDA_RECONFIG=y
CONFIG_SND_HDA_INPUT_BEEP=y
CONFIG_SND_HDA_INPUT_BEEP_MODE=1
CONFIG_SND_HDA_INPUT_JACK=y
# CONFIG_SND_HDA_PATCH_LOADER is not set
CONFIG_SND_HDA_CODEC_REALTEK=y
CONFIG_SND_HDA_CODEC_ANALOG=y
CONFIG_SND_HDA_CODEC_SIGMATEL=y
CONFIG_SND_HDA_CODEC_VIA=y
CONFIG_SND_HDA_CODEC_ATIHDMI=y
CONFIG_SND_HDA_CODEC_NVHDMI=y
CONFIG_SND_HDA_CODEC_INTELHDMI=y
CONFIG_SND_HDA_ELD=y
CONFIG_SND_HDA_CODEC_CIRRUS=y
CONFIG_SND_HDA_CODEC_CONEXANT=y
CONFIG_SND_HDA_CODEC_CA0110=y
CONFIG_SND_HDA_CODEC_CMEDIA=y
CONFIG_SND_HDA_CODEC_SI3054=y
CONFIG_SND_HDA_GENERIC=y
CONFIG_SND_HDA_POWER_SAVE=y
CONFIG_SND_HDA_POWER_SAVE_DEFAULT=0
# CONFIG_SND_HDSP is not set
# CONFIG_SND_HDSPM is not set
# CONFIG_SND_HIFIER is not set
# CONFIG_SND_ICE1712 is not set
# CONFIG_SND_ICE1724 is not set
# CONFIG_SND_INTEL8X0 is not set
# CONFIG_SND_INTEL8X0M is not set
# CONFIG_SND_KORG1212 is not set
# CONFIG_SND_LX6464ES is not set
# CONFIG_SND_MAESTRO3 is not set
# CONFIG_SND_MIXART is not set
# CONFIG_SND_NM256 is not set
# CONFIG_SND_PCXHR is not set
# CONFIG_SND_RIPTIDE is not set
# CONFIG_SND_RME32 is not set
# CONFIG_SND_RME96 is not set
# CONFIG_SND_RME9652 is not set
# CONFIG_SND_SONICVIBES is not set
# CONFIG_SND_TRIDENT is not set
# CONFIG_SND_VIA82XX is not set
# CONFIG_SND_VIA82XX_MODEM is not set
# CONFIG_SND_VIRTUOSO is not set
# CONFIG_SND_VX222 is not set
# CONFIG_SND_YMFPCI is not set
# CONFIG_SND_SPI is not set
CONFIG_SND_USB=y
CONFIG_SND_USB_AUDIO=m
# CONFIG_SND_USB_USX2Y is not set
CONFIG_SND_USB_CAIAQ=m
CONFIG_SND_USB_CAIAQ_INPUT=y
# CONFIG_SND_USB_US122L is not set
# CONFIG_SND_PCMCIA is not set
# CONFIG_SND_SOC is not set
# CONFIG_SOUND_PRIME is not set
CONFIG_HID_SUPPORT=y
CONFIG_HID=m
CONFIG_HIDRAW=y

#
# USB Input Devices
#
CONFIG_USB_HID=m
CONFIG_HID_PID=y
CONFIG_USB_HIDDEV=y

#
# Special HID drivers
#
CONFIG_HID_A4TECH=m
CONFIG_HID_APPLE=m
CONFIG_HID_BELKIN=m
CONFIG_HID_CHERRY=m
CONFIG_HID_CHICONY=m
CONFIG_HID_CYPRESS=m
CONFIG_HID_DRAGONRISE=m
# CONFIG_DRAGONRISE_FF is not set
CONFIG_HID_EZKEY=m
CONFIG_HID_KYE=m
CONFIG_HID_GYRATION=m
CONFIG_HID_TWINHAN=m
CONFIG_HID_KENSINGTON=m
CONFIG_HID_LOGITECH=m
CONFIG_LOGITECH_FF=y
CONFIG_LOGIRUMBLEPAD2_FF=y
CONFIG_HID_MICROSOFT=m
CONFIG_HID_MONTEREY=m
CONFIG_HID_NTRIG=m
CONFIG_HID_PANTHERLORD=m
CONFIG_PANTHERLORD_FF=y
CONFIG_HID_PETALYNX=m
CONFIG_HID_SAMSUNG=m
CONFIG_HID_SONY=m
CONFIG_HID_SUNPLUS=m
CONFIG_HID_GREENASIA=m
# CONFIG_GREENASIA_FF is not set
CONFIG_HID_SMARTJOYPLUS=m
# CONFIG_SMARTJOYPLUS_FF is not set
CONFIG_HID_TOPSEED=m
CONFIG_HID_THRUSTMASTER=m
# CONFIG_THRUSTMASTER_FF is not set
CONFIG_HID_WACOM=m
CONFIG_HID_ZEROPLUS=m
# CONFIG_ZEROPLUS_FF is not set
CONFIG_USB_SUPPORT=y
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB_ARCH_HAS_OHCI=y
CONFIG_USB_ARCH_HAS_EHCI=y
CONFIG_USB=m
# CONFIG_USB_DEBUG is not set
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y

#
# Miscellaneous USB options
#
CONFIG_USB_DEVICEFS=y
CONFIG_USB_DEVICE_CLASS=y
# CONFIG_USB_DYNAMIC_MINORS is not set
CONFIG_USB_SUSPEND=y
# CONFIG_USB_OTG is not set
CONFIG_USB_MON=m
CONFIG_USB_WUSB=m
# CONFIG_USB_WUSB_CBAF is not set

#
# USB Host Controller Drivers
#
# CONFIG_USB_C67X00_HCD is not set
# CONFIG_USB_XHCI_HCD is not set
CONFIG_USB_EHCI_HCD=m
CONFIG_USB_EHCI_ROOT_HUB_TT=y
CONFIG_USB_EHCI_TT_NEWSCHED=y
# CONFIG_USB_OXU210HP_HCD is not set
# CONFIG_USB_ISP116X_HCD is not set
# CONFIG_USB_ISP1760_HCD is not set
# CONFIG_USB_ISP1362_HCD is not set
CONFIG_USB_OHCI_HCD=m
# CONFIG_USB_OHCI_HCD_SSB is not set
# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
CONFIG_USB_OHCI_LITTLE_ENDIAN=y
CONFIG_USB_UHCI_HCD=m
CONFIG_USB_U132_HCD=m
CONFIG_USB_SL811_HCD=m
CONFIG_USB_SL811_CS=m
CONFIG_USB_R8A66597_HCD=m
CONFIG_USB_WHCI_HCD=m
CONFIG_USB_HWA_HCD=m

#
# Enable Host or Gadget support to see Inventra options
#

#
# USB Device Class drivers
#
CONFIG_USB_ACM=m
CONFIG_USB_PRINTER=m
CONFIG_USB_WDM=m
CONFIG_USB_TMC=m

#
# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
#

#
# also be needed; see USB_STORAGE Help for more info
#
CONFIG_USB_STORAGE=m
# CONFIG_USB_STORAGE_DEBUG is not set
CONFIG_USB_STORAGE_DATAFAB=m
CONFIG_USB_STORAGE_FREECOM=m
CONFIG_USB_STORAGE_ISD200=m
CONFIG_USB_STORAGE_USBAT=m
CONFIG_USB_STORAGE_SDDR09=m
CONFIG_USB_STORAGE_SDDR55=m
CONFIG_USB_STORAGE_JUMPSHOT=m
CONFIG_USB_STORAGE_ALAUDA=m
CONFIG_USB_STORAGE_ONETOUCH=m
CONFIG_USB_STORAGE_KARMA=m
CONFIG_USB_STORAGE_CYPRESS_ATACB=m
# CONFIG_USB_LIBUSUAL is not set

#
# USB Imaging devices
#
CONFIG_USB_MDC800=m
CONFIG_USB_MICROTEK=m

#
# USB port drivers
#
CONFIG_USB_SERIAL=m
CONFIG_USB_EZUSB=y
CONFIG_USB_SERIAL_GENERIC=y
CONFIG_USB_SERIAL_AIRCABLE=m
CONFIG_USB_SERIAL_ARK3116=m
CONFIG_USB_SERIAL_BELKIN=m
CONFIG_USB_SERIAL_CH341=m
# CONFIG_USB_SERIAL_WHITEHEAT is not set
CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
CONFIG_USB_SERIAL_CP210X=m
CONFIG_USB_SERIAL_CYPRESS_M8=m
CONFIG_USB_SERIAL_EMPEG=m
CONFIG_USB_SERIAL_FTDI_SIO=m
CONFIG_USB_SERIAL_FUNSOFT=m
CONFIG_USB_SERIAL_VISOR=m
CONFIG_USB_SERIAL_IPAQ=m
CONFIG_USB_SERIAL_IR=m
CONFIG_USB_SERIAL_EDGEPORT=m
CONFIG_USB_SERIAL_EDGEPORT_TI=m
CONFIG_USB_SERIAL_GARMIN=m
CONFIG_USB_SERIAL_IPW=m
CONFIG_USB_SERIAL_IUU=m
CONFIG_USB_SERIAL_KEYSPAN_PDA=m
CONFIG_USB_SERIAL_KEYSPAN=m
CONFIG_USB_SERIAL_KLSI=m
CONFIG_USB_SERIAL_KOBIL_SCT=m
CONFIG_USB_SERIAL_MCT_U232=m
CONFIG_USB_SERIAL_MOS7720=m
CONFIG_USB_SERIAL_MOS7840=m
CONFIG_USB_SERIAL_MOTOROLA=m
CONFIG_USB_SERIAL_NAVMAN=m
CONFIG_USB_SERIAL_PL2303=m
CONFIG_USB_SERIAL_OTI6858=m
CONFIG_USB_SERIAL_QUALCOMM=m
CONFIG_USB_SERIAL_SPCP8X5=m
CONFIG_USB_SERIAL_HP4X=m
CONFIG_USB_SERIAL_SAFE=m
# CONFIG_USB_SERIAL_SAFE_PADDED is not set
CONFIG_USB_SERIAL_SIEMENS_MPI=m
CONFIG_USB_SERIAL_SIERRAWIRELESS=m
CONFIG_USB_SERIAL_SYMBOL=m
# CONFIG_USB_SERIAL_TI is not set
CONFIG_USB_SERIAL_CYBERJACK=m
CONFIG_USB_SERIAL_XIRCOM=m
CONFIG_USB_SERIAL_OPTION=m
CONFIG_USB_SERIAL_OMNINET=m
CONFIG_USB_SERIAL_OPTICON=m
CONFIG_USB_SERIAL_DEBUG=m

#
# USB Miscellaneous drivers
#
CONFIG_USB_EMI62=m
CONFIG_USB_EMI26=m
CONFIG_USB_ADUTUX=m
CONFIG_USB_SEVSEG=m
CONFIG_USB_RIO500=m
# CONFIG_USB_LEGOTOWER is not set
CONFIG_USB_LCD=m
CONFIG_USB_BERRY_CHARGE=m
CONFIG_USB_LED=m
CONFIG_USB_CYPRESS_CY7C63=m
CONFIG_USB_CYTHERM=m
CONFIG_USB_IDMOUSE=m
CONFIG_USB_FTDI_ELAN=m
CONFIG_USB_APPLEDISPLAY=m
CONFIG_USB_SISUSBVGA=m
CONFIG_USB_SISUSBVGA_CON=y
CONFIG_USB_LD=m
CONFIG_USB_TRANCEVIBRATOR=m
CONFIG_USB_IOWARRIOR=m
CONFIG_USB_TEST=m
CONFIG_USB_ISIGHTFW=m
# CONFIG_USB_VST is not set
# CONFIG_USB_GADGET is not set

#
# OTG and related infrastructure
#
CONFIG_USB_OTG_UTILS=y
CONFIG_NOP_USB_XCEIV=m
CONFIG_UWB=m
CONFIG_UWB_HWA=m
CONFIG_UWB_WHCI=m
CONFIG_UWB_WLP=m
CONFIG_UWB_I1480U=m
CONFIG_UWB_I1480U_WLP=m
CONFIG_MMC=m
# CONFIG_MMC_DEBUG is not set
# CONFIG_MMC_UNSAFE_RESUME is not set

#
# MMC/SD/SDIO Card Drivers
#
CONFIG_MMC_BLOCK=m
CONFIG_MMC_BLOCK_BOUNCE=y
CONFIG_SDIO_UART=m
# CONFIG_MMC_TEST is not set

#
# MMC/SD/SDIO Host Controller Drivers
#
CONFIG_MMC_SDHCI=m
CONFIG_MMC_SDHCI_PCI=m
CONFIG_MMC_RICOH_MMC=m
CONFIG_MMC_SDHCI_PLTFM=m
CONFIG_MMC_WBSD=m
# CONFIG_MMC_AT91 is not set
# CONFIG_MMC_ATMELMCI is not set
CONFIG_MMC_TIFM_SD=m
CONFIG_MMC_SPI=m
CONFIG_MMC_SDRICOH_CS=m
CONFIG_MMC_CB710=m
CONFIG_MMC_VIA_SDMMC=m
CONFIG_MEMSTICK=m
# CONFIG_MEMSTICK_DEBUG is not set

#
# MemoryStick drivers
#
# CONFIG_MEMSTICK_UNSAFE_RESUME is not set
CONFIG_MSPRO_BLOCK=m

#
# MemoryStick Host Controller Drivers
#
CONFIG_MEMSTICK_TIFM_MS=m
CONFIG_MEMSTICK_JMICRON_38X=m
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=m

#
# LED drivers
#
CONFIG_LEDS_ALIX2=m
CONFIG_LEDS_PCA9532=m
# CONFIG_LEDS_LP3944 is not set
CONFIG_LEDS_CLEVO_MAIL=m
CONFIG_LEDS_PCA955X=m
CONFIG_LEDS_WM8350=m
CONFIG_LEDS_DAC124S085=m
CONFIG_LEDS_BD2802=m
# CONFIG_LEDS_INTEL_SS4200 is not set

#
# LED Triggers
#
CONFIG_LEDS_TRIGGERS=y
CONFIG_LEDS_TRIGGER_TIMER=m
CONFIG_LEDS_TRIGGER_IDE_DISK=y
CONFIG_LEDS_TRIGGER_HEARTBEAT=m
CONFIG_LEDS_TRIGGER_BACKLIGHT=m
CONFIG_LEDS_TRIGGER_DEFAULT_ON=m

#
# iptables trigger is under Netfilter config (LED target)
#
# CONFIG_ACCESSIBILITY is not set
# CONFIG_INFINIBAND is not set
# CONFIG_EDAC is not set
CONFIG_RTC_LIB=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_HCTOSYS=y
CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
# CONFIG_RTC_DEBUG is not set

#
# RTC interfaces
#
CONFIG_RTC_INTF_SYSFS=y
CONFIG_RTC_INTF_PROC=y
CONFIG_RTC_INTF_DEV=y
# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
# CONFIG_RTC_DRV_TEST is not set

#
# I2C RTC drivers
#
CONFIG_RTC_DRV_DS1307=m
CONFIG_RTC_DRV_DS1374=m
CONFIG_RTC_DRV_DS1672=m
CONFIG_RTC_DRV_MAX6900=m
CONFIG_RTC_DRV_RS5C372=m
CONFIG_RTC_DRV_ISL1208=m
CONFIG_RTC_DRV_X1205=m
CONFIG_RTC_DRV_PCF8563=m
CONFIG_RTC_DRV_PCF8583=m
CONFIG_RTC_DRV_M41T80=m
# CONFIG_RTC_DRV_M41T80_WDT is not set
# CONFIG_RTC_DRV_BQ32K is not set
CONFIG_RTC_DRV_S35390A=m
CONFIG_RTC_DRV_FM3130=m
CONFIG_RTC_DRV_RX8581=m
CONFIG_RTC_DRV_RX8025=m

#
# SPI RTC drivers
#
CONFIG_RTC_DRV_M41T94=m
CONFIG_RTC_DRV_DS1305=m
CONFIG_RTC_DRV_DS1390=m
CONFIG_RTC_DRV_MAX6902=m
CONFIG_RTC_DRV_R9701=m
CONFIG_RTC_DRV_RS5C348=m
CONFIG_RTC_DRV_DS3234=m
CONFIG_RTC_DRV_PCF2123=m

#
# Platform RTC drivers
#
CONFIG_RTC_DRV_CMOS=y
CONFIG_RTC_DRV_DS1286=m
CONFIG_RTC_DRV_DS1511=m
CONFIG_RTC_DRV_DS1553=m
CONFIG_RTC_DRV_DS1742=m
CONFIG_RTC_DRV_STK17TA8=m
CONFIG_RTC_DRV_M48T86=m
CONFIG_RTC_DRV_M48T35=m
CONFIG_RTC_DRV_M48T59=m
# CONFIG_RTC_DRV_MSM6242 is not set
CONFIG_RTC_DRV_BQ4802=m
# CONFIG_RTC_DRV_RP5C01 is not set
CONFIG_RTC_DRV_V3020=m
CONFIG_RTC_DRV_WM8350=m
CONFIG_RTC_DRV_PCF50633=m

#
# on-CPU RTC drivers
#
# CONFIG_RTC_DRV_MC13783 is not set
# CONFIG_DMADEVICES is not set
# CONFIG_AUXDISPLAY is not set
CONFIG_UIO=m
# CONFIG_UIO_CIF is not set
CONFIG_UIO_PDRV=m
CONFIG_UIO_PDRV_GENIRQ=m
# CONFIG_UIO_SMX is not set
# CONFIG_UIO_AEC is not set
# CONFIG_UIO_SERCOS3 is not set
# CONFIG_UIO_PCI_GENERIC is not set

#
# TI VLYNQ
#
# CONFIG_STAGING is not set
CONFIG_X86_PLATFORM_DEVICES=y
# CONFIG_ACER_WMI is not set
# CONFIG_ACERHDF is not set
# CONFIG_ASUS_LAPTOP is not set
# CONFIG_DELL_WMI is not set
# CONFIG_FUJITSU_LAPTOP is not set
# CONFIG_HP_WMI is not set
# CONFIG_MSI_LAPTOP is not set
# CONFIG_PANASONIC_LAPTOP is not set
# CONFIG_COMPAL_LAPTOP is not set
# CONFIG_SONY_LAPTOP is not set
CONFIG_THINKPAD_ACPI=m
# CONFIG_THINKPAD_ACPI_ALSA_SUPPORT is not set
# CONFIG_THINKPAD_ACPI_DEBUGFACILITIES is not set
# CONFIG_THINKPAD_ACPI_DEBUG is not set
# CONFIG_THINKPAD_ACPI_UNSAFE_LEDS is not set
CONFIG_THINKPAD_ACPI_VIDEO=y
CONFIG_THINKPAD_ACPI_HOTKEY_POLL=y
# CONFIG_INTEL_MENLOW is not set
# CONFIG_EEEPC_LAPTOP is not set
CONFIG_ACPI_WMI=m
# CONFIG_MSI_WMI is not set
# CONFIG_ACPI_ASUS is not set
# CONFIG_TOPSTAR_LAPTOP is not set
# CONFIG_ACPI_TOSHIBA is not set
# CONFIG_TOSHIBA_BT_RFKILL is not set
# CONFIG_ACPI_CMPC is not set

#
# Firmware Drivers
#
CONFIG_EDD=m
# CONFIG_EDD_OFF is not set
CONFIG_FIRMWARE_MEMMAP=y
CONFIG_EFI_VARS=m
# CONFIG_DELL_RBU is not set
# CONFIG_DCDBAS is not set
CONFIG_DMIID=y
# CONFIG_ISCSI_IBFT_FIND is not set

#
# File systems
#
CONFIG_EXT2_FS=m
CONFIG_EXT2_FS_XATTR=y
CONFIG_EXT2_FS_POSIX_ACL=y
CONFIG_EXT2_FS_SECURITY=y
# CONFIG_EXT2_FS_XIP is not set
CONFIG_EXT3_FS=m
CONFIG_EXT3_DEFAULTS_TO_ORDERED=y
CONFIG_EXT3_FS_XATTR=y
CONFIG_EXT3_FS_POSIX_ACL=y
CONFIG_EXT3_FS_SECURITY=y
CONFIG_EXT4_FS=m
CONFIG_EXT4_FS_XATTR=y
CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_EXT4_FS_SECURITY=y
# CONFIG_EXT4_DEBUG is not set
CONFIG_JBD=m
# CONFIG_JBD_DEBUG is not set
CONFIG_JBD2=m
# CONFIG_JBD2_DEBUG is not set
CONFIG_FS_MBCACHE=m
CONFIG_REISERFS_FS=m
# CONFIG_REISERFS_CHECK is not set
# CONFIG_REISERFS_PROC_INFO is not set
CONFIG_REISERFS_FS_XATTR=y
CONFIG_REISERFS_FS_POSIX_ACL=y
CONFIG_REISERFS_FS_SECURITY=y
CONFIG_JFS_FS=m
CONFIG_JFS_POSIX_ACL=y
CONFIG_JFS_SECURITY=y
# CONFIG_JFS_DEBUG is not set
# CONFIG_JFS_STATISTICS is not set
CONFIG_FS_POSIX_ACL=y
CONFIG_XFS_FS=m
CONFIG_XFS_QUOTA=y
CONFIG_XFS_POSIX_ACL=y
CONFIG_XFS_RT=y
# CONFIG_XFS_DEBUG is not set
CONFIG_GFS2_FS=m
CONFIG_GFS2_FS_LOCKING_DLM=y
CONFIG_OCFS2_FS=m
CONFIG_OCFS2_FS_O2CB=m
CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m
CONFIG_OCFS2_FS_STATS=y
CONFIG_OCFS2_DEBUG_MASKLOG=y
# CONFIG_OCFS2_DEBUG_FS is not set
CONFIG_BTRFS_FS=m
CONFIG_BTRFS_FS_POSIX_ACL=y
CONFIG_NILFS2_FS=m
CONFIG_FILE_LOCKING=y
CONFIG_FSNOTIFY=y
CONFIG_DNOTIFY=y
CONFIG_INOTIFY=y
CONFIG_INOTIFY_USER=y
CONFIG_QUOTA=y
CONFIG_QUOTA_NETLINK_INTERFACE=y
CONFIG_PRINT_QUOTA_WARNING=y
CONFIG_QUOTA_TREE=m
CONFIG_QFMT_V1=m
CONFIG_QFMT_V2=m
CONFIG_QUOTACTL=y
CONFIG_AUTOFS_FS=m
CONFIG_AUTOFS4_FS=m
CONFIG_FUSE_FS=m
CONFIG_CUSE=m
CONFIG_GENERIC_ACL=y

#
# Caches
#
CONFIG_FSCACHE=m
CONFIG_FSCACHE_STATS=y
# CONFIG_FSCACHE_HISTOGRAM is not set
# CONFIG_FSCACHE_DEBUG is not set
# CONFIG_FSCACHE_OBJECT_LIST is not set
CONFIG_CACHEFILES=m
# CONFIG_CACHEFILES_DEBUG is not set
# CONFIG_CACHEFILES_HISTOGRAM is not set

#
# CD-ROM/DVD Filesystems
#
CONFIG_ISO9660_FS=m
CONFIG_JOLIET=y
CONFIG_ZISOFS=y
CONFIG_UDF_FS=m
CONFIG_UDF_NLS=y

#
# DOS/FAT/NT Filesystems
#
CONFIG_FAT_FS=m
CONFIG_MSDOS_FS=m
CONFIG_VFAT_FS=m
CONFIG_FAT_DEFAULT_CODEPAGE=437
CONFIG_FAT_DEFAULT_IOCHARSET="utf8"
CONFIG_NTFS_FS=m
# CONFIG_NTFS_DEBUG is not set
CONFIG_NTFS_RW=y

#
# Pseudo filesystems
#
CONFIG_PROC_FS=y
CONFIG_PROC_KCORE=y
CONFIG_PROC_SYSCTL=y
CONFIG_PROC_PAGE_MONITOR=y
CONFIG_SYSFS=y
CONFIG_TMPFS=y
CONFIG_TMPFS_POSIX_ACL=y
CONFIG_HUGETLBFS=y
CONFIG_HUGETLB_PAGE=y
CONFIG_CONFIGFS_FS=m
CONFIG_MISC_FILESYSTEMS=y
CONFIG_ADFS_FS=m
# CONFIG_ADFS_FS_RW is not set
CONFIG_AFFS_FS=m
CONFIG_ECRYPT_FS=m
CONFIG_HFS_FS=m
CONFIG_HFSPLUS_FS=m
CONFIG_BEFS_FS=m
# CONFIG_BEFS_DEBUG is not set
CONFIG_BFS_FS=m
CONFIG_EFS_FS=m
CONFIG_JFFS2_FS=m
CONFIG_JFFS2_FS_DEBUG=0
CONFIG_JFFS2_FS_WRITEBUFFER=y
# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
CONFIG_JFFS2_SUMMARY=y
CONFIG_JFFS2_FS_XATTR=y
CONFIG_JFFS2_FS_POSIX_ACL=y
CONFIG_JFFS2_FS_SECURITY=y
CONFIG_JFFS2_COMPRESSION_OPTIONS=y
CONFIG_JFFS2_ZLIB=y
CONFIG_JFFS2_LZO=y
CONFIG_JFFS2_RTIME=y
# CONFIG_JFFS2_RUBIN is not set
# CONFIG_JFFS2_CMODE_NONE is not set
CONFIG_JFFS2_CMODE_PRIORITY=y
# CONFIG_JFFS2_CMODE_SIZE is not set
# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
CONFIG_UBIFS_FS=m
CONFIG_UBIFS_FS_XATTR=y
CONFIG_UBIFS_FS_ADVANCED_COMPR=y
CONFIG_UBIFS_FS_LZO=y
CONFIG_UBIFS_FS_ZLIB=y
# CONFIG_UBIFS_FS_DEBUG is not set
CONFIG_CRAMFS=m
CONFIG_SQUASHFS=m
# CONFIG_SQUASHFS_EMBEDDED is not set
CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
CONFIG_VXFS_FS=m
CONFIG_MINIX_FS=m
CONFIG_OMFS_FS=m
CONFIG_HPFS_FS=m
CONFIG_QNX4FS_FS=m
CONFIG_ROMFS_FS=m
# CONFIG_ROMFS_BACKED_BY_BLOCK is not set
# CONFIG_ROMFS_BACKED_BY_MTD is not set
CONFIG_ROMFS_BACKED_BY_BOTH=y
CONFIG_ROMFS_ON_BLOCK=y
CONFIG_ROMFS_ON_MTD=y
CONFIG_SYSV_FS=m
CONFIG_UFS_FS=m
# CONFIG_UFS_FS_WRITE is not set
# CONFIG_UFS_DEBUG is not set
CONFIG_EXOFS_FS=m
# CONFIG_EXOFS_DEBUG is not set
CONFIG_NETWORK_FILESYSTEMS=y
CONFIG_NFS_FS=m
CONFIG_NFS_V3=y
CONFIG_NFS_V3_ACL=y
CONFIG_NFS_V4=y
# CONFIG_NFS_V4_1 is not set
CONFIG_NFS_FSCACHE=y
CONFIG_NFSD=m
CONFIG_NFSD_V2_ACL=y
CONFIG_NFSD_V3=y
CONFIG_NFSD_V3_ACL=y
CONFIG_NFSD_V4=y
CONFIG_LOCKD=m
CONFIG_LOCKD_V4=y
CONFIG_EXPORTFS=m
CONFIG_NFS_ACL_SUPPORT=m
CONFIG_NFS_COMMON=y
CONFIG_SUNRPC=m
CONFIG_SUNRPC_GSS=m
CONFIG_RPCSEC_GSS_KRB5=m
CONFIG_RPCSEC_GSS_SPKM3=m
# CONFIG_SMB_FS is not set
CONFIG_CIFS=m
# CONFIG_CIFS_STATS is not set
CONFIG_CIFS_WEAK_PW_HASH=y
CONFIG_CIFS_UPCALL=y
CONFIG_CIFS_XATTR=y
CONFIG_CIFS_POSIX=y
# CONFIG_CIFS_DEBUG2 is not set
CONFIG_CIFS_DFS_UPCALL=y
CONFIG_CIFS_EXPERIMENTAL=y
CONFIG_NCP_FS=m
# CONFIG_NCPFS_PACKET_SIGNING is not set
# CONFIG_NCPFS_IOCTL_LOCKING is not set
# CONFIG_NCPFS_STRONG is not set
CONFIG_NCPFS_NFS_NS=y
CONFIG_NCPFS_OS2_NS=y
# CONFIG_NCPFS_SMALLDOS is not set
CONFIG_NCPFS_NLS=y
CONFIG_NCPFS_EXTRAS=y
CONFIG_CODA_FS=m
CONFIG_AFS_FS=m
# CONFIG_AFS_DEBUG is not set
CONFIG_AFS_FSCACHE=y

#
# Partition Types
#
CONFIG_PARTITION_ADVANCED=y
CONFIG_ACORN_PARTITION=y
# CONFIG_ACORN_PARTITION_CUMANA is not set
# CONFIG_ACORN_PARTITION_EESOX is not set
CONFIG_ACORN_PARTITION_ICS=y
# CONFIG_ACORN_PARTITION_ADFS is not set
# CONFIG_ACORN_PARTITION_POWERTEC is not set
CONFIG_ACORN_PARTITION_RISCIX=y
CONFIG_OSF_PARTITION=y
CONFIG_AMIGA_PARTITION=y
CONFIG_ATARI_PARTITION=y
CONFIG_MAC_PARTITION=y
CONFIG_MSDOS_PARTITION=y
CONFIG_BSD_DISKLABEL=y
CONFIG_MINIX_SUBPARTITION=y
CONFIG_SOLARIS_X86_PARTITION=y
CONFIG_UNIXWARE_DISKLABEL=y
CONFIG_LDM_PARTITION=y
# CONFIG_LDM_DEBUG is not set
CONFIG_SGI_PARTITION=y
CONFIG_ULTRIX_PARTITION=y
CONFIG_SUN_PARTITION=y
CONFIG_KARMA_PARTITION=y
CONFIG_EFI_PARTITION=y
# CONFIG_SYSV68_PARTITION is not set
CONFIG_NLS=m
CONFIG_NLS_DEFAULT="utf8"
CONFIG_NLS_CODEPAGE_437=m
CONFIG_NLS_CODEPAGE_737=m
CONFIG_NLS_CODEPAGE_775=m
CONFIG_NLS_CODEPAGE_850=m
CONFIG_NLS_CODEPAGE_852=m
CONFIG_NLS_CODEPAGE_855=m
CONFIG_NLS_CODEPAGE_857=m
CONFIG_NLS_CODEPAGE_860=m
CONFIG_NLS_CODEPAGE_861=m
CONFIG_NLS_CODEPAGE_862=m
CONFIG_NLS_CODEPAGE_863=m
CONFIG_NLS_CODEPAGE_864=m
CONFIG_NLS_CODEPAGE_865=m
CONFIG_NLS_CODEPAGE_866=m
CONFIG_NLS_CODEPAGE_869=m
CONFIG_NLS_CODEPAGE_936=m
CONFIG_NLS_CODEPAGE_950=m
CONFIG_NLS_CODEPAGE_932=m
CONFIG_NLS_CODEPAGE_949=m
CONFIG_NLS_CODEPAGE_874=m
CONFIG_NLS_ISO8859_8=m
CONFIG_NLS_CODEPAGE_1250=m
CONFIG_NLS_CODEPAGE_1251=m
CONFIG_NLS_ASCII=m
CONFIG_NLS_ISO8859_1=m
CONFIG_NLS_ISO8859_2=m
CONFIG_NLS_ISO8859_3=m
CONFIG_NLS_ISO8859_4=m
CONFIG_NLS_ISO8859_5=m
CONFIG_NLS_ISO8859_6=m
CONFIG_NLS_ISO8859_7=m
CONFIG_NLS_ISO8859_9=m
CONFIG_NLS_ISO8859_13=m
CONFIG_NLS_ISO8859_14=m
CONFIG_NLS_ISO8859_15=m
CONFIG_NLS_KOI8_R=m
CONFIG_NLS_KOI8_U=m
CONFIG_NLS_UTF8=m
CONFIG_DLM=m
CONFIG_DLM_DEBUG=y

#
# Kernel hacking
#
CONFIG_TRACE_IRQFLAGS_SUPPORT=y
CONFIG_PRINTK_TIME=y
CONFIG_ENABLE_WARN_DEPRECATED=y
CONFIG_ENABLE_MUST_CHECK=y
CONFIG_FRAME_WARN=2048
CONFIG_MAGIC_SYSRQ=y
CONFIG_STRIP_ASM_SYMS=y
# CONFIG_UNUSED_SYMBOLS is not set
CONFIG_DEBUG_FS=y
# CONFIG_HEADERS_CHECK is not set
CONFIG_DEBUG_KERNEL=y
CONFIG_DETECT_SOFTLOCKUP=y
# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
CONFIG_DETECT_HUNG_TASK=y
# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
CONFIG_SCHED_DEBUG=y
# CONFIG_SCHEDSTATS is not set
CONFIG_TIMER_STATS=y
# CONFIG_DEBUG_OBJECTS is not set
# CONFIG_DEBUG_SLAB is not set
# CONFIG_DEBUG_KMEMLEAK is not set
# CONFIG_DEBUG_PREEMPT is not set
# CONFIG_DEBUG_RT_MUTEXES is not set
# CONFIG_RT_MUTEX_TESTER is not set
# CONFIG_DEBUG_SPINLOCK is not set
# CONFIG_DEBUG_LOCK_ALLOC is not set
# CONFIG_PROVE_LOCKING is not set
# CONFIG_LOCK_STAT is not set
# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
CONFIG_STACKTRACE=y
# CONFIG_DEBUG_KOBJECT is not set
CONFIG_DEBUG_BUGVERBOSE=y
# CONFIG_DEBUG_INFO is not set
# CONFIG_DEBUG_VM is not set
# CONFIG_DEBUG_VIRTUAL is not set
# CONFIG_DEBUG_WRITECOUNT is not set
CONFIG_DEBUG_MEMORY_INIT=y
# CONFIG_DEBUG_LIST is not set
# CONFIG_DEBUG_SG is not set
# CONFIG_DEBUG_NOTIFIERS is not set
# CONFIG_DEBUG_CREDENTIALS is not set
CONFIG_ARCH_WANT_FRAME_POINTERS=y
# CONFIG_FRAME_POINTER is not set
# CONFIG_BOOT_PRINTK_DELAY is not set
# CONFIG_RCU_TORTURE_TEST is not set
# CONFIG_RCU_CPU_STALL_DETECTOR is not set
# CONFIG_BACKTRACE_SELF_TEST is not set
# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
# CONFIG_FAULT_INJECTION is not set
# CONFIG_LATENCYTOP is not set
CONFIG_SYSCTL_SYSCALL_CHECK=y
# CONFIG_DEBUG_PAGEALLOC is not set
CONFIG_USER_STACKTRACE_SUPPORT=y
CONFIG_NOP_TRACER=y
CONFIG_HAVE_FUNCTION_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_FP_TEST=y
CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
CONFIG_HAVE_DYNAMIC_FTRACE=y
CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
CONFIG_RING_BUFFER=y
CONFIG_EVENT_TRACING=y
CONFIG_CONTEXT_SWITCH_TRACER=y
CONFIG_RING_BUFFER_ALLOW_SWAP=y
CONFIG_TRACING=y
CONFIG_TRACING_SUPPORT=y
# CONFIG_FTRACE is not set
# CONFIG_PROVIDE_OHCI1394_DMA_INIT is not set
# CONFIG_DYNAMIC_DEBUG is not set
# CONFIG_DMA_API_DEBUG is not set
# CONFIG_SAMPLES is not set
CONFIG_HAVE_ARCH_KGDB=y
# CONFIG_KGDB is not set
CONFIG_HAVE_ARCH_KMEMCHECK=y
# CONFIG_KMEMCHECK is not set
CONFIG_STRICT_DEVMEM=y
CONFIG_X86_VERBOSE_BOOTUP=y
CONFIG_EARLY_PRINTK=y
# CONFIG_EARLY_PRINTK_DBGP is not set
# CONFIG_DEBUG_STACKOVERFLOW is not set
# CONFIG_DEBUG_STACK_USAGE is not set
# CONFIG_X86_PTDUMP is not set
CONFIG_DEBUG_RODATA=y
# CONFIG_DEBUG_RODATA_TEST is not set
# CONFIG_DEBUG_NX_TEST is not set
# CONFIG_IOMMU_DEBUG is not set
# CONFIG_IOMMU_STRESS is not set
CONFIG_HAVE_MMIOTRACE_SUPPORT=y
CONFIG_IO_DELAY_TYPE_0X80=0
CONFIG_IO_DELAY_TYPE_0XED=1
CONFIG_IO_DELAY_TYPE_UDELAY=2
CONFIG_IO_DELAY_TYPE_NONE=3
CONFIG_IO_DELAY_0X80=y
# CONFIG_IO_DELAY_0XED is not set
# CONFIG_IO_DELAY_UDELAY is not set
# CONFIG_IO_DELAY_NONE is not set
CONFIG_DEFAULT_IO_DELAY_TYPE=0
# CONFIG_DEBUG_BOOT_PARAMS is not set
# CONFIG_CPA_DEBUG is not set
CONFIG_OPTIMIZE_INLINING=y
# CONFIG_DEBUG_STRICT_USER_COPY_CHECKS is not set

#
# Security options
#
CONFIG_KEYS=y
# CONFIG_KEYS_DEBUG_PROC_KEYS is not set
CONFIG_SECURITY=y
CONFIG_SECURITYFS=y
CONFIG_SECURITY_NETWORK=y
CONFIG_SECURITY_NETWORK_XFRM=y
# CONFIG_SECURITY_PATH is not set
# CONFIG_SECURITY_SELINUX is not set
# CONFIG_SECURITY_TOMOYO is not set
# CONFIG_IMA is not set
# CONFIG_DEFAULT_SECURITY_SELINUX is not set
# CONFIG_DEFAULT_SECURITY_SMACK is not set
# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
CONFIG_DEFAULT_SECURITY_DAC=y
CONFIG_DEFAULT_SECURITY=""
CONFIG_CRYPTO=y

#
# Crypto core or helper
#
CONFIG_CRYPTO_FIPS=y
CONFIG_CRYPTO_ALGAPI=y
CONFIG_CRYPTO_ALGAPI2=y
CONFIG_CRYPTO_AEAD=m
CONFIG_CRYPTO_AEAD2=y
CONFIG_CRYPTO_BLKCIPHER=m
CONFIG_CRYPTO_BLKCIPHER2=y
CONFIG_CRYPTO_HASH=y
CONFIG_CRYPTO_HASH2=y
CONFIG_CRYPTO_RNG=m
CONFIG_CRYPTO_RNG2=y
CONFIG_CRYPTO_PCOMP=y
CONFIG_CRYPTO_MANAGER=y
CONFIG_CRYPTO_MANAGER2=y
CONFIG_CRYPTO_GF128MUL=m
CONFIG_CRYPTO_NULL=m
CONFIG_CRYPTO_WORKQUEUE=y
CONFIG_CRYPTO_CRYPTD=m
CONFIG_CRYPTO_AUTHENC=m
CONFIG_CRYPTO_TEST=m

#
# Authenticated Encryption with Associated Data
#
CONFIG_CRYPTO_CCM=m
CONFIG_CRYPTO_GCM=m
CONFIG_CRYPTO_SEQIV=m

#
# Block modes
#
CONFIG_CRYPTO_CBC=m
CONFIG_CRYPTO_CTR=m
CONFIG_CRYPTO_CTS=m
CONFIG_CRYPTO_ECB=m
CONFIG_CRYPTO_LRW=m
CONFIG_CRYPTO_PCBC=m
CONFIG_CRYPTO_XTS=m

#
# Hash modes
#
CONFIG_CRYPTO_HMAC=m
CONFIG_CRYPTO_XCBC=m
CONFIG_CRYPTO_VMAC=m

#
# Digest
#
CONFIG_CRYPTO_CRC32C=m
CONFIG_CRYPTO_CRC32C_INTEL=m
CONFIG_CRYPTO_GHASH=m
CONFIG_CRYPTO_MD4=m
CONFIG_CRYPTO_MD5=y
CONFIG_CRYPTO_MICHAEL_MIC=m
CONFIG_CRYPTO_RMD128=m
CONFIG_CRYPTO_RMD160=m
CONFIG_CRYPTO_RMD256=m
CONFIG_CRYPTO_RMD320=m
CONFIG_CRYPTO_SHA1=m
CONFIG_CRYPTO_SHA256=m
CONFIG_CRYPTO_SHA512=m
CONFIG_CRYPTO_TGR192=m
CONFIG_CRYPTO_WP512=m
CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL=m

#
# Ciphers
#
CONFIG_CRYPTO_AES=m
CONFIG_CRYPTO_AES_X86_64=m
# CONFIG_CRYPTO_AES_NI_INTEL is not set
CONFIG_CRYPTO_ANUBIS=m
CONFIG_CRYPTO_ARC4=m
CONFIG_CRYPTO_BLOWFISH=m
CONFIG_CRYPTO_CAMELLIA=m
CONFIG_CRYPTO_CAST5=m
CONFIG_CRYPTO_CAST6=m
CONFIG_CRYPTO_DES=m
CONFIG_CRYPTO_FCRYPT=m
CONFIG_CRYPTO_KHAZAD=m
# CONFIG_CRYPTO_SALSA20 is not set
CONFIG_CRYPTO_SALSA20_X86_64=m
CONFIG_CRYPTO_SEED=m
CONFIG_CRYPTO_SERPENT=m
CONFIG_CRYPTO_TEA=m
# CONFIG_CRYPTO_TWOFISH is not set
CONFIG_CRYPTO_TWOFISH_COMMON=m
CONFIG_CRYPTO_TWOFISH_X86_64=m

#
# Compression
#
CONFIG_CRYPTO_DEFLATE=m
CONFIG_CRYPTO_ZLIB=m
CONFIG_CRYPTO_LZO=m
CONFIG_CRYPTO_LZF=m

#
# Random Number Generation
#
CONFIG_CRYPTO_ANSI_CPRNG=m
CONFIG_CRYPTO_HW=y
# CONFIG_CRYPTO_DEV_PADLOCK is not set
# CONFIG_CRYPTO_DEV_HIFN_795X is not set
CONFIG_HAVE_KVM=y
CONFIG_HAVE_KVM_IRQCHIP=y
CONFIG_HAVE_KVM_EVENTFD=y
CONFIG_KVM_APIC_ARCHITECTURE=y
CONFIG_VIRTUALIZATION=y
CONFIG_KVM=m
CONFIG_KVM_INTEL=m
# CONFIG_KVM_AMD is not set
CONFIG_VIRTIO=m
CONFIG_VIRTIO_RING=m
CONFIG_VIRTIO_PCI=m
CONFIG_VIRTIO_BALLOON=m
CONFIG_BINARY_PRINTF=y

#
# Library routines
#
CONFIG_BITREVERSE=y
CONFIG_GENERIC_FIND_FIRST_BIT=y
CONFIG_GENERIC_FIND_NEXT_BIT=y
CONFIG_GENERIC_FIND_LAST_BIT=y
CONFIG_CRC_CCITT=m
CONFIG_CRC16=m
CONFIG_CRC_T10DIF=m
CONFIG_CRC_ITU_T=m
CONFIG_CRC32=y
CONFIG_CRC7=m
CONFIG_LIBCRC32C=m
CONFIG_ZLIB_INFLATE=y
CONFIG_ZLIB_DEFLATE=m
CONFIG_LZO_COMPRESS=m
CONFIG_LZO_DECOMPRESS=y
CONFIG_DECOMPRESS_GZIP=y
CONFIG_DECOMPRESS_BZIP2=y
CONFIG_DECOMPRESS_LZMA=y
CONFIG_DECOMPRESS_LZO=y
CONFIG_REED_SOLOMON=m
CONFIG_REED_SOLOMON_DEC16=y
CONFIG_TEXTSEARCH=y
CONFIG_TEXTSEARCH_KMP=m
CONFIG_TEXTSEARCH_BM=m
CONFIG_TEXTSEARCH_FSM=m
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y
CONFIG_HAS_DMA=y
CONFIG_NLATTR=y

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-10 13:21                       ` Pedro Ribeiro
  0 siblings, 0 replies; 221+ messages in thread
From: Pedro Ribeiro @ 2010-04-10 13:21 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Alan Stern, Robert Hancock, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b, Greg KH,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-usb-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 1131 bytes --]

On 10 April 2010 13:49, Daniel Mack <daniel-rDUAYElUppE@public.gmane.org> wrote:
> On Fri, Apr 09, 2010 at 07:19:22PM +0100, Pedro Ribeiro wrote:
>> On 9 April 2010 19:09, Daniel Mack <daniel-rDUAYElUppE@public.gmane.org> wrote:
>> > On Fri, Apr 09, 2010 at 12:01:27PM -0400, Alan Stern wrote:
>> >> I don't see anything suspicious.  The transfer_buffer addresses repeat
>> >> every 32 URBs, and the DMA addresses cycle almost entirely uniformly
>> >> from 0x20000000 to 0x23ffffff in units of 0x2000 (there are a few gaps
>> >> where the interval is a little bigger).
>> >
>> > The DMA pointers do indeed look sane. I wanted to take a deeper look at
>> > this and set up a 64bit system today. However, I fail to see the problem
>> > here. Pedro, how much RAM does your machine have installed?
>> >
>> > Daniel
>> >
>> >
>>
>> It has 4 GB.
>
> Upgraded my machine now to 4GB, but I still can't reproduce this bug.
> Pedro, can you send your config, please?
>
> Daniel
>

Here it is. It is configured for realtime and TuxOnIce patches.
However, the bug still occurs without these kernel patches.

Pedro

[-- Attachment #2: .config_2.6.33-rt-ToI --]
[-- Type: application/octet-stream, Size: 90819 bytes --]

#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.33-rt4
# Sat Mar 13 10:36:34 2010
#
CONFIG_64BIT=y
# CONFIG_X86_32 is not set
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"
CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"
CONFIG_GENERIC_TIME=y
CONFIG_GENERIC_CMOS_UPDATE=y
CONFIG_CLOCKSOURCE_WATCHDOG=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
CONFIG_MMU=y
CONFIG_ZONE_DMA=y
CONFIG_GENERIC_ISA_DMA=y
CONFIG_GENERIC_IOMAP=y
CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_ARCH_MAY_HAVE_PC_FDC=y
CONFIG_RWSEM_GENERIC_SPINLOCK=y
CONFIG_ASM_SEMAPHORES=y
CONFIG_ARCH_HAS_CPU_IDLE_WAIT=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_GENERIC_TIME_VSYSCALL=y
CONFIG_ARCH_HAS_CPU_RELAX=y
CONFIG_ARCH_HAS_DEFAULT_IDLE=y
CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
CONFIG_HAVE_SETUP_PER_CPU_AREA=y
CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y
CONFIG_HAVE_CPUMASK_OF_CPU_MAP=y
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_ZONE_DMA32=y
CONFIG_ARCH_POPULATES_NODE_MAP=y
CONFIG_AUDIT_ARCH=y
CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y
CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
CONFIG_GENERIC_HARDIRQS=y
CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_GENERIC_PENDING_IRQ=y
CONFIG_USE_GENERIC_SMP_HELPERS=y
CONFIG_X86_64_SMP=y
CONFIG_X86_HT=y
CONFIG_X86_TRAMPOLINE=y
# CONFIG_KTIME_SCALAR is not set
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
CONFIG_CONSTRUCTORS=y

#
# General setup
#
CONFIG_EXPERIMENTAL=y
CONFIG_LOCK_KERNEL=y
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_LOCALVERSION=""
# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_HAVE_KERNEL_GZIP=y
CONFIG_HAVE_KERNEL_BZIP2=y
CONFIG_HAVE_KERNEL_LZMA=y
CONFIG_HAVE_KERNEL_LZO=y
CONFIG_KERNEL_GZIP=y
# CONFIG_KERNEL_BZIP2 is not set
# CONFIG_KERNEL_LZMA is not set
# CONFIG_KERNEL_LZO is not set
CONFIG_SWAP=y
CONFIG_SYSVIPC=y
CONFIG_SYSVIPC_SYSCTL=y
CONFIG_POSIX_MQUEUE=y
CONFIG_POSIX_MQUEUE_SYSCTL=y
CONFIG_BSD_PROCESS_ACCT=y
CONFIG_BSD_PROCESS_ACCT_V3=y
CONFIG_TASKSTATS=y
CONFIG_TASK_DELAY_ACCT=y
CONFIG_TASK_XACCT=y
CONFIG_TASK_IO_ACCOUNTING=y
CONFIG_AUDIT=y
CONFIG_AUDITSYSCALL=y
CONFIG_AUDIT_TREE=y

#
# RCU Subsystem
#
# CONFIG_TREE_RCU is not set
CONFIG_TREE_PREEMPT_RCU=y
# CONFIG_TINY_RCU is not set
# CONFIG_RCU_TRACE is not set
CONFIG_RCU_FANOUT=32
# CONFIG_RCU_FANOUT_EXACT is not set
# CONFIG_TREE_RCU_TRACE is not set
# CONFIG_IKCONFIG is not set
CONFIG_LOG_BUF_SHIFT=17
CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y
CONFIG_GROUP_SCHED=y
CONFIG_FAIR_GROUP_SCHED=y
CONFIG_RT_GROUP_SCHED=y
# CONFIG_USER_SCHED is not set
CONFIG_CGROUP_SCHED=y
CONFIG_CGROUPS=y
# CONFIG_CGROUP_DEBUG is not set
CONFIG_CGROUP_NS=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CPUSETS=y
CONFIG_PROC_PID_CPUSET=y
CONFIG_CGROUP_CPUACCT=y
# CONFIG_RESOURCE_COUNTERS is not set
# CONFIG_SYSFS_DEPRECATED_V2 is not set
CONFIG_RELAY=y
CONFIG_NAMESPACES=y
CONFIG_UTS_NS=y
CONFIG_IPC_NS=y
CONFIG_USER_NS=y
CONFIG_PID_NS=y
CONFIG_NET_NS=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_RD_GZIP=y
CONFIG_RD_BZIP2=y
CONFIG_RD_LZMA=y
CONFIG_RD_LZO=y
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
CONFIG_SYSCTL=y
CONFIG_ANON_INODES=y
# CONFIG_EMBEDDED is not set
CONFIG_UID16=y
CONFIG_SYSCTL_SYSCALL=y
CONFIG_KALLSYMS=y
CONFIG_KALLSYMS_ALL=y
# CONFIG_KALLSYMS_EXTRA_PASS is not set
CONFIG_HOTPLUG=y
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
CONFIG_PCSPKR_PLATFORM=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
CONFIG_EPOLL=y
CONFIG_SIGNALFD=y
CONFIG_TIMERFD=y
CONFIG_EVENTFD=y
CONFIG_SHMEM=y
CONFIG_AIO=y
CONFIG_HAVE_PERF_EVENTS=y

#
# Kernel Performance Events And Counters
#
CONFIG_PERF_EVENTS=y
CONFIG_EVENT_PROFILE=y
# CONFIG_PERF_COUNTERS is not set
# CONFIG_DEBUG_PERF_USE_VMALLOC is not set
CONFIG_VM_EVENT_COUNTERS=y
CONFIG_PCI_QUIRKS=y
# CONFIG_COMPAT_BRK is not set
CONFIG_SLAB=y
# CONFIG_SLUB is not set
# CONFIG_SLOB is not set
CONFIG_PROFILING=y
CONFIG_TRACEPOINTS=y
CONFIG_OPROFILE=m
CONFIG_OPROFILE_IBS=y
# CONFIG_OPROFILE_EVENT_MULTIPLEX is not set
CONFIG_HAVE_OPROFILE=y
CONFIG_PROFILE_NMI=y
# CONFIG_KPROBES is not set
CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
CONFIG_USER_RETURN_NOTIFIER=y
CONFIG_HAVE_IOREMAP_PROT=y
CONFIG_HAVE_KPROBES=y
CONFIG_HAVE_KRETPROBES=y
CONFIG_HAVE_ARCH_TRACEHOOK=y
CONFIG_HAVE_DMA_ATTRS=y
CONFIG_HAVE_DMA_API_DEBUG=y
CONFIG_HAVE_HW_BREAKPOINT=y
CONFIG_HAVE_USER_RETURN_NOTIFIER=y

#
# GCOV-based kernel profiling
#
# CONFIG_GCOV_KERNEL is not set
CONFIG_SLOW_WORK=y
# CONFIG_SLOW_WORK_DEBUG is not set
# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
CONFIG_SLABINFO=y
CONFIG_RT_MUTEXES=y
CONFIG_BASE_SMALL=0
CONFIG_MODULES=y
CONFIG_MODULE_FORCE_LOAD=y
CONFIG_MODULE_UNLOAD=y
CONFIG_MODULE_FORCE_UNLOAD=y
CONFIG_MODVERSIONS=y
# CONFIG_MODULE_SRCVERSION_ALL is not set
CONFIG_STOP_MACHINE=y
CONFIG_BLOCK=y
CONFIG_BLK_DEV_BSG=y
CONFIG_BLK_DEV_INTEGRITY=y
# CONFIG_BLK_CGROUP is not set
CONFIG_BLOCK_COMPAT=y

#
# IO Schedulers
#
CONFIG_IOSCHED_NOOP=y
CONFIG_IOSCHED_DEADLINE=y
CONFIG_IOSCHED_CFQ=y
# CONFIG_CFQ_GROUP_IOSCHED is not set
# CONFIG_DEFAULT_DEADLINE is not set
CONFIG_DEFAULT_CFQ=y
# CONFIG_DEFAULT_NOOP is not set
CONFIG_DEFAULT_IOSCHED="cfq"
CONFIG_PREEMPT_NOTIFIERS=y
# CONFIG_INLINE_SPIN_TRYLOCK is not set
# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
# CONFIG_INLINE_SPIN_LOCK is not set
# CONFIG_INLINE_SPIN_LOCK_BH is not set
# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
# CONFIG_INLINE_SPIN_UNLOCK is not set
# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
# CONFIG_INLINE_SPIN_UNLOCK_IRQ is not set
# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
# CONFIG_INLINE_READ_TRYLOCK is not set
# CONFIG_INLINE_READ_LOCK is not set
# CONFIG_INLINE_READ_LOCK_BH is not set
# CONFIG_INLINE_READ_LOCK_IRQ is not set
# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
# CONFIG_INLINE_READ_UNLOCK is not set
# CONFIG_INLINE_READ_UNLOCK_BH is not set
# CONFIG_INLINE_READ_UNLOCK_IRQ is not set
# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
# CONFIG_INLINE_WRITE_TRYLOCK is not set
# CONFIG_INLINE_WRITE_LOCK is not set
# CONFIG_INLINE_WRITE_LOCK_BH is not set
# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
# CONFIG_INLINE_WRITE_UNLOCK is not set
# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
# CONFIG_INLINE_WRITE_UNLOCK_IRQ is not set
# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
CONFIG_MUTEX_SPIN_ON_OWNER=y
CONFIG_FREEZER=y

#
# Processor type and features
#
CONFIG_TICK_ONESHOT=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
CONFIG_SMP=y
CONFIG_X86_MPPARSE=y
# CONFIG_X86_EXTENDED_PLATFORM is not set
CONFIG_X86_SUPPORTS_MEMORY_FAILURE=y
CONFIG_SCHED_OMIT_FRAME_POINTER=y
# CONFIG_PARAVIRT_GUEST is not set
# CONFIG_MEMTEST is not set
# CONFIG_M386 is not set
# CONFIG_M486 is not set
# CONFIG_M586 is not set
# CONFIG_M586TSC is not set
# CONFIG_M586MMX is not set
# CONFIG_M686 is not set
# CONFIG_MPENTIUMII is not set
# CONFIG_MPENTIUMIII is not set
# CONFIG_MPENTIUMM is not set
# CONFIG_MPENTIUM4 is not set
# CONFIG_MK6 is not set
# CONFIG_MK7 is not set
# CONFIG_MK8 is not set
# CONFIG_MCRUSOE is not set
# CONFIG_MEFFICEON is not set
# CONFIG_MWINCHIPC6 is not set
# CONFIG_MWINCHIP3D is not set
# CONFIG_MGEODEGX1 is not set
# CONFIG_MGEODE_LX is not set
# CONFIG_MCYRIXIII is not set
# CONFIG_MVIAC3_2 is not set
# CONFIG_MVIAC7 is not set
# CONFIG_MPSC is not set
CONFIG_MCORE2=y
# CONFIG_MATOM is not set
# CONFIG_GENERIC_CPU is not set
CONFIG_X86_CPU=y
CONFIG_X86_INTERNODE_CACHE_SHIFT=6
CONFIG_X86_CMPXCHG=y
CONFIG_X86_L1_CACHE_SHIFT=6
CONFIG_X86_WP_WORKS_OK=y
CONFIG_X86_INTEL_USERCOPY=y
CONFIG_X86_USE_PPRO_CHECKSUM=y
CONFIG_X86_P6_NOP=y
CONFIG_X86_TSC=y
CONFIG_X86_CMPXCHG64=y
CONFIG_X86_CMOV=y
CONFIG_X86_MINIMUM_CPU_FAMILY=64
CONFIG_X86_DEBUGCTLMSR=y
CONFIG_CPU_SUP_INTEL=y
CONFIG_CPU_SUP_AMD=y
CONFIG_CPU_SUP_CENTAUR=y
# CONFIG_X86_DS is not set
CONFIG_HPET_TIMER=y
CONFIG_HPET_EMULATE_RTC=y
CONFIG_DMI=y
CONFIG_GART_IOMMU=y
# CONFIG_CALGARY_IOMMU is not set
# CONFIG_AMD_IOMMU is not set
CONFIG_SWIOTLB=y
CONFIG_IOMMU_HELPER=y
# CONFIG_IOMMU_API is not set
CONFIG_NR_CPUS=4
# CONFIG_SCHED_SMT is not set
CONFIG_SCHED_MC=y
# CONFIG_PREEMPT_NONE is not set
# CONFIG_PREEMPT_VOLUNTARY is not set
# CONFIG_PREEMPT_DESKTOP is not set
CONFIG_PREEMPT_RT=y
CONFIG_PREEMPT=y
CONFIG_PREEMPT_SOFTIRQS=y
CONFIG_PREEMPT_HARDIRQS=y
CONFIG_X86_LOCAL_APIC=y
CONFIG_X86_IO_APIC=y
CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS=y
CONFIG_X86_MCE=y
CONFIG_X86_MCE_INTEL=y
# CONFIG_X86_MCE_AMD is not set
CONFIG_X86_MCE_THRESHOLD=y
# CONFIG_X86_MCE_INJECT is not set
CONFIG_X86_THERMAL_VECTOR=y
# CONFIG_I8K is not set
CONFIG_MICROCODE=m
CONFIG_MICROCODE_INTEL=y
# CONFIG_MICROCODE_AMD is not set
CONFIG_MICROCODE_OLD_INTERFACE=y
CONFIG_X86_MSR=m
CONFIG_X86_CPUID=m
CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
CONFIG_DIRECT_GBPAGES=y
# CONFIG_NUMA is not set
CONFIG_ARCH_PROC_KCORE_TEXT=y
CONFIG_ARCH_SPARSEMEM_DEFAULT=y
CONFIG_ARCH_SPARSEMEM_ENABLE=y
CONFIG_ARCH_SELECT_MEMORY_MODEL=y
CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
CONFIG_SELECT_MEMORY_MODEL=y
# CONFIG_FLATMEM_MANUAL is not set
# CONFIG_DISCONTIGMEM_MANUAL is not set
CONFIG_SPARSEMEM_MANUAL=y
CONFIG_SPARSEMEM=y
CONFIG_HAVE_MEMORY_PRESENT=y
CONFIG_SPARSEMEM_EXTREME=y
CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
CONFIG_SPARSEMEM_VMEMMAP=y
# CONFIG_MEMORY_HOTPLUG is not set
CONFIG_PAGEFLAGS_EXTENDED=y
CONFIG_SPLIT_PTLOCK_CPUS=4
CONFIG_PHYS_ADDR_T_64BIT=y
CONFIG_ZONE_DMA_FLAG=1
CONFIG_BOUNCE=y
CONFIG_VIRT_TO_BUS=y
CONFIG_MMU_NOTIFIER=y
CONFIG_KSM=y
CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y
# CONFIG_MEMORY_FAILURE is not set
# CONFIG_X86_CHECK_BIOS_CORRUPTION is not set
CONFIG_X86_RESERVE_LOW_64K=y
CONFIG_MTRR=y
CONFIG_MTRR_SANITIZER=y
CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=0
CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT=1
CONFIG_X86_PAT=y
CONFIG_ARCH_USES_PG_UNCACHED=y
CONFIG_EFI=y
CONFIG_SECCOMP=y
# CONFIG_CC_STACKPROTECTOR is not set
# CONFIG_HZ_100 is not set
# CONFIG_HZ_250 is not set
# CONFIG_HZ_300 is not set
CONFIG_HZ_1000=y
CONFIG_HZ=1000
CONFIG_SCHED_HRTICK=y
CONFIG_KEXEC=y
# CONFIG_CRASH_DUMP is not set
# CONFIG_KEXEC_JUMP is not set
CONFIG_PHYSICAL_START=0x1000000
CONFIG_RELOCATABLE=y
CONFIG_PHYSICAL_ALIGN=0x1000000
CONFIG_HOTPLUG_CPU=y
# CONFIG_COMPAT_VDSO is not set
# CONFIG_CMDLINE_BOOL is not set
CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y

#
# Power management and ACPI options
#
CONFIG_ARCH_HIBERNATION_HEADER=y
CONFIG_PM=y
# CONFIG_PM_DEBUG is not set
CONFIG_PM_SLEEP_SMP=y
CONFIG_PM_SLEEP=y
CONFIG_SUSPEND=y
CONFIG_SUSPEND_FREEZER=y
CONFIG_HIBERNATION_NVS=y
CONFIG_HIBERNATION=y
CONFIG_PM_STD_PARTITION=""
CONFIG_TOI_CORE=y

#
# Image Storage (you need at least one allocator)
#
CONFIG_TOI_FILE=y
CONFIG_TOI_SWAP=y

#
# General Options
#
CONFIG_TOI_CRYPTO=y
CONFIG_TOI_USERUI=y
CONFIG_TOI_USERUI_DEFAULT_PATH="/usr/local/sbin/tuxoniceui_text"
# CONFIG_TOI_KEEP_IMAGE is not set
CONFIG_TOI_REPLACE_SWSUSP=y
CONFIG_TOI_IGNORE_LATE_INITCALL=y
CONFIG_TOI_DEFAULT_WAIT=25
CONFIG_TOI_DEFAULT_EXTRA_PAGES_ALLOWANCE=2000
# CONFIG_TOI_CHECKSUM is not set
CONFIG_TOI=y
CONFIG_PM_RUNTIME=y
CONFIG_ACPI=y
CONFIG_ACPI_SLEEP=y
CONFIG_ACPI_PROCFS=y
# CONFIG_ACPI_PROCFS_POWER is not set
# CONFIG_ACPI_POWER_METER is not set
CONFIG_ACPI_SYSFS_POWER=y
# CONFIG_ACPI_PROC_EVENT is not set
CONFIG_ACPI_AC=m
CONFIG_ACPI_BATTERY=m
CONFIG_ACPI_BUTTON=m
CONFIG_ACPI_VIDEO=m
CONFIG_ACPI_FAN=m
CONFIG_ACPI_DOCK=y
CONFIG_ACPI_PROCESSOR=m
CONFIG_ACPI_HOTPLUG_CPU=y
CONFIG_ACPI_PROCESSOR_AGGREGATOR=m
CONFIG_ACPI_THERMAL=m
# CONFIG_ACPI_CUSTOM_DSDT is not set
CONFIG_ACPI_BLACKLIST_YEAR=0
# CONFIG_ACPI_DEBUG is not set
CONFIG_ACPI_PCI_SLOT=m
CONFIG_X86_PM_TIMER=y
CONFIG_ACPI_CONTAINER=m
CONFIG_ACPI_SBS=m
# CONFIG_SFI is not set

#
# CPU Frequency scaling
#
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_TABLE=y
# CONFIG_CPU_FREQ_DEBUG is not set
CONFIG_CPU_FREQ_STAT=m
# CONFIG_CPU_FREQ_STAT_DETAILS is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
CONFIG_CPU_FREQ_GOV_USERSPACE=m
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set

#
# CPUFreq processor drivers
#
CONFIG_X86_ACPI_CPUFREQ=m
# CONFIG_X86_POWERNOW_K8 is not set
# CONFIG_X86_SPEEDSTEP_CENTRINO is not set
# CONFIG_X86_P4_CLOCKMOD is not set

#
# shared options
#
# CONFIG_X86_SPEEDSTEP_LIB is not set
CONFIG_CPU_IDLE=y
CONFIG_CPU_IDLE_GOV_LADDER=y
CONFIG_CPU_IDLE_GOV_MENU=y

#
# Memory power savings
#
# CONFIG_I7300_IDLE is not set

#
# Bus options (PCI etc.)
#
CONFIG_PCI=y
CONFIG_PCI_DIRECT=y
CONFIG_PCI_MMCONFIG=y
CONFIG_PCI_DOMAINS=y
CONFIG_PCIEPORTBUS=y
CONFIG_HOTPLUG_PCI_PCIE=m
CONFIG_PCIEAER=y
# CONFIG_PCIE_ECRC is not set
# CONFIG_PCIEAER_INJECT is not set
CONFIG_PCIEASPM=y
# CONFIG_PCIEASPM_DEBUG is not set
CONFIG_ARCH_SUPPORTS_MSI=y
CONFIG_PCI_MSI=y
CONFIG_PCI_LEGACY=y
# CONFIG_PCI_DEBUG is not set
CONFIG_PCI_STUB=m
CONFIG_HT_IRQ=y
CONFIG_PCI_IOV=y
CONFIG_PCI_IOAPIC=y
CONFIG_ISA_DMA_API=y
CONFIG_K8_NB=y
CONFIG_PCCARD=m
CONFIG_PCMCIA=m
CONFIG_PCMCIA_LOAD_CIS=y
# CONFIG_PCMCIA_IOCTL is not set
CONFIG_CARDBUS=y

#
# PC-card bridges
#
CONFIG_YENTA=m
CONFIG_YENTA_O2=y
CONFIG_YENTA_RICOH=y
CONFIG_YENTA_TI=y
CONFIG_YENTA_ENE_TUNE=y
CONFIG_YENTA_TOSHIBA=y
CONFIG_PD6729=m
CONFIG_I82092=m
CONFIG_PCCARD_NONSTATIC=m
CONFIG_HOTPLUG_PCI=m
CONFIG_HOTPLUG_PCI_FAKE=m
CONFIG_HOTPLUG_PCI_ACPI=m
CONFIG_HOTPLUG_PCI_ACPI_IBM=m
# CONFIG_HOTPLUG_PCI_CPCI is not set
CONFIG_HOTPLUG_PCI_SHPC=m

#
# Executable file formats / Emulations
#
CONFIG_BINFMT_ELF=y
CONFIG_COMPAT_BINFMT_ELF=y
CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
# CONFIG_HAVE_AOUT is not set
CONFIG_BINFMT_MISC=m
CONFIG_IA32_EMULATION=y
CONFIG_IA32_AOUT=y
CONFIG_COMPAT=y
CONFIG_COMPAT_FOR_U64_ALIGNMENT=y
CONFIG_SYSVIPC_COMPAT=y
CONFIG_NET=y
CONFIG_COMPAT_NETLINK_MESSAGES=y

#
# Networking options
#
CONFIG_PACKET=y
CONFIG_PACKET_MMAP=y
CONFIG_UNIX=y
CONFIG_XFRM=y
CONFIG_XFRM_USER=m
# CONFIG_XFRM_SUB_POLICY is not set
# CONFIG_XFRM_MIGRATE is not set
# CONFIG_XFRM_STATISTICS is not set
CONFIG_XFRM_IPCOMP=m
CONFIG_NET_KEY=m
# CONFIG_NET_KEY_MIGRATE is not set
CONFIG_INET=y
CONFIG_IP_MULTICAST=y
CONFIG_IP_ADVANCED_ROUTER=y
CONFIG_ASK_IP_FIB_HASH=y
# CONFIG_IP_FIB_TRIE is not set
CONFIG_IP_FIB_HASH=y
CONFIG_IP_MULTIPLE_TABLES=y
CONFIG_IP_ROUTE_MULTIPATH=y
CONFIG_IP_ROUTE_VERBOSE=y
# CONFIG_IP_PNP is not set
CONFIG_NET_IPIP=m
CONFIG_NET_IPGRE=m
CONFIG_NET_IPGRE_BROADCAST=y
CONFIG_IP_MROUTE=y
CONFIG_IP_PIMSM_V1=y
CONFIG_IP_PIMSM_V2=y
# CONFIG_ARPD is not set
CONFIG_SYN_COOKIES=y
CONFIG_INET_AH=m
CONFIG_INET_ESP=m
CONFIG_INET_IPCOMP=m
CONFIG_INET_XFRM_TUNNEL=m
CONFIG_INET_TUNNEL=m
CONFIG_INET_XFRM_MODE_TRANSPORT=m
CONFIG_INET_XFRM_MODE_TUNNEL=m
CONFIG_INET_XFRM_MODE_BEET=m
CONFIG_INET_LRO=y
CONFIG_INET_DIAG=m
CONFIG_INET_TCP_DIAG=m
CONFIG_TCP_CONG_ADVANCED=y
CONFIG_TCP_CONG_BIC=m
CONFIG_TCP_CONG_CUBIC=y
CONFIG_TCP_CONG_WESTWOOD=m
CONFIG_TCP_CONG_HTCP=m
CONFIG_TCP_CONG_HSTCP=m
CONFIG_TCP_CONG_HYBLA=m
CONFIG_TCP_CONG_VEGAS=m
CONFIG_TCP_CONG_SCALABLE=m
CONFIG_TCP_CONG_LP=m
CONFIG_TCP_CONG_VENO=m
CONFIG_TCP_CONG_YEAH=m
CONFIG_TCP_CONG_ILLINOIS=m
# CONFIG_DEFAULT_BIC is not set
CONFIG_DEFAULT_CUBIC=y
# CONFIG_DEFAULT_HTCP is not set
# CONFIG_DEFAULT_VEGAS is not set
# CONFIG_DEFAULT_WESTWOOD is not set
# CONFIG_DEFAULT_RENO is not set
CONFIG_DEFAULT_TCP_CONG="cubic"
CONFIG_TCP_MD5SIG=y
CONFIG_IPV6=m
CONFIG_IPV6_PRIVACY=y
CONFIG_IPV6_ROUTER_PREF=y
CONFIG_IPV6_ROUTE_INFO=y
CONFIG_IPV6_OPTIMISTIC_DAD=y
CONFIG_INET6_AH=m
CONFIG_INET6_ESP=m
CONFIG_INET6_IPCOMP=m
CONFIG_IPV6_MIP6=m
CONFIG_INET6_XFRM_TUNNEL=m
CONFIG_INET6_TUNNEL=m
CONFIG_INET6_XFRM_MODE_TRANSPORT=m
CONFIG_INET6_XFRM_MODE_TUNNEL=m
CONFIG_INET6_XFRM_MODE_BEET=m
CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m
CONFIG_IPV6_SIT=m
# CONFIG_IPV6_SIT_6RD is not set
CONFIG_IPV6_NDISC_NODETYPE=y
CONFIG_IPV6_TUNNEL=m
CONFIG_IPV6_MULTIPLE_TABLES=y
CONFIG_IPV6_SUBTREES=y
CONFIG_IPV6_MROUTE=y
CONFIG_IPV6_PIMSM_V2=y
# CONFIG_NETLABEL is not set
CONFIG_NETWORK_SECMARK=y
CONFIG_NETFILTER=y
# CONFIG_NETFILTER_DEBUG is not set
CONFIG_NETFILTER_ADVANCED=y
CONFIG_BRIDGE_NETFILTER=y

#
# Core Netfilter Configuration
#
CONFIG_NETFILTER_NETLINK=m
CONFIG_NETFILTER_NETLINK_QUEUE=m
CONFIG_NETFILTER_NETLINK_LOG=m
CONFIG_NF_CONNTRACK=m
CONFIG_NF_CT_ACCT=y
CONFIG_NF_CONNTRACK_MARK=y
CONFIG_NF_CONNTRACK_SECMARK=y
CONFIG_NF_CONNTRACK_EVENTS=y
CONFIG_NF_CT_PROTO_DCCP=m
CONFIG_NF_CT_PROTO_GRE=m
CONFIG_NF_CT_PROTO_SCTP=m
CONFIG_NF_CT_PROTO_UDPLITE=m
CONFIG_NF_CONNTRACK_AMANDA=m
CONFIG_NF_CONNTRACK_FTP=m
CONFIG_NF_CONNTRACK_H323=m
CONFIG_NF_CONNTRACK_IRC=m
CONFIG_NF_CONNTRACK_NETBIOS_NS=m
CONFIG_NF_CONNTRACK_PPTP=m
CONFIG_NF_CONNTRACK_SANE=m
CONFIG_NF_CONNTRACK_SIP=m
CONFIG_NF_CONNTRACK_TFTP=m
CONFIG_NF_CT_NETLINK=m
CONFIG_NETFILTER_TPROXY=m
CONFIG_NETFILTER_XTABLES=m
CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m
CONFIG_NETFILTER_XT_TARGET_DSCP=m
CONFIG_NETFILTER_XT_TARGET_HL=m
CONFIG_NETFILTER_XT_TARGET_LED=m
CONFIG_NETFILTER_XT_TARGET_MARK=m
CONFIG_NETFILTER_XT_TARGET_NFLOG=m
CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
CONFIG_NETFILTER_XT_TARGET_RATEEST=m
CONFIG_NETFILTER_XT_TARGET_TPROXY=m
CONFIG_NETFILTER_XT_TARGET_TRACE=m
CONFIG_NETFILTER_XT_TARGET_SECMARK=m
CONFIG_NETFILTER_XT_TARGET_TCPMSS=m
CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP=m
CONFIG_NETFILTER_XT_MATCH_CLUSTER=m
CONFIG_NETFILTER_XT_MATCH_COMMENT=m
CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m
CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
CONFIG_NETFILTER_XT_MATCH_DCCP=m
CONFIG_NETFILTER_XT_MATCH_DSCP=m
CONFIG_NETFILTER_XT_MATCH_ESP=m
CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
CONFIG_NETFILTER_XT_MATCH_HELPER=m
CONFIG_NETFILTER_XT_MATCH_HL=m
CONFIG_NETFILTER_XT_MATCH_IPRANGE=m
CONFIG_NETFILTER_XT_MATCH_LENGTH=m
CONFIG_NETFILTER_XT_MATCH_LIMIT=m
CONFIG_NETFILTER_XT_MATCH_MAC=m
CONFIG_NETFILTER_XT_MATCH_MARK=m
CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
CONFIG_NETFILTER_XT_MATCH_OWNER=m
CONFIG_NETFILTER_XT_MATCH_POLICY=m
CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m
CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
CONFIG_NETFILTER_XT_MATCH_QUOTA=m
CONFIG_NETFILTER_XT_MATCH_RATEEST=m
CONFIG_NETFILTER_XT_MATCH_REALM=m
CONFIG_NETFILTER_XT_MATCH_RECENT=m
# CONFIG_NETFILTER_XT_MATCH_RECENT_PROC_COMPAT is not set
CONFIG_NETFILTER_XT_MATCH_SCTP=m
CONFIG_NETFILTER_XT_MATCH_SOCKET=m
CONFIG_NETFILTER_XT_MATCH_STATE=m
CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
CONFIG_NETFILTER_XT_MATCH_STRING=m
CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
CONFIG_NETFILTER_XT_MATCH_TIME=m
CONFIG_NETFILTER_XT_MATCH_U32=m
CONFIG_NETFILTER_XT_MATCH_OSF=m
CONFIG_IP_VS=m
# CONFIG_IP_VS_IPV6 is not set
# CONFIG_IP_VS_DEBUG is not set
CONFIG_IP_VS_TAB_BITS=12

#
# IPVS transport protocol load balancing support
#
CONFIG_IP_VS_PROTO_TCP=y
CONFIG_IP_VS_PROTO_UDP=y
CONFIG_IP_VS_PROTO_AH_ESP=y
CONFIG_IP_VS_PROTO_ESP=y
CONFIG_IP_VS_PROTO_AH=y

#
# IPVS scheduler
#
CONFIG_IP_VS_RR=m
CONFIG_IP_VS_WRR=m
CONFIG_IP_VS_LC=m
CONFIG_IP_VS_WLC=m
CONFIG_IP_VS_LBLC=m
CONFIG_IP_VS_LBLCR=m
CONFIG_IP_VS_DH=m
CONFIG_IP_VS_SH=m
CONFIG_IP_VS_SED=m
CONFIG_IP_VS_NQ=m

#
# IPVS application helper
#
CONFIG_IP_VS_FTP=m

#
# IP: Netfilter Configuration
#
CONFIG_NF_DEFRAG_IPV4=m
CONFIG_NF_CONNTRACK_IPV4=m
CONFIG_NF_CONNTRACK_PROC_COMPAT=y
CONFIG_IP_NF_QUEUE=m
CONFIG_IP_NF_IPTABLES=m
CONFIG_IP_NF_MATCH_ADDRTYPE=m
CONFIG_IP_NF_MATCH_AH=m
CONFIG_IP_NF_MATCH_ECN=m
CONFIG_IP_NF_MATCH_TTL=m
CONFIG_IP_NF_FILTER=m
CONFIG_IP_NF_TARGET_REJECT=m
CONFIG_IP_NF_TARGET_LOG=m
CONFIG_IP_NF_TARGET_ULOG=m
CONFIG_NF_NAT=m
CONFIG_NF_NAT_NEEDED=y
CONFIG_IP_NF_TARGET_MASQUERADE=m
CONFIG_IP_NF_TARGET_NETMAP=m
CONFIG_IP_NF_TARGET_REDIRECT=m
CONFIG_NF_NAT_SNMP_BASIC=m
CONFIG_NF_NAT_PROTO_DCCP=m
CONFIG_NF_NAT_PROTO_GRE=m
CONFIG_NF_NAT_PROTO_UDPLITE=m
CONFIG_NF_NAT_PROTO_SCTP=m
CONFIG_NF_NAT_FTP=m
CONFIG_NF_NAT_IRC=m
CONFIG_NF_NAT_TFTP=m
CONFIG_NF_NAT_AMANDA=m
CONFIG_NF_NAT_PPTP=m
CONFIG_NF_NAT_H323=m
CONFIG_NF_NAT_SIP=m
CONFIG_IP_NF_MANGLE=m
CONFIG_IP_NF_TARGET_CLUSTERIP=m
CONFIG_IP_NF_TARGET_ECN=m
CONFIG_IP_NF_TARGET_TTL=m
CONFIG_IP_NF_RAW=m
CONFIG_IP_NF_SECURITY=m
CONFIG_IP_NF_ARPTABLES=m
CONFIG_IP_NF_ARPFILTER=m
CONFIG_IP_NF_ARP_MANGLE=m

#
# IPv6: Netfilter Configuration
#
CONFIG_NF_CONNTRACK_IPV6=m
CONFIG_IP6_NF_QUEUE=m
CONFIG_IP6_NF_IPTABLES=m
CONFIG_IP6_NF_MATCH_AH=m
CONFIG_IP6_NF_MATCH_EUI64=m
CONFIG_IP6_NF_MATCH_FRAG=m
CONFIG_IP6_NF_MATCH_OPTS=m
CONFIG_IP6_NF_MATCH_HL=m
CONFIG_IP6_NF_MATCH_IPV6HEADER=m
CONFIG_IP6_NF_MATCH_MH=m
CONFIG_IP6_NF_MATCH_RT=m
CONFIG_IP6_NF_TARGET_HL=m
CONFIG_IP6_NF_TARGET_LOG=m
CONFIG_IP6_NF_FILTER=m
CONFIG_IP6_NF_TARGET_REJECT=m
CONFIG_IP6_NF_MANGLE=m
CONFIG_IP6_NF_RAW=m
CONFIG_IP6_NF_SECURITY=m
CONFIG_BRIDGE_NF_EBTABLES=m
CONFIG_BRIDGE_EBT_BROUTE=m
CONFIG_BRIDGE_EBT_T_FILTER=m
CONFIG_BRIDGE_EBT_T_NAT=m
CONFIG_BRIDGE_EBT_802_3=m
CONFIG_BRIDGE_EBT_AMONG=m
CONFIG_BRIDGE_EBT_ARP=m
CONFIG_BRIDGE_EBT_IP=m
CONFIG_BRIDGE_EBT_IP6=m
CONFIG_BRIDGE_EBT_LIMIT=m
CONFIG_BRIDGE_EBT_MARK=m
CONFIG_BRIDGE_EBT_PKTTYPE=m
CONFIG_BRIDGE_EBT_STP=m
CONFIG_BRIDGE_EBT_VLAN=m
CONFIG_BRIDGE_EBT_ARPREPLY=m
CONFIG_BRIDGE_EBT_DNAT=m
CONFIG_BRIDGE_EBT_MARK_T=m
CONFIG_BRIDGE_EBT_REDIRECT=m
CONFIG_BRIDGE_EBT_SNAT=m
CONFIG_BRIDGE_EBT_LOG=m
CONFIG_BRIDGE_EBT_ULOG=m
CONFIG_BRIDGE_EBT_NFLOG=m
# CONFIG_IP_DCCP is not set
CONFIG_IP_SCTP=m
# CONFIG_SCTP_DBG_MSG is not set
# CONFIG_SCTP_DBG_OBJCNT is not set
# CONFIG_SCTP_HMAC_NONE is not set
# CONFIG_SCTP_HMAC_SHA1 is not set
CONFIG_SCTP_HMAC_MD5=y
CONFIG_RDS=m
CONFIG_RDS_TCP=m
# CONFIG_RDS_DEBUG is not set
# CONFIG_TIPC is not set
# CONFIG_ATM is not set
CONFIG_STP=m
CONFIG_GARP=m
CONFIG_BRIDGE=m
# CONFIG_NET_DSA is not set
CONFIG_VLAN_8021Q=m
CONFIG_VLAN_8021Q_GVRP=y
# CONFIG_DECNET is not set
CONFIG_LLC=m
CONFIG_LLC2=m
CONFIG_IPX=m
# CONFIG_IPX_INTERN is not set
CONFIG_ATALK=m
CONFIG_DEV_APPLETALK=m
CONFIG_IPDDP=m
CONFIG_IPDDP_ENCAP=y
CONFIG_IPDDP_DECAP=y
# CONFIG_X25 is not set
# CONFIG_LAPB is not set
# CONFIG_ECONET is not set
CONFIG_WAN_ROUTER=m
# CONFIG_PHONET is not set
# CONFIG_IEEE802154 is not set
CONFIG_NET_SCHED=y

#
# Queueing/Scheduling
#
CONFIG_NET_SCH_CBQ=m
CONFIG_NET_SCH_HTB=m
CONFIG_NET_SCH_HFSC=m
CONFIG_NET_SCH_PRIO=m
CONFIG_NET_SCH_MULTIQ=m
CONFIG_NET_SCH_RED=m
CONFIG_NET_SCH_SFQ=m
CONFIG_NET_SCH_TEQL=m
CONFIG_NET_SCH_TBF=m
CONFIG_NET_SCH_GRED=m
CONFIG_NET_SCH_DSMARK=m
CONFIG_NET_SCH_NETEM=m
CONFIG_NET_SCH_DRR=m
CONFIG_NET_SCH_INGRESS=m

#
# Classification
#
CONFIG_NET_CLS=y
CONFIG_NET_CLS_BASIC=m
CONFIG_NET_CLS_TCINDEX=m
CONFIG_NET_CLS_ROUTE4=m
CONFIG_NET_CLS_ROUTE=y
CONFIG_NET_CLS_FW=m
CONFIG_NET_CLS_U32=m
CONFIG_CLS_U32_PERF=y
CONFIG_CLS_U32_MARK=y
CONFIG_NET_CLS_RSVP=m
CONFIG_NET_CLS_RSVP6=m
CONFIG_NET_CLS_FLOW=m
CONFIG_NET_CLS_CGROUP=y
CONFIG_NET_EMATCH=y
CONFIG_NET_EMATCH_STACK=32
CONFIG_NET_EMATCH_CMP=m
CONFIG_NET_EMATCH_NBYTE=m
CONFIG_NET_EMATCH_U32=m
CONFIG_NET_EMATCH_META=m
CONFIG_NET_EMATCH_TEXT=m
CONFIG_NET_CLS_ACT=y
CONFIG_NET_ACT_POLICE=m
CONFIG_NET_ACT_GACT=m
CONFIG_GACT_PROB=y
CONFIG_NET_ACT_MIRRED=m
CONFIG_NET_ACT_IPT=m
CONFIG_NET_ACT_NAT=m
CONFIG_NET_ACT_PEDIT=m
CONFIG_NET_ACT_SIMP=m
CONFIG_NET_ACT_SKBEDIT=m
CONFIG_NET_CLS_IND=y
CONFIG_NET_SCH_FIFO=y
CONFIG_DCB=y

#
# Network testing
#
CONFIG_NET_PKTGEN=m
# CONFIG_NET_DROP_MONITOR is not set
# CONFIG_HAMRADIO is not set
# CONFIG_CAN is not set
# CONFIG_IRDA is not set
CONFIG_BT=m
CONFIG_BT_L2CAP=m
CONFIG_BT_SCO=m
CONFIG_BT_RFCOMM=m
CONFIG_BT_RFCOMM_TTY=y
CONFIG_BT_BNEP=m
CONFIG_BT_BNEP_MC_FILTER=y
CONFIG_BT_BNEP_PROTO_FILTER=y
CONFIG_BT_HIDP=m

#
# Bluetooth device drivers
#
CONFIG_BT_HCIBTUSB=m
CONFIG_BT_HCIBTSDIO=m
CONFIG_BT_HCIUART=m
CONFIG_BT_HCIUART_H4=y
CONFIG_BT_HCIUART_BCSP=y
CONFIG_BT_HCIUART_LL=y
CONFIG_BT_HCIBCM203X=m
CONFIG_BT_HCIBPA10X=m
CONFIG_BT_HCIBFUSB=m
CONFIG_BT_HCIDTL1=m
CONFIG_BT_HCIBT3C=m
CONFIG_BT_HCIBLUECARD=m
CONFIG_BT_HCIBTUART=m
CONFIG_BT_HCIVHCI=m
CONFIG_BT_MRVL=m
CONFIG_BT_MRVL_SDIO=m
CONFIG_BT_ATH3K=m
CONFIG_AF_RXRPC=m
# CONFIG_AF_RXRPC_DEBUG is not set
CONFIG_RXKAD=m
CONFIG_FIB_RULES=y
CONFIG_WIRELESS=y
CONFIG_WIRELESS_EXT=y
CONFIG_WEXT_CORE=y
CONFIG_WEXT_PROC=y
CONFIG_WEXT_SPY=y
CONFIG_WEXT_PRIV=y
CONFIG_CFG80211=m
# CONFIG_NL80211_TESTMODE is not set
# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set
# CONFIG_CFG80211_REG_DEBUG is not set
CONFIG_CFG80211_DEFAULT_PS=y
# CONFIG_CFG80211_DEBUGFS is not set
CONFIG_WIRELESS_OLD_REGULATORY=y
CONFIG_CFG80211_WEXT=y
# CONFIG_WIRELESS_EXT_SYSFS is not set
CONFIG_LIB80211=m
CONFIG_LIB80211_CRYPT_WEP=m
CONFIG_LIB80211_CRYPT_CCMP=m
CONFIG_LIB80211_CRYPT_TKIP=m
# CONFIG_LIB80211_DEBUG is not set
CONFIG_MAC80211=m
CONFIG_MAC80211_RC_MINSTREL=y
# CONFIG_MAC80211_RC_DEFAULT_PID is not set
CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y
CONFIG_MAC80211_RC_DEFAULT="minstrel"
# CONFIG_MAC80211_MESH is not set
CONFIG_MAC80211_LEDS=y
# CONFIG_MAC80211_DEBUGFS is not set
# CONFIG_MAC80211_DEBUG_MENU is not set
CONFIG_WIMAX=m
CONFIG_WIMAX_DEBUG_LEVEL=8
CONFIG_RFKILL=m
CONFIG_RFKILL_LEDS=y
CONFIG_RFKILL_INPUT=y
# CONFIG_NET_9P is not set

#
# Device Drivers
#

#
# Generic Driver Options
#
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
# CONFIG_DEVTMPFS is not set
CONFIG_STANDALONE=y
CONFIG_PREVENT_FIRMWARE_BUILD=y
CONFIG_FW_LOADER=y
# CONFIG_FIRMWARE_IN_KERNEL is not set
CONFIG_EXTRA_FIRMWARE=""
# CONFIG_DEBUG_DRIVER is not set
# CONFIG_DEBUG_DEVRES is not set
# CONFIG_SYS_HYPERVISOR is not set
CONFIG_CONNECTOR=m
CONFIG_MTD=m
# CONFIG_MTD_DEBUG is not set
# CONFIG_MTD_TESTS is not set
CONFIG_MTD_CONCAT=m
CONFIG_MTD_PARTITIONS=y
CONFIG_MTD_REDBOOT_PARTS=m
CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set
CONFIG_MTD_AR7_PARTS=m

#
# User Modules And Translation Layers
#
CONFIG_MTD_CHAR=m
CONFIG_MTD_BLKDEVS=m
CONFIG_MTD_BLOCK=m
CONFIG_MTD_BLOCK_RO=m
CONFIG_FTL=m
CONFIG_NFTL=m
CONFIG_NFTL_RW=y
CONFIG_INFTL=m
CONFIG_RFD_FTL=m
CONFIG_SSFDC=m
CONFIG_MTD_OOPS=m

#
# RAM/ROM/Flash chip drivers
#
CONFIG_MTD_CFI=m
CONFIG_MTD_JEDECPROBE=m
CONFIG_MTD_GEN_PROBE=m
# CONFIG_MTD_CFI_ADV_OPTIONS is not set
CONFIG_MTD_MAP_BANK_WIDTH_1=y
CONFIG_MTD_MAP_BANK_WIDTH_2=y
CONFIG_MTD_MAP_BANK_WIDTH_4=y
# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
CONFIG_MTD_CFI_I1=y
CONFIG_MTD_CFI_I2=y
# CONFIG_MTD_CFI_I4 is not set
# CONFIG_MTD_CFI_I8 is not set
CONFIG_MTD_CFI_INTELEXT=m
CONFIG_MTD_CFI_AMDSTD=m
CONFIG_MTD_CFI_STAA=m
CONFIG_MTD_CFI_UTIL=m
CONFIG_MTD_RAM=m
CONFIG_MTD_ROM=m
CONFIG_MTD_ABSENT=m

#
# Mapping drivers for chip access
#
CONFIG_MTD_COMPLEX_MAPPINGS=y
CONFIG_MTD_PHYSMAP=m
# CONFIG_MTD_PHYSMAP_COMPAT is not set
CONFIG_MTD_SC520CDP=m
CONFIG_MTD_NETSC520=m
CONFIG_MTD_TS5500=m
CONFIG_MTD_SBC_GXX=m
# CONFIG_MTD_AMD76XROM is not set
# CONFIG_MTD_ICHXROM is not set
# CONFIG_MTD_ESB2ROM is not set
# CONFIG_MTD_CK804XROM is not set
# CONFIG_MTD_SCB2_FLASH is not set
CONFIG_MTD_NETtel=m
# CONFIG_MTD_L440GX is not set
CONFIG_MTD_PCI=m
CONFIG_MTD_INTEL_VR_NOR=m
CONFIG_MTD_PLATRAM=m

#
# Self-contained MTD device drivers
#
CONFIG_MTD_PMC551=m
# CONFIG_MTD_PMC551_BUGFIX is not set
# CONFIG_MTD_PMC551_DEBUG is not set
CONFIG_MTD_DATAFLASH=m
# CONFIG_MTD_DATAFLASH_WRITE_VERIFY is not set
# CONFIG_MTD_DATAFLASH_OTP is not set
CONFIG_MTD_M25P80=m
CONFIG_M25PXX_USE_FAST_READ=y
CONFIG_MTD_SST25L=m
CONFIG_MTD_SLRAM=m
CONFIG_MTD_PHRAM=m
CONFIG_MTD_MTDRAM=m
CONFIG_MTDRAM_TOTAL_SIZE=4096
CONFIG_MTDRAM_ERASE_SIZE=128
CONFIG_MTD_BLOCK2MTD=m

#
# Disk-On-Chip Device Drivers
#
CONFIG_MTD_DOC2000=m
CONFIG_MTD_DOC2001=m
CONFIG_MTD_DOC2001PLUS=m
CONFIG_MTD_DOCPROBE=m
CONFIG_MTD_DOCECC=m
# CONFIG_MTD_DOCPROBE_ADVANCED is not set
CONFIG_MTD_DOCPROBE_ADDRESS=0
CONFIG_MTD_NAND=m
# CONFIG_MTD_NAND_VERIFY_WRITE is not set
# CONFIG_MTD_NAND_ECC_SMC is not set
# CONFIG_MTD_NAND_MUSEUM_IDS is not set
CONFIG_MTD_NAND_IDS=m
CONFIG_MTD_NAND_DISKONCHIP=m
# CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADVANCED is not set
CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADDRESS=0
# CONFIG_MTD_NAND_DISKONCHIP_BBTWRITE is not set
CONFIG_MTD_NAND_CAFE=m
CONFIG_MTD_NAND_NANDSIM=m
CONFIG_MTD_NAND_PLATFORM=m
CONFIG_MTD_ALAUDA=m
CONFIG_MTD_ONENAND=m
CONFIG_MTD_ONENAND_VERIFY_WRITE=y
CONFIG_MTD_ONENAND_GENERIC=m
# CONFIG_MTD_ONENAND_OTP is not set
CONFIG_MTD_ONENAND_2X_PROGRAM=y
CONFIG_MTD_ONENAND_SIM=m

#
# LPDDR flash memory drivers
#
CONFIG_MTD_LPDDR=m
CONFIG_MTD_QINFO_PROBE=m

#
# UBI - Unsorted block images
#
CONFIG_MTD_UBI=m
CONFIG_MTD_UBI_WL_THRESHOLD=4096
CONFIG_MTD_UBI_BEB_RESERVE=1
# CONFIG_MTD_UBI_GLUEBI is not set

#
# UBI debugging options
#
# CONFIG_MTD_UBI_DEBUG is not set
# CONFIG_PARPORT is not set
CONFIG_PNP=y
# CONFIG_PNP_DEBUG_MESSAGES is not set

#
# Protocols
#
CONFIG_PNPACPI=y
CONFIG_BLK_DEV=y
# CONFIG_BLK_DEV_FD is not set
# CONFIG_BLK_CPQ_DA is not set
# CONFIG_BLK_CPQ_CISS_DA is not set
# CONFIG_BLK_DEV_DAC960 is not set
# CONFIG_BLK_DEV_UMEM is not set
# CONFIG_BLK_DEV_COW_COMMON is not set
CONFIG_BLK_DEV_LOOP=m
CONFIG_BLK_DEV_CRYPTOLOOP=m
# CONFIG_BLK_DEV_DRBD is not set
CONFIG_BLK_DEV_NBD=m
CONFIG_BLK_DEV_OSD=m
# CONFIG_BLK_DEV_SX8 is not set
# CONFIG_BLK_DEV_UB is not set
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_COUNT=16
CONFIG_BLK_DEV_RAM_SIZE=8192
# CONFIG_BLK_DEV_XIP is not set
CONFIG_CDROM_PKTCDVD=m
CONFIG_CDROM_PKTCDVD_BUFFERS=8
# CONFIG_CDROM_PKTCDVD_WCACHE is not set
CONFIG_ATA_OVER_ETH=m
CONFIG_VIRTIO_BLK=m
# CONFIG_BLK_DEV_HD is not set
CONFIG_MISC_DEVICES=y
# CONFIG_AD525X_DPOT is not set
# CONFIG_IBM_ASM is not set
CONFIG_HWLAT_DETECTOR=m
# CONFIG_PHANTOM is not set
# CONFIG_SGI_IOC4 is not set
CONFIG_TIFM_CORE=m
# CONFIG_TIFM_7XX1 is not set
# CONFIG_ICS932S401 is not set
CONFIG_ENCLOSURE_SERVICES=m
# CONFIG_CS5535_MFGPT is not set
# CONFIG_HP_ILO is not set
# CONFIG_ISL29003 is not set
CONFIG_DS1682=m
# CONFIG_TI_DAC7512 is not set
# CONFIG_C2PORT is not set

#
# EEPROM support
#
CONFIG_EEPROM_AT24=m
CONFIG_EEPROM_AT25=m
CONFIG_EEPROM_LEGACY=m
CONFIG_EEPROM_MAX6875=m
CONFIG_EEPROM_93CX6=m
CONFIG_CB710_CORE=m
# CONFIG_CB710_DEBUG is not set
CONFIG_CB710_DEBUG_ASSUMPTIONS=y
CONFIG_IWMC3200TOP=m
# CONFIG_IWMC3200TOP_DEBUG is not set
# CONFIG_IWMC3200TOP_DEBUGFS is not set
CONFIG_HAVE_IDE=y
CONFIG_IDE=m

#
# Please see Documentation/ide/ide.txt for help/info on IDE drives
#
CONFIG_IDE_XFER_MODE=y
CONFIG_IDE_ATAPI=y
# CONFIG_BLK_DEV_IDE_SATA is not set
CONFIG_IDE_GD=m
CONFIG_IDE_GD_ATA=y
CONFIG_IDE_GD_ATAPI=y
CONFIG_BLK_DEV_IDECS=m
CONFIG_BLK_DEV_DELKIN=m
CONFIG_BLK_DEV_IDECD=m
CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS=y
CONFIG_BLK_DEV_IDETAPE=m
CONFIG_BLK_DEV_IDEACPI=y
# CONFIG_IDE_TASK_IOCTL is not set
CONFIG_IDE_PROC_FS=y

#
# IDE chipset support/bugfixes
#
# CONFIG_IDE_GENERIC is not set
# CONFIG_BLK_DEV_PLATFORM is not set
# CONFIG_BLK_DEV_CMD640 is not set
# CONFIG_BLK_DEV_IDEPNP is not set
CONFIG_BLK_DEV_IDEDMA_SFF=y

#
# PCI IDE chipsets support
#
CONFIG_BLK_DEV_IDEPCI=y
# CONFIG_BLK_DEV_GENERIC is not set
# CONFIG_BLK_DEV_OPTI621 is not set
# CONFIG_BLK_DEV_RZ1000 is not set
CONFIG_BLK_DEV_IDEDMA_PCI=y
# CONFIG_BLK_DEV_AEC62XX is not set
# CONFIG_BLK_DEV_ALI15X3 is not set
# CONFIG_BLK_DEV_AMD74XX is not set
# CONFIG_BLK_DEV_ATIIXP is not set
# CONFIG_BLK_DEV_CMD64X is not set
# CONFIG_BLK_DEV_TRIFLEX is not set
# CONFIG_BLK_DEV_CS5520 is not set
# CONFIG_BLK_DEV_CS5530 is not set
# CONFIG_BLK_DEV_HPT366 is not set
# CONFIG_BLK_DEV_JMICRON is not set
# CONFIG_BLK_DEV_SC1200 is not set
CONFIG_BLK_DEV_PIIX=m
# CONFIG_BLK_DEV_IT8172 is not set
# CONFIG_BLK_DEV_IT8213 is not set
# CONFIG_BLK_DEV_IT821X is not set
# CONFIG_BLK_DEV_NS87415 is not set
# CONFIG_BLK_DEV_PDC202XX_OLD is not set
# CONFIG_BLK_DEV_PDC202XX_NEW is not set
# CONFIG_BLK_DEV_SVWKS is not set
# CONFIG_BLK_DEV_SIIMAGE is not set
# CONFIG_BLK_DEV_SIS5513 is not set
# CONFIG_BLK_DEV_SLC90E66 is not set
# CONFIG_BLK_DEV_TRM290 is not set
# CONFIG_BLK_DEV_VIA82CXXX is not set
# CONFIG_BLK_DEV_TC86C001 is not set
CONFIG_BLK_DEV_IDEDMA=y

#
# SCSI device support
#
CONFIG_RAID_ATTRS=m
CONFIG_SCSI=m
CONFIG_SCSI_DMA=y
CONFIG_SCSI_TGT=m
CONFIG_SCSI_NETLINK=y
# CONFIG_SCSI_PROC_FS is not set

#
# SCSI support type (disk, tape, CD-ROM)
#
CONFIG_BLK_DEV_SD=m
CONFIG_CHR_DEV_ST=m
CONFIG_CHR_DEV_OSST=m
CONFIG_BLK_DEV_SR=m
CONFIG_BLK_DEV_SR_VENDOR=y
CONFIG_CHR_DEV_SG=m
CONFIG_CHR_DEV_SCH=m
CONFIG_SCSI_ENCLOSURE=m
CONFIG_SCSI_MULTI_LUN=y
CONFIG_SCSI_CONSTANTS=y
CONFIG_SCSI_LOGGING=y
CONFIG_SCSI_SCAN_ASYNC=y
CONFIG_SCSI_WAIT_SCAN=m

#
# SCSI Transports
#
CONFIG_SCSI_SPI_ATTRS=m
CONFIG_SCSI_FC_ATTRS=m
CONFIG_SCSI_FC_TGT_ATTRS=y
CONFIG_SCSI_ISCSI_ATTRS=m
CONFIG_SCSI_SAS_ATTRS=m
CONFIG_SCSI_SAS_LIBSAS=m
CONFIG_SCSI_SAS_ATA=y
CONFIG_SCSI_SAS_HOST_SMP=y
# CONFIG_SCSI_SAS_LIBSAS_DEBUG is not set
CONFIG_SCSI_SRP_ATTRS=m
CONFIG_SCSI_SRP_TGT_ATTRS=y
CONFIG_SCSI_LOWLEVEL=y
# CONFIG_ISCSI_TCP is not set
# CONFIG_SCSI_BNX2_ISCSI is not set
# CONFIG_BE2ISCSI is not set
# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
# CONFIG_SCSI_HPSA is not set
# CONFIG_SCSI_3W_9XXX is not set
# CONFIG_SCSI_3W_SAS is not set
# CONFIG_SCSI_ACARD is not set
# CONFIG_SCSI_AACRAID is not set
# CONFIG_SCSI_AIC7XXX is not set
# CONFIG_SCSI_AIC7XXX_OLD is not set
# CONFIG_SCSI_AIC79XX is not set
# CONFIG_SCSI_AIC94XX is not set
# CONFIG_SCSI_MVSAS is not set
# CONFIG_SCSI_DPT_I2O is not set
# CONFIG_SCSI_ADVANSYS is not set
# CONFIG_SCSI_ARCMSR is not set
# CONFIG_MEGARAID_NEWGEN is not set
# CONFIG_MEGARAID_LEGACY is not set
# CONFIG_MEGARAID_SAS is not set
# CONFIG_SCSI_MPT2SAS is not set
# CONFIG_SCSI_HPTIOP is not set
# CONFIG_SCSI_BUSLOGIC is not set
CONFIG_VMWARE_PVSCSI=m
CONFIG_LIBFC=m
CONFIG_LIBFCOE=m
# CONFIG_FCOE is not set
# CONFIG_FCOE_FNIC is not set
# CONFIG_SCSI_DMX3191D is not set
# CONFIG_SCSI_EATA is not set
# CONFIG_SCSI_FUTURE_DOMAIN is not set
# CONFIG_SCSI_GDTH is not set
# CONFIG_SCSI_IPS is not set
# CONFIG_SCSI_INITIO is not set
# CONFIG_SCSI_INIA100 is not set
# CONFIG_SCSI_STEX is not set
# CONFIG_SCSI_SYM53C8XX_2 is not set
# CONFIG_SCSI_IPR is not set
# CONFIG_SCSI_QLOGIC_1280 is not set
# CONFIG_SCSI_QLA_FC is not set
# CONFIG_SCSI_QLA_ISCSI is not set
# CONFIG_SCSI_LPFC is not set
# CONFIG_SCSI_DC395x is not set
# CONFIG_SCSI_DC390T is not set
CONFIG_SCSI_DEBUG=m
# CONFIG_SCSI_PMCRAID is not set
# CONFIG_SCSI_PM8001 is not set
CONFIG_SCSI_SRP=m
# CONFIG_SCSI_BFA_FC is not set
CONFIG_SCSI_LOWLEVEL_PCMCIA=y
CONFIG_PCMCIA_FDOMAIN=m
CONFIG_PCMCIA_QLOGIC=m
CONFIG_PCMCIA_SYM53C500=m
CONFIG_SCSI_DH=m
CONFIG_SCSI_DH_RDAC=m
CONFIG_SCSI_DH_HP_SW=m
CONFIG_SCSI_DH_EMC=m
CONFIG_SCSI_DH_ALUA=m
CONFIG_SCSI_OSD_INITIATOR=m
CONFIG_SCSI_OSD_ULD=m
CONFIG_SCSI_OSD_DPRINT_SENSE=1
# CONFIG_SCSI_OSD_DEBUG is not set
CONFIG_ATA=m
# CONFIG_ATA_NONSTANDARD is not set
CONFIG_ATA_VERBOSE_ERROR=y
CONFIG_ATA_ACPI=y
CONFIG_SATA_PMP=y
CONFIG_SATA_AHCI=m
# CONFIG_SATA_SIL24 is not set
CONFIG_ATA_SFF=y
# CONFIG_SATA_SVW is not set
# CONFIG_ATA_PIIX is not set
# CONFIG_SATA_MV is not set
# CONFIG_SATA_NV is not set
# CONFIG_PDC_ADMA is not set
# CONFIG_SATA_QSTOR is not set
# CONFIG_SATA_PROMISE is not set
# CONFIG_SATA_SX4 is not set
# CONFIG_SATA_SIL is not set
# CONFIG_SATA_SIS is not set
# CONFIG_SATA_ULI is not set
# CONFIG_SATA_VIA is not set
# CONFIG_SATA_VITESSE is not set
# CONFIG_SATA_INIC162X is not set
# CONFIG_PATA_ACPI is not set
# CONFIG_PATA_ALI is not set
# CONFIG_PATA_AMD is not set
# CONFIG_PATA_ARTOP is not set
# CONFIG_PATA_ATP867X is not set
# CONFIG_PATA_ATIIXP is not set
# CONFIG_PATA_CMD640_PCI is not set
# CONFIG_PATA_CMD64X is not set
# CONFIG_PATA_CS5520 is not set
# CONFIG_PATA_CS5530 is not set
# CONFIG_PATA_CYPRESS is not set
# CONFIG_PATA_EFAR is not set
CONFIG_ATA_GENERIC=m
# CONFIG_PATA_HPT366 is not set
# CONFIG_PATA_HPT37X is not set
# CONFIG_PATA_HPT3X2N is not set
# CONFIG_PATA_HPT3X3 is not set
# CONFIG_PATA_IT821X is not set
# CONFIG_PATA_IT8213 is not set
# CONFIG_PATA_JMICRON is not set
# CONFIG_PATA_TRIFLEX is not set
# CONFIG_PATA_MARVELL is not set
# CONFIG_PATA_MPIIX is not set
# CONFIG_PATA_OLDPIIX is not set
# CONFIG_PATA_NETCELL is not set
# CONFIG_PATA_NINJA32 is not set
# CONFIG_PATA_NS87410 is not set
# CONFIG_PATA_NS87415 is not set
# CONFIG_PATA_OPTI is not set
# CONFIG_PATA_OPTIDMA is not set
CONFIG_PATA_PCMCIA=m
# CONFIG_PATA_PDC2027X is not set
# CONFIG_PATA_PDC_OLD is not set
# CONFIG_PATA_RADISYS is not set
# CONFIG_PATA_RDC is not set
# CONFIG_PATA_RZ1000 is not set
# CONFIG_PATA_SC1200 is not set
# CONFIG_PATA_SERVERWORKS is not set
# CONFIG_PATA_SIL680 is not set
# CONFIG_PATA_SIS is not set
# CONFIG_PATA_TOSHIBA is not set
# CONFIG_PATA_VIA is not set
# CONFIG_PATA_WINBOND is not set
# CONFIG_PATA_SCH is not set
CONFIG_MD=y
# CONFIG_BLK_DEV_MD is not set
CONFIG_BLK_DEV_DM=m
# CONFIG_DM_DEBUG is not set
CONFIG_DM_CRYPT=m
CONFIG_DM_SNAPSHOT=m
CONFIG_DM_MIRROR=m
# CONFIG_DM_LOG_USERSPACE is not set
CONFIG_DM_ZERO=m
CONFIG_DM_MULTIPATH=m
# CONFIG_DM_MULTIPATH_QL is not set
# CONFIG_DM_MULTIPATH_ST is not set
CONFIG_DM_DELAY=m
CONFIG_DM_UEVENT=y
# CONFIG_FUSION is not set

#
# IEEE 1394 (FireWire) support
#

#
# You can enable one or both FireWire driver stacks.
#

#
# The newer stack is recommended.
#
# CONFIG_FIREWIRE is not set
CONFIG_IEEE1394=m
CONFIG_IEEE1394_OHCI1394=m
# CONFIG_IEEE1394_PCILYNX is not set
CONFIG_IEEE1394_SBP2=m
# CONFIG_IEEE1394_SBP2_PHYS_DMA is not set
CONFIG_IEEE1394_ETH1394_ROM_ENTRY=y
CONFIG_IEEE1394_ETH1394=m
CONFIG_IEEE1394_RAWIO=m
CONFIG_IEEE1394_VIDEO1394=m
# CONFIG_IEEE1394_DV1394 is not set
# CONFIG_IEEE1394_VERBOSEDEBUG is not set
CONFIG_I2O=m
CONFIG_I2O_LCT_NOTIFY_ON_CHANGES=y
CONFIG_I2O_EXT_ADAPTEC=y
CONFIG_I2O_EXT_ADAPTEC_DMA64=y
CONFIG_I2O_CONFIG=m
CONFIG_I2O_CONFIG_OLD_IOCTL=y
CONFIG_I2O_BUS=m
CONFIG_I2O_BLOCK=m
CONFIG_I2O_SCSI=m
CONFIG_I2O_PROC=m
# CONFIG_MACINTOSH_DRIVERS is not set
CONFIG_NETDEVICES=y
CONFIG_IFB=m
CONFIG_DUMMY=m
CONFIG_BONDING=m
CONFIG_MACVLAN=m
CONFIG_EQUALIZER=m
CONFIG_TUN=m
CONFIG_VETH=m
# CONFIG_NET_SB1000 is not set
# CONFIG_ARCNET is not set
CONFIG_PHYLIB=m

#
# MII PHY device drivers
#
CONFIG_MARVELL_PHY=m
CONFIG_DAVICOM_PHY=m
CONFIG_QSEMI_PHY=m
CONFIG_LXT_PHY=m
CONFIG_CICADA_PHY=m
CONFIG_VITESSE_PHY=m
CONFIG_SMSC_PHY=m
CONFIG_BROADCOM_PHY=m
CONFIG_ICPLUS_PHY=m
CONFIG_REALTEK_PHY=m
CONFIG_NATIONAL_PHY=m
CONFIG_STE10XP=m
CONFIG_LSI_ET1011C_PHY=m
CONFIG_MDIO_BITBANG=m
# CONFIG_NET_ETHERNET is not set
CONFIG_MII=m
CONFIG_NETDEV_1000=y
CONFIG_ACENIC=m
# CONFIG_ACENIC_OMIT_TIGON_I is not set
CONFIG_DL2K=m
CONFIG_E1000=m
CONFIG_E1000E=m
CONFIG_IP1000=m
CONFIG_IGB=m
CONFIG_IGBVF=m
CONFIG_NS83820=m
CONFIG_HAMACHI=m
CONFIG_YELLOWFIN=m
CONFIG_R8169=m
CONFIG_R8169_VLAN=y
CONFIG_SIS190=m
CONFIG_SKGE=m
# CONFIG_SKGE_DEBUG is not set
CONFIG_SKY2=m
# CONFIG_SKY2_DEBUG is not set
CONFIG_VIA_VELOCITY=m
CONFIG_TIGON3=m
CONFIG_BNX2=m
# CONFIG_CNIC is not set
CONFIG_QLA3XXX=m
CONFIG_ATL1=m
CONFIG_ATL1E=m
CONFIG_ATL1C=m
CONFIG_JME=m
# CONFIG_NETDEV_10000 is not set
# CONFIG_TR is not set
CONFIG_WLAN=y
CONFIG_PCMCIA_RAYCS=m
CONFIG_LIBERTAS_THINFIRM=m
CONFIG_LIBERTAS_THINFIRM_USB=m
CONFIG_AIRO=m
CONFIG_ATMEL=m
CONFIG_PCI_ATMEL=m
CONFIG_PCMCIA_ATMEL=m
CONFIG_AT76C50X_USB=m
CONFIG_AIRO_CS=m
CONFIG_PCMCIA_WL3501=m
# CONFIG_PRISM54 is not set
CONFIG_USB_ZD1201=m
CONFIG_USB_NET_RNDIS_WLAN=m
CONFIG_RTL8180=m
CONFIG_RTL8187=m
CONFIG_RTL8187_LEDS=y
CONFIG_ADM8211=m
CONFIG_MAC80211_HWSIM=m
CONFIG_MWL8K=m
CONFIG_ATH_COMMON=m
# CONFIG_ATH_DEBUG is not set
CONFIG_ATH5K=m
# CONFIG_ATH5K_DEBUG is not set
CONFIG_ATH9K_HW=m
CONFIG_ATH9K_COMMON=m
CONFIG_ATH9K=m
# CONFIG_ATH9K_DEBUGFS is not set
CONFIG_AR9170_USB=m
CONFIG_AR9170_LEDS=y
CONFIG_B43=m
CONFIG_B43_PCI_AUTOSELECT=y
CONFIG_B43_PCICORE_AUTOSELECT=y
CONFIG_B43_PCMCIA=y
CONFIG_B43_SDIO=y
CONFIG_B43_PIO=y
CONFIG_B43_PHY_LP=y
CONFIG_B43_LEDS=y
CONFIG_B43_HWRNG=y
# CONFIG_B43_DEBUG is not set
CONFIG_B43LEGACY=m
CONFIG_B43LEGACY_PCI_AUTOSELECT=y
CONFIG_B43LEGACY_PCICORE_AUTOSELECT=y
CONFIG_B43LEGACY_LEDS=y
CONFIG_B43LEGACY_HWRNG=y
CONFIG_B43LEGACY_DEBUG=y
CONFIG_B43LEGACY_DMA=y
CONFIG_B43LEGACY_PIO=y
CONFIG_B43LEGACY_DMA_AND_PIO_MODE=y
# CONFIG_B43LEGACY_DMA_MODE is not set
# CONFIG_B43LEGACY_PIO_MODE is not set
CONFIG_HOSTAP=m
CONFIG_HOSTAP_FIRMWARE=y
# CONFIG_HOSTAP_FIRMWARE_NVRAM is not set
CONFIG_HOSTAP_PLX=m
CONFIG_HOSTAP_PCI=m
CONFIG_HOSTAP_CS=m
CONFIG_IPW2100=m
CONFIG_IPW2100_MONITOR=y
# CONFIG_IPW2100_DEBUG is not set
CONFIG_IPW2200=m
CONFIG_IPW2200_MONITOR=y
CONFIG_IPW2200_RADIOTAP=y
CONFIG_IPW2200_PROMISCUOUS=y
CONFIG_IPW2200_QOS=y
# CONFIG_IPW2200_DEBUG is not set
CONFIG_LIBIPW=m
# CONFIG_LIBIPW_DEBUG is not set
CONFIG_IWLWIFI=m
CONFIG_IWLWIFI_SPECTRUM_MEASUREMENT=y
# CONFIG_IWLWIFI_DEBUG is not set
# CONFIG_IWLWIFI_DEVICE_TRACING is not set
CONFIG_IWLAGN=m
CONFIG_IWL4965=y
CONFIG_IWL5000=y
CONFIG_IWL3945=m
CONFIG_IWL3945_SPECTRUM_MEASUREMENT=y
CONFIG_IWM=m
# CONFIG_IWM_DEBUG is not set
CONFIG_LIBERTAS=m
CONFIG_LIBERTAS_USB=m
CONFIG_LIBERTAS_CS=m
CONFIG_LIBERTAS_SDIO=m
CONFIG_LIBERTAS_SPI=m
# CONFIG_LIBERTAS_DEBUG is not set
CONFIG_HERMES=m
CONFIG_HERMES_CACHE_FW_ON_INIT=y
CONFIG_PLX_HERMES=m
CONFIG_TMD_HERMES=m
CONFIG_NORTEL_HERMES=m
CONFIG_PCI_HERMES=m
CONFIG_PCMCIA_HERMES=m
CONFIG_PCMCIA_SPECTRUM=m
CONFIG_P54_COMMON=m
CONFIG_P54_USB=m
CONFIG_P54_PCI=m
CONFIG_P54_SPI=m
CONFIG_P54_LEDS=y
CONFIG_RT2X00=m
CONFIG_RT2400PCI=m
CONFIG_RT2500PCI=m
CONFIG_RT61PCI=m
CONFIG_RT2800PCI_PCI=m
CONFIG_RT2800PCI=m
CONFIG_RT2500USB=m
CONFIG_RT73USB=m
CONFIG_RT2800USB=m
CONFIG_RT2800_LIB=m
CONFIG_RT2X00_LIB_PCI=m
CONFIG_RT2X00_LIB_USB=m
CONFIG_RT2X00_LIB=m
CONFIG_RT2X00_LIB_HT=y
CONFIG_RT2X00_LIB_FIRMWARE=y
CONFIG_RT2X00_LIB_CRYPTO=y
CONFIG_RT2X00_LIB_LEDS=y
# CONFIG_RT2X00_DEBUG is not set
CONFIG_WL12XX=m
CONFIG_WL1251=m
CONFIG_WL1251_SPI=m
CONFIG_WL1251_SDIO=m
CONFIG_WL1271=m
CONFIG_ZD1211RW=m
# CONFIG_ZD1211RW_DEBUG is not set

#
# WiMAX Wireless Broadband devices
#
CONFIG_WIMAX_I2400M=m
CONFIG_WIMAX_I2400M_USB=m
CONFIG_WIMAX_I2400M_SDIO=m
# CONFIG_WIMAX_IWMC3200_SDIO is not set
CONFIG_WIMAX_I2400M_DEBUG_LEVEL=8

#
# USB Network Adapters
#
CONFIG_USB_CATC=m
CONFIG_USB_KAWETH=m
CONFIG_USB_PEGASUS=m
CONFIG_USB_RTL8150=m
CONFIG_USB_USBNET=m
CONFIG_USB_NET_AX8817X=m
CONFIG_USB_NET_CDCETHER=m
CONFIG_USB_NET_CDC_EEM=m
CONFIG_USB_NET_DM9601=m
CONFIG_USB_NET_SMSC95XX=m
CONFIG_USB_NET_GL620A=m
CONFIG_USB_NET_NET1080=m
CONFIG_USB_NET_PLUSB=m
CONFIG_USB_NET_MCS7830=m
CONFIG_USB_NET_RNDIS_HOST=m
CONFIG_USB_NET_CDC_SUBSET=m
CONFIG_USB_ALI_M5632=y
CONFIG_USB_AN2720=y
CONFIG_USB_BELKIN=y
CONFIG_USB_ARMLINUX=y
CONFIG_USB_EPSON2888=y
CONFIG_USB_KC2190=y
CONFIG_USB_NET_ZAURUS=m
CONFIG_USB_HSO=m
CONFIG_USB_NET_INT51X1=m
CONFIG_NET_PCMCIA=y
CONFIG_PCMCIA_3C589=m
CONFIG_PCMCIA_3C574=m
CONFIG_PCMCIA_FMVJ18X=m
CONFIG_PCMCIA_PCNET=m
CONFIG_PCMCIA_NMCLAN=m
CONFIG_PCMCIA_SMC91C92=m
CONFIG_PCMCIA_XIRC2PS=m
CONFIG_PCMCIA_AXNET=m
# CONFIG_WAN is not set
# CONFIG_FDDI is not set
# CONFIG_HIPPI is not set
CONFIG_PPP=m
CONFIG_PPP_MULTILINK=y
CONFIG_PPP_FILTER=y
CONFIG_PPP_ASYNC=m
CONFIG_PPP_SYNC_TTY=m
CONFIG_PPP_DEFLATE=m
CONFIG_PPP_BSDCOMP=m
CONFIG_PPP_MPPE=m
CONFIG_PPPOE=m
CONFIG_PPPOL2TP=m
CONFIG_SLIP=m
CONFIG_SLIP_COMPRESSED=y
CONFIG_SLHC=m
CONFIG_SLIP_SMART=y
CONFIG_SLIP_MODE_SLIP6=y
CONFIG_NET_FC=y
CONFIG_NETCONSOLE=m
CONFIG_NETCONSOLE_DYNAMIC=y
CONFIG_NETPOLL=y
# CONFIG_NETPOLL_TRAP is not set
CONFIG_NET_POLL_CONTROLLER=y
CONFIG_VIRTIO_NET=m
CONFIG_VMXNET3=m
# CONFIG_ISDN is not set
# CONFIG_PHONE is not set

#
# Input device support
#
CONFIG_INPUT=y
CONFIG_INPUT_FF_MEMLESS=m
CONFIG_INPUT_POLLDEV=m
# CONFIG_INPUT_SPARSEKMAP is not set

#
# Userland interfaces
#
CONFIG_INPUT_MOUSEDEV=y
CONFIG_INPUT_MOUSEDEV_PSAUX=y
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1280
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=800
CONFIG_INPUT_JOYDEV=m
CONFIG_INPUT_EVDEV=m
# CONFIG_INPUT_EVBUG is not set

#
# Input Device Drivers
#
CONFIG_INPUT_KEYBOARD=y
# CONFIG_KEYBOARD_ADP5588 is not set
CONFIG_KEYBOARD_ATKBD=y
# CONFIG_QT2160 is not set
# CONFIG_KEYBOARD_LKKBD is not set
# CONFIG_KEYBOARD_LM8323 is not set
# CONFIG_KEYBOARD_MAX7359 is not set
# CONFIG_KEYBOARD_NEWTON is not set
# CONFIG_KEYBOARD_OPENCORES is not set
# CONFIG_KEYBOARD_STOWAWAY is not set
# CONFIG_KEYBOARD_SUNKBD is not set
# CONFIG_KEYBOARD_XTKBD is not set
CONFIG_INPUT_MOUSE=y
CONFIG_MOUSE_PS2=m
CONFIG_MOUSE_PS2_ALPS=y
CONFIG_MOUSE_PS2_LOGIPS2PP=y
CONFIG_MOUSE_PS2_SYNAPTICS=y
CONFIG_MOUSE_PS2_LIFEBOOK=y
CONFIG_MOUSE_PS2_TRACKPOINT=y
# CONFIG_MOUSE_PS2_ELANTECH is not set
# CONFIG_MOUSE_PS2_SENTELIC is not set
# CONFIG_MOUSE_PS2_TOUCHKIT is not set
CONFIG_MOUSE_SERIAL=m
# CONFIG_MOUSE_APPLETOUCH is not set
# CONFIG_MOUSE_BCM5974 is not set
# CONFIG_MOUSE_VSXXXAA is not set
CONFIG_MOUSE_SYNAPTICS_I2C=m
CONFIG_INPUT_JOYSTICK=y
CONFIG_JOYSTICK_ANALOG=m
CONFIG_JOYSTICK_A3D=m
CONFIG_JOYSTICK_ADI=m
CONFIG_JOYSTICK_COBRA=m
CONFIG_JOYSTICK_GF2K=m
CONFIG_JOYSTICK_GRIP=m
CONFIG_JOYSTICK_GRIP_MP=m
CONFIG_JOYSTICK_GUILLEMOT=m
CONFIG_JOYSTICK_INTERACT=m
CONFIG_JOYSTICK_SIDEWINDER=m
CONFIG_JOYSTICK_TMDC=m
CONFIG_JOYSTICK_IFORCE=m
CONFIG_JOYSTICK_IFORCE_USB=y
CONFIG_JOYSTICK_IFORCE_232=y
CONFIG_JOYSTICK_WARRIOR=m
CONFIG_JOYSTICK_MAGELLAN=m
CONFIG_JOYSTICK_SPACEORB=m
CONFIG_JOYSTICK_SPACEBALL=m
CONFIG_JOYSTICK_STINGER=m
CONFIG_JOYSTICK_TWIDJOY=m
CONFIG_JOYSTICK_ZHENHUA=m
CONFIG_JOYSTICK_JOYDUMP=m
CONFIG_JOYSTICK_XPAD=m
CONFIG_JOYSTICK_XPAD_FF=y
CONFIG_JOYSTICK_XPAD_LEDS=y
# CONFIG_INPUT_TABLET is not set
# CONFIG_INPUT_TOUCHSCREEN is not set
CONFIG_INPUT_MISC=y
CONFIG_INPUT_PCSPKR=m
# CONFIG_INPUT_APANEL is not set
CONFIG_INPUT_ATLAS_BTNS=m
CONFIG_INPUT_ATI_REMOTE=m
CONFIG_INPUT_ATI_REMOTE2=m
CONFIG_INPUT_KEYSPAN_REMOTE=m
# CONFIG_INPUT_POWERMATE is not set
# CONFIG_INPUT_YEALINK is not set
# CONFIG_INPUT_CM109 is not set
CONFIG_INPUT_UINPUT=m
CONFIG_INPUT_WINBOND_CIR=m
# CONFIG_INPUT_PCF50633_PMU is not set

#
# Hardware I/O ports
#
CONFIG_SERIO=y
CONFIG_SERIO_I8042=y
CONFIG_SERIO_SERPORT=m
# CONFIG_SERIO_CT82C710 is not set
CONFIG_SERIO_PCIPS2=m
CONFIG_SERIO_LIBPS2=y
CONFIG_SERIO_RAW=m
# CONFIG_SERIO_ALTERA_PS2 is not set
CONFIG_GAMEPORT=m
# CONFIG_GAMEPORT_NS558 is not set
# CONFIG_GAMEPORT_L4 is not set
# CONFIG_GAMEPORT_EMU10K1 is not set
# CONFIG_GAMEPORT_FM801 is not set

#
# Character devices
#
CONFIG_VT=y
CONFIG_CONSOLE_TRANSLATIONS=y
CONFIG_VT_CONSOLE=y
CONFIG_HW_CONSOLE=y
# CONFIG_VT_HW_CONSOLE_BINDING is not set
CONFIG_DEVKMEM=y
# CONFIG_SERIAL_NONSTANDARD is not set
CONFIG_NOZOMI=m

#
# Serial drivers
#
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_FIX_EARLYCON_MEM=y
CONFIG_SERIAL_8250_PCI=y
CONFIG_SERIAL_8250_PNP=y
CONFIG_SERIAL_8250_CS=m
CONFIG_SERIAL_8250_NR_UARTS=32
CONFIG_SERIAL_8250_RUNTIME_UARTS=4
CONFIG_SERIAL_8250_EXTENDED=y
CONFIG_SERIAL_8250_MANY_PORTS=y
CONFIG_SERIAL_8250_SHARE_IRQ=y
# CONFIG_SERIAL_8250_DETECT_IRQ is not set
CONFIG_SERIAL_8250_RSA=y

#
# Non-8250 serial port support
#
CONFIG_SERIAL_MAX3100=m
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
# CONFIG_SERIAL_JSM is not set
CONFIG_UNIX98_PTYS=y
CONFIG_DEVPTS_MULTIPLE_INSTANCES=y
# CONFIG_LEGACY_PTYS is not set
# CONFIG_VIRTIO_CONSOLE is not set
CONFIG_IPMI_HANDLER=m
# CONFIG_IPMI_PANIC_EVENT is not set
CONFIG_IPMI_DEVICE_INTERFACE=m
CONFIG_IPMI_SI=m
CONFIG_IPMI_WATCHDOG=m
CONFIG_IPMI_POWEROFF=m
CONFIG_HW_RANDOM=m
CONFIG_HW_RANDOM_TIMERIOMEM=m
# CONFIG_HW_RANDOM_INTEL is not set
# CONFIG_HW_RANDOM_AMD is not set
# CONFIG_HW_RANDOM_VIA is not set
# CONFIG_HW_RANDOM_VIRTIO is not set
CONFIG_NVRAM=m
# CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set

#
# PCMCIA character devices
#
CONFIG_SYNCLINK_CS=m
CONFIG_CARDMAN_4000=m
CONFIG_CARDMAN_4040=m
CONFIG_IPWIRELESS=m
# CONFIG_MWAVE is not set
# CONFIG_PC8736x_GPIO is not set
CONFIG_RAW_DRIVER=m
CONFIG_MAX_RAW_DEVS=256
CONFIG_HPET=y
CONFIG_HPET_MMAP=y
CONFIG_HANGCHECK_TIMER=m
# CONFIG_TCG_TPM is not set
# CONFIG_TELCLOCK is not set
CONFIG_DEVPORT=y
CONFIG_I2C=m
CONFIG_I2C_BOARDINFO=y
CONFIG_I2C_COMPAT=y
CONFIG_I2C_CHARDEV=m
CONFIG_I2C_HELPER_AUTO=y
CONFIG_I2C_ALGOBIT=m
CONFIG_I2C_ALGOPCA=m

#
# I2C Hardware Bus support
#

#
# PC SMBus host controller drivers
#
CONFIG_I2C_ALI1535=m
CONFIG_I2C_ALI1563=m
CONFIG_I2C_ALI15X3=m
CONFIG_I2C_AMD756=m
CONFIG_I2C_AMD756_S4882=m
CONFIG_I2C_AMD8111=m
CONFIG_I2C_I801=m
CONFIG_I2C_ISCH=m
CONFIG_I2C_PIIX4=m
CONFIG_I2C_NFORCE2=m
CONFIG_I2C_NFORCE2_S4985=m
CONFIG_I2C_SIS5595=m
CONFIG_I2C_SIS630=m
CONFIG_I2C_SIS96X=m
CONFIG_I2C_VIA=m
CONFIG_I2C_VIAPRO=m

#
# ACPI drivers
#
CONFIG_I2C_SCMI=m

#
# I2C system bus drivers (mostly embedded / system-on-chip)
#
CONFIG_I2C_OCORES=m
CONFIG_I2C_SIMTEC=m

#
# External I2C/SMBus adapter drivers
#
CONFIG_I2C_PARPORT_LIGHT=m
CONFIG_I2C_TAOS_EVM=m
CONFIG_I2C_TINY_USB=m

#
# Other I2C/SMBus bus drivers
#
CONFIG_I2C_PCA_PLATFORM=m
CONFIG_I2C_STUB=m

#
# Miscellaneous I2C Chip support
#
CONFIG_SENSORS_TSL2550=m
# CONFIG_I2C_DEBUG_CORE is not set
# CONFIG_I2C_DEBUG_ALGO is not set
# CONFIG_I2C_DEBUG_BUS is not set
# CONFIG_I2C_DEBUG_CHIP is not set
CONFIG_SPI=y
# CONFIG_SPI_DEBUG is not set
CONFIG_SPI_MASTER=y

#
# SPI Master Controller Drivers
#
CONFIG_SPI_BITBANG=m
# CONFIG_SPI_XILINX is not set
# CONFIG_SPI_DESIGNWARE is not set

#
# SPI Protocol Masters
#
CONFIG_SPI_SPIDEV=m
# CONFIG_SPI_TLE62X0 is not set

#
# PPS support
#
# CONFIG_PPS is not set
CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
# CONFIG_GPIOLIB is not set
CONFIG_W1=m
CONFIG_W1_CON=y

#
# 1-wire Bus Masters
#
CONFIG_W1_MASTER_MATROX=m
CONFIG_W1_MASTER_DS2490=m
CONFIG_W1_MASTER_DS2482=m

#
# 1-wire Slaves
#
CONFIG_W1_SLAVE_THERM=m
CONFIG_W1_SLAVE_SMEM=m
CONFIG_W1_SLAVE_DS2431=m
CONFIG_W1_SLAVE_DS2433=m
# CONFIG_W1_SLAVE_DS2433_CRC is not set
CONFIG_W1_SLAVE_DS2760=m
CONFIG_W1_SLAVE_BQ27000=m
CONFIG_POWER_SUPPLY=y
# CONFIG_POWER_SUPPLY_DEBUG is not set
CONFIG_PDA_POWER=m
CONFIG_WM8350_POWER=m
CONFIG_BATTERY_DS2760=m
# CONFIG_BATTERY_DS2782 is not set
CONFIG_BATTERY_BQ27x00=m
# CONFIG_BATTERY_MAX17040 is not set
CONFIG_CHARGER_PCF50633=m
CONFIG_HWMON=y
CONFIG_HWMON_VID=m
# CONFIG_HWMON_DEBUG_CHIP is not set

#
# Native drivers
#
CONFIG_SENSORS_ABITUGURU=m
CONFIG_SENSORS_ABITUGURU3=m
CONFIG_SENSORS_AD7414=m
CONFIG_SENSORS_AD7418=m
CONFIG_SENSORS_ADCXX=m
CONFIG_SENSORS_ADM1021=m
CONFIG_SENSORS_ADM1025=m
CONFIG_SENSORS_ADM1026=m
CONFIG_SENSORS_ADM1029=m
CONFIG_SENSORS_ADM1031=m
CONFIG_SENSORS_ADM9240=m
CONFIG_SENSORS_ADT7462=m
CONFIG_SENSORS_ADT7470=m
CONFIG_SENSORS_ADT7473=m
CONFIG_SENSORS_ADT7475=m
CONFIG_SENSORS_K8TEMP=m
# CONFIG_SENSORS_K10TEMP is not set
CONFIG_SENSORS_ASB100=m
CONFIG_SENSORS_ATXP1=m
CONFIG_SENSORS_DS1621=m
CONFIG_SENSORS_I5K_AMB=m
CONFIG_SENSORS_F71805F=m
CONFIG_SENSORS_F71882FG=m
CONFIG_SENSORS_F75375S=m
CONFIG_SENSORS_FSCHMD=m
CONFIG_SENSORS_G760A=m
CONFIG_SENSORS_GL518SM=m
CONFIG_SENSORS_GL520SM=m
CONFIG_SENSORS_CORETEMP=m
CONFIG_SENSORS_IBMAEM=m
CONFIG_SENSORS_IBMPEX=m
CONFIG_SENSORS_IT87=m
CONFIG_SENSORS_LM63=m
CONFIG_SENSORS_LM70=m
CONFIG_SENSORS_LM73=m
CONFIG_SENSORS_LM75=m
CONFIG_SENSORS_LM77=m
CONFIG_SENSORS_LM78=m
CONFIG_SENSORS_LM80=m
CONFIG_SENSORS_LM83=m
CONFIG_SENSORS_LM85=m
CONFIG_SENSORS_LM87=m
CONFIG_SENSORS_LM90=m
CONFIG_SENSORS_LM92=m
CONFIG_SENSORS_LM93=m
CONFIG_SENSORS_LTC4215=m
CONFIG_SENSORS_LTC4245=m
CONFIG_SENSORS_LM95241=m
CONFIG_SENSORS_MAX1111=m
CONFIG_SENSORS_MAX1619=m
CONFIG_SENSORS_MAX6650=m
CONFIG_SENSORS_PC87360=m
CONFIG_SENSORS_PC87427=m
CONFIG_SENSORS_PCF8591=m
CONFIG_SENSORS_SIS5595=m
CONFIG_SENSORS_DME1737=m
CONFIG_SENSORS_SMSC47M1=m
CONFIG_SENSORS_SMSC47M192=m
CONFIG_SENSORS_SMSC47B397=m
CONFIG_SENSORS_ADS7828=m
CONFIG_SENSORS_AMC6821=m
CONFIG_SENSORS_THMC50=m
CONFIG_SENSORS_TMP401=m
CONFIG_SENSORS_TMP421=m
# CONFIG_SENSORS_VIA_CPUTEMP is not set
CONFIG_SENSORS_VIA686A=m
CONFIG_SENSORS_VT1211=m
CONFIG_SENSORS_VT8231=m
CONFIG_SENSORS_W83781D=m
CONFIG_SENSORS_W83791D=m
CONFIG_SENSORS_W83792D=m
CONFIG_SENSORS_W83793=m
CONFIG_SENSORS_W83L785TS=m
CONFIG_SENSORS_W83L786NG=m
CONFIG_SENSORS_W83627HF=m
CONFIG_SENSORS_W83627EHF=m
CONFIG_SENSORS_WM8350=m
CONFIG_SENSORS_HDAPS=m
# CONFIG_SENSORS_LIS3_I2C is not set
CONFIG_SENSORS_APPLESMC=m
# CONFIG_SENSORS_MC13783_ADC is not set

#
# ACPI drivers
#
CONFIG_SENSORS_ATK0110=m
CONFIG_SENSORS_LIS3LV02D=m
CONFIG_THERMAL=m
CONFIG_THERMAL_HWMON=y
# CONFIG_WATCHDOG is not set
CONFIG_SSB_POSSIBLE=y

#
# Sonics Silicon Backplane
#
CONFIG_SSB=m
CONFIG_SSB_SPROM=y
CONFIG_SSB_BLOCKIO=y
CONFIG_SSB_PCIHOST_POSSIBLE=y
CONFIG_SSB_PCIHOST=y
CONFIG_SSB_B43_PCI_BRIDGE=y
CONFIG_SSB_PCMCIAHOST_POSSIBLE=y
CONFIG_SSB_PCMCIAHOST=y
CONFIG_SSB_SDIOHOST_POSSIBLE=y
CONFIG_SSB_SDIOHOST=y
# CONFIG_SSB_DEBUG is not set
CONFIG_SSB_DRIVER_PCICORE_POSSIBLE=y
CONFIG_SSB_DRIVER_PCICORE=y

#
# Multifunction device drivers
#
CONFIG_MFD_CORE=m
CONFIG_MFD_SM501=m
CONFIG_HTC_PASIC3=m
# CONFIG_MFD_TMIO is not set
CONFIG_MFD_WM8400=m
CONFIG_MFD_WM8350=m
CONFIG_MFD_WM8350_I2C=m
CONFIG_MFD_PCF50633=m
CONFIG_MFD_MC13783=m
CONFIG_PCF50633_ADC=m
CONFIG_PCF50633_GPIO=m
# CONFIG_AB3100_CORE is not set
# CONFIG_EZX_PCAP is not set
# CONFIG_AB4500_CORE is not set
# CONFIG_REGULATOR is not set
CONFIG_MEDIA_SUPPORT=m

#
# Multimedia core support
#
CONFIG_VIDEO_DEV=m
CONFIG_VIDEO_V4L2_COMMON=m
CONFIG_VIDEO_ALLOW_V4L1=y
CONFIG_VIDEO_V4L1_COMPAT=y
CONFIG_DVB_CORE=m
CONFIG_VIDEO_MEDIA=m

#
# Multimedia drivers
#
CONFIG_VIDEO_SAA7146=m
CONFIG_VIDEO_SAA7146_VV=m
CONFIG_IR_CORE=m
CONFIG_VIDEO_IR=m
CONFIG_MEDIA_ATTACH=y
CONFIG_MEDIA_TUNER=m
# CONFIG_MEDIA_TUNER_CUSTOMISE is not set
CONFIG_MEDIA_TUNER_SIMPLE=m
CONFIG_MEDIA_TUNER_TDA8290=m
CONFIG_MEDIA_TUNER_TDA827X=m
CONFIG_MEDIA_TUNER_TDA18271=m
CONFIG_MEDIA_TUNER_TDA9887=m
CONFIG_MEDIA_TUNER_TEA5761=m
CONFIG_MEDIA_TUNER_TEA5767=m
CONFIG_MEDIA_TUNER_MT20XX=m
CONFIG_MEDIA_TUNER_MT2060=m
CONFIG_MEDIA_TUNER_MT2266=m
CONFIG_MEDIA_TUNER_MT2131=m
CONFIG_MEDIA_TUNER_QT1010=m
CONFIG_MEDIA_TUNER_XC2028=m
CONFIG_MEDIA_TUNER_XC5000=m
CONFIG_MEDIA_TUNER_MXL5005S=m
CONFIG_MEDIA_TUNER_MXL5007T=m
CONFIG_MEDIA_TUNER_MC44S803=m
CONFIG_MEDIA_TUNER_MAX2165=m
CONFIG_VIDEO_V4L2=m
CONFIG_VIDEO_V4L1=m
CONFIG_VIDEOBUF_GEN=m
CONFIG_VIDEOBUF_DMA_SG=m
CONFIG_VIDEOBUF_VMALLOC=m
CONFIG_VIDEOBUF_DVB=m
CONFIG_VIDEO_BTCX=m
CONFIG_VIDEO_TVEEPROM=m
CONFIG_VIDEO_TUNER=m
CONFIG_VIDEO_CAPTURE_DRIVERS=y
# CONFIG_VIDEO_ADV_DEBUG is not set
# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
CONFIG_VIDEO_IR_I2C=m
CONFIG_VIDEO_TVAUDIO=m
CONFIG_VIDEO_TDA7432=m
CONFIG_VIDEO_TDA9840=m
CONFIG_VIDEO_TEA6415C=m
CONFIG_VIDEO_TEA6420=m
CONFIG_VIDEO_MSP3400=m
CONFIG_VIDEO_CS5345=m
CONFIG_VIDEO_CS53L32A=m
CONFIG_VIDEO_M52790=m
CONFIG_VIDEO_WM8775=m
CONFIG_VIDEO_WM8739=m
CONFIG_VIDEO_VP27SMPX=m
CONFIG_VIDEO_SAA6588=m
CONFIG_VIDEO_BT819=m
CONFIG_VIDEO_BT856=m
CONFIG_VIDEO_BT866=m
CONFIG_VIDEO_KS0127=m
CONFIG_VIDEO_OV7670=m
CONFIG_VIDEO_MT9V011=m
CONFIG_VIDEO_SAA7110=m
CONFIG_VIDEO_SAA711X=m
CONFIG_VIDEO_SAA717X=m
CONFIG_VIDEO_TVP5150=m
CONFIG_VIDEO_VPX3220=m
CONFIG_VIDEO_CX25840=m
CONFIG_VIDEO_CX2341X=m
CONFIG_VIDEO_SAA7127=m
CONFIG_VIDEO_SAA7185=m
CONFIG_VIDEO_ADV7170=m
CONFIG_VIDEO_ADV7175=m
CONFIG_VIDEO_UPD64031A=m
CONFIG_VIDEO_UPD64083=m
CONFIG_VIDEO_VIVI=m
CONFIG_VIDEO_BT848=m
CONFIG_VIDEO_BT848_DVB=y
CONFIG_VIDEO_CPIA=m
CONFIG_VIDEO_CPIA_USB=m
CONFIG_VIDEO_CPIA2=m
CONFIG_VIDEO_SAA5246A=m
CONFIG_VIDEO_SAA5249=m
CONFIG_VIDEO_STRADIS=m
CONFIG_VIDEO_ZORAN=m
CONFIG_VIDEO_ZORAN_DC30=m
CONFIG_VIDEO_ZORAN_ZR36060=m
CONFIG_VIDEO_ZORAN_BUZ=m
CONFIG_VIDEO_ZORAN_DC10=m
CONFIG_VIDEO_ZORAN_LML33=m
CONFIG_VIDEO_ZORAN_LML33R10=m
CONFIG_VIDEO_ZORAN_AVS6EYES=m
CONFIG_VIDEO_SAA7134=m
CONFIG_VIDEO_SAA7134_ALSA=m
CONFIG_VIDEO_SAA7134_DVB=m
CONFIG_VIDEO_MXB=m
CONFIG_VIDEO_HEXIUM_ORION=m
CONFIG_VIDEO_HEXIUM_GEMINI=m
CONFIG_VIDEO_CX88=m
CONFIG_VIDEO_CX88_ALSA=m
CONFIG_VIDEO_CX88_BLACKBIRD=m
CONFIG_VIDEO_CX88_DVB=m
CONFIG_VIDEO_CX88_MPEG=m
CONFIG_VIDEO_CX88_VP3054=m
CONFIG_VIDEO_CX23885=m
CONFIG_VIDEO_AU0828=m
CONFIG_VIDEO_IVTV=m
CONFIG_VIDEO_FB_IVTV=m
CONFIG_VIDEO_CX18=m
CONFIG_VIDEO_SAA7164=m
CONFIG_VIDEO_CAFE_CCIC=m
CONFIG_SOC_CAMERA=m
CONFIG_SOC_CAMERA_MT9M001=m
CONFIG_SOC_CAMERA_MT9M111=m
CONFIG_SOC_CAMERA_MT9T031=m
CONFIG_SOC_CAMERA_MT9T112=m
CONFIG_SOC_CAMERA_MT9V022=m
CONFIG_SOC_CAMERA_RJ54N1=m
CONFIG_SOC_CAMERA_TW9910=m
CONFIG_SOC_CAMERA_PLATFORM=m
CONFIG_SOC_CAMERA_OV772X=m
CONFIG_SOC_CAMERA_OV9640=m
CONFIG_V4L_USB_DRIVERS=y
CONFIG_USB_VIDEO_CLASS=m
CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y
CONFIG_USB_GSPCA=m
CONFIG_USB_M5602=m
CONFIG_USB_STV06XX=m
CONFIG_USB_GL860=m
CONFIG_USB_GSPCA_CONEX=m
CONFIG_USB_GSPCA_ETOMS=m
CONFIG_USB_GSPCA_FINEPIX=m
CONFIG_USB_GSPCA_JEILINJ=m
CONFIG_USB_GSPCA_MARS=m
CONFIG_USB_GSPCA_MR97310A=m
CONFIG_USB_GSPCA_OV519=m
CONFIG_USB_GSPCA_OV534=m
CONFIG_USB_GSPCA_PAC207=m
CONFIG_USB_GSPCA_PAC7302=m
CONFIG_USB_GSPCA_PAC7311=m
CONFIG_USB_GSPCA_SN9C20X=m
# CONFIG_USB_GSPCA_SN9C20X_EVDEV is not set
CONFIG_USB_GSPCA_SONIXB=m
CONFIG_USB_GSPCA_SONIXJ=m
CONFIG_USB_GSPCA_SPCA500=m
CONFIG_USB_GSPCA_SPCA501=m
CONFIG_USB_GSPCA_SPCA505=m
CONFIG_USB_GSPCA_SPCA506=m
CONFIG_USB_GSPCA_SPCA508=m
CONFIG_USB_GSPCA_SPCA561=m
CONFIG_USB_GSPCA_SQ905=m
CONFIG_USB_GSPCA_SQ905C=m
CONFIG_USB_GSPCA_STK014=m
CONFIG_USB_GSPCA_STV0680=m
CONFIG_USB_GSPCA_SUNPLUS=m
CONFIG_USB_GSPCA_T613=m
CONFIG_USB_GSPCA_TV8532=m
CONFIG_USB_GSPCA_VC032X=m
CONFIG_USB_GSPCA_ZC3XX=m
CONFIG_VIDEO_PVRUSB2=m
CONFIG_VIDEO_PVRUSB2_SYSFS=y
CONFIG_VIDEO_PVRUSB2_DVB=y
# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set
CONFIG_VIDEO_HDPVR=m
CONFIG_VIDEO_EM28XX=m
CONFIG_VIDEO_EM28XX_ALSA=m
CONFIG_VIDEO_EM28XX_DVB=m
CONFIG_VIDEO_CX231XX=m
CONFIG_VIDEO_CX231XX_ALSA=m
CONFIG_VIDEO_CX231XX_DVB=m
CONFIG_VIDEO_USBVISION=m
CONFIG_VIDEO_USBVIDEO=m
CONFIG_USB_VICAM=m
CONFIG_USB_IBMCAM=m
CONFIG_USB_KONICAWC=m
CONFIG_USB_QUICKCAM_MESSENGER=m
CONFIG_USB_ET61X251=m
CONFIG_VIDEO_OVCAMCHIP=m
# CONFIG_USB_W9968CF is not set
CONFIG_USB_OV511=m
CONFIG_USB_SE401=m
CONFIG_USB_SN9C102=m
CONFIG_USB_STV680=m
CONFIG_USB_ZC0301=m
CONFIG_USB_PWC=m
# CONFIG_USB_PWC_DEBUG is not set
CONFIG_USB_PWC_INPUT_EVDEV=y
CONFIG_USB_ZR364XX=m
CONFIG_USB_STKWEBCAM=m
CONFIG_USB_S2255=m
CONFIG_RADIO_ADAPTERS=y
CONFIG_RADIO_GEMTEK_PCI=m
CONFIG_RADIO_MAXIRADIO=m
CONFIG_RADIO_MAESTRO=m
CONFIG_I2C_SI4713=m
CONFIG_RADIO_SI4713=m
CONFIG_USB_DSBR=m
# CONFIG_RADIO_SI470X is not set
CONFIG_USB_MR800=m
CONFIG_RADIO_TEA5764=m
CONFIG_RADIO_TEF6862=m
CONFIG_DVB_MAX_ADAPTERS=8
# CONFIG_DVB_DYNAMIC_MINORS is not set
CONFIG_DVB_CAPTURE_DRIVERS=y

#
# Supported SAA7146 based PCI Adapters
#
CONFIG_TTPCI_EEPROM=m
CONFIG_DVB_AV7110=m
CONFIG_DVB_AV7110_OSD=y
CONFIG_DVB_BUDGET_CORE=m
CONFIG_DVB_BUDGET=m
CONFIG_DVB_BUDGET_CI=m
CONFIG_DVB_BUDGET_AV=m
CONFIG_DVB_BUDGET_PATCH=m

#
# Supported USB Adapters
#
CONFIG_DVB_USB=m
# CONFIG_DVB_USB_DEBUG is not set
CONFIG_DVB_USB_A800=m
CONFIG_DVB_USB_DIBUSB_MB=m
CONFIG_DVB_USB_DIBUSB_MB_FAULTY=y
CONFIG_DVB_USB_DIBUSB_MC=m
CONFIG_DVB_USB_DIB0700=m
CONFIG_DVB_USB_UMT_010=m
CONFIG_DVB_USB_CXUSB=m
CONFIG_DVB_USB_M920X=m
CONFIG_DVB_USB_GL861=m
CONFIG_DVB_USB_AU6610=m
CONFIG_DVB_USB_DIGITV=m
CONFIG_DVB_USB_VP7045=m
CONFIG_DVB_USB_VP702X=m
CONFIG_DVB_USB_GP8PSK=m
CONFIG_DVB_USB_NOVA_T_USB2=m
CONFIG_DVB_USB_TTUSB2=m
CONFIG_DVB_USB_DTT200U=m
CONFIG_DVB_USB_OPERA1=m
CONFIG_DVB_USB_AF9005=m
CONFIG_DVB_USB_AF9005_REMOTE=m
CONFIG_DVB_USB_DW2102=m
CONFIG_DVB_USB_CINERGY_T2=m
CONFIG_DVB_USB_ANYSEE=m
CONFIG_DVB_USB_DTV5100=m
CONFIG_DVB_USB_AF9015=m
CONFIG_DVB_USB_CE6230=m
CONFIG_DVB_USB_FRIIO=m
CONFIG_DVB_USB_EC168=m
CONFIG_DVB_TTUSB_BUDGET=m
CONFIG_DVB_TTUSB_DEC=m
# CONFIG_SMS_SIANO_MDTV is not set

#
# Supported FlexCopII (B2C2) Adapters
#
CONFIG_DVB_B2C2_FLEXCOP=m
CONFIG_DVB_B2C2_FLEXCOP_PCI=m
CONFIG_DVB_B2C2_FLEXCOP_USB=m
# CONFIG_DVB_B2C2_FLEXCOP_DEBUG is not set

#
# Supported BT878 Adapters
#
CONFIG_DVB_BT8XX=m

#
# Supported Pluto2 Adapters
#
CONFIG_DVB_PLUTO2=m

#
# Supported SDMC DM1105 Adapters
#
CONFIG_DVB_DM1105=m

#
# Supported FireWire (IEEE 1394) Adapters
#
# CONFIG_DVB_FIREDTV is not set

#
# Supported Earthsoft PT1 Adapters
#
CONFIG_DVB_PT1=m

#
# Supported Mantis Adapters
#
# CONFIG_MANTIS_CORE is not set

#
# Supported DVB Frontends
#
# CONFIG_DVB_FE_CUSTOMISE is not set
CONFIG_DVB_STB0899=m
CONFIG_DVB_STB6100=m
CONFIG_DVB_CX24110=m
CONFIG_DVB_CX24123=m
CONFIG_DVB_MT312=m
CONFIG_DVB_ZL10036=m
CONFIG_DVB_ZL10039=m
CONFIG_DVB_S5H1420=m
CONFIG_DVB_STV0288=m
CONFIG_DVB_STB6000=m
CONFIG_DVB_STV0299=m
CONFIG_DVB_STV6110=m
CONFIG_DVB_STV0900=m
CONFIG_DVB_TDA8083=m
CONFIG_DVB_TDA10086=m
CONFIG_DVB_TDA8261=m
CONFIG_DVB_VES1X93=m
CONFIG_DVB_TUNER_ITD1000=m
CONFIG_DVB_TUNER_CX24113=m
CONFIG_DVB_TDA826X=m
CONFIG_DVB_TUA6100=m
CONFIG_DVB_CX24116=m
CONFIG_DVB_SI21XX=m
CONFIG_DVB_DS3000=m
CONFIG_DVB_SP8870=m
CONFIG_DVB_SP887X=m
CONFIG_DVB_CX22700=m
CONFIG_DVB_CX22702=m
CONFIG_DVB_L64781=m
CONFIG_DVB_TDA1004X=m
CONFIG_DVB_NXT6000=m
CONFIG_DVB_MT352=m
CONFIG_DVB_ZL10353=m
CONFIG_DVB_DIB3000MB=m
CONFIG_DVB_DIB3000MC=m
CONFIG_DVB_DIB7000M=m
CONFIG_DVB_DIB7000P=m
CONFIG_DVB_TDA10048=m
CONFIG_DVB_AF9013=m
CONFIG_DVB_EC100=m
CONFIG_DVB_VES1820=m
CONFIG_DVB_TDA10021=m
CONFIG_DVB_TDA10023=m
CONFIG_DVB_STV0297=m
CONFIG_DVB_NXT200X=m
CONFIG_DVB_OR51211=m
CONFIG_DVB_OR51132=m
CONFIG_DVB_BCM3510=m
CONFIG_DVB_LGDT330X=m
CONFIG_DVB_LGDT3305=m
CONFIG_DVB_S5H1409=m
CONFIG_DVB_AU8522=m
CONFIG_DVB_S5H1411=m
CONFIG_DVB_DIB8000=m
CONFIG_DVB_PLL=m
CONFIG_DVB_TUNER_DIB0070=m
CONFIG_DVB_LNBP21=m
CONFIG_DVB_ISL6405=m
CONFIG_DVB_ISL6421=m
CONFIG_DVB_LGS8GXX=m
CONFIG_DVB_ATBM8830=m
CONFIG_DAB=y
CONFIG_USB_DABUSB=m

#
# Graphics support
#
CONFIG_AGP=m
CONFIG_AGP_AMD64=m
CONFIG_AGP_INTEL=m
# CONFIG_AGP_SIS is not set
# CONFIG_AGP_VIA is not set
CONFIG_VGA_ARB=y
CONFIG_DRM=m
CONFIG_DRM_KMS_HELPER=m
# CONFIG_DRM_TDFX is not set
# CONFIG_DRM_R128 is not set
# CONFIG_DRM_RADEON is not set
# CONFIG_DRM_I810 is not set
# CONFIG_DRM_I830 is not set
CONFIG_DRM_I915=m
CONFIG_DRM_I915_KMS=y
# CONFIG_DRM_MGA is not set
# CONFIG_DRM_SIS is not set
# CONFIG_DRM_VIA is not set
# CONFIG_DRM_SAVAGE is not set
CONFIG_VGASTATE=m
CONFIG_VIDEO_OUTPUT_CONTROL=m
CONFIG_FB=y
CONFIG_FIRMWARE_EDID=y
# CONFIG_FB_DDC is not set
CONFIG_FB_BOOT_VESA_SUPPORT=y
CONFIG_FB_CFB_FILLRECT=y
CONFIG_FB_CFB_COPYAREA=y
CONFIG_FB_CFB_IMAGEBLIT=y
# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
# CONFIG_FB_SYS_FILLRECT is not set
# CONFIG_FB_SYS_COPYAREA is not set
# CONFIG_FB_SYS_IMAGEBLIT is not set
# CONFIG_FB_FOREIGN_ENDIAN is not set
# CONFIG_FB_SYS_FOPS is not set
# CONFIG_FB_SVGALIB is not set
# CONFIG_FB_MACMODES is not set
# CONFIG_FB_BACKLIGHT is not set
CONFIG_FB_MODE_HELPERS=y
CONFIG_FB_TILEBLITTING=y

#
# Frame buffer hardware drivers
#
# CONFIG_FB_CIRRUS is not set
# CONFIG_FB_PM2 is not set
# CONFIG_FB_CYBER2000 is not set
# CONFIG_FB_ARC is not set
# CONFIG_FB_ASILIANT is not set
# CONFIG_FB_IMSTT is not set
CONFIG_FB_VGA16=m
CONFIG_FB_UVESA=m
CONFIG_FB_VESA=y
CONFIG_FB_EFI=y
# CONFIG_FB_N411 is not set
# CONFIG_FB_HGA is not set
# CONFIG_FB_S1D13XXX is not set
# CONFIG_FB_NVIDIA is not set
# CONFIG_FB_RIVA is not set
# CONFIG_FB_LE80578 is not set
# CONFIG_FB_MATROX is not set
# CONFIG_FB_RADEON is not set
# CONFIG_FB_ATY128 is not set
# CONFIG_FB_ATY is not set
# CONFIG_FB_S3 is not set
# CONFIG_FB_SAVAGE is not set
# CONFIG_FB_SIS is not set
# CONFIG_FB_VIA is not set
# CONFIG_FB_NEOMAGIC is not set
# CONFIG_FB_KYRO is not set
# CONFIG_FB_3DFX is not set
# CONFIG_FB_VOODOO1 is not set
# CONFIG_FB_VT8623 is not set
# CONFIG_FB_TRIDENT is not set
# CONFIG_FB_ARK is not set
# CONFIG_FB_PM3 is not set
# CONFIG_FB_CARMINE is not set
# CONFIG_FB_GEODE is not set
# CONFIG_FB_TMIO is not set
# CONFIG_FB_SM501 is not set
# CONFIG_FB_VIRTUAL is not set
# CONFIG_FB_METRONOME is not set
# CONFIG_FB_MB862XX is not set
# CONFIG_FB_BROADSHEET is not set
CONFIG_BACKLIGHT_LCD_SUPPORT=y
# CONFIG_LCD_CLASS_DEVICE is not set
CONFIG_BACKLIGHT_CLASS_DEVICE=y
# CONFIG_BACKLIGHT_GENERIC is not set
# CONFIG_BACKLIGHT_PROGEAR is not set
# CONFIG_BACKLIGHT_MBP_NVIDIA is not set
# CONFIG_BACKLIGHT_SAHARA is not set

#
# Display device support
#
CONFIG_DISPLAY_SUPPORT=m

#
# Display hardware drivers
#

#
# Console display driver support
#
CONFIG_VGA_CONSOLE=y
# CONFIG_VGACON_SOFT_SCROLLBACK is not set
CONFIG_DUMMY_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE=y
# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
# CONFIG_FONTS is not set
CONFIG_FONT_8x8=y
CONFIG_FONT_8x16=y
# CONFIG_LOGO is not set
CONFIG_SOUND=m
CONFIG_SOUND_OSS_CORE=y
CONFIG_SOUND_OSS_CORE_PRECLAIM=y
CONFIG_SND=m
CONFIG_SND_TIMER=m
CONFIG_SND_PCM=m
CONFIG_SND_HWDEP=m
CONFIG_SND_RAWMIDI=m
CONFIG_SND_JACK=y
CONFIG_SND_SEQUENCER=m
CONFIG_SND_SEQ_DUMMY=m
CONFIG_SND_OSSEMUL=y
CONFIG_SND_MIXER_OSS=m
CONFIG_SND_PCM_OSS=m
CONFIG_SND_PCM_OSS_PLUGINS=y
CONFIG_SND_SEQUENCER_OSS=y
CONFIG_SND_HRTIMER=m
CONFIG_SND_SEQ_HRTIMER_DEFAULT=y
# CONFIG_SND_DYNAMIC_MINORS is not set
CONFIG_SND_SUPPORT_OLD_API=y
CONFIG_SND_VERBOSE_PROCFS=y
# CONFIG_SND_VERBOSE_PRINTK is not set
# CONFIG_SND_DEBUG is not set
CONFIG_SND_VMASTER=y
CONFIG_SND_DMA_SGBUF=y
CONFIG_SND_RAWMIDI_SEQ=m
# CONFIG_SND_OPL3_LIB_SEQ is not set
# CONFIG_SND_OPL4_LIB_SEQ is not set
# CONFIG_SND_SBAWE_SEQ is not set
# CONFIG_SND_EMU10K1_SEQ is not set
CONFIG_SND_DRIVERS=y
# CONFIG_SND_PCSP is not set
CONFIG_SND_DUMMY=m
CONFIG_SND_VIRMIDI=m
# CONFIG_SND_MTPAV is not set
# CONFIG_SND_SERIAL_U16550 is not set
# CONFIG_SND_MPU401 is not set
CONFIG_SND_PCI=y
# CONFIG_SND_AD1889 is not set
# CONFIG_SND_ALS300 is not set
# CONFIG_SND_ALS4000 is not set
# CONFIG_SND_ALI5451 is not set
# CONFIG_SND_ATIIXP is not set
# CONFIG_SND_ATIIXP_MODEM is not set
# CONFIG_SND_AU8810 is not set
# CONFIG_SND_AU8820 is not set
# CONFIG_SND_AU8830 is not set
# CONFIG_SND_AW2 is not set
# CONFIG_SND_AZT3328 is not set
# CONFIG_SND_BT87X is not set
# CONFIG_SND_CA0106 is not set
# CONFIG_SND_CMIPCI is not set
# CONFIG_SND_OXYGEN is not set
# CONFIG_SND_CS4281 is not set
# CONFIG_SND_CS46XX is not set
# CONFIG_SND_CS5530 is not set
# CONFIG_SND_CS5535AUDIO is not set
# CONFIG_SND_CTXFI is not set
# CONFIG_SND_DARLA20 is not set
# CONFIG_SND_GINA20 is not set
# CONFIG_SND_LAYLA20 is not set
# CONFIG_SND_DARLA24 is not set
# CONFIG_SND_GINA24 is not set
# CONFIG_SND_LAYLA24 is not set
# CONFIG_SND_MONA is not set
# CONFIG_SND_MIA is not set
# CONFIG_SND_ECHO3G is not set
# CONFIG_SND_INDIGO is not set
# CONFIG_SND_INDIGOIO is not set
# CONFIG_SND_INDIGODJ is not set
# CONFIG_SND_INDIGOIOX is not set
# CONFIG_SND_INDIGODJX is not set
# CONFIG_SND_EMU10K1 is not set
# CONFIG_SND_EMU10K1X is not set
# CONFIG_SND_ENS1370 is not set
# CONFIG_SND_ENS1371 is not set
# CONFIG_SND_ES1938 is not set
# CONFIG_SND_ES1968 is not set
# CONFIG_SND_FM801 is not set
CONFIG_SND_HDA_INTEL=m
CONFIG_SND_HDA_HWDEP=y
CONFIG_SND_HDA_RECONFIG=y
CONFIG_SND_HDA_INPUT_BEEP=y
CONFIG_SND_HDA_INPUT_BEEP_MODE=1
CONFIG_SND_HDA_INPUT_JACK=y
# CONFIG_SND_HDA_PATCH_LOADER is not set
CONFIG_SND_HDA_CODEC_REALTEK=y
CONFIG_SND_HDA_CODEC_ANALOG=y
CONFIG_SND_HDA_CODEC_SIGMATEL=y
CONFIG_SND_HDA_CODEC_VIA=y
CONFIG_SND_HDA_CODEC_ATIHDMI=y
CONFIG_SND_HDA_CODEC_NVHDMI=y
CONFIG_SND_HDA_CODEC_INTELHDMI=y
CONFIG_SND_HDA_ELD=y
CONFIG_SND_HDA_CODEC_CIRRUS=y
CONFIG_SND_HDA_CODEC_CONEXANT=y
CONFIG_SND_HDA_CODEC_CA0110=y
CONFIG_SND_HDA_CODEC_CMEDIA=y
CONFIG_SND_HDA_CODEC_SI3054=y
CONFIG_SND_HDA_GENERIC=y
CONFIG_SND_HDA_POWER_SAVE=y
CONFIG_SND_HDA_POWER_SAVE_DEFAULT=0
# CONFIG_SND_HDSP is not set
# CONFIG_SND_HDSPM is not set
# CONFIG_SND_HIFIER is not set
# CONFIG_SND_ICE1712 is not set
# CONFIG_SND_ICE1724 is not set
# CONFIG_SND_INTEL8X0 is not set
# CONFIG_SND_INTEL8X0M is not set
# CONFIG_SND_KORG1212 is not set
# CONFIG_SND_LX6464ES is not set
# CONFIG_SND_MAESTRO3 is not set
# CONFIG_SND_MIXART is not set
# CONFIG_SND_NM256 is not set
# CONFIG_SND_PCXHR is not set
# CONFIG_SND_RIPTIDE is not set
# CONFIG_SND_RME32 is not set
# CONFIG_SND_RME96 is not set
# CONFIG_SND_RME9652 is not set
# CONFIG_SND_SONICVIBES is not set
# CONFIG_SND_TRIDENT is not set
# CONFIG_SND_VIA82XX is not set
# CONFIG_SND_VIA82XX_MODEM is not set
# CONFIG_SND_VIRTUOSO is not set
# CONFIG_SND_VX222 is not set
# CONFIG_SND_YMFPCI is not set
# CONFIG_SND_SPI is not set
CONFIG_SND_USB=y
CONFIG_SND_USB_AUDIO=m
# CONFIG_SND_USB_USX2Y is not set
CONFIG_SND_USB_CAIAQ=m
CONFIG_SND_USB_CAIAQ_INPUT=y
# CONFIG_SND_USB_US122L is not set
# CONFIG_SND_PCMCIA is not set
# CONFIG_SND_SOC is not set
# CONFIG_SOUND_PRIME is not set
CONFIG_HID_SUPPORT=y
CONFIG_HID=m
CONFIG_HIDRAW=y

#
# USB Input Devices
#
CONFIG_USB_HID=m
CONFIG_HID_PID=y
CONFIG_USB_HIDDEV=y

#
# Special HID drivers
#
CONFIG_HID_A4TECH=m
CONFIG_HID_APPLE=m
CONFIG_HID_BELKIN=m
CONFIG_HID_CHERRY=m
CONFIG_HID_CHICONY=m
CONFIG_HID_CYPRESS=m
CONFIG_HID_DRAGONRISE=m
# CONFIG_DRAGONRISE_FF is not set
CONFIG_HID_EZKEY=m
CONFIG_HID_KYE=m
CONFIG_HID_GYRATION=m
CONFIG_HID_TWINHAN=m
CONFIG_HID_KENSINGTON=m
CONFIG_HID_LOGITECH=m
CONFIG_LOGITECH_FF=y
CONFIG_LOGIRUMBLEPAD2_FF=y
CONFIG_HID_MICROSOFT=m
CONFIG_HID_MONTEREY=m
CONFIG_HID_NTRIG=m
CONFIG_HID_PANTHERLORD=m
CONFIG_PANTHERLORD_FF=y
CONFIG_HID_PETALYNX=m
CONFIG_HID_SAMSUNG=m
CONFIG_HID_SONY=m
CONFIG_HID_SUNPLUS=m
CONFIG_HID_GREENASIA=m
# CONFIG_GREENASIA_FF is not set
CONFIG_HID_SMARTJOYPLUS=m
# CONFIG_SMARTJOYPLUS_FF is not set
CONFIG_HID_TOPSEED=m
CONFIG_HID_THRUSTMASTER=m
# CONFIG_THRUSTMASTER_FF is not set
CONFIG_HID_WACOM=m
CONFIG_HID_ZEROPLUS=m
# CONFIG_ZEROPLUS_FF is not set
CONFIG_USB_SUPPORT=y
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB_ARCH_HAS_OHCI=y
CONFIG_USB_ARCH_HAS_EHCI=y
CONFIG_USB=m
# CONFIG_USB_DEBUG is not set
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y

#
# Miscellaneous USB options
#
CONFIG_USB_DEVICEFS=y
CONFIG_USB_DEVICE_CLASS=y
# CONFIG_USB_DYNAMIC_MINORS is not set
CONFIG_USB_SUSPEND=y
# CONFIG_USB_OTG is not set
CONFIG_USB_MON=m
CONFIG_USB_WUSB=m
# CONFIG_USB_WUSB_CBAF is not set

#
# USB Host Controller Drivers
#
# CONFIG_USB_C67X00_HCD is not set
# CONFIG_USB_XHCI_HCD is not set
CONFIG_USB_EHCI_HCD=m
CONFIG_USB_EHCI_ROOT_HUB_TT=y
CONFIG_USB_EHCI_TT_NEWSCHED=y
# CONFIG_USB_OXU210HP_HCD is not set
# CONFIG_USB_ISP116X_HCD is not set
# CONFIG_USB_ISP1760_HCD is not set
# CONFIG_USB_ISP1362_HCD is not set
CONFIG_USB_OHCI_HCD=m
# CONFIG_USB_OHCI_HCD_SSB is not set
# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
CONFIG_USB_OHCI_LITTLE_ENDIAN=y
CONFIG_USB_UHCI_HCD=m
CONFIG_USB_U132_HCD=m
CONFIG_USB_SL811_HCD=m
CONFIG_USB_SL811_CS=m
CONFIG_USB_R8A66597_HCD=m
CONFIG_USB_WHCI_HCD=m
CONFIG_USB_HWA_HCD=m

#
# Enable Host or Gadget support to see Inventra options
#

#
# USB Device Class drivers
#
CONFIG_USB_ACM=m
CONFIG_USB_PRINTER=m
CONFIG_USB_WDM=m
CONFIG_USB_TMC=m

#
# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
#

#
# also be needed; see USB_STORAGE Help for more info
#
CONFIG_USB_STORAGE=m
# CONFIG_USB_STORAGE_DEBUG is not set
CONFIG_USB_STORAGE_DATAFAB=m
CONFIG_USB_STORAGE_FREECOM=m
CONFIG_USB_STORAGE_ISD200=m
CONFIG_USB_STORAGE_USBAT=m
CONFIG_USB_STORAGE_SDDR09=m
CONFIG_USB_STORAGE_SDDR55=m
CONFIG_USB_STORAGE_JUMPSHOT=m
CONFIG_USB_STORAGE_ALAUDA=m
CONFIG_USB_STORAGE_ONETOUCH=m
CONFIG_USB_STORAGE_KARMA=m
CONFIG_USB_STORAGE_CYPRESS_ATACB=m
# CONFIG_USB_LIBUSUAL is not set

#
# USB Imaging devices
#
CONFIG_USB_MDC800=m
CONFIG_USB_MICROTEK=m

#
# USB port drivers
#
CONFIG_USB_SERIAL=m
CONFIG_USB_EZUSB=y
CONFIG_USB_SERIAL_GENERIC=y
CONFIG_USB_SERIAL_AIRCABLE=m
CONFIG_USB_SERIAL_ARK3116=m
CONFIG_USB_SERIAL_BELKIN=m
CONFIG_USB_SERIAL_CH341=m
# CONFIG_USB_SERIAL_WHITEHEAT is not set
CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
CONFIG_USB_SERIAL_CP210X=m
CONFIG_USB_SERIAL_CYPRESS_M8=m
CONFIG_USB_SERIAL_EMPEG=m
CONFIG_USB_SERIAL_FTDI_SIO=m
CONFIG_USB_SERIAL_FUNSOFT=m
CONFIG_USB_SERIAL_VISOR=m
CONFIG_USB_SERIAL_IPAQ=m
CONFIG_USB_SERIAL_IR=m
CONFIG_USB_SERIAL_EDGEPORT=m
CONFIG_USB_SERIAL_EDGEPORT_TI=m
CONFIG_USB_SERIAL_GARMIN=m
CONFIG_USB_SERIAL_IPW=m
CONFIG_USB_SERIAL_IUU=m
CONFIG_USB_SERIAL_KEYSPAN_PDA=m
CONFIG_USB_SERIAL_KEYSPAN=m
CONFIG_USB_SERIAL_KLSI=m
CONFIG_USB_SERIAL_KOBIL_SCT=m
CONFIG_USB_SERIAL_MCT_U232=m
CONFIG_USB_SERIAL_MOS7720=m
CONFIG_USB_SERIAL_MOS7840=m
CONFIG_USB_SERIAL_MOTOROLA=m
CONFIG_USB_SERIAL_NAVMAN=m
CONFIG_USB_SERIAL_PL2303=m
CONFIG_USB_SERIAL_OTI6858=m
CONFIG_USB_SERIAL_QUALCOMM=m
CONFIG_USB_SERIAL_SPCP8X5=m
CONFIG_USB_SERIAL_HP4X=m
CONFIG_USB_SERIAL_SAFE=m
# CONFIG_USB_SERIAL_SAFE_PADDED is not set
CONFIG_USB_SERIAL_SIEMENS_MPI=m
CONFIG_USB_SERIAL_SIERRAWIRELESS=m
CONFIG_USB_SERIAL_SYMBOL=m
# CONFIG_USB_SERIAL_TI is not set
CONFIG_USB_SERIAL_CYBERJACK=m
CONFIG_USB_SERIAL_XIRCOM=m
CONFIG_USB_SERIAL_OPTION=m
CONFIG_USB_SERIAL_OMNINET=m
CONFIG_USB_SERIAL_OPTICON=m
CONFIG_USB_SERIAL_DEBUG=m

#
# USB Miscellaneous drivers
#
CONFIG_USB_EMI62=m
CONFIG_USB_EMI26=m
CONFIG_USB_ADUTUX=m
CONFIG_USB_SEVSEG=m
CONFIG_USB_RIO500=m
# CONFIG_USB_LEGOTOWER is not set
CONFIG_USB_LCD=m
CONFIG_USB_BERRY_CHARGE=m
CONFIG_USB_LED=m
CONFIG_USB_CYPRESS_CY7C63=m
CONFIG_USB_CYTHERM=m
CONFIG_USB_IDMOUSE=m
CONFIG_USB_FTDI_ELAN=m
CONFIG_USB_APPLEDISPLAY=m
CONFIG_USB_SISUSBVGA=m
CONFIG_USB_SISUSBVGA_CON=y
CONFIG_USB_LD=m
CONFIG_USB_TRANCEVIBRATOR=m
CONFIG_USB_IOWARRIOR=m
CONFIG_USB_TEST=m
CONFIG_USB_ISIGHTFW=m
# CONFIG_USB_VST is not set
# CONFIG_USB_GADGET is not set

#
# OTG and related infrastructure
#
CONFIG_USB_OTG_UTILS=y
CONFIG_NOP_USB_XCEIV=m
CONFIG_UWB=m
CONFIG_UWB_HWA=m
CONFIG_UWB_WHCI=m
CONFIG_UWB_WLP=m
CONFIG_UWB_I1480U=m
CONFIG_UWB_I1480U_WLP=m
CONFIG_MMC=m
# CONFIG_MMC_DEBUG is not set
# CONFIG_MMC_UNSAFE_RESUME is not set

#
# MMC/SD/SDIO Card Drivers
#
CONFIG_MMC_BLOCK=m
CONFIG_MMC_BLOCK_BOUNCE=y
CONFIG_SDIO_UART=m
# CONFIG_MMC_TEST is not set

#
# MMC/SD/SDIO Host Controller Drivers
#
CONFIG_MMC_SDHCI=m
CONFIG_MMC_SDHCI_PCI=m
CONFIG_MMC_RICOH_MMC=m
CONFIG_MMC_SDHCI_PLTFM=m
CONFIG_MMC_WBSD=m
# CONFIG_MMC_AT91 is not set
# CONFIG_MMC_ATMELMCI is not set
CONFIG_MMC_TIFM_SD=m
CONFIG_MMC_SPI=m
CONFIG_MMC_SDRICOH_CS=m
CONFIG_MMC_CB710=m
CONFIG_MMC_VIA_SDMMC=m
CONFIG_MEMSTICK=m
# CONFIG_MEMSTICK_DEBUG is not set

#
# MemoryStick drivers
#
# CONFIG_MEMSTICK_UNSAFE_RESUME is not set
CONFIG_MSPRO_BLOCK=m

#
# MemoryStick Host Controller Drivers
#
CONFIG_MEMSTICK_TIFM_MS=m
CONFIG_MEMSTICK_JMICRON_38X=m
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=m

#
# LED drivers
#
CONFIG_LEDS_ALIX2=m
CONFIG_LEDS_PCA9532=m
# CONFIG_LEDS_LP3944 is not set
CONFIG_LEDS_CLEVO_MAIL=m
CONFIG_LEDS_PCA955X=m
CONFIG_LEDS_WM8350=m
CONFIG_LEDS_DAC124S085=m
CONFIG_LEDS_BD2802=m
# CONFIG_LEDS_INTEL_SS4200 is not set

#
# LED Triggers
#
CONFIG_LEDS_TRIGGERS=y
CONFIG_LEDS_TRIGGER_TIMER=m
CONFIG_LEDS_TRIGGER_IDE_DISK=y
CONFIG_LEDS_TRIGGER_HEARTBEAT=m
CONFIG_LEDS_TRIGGER_BACKLIGHT=m
CONFIG_LEDS_TRIGGER_DEFAULT_ON=m

#
# iptables trigger is under Netfilter config (LED target)
#
# CONFIG_ACCESSIBILITY is not set
# CONFIG_INFINIBAND is not set
# CONFIG_EDAC is not set
CONFIG_RTC_LIB=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_HCTOSYS=y
CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
# CONFIG_RTC_DEBUG is not set

#
# RTC interfaces
#
CONFIG_RTC_INTF_SYSFS=y
CONFIG_RTC_INTF_PROC=y
CONFIG_RTC_INTF_DEV=y
# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
# CONFIG_RTC_DRV_TEST is not set

#
# I2C RTC drivers
#
CONFIG_RTC_DRV_DS1307=m
CONFIG_RTC_DRV_DS1374=m
CONFIG_RTC_DRV_DS1672=m
CONFIG_RTC_DRV_MAX6900=m
CONFIG_RTC_DRV_RS5C372=m
CONFIG_RTC_DRV_ISL1208=m
CONFIG_RTC_DRV_X1205=m
CONFIG_RTC_DRV_PCF8563=m
CONFIG_RTC_DRV_PCF8583=m
CONFIG_RTC_DRV_M41T80=m
# CONFIG_RTC_DRV_M41T80_WDT is not set
# CONFIG_RTC_DRV_BQ32K is not set
CONFIG_RTC_DRV_S35390A=m
CONFIG_RTC_DRV_FM3130=m
CONFIG_RTC_DRV_RX8581=m
CONFIG_RTC_DRV_RX8025=m

#
# SPI RTC drivers
#
CONFIG_RTC_DRV_M41T94=m
CONFIG_RTC_DRV_DS1305=m
CONFIG_RTC_DRV_DS1390=m
CONFIG_RTC_DRV_MAX6902=m
CONFIG_RTC_DRV_R9701=m
CONFIG_RTC_DRV_RS5C348=m
CONFIG_RTC_DRV_DS3234=m
CONFIG_RTC_DRV_PCF2123=m

#
# Platform RTC drivers
#
CONFIG_RTC_DRV_CMOS=y
CONFIG_RTC_DRV_DS1286=m
CONFIG_RTC_DRV_DS1511=m
CONFIG_RTC_DRV_DS1553=m
CONFIG_RTC_DRV_DS1742=m
CONFIG_RTC_DRV_STK17TA8=m
CONFIG_RTC_DRV_M48T86=m
CONFIG_RTC_DRV_M48T35=m
CONFIG_RTC_DRV_M48T59=m
# CONFIG_RTC_DRV_MSM6242 is not set
CONFIG_RTC_DRV_BQ4802=m
# CONFIG_RTC_DRV_RP5C01 is not set
CONFIG_RTC_DRV_V3020=m
CONFIG_RTC_DRV_WM8350=m
CONFIG_RTC_DRV_PCF50633=m

#
# on-CPU RTC drivers
#
# CONFIG_RTC_DRV_MC13783 is not set
# CONFIG_DMADEVICES is not set
# CONFIG_AUXDISPLAY is not set
CONFIG_UIO=m
# CONFIG_UIO_CIF is not set
CONFIG_UIO_PDRV=m
CONFIG_UIO_PDRV_GENIRQ=m
# CONFIG_UIO_SMX is not set
# CONFIG_UIO_AEC is not set
# CONFIG_UIO_SERCOS3 is not set
# CONFIG_UIO_PCI_GENERIC is not set

#
# TI VLYNQ
#
# CONFIG_STAGING is not set
CONFIG_X86_PLATFORM_DEVICES=y
# CONFIG_ACER_WMI is not set
# CONFIG_ACERHDF is not set
# CONFIG_ASUS_LAPTOP is not set
# CONFIG_DELL_WMI is not set
# CONFIG_FUJITSU_LAPTOP is not set
# CONFIG_HP_WMI is not set
# CONFIG_MSI_LAPTOP is not set
# CONFIG_PANASONIC_LAPTOP is not set
# CONFIG_COMPAL_LAPTOP is not set
# CONFIG_SONY_LAPTOP is not set
CONFIG_THINKPAD_ACPI=m
# CONFIG_THINKPAD_ACPI_ALSA_SUPPORT is not set
# CONFIG_THINKPAD_ACPI_DEBUGFACILITIES is not set
# CONFIG_THINKPAD_ACPI_DEBUG is not set
# CONFIG_THINKPAD_ACPI_UNSAFE_LEDS is not set
CONFIG_THINKPAD_ACPI_VIDEO=y
CONFIG_THINKPAD_ACPI_HOTKEY_POLL=y
# CONFIG_INTEL_MENLOW is not set
# CONFIG_EEEPC_LAPTOP is not set
CONFIG_ACPI_WMI=m
# CONFIG_MSI_WMI is not set
# CONFIG_ACPI_ASUS is not set
# CONFIG_TOPSTAR_LAPTOP is not set
# CONFIG_ACPI_TOSHIBA is not set
# CONFIG_TOSHIBA_BT_RFKILL is not set
# CONFIG_ACPI_CMPC is not set

#
# Firmware Drivers
#
CONFIG_EDD=m
# CONFIG_EDD_OFF is not set
CONFIG_FIRMWARE_MEMMAP=y
CONFIG_EFI_VARS=m
# CONFIG_DELL_RBU is not set
# CONFIG_DCDBAS is not set
CONFIG_DMIID=y
# CONFIG_ISCSI_IBFT_FIND is not set

#
# File systems
#
CONFIG_EXT2_FS=m
CONFIG_EXT2_FS_XATTR=y
CONFIG_EXT2_FS_POSIX_ACL=y
CONFIG_EXT2_FS_SECURITY=y
# CONFIG_EXT2_FS_XIP is not set
CONFIG_EXT3_FS=m
CONFIG_EXT3_DEFAULTS_TO_ORDERED=y
CONFIG_EXT3_FS_XATTR=y
CONFIG_EXT3_FS_POSIX_ACL=y
CONFIG_EXT3_FS_SECURITY=y
CONFIG_EXT4_FS=m
CONFIG_EXT4_FS_XATTR=y
CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_EXT4_FS_SECURITY=y
# CONFIG_EXT4_DEBUG is not set
CONFIG_JBD=m
# CONFIG_JBD_DEBUG is not set
CONFIG_JBD2=m
# CONFIG_JBD2_DEBUG is not set
CONFIG_FS_MBCACHE=m
CONFIG_REISERFS_FS=m
# CONFIG_REISERFS_CHECK is not set
# CONFIG_REISERFS_PROC_INFO is not set
CONFIG_REISERFS_FS_XATTR=y
CONFIG_REISERFS_FS_POSIX_ACL=y
CONFIG_REISERFS_FS_SECURITY=y
CONFIG_JFS_FS=m
CONFIG_JFS_POSIX_ACL=y
CONFIG_JFS_SECURITY=y
# CONFIG_JFS_DEBUG is not set
# CONFIG_JFS_STATISTICS is not set
CONFIG_FS_POSIX_ACL=y
CONFIG_XFS_FS=m
CONFIG_XFS_QUOTA=y
CONFIG_XFS_POSIX_ACL=y
CONFIG_XFS_RT=y
# CONFIG_XFS_DEBUG is not set
CONFIG_GFS2_FS=m
CONFIG_GFS2_FS_LOCKING_DLM=y
CONFIG_OCFS2_FS=m
CONFIG_OCFS2_FS_O2CB=m
CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m
CONFIG_OCFS2_FS_STATS=y
CONFIG_OCFS2_DEBUG_MASKLOG=y
# CONFIG_OCFS2_DEBUG_FS is not set
CONFIG_BTRFS_FS=m
CONFIG_BTRFS_FS_POSIX_ACL=y
CONFIG_NILFS2_FS=m
CONFIG_FILE_LOCKING=y
CONFIG_FSNOTIFY=y
CONFIG_DNOTIFY=y
CONFIG_INOTIFY=y
CONFIG_INOTIFY_USER=y
CONFIG_QUOTA=y
CONFIG_QUOTA_NETLINK_INTERFACE=y
CONFIG_PRINT_QUOTA_WARNING=y
CONFIG_QUOTA_TREE=m
CONFIG_QFMT_V1=m
CONFIG_QFMT_V2=m
CONFIG_QUOTACTL=y
CONFIG_AUTOFS_FS=m
CONFIG_AUTOFS4_FS=m
CONFIG_FUSE_FS=m
CONFIG_CUSE=m
CONFIG_GENERIC_ACL=y

#
# Caches
#
CONFIG_FSCACHE=m
CONFIG_FSCACHE_STATS=y
# CONFIG_FSCACHE_HISTOGRAM is not set
# CONFIG_FSCACHE_DEBUG is not set
# CONFIG_FSCACHE_OBJECT_LIST is not set
CONFIG_CACHEFILES=m
# CONFIG_CACHEFILES_DEBUG is not set
# CONFIG_CACHEFILES_HISTOGRAM is not set

#
# CD-ROM/DVD Filesystems
#
CONFIG_ISO9660_FS=m
CONFIG_JOLIET=y
CONFIG_ZISOFS=y
CONFIG_UDF_FS=m
CONFIG_UDF_NLS=y

#
# DOS/FAT/NT Filesystems
#
CONFIG_FAT_FS=m
CONFIG_MSDOS_FS=m
CONFIG_VFAT_FS=m
CONFIG_FAT_DEFAULT_CODEPAGE=437
CONFIG_FAT_DEFAULT_IOCHARSET="utf8"
CONFIG_NTFS_FS=m
# CONFIG_NTFS_DEBUG is not set
CONFIG_NTFS_RW=y

#
# Pseudo filesystems
#
CONFIG_PROC_FS=y
CONFIG_PROC_KCORE=y
CONFIG_PROC_SYSCTL=y
CONFIG_PROC_PAGE_MONITOR=y
CONFIG_SYSFS=y
CONFIG_TMPFS=y
CONFIG_TMPFS_POSIX_ACL=y
CONFIG_HUGETLBFS=y
CONFIG_HUGETLB_PAGE=y
CONFIG_CONFIGFS_FS=m
CONFIG_MISC_FILESYSTEMS=y
CONFIG_ADFS_FS=m
# CONFIG_ADFS_FS_RW is not set
CONFIG_AFFS_FS=m
CONFIG_ECRYPT_FS=m
CONFIG_HFS_FS=m
CONFIG_HFSPLUS_FS=m
CONFIG_BEFS_FS=m
# CONFIG_BEFS_DEBUG is not set
CONFIG_BFS_FS=m
CONFIG_EFS_FS=m
CONFIG_JFFS2_FS=m
CONFIG_JFFS2_FS_DEBUG=0
CONFIG_JFFS2_FS_WRITEBUFFER=y
# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
CONFIG_JFFS2_SUMMARY=y
CONFIG_JFFS2_FS_XATTR=y
CONFIG_JFFS2_FS_POSIX_ACL=y
CONFIG_JFFS2_FS_SECURITY=y
CONFIG_JFFS2_COMPRESSION_OPTIONS=y
CONFIG_JFFS2_ZLIB=y
CONFIG_JFFS2_LZO=y
CONFIG_JFFS2_RTIME=y
# CONFIG_JFFS2_RUBIN is not set
# CONFIG_JFFS2_CMODE_NONE is not set
CONFIG_JFFS2_CMODE_PRIORITY=y
# CONFIG_JFFS2_CMODE_SIZE is not set
# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
CONFIG_UBIFS_FS=m
CONFIG_UBIFS_FS_XATTR=y
CONFIG_UBIFS_FS_ADVANCED_COMPR=y
CONFIG_UBIFS_FS_LZO=y
CONFIG_UBIFS_FS_ZLIB=y
# CONFIG_UBIFS_FS_DEBUG is not set
CONFIG_CRAMFS=m
CONFIG_SQUASHFS=m
# CONFIG_SQUASHFS_EMBEDDED is not set
CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
CONFIG_VXFS_FS=m
CONFIG_MINIX_FS=m
CONFIG_OMFS_FS=m
CONFIG_HPFS_FS=m
CONFIG_QNX4FS_FS=m
CONFIG_ROMFS_FS=m
# CONFIG_ROMFS_BACKED_BY_BLOCK is not set
# CONFIG_ROMFS_BACKED_BY_MTD is not set
CONFIG_ROMFS_BACKED_BY_BOTH=y
CONFIG_ROMFS_ON_BLOCK=y
CONFIG_ROMFS_ON_MTD=y
CONFIG_SYSV_FS=m
CONFIG_UFS_FS=m
# CONFIG_UFS_FS_WRITE is not set
# CONFIG_UFS_DEBUG is not set
CONFIG_EXOFS_FS=m
# CONFIG_EXOFS_DEBUG is not set
CONFIG_NETWORK_FILESYSTEMS=y
CONFIG_NFS_FS=m
CONFIG_NFS_V3=y
CONFIG_NFS_V3_ACL=y
CONFIG_NFS_V4=y
# CONFIG_NFS_V4_1 is not set
CONFIG_NFS_FSCACHE=y
CONFIG_NFSD=m
CONFIG_NFSD_V2_ACL=y
CONFIG_NFSD_V3=y
CONFIG_NFSD_V3_ACL=y
CONFIG_NFSD_V4=y
CONFIG_LOCKD=m
CONFIG_LOCKD_V4=y
CONFIG_EXPORTFS=m
CONFIG_NFS_ACL_SUPPORT=m
CONFIG_NFS_COMMON=y
CONFIG_SUNRPC=m
CONFIG_SUNRPC_GSS=m
CONFIG_RPCSEC_GSS_KRB5=m
CONFIG_RPCSEC_GSS_SPKM3=m
# CONFIG_SMB_FS is not set
CONFIG_CIFS=m
# CONFIG_CIFS_STATS is not set
CONFIG_CIFS_WEAK_PW_HASH=y
CONFIG_CIFS_UPCALL=y
CONFIG_CIFS_XATTR=y
CONFIG_CIFS_POSIX=y
# CONFIG_CIFS_DEBUG2 is not set
CONFIG_CIFS_DFS_UPCALL=y
CONFIG_CIFS_EXPERIMENTAL=y
CONFIG_NCP_FS=m
# CONFIG_NCPFS_PACKET_SIGNING is not set
# CONFIG_NCPFS_IOCTL_LOCKING is not set
# CONFIG_NCPFS_STRONG is not set
CONFIG_NCPFS_NFS_NS=y
CONFIG_NCPFS_OS2_NS=y
# CONFIG_NCPFS_SMALLDOS is not set
CONFIG_NCPFS_NLS=y
CONFIG_NCPFS_EXTRAS=y
CONFIG_CODA_FS=m
CONFIG_AFS_FS=m
# CONFIG_AFS_DEBUG is not set
CONFIG_AFS_FSCACHE=y

#
# Partition Types
#
CONFIG_PARTITION_ADVANCED=y
CONFIG_ACORN_PARTITION=y
# CONFIG_ACORN_PARTITION_CUMANA is not set
# CONFIG_ACORN_PARTITION_EESOX is not set
CONFIG_ACORN_PARTITION_ICS=y
# CONFIG_ACORN_PARTITION_ADFS is not set
# CONFIG_ACORN_PARTITION_POWERTEC is not set
CONFIG_ACORN_PARTITION_RISCIX=y
CONFIG_OSF_PARTITION=y
CONFIG_AMIGA_PARTITION=y
CONFIG_ATARI_PARTITION=y
CONFIG_MAC_PARTITION=y
CONFIG_MSDOS_PARTITION=y
CONFIG_BSD_DISKLABEL=y
CONFIG_MINIX_SUBPARTITION=y
CONFIG_SOLARIS_X86_PARTITION=y
CONFIG_UNIXWARE_DISKLABEL=y
CONFIG_LDM_PARTITION=y
# CONFIG_LDM_DEBUG is not set
CONFIG_SGI_PARTITION=y
CONFIG_ULTRIX_PARTITION=y
CONFIG_SUN_PARTITION=y
CONFIG_KARMA_PARTITION=y
CONFIG_EFI_PARTITION=y
# CONFIG_SYSV68_PARTITION is not set
CONFIG_NLS=m
CONFIG_NLS_DEFAULT="utf8"
CONFIG_NLS_CODEPAGE_437=m
CONFIG_NLS_CODEPAGE_737=m
CONFIG_NLS_CODEPAGE_775=m
CONFIG_NLS_CODEPAGE_850=m
CONFIG_NLS_CODEPAGE_852=m
CONFIG_NLS_CODEPAGE_855=m
CONFIG_NLS_CODEPAGE_857=m
CONFIG_NLS_CODEPAGE_860=m
CONFIG_NLS_CODEPAGE_861=m
CONFIG_NLS_CODEPAGE_862=m
CONFIG_NLS_CODEPAGE_863=m
CONFIG_NLS_CODEPAGE_864=m
CONFIG_NLS_CODEPAGE_865=m
CONFIG_NLS_CODEPAGE_866=m
CONFIG_NLS_CODEPAGE_869=m
CONFIG_NLS_CODEPAGE_936=m
CONFIG_NLS_CODEPAGE_950=m
CONFIG_NLS_CODEPAGE_932=m
CONFIG_NLS_CODEPAGE_949=m
CONFIG_NLS_CODEPAGE_874=m
CONFIG_NLS_ISO8859_8=m
CONFIG_NLS_CODEPAGE_1250=m
CONFIG_NLS_CODEPAGE_1251=m
CONFIG_NLS_ASCII=m
CONFIG_NLS_ISO8859_1=m
CONFIG_NLS_ISO8859_2=m
CONFIG_NLS_ISO8859_3=m
CONFIG_NLS_ISO8859_4=m
CONFIG_NLS_ISO8859_5=m
CONFIG_NLS_ISO8859_6=m
CONFIG_NLS_ISO8859_7=m
CONFIG_NLS_ISO8859_9=m
CONFIG_NLS_ISO8859_13=m
CONFIG_NLS_ISO8859_14=m
CONFIG_NLS_ISO8859_15=m
CONFIG_NLS_KOI8_R=m
CONFIG_NLS_KOI8_U=m
CONFIG_NLS_UTF8=m
CONFIG_DLM=m
CONFIG_DLM_DEBUG=y

#
# Kernel hacking
#
CONFIG_TRACE_IRQFLAGS_SUPPORT=y
CONFIG_PRINTK_TIME=y
CONFIG_ENABLE_WARN_DEPRECATED=y
CONFIG_ENABLE_MUST_CHECK=y
CONFIG_FRAME_WARN=2048
CONFIG_MAGIC_SYSRQ=y
CONFIG_STRIP_ASM_SYMS=y
# CONFIG_UNUSED_SYMBOLS is not set
CONFIG_DEBUG_FS=y
# CONFIG_HEADERS_CHECK is not set
CONFIG_DEBUG_KERNEL=y
CONFIG_DETECT_SOFTLOCKUP=y
# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
CONFIG_DETECT_HUNG_TASK=y
# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
CONFIG_SCHED_DEBUG=y
# CONFIG_SCHEDSTATS is not set
CONFIG_TIMER_STATS=y
# CONFIG_DEBUG_OBJECTS is not set
# CONFIG_DEBUG_SLAB is not set
# CONFIG_DEBUG_KMEMLEAK is not set
# CONFIG_DEBUG_PREEMPT is not set
# CONFIG_DEBUG_RT_MUTEXES is not set
# CONFIG_RT_MUTEX_TESTER is not set
# CONFIG_DEBUG_SPINLOCK is not set
# CONFIG_DEBUG_LOCK_ALLOC is not set
# CONFIG_PROVE_LOCKING is not set
# CONFIG_LOCK_STAT is not set
# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
CONFIG_STACKTRACE=y
# CONFIG_DEBUG_KOBJECT is not set
CONFIG_DEBUG_BUGVERBOSE=y
# CONFIG_DEBUG_INFO is not set
# CONFIG_DEBUG_VM is not set
# CONFIG_DEBUG_VIRTUAL is not set
# CONFIG_DEBUG_WRITECOUNT is not set
CONFIG_DEBUG_MEMORY_INIT=y
# CONFIG_DEBUG_LIST is not set
# CONFIG_DEBUG_SG is not set
# CONFIG_DEBUG_NOTIFIERS is not set
# CONFIG_DEBUG_CREDENTIALS is not set
CONFIG_ARCH_WANT_FRAME_POINTERS=y
# CONFIG_FRAME_POINTER is not set
# CONFIG_BOOT_PRINTK_DELAY is not set
# CONFIG_RCU_TORTURE_TEST is not set
# CONFIG_RCU_CPU_STALL_DETECTOR is not set
# CONFIG_BACKTRACE_SELF_TEST is not set
# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
# CONFIG_FAULT_INJECTION is not set
# CONFIG_LATENCYTOP is not set
CONFIG_SYSCTL_SYSCALL_CHECK=y
# CONFIG_DEBUG_PAGEALLOC is not set
CONFIG_USER_STACKTRACE_SUPPORT=y
CONFIG_NOP_TRACER=y
CONFIG_HAVE_FUNCTION_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_FP_TEST=y
CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
CONFIG_HAVE_DYNAMIC_FTRACE=y
CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
CONFIG_RING_BUFFER=y
CONFIG_EVENT_TRACING=y
CONFIG_CONTEXT_SWITCH_TRACER=y
CONFIG_RING_BUFFER_ALLOW_SWAP=y
CONFIG_TRACING=y
CONFIG_TRACING_SUPPORT=y
# CONFIG_FTRACE is not set
# CONFIG_PROVIDE_OHCI1394_DMA_INIT is not set
# CONFIG_DYNAMIC_DEBUG is not set
# CONFIG_DMA_API_DEBUG is not set
# CONFIG_SAMPLES is not set
CONFIG_HAVE_ARCH_KGDB=y
# CONFIG_KGDB is not set
CONFIG_HAVE_ARCH_KMEMCHECK=y
# CONFIG_KMEMCHECK is not set
CONFIG_STRICT_DEVMEM=y
CONFIG_X86_VERBOSE_BOOTUP=y
CONFIG_EARLY_PRINTK=y
# CONFIG_EARLY_PRINTK_DBGP is not set
# CONFIG_DEBUG_STACKOVERFLOW is not set
# CONFIG_DEBUG_STACK_USAGE is not set
# CONFIG_X86_PTDUMP is not set
CONFIG_DEBUG_RODATA=y
# CONFIG_DEBUG_RODATA_TEST is not set
# CONFIG_DEBUG_NX_TEST is not set
# CONFIG_IOMMU_DEBUG is not set
# CONFIG_IOMMU_STRESS is not set
CONFIG_HAVE_MMIOTRACE_SUPPORT=y
CONFIG_IO_DELAY_TYPE_0X80=0
CONFIG_IO_DELAY_TYPE_0XED=1
CONFIG_IO_DELAY_TYPE_UDELAY=2
CONFIG_IO_DELAY_TYPE_NONE=3
CONFIG_IO_DELAY_0X80=y
# CONFIG_IO_DELAY_0XED is not set
# CONFIG_IO_DELAY_UDELAY is not set
# CONFIG_IO_DELAY_NONE is not set
CONFIG_DEFAULT_IO_DELAY_TYPE=0
# CONFIG_DEBUG_BOOT_PARAMS is not set
# CONFIG_CPA_DEBUG is not set
CONFIG_OPTIMIZE_INLINING=y
# CONFIG_DEBUG_STRICT_USER_COPY_CHECKS is not set

#
# Security options
#
CONFIG_KEYS=y
# CONFIG_KEYS_DEBUG_PROC_KEYS is not set
CONFIG_SECURITY=y
CONFIG_SECURITYFS=y
CONFIG_SECURITY_NETWORK=y
CONFIG_SECURITY_NETWORK_XFRM=y
# CONFIG_SECURITY_PATH is not set
# CONFIG_SECURITY_SELINUX is not set
# CONFIG_SECURITY_TOMOYO is not set
# CONFIG_IMA is not set
# CONFIG_DEFAULT_SECURITY_SELINUX is not set
# CONFIG_DEFAULT_SECURITY_SMACK is not set
# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
CONFIG_DEFAULT_SECURITY_DAC=y
CONFIG_DEFAULT_SECURITY=""
CONFIG_CRYPTO=y

#
# Crypto core or helper
#
CONFIG_CRYPTO_FIPS=y
CONFIG_CRYPTO_ALGAPI=y
CONFIG_CRYPTO_ALGAPI2=y
CONFIG_CRYPTO_AEAD=m
CONFIG_CRYPTO_AEAD2=y
CONFIG_CRYPTO_BLKCIPHER=m
CONFIG_CRYPTO_BLKCIPHER2=y
CONFIG_CRYPTO_HASH=y
CONFIG_CRYPTO_HASH2=y
CONFIG_CRYPTO_RNG=m
CONFIG_CRYPTO_RNG2=y
CONFIG_CRYPTO_PCOMP=y
CONFIG_CRYPTO_MANAGER=y
CONFIG_CRYPTO_MANAGER2=y
CONFIG_CRYPTO_GF128MUL=m
CONFIG_CRYPTO_NULL=m
CONFIG_CRYPTO_WORKQUEUE=y
CONFIG_CRYPTO_CRYPTD=m
CONFIG_CRYPTO_AUTHENC=m
CONFIG_CRYPTO_TEST=m

#
# Authenticated Encryption with Associated Data
#
CONFIG_CRYPTO_CCM=m
CONFIG_CRYPTO_GCM=m
CONFIG_CRYPTO_SEQIV=m

#
# Block modes
#
CONFIG_CRYPTO_CBC=m
CONFIG_CRYPTO_CTR=m
CONFIG_CRYPTO_CTS=m
CONFIG_CRYPTO_ECB=m
CONFIG_CRYPTO_LRW=m
CONFIG_CRYPTO_PCBC=m
CONFIG_CRYPTO_XTS=m

#
# Hash modes
#
CONFIG_CRYPTO_HMAC=m
CONFIG_CRYPTO_XCBC=m
CONFIG_CRYPTO_VMAC=m

#
# Digest
#
CONFIG_CRYPTO_CRC32C=m
CONFIG_CRYPTO_CRC32C_INTEL=m
CONFIG_CRYPTO_GHASH=m
CONFIG_CRYPTO_MD4=m
CONFIG_CRYPTO_MD5=y
CONFIG_CRYPTO_MICHAEL_MIC=m
CONFIG_CRYPTO_RMD128=m
CONFIG_CRYPTO_RMD160=m
CONFIG_CRYPTO_RMD256=m
CONFIG_CRYPTO_RMD320=m
CONFIG_CRYPTO_SHA1=m
CONFIG_CRYPTO_SHA256=m
CONFIG_CRYPTO_SHA512=m
CONFIG_CRYPTO_TGR192=m
CONFIG_CRYPTO_WP512=m
CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL=m

#
# Ciphers
#
CONFIG_CRYPTO_AES=m
CONFIG_CRYPTO_AES_X86_64=m
# CONFIG_CRYPTO_AES_NI_INTEL is not set
CONFIG_CRYPTO_ANUBIS=m
CONFIG_CRYPTO_ARC4=m
CONFIG_CRYPTO_BLOWFISH=m
CONFIG_CRYPTO_CAMELLIA=m
CONFIG_CRYPTO_CAST5=m
CONFIG_CRYPTO_CAST6=m
CONFIG_CRYPTO_DES=m
CONFIG_CRYPTO_FCRYPT=m
CONFIG_CRYPTO_KHAZAD=m
# CONFIG_CRYPTO_SALSA20 is not set
CONFIG_CRYPTO_SALSA20_X86_64=m
CONFIG_CRYPTO_SEED=m
CONFIG_CRYPTO_SERPENT=m
CONFIG_CRYPTO_TEA=m
# CONFIG_CRYPTO_TWOFISH is not set
CONFIG_CRYPTO_TWOFISH_COMMON=m
CONFIG_CRYPTO_TWOFISH_X86_64=m

#
# Compression
#
CONFIG_CRYPTO_DEFLATE=m
CONFIG_CRYPTO_ZLIB=m
CONFIG_CRYPTO_LZO=m
CONFIG_CRYPTO_LZF=m

#
# Random Number Generation
#
CONFIG_CRYPTO_ANSI_CPRNG=m
CONFIG_CRYPTO_HW=y
# CONFIG_CRYPTO_DEV_PADLOCK is not set
# CONFIG_CRYPTO_DEV_HIFN_795X is not set
CONFIG_HAVE_KVM=y
CONFIG_HAVE_KVM_IRQCHIP=y
CONFIG_HAVE_KVM_EVENTFD=y
CONFIG_KVM_APIC_ARCHITECTURE=y
CONFIG_VIRTUALIZATION=y
CONFIG_KVM=m
CONFIG_KVM_INTEL=m
# CONFIG_KVM_AMD is not set
CONFIG_VIRTIO=m
CONFIG_VIRTIO_RING=m
CONFIG_VIRTIO_PCI=m
CONFIG_VIRTIO_BALLOON=m
CONFIG_BINARY_PRINTF=y

#
# Library routines
#
CONFIG_BITREVERSE=y
CONFIG_GENERIC_FIND_FIRST_BIT=y
CONFIG_GENERIC_FIND_NEXT_BIT=y
CONFIG_GENERIC_FIND_LAST_BIT=y
CONFIG_CRC_CCITT=m
CONFIG_CRC16=m
CONFIG_CRC_T10DIF=m
CONFIG_CRC_ITU_T=m
CONFIG_CRC32=y
CONFIG_CRC7=m
CONFIG_LIBCRC32C=m
CONFIG_ZLIB_INFLATE=y
CONFIG_ZLIB_DEFLATE=m
CONFIG_LZO_COMPRESS=m
CONFIG_LZO_DECOMPRESS=y
CONFIG_DECOMPRESS_GZIP=y
CONFIG_DECOMPRESS_BZIP2=y
CONFIG_DECOMPRESS_LZMA=y
CONFIG_DECOMPRESS_LZO=y
CONFIG_REED_SOLOMON=m
CONFIG_REED_SOLOMON_DEC16=y
CONFIG_TEXTSEARCH=y
CONFIG_TEXTSEARCH_KMP=m
CONFIG_TEXTSEARCH_BM=m
CONFIG_TEXTSEARCH_FSM=m
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y
CONFIG_HAS_DMA=y
CONFIG_NLATTR=y

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
  2010-04-10  8:34                         ` Daniel Mack
  (?)
@ 2010-04-10 17:02                         ` Robert Hancock
  2010-04-12 18:56                           ` Sarah Sharp
  -1 siblings, 1 reply; 221+ messages in thread
From: Robert Hancock @ 2010-04-10 17:02 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Sarah Sharp, alsa-devel, Greg KH, Takashi Iwai, Greg KH,
	linux-usb, linux-kernel, Alan Stern, Pedro Ribeiro, akpm

On Sat, Apr 10, 2010 at 2:34 AM, Daniel Mack <daniel@caiaq.de> wrote:
> On Fri, Apr 09, 2010 at 05:38:13PM -0600, Robert Hancock wrote:
>> On Fri, Apr 9, 2010 at 10:50 AM, Sarah Sharp
>> <sarah.a.sharp@linux.intel.com> wrote:
>> > What makes you think that?  I've seen URB buffers with 64-bit DMA
>> > addresses.  I can tell when the debug polling loop runs and I look at
>> > the DMA addresses the xHCI driver is feeding to the hardware:
>> >
>> > Dev 1 endpoint ring 0:
>> > xhci_hcd 0000:05:00.0: @71a49800 01000680 00080000 00000008 00000841
>> >
>> > So the TRB at address 71a49800 is pointing to a buffer at address
>> > 0x0008000001000680.
>>
>> I'm not sure why the address would be that huge, unless it's not
>> actually a physical address, or there's some kind of remapping going
>> on?
>>
>> >
>> > If I'm setting a DMA mask wrong somewhere, or doing something else to
>> > limit the DMA to 32-bit, then please let me know.
>>
>> The DMA mask for the controller isn't being set anywhere (in the
>> version that's in Linus' current git anyway). In that case it'll
>> default to 32-bit and any DMA mappings above 4GB will need to be
>> remapped. The controller driver doesn't do the mapping itself but the
>> USB core does, passing in the controller device as the one doing the
>> DMA, so if the controller's DMA mask is set to 32-bit then the buffers
>> passed in will get remapped/bounced accordingly.
>
> So if we're seeing physical addresses in the log above, and the xHCI
> driver does not explicitly allow the USB core to use addresses above
> 4GB, why shouldn't the same thing be true as well for EHCI?
> (Which would then be exactly the case we're seeing)

That is a bit suspicious, yes. With the DMA mask at default I don't
expect that should happen. Sarah, what kind of traffic was happening
when you saw that (bulk, isochronous, etc)?

If this apparent EHCI problem is reproducible, it might be useful to
add some code that warns if anything non-zero gets written to the
hw_bufp_hi and hw_buf_hi members in the descriptors.

Also, booting with mem=4096M on an affected system would also tell you
if it's related to using memory above 4GB.

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-07 14:59   ` Alan Stern
@ 2010-04-12  8:59     ` Andi Kleen
  -1 siblings, 0 replies; 221+ messages in thread
From: Andi Kleen @ 2010-04-12  8:59 UTC (permalink / raw)
  To: Alan Stern
  Cc: Daniel Mack, linux-kernel, Pedro Ribeiro, akpm, Greg KH,
	alsa-devel, linux-usb

Alan Stern <stern@rowland.harvard.edu> writes:
>> 
>> The fix is to use usb_buffer_alloc() for that purpose which ensures
>> memory that is suitable for DMA. And on x86_64, this also means that the
>> upper 32 bits of the address returned are all 0's.
>
> That is not a good fix.  usb_buffer_alloc() provides coherent memory, 
> which is not what we want.  I believe the correct fix is to specify the 
> GFP_DMA32 flag in the kzalloc() call.

The traditional way to handle this is to leave it to swiotlb in
pci_map_*. pci_map_* is needed anyways if you run with a IOMMU.

Also note at least on x86 systems coherent memory is the same as non coherent
memory. And GFP_DMA32 is a x86 specific flag, doesn't necessarily 
do any good anywhere else.

So if you add x86isms anyways you could as well use dma_alloc_coherent()
directly which is actually better at this than a simple GFP_DMA32
and as a bonus handles the IOMMUs correctly too.

Or just use GFP_KERNEL and pci_map_* later.

-Andi

-- 
ak@linux.intel.com -- Speaking for myself only.

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-12  8:59     ` Andi Kleen
  0 siblings, 0 replies; 221+ messages in thread
From: Andi Kleen @ 2010-04-12  8:59 UTC (permalink / raw)
  To: Alan Stern
  Cc: Daniel Mack, linux-kernel, Pedro Ribeiro, akpm, Greg KH,
	alsa-devel, linux-usb

Alan Stern <stern@rowland.harvard.edu> writes:
>> 
>> The fix is to use usb_buffer_alloc() for that purpose which ensures
>> memory that is suitable for DMA. And on x86_64, this also means that the
>> upper 32 bits of the address returned are all 0's.
>
> That is not a good fix.  usb_buffer_alloc() provides coherent memory, 
> which is not what we want.  I believe the correct fix is to specify the 
> GFP_DMA32 flag in the kzalloc() call.

The traditional way to handle this is to leave it to swiotlb in
pci_map_*. pci_map_* is needed anyways if you run with a IOMMU.

Also note at least on x86 systems coherent memory is the same as non coherent
memory. And GFP_DMA32 is a x86 specific flag, doesn't necessarily 
do any good anywhere else.

So if you add x86isms anyways you could as well use dma_alloc_coherent()
directly which is actually better at this than a simple GFP_DMA32
and as a bonus handles the IOMMUs correctly too.

Or just use GFP_KERNEL and pci_map_* later.

-Andi

-- 
ak@linux.intel.com -- Speaking for myself only.

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [LKML] Re: USB transfer_buffer allocations on 64bit systems
  2010-04-09 22:11                         ` Robert Hancock
@ 2010-04-12 10:48                             ` Daniel Mack
  0 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-12 10:48 UTC (permalink / raw)
  To: Robert Hancock
  Cc: Alan Stern, Konrad Rzeszutek Wilk, Pedro Ribeiro, linux-kernel,
	akpm, Greg KH, alsa-devel, linux-usb

On Fri, Apr 09, 2010 at 04:11:52PM -0600, Robert Hancock wrote:
> On Fri, Apr 9, 2010 at 3:23 PM, Alan Stern <stern@rowland.harvard.edu> wrote:
> > On Fri, 9 Apr 2010, Konrad Rzeszutek Wilk wrote:
> >
> >> On Fri, Apr 09, 2010 at 03:34:06PM -0400, Alan Stern wrote:
> >> > On Fri, 9 Apr 2010, Pedro Ribeiro wrote:
> >> >
> >> > > > The DMA pointers do indeed look sane. I wanted to take a deeper look at
> >> > > > this and set up a 64bit system today. However, I fail to see the problem
> >> > > > here. Pedro, how much RAM does your machine have installed?
> >> >
> >> > > It has 4 GB.
> >> >
> >> > That means DMA mapping cannot be the cause of the problem.  :-(
> >>
> >> That isn't entirely true. The BIOS usually allocates a 256 MB ACPI/PCI hole
> >> that is under the 4GB.
> >>
> >> So end up with 3.7 GB, then the 256MB hole, and then right above the 4GB
> >> you the the remaining memory: 4.3GB.
> >
> > How can Pedro find out what physical addresses are in use on his
> > system?
> 
> If you have 4GB of RAM then almost certainly you have memory located
> at addresses over 4GB. If you look at the e820 memory map printed at
> the start of dmesg on bootup and see entries with addresses of
> 100000000 or higher reported as usable, then this is the case.

Pedro, can you provide your dmesg output, please? I installed 5GB or RAM
to my machine now, and even with your .config, I can't see the problem.

Daniel


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [LKML] Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-12 10:48                             ` Daniel Mack
  0 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-12 10:48 UTC (permalink / raw)
  To: Robert Hancock
  Cc: alsa-devel, linux-usb, Konrad Rzeszutek Wilk, Greg KH,
	linux-kernel, Alan Stern, Pedro Ribeiro, akpm

On Fri, Apr 09, 2010 at 04:11:52PM -0600, Robert Hancock wrote:
> On Fri, Apr 9, 2010 at 3:23 PM, Alan Stern <stern@rowland.harvard.edu> wrote:
> > On Fri, 9 Apr 2010, Konrad Rzeszutek Wilk wrote:
> >
> >> On Fri, Apr 09, 2010 at 03:34:06PM -0400, Alan Stern wrote:
> >> > On Fri, 9 Apr 2010, Pedro Ribeiro wrote:
> >> >
> >> > > > The DMA pointers do indeed look sane. I wanted to take a deeper look at
> >> > > > this and set up a 64bit system today. However, I fail to see the problem
> >> > > > here. Pedro, how much RAM does your machine have installed?
> >> >
> >> > > It has 4 GB.
> >> >
> >> > That means DMA mapping cannot be the cause of the problem.  :-(
> >>
> >> That isn't entirely true. The BIOS usually allocates a 256 MB ACPI/PCI hole
> >> that is under the 4GB.
> >>
> >> So end up with 3.7 GB, then the 256MB hole, and then right above the 4GB
> >> you the the remaining memory: 4.3GB.
> >
> > How can Pedro find out what physical addresses are in use on his
> > system?
> 
> If you have 4GB of RAM then almost certainly you have memory located
> at addresses over 4GB. If you look at the e820 memory map printed at
> the start of dmesg on bootup and see entries with addresses of
> 100000000 or higher reported as usable, then this is the case.

Pedro, can you provide your dmesg output, please? I installed 5GB or RAM
to my machine now, and even with your .config, I can't see the problem.

Daniel

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-12  8:59     ` Andi Kleen
@ 2010-04-12 11:14       ` Daniel Mack
  -1 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-12 11:14 UTC (permalink / raw)
  To: Andi Kleen
  Cc: Alan Stern, linux-kernel, Pedro Ribeiro, akpm, Greg KH,
	alsa-devel, linux-usb

On Mon, Apr 12, 2010 at 10:59:57AM +0200, Andi Kleen wrote:
> Alan Stern <stern@rowland.harvard.edu> writes:
> >> 
> >> The fix is to use usb_buffer_alloc() for that purpose which ensures
> >> memory that is suitable for DMA. And on x86_64, this also means that the
> >> upper 32 bits of the address returned are all 0's.
> >
> > That is not a good fix.  usb_buffer_alloc() provides coherent memory, 
> > which is not what we want.  I believe the correct fix is to specify the 
> > GFP_DMA32 flag in the kzalloc() call.
> 
> The traditional way to handle this is to leave it to swiotlb in
> pci_map_*. pci_map_* is needed anyways if you run with a IOMMU.
> 
> Also note at least on x86 systems coherent memory is the same as non coherent
> memory. And GFP_DMA32 is a x86 specific flag, doesn't necessarily 
> do any good anywhere else.
> 
> So if you add x86isms anyways you could as well use dma_alloc_coherent()
> directly which is actually better at this than a simple GFP_DMA32
> and as a bonus handles the IOMMUs correctly too.

Which is exactly what usb_buffer_alloc() does already. So at least for
x86 you say this is the right thing to do? However, we don't necessarily
need coherent memory on other platforms, which is why I hessitate to
enforce that type of memory for all transfer_buffer allocations.

> Or just use GFP_KERNEL and pci_map_* later.

The USB core does this already, but at least on Pedro's machine, this
seems unsufficient. Unfortunately, I can't reproduce the issue yet, even
with more than 4GB of RAM installed.

Daniel


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-12 11:14       ` Daniel Mack
  0 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-12 11:14 UTC (permalink / raw)
  To: Andi Kleen
  Cc: alsa-devel, linux-usb, Greg KH, linux-kernel, Alan Stern,
	Pedro Ribeiro, akpm

On Mon, Apr 12, 2010 at 10:59:57AM +0200, Andi Kleen wrote:
> Alan Stern <stern@rowland.harvard.edu> writes:
> >> 
> >> The fix is to use usb_buffer_alloc() for that purpose which ensures
> >> memory that is suitable for DMA. And on x86_64, this also means that the
> >> upper 32 bits of the address returned are all 0's.
> >
> > That is not a good fix.  usb_buffer_alloc() provides coherent memory, 
> > which is not what we want.  I believe the correct fix is to specify the 
> > GFP_DMA32 flag in the kzalloc() call.
> 
> The traditional way to handle this is to leave it to swiotlb in
> pci_map_*. pci_map_* is needed anyways if you run with a IOMMU.
> 
> Also note at least on x86 systems coherent memory is the same as non coherent
> memory. And GFP_DMA32 is a x86 specific flag, doesn't necessarily 
> do any good anywhere else.
> 
> So if you add x86isms anyways you could as well use dma_alloc_coherent()
> directly which is actually better at this than a simple GFP_DMA32
> and as a bonus handles the IOMMUs correctly too.

Which is exactly what usb_buffer_alloc() does already. So at least for
x86 you say this is the right thing to do? However, we don't necessarily
need coherent memory on other platforms, which is why I hessitate to
enforce that type of memory for all transfer_buffer allocations.

> Or just use GFP_KERNEL and pci_map_* later.

The USB core does this already, but at least on Pedro's machine, this
seems unsufficient. Unfortunately, I can't reproduce the issue yet, even
with more than 4GB of RAM installed.

Daniel

^ permalink raw reply	[flat|nested] 221+ messages in thread

* [PATCH] USB: rename usb_buffer_alloc() and usb_buffer_free()
@ 2010-04-12 11:17                 ` Daniel Mack
  0 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-12 11:17 UTC (permalink / raw)
  To: linux-kernel
  Cc: Daniel Mack, Alan Stern, Greg KH, Pedro Ribeiro, akpm, linux-usb,
	alsa-devel

For more clearance what the functions actually do,

  usb_buffer_alloc() is renamed to usb_alloc_coherent()
  usb_buffer_free()  is renamed to usb_free_coherent()

They should only be used in code which really needs DMA coherency.

All call sites have been changed accordingly, except for staging
drivers.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg KH <gregkh@suse.de>
Cc: Pedro Ribeiro <pedrib@gmail.com>
Cc: akpm@linux-foundation.org
Cc: linux-usb@vger.kernel.org
Cc: alsa-devel@alsa-project.org
---
 Documentation/DocBook/writing_usb_driver.tmpl  |    2 +-
 Documentation/usb/dma.txt                      |    4 +-
 drivers/hid/usbhid/hid-core.c                  |   16 +++++-----
 drivers/hid/usbhid/usbkbd.c                    |   12 ++++----
 drivers/hid/usbhid/usbmouse.c                  |    6 ++--
 drivers/input/joystick/xpad.c                  |   16 +++++-----
 drivers/input/misc/ati_remote.c                |   12 ++++----
 drivers/input/misc/ati_remote2.c               |    4 +-
 drivers/input/misc/cm109.c                     |   24 +++++++-------
 drivers/input/misc/keyspan_remote.c            |    6 ++--
 drivers/input/misc/powermate.c                 |   16 +++++-----
 drivers/input/misc/yealink.c                   |   24 +++++++-------
 drivers/input/mouse/appletouch.c               |   12 ++++----
 drivers/input/mouse/bcm5974.c                  |   24 +++++++-------
 drivers/input/tablet/acecad.c                  |    6 ++--
 drivers/input/tablet/aiptek.c                  |   14 ++++----
 drivers/input/tablet/gtco.c                    |   12 ++++----
 drivers/input/tablet/kbtab.c                   |    6 ++--
 drivers/input/tablet/wacom_sys.c               |   10 +++---
 drivers/input/touchscreen/usbtouchscreen.c     |    8 ++--
 drivers/media/dvb/dvb-usb/usb-urb.c            |    7 ++--
 drivers/media/dvb/ttusb-dec/ttusb_dec.c        |    6 ++--
 drivers/media/video/au0828/au0828-video.c      |    4 +-
 drivers/media/video/cx231xx/cx231xx-core.c     |   14 ++++----
 drivers/media/video/em28xx/em28xx-core.c       |    4 +-
 drivers/media/video/gspca/benq.c               |    4 +-
 drivers/media/video/gspca/gspca.c              |   30 +++++++++---------
 drivers/media/video/hdpvr/hdpvr-video.c        |    8 ++--
 drivers/media/video/tlg2300/pd-video.c         |   14 ++++----
 drivers/media/video/usbvision/usbvision-core.c |   16 +++++-----
 drivers/media/video/uvc/uvc_video.c            |    4 +-
 drivers/net/can/usb/ems_usb.c                  |   18 +++++-----
 drivers/net/usb/kaweth.c                       |   12 ++++----
 drivers/net/wireless/ath/ar9170/usb.c          |    8 ++--
 drivers/net/wireless/zd1211rw/zd_usb.c         |   10 +++---
 drivers/usb/class/cdc-acm.c                    |   22 +++++++-------
 drivers/usb/class/cdc-wdm.c                    |   38 ++++++++++++------------
 drivers/usb/class/usblp.c                      |    2 +-
 drivers/usb/core/usb.c                         |   20 ++++++------
 drivers/usb/misc/appledisplay.c                |    6 ++--
 drivers/usb/misc/ftdi-elan.c                   |   18 +++++-----
 drivers/usb/misc/iowarrior.c                   |   12 ++++----
 drivers/usb/misc/usblcd.c                      |    8 ++--
 drivers/usb/misc/usbtest.c                     |   16 +++++-----
 drivers/usb/storage/onetouch.c                 |   12 ++++----
 drivers/usb/storage/usb.c                      |   12 ++++----
 drivers/usb/usb-skeleton.c                     |   10 +++---
 drivers/watchdog/pcwd_usb.c                    |    6 ++--
 include/linux/usb.h                            |    6 ++--
 sound/usb/midi.c                               |   14 ++++----
 sound/usb/misc/ua101.c                         |   16 +++++-----
 sound/usb/urb.c                                |   18 +++++-----
 52 files changed, 315 insertions(+), 314 deletions(-)

diff --git a/Documentation/DocBook/writing_usb_driver.tmpl b/Documentation/DocBook/writing_usb_driver.tmpl
index eeff19c..bd97a13 100644
--- a/Documentation/DocBook/writing_usb_driver.tmpl
+++ b/Documentation/DocBook/writing_usb_driver.tmpl
@@ -342,7 +342,7 @@ static inline void skel_delete (struct usb_skel *dev)
 {
     kfree (dev->bulk_in_buffer);
     if (dev->bulk_out_buffer != NULL)
-        usb_buffer_free (dev->udev, dev->bulk_out_size,
+        usb_free_coherent (dev->udev, dev->bulk_out_size,
             dev->bulk_out_buffer,
             dev->write_urb->transfer_dma);
     usb_free_urb (dev->write_urb);
diff --git a/Documentation/usb/dma.txt b/Documentation/usb/dma.txt
index cfdcd16..a37e59c 100644
--- a/Documentation/usb/dma.txt
+++ b/Documentation/usb/dma.txt
@@ -43,10 +43,10 @@ and effects like cache-trashing can impose subtle penalties.
   kind of addresses to store in urb->transfer_buffer and urb->transfer_dma.
   You'd also set URB_NO_TRANSFER_DMA_MAP in urb->transfer_flags:
 
-	void *usb_buffer_alloc (struct usb_device *dev, size_t size,
+	void *usb_alloc_coherent (struct usb_device *dev, size_t size,
 		int mem_flags, dma_addr_t *dma);
 
-	void usb_buffer_free (struct usb_device *dev, size_t size,
+	void usb_free_coherent (struct usb_device *dev, size_t size,
 		void *addr, dma_addr_t dma);
 
   Most drivers should *NOT* be using these primitives; they don't need
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index 56d06cd..8496f3a 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -783,13 +783,13 @@ static int hid_alloc_buffers(struct usb_device *dev, struct hid_device *hid)
 {
 	struct usbhid_device *usbhid = hid->driver_data;
 
-	usbhid->inbuf = usb_buffer_alloc(dev, usbhid->bufsize, GFP_KERNEL,
+	usbhid->inbuf = usb_alloc_coherent(dev, usbhid->bufsize, GFP_KERNEL,
 			&usbhid->inbuf_dma);
-	usbhid->outbuf = usb_buffer_alloc(dev, usbhid->bufsize, GFP_KERNEL,
+	usbhid->outbuf = usb_alloc_coherent(dev, usbhid->bufsize, GFP_KERNEL,
 			&usbhid->outbuf_dma);
-	usbhid->cr = usb_buffer_alloc(dev, sizeof(*usbhid->cr), GFP_KERNEL,
+	usbhid->cr = usb_alloc_coherent(dev, sizeof(*usbhid->cr), GFP_KERNEL,
 			&usbhid->cr_dma);
-	usbhid->ctrlbuf = usb_buffer_alloc(dev, usbhid->bufsize, GFP_KERNEL,
+	usbhid->ctrlbuf = usb_alloc_coherent(dev, usbhid->bufsize, GFP_KERNEL,
 			&usbhid->ctrlbuf_dma);
 	if (!usbhid->inbuf || !usbhid->outbuf || !usbhid->cr ||
 			!usbhid->ctrlbuf)
@@ -844,10 +844,10 @@ static void hid_free_buffers(struct usb_device *dev, struct hid_device *hid)
 {
 	struct usbhid_device *usbhid = hid->driver_data;
 
-	usb_buffer_free(dev, usbhid->bufsize, usbhid->inbuf, usbhid->inbuf_dma);
-	usb_buffer_free(dev, usbhid->bufsize, usbhid->outbuf, usbhid->outbuf_dma);
-	usb_buffer_free(dev, sizeof(*(usbhid->cr)), usbhid->cr, usbhid->cr_dma);
-	usb_buffer_free(dev, usbhid->bufsize, usbhid->ctrlbuf, usbhid->ctrlbuf_dma);
+	usb_free_coherent(dev, usbhid->bufsize, usbhid->inbuf, usbhid->inbuf_dma);
+	usb_free_coherent(dev, usbhid->bufsize, usbhid->outbuf, usbhid->outbuf_dma);
+	usb_free_coherent(dev, sizeof(*(usbhid->cr)), usbhid->cr, usbhid->cr_dma);
+	usb_free_coherent(dev, usbhid->bufsize, usbhid->ctrlbuf, usbhid->ctrlbuf_dma);
 }
 
 static int usbhid_parse(struct hid_device *hid)
diff --git a/drivers/hid/usbhid/usbkbd.c b/drivers/hid/usbhid/usbkbd.c
index f843443..b86f866 100644
--- a/drivers/hid/usbhid/usbkbd.c
+++ b/drivers/hid/usbhid/usbkbd.c
@@ -197,11 +197,11 @@ static int usb_kbd_alloc_mem(struct usb_device *dev, struct usb_kbd *kbd)
 		return -1;
 	if (!(kbd->led = usb_alloc_urb(0, GFP_KERNEL)))
 		return -1;
-	if (!(kbd->new = usb_buffer_alloc(dev, 8, GFP_ATOMIC, &kbd->new_dma)))
+	if (!(kbd->new = usb_alloc_coherent(dev, 8, GFP_ATOMIC, &kbd->new_dma)))
 		return -1;
-	if (!(kbd->cr = usb_buffer_alloc(dev, sizeof(struct usb_ctrlrequest), GFP_ATOMIC, &kbd->cr_dma)))
+	if (!(kbd->cr = usb_alloc_coherent(dev, sizeof(struct usb_ctrlrequest), GFP_ATOMIC, &kbd->cr_dma)))
 		return -1;
-	if (!(kbd->leds = usb_buffer_alloc(dev, 1, GFP_ATOMIC, &kbd->leds_dma)))
+	if (!(kbd->leds = usb_alloc_coherent(dev, 1, GFP_ATOMIC, &kbd->leds_dma)))
 		return -1;
 
 	return 0;
@@ -211,9 +211,9 @@ static void usb_kbd_free_mem(struct usb_device *dev, struct usb_kbd *kbd)
 {
 	usb_free_urb(kbd->irq);
 	usb_free_urb(kbd->led);
-	usb_buffer_free(dev, 8, kbd->new, kbd->new_dma);
-	usb_buffer_free(dev, sizeof(struct usb_ctrlrequest), kbd->cr, kbd->cr_dma);
-	usb_buffer_free(dev, 1, kbd->leds, kbd->leds_dma);
+	usb_free_coherent(dev, 8, kbd->new, kbd->new_dma);
+	usb_free_coherent(dev, sizeof(struct usb_ctrlrequest), kbd->cr, kbd->cr_dma);
+	usb_free_coherent(dev, 1, kbd->leds, kbd->leds_dma);
 }
 
 static int usb_kbd_probe(struct usb_interface *iface,
diff --git a/drivers/hid/usbhid/usbmouse.c b/drivers/hid/usbhid/usbmouse.c
index 72ab4b2..79b2bf8 100644
--- a/drivers/hid/usbhid/usbmouse.c
+++ b/drivers/hid/usbhid/usbmouse.c
@@ -142,7 +142,7 @@ static int usb_mouse_probe(struct usb_interface *intf, const struct usb_device_i
 	if (!mouse || !input_dev)
 		goto fail1;
 
-	mouse->data = usb_buffer_alloc(dev, 8, GFP_ATOMIC, &mouse->data_dma);
+	mouse->data = usb_alloc_coherent(dev, 8, GFP_ATOMIC, &mouse->data_dma);
 	if (!mouse->data)
 		goto fail1;
 
@@ -205,7 +205,7 @@ static int usb_mouse_probe(struct usb_interface *intf, const struct usb_device_i
 fail3:	
 	usb_free_urb(mouse->irq);
 fail2:	
-	usb_buffer_free(dev, 8, mouse->data, mouse->data_dma);
+	usb_free_coherent(dev, 8, mouse->data, mouse->data_dma);
 fail1:	
 	input_free_device(input_dev);
 	kfree(mouse);
@@ -221,7 +221,7 @@ static void usb_mouse_disconnect(struct usb_interface *intf)
 		usb_kill_urb(mouse->irq);
 		input_unregister_device(mouse->dev);
 		usb_free_urb(mouse->irq);
-		usb_buffer_free(interface_to_usbdev(intf), 8, mouse->data, mouse->data_dma);
+		usb_free_coherent(interface_to_usbdev(intf), 8, mouse->data, mouse->data_dma);
 		kfree(mouse);
 	}
 }
diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index 9b3353b..c1087ce 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -533,8 +533,8 @@ static int xpad_init_output(struct usb_interface *intf, struct usb_xpad *xpad)
 	if (xpad->xtype != XTYPE_XBOX360 && xpad->xtype != XTYPE_XBOX)
 		return 0;
 
-	xpad->odata = usb_buffer_alloc(xpad->udev, XPAD_PKT_LEN,
-				       GFP_KERNEL, &xpad->odata_dma);
+	xpad->odata = usb_alloc_coherent(xpad->udev, XPAD_PKT_LEN,
+					 GFP_KERNEL, &xpad->odata_dma);
 	if (!xpad->odata)
 		goto fail1;
 
@@ -554,7 +554,7 @@ static int xpad_init_output(struct usb_interface *intf, struct usb_xpad *xpad)
 
 	return 0;
 
- fail2:	usb_buffer_free(xpad->udev, XPAD_PKT_LEN, xpad->odata, xpad->odata_dma);
+ fail2:	usb_free_coherent(xpad->udev, XPAD_PKT_LEN, xpad->odata, xpad->odata_dma);
  fail1:	return error;
 }
 
@@ -568,7 +568,7 @@ static void xpad_deinit_output(struct usb_xpad *xpad)
 {
 	if (xpad->xtype == XTYPE_XBOX360 || xpad->xtype == XTYPE_XBOX) {
 		usb_free_urb(xpad->irq_out);
-		usb_buffer_free(xpad->udev, XPAD_PKT_LEN,
+		usb_free_coherent(xpad->udev, XPAD_PKT_LEN,
 				xpad->odata, xpad->odata_dma);
 	}
 }
@@ -788,8 +788,8 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id
 	if (!xpad || !input_dev)
 		goto fail1;
 
-	xpad->idata = usb_buffer_alloc(udev, XPAD_PKT_LEN,
-				       GFP_KERNEL, &xpad->idata_dma);
+	xpad->idata = usb_alloc_coherent(udev, XPAD_PKT_LEN,
+					 GFP_KERNEL, &xpad->idata_dma);
 	if (!xpad->idata)
 		goto fail1;
 
@@ -942,7 +942,7 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id
  fail5:	usb_kill_urb(xpad->irq_in);
  fail4:	usb_free_urb(xpad->irq_in);
  fail3:	xpad_deinit_output(xpad);
- fail2:	usb_buffer_free(udev, XPAD_PKT_LEN, xpad->idata, xpad->idata_dma);
+ fail2:	usb_free_coherent(udev, XPAD_PKT_LEN, xpad->idata, xpad->idata_dma);
  fail1:	input_free_device(input_dev);
 	kfree(xpad);
 	return error;
@@ -964,7 +964,7 @@ static void xpad_disconnect(struct usb_interface *intf)
 			usb_kill_urb(xpad->irq_in);
 		}
 		usb_free_urb(xpad->irq_in);
-		usb_buffer_free(xpad->udev, XPAD_PKT_LEN,
+		usb_free_coherent(xpad->udev, XPAD_PKT_LEN,
 				xpad->idata, xpad->idata_dma);
 		kfree(xpad);
 	}
diff --git a/drivers/input/misc/ati_remote.c b/drivers/input/misc/ati_remote.c
index 614b65d..2b9a2c8 100644
--- a/drivers/input/misc/ati_remote.c
+++ b/drivers/input/misc/ati_remote.c
@@ -620,13 +620,13 @@ static void ati_remote_irq_in(struct urb *urb)
 static int ati_remote_alloc_buffers(struct usb_device *udev,
 				    struct ati_remote *ati_remote)
 {
-	ati_remote->inbuf = usb_buffer_alloc(udev, DATA_BUFSIZE, GFP_ATOMIC,
-					     &ati_remote->inbuf_dma);
+	ati_remote->inbuf = usb_alloc_coherent(udev, DATA_BUFSIZE, GFP_ATOMIC,
+					       &ati_remote->inbuf_dma);
 	if (!ati_remote->inbuf)
 		return -1;
 
-	ati_remote->outbuf = usb_buffer_alloc(udev, DATA_BUFSIZE, GFP_ATOMIC,
-					      &ati_remote->outbuf_dma);
+	ati_remote->outbuf = usb_alloc_coherent(udev, DATA_BUFSIZE, GFP_ATOMIC,
+					        &ati_remote->outbuf_dma);
 	if (!ati_remote->outbuf)
 		return -1;
 
@@ -649,10 +649,10 @@ static void ati_remote_free_buffers(struct ati_remote *ati_remote)
 	usb_free_urb(ati_remote->irq_urb);
 	usb_free_urb(ati_remote->out_urb);
 
-	usb_buffer_free(ati_remote->udev, DATA_BUFSIZE,
+	usb_free_coherent(ati_remote->udev, DATA_BUFSIZE,
 		ati_remote->inbuf, ati_remote->inbuf_dma);
 
-	usb_buffer_free(ati_remote->udev, DATA_BUFSIZE,
+	usb_free_coherent(ati_remote->udev, DATA_BUFSIZE,
 		ati_remote->outbuf, ati_remote->outbuf_dma);
 }
 
diff --git a/drivers/input/misc/ati_remote2.c b/drivers/input/misc/ati_remote2.c
index 2124b99..e148749 100644
--- a/drivers/input/misc/ati_remote2.c
+++ b/drivers/input/misc/ati_remote2.c
@@ -589,7 +589,7 @@ static int ati_remote2_urb_init(struct ati_remote2 *ar2)
 	int i, pipe, maxp;
 
 	for (i = 0; i < 2; i++) {
-		ar2->buf[i] = usb_buffer_alloc(udev, 4, GFP_KERNEL, &ar2->buf_dma[i]);
+		ar2->buf[i] = usb_alloc_coherent(udev, 4, GFP_KERNEL, &ar2->buf_dma[i]);
 		if (!ar2->buf[i])
 			return -ENOMEM;
 
@@ -617,7 +617,7 @@ static void ati_remote2_urb_cleanup(struct ati_remote2 *ar2)
 
 	for (i = 0; i < 2; i++) {
 		usb_free_urb(ar2->urb[i]);
-		usb_buffer_free(ar2->udev, 4, ar2->buf[i], ar2->buf_dma[i]);
+		usb_free_coherent(ar2->udev, 4, ar2->buf[i], ar2->buf_dma[i]);
 	}
 }
 
diff --git a/drivers/input/misc/cm109.c b/drivers/input/misc/cm109.c
index 86457fe..635b7ac 100644
--- a/drivers/input/misc/cm109.c
+++ b/drivers/input/misc/cm109.c
@@ -630,14 +630,14 @@ static const struct usb_device_id cm109_usb_table[] = {
 static void cm109_usb_cleanup(struct cm109_dev *dev)
 {
 	if (dev->ctl_req)
-		usb_buffer_free(dev->udev, sizeof(*(dev->ctl_req)),
-				dev->ctl_req, dev->ctl_req_dma);
+		usb_free_coherent(dev->udev, sizeof(*(dev->ctl_req)),
+				  dev->ctl_req, dev->ctl_req_dma);
 	if (dev->ctl_data)
-		usb_buffer_free(dev->udev, USB_PKT_LEN,
-				dev->ctl_data, dev->ctl_dma);
+		usb_free_coherent(dev->udev, USB_PKT_LEN,
+				  dev->ctl_data, dev->ctl_dma);
 	if (dev->irq_data)
-		usb_buffer_free(dev->udev, USB_PKT_LEN,
-				dev->irq_data, dev->irq_dma);
+		usb_free_coherent(dev->udev, USB_PKT_LEN,
+				  dev->irq_data, dev->irq_dma);
 
 	usb_free_urb(dev->urb_irq);	/* parameter validation in core/urb */
 	usb_free_urb(dev->urb_ctl);	/* parameter validation in core/urb */
@@ -686,18 +686,18 @@ static int cm109_usb_probe(struct usb_interface *intf,
 		goto err_out;
 
 	/* allocate usb buffers */
-	dev->irq_data = usb_buffer_alloc(udev, USB_PKT_LEN,
-					 GFP_KERNEL, &dev->irq_dma);
+	dev->irq_data = usb_alloc_coherent(udev, USB_PKT_LEN,
+					   GFP_KERNEL, &dev->irq_dma);
 	if (!dev->irq_data)
 		goto err_out;
 
-	dev->ctl_data = usb_buffer_alloc(udev, USB_PKT_LEN,
-					 GFP_KERNEL, &dev->ctl_dma);
+	dev->ctl_data = usb_alloc_coherent(udev, USB_PKT_LEN,
+					   GFP_KERNEL, &dev->ctl_dma);
 	if (!dev->ctl_data)
 		goto err_out;
 
-	dev->ctl_req = usb_buffer_alloc(udev, sizeof(*(dev->ctl_req)),
-					GFP_KERNEL, &dev->ctl_req_dma);
+	dev->ctl_req = usb_alloc_coherent(udev, sizeof(*(dev->ctl_req)),
+					  GFP_KERNEL, &dev->ctl_req_dma);
 	if (!dev->ctl_req)
 		goto err_out;
 
diff --git a/drivers/input/misc/keyspan_remote.c b/drivers/input/misc/keyspan_remote.c
index 86afdd1..a93c525 100644
--- a/drivers/input/misc/keyspan_remote.c
+++ b/drivers/input/misc/keyspan_remote.c
@@ -464,7 +464,7 @@ static int keyspan_probe(struct usb_interface *interface, const struct usb_devic
 	remote->in_endpoint = endpoint;
 	remote->toggle = -1;	/* Set to -1 so we will always not match the toggle from the first remote message. */
 
-	remote->in_buffer = usb_buffer_alloc(udev, RECV_SIZE, GFP_ATOMIC, &remote->in_dma);
+	remote->in_buffer = usb_alloc_coherent(udev, RECV_SIZE, GFP_ATOMIC, &remote->in_dma);
 	if (!remote->in_buffer) {
 		error = -ENOMEM;
 		goto fail1;
@@ -543,7 +543,7 @@ static int keyspan_probe(struct usb_interface *interface, const struct usb_devic
 	return 0;
 
  fail3:	usb_free_urb(remote->irq_urb);
- fail2:	usb_buffer_free(udev, RECV_SIZE, remote->in_buffer, remote->in_dma);
+ fail2:	usb_free_coherent(udev, RECV_SIZE, remote->in_buffer, remote->in_dma);
  fail1:	kfree(remote);
 	input_free_device(input_dev);
 
@@ -564,7 +564,7 @@ static void keyspan_disconnect(struct usb_interface *interface)
 		input_unregister_device(remote->input);
 		usb_kill_urb(remote->irq_urb);
 		usb_free_urb(remote->irq_urb);
-		usb_buffer_free(remote->udev, RECV_SIZE, remote->in_buffer, remote->in_dma);
+		usb_free_coherent(remote->udev, RECV_SIZE, remote->in_buffer, remote->in_dma);
 		kfree(remote);
 	}
 }
diff --git a/drivers/input/misc/powermate.c b/drivers/input/misc/powermate.c
index 668913d..a0b00d6 100644
--- a/drivers/input/misc/powermate.c
+++ b/drivers/input/misc/powermate.c
@@ -276,13 +276,13 @@ static int powermate_input_event(struct input_dev *dev, unsigned int type, unsig
 
 static int powermate_alloc_buffers(struct usb_device *udev, struct powermate_device *pm)
 {
-	pm->data = usb_buffer_alloc(udev, POWERMATE_PAYLOAD_SIZE_MAX,
-				    GFP_ATOMIC, &pm->data_dma);
+	pm->data = usb_alloc_coherent(udev, POWERMATE_PAYLOAD_SIZE_MAX,
+				      GFP_ATOMIC, &pm->data_dma);
 	if (!pm->data)
 		return -1;
 
-	pm->configcr = usb_buffer_alloc(udev, sizeof(*(pm->configcr)),
-					GFP_ATOMIC, &pm->configcr_dma);
+	pm->configcr = usb_alloc_coherent(udev, sizeof(*(pm->configcr)),
+					  GFP_ATOMIC, &pm->configcr_dma);
 	if (!pm->configcr)
 		return -1;
 
@@ -291,10 +291,10 @@ static int powermate_alloc_buffers(struct usb_device *udev, struct powermate_dev
 
 static void powermate_free_buffers(struct usb_device *udev, struct powermate_device *pm)
 {
-	usb_buffer_free(udev, POWERMATE_PAYLOAD_SIZE_MAX,
-			pm->data, pm->data_dma);
-	usb_buffer_free(udev, sizeof(*(pm->configcr)),
-			pm->configcr, pm->configcr_dma);
+	usb_free_coherent(udev, POWERMATE_PAYLOAD_SIZE_MAX,
+			  pm->data, pm->data_dma);
+	usb_free_coherent(udev, sizeof(*(pm->configcr)),
+			  pm->configcr, pm->configcr_dma);
 }
 
 /* Called whenever a USB device matching one in our supported devices table is connected */
diff --git a/drivers/input/misc/yealink.c b/drivers/input/misc/yealink.c
index 93a22ac..f584985 100644
--- a/drivers/input/misc/yealink.c
+++ b/drivers/input/misc/yealink.c
@@ -836,12 +836,12 @@ static int usb_cleanup(struct yealink_dev *yld, int err)
 	usb_free_urb(yld->urb_irq);
 	usb_free_urb(yld->urb_ctl);
 
-	usb_buffer_free(yld->udev, sizeof(*(yld->ctl_req)),
-			yld->ctl_req, yld->ctl_req_dma);
-	usb_buffer_free(yld->udev, USB_PKT_LEN,
-			yld->ctl_data, yld->ctl_dma);
-	usb_buffer_free(yld->udev, USB_PKT_LEN,
-			yld->irq_data, yld->irq_dma);
+	usb_free_coherent(yld->udev, sizeof(*(yld->ctl_req)),
+			  yld->ctl_req, yld->ctl_req_dma);
+	usb_free_coherent(yld->udev, USB_PKT_LEN,
+			  yld->ctl_data, yld->ctl_dma);
+	usb_free_coherent(yld->udev, USB_PKT_LEN,
+			  yld->irq_data, yld->irq_dma);
 
 	kfree(yld);
 	return err;
@@ -886,18 +886,18 @@ static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
 		return usb_cleanup(yld, -ENOMEM);
 
 	/* allocate usb buffers */
-	yld->irq_data = usb_buffer_alloc(udev, USB_PKT_LEN,
-					GFP_ATOMIC, &yld->irq_dma);
+	yld->irq_data = usb_alloc_coherent(udev, USB_PKT_LEN,
+					  GFP_ATOMIC, &yld->irq_dma);
 	if (yld->irq_data == NULL)
 		return usb_cleanup(yld, -ENOMEM);
 
-	yld->ctl_data = usb_buffer_alloc(udev, USB_PKT_LEN,
-					GFP_ATOMIC, &yld->ctl_dma);
+	yld->ctl_data = usb_alloc_coherent(udev, USB_PKT_LEN,
+					  GFP_ATOMIC, &yld->ctl_dma);
 	if (!yld->ctl_data)
 		return usb_cleanup(yld, -ENOMEM);
 
-	yld->ctl_req = usb_buffer_alloc(udev, sizeof(*(yld->ctl_req)),
-					GFP_ATOMIC, &yld->ctl_req_dma);
+	yld->ctl_req = usb_alloc_coherent(udev, sizeof(*(yld->ctl_req)),
+					  GFP_ATOMIC, &yld->ctl_req_dma);
 	if (yld->ctl_req == NULL)
 		return usb_cleanup(yld, -ENOMEM);
 
diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c
index 53ec7dd..05edd75 100644
--- a/drivers/input/mouse/appletouch.c
+++ b/drivers/input/mouse/appletouch.c
@@ -806,8 +806,8 @@ static int atp_probe(struct usb_interface *iface,
 	if (!dev->urb)
 		goto err_free_devs;
 
-	dev->data = usb_buffer_alloc(dev->udev, dev->info->datalen, GFP_KERNEL,
-				     &dev->urb->transfer_dma);
+	dev->data = usb_alloc_coherent(dev->udev, dev->info->datalen, GFP_KERNEL,
+				       &dev->urb->transfer_dma);
 	if (!dev->data)
 		goto err_free_urb;
 
@@ -862,8 +862,8 @@ static int atp_probe(struct usb_interface *iface,
 	return 0;
 
  err_free_buffer:
-	usb_buffer_free(dev->udev, dev->info->datalen,
-			dev->data, dev->urb->transfer_dma);
+	usb_free_coherent(dev->udev, dev->info->datalen,
+			  dev->data, dev->urb->transfer_dma);
  err_free_urb:
 	usb_free_urb(dev->urb);
  err_free_devs:
@@ -881,8 +881,8 @@ static void atp_disconnect(struct usb_interface *iface)
 	if (dev) {
 		usb_kill_urb(dev->urb);
 		input_unregister_device(dev->input);
-		usb_buffer_free(dev->udev, dev->info->datalen,
-				dev->data, dev->urb->transfer_dma);
+		usb_free_coherent(dev->udev, dev->info->datalen,
+				  dev->data, dev->urb->transfer_dma);
 		usb_free_urb(dev->urb);
 		kfree(dev);
 	}
diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c
index 4f8fe08..aa3359a 100644
--- a/drivers/input/mouse/bcm5974.c
+++ b/drivers/input/mouse/bcm5974.c
@@ -715,15 +715,15 @@ static int bcm5974_probe(struct usb_interface *iface,
 	if (!dev->tp_urb)
 		goto err_free_bt_urb;
 
-	dev->bt_data = usb_buffer_alloc(dev->udev,
-					dev->cfg.bt_datalen, GFP_KERNEL,
-					&dev->bt_urb->transfer_dma);
+	dev->bt_data = usb_alloc_coherent(dev->udev,
+					  dev->cfg.bt_datalen, GFP_KERNEL,
+					  &dev->bt_urb->transfer_dma);
 	if (!dev->bt_data)
 		goto err_free_urb;
 
-	dev->tp_data = usb_buffer_alloc(dev->udev,
-					dev->cfg.tp_datalen, GFP_KERNEL,
-					&dev->tp_urb->transfer_dma);
+	dev->tp_data = usb_alloc_coherent(dev->udev,
+					  dev->cfg.tp_datalen, GFP_KERNEL,
+					  &dev->tp_urb->transfer_dma);
 	if (!dev->tp_data)
 		goto err_free_bt_buffer;
 
@@ -765,10 +765,10 @@ static int bcm5974_probe(struct usb_interface *iface,
 	return 0;
 
 err_free_buffer:
-	usb_buffer_free(dev->udev, dev->cfg.tp_datalen,
+	usb_free_coherent(dev->udev, dev->cfg.tp_datalen,
 		dev->tp_data, dev->tp_urb->transfer_dma);
 err_free_bt_buffer:
-	usb_buffer_free(dev->udev, dev->cfg.bt_datalen,
+	usb_free_coherent(dev->udev, dev->cfg.bt_datalen,
 		dev->bt_data, dev->bt_urb->transfer_dma);
 err_free_urb:
 	usb_free_urb(dev->tp_urb);
@@ -788,10 +788,10 @@ static void bcm5974_disconnect(struct usb_interface *iface)
 	usb_set_intfdata(iface, NULL);
 
 	input_unregister_device(dev->input);
-	usb_buffer_free(dev->udev, dev->cfg.tp_datalen,
-			dev->tp_data, dev->tp_urb->transfer_dma);
-	usb_buffer_free(dev->udev, dev->cfg.bt_datalen,
-			dev->bt_data, dev->bt_urb->transfer_dma);
+	usb_free_coherent(dev->udev, dev->cfg.tp_datalen,
+			  dev->tp_data, dev->tp_urb->transfer_dma);
+	usb_free_coherent(dev->udev, dev->cfg.bt_datalen,
+			  dev->bt_data, dev->bt_urb->transfer_dma);
 	usb_free_urb(dev->tp_urb);
 	usb_free_urb(dev->bt_urb);
 	kfree(dev);
diff --git a/drivers/input/tablet/acecad.c b/drivers/input/tablet/acecad.c
index 670c61c..c047016 100644
--- a/drivers/input/tablet/acecad.c
+++ b/drivers/input/tablet/acecad.c
@@ -155,7 +155,7 @@ static int usb_acecad_probe(struct usb_interface *intf, const struct usb_device_
 		goto fail1;
 	}
 
-	acecad->data = usb_buffer_alloc(dev, 8, GFP_KERNEL, &acecad->data_dma);
+	acecad->data = usb_alloc_coherent(dev, 8, GFP_KERNEL, &acecad->data_dma);
 	if (!acecad->data) {
 		err= -ENOMEM;
 		goto fail1;
@@ -241,7 +241,7 @@ static int usb_acecad_probe(struct usb_interface *intf, const struct usb_device_
 
 	return 0;
 
- fail2:	usb_buffer_free(dev, 8, acecad->data, acecad->data_dma);
+ fail2:	usb_free_coherent(dev, 8, acecad->data, acecad->data_dma);
  fail1: input_free_device(input_dev);
 	kfree(acecad);
 	return err;
@@ -256,7 +256,7 @@ static void usb_acecad_disconnect(struct usb_interface *intf)
 		usb_kill_urb(acecad->irq);
 		input_unregister_device(acecad->input);
 		usb_free_urb(acecad->irq);
-		usb_buffer_free(interface_to_usbdev(intf), 10, acecad->data, acecad->data_dma);
+		usb_free_coherent(interface_to_usbdev(intf), 10, acecad->data, acecad->data_dma);
 		kfree(acecad);
 	}
 }
diff --git a/drivers/input/tablet/aiptek.c b/drivers/input/tablet/aiptek.c
index 4be039d..51b80b0 100644
--- a/drivers/input/tablet/aiptek.c
+++ b/drivers/input/tablet/aiptek.c
@@ -1711,8 +1711,8 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id)
 		goto fail1;
         }
 
-	aiptek->data = usb_buffer_alloc(usbdev, AIPTEK_PACKET_LENGTH,
-					GFP_ATOMIC, &aiptek->data_dma);
+	aiptek->data = usb_alloc_coherent(usbdev, AIPTEK_PACKET_LENGTH,
+					  GFP_ATOMIC, &aiptek->data_dma);
         if (!aiptek->data) {
 		dev_warn(&intf->dev, "cannot allocate usb buffer\n");
 		goto fail1;
@@ -1884,8 +1884,8 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id)
 
  fail4:	sysfs_remove_group(&intf->dev.kobj, &aiptek_attribute_group);
  fail3: usb_free_urb(aiptek->urb);
- fail2:	usb_buffer_free(usbdev, AIPTEK_PACKET_LENGTH, aiptek->data,
-			aiptek->data_dma);
+ fail2:	usb_free_coherent(usbdev, AIPTEK_PACKET_LENGTH, aiptek->data,
+			  aiptek->data_dma);
  fail1: usb_set_intfdata(intf, NULL);
 	input_free_device(inputdev);
 	kfree(aiptek);
@@ -1909,9 +1909,9 @@ static void aiptek_disconnect(struct usb_interface *intf)
 		input_unregister_device(aiptek->inputdev);
 		sysfs_remove_group(&intf->dev.kobj, &aiptek_attribute_group);
 		usb_free_urb(aiptek->urb);
-		usb_buffer_free(interface_to_usbdev(intf),
-				AIPTEK_PACKET_LENGTH,
-				aiptek->data, aiptek->data_dma);
+		usb_free_coherent(interface_to_usbdev(intf),
+				  AIPTEK_PACKET_LENGTH,
+				  aiptek->data, aiptek->data_dma);
 		kfree(aiptek);
 	}
 }
diff --git a/drivers/input/tablet/gtco.c b/drivers/input/tablet/gtco.c
index 866a9ee..8ea6afe 100644
--- a/drivers/input/tablet/gtco.c
+++ b/drivers/input/tablet/gtco.c
@@ -850,8 +850,8 @@ static int gtco_probe(struct usb_interface *usbinterface,
 	gtco->usbdev = usb_get_dev(interface_to_usbdev(usbinterface));
 
 	/* Allocate some data for incoming reports */
-	gtco->buffer = usb_buffer_alloc(gtco->usbdev, REPORT_MAX_SIZE,
-					GFP_KERNEL, &gtco->buf_dma);
+	gtco->buffer = usb_alloc_coherent(gtco->usbdev, REPORT_MAX_SIZE,
+					  GFP_KERNEL, &gtco->buf_dma);
 	if (!gtco->buffer) {
 		err("No more memory for us buffers");
 		error = -ENOMEM;
@@ -982,8 +982,8 @@ static int gtco_probe(struct usb_interface *usbinterface,
  err_free_urb:
 	usb_free_urb(gtco->urbinfo);
  err_free_buf:
-	usb_buffer_free(gtco->usbdev, REPORT_MAX_SIZE,
-			gtco->buffer, gtco->buf_dma);
+	usb_free_coherent(gtco->usbdev, REPORT_MAX_SIZE,
+			  gtco->buffer, gtco->buf_dma);
  err_free_devs:
 	input_free_device(input_dev);
 	kfree(gtco);
@@ -1005,8 +1005,8 @@ static void gtco_disconnect(struct usb_interface *interface)
 		input_unregister_device(gtco->inputdevice);
 		usb_kill_urb(gtco->urbinfo);
 		usb_free_urb(gtco->urbinfo);
-		usb_buffer_free(gtco->usbdev, REPORT_MAX_SIZE,
-				gtco->buffer, gtco->buf_dma);
+		usb_free_coherent(gtco->usbdev, REPORT_MAX_SIZE,
+				  gtco->buffer, gtco->buf_dma);
 		kfree(gtco);
 	}
 
diff --git a/drivers/input/tablet/kbtab.c b/drivers/input/tablet/kbtab.c
index 6682b17..d31b9c7 100644
--- a/drivers/input/tablet/kbtab.c
+++ b/drivers/input/tablet/kbtab.c
@@ -129,7 +129,7 @@ static int kbtab_probe(struct usb_interface *intf, const struct usb_device_id *i
 	if (!kbtab || !input_dev)
 		goto fail1;
 
-	kbtab->data = usb_buffer_alloc(dev, 8, GFP_KERNEL, &kbtab->data_dma);
+	kbtab->data = usb_alloc_coherent(dev, 8, GFP_KERNEL, &kbtab->data_dma);
 	if (!kbtab->data)
 		goto fail1;
 
@@ -182,7 +182,7 @@ static int kbtab_probe(struct usb_interface *intf, const struct usb_device_id *i
 	return 0;
 
  fail3:	usb_free_urb(kbtab->irq);
- fail2:	usb_buffer_free(dev, 10, kbtab->data, kbtab->data_dma);
+ fail2:	usb_free_coherent(dev, 10, kbtab->data, kbtab->data_dma);
  fail1:	input_free_device(input_dev);
 	kfree(kbtab);
 	return error;
@@ -197,7 +197,7 @@ static void kbtab_disconnect(struct usb_interface *intf)
 		usb_kill_urb(kbtab->irq);
 		input_unregister_device(kbtab->dev);
 		usb_free_urb(kbtab->irq);
-		usb_buffer_free(interface_to_usbdev(intf), 10, kbtab->data, kbtab->data_dma);
+		usb_free_coherent(interface_to_usbdev(intf), 10, kbtab->data, kbtab->data_dma);
 		kfree(kbtab);
 	}
 }
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index 8b5d287..5d5b3c3 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -556,8 +556,8 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
 		goto fail1;
 	}
 
-	wacom_wac->data = usb_buffer_alloc(dev, WACOM_PKGLEN_MAX,
-					   GFP_KERNEL, &wacom->data_dma);
+	wacom_wac->data = usb_alloc_coherent(dev, WACOM_PKGLEN_MAX,
+					     GFP_KERNEL, &wacom->data_dma);
 	if (!wacom_wac->data) {
 		error = -ENOMEM;
 		goto fail1;
@@ -633,7 +633,7 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
 	return 0;
 
  fail3:	usb_free_urb(wacom->irq);
- fail2:	usb_buffer_free(dev, WACOM_PKGLEN_MAX, wacom_wac->data, wacom->data_dma);
+ fail2:	usb_free_coherent(dev, WACOM_PKGLEN_MAX, wacom_wac->data, wacom->data_dma);
  fail1:	input_free_device(input_dev);
 	kfree(wacom);
 	kfree(wacom_wac);
@@ -649,8 +649,8 @@ static void wacom_disconnect(struct usb_interface *intf)
 	usb_kill_urb(wacom->irq);
 	input_unregister_device(wacom->dev);
 	usb_free_urb(wacom->irq);
-	usb_buffer_free(interface_to_usbdev(intf), WACOM_PKGLEN_MAX,
-			wacom->wacom_wac->data, wacom->data_dma);
+	usb_free_coherent(interface_to_usbdev(intf), WACOM_PKGLEN_MAX,
+			  wacom->wacom_wac->data, wacom->data_dma);
 	kfree(wacom->wacom_wac);
 	kfree(wacom);
 }
diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c
index 99330bb..ea41a85 100644
--- a/drivers/input/touchscreen/usbtouchscreen.c
+++ b/drivers/input/touchscreen/usbtouchscreen.c
@@ -1291,8 +1291,8 @@ static void usbtouch_close(struct input_dev *input)
 static void usbtouch_free_buffers(struct usb_device *udev,
 				  struct usbtouch_usb *usbtouch)
 {
-	usb_buffer_free(udev, usbtouch->type->rept_size,
-	                usbtouch->data, usbtouch->data_dma);
+	usb_free_coherent(udev, usbtouch->type->rept_size,
+			  usbtouch->data, usbtouch->data_dma);
 	kfree(usbtouch->buffer);
 }
 
@@ -1336,8 +1336,8 @@ static int usbtouch_probe(struct usb_interface *intf,
 	if (!type->process_pkt)
 		type->process_pkt = usbtouch_process_pkt;
 
-	usbtouch->data = usb_buffer_alloc(udev, type->rept_size,
-	                                  GFP_KERNEL, &usbtouch->data_dma);
+	usbtouch->data = usb_alloc_coherent(udev, type->rept_size,
+					    GFP_KERNEL, &usbtouch->data_dma);
 	if (!usbtouch->data)
 		goto out_free;
 
diff --git a/drivers/media/dvb/dvb-usb/usb-urb.c b/drivers/media/dvb/dvb-usb/usb-urb.c
index f9702e3..86d6893 100644
--- a/drivers/media/dvb/dvb-usb/usb-urb.c
+++ b/drivers/media/dvb/dvb-usb/usb-urb.c
@@ -96,8 +96,9 @@ static int usb_free_stream_buffers(struct usb_data_stream *stream)
 		while (stream->buf_num) {
 			stream->buf_num--;
 			deb_mem("freeing buffer %d\n",stream->buf_num);
-			usb_buffer_free(stream->udev, stream->buf_size,
-					stream->buf_list[stream->buf_num], stream->dma_addr[stream->buf_num]);
+			usb_free_coherent(stream->udev, stream->buf_size,
+					  stream->buf_list[stream->buf_num],
+					  stream->dma_addr[stream->buf_num]);
 		}
 	}
 
@@ -116,7 +117,7 @@ static int usb_allocate_stream_buffers(struct usb_data_stream *stream, int num,
 	for (stream->buf_num = 0; stream->buf_num < num; stream->buf_num++) {
 		deb_mem("allocating buffer %d\n",stream->buf_num);
 		if (( stream->buf_list[stream->buf_num] =
-					usb_buffer_alloc(stream->udev, size, GFP_ATOMIC,
+					usb_alloc_coherent(stream->udev, size, GFP_ATOMIC,
 					&stream->dma_addr[stream->buf_num]) ) == NULL) {
 			deb_mem("not enough memory for urb-buffer allocation.\n");
 			usb_free_stream_buffers(stream);
diff --git a/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/drivers/media/dvb/ttusb-dec/ttusb_dec.c
index 53baccb..fe1b803 100644
--- a/drivers/media/dvb/ttusb-dec/ttusb_dec.c
+++ b/drivers/media/dvb/ttusb-dec/ttusb_dec.c
@@ -1257,7 +1257,7 @@ static int ttusb_dec_init_usb(struct ttusb_dec *dec)
 		if(!dec->irq_urb) {
 			return -ENOMEM;
 		}
-		dec->irq_buffer = usb_buffer_alloc(dec->udev,IRQ_PACKET_SIZE,
+		dec->irq_buffer = usb_alloc_coherent(dec->udev,IRQ_PACKET_SIZE,
 					GFP_ATOMIC, &dec->irq_dma_handle);
 		if(!dec->irq_buffer) {
 			usb_free_urb(dec->irq_urb);
@@ -1550,8 +1550,8 @@ static void ttusb_dec_exit_rc(struct ttusb_dec *dec)
 
 	usb_free_urb(dec->irq_urb);
 
-	usb_buffer_free(dec->udev,IRQ_PACKET_SIZE,
-			   dec->irq_buffer, dec->irq_dma_handle);
+	usb_free_coherent(dec->udev,IRQ_PACKET_SIZE,
+			  dec->irq_buffer, dec->irq_dma_handle);
 
 	if (dec->rc_input_dev) {
 		input_unregister_device(dec->rc_input_dev);
diff --git a/drivers/media/video/au0828/au0828-video.c b/drivers/media/video/au0828/au0828-video.c
index 8c140c0..a2a0f79 100644
--- a/drivers/media/video/au0828/au0828-video.c
+++ b/drivers/media/video/au0828/au0828-video.c
@@ -177,7 +177,7 @@ void au0828_uninit_isoc(struct au0828_dev *dev)
 				usb_unlink_urb(urb);
 
 			if (dev->isoc_ctl.transfer_buffer[i]) {
-				usb_buffer_free(dev->usbdev,
+				usb_free_coherent(dev->usbdev,
 					urb->transfer_buffer_length,
 					dev->isoc_ctl.transfer_buffer[i],
 					urb->transfer_dma);
@@ -247,7 +247,7 @@ int au0828_init_isoc(struct au0828_dev *dev, int max_packets,
 		}
 		dev->isoc_ctl.urb[i] = urb;
 
-		dev->isoc_ctl.transfer_buffer[i] = usb_buffer_alloc(dev->usbdev,
+		dev->isoc_ctl.transfer_buffer[i] = usb_alloc_coherent(dev->usbdev,
 			sb_size, GFP_KERNEL, &urb->transfer_dma);
 		if (!dev->isoc_ctl.transfer_buffer[i]) {
 			printk("unable to allocate %i bytes for transfer"
diff --git a/drivers/media/video/cx231xx/cx231xx-core.c b/drivers/media/video/cx231xx/cx231xx-core.c
index b24eee1..6ccd87d 100644
--- a/drivers/media/video/cx231xx/cx231xx-core.c
+++ b/drivers/media/video/cx231xx/cx231xx-core.c
@@ -679,11 +679,11 @@ void cx231xx_uninit_isoc(struct cx231xx *dev)
 				usb_unlink_urb(urb);
 
 			if (dev->video_mode.isoc_ctl.transfer_buffer[i]) {
-				usb_buffer_free(dev->udev,
-						urb->transfer_buffer_length,
-						dev->video_mode.isoc_ctl.
-						transfer_buffer[i],
-						urb->transfer_dma);
+				usb_free_coherent(dev->udev,
+						  urb->transfer_buffer_length,
+						  dev->video_mode.isoc_ctl.
+						  transfer_buffer[i],
+						  urb->transfer_dma);
 			}
 			usb_free_urb(urb);
 			dev->video_mode.isoc_ctl.urb[i] = NULL;
@@ -770,8 +770,8 @@ int cx231xx_init_isoc(struct cx231xx *dev, int max_packets,
 		dev->video_mode.isoc_ctl.urb[i] = urb;
 
 		dev->video_mode.isoc_ctl.transfer_buffer[i] =
-		    usb_buffer_alloc(dev->udev, sb_size, GFP_KERNEL,
-				     &urb->transfer_dma);
+		    usb_alloc_coherent(dev->udev, sb_size, GFP_KERNEL,
+				       &urb->transfer_dma);
 		if (!dev->video_mode.isoc_ctl.transfer_buffer[i]) {
 			cx231xx_err("unable to allocate %i bytes for transfer"
 				    " buffer %i%s\n",
diff --git a/drivers/media/video/em28xx/em28xx-core.c b/drivers/media/video/em28xx/em28xx-core.c
index a41cc55..d4a9554 100644
--- a/drivers/media/video/em28xx/em28xx-core.c
+++ b/drivers/media/video/em28xx/em28xx-core.c
@@ -966,7 +966,7 @@ void em28xx_uninit_isoc(struct em28xx *dev)
 				usb_unlink_urb(urb);
 
 			if (dev->isoc_ctl.transfer_buffer[i]) {
-				usb_buffer_free(dev->udev,
+				usb_free_coherent(dev->udev,
 					urb->transfer_buffer_length,
 					dev->isoc_ctl.transfer_buffer[i],
 					urb->transfer_dma);
@@ -1041,7 +1041,7 @@ int em28xx_init_isoc(struct em28xx *dev, int max_packets,
 		}
 		dev->isoc_ctl.urb[i] = urb;
 
-		dev->isoc_ctl.transfer_buffer[i] = usb_buffer_alloc(dev->udev,
+		dev->isoc_ctl.transfer_buffer[i] = usb_alloc_coherent(dev->udev,
 			sb_size, GFP_KERNEL, &urb->transfer_dma);
 		if (!dev->isoc_ctl.transfer_buffer[i]) {
 			em28xx_err("unable to allocate %i bytes for transfer"
diff --git a/drivers/media/video/gspca/benq.c b/drivers/media/video/gspca/benq.c
index 43ac4af..fce8d94 100644
--- a/drivers/media/video/gspca/benq.c
+++ b/drivers/media/video/gspca/benq.c
@@ -117,13 +117,13 @@ static int sd_start(struct gspca_dev *gspca_dev)
 			return -ENOMEM;
 		}
 		gspca_dev->urb[n] = urb;
-		urb->transfer_buffer = usb_buffer_alloc(gspca_dev->dev,
+		urb->transfer_buffer = usb_alloc_coherent(gspca_dev->dev,
 						SD_PKT_SZ * SD_NPKT,
 						GFP_KERNEL,
 						&urb->transfer_dma);
 
 		if (urb->transfer_buffer == NULL) {
-			err("usb_buffer_alloc failed");
+			err("usb_alloc_coherent failed");
 			return -ENOMEM;
 		}
 		urb->dev = gspca_dev->dev;
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c
index 222af47..00713f8 100644
--- a/drivers/media/video/gspca/gspca.c
+++ b/drivers/media/video/gspca/gspca.c
@@ -213,7 +213,7 @@ static int alloc_and_submit_int_urb(struct gspca_dev *gspca_dev,
 		goto error;
 	}
 
-	buffer = usb_buffer_alloc(dev, ep->wMaxPacketSize,
+	buffer = usb_alloc_coherent(dev, ep->wMaxPacketSize,
 				GFP_KERNEL, &urb->transfer_dma);
 	if (!buffer) {
 		ret = -ENOMEM;
@@ -232,10 +232,10 @@ static int alloc_and_submit_int_urb(struct gspca_dev *gspca_dev,
 	return ret;
 
 error_submit:
-	usb_buffer_free(dev,
-			urb->transfer_buffer_length,
-			urb->transfer_buffer,
-			urb->transfer_dma);
+	usb_free_coherent(dev,
+			  urb->transfer_buffer_length,
+			  urb->transfer_buffer,
+			  urb->transfer_dma);
 error_buffer:
 	usb_free_urb(urb);
 error:
@@ -272,10 +272,10 @@ static void gspca_input_destroy_urb(struct gspca_dev *gspca_dev)
 	if (urb) {
 		gspca_dev->int_urb = NULL;
 		usb_kill_urb(urb);
-		usb_buffer_free(gspca_dev->dev,
-				urb->transfer_buffer_length,
-				urb->transfer_buffer,
-				urb->transfer_dma);
+		usb_free_coherent(gspca_dev->dev,
+				  urb->transfer_buffer_length,
+				  urb->transfer_buffer,
+				  urb->transfer_dma);
 		usb_free_urb(urb);
 	}
 }
@@ -597,10 +597,10 @@ static void destroy_urbs(struct gspca_dev *gspca_dev)
 		gspca_dev->urb[i] = NULL;
 		usb_kill_urb(urb);
 		if (urb->transfer_buffer != NULL)
-			usb_buffer_free(gspca_dev->dev,
-					urb->transfer_buffer_length,
-					urb->transfer_buffer,
-					urb->transfer_dma);
+			usb_free_coherent(gspca_dev->dev,
+					  urb->transfer_buffer_length,
+					  urb->transfer_buffer,
+					  urb->transfer_dma);
 		usb_free_urb(urb);
 	}
 }
@@ -721,13 +721,13 @@ static int create_urbs(struct gspca_dev *gspca_dev,
 			return -ENOMEM;
 		}
 		gspca_dev->urb[n] = urb;
-		urb->transfer_buffer = usb_buffer_alloc(gspca_dev->dev,
+		urb->transfer_buffer = usb_alloc_coherent(gspca_dev->dev,
 						bsize,
 						GFP_KERNEL,
 						&urb->transfer_dma);
 
 		if (urb->transfer_buffer == NULL) {
-			err("usb_buffer_alloc failed");
+			err("usb_alloc_coherent failed");
 			return -ENOMEM;
 		}
 		urb->dev = gspca_dev->dev;
diff --git a/drivers/media/video/hdpvr/hdpvr-video.c b/drivers/media/video/hdpvr/hdpvr-video.c
index 196f82d..b65efe2 100644
--- a/drivers/media/video/hdpvr/hdpvr-video.c
+++ b/drivers/media/video/hdpvr/hdpvr-video.c
@@ -92,8 +92,8 @@ static int hdpvr_free_queue(struct list_head *q)
 		buf = list_entry(p, struct hdpvr_buffer, buff_list);
 
 		urb = buf->urb;
-		usb_buffer_free(urb->dev, urb->transfer_buffer_length,
-				urb->transfer_buffer, urb->transfer_dma);
+		usb_free_coherent(urb->dev, urb->transfer_buffer_length,
+				  urb->transfer_buffer, urb->transfer_dma);
 		usb_free_urb(urb);
 		tmp = p->next;
 		list_del(p);
@@ -143,8 +143,8 @@ int hdpvr_alloc_buffers(struct hdpvr_device *dev, uint count)
 		}
 		buf->urb = urb;
 
-		mem = usb_buffer_alloc(dev->udev, dev->bulk_in_size, GFP_KERNEL,
-				       &urb->transfer_dma);
+		mem = usb_alloc_coherent(dev->udev, dev->bulk_in_size, GFP_KERNEL,
+					 &urb->transfer_dma);
 		if (!mem) {
 			v4l2_err(&dev->v4l2_dev,
 				 "cannot allocate usb transfer buffer\n");
diff --git a/drivers/media/video/tlg2300/pd-video.c b/drivers/media/video/tlg2300/pd-video.c
index cf8f18c..7bc2906 100644
--- a/drivers/media/video/tlg2300/pd-video.c
+++ b/drivers/media/video/tlg2300/pd-video.c
@@ -476,10 +476,10 @@ static int prepare_iso_urb(struct video_data *video)
 			goto out;
 
 		video->urb_array[i] = urb;
-		mem = usb_buffer_alloc(udev,
-					ISO_PKT_SIZE * PK_PER_URB,
-					GFP_KERNEL,
-					&urb->transfer_dma);
+		mem = usb_alloc_coherent(udev,
+					 ISO_PKT_SIZE * PK_PER_URB,
+					 GFP_KERNEL,
+					 &urb->transfer_dma);
 
 		urb->complete	= urb_complete_iso;	/* handler */
 		urb->dev	= udev;
@@ -519,8 +519,8 @@ int alloc_bulk_urbs_generic(struct urb **urb_array, int num,
 		if (urb == NULL)
 			return i;
 
-		mem = usb_buffer_alloc(udev, buf_size, gfp_flags,
-					&urb->transfer_dma);
+		mem = usb_alloc_coherent(udev, buf_size, gfp_flags,
+					 &urb->transfer_dma);
 		if (mem == NULL)
 			return i;
 
@@ -540,7 +540,7 @@ void free_all_urb_generic(struct urb **urb_array, int num)
 	for (i = 0; i < num; i++) {
 		urb = urb_array[i];
 		if (urb) {
-			usb_buffer_free(urb->dev,
+			usb_free_coherent(urb->dev,
 					urb->transfer_buffer_length,
 					urb->transfer_buffer,
 					urb->transfer_dma);
diff --git a/drivers/media/video/usbvision/usbvision-core.c b/drivers/media/video/usbvision/usbvision-core.c
index f7aae22..b9dd74f 100644
--- a/drivers/media/video/usbvision/usbvision-core.c
+++ b/drivers/media/video/usbvision/usbvision-core.c
@@ -2493,10 +2493,10 @@ int usbvision_init_isoc(struct usb_usbvision *usbvision)
 		}
 		usbvision->sbuf[bufIdx].urb = urb;
 		usbvision->sbuf[bufIdx].data =
-			usb_buffer_alloc(usbvision->dev,
-					 sb_size,
-					 GFP_KERNEL,
-					 &urb->transfer_dma);
+			usb_alloc_coherent(usbvision->dev,
+					   sb_size,
+					   GFP_KERNEL,
+					   &urb->transfer_dma);
 		urb->dev = dev;
 		urb->context = usbvision;
 		urb->pipe = usb_rcvisocpipe(dev, usbvision->video_endp);
@@ -2552,10 +2552,10 @@ void usbvision_stop_isoc(struct usb_usbvision *usbvision)
 	for (bufIdx = 0; bufIdx < USBVISION_NUMSBUF; bufIdx++) {
 		usb_kill_urb(usbvision->sbuf[bufIdx].urb);
 		if (usbvision->sbuf[bufIdx].data){
-			usb_buffer_free(usbvision->dev,
-					sb_size,
-					usbvision->sbuf[bufIdx].data,
-					usbvision->sbuf[bufIdx].urb->transfer_dma);
+			usb_free_coherent(usbvision->dev,
+					  sb_size,
+					  usbvision->sbuf[bufIdx].data,
+					  usbvision->sbuf[bufIdx].urb->transfer_dma);
 		}
 		usb_free_urb(usbvision->sbuf[bufIdx].urb);
 		usbvision->sbuf[bufIdx].urb = NULL;
diff --git a/drivers/media/video/uvc/uvc_video.c b/drivers/media/video/uvc/uvc_video.c
index 821a996..53f3ef4 100644
--- a/drivers/media/video/uvc/uvc_video.c
+++ b/drivers/media/video/uvc/uvc_video.c
@@ -739,7 +739,7 @@ static void uvc_free_urb_buffers(struct uvc_streaming *stream)
 
 	for (i = 0; i < UVC_URBS; ++i) {
 		if (stream->urb_buffer[i]) {
-			usb_buffer_free(stream->dev->udev, stream->urb_size,
+			usb_free_coherent(stream->dev->udev, stream->urb_size,
 				stream->urb_buffer[i], stream->urb_dma[i]);
 			stream->urb_buffer[i] = NULL;
 		}
@@ -780,7 +780,7 @@ static int uvc_alloc_urb_buffers(struct uvc_streaming *stream,
 	for (; npackets > 1; npackets /= 2) {
 		for (i = 0; i < UVC_URBS; ++i) {
 			stream->urb_size = psize * npackets;
-			stream->urb_buffer[i] = usb_buffer_alloc(
+			stream->urb_buffer[i] = usb_alloc_coherent(
 				stream->dev->udev, stream->urb_size,
 				gfp_flags | __GFP_NOWARN, &stream->urb_dma[i]);
 			if (!stream->urb_buffer[i]) {
diff --git a/drivers/net/can/usb/ems_usb.c b/drivers/net/can/usb/ems_usb.c
index 3345109..62be62f 100644
--- a/drivers/net/can/usb/ems_usb.c
+++ b/drivers/net/can/usb/ems_usb.c
@@ -516,8 +516,8 @@ static void ems_usb_write_bulk_callback(struct urb *urb)
 	netdev = dev->netdev;
 
 	/* free up our allocated buffer */
-	usb_buffer_free(urb->dev, urb->transfer_buffer_length,
-			urb->transfer_buffer, urb->transfer_dma);
+	usb_free_coherent(urb->dev, urb->transfer_buffer_length,
+			  urb->transfer_buffer, urb->transfer_dma);
 
 	atomic_dec(&dev->active_tx_urbs);
 
@@ -614,8 +614,8 @@ static int ems_usb_start(struct ems_usb *dev)
 			return -ENOMEM;
 		}
 
-		buf = usb_buffer_alloc(dev->udev, RX_BUFFER_SIZE, GFP_KERNEL,
-				       &urb->transfer_dma);
+		buf = usb_alloc_coherent(dev->udev, RX_BUFFER_SIZE, GFP_KERNEL,
+					 &urb->transfer_dma);
 		if (!buf) {
 			dev_err(netdev->dev.parent,
 				"No memory left for USB buffer\n");
@@ -635,8 +635,8 @@ static int ems_usb_start(struct ems_usb *dev)
 				netif_device_detach(dev->netdev);
 
 			usb_unanchor_urb(urb);
-			usb_buffer_free(dev->udev, RX_BUFFER_SIZE, buf,
-					urb->transfer_dma);
+			usb_free_coherent(dev->udev, RX_BUFFER_SIZE, buf,
+					  urb->transfer_dma);
 			break;
 		}
 
@@ -777,7 +777,7 @@ static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *ne
 		goto nomem;
 	}
 
-	buf = usb_buffer_alloc(dev->udev, size, GFP_ATOMIC, &urb->transfer_dma);
+	buf = usb_alloc_coherent(dev->udev, size, GFP_ATOMIC, &urb->transfer_dma);
 	if (!buf) {
 		dev_err(netdev->dev.parent, "No memory left for USB buffer\n");
 		usb_free_urb(urb);
@@ -820,7 +820,7 @@ static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *ne
 	 */
 	if (!context) {
 		usb_unanchor_urb(urb);
-		usb_buffer_free(dev->udev, size, buf, urb->transfer_dma);
+		usb_free_coherent(dev->udev, size, buf, urb->transfer_dma);
 
 		dev_warn(netdev->dev.parent, "couldn't find free context\n");
 
@@ -845,7 +845,7 @@ static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *ne
 		can_free_echo_skb(netdev, context->echo_index);
 
 		usb_unanchor_urb(urb);
-		usb_buffer_free(dev->udev, size, buf, urb->transfer_dma);
+		usb_free_coherent(dev->udev, size, buf, urb->transfer_dma);
 		dev_kfree_skb(skb);
 
 		atomic_dec(&dev->active_tx_urbs);
diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c
index 52671ea..a790a6d 100644
--- a/drivers/net/usb/kaweth.c
+++ b/drivers/net/usb/kaweth.c
@@ -1155,13 +1155,13 @@ err_fw:
 	if (!kaweth->irq_urb)
 		goto err_tx_and_rx;
 
-	kaweth->intbuffer = usb_buffer_alloc(	kaweth->dev,
+	kaweth->intbuffer = usb_alloc_coherent(	kaweth->dev,
 						INTBUFFERSIZE,
 						GFP_KERNEL,
 						&kaweth->intbufferhandle);
 	if (!kaweth->intbuffer)
 		goto err_tx_and_rx_and_irq;
-	kaweth->rx_buf = usb_buffer_alloc(	kaweth->dev,
+	kaweth->rx_buf = usb_alloc_coherent(	kaweth->dev,
 						KAWETH_BUF_SIZE,
 						GFP_KERNEL,
 						&kaweth->rxbufferhandle);
@@ -1202,9 +1202,9 @@ err_fw:
 
 err_intfdata:
 	usb_set_intfdata(intf, NULL);
-	usb_buffer_free(kaweth->dev, KAWETH_BUF_SIZE, (void *)kaweth->rx_buf, kaweth->rxbufferhandle);
+	usb_free_coherent(kaweth->dev, KAWETH_BUF_SIZE, (void *)kaweth->rx_buf, kaweth->rxbufferhandle);
 err_all_but_rxbuf:
-	usb_buffer_free(kaweth->dev, INTBUFFERSIZE, (void *)kaweth->intbuffer, kaweth->intbufferhandle);
+	usb_free_coherent(kaweth->dev, INTBUFFERSIZE, (void *)kaweth->intbuffer, kaweth->intbufferhandle);
 err_tx_and_rx_and_irq:
 	usb_free_urb(kaweth->irq_urb);
 err_tx_and_rx:
@@ -1241,8 +1241,8 @@ static void kaweth_disconnect(struct usb_interface *intf)
 	usb_free_urb(kaweth->tx_urb);
 	usb_free_urb(kaweth->irq_urb);
 
-	usb_buffer_free(kaweth->dev, KAWETH_BUF_SIZE, (void *)kaweth->rx_buf, kaweth->rxbufferhandle);
-	usb_buffer_free(kaweth->dev, INTBUFFERSIZE, (void *)kaweth->intbuffer, kaweth->intbufferhandle);
+	usb_free_coherent(kaweth->dev, KAWETH_BUF_SIZE, (void *)kaweth->rx_buf, kaweth->rxbufferhandle);
+	usb_free_coherent(kaweth->dev, INTBUFFERSIZE, (void *)kaweth->intbuffer, kaweth->intbufferhandle);
 
 	free_netdev(netdev);
 }
diff --git a/drivers/net/wireless/ath/ar9170/usb.c b/drivers/net/wireless/ath/ar9170/usb.c
index 0b0d2dc..14eda1d 100644
--- a/drivers/net/wireless/ath/ar9170/usb.c
+++ b/drivers/net/wireless/ath/ar9170/usb.c
@@ -200,7 +200,7 @@ resubmit:
 	return;
 
 free:
-	usb_buffer_free(aru->udev, 64, urb->transfer_buffer, urb->transfer_dma);
+	usb_free_coherent(aru->udev, 64, urb->transfer_buffer, urb->transfer_dma);
 }
 
 static void ar9170_usb_rx_completed(struct urb *urb)
@@ -281,7 +281,7 @@ static int ar9170_usb_alloc_rx_irq_urb(struct ar9170_usb *aru)
 	if (!urb)
 		goto out;
 
-	ibuf = usb_buffer_alloc(aru->udev, 64, GFP_KERNEL, &urb->transfer_dma);
+	ibuf = usb_alloc_coherent(aru->udev, 64, GFP_KERNEL, &urb->transfer_dma);
 	if (!ibuf)
 		goto out;
 
@@ -294,8 +294,8 @@ static int ar9170_usb_alloc_rx_irq_urb(struct ar9170_usb *aru)
 	err = usb_submit_urb(urb, GFP_KERNEL);
 	if (err) {
 		usb_unanchor_urb(urb);
-		usb_buffer_free(aru->udev, 64, urb->transfer_buffer,
-				urb->transfer_dma);
+		usb_free_coherent(aru->udev, 64, urb->transfer_buffer,
+				  urb->transfer_dma);
 	}
 
 out:
diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c
index d91ad1a..c257940 100644
--- a/drivers/net/wireless/zd1211rw/zd_usb.c
+++ b/drivers/net/wireless/zd1211rw/zd_usb.c
@@ -664,15 +664,15 @@ static struct urb *alloc_rx_urb(struct zd_usb *usb)
 	urb = usb_alloc_urb(0, GFP_KERNEL);
 	if (!urb)
 		return NULL;
-	buffer = usb_buffer_alloc(udev, USB_MAX_RX_SIZE, GFP_KERNEL,
-		                  &urb->transfer_dma);
+	buffer = usb_alloc_coherent(udev, USB_MAX_RX_SIZE, GFP_KERNEL,
+				    &urb->transfer_dma);
 	if (!buffer) {
 		usb_free_urb(urb);
 		return NULL;
 	}
 
 	usb_fill_bulk_urb(urb, udev, usb_rcvbulkpipe(udev, EP_DATA_IN),
-		          buffer, USB_MAX_RX_SIZE,
+			  buffer, USB_MAX_RX_SIZE,
 			  rx_urb_complete, usb);
 	urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
 
@@ -683,8 +683,8 @@ static void free_rx_urb(struct urb *urb)
 {
 	if (!urb)
 		return;
-	usb_buffer_free(urb->dev, urb->transfer_buffer_length,
-		        urb->transfer_buffer, urb->transfer_dma);
+	usb_free_coherent(urb->dev, urb->transfer_buffer_length,
+			  urb->transfer_buffer, urb->transfer_dma);
 	usb_free_urb(urb);
 }
 
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index be6331e..66713ed 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -892,7 +892,7 @@ static void acm_write_buffers_free(struct acm *acm)
 	struct usb_device *usb_dev = interface_to_usbdev(acm->control);
 
 	for (wb = &acm->wb[0], i = 0; i < ACM_NW; i++, wb++)
-		usb_buffer_free(usb_dev, acm->writesize, wb->buf, wb->dmah);
+		usb_free_coherent(usb_dev, acm->writesize, wb->buf, wb->dmah);
 }
 
 static void acm_read_buffers_free(struct acm *acm)
@@ -901,8 +901,8 @@ static void acm_read_buffers_free(struct acm *acm)
 	int i, n = acm->rx_buflimit;
 
 	for (i = 0; i < n; i++)
-		usb_buffer_free(usb_dev, acm->readsize,
-					acm->rb[i].base, acm->rb[i].dma);
+		usb_free_coherent(usb_dev, acm->readsize,
+				  acm->rb[i].base, acm->rb[i].dma);
 }
 
 /* Little helper: write buffers allocate */
@@ -912,13 +912,13 @@ static int acm_write_buffers_alloc(struct acm *acm)
 	struct acm_wb *wb;
 
 	for (wb = &acm->wb[0], i = 0; i < ACM_NW; i++, wb++) {
-		wb->buf = usb_buffer_alloc(acm->dev, acm->writesize, GFP_KERNEL,
+		wb->buf = usb_alloc_coherent(acm->dev, acm->writesize, GFP_KERNEL,
 		    &wb->dmah);
 		if (!wb->buf) {
 			while (i != 0) {
 				--i;
 				--wb;
-				usb_buffer_free(acm->dev, acm->writesize,
+				usb_free_coherent(acm->dev, acm->writesize,
 				    wb->buf, wb->dmah);
 			}
 			return -ENOMEM;
@@ -1177,7 +1177,7 @@ made_compressed_probe:
 	tty_port_init(&acm->port);
 	acm->port.ops = &acm_port_ops;
 
-	buf = usb_buffer_alloc(usb_dev, ctrlsize, GFP_KERNEL, &acm->ctrl_dma);
+	buf = usb_alloc_coherent(usb_dev, ctrlsize, GFP_KERNEL, &acm->ctrl_dma);
 	if (!buf) {
 		dev_dbg(&intf->dev, "out of memory (ctrl buffer alloc)\n");
 		goto alloc_fail2;
@@ -1210,11 +1210,11 @@ made_compressed_probe:
 	for (i = 0; i < num_rx_buf; i++) {
 		struct acm_rb *rb = &(acm->rb[i]);
 
-		rb->base = usb_buffer_alloc(acm->dev, readsize,
+		rb->base = usb_alloc_coherent(acm->dev, readsize,
 				GFP_KERNEL, &rb->dma);
 		if (!rb->base) {
 			dev_dbg(&intf->dev,
-				"out of memory (read bufs usb_buffer_alloc)\n");
+				"out of memory (read bufs usb_alloc_coherent)\n");
 			goto alloc_fail7;
 		}
 	}
@@ -1306,7 +1306,7 @@ alloc_fail7:
 alloc_fail5:
 	acm_write_buffers_free(acm);
 alloc_fail4:
-	usb_buffer_free(usb_dev, ctrlsize, acm->ctrl_buffer, acm->ctrl_dma);
+	usb_free_coherent(usb_dev, ctrlsize, acm->ctrl_buffer, acm->ctrl_dma);
 alloc_fail2:
 	kfree(acm);
 alloc_fail:
@@ -1356,8 +1356,8 @@ static void acm_disconnect(struct usb_interface *intf)
 	stop_data_traffic(acm);
 
 	acm_write_buffers_free(acm);
-	usb_buffer_free(usb_dev, acm->ctrlsize, acm->ctrl_buffer,
-								acm->ctrl_dma);
+	usb_free_coherent(usb_dev, acm->ctrlsize, acm->ctrl_buffer,
+			  acm->ctrl_dma);
 	acm_read_buffers_free(acm);
 
 	if (!acm->combined_interfaces)
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c
index 189141c..094c76b 100644
--- a/drivers/usb/class/cdc-wdm.c
+++ b/drivers/usb/class/cdc-wdm.c
@@ -276,14 +276,14 @@ static void free_urbs(struct wdm_device *desc)
 
 static void cleanup(struct wdm_device *desc)
 {
-	usb_buffer_free(interface_to_usbdev(desc->intf),
-			desc->wMaxPacketSize,
-			desc->sbuf,
-			desc->validity->transfer_dma);
-	usb_buffer_free(interface_to_usbdev(desc->intf),
-			desc->wMaxCommand,
-			desc->inbuf,
-			desc->response->transfer_dma);
+	usb_free_coherent(interface_to_usbdev(desc->intf),
+			  desc->wMaxPacketSize,
+			  desc->sbuf,
+			  desc->validity->transfer_dma);
+	usb_free_coherent(interface_to_usbdev(desc->intf),
+			  desc->wMaxCommand,
+			  desc->inbuf,
+			  desc->response->transfer_dma);
 	kfree(desc->orq);
 	kfree(desc->irq);
 	kfree(desc->ubuf);
@@ -705,17 +705,17 @@ next_desc:
 	if (!desc->ubuf)
 		goto err;
 
-	desc->sbuf = usb_buffer_alloc(interface_to_usbdev(intf),
+	desc->sbuf = usb_alloc_coherent(interface_to_usbdev(intf),
 					desc->wMaxPacketSize,
 					GFP_KERNEL,
 					&desc->validity->transfer_dma);
 	if (!desc->sbuf)
 		goto err;
 
-	desc->inbuf = usb_buffer_alloc(interface_to_usbdev(intf),
-					desc->bMaxPacketSize0,
-					GFP_KERNEL,
-					&desc->response->transfer_dma);
+	desc->inbuf = usb_alloc_coherent(interface_to_usbdev(intf),
+					 desc->bMaxPacketSize0,
+					 GFP_KERNEL,
+					 &desc->response->transfer_dma);
 	if (!desc->inbuf)
 		goto err2;
 
@@ -742,15 +742,15 @@ out:
 	return rv;
 err3:
 	usb_set_intfdata(intf, NULL);
-	usb_buffer_free(interface_to_usbdev(desc->intf),
-			desc->bMaxPacketSize0,
+	usb_free_coherent(interface_to_usbdev(desc->intf),
+			  desc->bMaxPacketSize0,
 			desc->inbuf,
 			desc->response->transfer_dma);
 err2:
-	usb_buffer_free(interface_to_usbdev(desc->intf),
-			desc->wMaxPacketSize,
-			desc->sbuf,
-			desc->validity->transfer_dma);
+	usb_free_coherent(interface_to_usbdev(desc->intf),
+			  desc->wMaxPacketSize,
+			  desc->sbuf,
+			  desc->validity->transfer_dma);
 err:
 	free_urbs(desc);
 	kfree(desc->ubuf);
diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c
index 93b5f85..2250095 100644
--- a/drivers/usb/class/usblp.c
+++ b/drivers/usb/class/usblp.c
@@ -27,7 +27,7 @@
  *	v0.11 - add proto_bias option (Pete Zaitcev)
  *	v0.12 - add hpoj.sourceforge.net ioctls (David Paschal)
  *	v0.13 - alloc space for statusbuf (<status> not on stack);
- *		use usb_buffer_alloc() for read buf & write buf;
+ *		use usb_alloc_coherent() for read buf & write buf;
  *      none  - Maintained in Linux kernel after v0.13
  */
 
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index 1297e9b..0561430 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -718,7 +718,7 @@ int __usb_get_extra_descriptor(char *buffer, unsigned size,
 EXPORT_SYMBOL_GPL(__usb_get_extra_descriptor);
 
 /**
- * usb_buffer_alloc - allocate dma-consistent buffer for URB_NO_xxx_DMA_MAP
+ * usb_alloc_coherent - allocate dma-consistent buffer for URB_NO_xxx_DMA_MAP
  * @dev: device the buffer will be used with
  * @size: requested buffer size
  * @mem_flags: affect whether allocation may block
@@ -737,30 +737,30 @@ EXPORT_SYMBOL_GPL(__usb_get_extra_descriptor);
  * architectures where CPU caches are not DMA-coherent.  On systems without
  * bus-snooping caches, these buffers are uncached.
  *
- * When the buffer is no longer used, free it with usb_buffer_free().
+ * When the buffer is no longer used, free it with usb_free_coherent().
  */
-void *usb_buffer_alloc(struct usb_device *dev, size_t size, gfp_t mem_flags,
-		       dma_addr_t *dma)
+void *usb_alloc_coherent(struct usb_device *dev, size_t size, gfp_t mem_flags,
+			 dma_addr_t *dma)
 {
 	if (!dev || !dev->bus)
 		return NULL;
 	return hcd_buffer_alloc(dev->bus, size, mem_flags, dma);
 }
-EXPORT_SYMBOL_GPL(usb_buffer_alloc);
+EXPORT_SYMBOL_GPL(usb_alloc_coherent);
 
 /**
- * usb_buffer_free - free memory allocated with usb_buffer_alloc()
+ * usb_free_coherent - free memory allocated with usb_alloc_coherent()
  * @dev: device the buffer was used with
  * @size: requested buffer size
  * @addr: CPU address of buffer
  * @dma: DMA address of buffer
  *
  * This reclaims an I/O buffer, letting it be reused.  The memory must have
- * been allocated using usb_buffer_alloc(), and the parameters must match
+ * been allocated using usb_alloc_coherent(), and the parameters must match
  * those provided in that allocation request.
  */
-void usb_buffer_free(struct usb_device *dev, size_t size, void *addr,
-		     dma_addr_t dma)
+void usb_free_coherent(struct usb_device *dev, size_t size, void *addr,
+		       dma_addr_t dma)
 {
 	if (!dev || !dev->bus)
 		return;
@@ -768,7 +768,7 @@ void usb_buffer_free(struct usb_device *dev, size_t size, void *addr,
 		return;
 	hcd_buffer_free(dev->bus, size, addr, dma);
 }
-EXPORT_SYMBOL_GPL(usb_buffer_free);
+EXPORT_SYMBOL_GPL(usb_free_coherent);
 
 /**
  * usb_buffer_map - create DMA mapping(s) for an urb
diff --git a/drivers/usb/misc/appledisplay.c b/drivers/usb/misc/appledisplay.c
index 094f91c..1fa6ce3 100644
--- a/drivers/usb/misc/appledisplay.c
+++ b/drivers/usb/misc/appledisplay.c
@@ -259,7 +259,7 @@ static int appledisplay_probe(struct usb_interface *iface,
 	}
 
 	/* Allocate buffer for interrupt data */
-	pdata->urbdata = usb_buffer_alloc(pdata->udev, ACD_URB_BUFFER_LEN,
+	pdata->urbdata = usb_alloc_coherent(pdata->udev, ACD_URB_BUFFER_LEN,
 		GFP_KERNEL, &pdata->urb->transfer_dma);
 	if (!pdata->urbdata) {
 		retval = -ENOMEM;
@@ -316,7 +316,7 @@ error:
 		if (pdata->urb) {
 			usb_kill_urb(pdata->urb);
 			if (pdata->urbdata)
-				usb_buffer_free(pdata->udev, ACD_URB_BUFFER_LEN,
+				usb_free_coherent(pdata->udev, ACD_URB_BUFFER_LEN,
 					pdata->urbdata, pdata->urb->transfer_dma);
 			usb_free_urb(pdata->urb);
 		}
@@ -337,7 +337,7 @@ static void appledisplay_disconnect(struct usb_interface *iface)
 		usb_kill_urb(pdata->urb);
 		cancel_delayed_work(&pdata->work);
 		backlight_device_unregister(pdata->bd);
-		usb_buffer_free(pdata->udev, ACD_URB_BUFFER_LEN,
+		usb_free_coherent(pdata->udev, ACD_URB_BUFFER_LEN,
 			pdata->urbdata, pdata->urb->transfer_dma);
 		usb_free_urb(pdata->urb);
 		kfree(pdata->msgdata);
diff --git a/drivers/usb/misc/ftdi-elan.c b/drivers/usb/misc/ftdi-elan.c
index 1edb6d3..a9e0546 100644
--- a/drivers/usb/misc/ftdi-elan.c
+++ b/drivers/usb/misc/ftdi-elan.c
@@ -734,7 +734,7 @@ static void ftdi_elan_write_bulk_callback(struct urb *urb)
                 dev_err(&ftdi->udev->dev, "urb=%p write bulk status received: %"
                         "d\n", urb, status);
         }
-        usb_buffer_free(urb->dev, urb->transfer_buffer_length,
+        usb_free_coherent(urb->dev, urb->transfer_buffer_length,
                 urb->transfer_buffer, urb->transfer_dma);
 }
 
@@ -795,7 +795,7 @@ static int ftdi_elan_command_engine(struct usb_ftdi *ftdi)
                         total_size);
                 return -ENOMEM;
         }
-        buf = usb_buffer_alloc(ftdi->udev, total_size, GFP_KERNEL,
+        buf = usb_alloc_coherent(ftdi->udev, total_size, GFP_KERNEL,
                 &urb->transfer_dma);
         if (!buf) {
                 dev_err(&ftdi->udev->dev, "could not get a buffer to write %d c"
@@ -829,7 +829,7 @@ static int ftdi_elan_command_engine(struct usb_ftdi *ftdi)
                 dev_err(&ftdi->udev->dev, "failed %d to submit urb %p to write "
                         "%d commands totaling %d bytes to the Uxxx\n", retval,
                         urb, command_size, total_size);
-                usb_buffer_free(ftdi->udev, total_size, buf, urb->transfer_dma);
+                usb_free_coherent(ftdi->udev, total_size, buf, urb->transfer_dma);
                 usb_free_urb(urb);
                 return retval;
         }
@@ -1167,7 +1167,7 @@ static ssize_t ftdi_elan_write(struct file *file,
                 retval = -ENOMEM;
                 goto error_1;
         }
-        buf = usb_buffer_alloc(ftdi->udev, count, GFP_KERNEL,
+        buf = usb_alloc_coherent(ftdi->udev, count, GFP_KERNEL,
                 &urb->transfer_dma);
         if (!buf) {
                 retval = -ENOMEM;
@@ -1192,7 +1192,7 @@ static ssize_t ftdi_elan_write(struct file *file,
 exit:
         return count;
 error_3:
-	usb_buffer_free(ftdi->udev, count, buf, urb->transfer_dma);
+	usb_free_coherent(ftdi->udev, count, buf, urb->transfer_dma);
 error_2:
 	usb_free_urb(urb);
 error_1:
@@ -1968,7 +1968,7 @@ static int ftdi_elan_synchronize_flush(struct usb_ftdi *ftdi)
                         "ence\n");
                 return -ENOMEM;
         }
-        buf = usb_buffer_alloc(ftdi->udev, I, GFP_KERNEL, &urb->transfer_dma);
+        buf = usb_alloc_coherent(ftdi->udev, I, GFP_KERNEL, &urb->transfer_dma);
         if (!buf) {
                 dev_err(&ftdi->udev->dev, "could not get a buffer for flush seq"
                         "uence\n");
@@ -1985,7 +1985,7 @@ static int ftdi_elan_synchronize_flush(struct usb_ftdi *ftdi)
         if (retval) {
                 dev_err(&ftdi->udev->dev, "failed to submit urb containing the "
                         "flush sequence\n");
-                usb_buffer_free(ftdi->udev, i, buf, urb->transfer_dma);
+                usb_free_coherent(ftdi->udev, i, buf, urb->transfer_dma);
                 usb_free_urb(urb);
                 return -ENOMEM;
         }
@@ -2011,7 +2011,7 @@ static int ftdi_elan_synchronize_reset(struct usb_ftdi *ftdi)
                         "quence\n");
                 return -ENOMEM;
         }
-        buf = usb_buffer_alloc(ftdi->udev, I, GFP_KERNEL, &urb->transfer_dma);
+        buf = usb_alloc_coherent(ftdi->udev, I, GFP_KERNEL, &urb->transfer_dma);
         if (!buf) {
                 dev_err(&ftdi->udev->dev, "could not get a buffer for the reset"
                         " sequence\n");
@@ -2030,7 +2030,7 @@ static int ftdi_elan_synchronize_reset(struct usb_ftdi *ftdi)
         if (retval) {
                 dev_err(&ftdi->udev->dev, "failed to submit urb containing the "
                         "reset sequence\n");
-                usb_buffer_free(ftdi->udev, i, buf, urb->transfer_dma);
+                usb_free_coherent(ftdi->udev, i, buf, urb->transfer_dma);
                 usb_free_urb(urb);
                 return -ENOMEM;
         }
diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c
index d3c8523..7dc9d3c 100644
--- a/drivers/usb/misc/iowarrior.c
+++ b/drivers/usb/misc/iowarrior.c
@@ -239,8 +239,8 @@ static void iowarrior_write_callback(struct urb *urb)
 		    __func__, status);
 	}
 	/* free up our allocated buffer */
-	usb_buffer_free(urb->dev, urb->transfer_buffer_length,
-			urb->transfer_buffer, urb->transfer_dma);
+	usb_free_coherent(urb->dev, urb->transfer_buffer_length,
+			  urb->transfer_buffer, urb->transfer_dma);
 	/* tell a waiting writer the interrupt-out-pipe is available again */
 	atomic_dec(&dev->write_busy);
 	wake_up_interruptible(&dev->write_wait);
@@ -421,8 +421,8 @@ static ssize_t iowarrior_write(struct file *file,
 			dbg("%s Unable to allocate urb ", __func__);
 			goto error_no_urb;
 		}
-		buf = usb_buffer_alloc(dev->udev, dev->report_size,
-				       GFP_KERNEL, &int_out_urb->transfer_dma);
+		buf = usb_alloc_coherent(dev->udev, dev->report_size,
+					 GFP_KERNEL, &int_out_urb->transfer_dma);
 		if (!buf) {
 			retval = -ENOMEM;
 			dbg("%s Unable to allocate buffer ", __func__);
@@ -459,8 +459,8 @@ static ssize_t iowarrior_write(struct file *file,
 		break;
 	}
 error:
-	usb_buffer_free(dev->udev, dev->report_size, buf,
-			int_out_urb->transfer_dma);
+	usb_free_coherent(dev->udev, dev->report_size, buf,
+			  int_out_urb->transfer_dma);
 error_no_buffer:
 	usb_free_urb(int_out_urb);
 error_no_urb:
diff --git a/drivers/usb/misc/usblcd.c b/drivers/usb/misc/usblcd.c
index 90aede9..7828c76 100644
--- a/drivers/usb/misc/usblcd.c
+++ b/drivers/usb/misc/usblcd.c
@@ -205,8 +205,8 @@ static void lcd_write_bulk_callback(struct urb *urb)
 	}
 
 	/* free up our allocated buffer */
-	usb_buffer_free(urb->dev, urb->transfer_buffer_length,
-			urb->transfer_buffer, urb->transfer_dma);
+	usb_free_coherent(urb->dev, urb->transfer_buffer_length,
+			  urb->transfer_buffer, urb->transfer_dma);
 	up(&dev->limit_sem);
 }
 
@@ -234,7 +234,7 @@ static ssize_t lcd_write(struct file *file, const char __user * user_buffer, siz
 		goto err_no_buf;
 	}
 	
-	buf = usb_buffer_alloc(dev->udev, count, GFP_KERNEL, &urb->transfer_dma);
+	buf = usb_alloc_coherent(dev->udev, count, GFP_KERNEL, &urb->transfer_dma);
 	if (!buf) {
 		retval = -ENOMEM;
 		goto error;
@@ -268,7 +268,7 @@ exit:
 error_unanchor:
 	usb_unanchor_urb(urb);
 error:
-	usb_buffer_free(dev->udev, count, buf, urb->transfer_dma);
+	usb_free_coherent(dev->udev, count, buf, urb->transfer_dma);
 	usb_free_urb(urb);
 err_no_buf:
 	up(&dev->limit_sem);
diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c
index a21cce6..9ecde8c 100644
--- a/drivers/usb/misc/usbtest.c
+++ b/drivers/usb/misc/usbtest.c
@@ -202,7 +202,7 @@ static struct urb *simple_alloc_urb (
 	urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP;
 	if (usb_pipein (pipe))
 		urb->transfer_flags |= URB_SHORT_NOT_OK;
-	urb->transfer_buffer = usb_buffer_alloc (udev, bytes, GFP_KERNEL,
+	urb->transfer_buffer = usb_alloc_coherent (udev, bytes, GFP_KERNEL,
 			&urb->transfer_dma);
 	if (!urb->transfer_buffer) {
 		usb_free_urb (urb);
@@ -272,8 +272,8 @@ static inline int simple_check_buf(struct usbtest_dev *tdev, struct urb *urb)
 
 static void simple_free_urb (struct urb *urb)
 {
-	usb_buffer_free (urb->dev, urb->transfer_buffer_length,
-			urb->transfer_buffer, urb->transfer_dma);
+	usb_free_coherent(urb->dev, urb->transfer_buffer_length,
+			  urb->transfer_buffer, urb->transfer_dma);
 	usb_free_urb (urb);
 }
 
@@ -977,7 +977,7 @@ test_ctrl_queue (struct usbtest_dev *dev, struct usbtest_param *param)
 		if (!u)
 			goto cleanup;
 
-		reqp = usb_buffer_alloc (udev, sizeof *reqp, GFP_KERNEL,
+		reqp = usb_alloc_coherent (udev, sizeof *reqp, GFP_KERNEL,
 				&u->setup_dma);
 		if (!reqp)
 			goto cleanup;
@@ -1018,9 +1018,9 @@ cleanup:
 			continue;
 		urb [i]->dev = udev;
 		if (urb [i]->setup_packet)
-			usb_buffer_free (udev, sizeof (struct usb_ctrlrequest),
-					urb [i]->setup_packet,
-					urb [i]->setup_dma);
+			usb_free_coherent (udev, sizeof (struct usb_ctrlrequest),
+					   urb [i]->setup_packet,
+					   urb [i]->setup_dma);
 		simple_free_urb (urb [i]);
 	}
 	kfree (urb);
@@ -1421,7 +1421,7 @@ static struct urb *iso_alloc_urb (
 
 	urb->number_of_packets = packets;
 	urb->transfer_buffer_length = bytes;
-	urb->transfer_buffer = usb_buffer_alloc (udev, bytes, GFP_KERNEL,
+	urb->transfer_buffer = usb_alloc_coherent (udev, bytes, GFP_KERNEL,
 			&urb->transfer_dma);
 	if (!urb->transfer_buffer) {
 		usb_free_urb (urb);
diff --git a/drivers/usb/storage/onetouch.c b/drivers/usb/storage/onetouch.c
index 198bb3e..1943be5 100644
--- a/drivers/usb/storage/onetouch.c
+++ b/drivers/usb/storage/onetouch.c
@@ -201,8 +201,8 @@ static int onetouch_connect_input(struct us_data *ss)
 	if (!onetouch || !input_dev)
 		goto fail1;
 
-	onetouch->data = usb_buffer_alloc(udev, ONETOUCH_PKT_LEN,
-					  GFP_KERNEL, &onetouch->data_dma);
+	onetouch->data = usb_alloc_coherent(udev, ONETOUCH_PKT_LEN,
+					    GFP_KERNEL, &onetouch->data_dma);
 	if (!onetouch->data)
 		goto fail1;
 
@@ -264,8 +264,8 @@ static int onetouch_connect_input(struct us_data *ss)
 	return 0;
 
  fail3:	usb_free_urb(onetouch->irq);
- fail2:	usb_buffer_free(udev, ONETOUCH_PKT_LEN,
-			onetouch->data, onetouch->data_dma);
+ fail2:	usb_free_coherent(udev, ONETOUCH_PKT_LEN,
+			  onetouch->data, onetouch->data_dma);
  fail1:	kfree(onetouch);
 	input_free_device(input_dev);
 	return error;
@@ -279,8 +279,8 @@ static void onetouch_release_input(void *onetouch_)
 		usb_kill_urb(onetouch->irq);
 		input_unregister_device(onetouch->dev);
 		usb_free_urb(onetouch->irq);
-		usb_buffer_free(onetouch->udev, ONETOUCH_PKT_LEN,
-				onetouch->data, onetouch->data_dma);
+		usb_free_coherent(onetouch->udev, ONETOUCH_PKT_LEN,
+				  onetouch->data, onetouch->data_dma);
 	}
 }
 
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
index bbeeb92..ef00584 100644
--- a/drivers/usb/storage/usb.c
+++ b/drivers/usb/storage/usb.c
@@ -408,14 +408,14 @@ static int associate_dev(struct us_data *us, struct usb_interface *intf)
 	usb_set_intfdata(intf, us);
 
 	/* Allocate the device-related DMA-mapped buffers */
-	us->cr = usb_buffer_alloc(us->pusb_dev, sizeof(*us->cr),
+	us->cr = usb_alloc_coherent(us->pusb_dev, sizeof(*us->cr),
 			GFP_KERNEL, &us->cr_dma);
 	if (!us->cr) {
 		US_DEBUGP("usb_ctrlrequest allocation failed\n");
 		return -ENOMEM;
 	}
 
-	us->iobuf = usb_buffer_alloc(us->pusb_dev, US_IOBUF_SIZE,
+	us->iobuf = usb_alloc_coherent(us->pusb_dev, US_IOBUF_SIZE,
 			GFP_KERNEL, &us->iobuf_dma);
 	if (!us->iobuf) {
 		US_DEBUGP("I/O buffer allocation failed\n");
@@ -759,11 +759,11 @@ static void dissociate_dev(struct us_data *us)
 
 	/* Free the device-related DMA-mapped buffers */
 	if (us->cr)
-		usb_buffer_free(us->pusb_dev, sizeof(*us->cr), us->cr,
-				us->cr_dma);
+		usb_free_coherent(us->pusb_dev, sizeof(*us->cr), us->cr,
+				  us->cr_dma);
 	if (us->iobuf)
-		usb_buffer_free(us->pusb_dev, US_IOBUF_SIZE, us->iobuf,
-				us->iobuf_dma);
+		usb_free_coherent(us->pusb_dev, US_IOBUF_SIZE, us->iobuf,
+				  us->iobuf_dma);
 
 	/* Remove our private data from the interface */
 	usb_set_intfdata(us->pusb_intf, NULL);
diff --git a/drivers/usb/usb-skeleton.c b/drivers/usb/usb-skeleton.c
index 6152278..d110588 100644
--- a/drivers/usb/usb-skeleton.c
+++ b/drivers/usb/usb-skeleton.c
@@ -387,8 +387,8 @@ static void skel_write_bulk_callback(struct urb *urb)
 	}
 
 	/* free up our allocated buffer */
-	usb_buffer_free(urb->dev, urb->transfer_buffer_length,
-			urb->transfer_buffer, urb->transfer_dma);
+	usb_free_coherent(urb->dev, urb->transfer_buffer_length,
+			  urb->transfer_buffer, urb->transfer_dma);
 	up(&dev->limit_sem);
 }
 
@@ -442,8 +442,8 @@ static ssize_t skel_write(struct file *file, const char *user_buffer,
 		goto error;
 	}
 
-	buf = usb_buffer_alloc(dev->udev, writesize, GFP_KERNEL,
-			       &urb->transfer_dma);
+	buf = usb_alloc_coherent(dev->udev, writesize, GFP_KERNEL,
+				 &urb->transfer_dma);
 	if (!buf) {
 		retval = -ENOMEM;
 		goto error;
@@ -491,7 +491,7 @@ error_unanchor:
 	usb_unanchor_urb(urb);
 error:
 	if (urb) {
-		usb_buffer_free(dev->udev, writesize, buf, urb->transfer_dma);
+		usb_free_coherent(dev->udev, writesize, buf, urb->transfer_dma);
 		usb_free_urb(urb);
 	}
 	up(&dev->limit_sem);
diff --git a/drivers/watchdog/pcwd_usb.c b/drivers/watchdog/pcwd_usb.c
index 8e4eacc..748a74b 100644
--- a/drivers/watchdog/pcwd_usb.c
+++ b/drivers/watchdog/pcwd_usb.c
@@ -600,8 +600,8 @@ static inline void usb_pcwd_delete(struct usb_pcwd_private *usb_pcwd)
 {
 	usb_free_urb(usb_pcwd->intr_urb);
 	if (usb_pcwd->intr_buffer != NULL)
-		usb_buffer_free(usb_pcwd->udev, usb_pcwd->intr_size,
-				usb_pcwd->intr_buffer, usb_pcwd->intr_dma);
+		usb_free_coherent(usb_pcwd->udev, usb_pcwd->intr_size,
+				  usb_pcwd->intr_buffer, usb_pcwd->intr_dma);
 	kfree(usb_pcwd);
 }
 
@@ -671,7 +671,7 @@ static int usb_pcwd_probe(struct usb_interface *interface,
 				le16_to_cpu(endpoint->wMaxPacketSize) : 8);
 
 	/* set up the memory buffer's */
-	usb_pcwd->intr_buffer = usb_buffer_alloc(udev, usb_pcwd->intr_size,
+	usb_pcwd->intr_buffer = usb_alloc_coherent(udev, usb_pcwd->intr_size,
 					GFP_ATOMIC, &usb_pcwd->intr_dma);
 	if (!usb_pcwd->intr_buffer) {
 		printk(KERN_ERR PFX "Out of memory\n");
diff --git a/include/linux/usb.h b/include/linux/usb.h
index ce1323c..4f485d0 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -1085,7 +1085,7 @@ typedef void (*usb_complete_t)(struct urb *);
  * Alternatively, drivers may pass the URB_NO_xxx_DMA_MAP transfer flags,
  * which tell the host controller driver that no such mapping is needed since
  * the device driver is DMA-aware.  For example, a device driver might
- * allocate a DMA buffer with usb_buffer_alloc() or call usb_buffer_map().
+ * allocate a DMA buffer with usb_alloc_coherent() or call usb_buffer_map().
  * When these transfer flags are provided, host controller drivers will
  * attempt to use the dma addresses found in the transfer_dma and/or
  * setup_dma fields rather than determining a dma address themselves.
@@ -1366,9 +1366,9 @@ static inline int usb_urb_dir_out(struct urb *urb)
 	return (urb->transfer_flags & URB_DIR_MASK) == URB_DIR_OUT;
 }
 
-void *usb_buffer_alloc(struct usb_device *dev, size_t size,
+void *usb_alloc_coherent(struct usb_device *dev, size_t size,
 	gfp_t mem_flags, dma_addr_t *dma);
-void usb_buffer_free(struct usb_device *dev, size_t size,
+void usb_free_coherent(struct usb_device *dev, size_t size,
 	void *addr, dma_addr_t dma);
 
 #if 0
diff --git a/sound/usb/midi.c b/sound/usb/midi.c
index c6ee4a1..00f7d8e 100644
--- a/sound/usb/midi.c
+++ b/sound/usb/midi.c
@@ -1046,8 +1046,8 @@ static struct snd_rawmidi_ops snd_usbmidi_input_ops = {
 static void free_urb_and_buffer(struct snd_usb_midi *umidi, struct urb *urb,
 				unsigned int buffer_length)
 {
-	usb_buffer_free(umidi->dev, buffer_length,
-			urb->transfer_buffer, urb->transfer_dma);
+	usb_free_coherent(umidi->dev, buffer_length,
+			  urb->transfer_buffer, urb->transfer_dma);
 	usb_free_urb(urb);
 }
 
@@ -1098,8 +1098,8 @@ static int snd_usbmidi_in_endpoint_create(struct snd_usb_midi* umidi,
 		pipe = usb_rcvbulkpipe(umidi->dev, ep_info->in_ep);
 	length = usb_maxpacket(umidi->dev, pipe, 0);
 	for (i = 0; i < INPUT_URBS; ++i) {
-		buffer = usb_buffer_alloc(umidi->dev, length, GFP_KERNEL,
-					  &ep->urbs[i]->transfer_dma);
+		buffer = usb_alloc_coherent(umidi->dev, length, GFP_KERNEL,
+					    &ep->urbs[i]->transfer_dma);
 		if (!buffer) {
 			snd_usbmidi_in_endpoint_delete(ep);
 			return -ENOMEM;
@@ -1182,9 +1182,9 @@ static int snd_usbmidi_out_endpoint_create(struct snd_usb_midi* umidi,
 		break;
 	}
 	for (i = 0; i < OUTPUT_URBS; ++i) {
-		buffer = usb_buffer_alloc(umidi->dev,
-					  ep->max_transfer, GFP_KERNEL,
-					  &ep->urbs[i].urb->transfer_dma);
+		buffer = usb_alloc_coherent(umidi->dev,
+					    ep->max_transfer, GFP_KERNEL,
+					    &ep->urbs[i].urb->transfer_dma);
 		if (!buffer) {
 			snd_usbmidi_out_endpoint_delete(ep);
 			return -ENOMEM;
diff --git a/sound/usb/misc/ua101.c b/sound/usb/misc/ua101.c
index 796d8b2..fb5d68f 100644
--- a/sound/usb/misc/ua101.c
+++ b/sound/usb/misc/ua101.c
@@ -42,7 +42,7 @@ MODULE_SUPPORTED_DEVICE("{{Edirol,UA-101},{Edirol,UA-1000}}");
 /*
  * This magic value optimizes memory usage efficiency for the UA-101's packet
  * sizes at all sample rates, taking into account the stupid cache pool sizes
- * that usb_buffer_alloc() uses.
+ * that usb_alloc_coherent() uses.
  */
 #define DEFAULT_QUEUE_LENGTH	21
 
@@ -1057,7 +1057,7 @@ static int alloc_stream_buffers(struct ua101 *ua, struct ua101_stream *stream)
 				   (unsigned int)MAX_QUEUE_LENGTH);
 
 	/*
-	 * The cache pool sizes used by usb_buffer_alloc() (128, 512, 2048) are
+	 * The cache pool sizes used by usb_alloc_coherent() (128, 512, 2048) are
 	 * quite bad when used with the packet sizes of this device (e.g. 280,
 	 * 520, 624).  Therefore, we allocate and subdivide entire pages, using
 	 * a smaller buffer only for the last chunk.
@@ -1068,8 +1068,8 @@ static int alloc_stream_buffers(struct ua101 *ua, struct ua101_stream *stream)
 		packets = min(remaining_packets, packets_per_page);
 		size = packets * stream->max_packet_bytes;
 		stream->buffers[i].addr =
-			usb_buffer_alloc(ua->dev, size, GFP_KERNEL,
-					 &stream->buffers[i].dma);
+			usb_alloc_coherent(ua->dev, size, GFP_KERNEL,
+					   &stream->buffers[i].dma);
 		if (!stream->buffers[i].addr)
 			return -ENOMEM;
 		stream->buffers[i].size = size;
@@ -1089,10 +1089,10 @@ static void free_stream_buffers(struct ua101 *ua, struct ua101_stream *stream)
 	unsigned int i;
 
 	for (i = 0; i < ARRAY_SIZE(stream->buffers); ++i)
-		usb_buffer_free(ua->dev,
-				stream->buffers[i].size,
-				stream->buffers[i].addr,
-				stream->buffers[i].dma);
+		usb_free_coherent(ua->dev,
+				  stream->buffers[i].size,
+				  stream->buffers[i].addr,
+				  stream->buffers[i].dma);
 }
 
 static int alloc_stream_urbs(struct ua101 *ua, struct ua101_stream *stream,
diff --git a/sound/usb/urb.c b/sound/usb/urb.c
index 5570a2b..8c7b3e5 100644
--- a/sound/usb/urb.c
+++ b/sound/usb/urb.c
@@ -101,9 +101,9 @@ static void release_urb_ctx(struct snd_urb_ctx *u)
 {
 	if (u->urb) {
 		if (u->buffer_size)
-			usb_buffer_free(u->subs->dev, u->buffer_size,
-					u->urb->transfer_buffer,
-					u->urb->transfer_dma);
+			usb_free_coherent(u->subs->dev, u->buffer_size,
+					  u->urb->transfer_buffer,
+					  u->urb->transfer_dma);
 		usb_free_urb(u->urb);
 		u->urb = NULL;
 	}
@@ -154,8 +154,8 @@ void snd_usb_release_substream_urbs(struct snd_usb_substream *subs, int force)
 		release_urb_ctx(&subs->dataurb[i]);
 	for (i = 0; i < SYNC_URBS; i++)
 		release_urb_ctx(&subs->syncurb[i]);
-	usb_buffer_free(subs->dev, SYNC_URBS * 4,
-			subs->syncbuf, subs->sync_dma);
+	usb_free_coherent(subs->dev, SYNC_URBS * 4,
+			  subs->syncbuf, subs->sync_dma);
 	subs->syncbuf = NULL;
 	subs->nurbs = 0;
 }
@@ -308,8 +308,8 @@ int snd_usb_init_substream_urbs(struct snd_usb_substream *subs,
 		if (!u->urb)
 			goto out_of_memory;
 		u->urb->transfer_buffer =
-			usb_buffer_alloc(subs->dev, u->buffer_size, GFP_KERNEL,
-					 &u->urb->transfer_dma);
+			usb_alloc_coherent(subs->dev, u->buffer_size, GFP_KERNEL,
+					   &u->urb->transfer_dma);
 		if (!u->urb->transfer_buffer)
 			goto out_of_memory;
 		u->urb->pipe = subs->datapipe;
@@ -321,8 +321,8 @@ int snd_usb_init_substream_urbs(struct snd_usb_substream *subs,
 
 	if (subs->syncpipe) {
 		/* allocate and initialize sync urbs */
-		subs->syncbuf = usb_buffer_alloc(subs->dev, SYNC_URBS * 4,
-						 GFP_KERNEL, &subs->sync_dma);
+		subs->syncbuf = usb_alloc_coherent(subs->dev, SYNC_URBS * 4,
+						   GFP_KERNEL, &subs->sync_dma);
 		if (!subs->syncbuf)
 			goto out_of_memory;
 		for (i = 0; i < SYNC_URBS; i++) {
-- 
1.6.6.1


^ permalink raw reply related	[flat|nested] 221+ messages in thread

* [PATCH] USB: rename usb_buffer_alloc() and usb_buffer_free()
@ 2010-04-12 11:17                 ` Daniel Mack
  0 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-12 11:17 UTC (permalink / raw)
  To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: Daniel Mack, Alan Stern, Greg KH, Pedro Ribeiro,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
	linux-usb-u79uwXL29TY76Z2rM5mHXA,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw

For more clearance what the functions actually do,

  usb_buffer_alloc() is renamed to usb_alloc_coherent()
  usb_buffer_free()  is renamed to usb_free_coherent()

They should only be used in code which really needs DMA coherency.

All call sites have been changed accordingly, except for staging
drivers.

Signed-off-by: Daniel Mack <daniel-rDUAYElUppE@public.gmane.org>
Cc: Alan Stern <stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org>
Cc: Greg KH <gregkh-l3A5Bk7waGM@public.gmane.org>
Cc: Pedro Ribeiro <pedrib-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org
Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org
---
 Documentation/DocBook/writing_usb_driver.tmpl  |    2 +-
 Documentation/usb/dma.txt                      |    4 +-
 drivers/hid/usbhid/hid-core.c                  |   16 +++++-----
 drivers/hid/usbhid/usbkbd.c                    |   12 ++++----
 drivers/hid/usbhid/usbmouse.c                  |    6 ++--
 drivers/input/joystick/xpad.c                  |   16 +++++-----
 drivers/input/misc/ati_remote.c                |   12 ++++----
 drivers/input/misc/ati_remote2.c               |    4 +-
 drivers/input/misc/cm109.c                     |   24 +++++++-------
 drivers/input/misc/keyspan_remote.c            |    6 ++--
 drivers/input/misc/powermate.c                 |   16 +++++-----
 drivers/input/misc/yealink.c                   |   24 +++++++-------
 drivers/input/mouse/appletouch.c               |   12 ++++----
 drivers/input/mouse/bcm5974.c                  |   24 +++++++-------
 drivers/input/tablet/acecad.c                  |    6 ++--
 drivers/input/tablet/aiptek.c                  |   14 ++++----
 drivers/input/tablet/gtco.c                    |   12 ++++----
 drivers/input/tablet/kbtab.c                   |    6 ++--
 drivers/input/tablet/wacom_sys.c               |   10 +++---
 drivers/input/touchscreen/usbtouchscreen.c     |    8 ++--
 drivers/media/dvb/dvb-usb/usb-urb.c            |    7 ++--
 drivers/media/dvb/ttusb-dec/ttusb_dec.c        |    6 ++--
 drivers/media/video/au0828/au0828-video.c      |    4 +-
 drivers/media/video/cx231xx/cx231xx-core.c     |   14 ++++----
 drivers/media/video/em28xx/em28xx-core.c       |    4 +-
 drivers/media/video/gspca/benq.c               |    4 +-
 drivers/media/video/gspca/gspca.c              |   30 +++++++++---------
 drivers/media/video/hdpvr/hdpvr-video.c        |    8 ++--
 drivers/media/video/tlg2300/pd-video.c         |   14 ++++----
 drivers/media/video/usbvision/usbvision-core.c |   16 +++++-----
 drivers/media/video/uvc/uvc_video.c            |    4 +-
 drivers/net/can/usb/ems_usb.c                  |   18 +++++-----
 drivers/net/usb/kaweth.c                       |   12 ++++----
 drivers/net/wireless/ath/ar9170/usb.c          |    8 ++--
 drivers/net/wireless/zd1211rw/zd_usb.c         |   10 +++---
 drivers/usb/class/cdc-acm.c                    |   22 +++++++-------
 drivers/usb/class/cdc-wdm.c                    |   38 ++++++++++++------------
 drivers/usb/class/usblp.c                      |    2 +-
 drivers/usb/core/usb.c                         |   20 ++++++------
 drivers/usb/misc/appledisplay.c                |    6 ++--
 drivers/usb/misc/ftdi-elan.c                   |   18 +++++-----
 drivers/usb/misc/iowarrior.c                   |   12 ++++----
 drivers/usb/misc/usblcd.c                      |    8 ++--
 drivers/usb/misc/usbtest.c                     |   16 +++++-----
 drivers/usb/storage/onetouch.c                 |   12 ++++----
 drivers/usb/storage/usb.c                      |   12 ++++----
 drivers/usb/usb-skeleton.c                     |   10 +++---
 drivers/watchdog/pcwd_usb.c                    |    6 ++--
 include/linux/usb.h                            |    6 ++--
 sound/usb/midi.c                               |   14 ++++----
 sound/usb/misc/ua101.c                         |   16 +++++-----
 sound/usb/urb.c                                |   18 +++++-----
 52 files changed, 315 insertions(+), 314 deletions(-)

diff --git a/Documentation/DocBook/writing_usb_driver.tmpl b/Documentation/DocBook/writing_usb_driver.tmpl
index eeff19c..bd97a13 100644
--- a/Documentation/DocBook/writing_usb_driver.tmpl
+++ b/Documentation/DocBook/writing_usb_driver.tmpl
@@ -342,7 +342,7 @@ static inline void skel_delete (struct usb_skel *dev)
 {
     kfree (dev->bulk_in_buffer);
     if (dev->bulk_out_buffer != NULL)
-        usb_buffer_free (dev->udev, dev->bulk_out_size,
+        usb_free_coherent (dev->udev, dev->bulk_out_size,
             dev->bulk_out_buffer,
             dev->write_urb->transfer_dma);
     usb_free_urb (dev->write_urb);
diff --git a/Documentation/usb/dma.txt b/Documentation/usb/dma.txt
index cfdcd16..a37e59c 100644
--- a/Documentation/usb/dma.txt
+++ b/Documentation/usb/dma.txt
@@ -43,10 +43,10 @@ and effects like cache-trashing can impose subtle penalties.
   kind of addresses to store in urb->transfer_buffer and urb->transfer_dma.
   You'd also set URB_NO_TRANSFER_DMA_MAP in urb->transfer_flags:
 
-	void *usb_buffer_alloc (struct usb_device *dev, size_t size,
+	void *usb_alloc_coherent (struct usb_device *dev, size_t size,
 		int mem_flags, dma_addr_t *dma);
 
-	void usb_buffer_free (struct usb_device *dev, size_t size,
+	void usb_free_coherent (struct usb_device *dev, size_t size,
 		void *addr, dma_addr_t dma);
 
   Most drivers should *NOT* be using these primitives; they don't need
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index 56d06cd..8496f3a 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -783,13 +783,13 @@ static int hid_alloc_buffers(struct usb_device *dev, struct hid_device *hid)
 {
 	struct usbhid_device *usbhid = hid->driver_data;
 
-	usbhid->inbuf = usb_buffer_alloc(dev, usbhid->bufsize, GFP_KERNEL,
+	usbhid->inbuf = usb_alloc_coherent(dev, usbhid->bufsize, GFP_KERNEL,
 			&usbhid->inbuf_dma);
-	usbhid->outbuf = usb_buffer_alloc(dev, usbhid->bufsize, GFP_KERNEL,
+	usbhid->outbuf = usb_alloc_coherent(dev, usbhid->bufsize, GFP_KERNEL,
 			&usbhid->outbuf_dma);
-	usbhid->cr = usb_buffer_alloc(dev, sizeof(*usbhid->cr), GFP_KERNEL,
+	usbhid->cr = usb_alloc_coherent(dev, sizeof(*usbhid->cr), GFP_KERNEL,
 			&usbhid->cr_dma);
-	usbhid->ctrlbuf = usb_buffer_alloc(dev, usbhid->bufsize, GFP_KERNEL,
+	usbhid->ctrlbuf = usb_alloc_coherent(dev, usbhid->bufsize, GFP_KERNEL,
 			&usbhid->ctrlbuf_dma);
 	if (!usbhid->inbuf || !usbhid->outbuf || !usbhid->cr ||
 			!usbhid->ctrlbuf)
@@ -844,10 +844,10 @@ static void hid_free_buffers(struct usb_device *dev, struct hid_device *hid)
 {
 	struct usbhid_device *usbhid = hid->driver_data;
 
-	usb_buffer_free(dev, usbhid->bufsize, usbhid->inbuf, usbhid->inbuf_dma);
-	usb_buffer_free(dev, usbhid->bufsize, usbhid->outbuf, usbhid->outbuf_dma);
-	usb_buffer_free(dev, sizeof(*(usbhid->cr)), usbhid->cr, usbhid->cr_dma);
-	usb_buffer_free(dev, usbhid->bufsize, usbhid->ctrlbuf, usbhid->ctrlbuf_dma);
+	usb_free_coherent(dev, usbhid->bufsize, usbhid->inbuf, usbhid->inbuf_dma);
+	usb_free_coherent(dev, usbhid->bufsize, usbhid->outbuf, usbhid->outbuf_dma);
+	usb_free_coherent(dev, sizeof(*(usbhid->cr)), usbhid->cr, usbhid->cr_dma);
+	usb_free_coherent(dev, usbhid->bufsize, usbhid->ctrlbuf, usbhid->ctrlbuf_dma);
 }
 
 static int usbhid_parse(struct hid_device *hid)
diff --git a/drivers/hid/usbhid/usbkbd.c b/drivers/hid/usbhid/usbkbd.c
index f843443..b86f866 100644
--- a/drivers/hid/usbhid/usbkbd.c
+++ b/drivers/hid/usbhid/usbkbd.c
@@ -197,11 +197,11 @@ static int usb_kbd_alloc_mem(struct usb_device *dev, struct usb_kbd *kbd)
 		return -1;
 	if (!(kbd->led = usb_alloc_urb(0, GFP_KERNEL)))
 		return -1;
-	if (!(kbd->new = usb_buffer_alloc(dev, 8, GFP_ATOMIC, &kbd->new_dma)))
+	if (!(kbd->new = usb_alloc_coherent(dev, 8, GFP_ATOMIC, &kbd->new_dma)))
 		return -1;
-	if (!(kbd->cr = usb_buffer_alloc(dev, sizeof(struct usb_ctrlrequest), GFP_ATOMIC, &kbd->cr_dma)))
+	if (!(kbd->cr = usb_alloc_coherent(dev, sizeof(struct usb_ctrlrequest), GFP_ATOMIC, &kbd->cr_dma)))
 		return -1;
-	if (!(kbd->leds = usb_buffer_alloc(dev, 1, GFP_ATOMIC, &kbd->leds_dma)))
+	if (!(kbd->leds = usb_alloc_coherent(dev, 1, GFP_ATOMIC, &kbd->leds_dma)))
 		return -1;
 
 	return 0;
@@ -211,9 +211,9 @@ static void usb_kbd_free_mem(struct usb_device *dev, struct usb_kbd *kbd)
 {
 	usb_free_urb(kbd->irq);
 	usb_free_urb(kbd->led);
-	usb_buffer_free(dev, 8, kbd->new, kbd->new_dma);
-	usb_buffer_free(dev, sizeof(struct usb_ctrlrequest), kbd->cr, kbd->cr_dma);
-	usb_buffer_free(dev, 1, kbd->leds, kbd->leds_dma);
+	usb_free_coherent(dev, 8, kbd->new, kbd->new_dma);
+	usb_free_coherent(dev, sizeof(struct usb_ctrlrequest), kbd->cr, kbd->cr_dma);
+	usb_free_coherent(dev, 1, kbd->leds, kbd->leds_dma);
 }
 
 static int usb_kbd_probe(struct usb_interface *iface,
diff --git a/drivers/hid/usbhid/usbmouse.c b/drivers/hid/usbhid/usbmouse.c
index 72ab4b2..79b2bf8 100644
--- a/drivers/hid/usbhid/usbmouse.c
+++ b/drivers/hid/usbhid/usbmouse.c
@@ -142,7 +142,7 @@ static int usb_mouse_probe(struct usb_interface *intf, const struct usb_device_i
 	if (!mouse || !input_dev)
 		goto fail1;
 
-	mouse->data = usb_buffer_alloc(dev, 8, GFP_ATOMIC, &mouse->data_dma);
+	mouse->data = usb_alloc_coherent(dev, 8, GFP_ATOMIC, &mouse->data_dma);
 	if (!mouse->data)
 		goto fail1;
 
@@ -205,7 +205,7 @@ static int usb_mouse_probe(struct usb_interface *intf, const struct usb_device_i
 fail3:	
 	usb_free_urb(mouse->irq);
 fail2:	
-	usb_buffer_free(dev, 8, mouse->data, mouse->data_dma);
+	usb_free_coherent(dev, 8, mouse->data, mouse->data_dma);
 fail1:	
 	input_free_device(input_dev);
 	kfree(mouse);
@@ -221,7 +221,7 @@ static void usb_mouse_disconnect(struct usb_interface *intf)
 		usb_kill_urb(mouse->irq);
 		input_unregister_device(mouse->dev);
 		usb_free_urb(mouse->irq);
-		usb_buffer_free(interface_to_usbdev(intf), 8, mouse->data, mouse->data_dma);
+		usb_free_coherent(interface_to_usbdev(intf), 8, mouse->data, mouse->data_dma);
 		kfree(mouse);
 	}
 }
diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index 9b3353b..c1087ce 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -533,8 +533,8 @@ static int xpad_init_output(struct usb_interface *intf, struct usb_xpad *xpad)
 	if (xpad->xtype != XTYPE_XBOX360 && xpad->xtype != XTYPE_XBOX)
 		return 0;
 
-	xpad->odata = usb_buffer_alloc(xpad->udev, XPAD_PKT_LEN,
-				       GFP_KERNEL, &xpad->odata_dma);
+	xpad->odata = usb_alloc_coherent(xpad->udev, XPAD_PKT_LEN,
+					 GFP_KERNEL, &xpad->odata_dma);
 	if (!xpad->odata)
 		goto fail1;
 
@@ -554,7 +554,7 @@ static int xpad_init_output(struct usb_interface *intf, struct usb_xpad *xpad)
 
 	return 0;
 
- fail2:	usb_buffer_free(xpad->udev, XPAD_PKT_LEN, xpad->odata, xpad->odata_dma);
+ fail2:	usb_free_coherent(xpad->udev, XPAD_PKT_LEN, xpad->odata, xpad->odata_dma);
  fail1:	return error;
 }
 
@@ -568,7 +568,7 @@ static void xpad_deinit_output(struct usb_xpad *xpad)
 {
 	if (xpad->xtype == XTYPE_XBOX360 || xpad->xtype == XTYPE_XBOX) {
 		usb_free_urb(xpad->irq_out);
-		usb_buffer_free(xpad->udev, XPAD_PKT_LEN,
+		usb_free_coherent(xpad->udev, XPAD_PKT_LEN,
 				xpad->odata, xpad->odata_dma);
 	}
 }
@@ -788,8 +788,8 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id
 	if (!xpad || !input_dev)
 		goto fail1;
 
-	xpad->idata = usb_buffer_alloc(udev, XPAD_PKT_LEN,
-				       GFP_KERNEL, &xpad->idata_dma);
+	xpad->idata = usb_alloc_coherent(udev, XPAD_PKT_LEN,
+					 GFP_KERNEL, &xpad->idata_dma);
 	if (!xpad->idata)
 		goto fail1;
 
@@ -942,7 +942,7 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id
  fail5:	usb_kill_urb(xpad->irq_in);
  fail4:	usb_free_urb(xpad->irq_in);
  fail3:	xpad_deinit_output(xpad);
- fail2:	usb_buffer_free(udev, XPAD_PKT_LEN, xpad->idata, xpad->idata_dma);
+ fail2:	usb_free_coherent(udev, XPAD_PKT_LEN, xpad->idata, xpad->idata_dma);
  fail1:	input_free_device(input_dev);
 	kfree(xpad);
 	return error;
@@ -964,7 +964,7 @@ static void xpad_disconnect(struct usb_interface *intf)
 			usb_kill_urb(xpad->irq_in);
 		}
 		usb_free_urb(xpad->irq_in);
-		usb_buffer_free(xpad->udev, XPAD_PKT_LEN,
+		usb_free_coherent(xpad->udev, XPAD_PKT_LEN,
 				xpad->idata, xpad->idata_dma);
 		kfree(xpad);
 	}
diff --git a/drivers/input/misc/ati_remote.c b/drivers/input/misc/ati_remote.c
index 614b65d..2b9a2c8 100644
--- a/drivers/input/misc/ati_remote.c
+++ b/drivers/input/misc/ati_remote.c
@@ -620,13 +620,13 @@ static void ati_remote_irq_in(struct urb *urb)
 static int ati_remote_alloc_buffers(struct usb_device *udev,
 				    struct ati_remote *ati_remote)
 {
-	ati_remote->inbuf = usb_buffer_alloc(udev, DATA_BUFSIZE, GFP_ATOMIC,
-					     &ati_remote->inbuf_dma);
+	ati_remote->inbuf = usb_alloc_coherent(udev, DATA_BUFSIZE, GFP_ATOMIC,
+					       &ati_remote->inbuf_dma);
 	if (!ati_remote->inbuf)
 		return -1;
 
-	ati_remote->outbuf = usb_buffer_alloc(udev, DATA_BUFSIZE, GFP_ATOMIC,
-					      &ati_remote->outbuf_dma);
+	ati_remote->outbuf = usb_alloc_coherent(udev, DATA_BUFSIZE, GFP_ATOMIC,
+					        &ati_remote->outbuf_dma);
 	if (!ati_remote->outbuf)
 		return -1;
 
@@ -649,10 +649,10 @@ static void ati_remote_free_buffers(struct ati_remote *ati_remote)
 	usb_free_urb(ati_remote->irq_urb);
 	usb_free_urb(ati_remote->out_urb);
 
-	usb_buffer_free(ati_remote->udev, DATA_BUFSIZE,
+	usb_free_coherent(ati_remote->udev, DATA_BUFSIZE,
 		ati_remote->inbuf, ati_remote->inbuf_dma);
 
-	usb_buffer_free(ati_remote->udev, DATA_BUFSIZE,
+	usb_free_coherent(ati_remote->udev, DATA_BUFSIZE,
 		ati_remote->outbuf, ati_remote->outbuf_dma);
 }
 
diff --git a/drivers/input/misc/ati_remote2.c b/drivers/input/misc/ati_remote2.c
index 2124b99..e148749 100644
--- a/drivers/input/misc/ati_remote2.c
+++ b/drivers/input/misc/ati_remote2.c
@@ -589,7 +589,7 @@ static int ati_remote2_urb_init(struct ati_remote2 *ar2)
 	int i, pipe, maxp;
 
 	for (i = 0; i < 2; i++) {
-		ar2->buf[i] = usb_buffer_alloc(udev, 4, GFP_KERNEL, &ar2->buf_dma[i]);
+		ar2->buf[i] = usb_alloc_coherent(udev, 4, GFP_KERNEL, &ar2->buf_dma[i]);
 		if (!ar2->buf[i])
 			return -ENOMEM;
 
@@ -617,7 +617,7 @@ static void ati_remote2_urb_cleanup(struct ati_remote2 *ar2)
 
 	for (i = 0; i < 2; i++) {
 		usb_free_urb(ar2->urb[i]);
-		usb_buffer_free(ar2->udev, 4, ar2->buf[i], ar2->buf_dma[i]);
+		usb_free_coherent(ar2->udev, 4, ar2->buf[i], ar2->buf_dma[i]);
 	}
 }
 
diff --git a/drivers/input/misc/cm109.c b/drivers/input/misc/cm109.c
index 86457fe..635b7ac 100644
--- a/drivers/input/misc/cm109.c
+++ b/drivers/input/misc/cm109.c
@@ -630,14 +630,14 @@ static const struct usb_device_id cm109_usb_table[] = {
 static void cm109_usb_cleanup(struct cm109_dev *dev)
 {
 	if (dev->ctl_req)
-		usb_buffer_free(dev->udev, sizeof(*(dev->ctl_req)),
-				dev->ctl_req, dev->ctl_req_dma);
+		usb_free_coherent(dev->udev, sizeof(*(dev->ctl_req)),
+				  dev->ctl_req, dev->ctl_req_dma);
 	if (dev->ctl_data)
-		usb_buffer_free(dev->udev, USB_PKT_LEN,
-				dev->ctl_data, dev->ctl_dma);
+		usb_free_coherent(dev->udev, USB_PKT_LEN,
+				  dev->ctl_data, dev->ctl_dma);
 	if (dev->irq_data)
-		usb_buffer_free(dev->udev, USB_PKT_LEN,
-				dev->irq_data, dev->irq_dma);
+		usb_free_coherent(dev->udev, USB_PKT_LEN,
+				  dev->irq_data, dev->irq_dma);
 
 	usb_free_urb(dev->urb_irq);	/* parameter validation in core/urb */
 	usb_free_urb(dev->urb_ctl);	/* parameter validation in core/urb */
@@ -686,18 +686,18 @@ static int cm109_usb_probe(struct usb_interface *intf,
 		goto err_out;
 
 	/* allocate usb buffers */
-	dev->irq_data = usb_buffer_alloc(udev, USB_PKT_LEN,
-					 GFP_KERNEL, &dev->irq_dma);
+	dev->irq_data = usb_alloc_coherent(udev, USB_PKT_LEN,
+					   GFP_KERNEL, &dev->irq_dma);
 	if (!dev->irq_data)
 		goto err_out;
 
-	dev->ctl_data = usb_buffer_alloc(udev, USB_PKT_LEN,
-					 GFP_KERNEL, &dev->ctl_dma);
+	dev->ctl_data = usb_alloc_coherent(udev, USB_PKT_LEN,
+					   GFP_KERNEL, &dev->ctl_dma);
 	if (!dev->ctl_data)
 		goto err_out;
 
-	dev->ctl_req = usb_buffer_alloc(udev, sizeof(*(dev->ctl_req)),
-					GFP_KERNEL, &dev->ctl_req_dma);
+	dev->ctl_req = usb_alloc_coherent(udev, sizeof(*(dev->ctl_req)),
+					  GFP_KERNEL, &dev->ctl_req_dma);
 	if (!dev->ctl_req)
 		goto err_out;
 
diff --git a/drivers/input/misc/keyspan_remote.c b/drivers/input/misc/keyspan_remote.c
index 86afdd1..a93c525 100644
--- a/drivers/input/misc/keyspan_remote.c
+++ b/drivers/input/misc/keyspan_remote.c
@@ -464,7 +464,7 @@ static int keyspan_probe(struct usb_interface *interface, const struct usb_devic
 	remote->in_endpoint = endpoint;
 	remote->toggle = -1;	/* Set to -1 so we will always not match the toggle from the first remote message. */
 
-	remote->in_buffer = usb_buffer_alloc(udev, RECV_SIZE, GFP_ATOMIC, &remote->in_dma);
+	remote->in_buffer = usb_alloc_coherent(udev, RECV_SIZE, GFP_ATOMIC, &remote->in_dma);
 	if (!remote->in_buffer) {
 		error = -ENOMEM;
 		goto fail1;
@@ -543,7 +543,7 @@ static int keyspan_probe(struct usb_interface *interface, const struct usb_devic
 	return 0;
 
  fail3:	usb_free_urb(remote->irq_urb);
- fail2:	usb_buffer_free(udev, RECV_SIZE, remote->in_buffer, remote->in_dma);
+ fail2:	usb_free_coherent(udev, RECV_SIZE, remote->in_buffer, remote->in_dma);
  fail1:	kfree(remote);
 	input_free_device(input_dev);
 
@@ -564,7 +564,7 @@ static void keyspan_disconnect(struct usb_interface *interface)
 		input_unregister_device(remote->input);
 		usb_kill_urb(remote->irq_urb);
 		usb_free_urb(remote->irq_urb);
-		usb_buffer_free(remote->udev, RECV_SIZE, remote->in_buffer, remote->in_dma);
+		usb_free_coherent(remote->udev, RECV_SIZE, remote->in_buffer, remote->in_dma);
 		kfree(remote);
 	}
 }
diff --git a/drivers/input/misc/powermate.c b/drivers/input/misc/powermate.c
index 668913d..a0b00d6 100644
--- a/drivers/input/misc/powermate.c
+++ b/drivers/input/misc/powermate.c
@@ -276,13 +276,13 @@ static int powermate_input_event(struct input_dev *dev, unsigned int type, unsig
 
 static int powermate_alloc_buffers(struct usb_device *udev, struct powermate_device *pm)
 {
-	pm->data = usb_buffer_alloc(udev, POWERMATE_PAYLOAD_SIZE_MAX,
-				    GFP_ATOMIC, &pm->data_dma);
+	pm->data = usb_alloc_coherent(udev, POWERMATE_PAYLOAD_SIZE_MAX,
+				      GFP_ATOMIC, &pm->data_dma);
 	if (!pm->data)
 		return -1;
 
-	pm->configcr = usb_buffer_alloc(udev, sizeof(*(pm->configcr)),
-					GFP_ATOMIC, &pm->configcr_dma);
+	pm->configcr = usb_alloc_coherent(udev, sizeof(*(pm->configcr)),
+					  GFP_ATOMIC, &pm->configcr_dma);
 	if (!pm->configcr)
 		return -1;
 
@@ -291,10 +291,10 @@ static int powermate_alloc_buffers(struct usb_device *udev, struct powermate_dev
 
 static void powermate_free_buffers(struct usb_device *udev, struct powermate_device *pm)
 {
-	usb_buffer_free(udev, POWERMATE_PAYLOAD_SIZE_MAX,
-			pm->data, pm->data_dma);
-	usb_buffer_free(udev, sizeof(*(pm->configcr)),
-			pm->configcr, pm->configcr_dma);
+	usb_free_coherent(udev, POWERMATE_PAYLOAD_SIZE_MAX,
+			  pm->data, pm->data_dma);
+	usb_free_coherent(udev, sizeof(*(pm->configcr)),
+			  pm->configcr, pm->configcr_dma);
 }
 
 /* Called whenever a USB device matching one in our supported devices table is connected */
diff --git a/drivers/input/misc/yealink.c b/drivers/input/misc/yealink.c
index 93a22ac..f584985 100644
--- a/drivers/input/misc/yealink.c
+++ b/drivers/input/misc/yealink.c
@@ -836,12 +836,12 @@ static int usb_cleanup(struct yealink_dev *yld, int err)
 	usb_free_urb(yld->urb_irq);
 	usb_free_urb(yld->urb_ctl);
 
-	usb_buffer_free(yld->udev, sizeof(*(yld->ctl_req)),
-			yld->ctl_req, yld->ctl_req_dma);
-	usb_buffer_free(yld->udev, USB_PKT_LEN,
-			yld->ctl_data, yld->ctl_dma);
-	usb_buffer_free(yld->udev, USB_PKT_LEN,
-			yld->irq_data, yld->irq_dma);
+	usb_free_coherent(yld->udev, sizeof(*(yld->ctl_req)),
+			  yld->ctl_req, yld->ctl_req_dma);
+	usb_free_coherent(yld->udev, USB_PKT_LEN,
+			  yld->ctl_data, yld->ctl_dma);
+	usb_free_coherent(yld->udev, USB_PKT_LEN,
+			  yld->irq_data, yld->irq_dma);
 
 	kfree(yld);
 	return err;
@@ -886,18 +886,18 @@ static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
 		return usb_cleanup(yld, -ENOMEM);
 
 	/* allocate usb buffers */
-	yld->irq_data = usb_buffer_alloc(udev, USB_PKT_LEN,
-					GFP_ATOMIC, &yld->irq_dma);
+	yld->irq_data = usb_alloc_coherent(udev, USB_PKT_LEN,
+					  GFP_ATOMIC, &yld->irq_dma);
 	if (yld->irq_data == NULL)
 		return usb_cleanup(yld, -ENOMEM);
 
-	yld->ctl_data = usb_buffer_alloc(udev, USB_PKT_LEN,
-					GFP_ATOMIC, &yld->ctl_dma);
+	yld->ctl_data = usb_alloc_coherent(udev, USB_PKT_LEN,
+					  GFP_ATOMIC, &yld->ctl_dma);
 	if (!yld->ctl_data)
 		return usb_cleanup(yld, -ENOMEM);
 
-	yld->ctl_req = usb_buffer_alloc(udev, sizeof(*(yld->ctl_req)),
-					GFP_ATOMIC, &yld->ctl_req_dma);
+	yld->ctl_req = usb_alloc_coherent(udev, sizeof(*(yld->ctl_req)),
+					  GFP_ATOMIC, &yld->ctl_req_dma);
 	if (yld->ctl_req == NULL)
 		return usb_cleanup(yld, -ENOMEM);
 
diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c
index 53ec7dd..05edd75 100644
--- a/drivers/input/mouse/appletouch.c
+++ b/drivers/input/mouse/appletouch.c
@@ -806,8 +806,8 @@ static int atp_probe(struct usb_interface *iface,
 	if (!dev->urb)
 		goto err_free_devs;
 
-	dev->data = usb_buffer_alloc(dev->udev, dev->info->datalen, GFP_KERNEL,
-				     &dev->urb->transfer_dma);
+	dev->data = usb_alloc_coherent(dev->udev, dev->info->datalen, GFP_KERNEL,
+				       &dev->urb->transfer_dma);
 	if (!dev->data)
 		goto err_free_urb;
 
@@ -862,8 +862,8 @@ static int atp_probe(struct usb_interface *iface,
 	return 0;
 
  err_free_buffer:
-	usb_buffer_free(dev->udev, dev->info->datalen,
-			dev->data, dev->urb->transfer_dma);
+	usb_free_coherent(dev->udev, dev->info->datalen,
+			  dev->data, dev->urb->transfer_dma);
  err_free_urb:
 	usb_free_urb(dev->urb);
  err_free_devs:
@@ -881,8 +881,8 @@ static void atp_disconnect(struct usb_interface *iface)
 	if (dev) {
 		usb_kill_urb(dev->urb);
 		input_unregister_device(dev->input);
-		usb_buffer_free(dev->udev, dev->info->datalen,
-				dev->data, dev->urb->transfer_dma);
+		usb_free_coherent(dev->udev, dev->info->datalen,
+				  dev->data, dev->urb->transfer_dma);
 		usb_free_urb(dev->urb);
 		kfree(dev);
 	}
diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c
index 4f8fe08..aa3359a 100644
--- a/drivers/input/mouse/bcm5974.c
+++ b/drivers/input/mouse/bcm5974.c
@@ -715,15 +715,15 @@ static int bcm5974_probe(struct usb_interface *iface,
 	if (!dev->tp_urb)
 		goto err_free_bt_urb;
 
-	dev->bt_data = usb_buffer_alloc(dev->udev,
-					dev->cfg.bt_datalen, GFP_KERNEL,
-					&dev->bt_urb->transfer_dma);
+	dev->bt_data = usb_alloc_coherent(dev->udev,
+					  dev->cfg.bt_datalen, GFP_KERNEL,
+					  &dev->bt_urb->transfer_dma);
 	if (!dev->bt_data)
 		goto err_free_urb;
 
-	dev->tp_data = usb_buffer_alloc(dev->udev,
-					dev->cfg.tp_datalen, GFP_KERNEL,
-					&dev->tp_urb->transfer_dma);
+	dev->tp_data = usb_alloc_coherent(dev->udev,
+					  dev->cfg.tp_datalen, GFP_KERNEL,
+					  &dev->tp_urb->transfer_dma);
 	if (!dev->tp_data)
 		goto err_free_bt_buffer;
 
@@ -765,10 +765,10 @@ static int bcm5974_probe(struct usb_interface *iface,
 	return 0;
 
 err_free_buffer:
-	usb_buffer_free(dev->udev, dev->cfg.tp_datalen,
+	usb_free_coherent(dev->udev, dev->cfg.tp_datalen,
 		dev->tp_data, dev->tp_urb->transfer_dma);
 err_free_bt_buffer:
-	usb_buffer_free(dev->udev, dev->cfg.bt_datalen,
+	usb_free_coherent(dev->udev, dev->cfg.bt_datalen,
 		dev->bt_data, dev->bt_urb->transfer_dma);
 err_free_urb:
 	usb_free_urb(dev->tp_urb);
@@ -788,10 +788,10 @@ static void bcm5974_disconnect(struct usb_interface *iface)
 	usb_set_intfdata(iface, NULL);
 
 	input_unregister_device(dev->input);
-	usb_buffer_free(dev->udev, dev->cfg.tp_datalen,
-			dev->tp_data, dev->tp_urb->transfer_dma);
-	usb_buffer_free(dev->udev, dev->cfg.bt_datalen,
-			dev->bt_data, dev->bt_urb->transfer_dma);
+	usb_free_coherent(dev->udev, dev->cfg.tp_datalen,
+			  dev->tp_data, dev->tp_urb->transfer_dma);
+	usb_free_coherent(dev->udev, dev->cfg.bt_datalen,
+			  dev->bt_data, dev->bt_urb->transfer_dma);
 	usb_free_urb(dev->tp_urb);
 	usb_free_urb(dev->bt_urb);
 	kfree(dev);
diff --git a/drivers/input/tablet/acecad.c b/drivers/input/tablet/acecad.c
index 670c61c..c047016 100644
--- a/drivers/input/tablet/acecad.c
+++ b/drivers/input/tablet/acecad.c
@@ -155,7 +155,7 @@ static int usb_acecad_probe(struct usb_interface *intf, const struct usb_device_
 		goto fail1;
 	}
 
-	acecad->data = usb_buffer_alloc(dev, 8, GFP_KERNEL, &acecad->data_dma);
+	acecad->data = usb_alloc_coherent(dev, 8, GFP_KERNEL, &acecad->data_dma);
 	if (!acecad->data) {
 		err= -ENOMEM;
 		goto fail1;
@@ -241,7 +241,7 @@ static int usb_acecad_probe(struct usb_interface *intf, const struct usb_device_
 
 	return 0;
 
- fail2:	usb_buffer_free(dev, 8, acecad->data, acecad->data_dma);
+ fail2:	usb_free_coherent(dev, 8, acecad->data, acecad->data_dma);
  fail1: input_free_device(input_dev);
 	kfree(acecad);
 	return err;
@@ -256,7 +256,7 @@ static void usb_acecad_disconnect(struct usb_interface *intf)
 		usb_kill_urb(acecad->irq);
 		input_unregister_device(acecad->input);
 		usb_free_urb(acecad->irq);
-		usb_buffer_free(interface_to_usbdev(intf), 10, acecad->data, acecad->data_dma);
+		usb_free_coherent(interface_to_usbdev(intf), 10, acecad->data, acecad->data_dma);
 		kfree(acecad);
 	}
 }
diff --git a/drivers/input/tablet/aiptek.c b/drivers/input/tablet/aiptek.c
index 4be039d..51b80b0 100644
--- a/drivers/input/tablet/aiptek.c
+++ b/drivers/input/tablet/aiptek.c
@@ -1711,8 +1711,8 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id)
 		goto fail1;
         }
 
-	aiptek->data = usb_buffer_alloc(usbdev, AIPTEK_PACKET_LENGTH,
-					GFP_ATOMIC, &aiptek->data_dma);
+	aiptek->data = usb_alloc_coherent(usbdev, AIPTEK_PACKET_LENGTH,
+					  GFP_ATOMIC, &aiptek->data_dma);
         if (!aiptek->data) {
 		dev_warn(&intf->dev, "cannot allocate usb buffer\n");
 		goto fail1;
@@ -1884,8 +1884,8 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id)
 
  fail4:	sysfs_remove_group(&intf->dev.kobj, &aiptek_attribute_group);
  fail3: usb_free_urb(aiptek->urb);
- fail2:	usb_buffer_free(usbdev, AIPTEK_PACKET_LENGTH, aiptek->data,
-			aiptek->data_dma);
+ fail2:	usb_free_coherent(usbdev, AIPTEK_PACKET_LENGTH, aiptek->data,
+			  aiptek->data_dma);
  fail1: usb_set_intfdata(intf, NULL);
 	input_free_device(inputdev);
 	kfree(aiptek);
@@ -1909,9 +1909,9 @@ static void aiptek_disconnect(struct usb_interface *intf)
 		input_unregister_device(aiptek->inputdev);
 		sysfs_remove_group(&intf->dev.kobj, &aiptek_attribute_group);
 		usb_free_urb(aiptek->urb);
-		usb_buffer_free(interface_to_usbdev(intf),
-				AIPTEK_PACKET_LENGTH,
-				aiptek->data, aiptek->data_dma);
+		usb_free_coherent(interface_to_usbdev(intf),
+				  AIPTEK_PACKET_LENGTH,
+				  aiptek->data, aiptek->data_dma);
 		kfree(aiptek);
 	}
 }
diff --git a/drivers/input/tablet/gtco.c b/drivers/input/tablet/gtco.c
index 866a9ee..8ea6afe 100644
--- a/drivers/input/tablet/gtco.c
+++ b/drivers/input/tablet/gtco.c
@@ -850,8 +850,8 @@ static int gtco_probe(struct usb_interface *usbinterface,
 	gtco->usbdev = usb_get_dev(interface_to_usbdev(usbinterface));
 
 	/* Allocate some data for incoming reports */
-	gtco->buffer = usb_buffer_alloc(gtco->usbdev, REPORT_MAX_SIZE,
-					GFP_KERNEL, &gtco->buf_dma);
+	gtco->buffer = usb_alloc_coherent(gtco->usbdev, REPORT_MAX_SIZE,
+					  GFP_KERNEL, &gtco->buf_dma);
 	if (!gtco->buffer) {
 		err("No more memory for us buffers");
 		error = -ENOMEM;
@@ -982,8 +982,8 @@ static int gtco_probe(struct usb_interface *usbinterface,
  err_free_urb:
 	usb_free_urb(gtco->urbinfo);
  err_free_buf:
-	usb_buffer_free(gtco->usbdev, REPORT_MAX_SIZE,
-			gtco->buffer, gtco->buf_dma);
+	usb_free_coherent(gtco->usbdev, REPORT_MAX_SIZE,
+			  gtco->buffer, gtco->buf_dma);
  err_free_devs:
 	input_free_device(input_dev);
 	kfree(gtco);
@@ -1005,8 +1005,8 @@ static void gtco_disconnect(struct usb_interface *interface)
 		input_unregister_device(gtco->inputdevice);
 		usb_kill_urb(gtco->urbinfo);
 		usb_free_urb(gtco->urbinfo);
-		usb_buffer_free(gtco->usbdev, REPORT_MAX_SIZE,
-				gtco->buffer, gtco->buf_dma);
+		usb_free_coherent(gtco->usbdev, REPORT_MAX_SIZE,
+				  gtco->buffer, gtco->buf_dma);
 		kfree(gtco);
 	}
 
diff --git a/drivers/input/tablet/kbtab.c b/drivers/input/tablet/kbtab.c
index 6682b17..d31b9c7 100644
--- a/drivers/input/tablet/kbtab.c
+++ b/drivers/input/tablet/kbtab.c
@@ -129,7 +129,7 @@ static int kbtab_probe(struct usb_interface *intf, const struct usb_device_id *i
 	if (!kbtab || !input_dev)
 		goto fail1;
 
-	kbtab->data = usb_buffer_alloc(dev, 8, GFP_KERNEL, &kbtab->data_dma);
+	kbtab->data = usb_alloc_coherent(dev, 8, GFP_KERNEL, &kbtab->data_dma);
 	if (!kbtab->data)
 		goto fail1;
 
@@ -182,7 +182,7 @@ static int kbtab_probe(struct usb_interface *intf, const struct usb_device_id *i
 	return 0;
 
  fail3:	usb_free_urb(kbtab->irq);
- fail2:	usb_buffer_free(dev, 10, kbtab->data, kbtab->data_dma);
+ fail2:	usb_free_coherent(dev, 10, kbtab->data, kbtab->data_dma);
  fail1:	input_free_device(input_dev);
 	kfree(kbtab);
 	return error;
@@ -197,7 +197,7 @@ static void kbtab_disconnect(struct usb_interface *intf)
 		usb_kill_urb(kbtab->irq);
 		input_unregister_device(kbtab->dev);
 		usb_free_urb(kbtab->irq);
-		usb_buffer_free(interface_to_usbdev(intf), 10, kbtab->data, kbtab->data_dma);
+		usb_free_coherent(interface_to_usbdev(intf), 10, kbtab->data, kbtab->data_dma);
 		kfree(kbtab);
 	}
 }
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index 8b5d287..5d5b3c3 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -556,8 +556,8 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
 		goto fail1;
 	}
 
-	wacom_wac->data = usb_buffer_alloc(dev, WACOM_PKGLEN_MAX,
-					   GFP_KERNEL, &wacom->data_dma);
+	wacom_wac->data = usb_alloc_coherent(dev, WACOM_PKGLEN_MAX,
+					     GFP_KERNEL, &wacom->data_dma);
 	if (!wacom_wac->data) {
 		error = -ENOMEM;
 		goto fail1;
@@ -633,7 +633,7 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
 	return 0;
 
  fail3:	usb_free_urb(wacom->irq);
- fail2:	usb_buffer_free(dev, WACOM_PKGLEN_MAX, wacom_wac->data, wacom->data_dma);
+ fail2:	usb_free_coherent(dev, WACOM_PKGLEN_MAX, wacom_wac->data, wacom->data_dma);
  fail1:	input_free_device(input_dev);
 	kfree(wacom);
 	kfree(wacom_wac);
@@ -649,8 +649,8 @@ static void wacom_disconnect(struct usb_interface *intf)
 	usb_kill_urb(wacom->irq);
 	input_unregister_device(wacom->dev);
 	usb_free_urb(wacom->irq);
-	usb_buffer_free(interface_to_usbdev(intf), WACOM_PKGLEN_MAX,
-			wacom->wacom_wac->data, wacom->data_dma);
+	usb_free_coherent(interface_to_usbdev(intf), WACOM_PKGLEN_MAX,
+			  wacom->wacom_wac->data, wacom->data_dma);
 	kfree(wacom->wacom_wac);
 	kfree(wacom);
 }
diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c
index 99330bb..ea41a85 100644
--- a/drivers/input/touchscreen/usbtouchscreen.c
+++ b/drivers/input/touchscreen/usbtouchscreen.c
@@ -1291,8 +1291,8 @@ static void usbtouch_close(struct input_dev *input)
 static void usbtouch_free_buffers(struct usb_device *udev,
 				  struct usbtouch_usb *usbtouch)
 {
-	usb_buffer_free(udev, usbtouch->type->rept_size,
-	                usbtouch->data, usbtouch->data_dma);
+	usb_free_coherent(udev, usbtouch->type->rept_size,
+			  usbtouch->data, usbtouch->data_dma);
 	kfree(usbtouch->buffer);
 }
 
@@ -1336,8 +1336,8 @@ static int usbtouch_probe(struct usb_interface *intf,
 	if (!type->process_pkt)
 		type->process_pkt = usbtouch_process_pkt;
 
-	usbtouch->data = usb_buffer_alloc(udev, type->rept_size,
-	                                  GFP_KERNEL, &usbtouch->data_dma);
+	usbtouch->data = usb_alloc_coherent(udev, type->rept_size,
+					    GFP_KERNEL, &usbtouch->data_dma);
 	if (!usbtouch->data)
 		goto out_free;
 
diff --git a/drivers/media/dvb/dvb-usb/usb-urb.c b/drivers/media/dvb/dvb-usb/usb-urb.c
index f9702e3..86d6893 100644
--- a/drivers/media/dvb/dvb-usb/usb-urb.c
+++ b/drivers/media/dvb/dvb-usb/usb-urb.c
@@ -96,8 +96,9 @@ static int usb_free_stream_buffers(struct usb_data_stream *stream)
 		while (stream->buf_num) {
 			stream->buf_num--;
 			deb_mem("freeing buffer %d\n",stream->buf_num);
-			usb_buffer_free(stream->udev, stream->buf_size,
-					stream->buf_list[stream->buf_num], stream->dma_addr[stream->buf_num]);
+			usb_free_coherent(stream->udev, stream->buf_size,
+					  stream->buf_list[stream->buf_num],
+					  stream->dma_addr[stream->buf_num]);
 		}
 	}
 
@@ -116,7 +117,7 @@ static int usb_allocate_stream_buffers(struct usb_data_stream *stream, int num,
 	for (stream->buf_num = 0; stream->buf_num < num; stream->buf_num++) {
 		deb_mem("allocating buffer %d\n",stream->buf_num);
 		if (( stream->buf_list[stream->buf_num] =
-					usb_buffer_alloc(stream->udev, size, GFP_ATOMIC,
+					usb_alloc_coherent(stream->udev, size, GFP_ATOMIC,
 					&stream->dma_addr[stream->buf_num]) ) == NULL) {
 			deb_mem("not enough memory for urb-buffer allocation.\n");
 			usb_free_stream_buffers(stream);
diff --git a/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/drivers/media/dvb/ttusb-dec/ttusb_dec.c
index 53baccb..fe1b803 100644
--- a/drivers/media/dvb/ttusb-dec/ttusb_dec.c
+++ b/drivers/media/dvb/ttusb-dec/ttusb_dec.c
@@ -1257,7 +1257,7 @@ static int ttusb_dec_init_usb(struct ttusb_dec *dec)
 		if(!dec->irq_urb) {
 			return -ENOMEM;
 		}
-		dec->irq_buffer = usb_buffer_alloc(dec->udev,IRQ_PACKET_SIZE,
+		dec->irq_buffer = usb_alloc_coherent(dec->udev,IRQ_PACKET_SIZE,
 					GFP_ATOMIC, &dec->irq_dma_handle);
 		if(!dec->irq_buffer) {
 			usb_free_urb(dec->irq_urb);
@@ -1550,8 +1550,8 @@ static void ttusb_dec_exit_rc(struct ttusb_dec *dec)
 
 	usb_free_urb(dec->irq_urb);
 
-	usb_buffer_free(dec->udev,IRQ_PACKET_SIZE,
-			   dec->irq_buffer, dec->irq_dma_handle);
+	usb_free_coherent(dec->udev,IRQ_PACKET_SIZE,
+			  dec->irq_buffer, dec->irq_dma_handle);
 
 	if (dec->rc_input_dev) {
 		input_unregister_device(dec->rc_input_dev);
diff --git a/drivers/media/video/au0828/au0828-video.c b/drivers/media/video/au0828/au0828-video.c
index 8c140c0..a2a0f79 100644
--- a/drivers/media/video/au0828/au0828-video.c
+++ b/drivers/media/video/au0828/au0828-video.c
@@ -177,7 +177,7 @@ void au0828_uninit_isoc(struct au0828_dev *dev)
 				usb_unlink_urb(urb);
 
 			if (dev->isoc_ctl.transfer_buffer[i]) {
-				usb_buffer_free(dev->usbdev,
+				usb_free_coherent(dev->usbdev,
 					urb->transfer_buffer_length,
 					dev->isoc_ctl.transfer_buffer[i],
 					urb->transfer_dma);
@@ -247,7 +247,7 @@ int au0828_init_isoc(struct au0828_dev *dev, int max_packets,
 		}
 		dev->isoc_ctl.urb[i] = urb;
 
-		dev->isoc_ctl.transfer_buffer[i] = usb_buffer_alloc(dev->usbdev,
+		dev->isoc_ctl.transfer_buffer[i] = usb_alloc_coherent(dev->usbdev,
 			sb_size, GFP_KERNEL, &urb->transfer_dma);
 		if (!dev->isoc_ctl.transfer_buffer[i]) {
 			printk("unable to allocate %i bytes for transfer"
diff --git a/drivers/media/video/cx231xx/cx231xx-core.c b/drivers/media/video/cx231xx/cx231xx-core.c
index b24eee1..6ccd87d 100644
--- a/drivers/media/video/cx231xx/cx231xx-core.c
+++ b/drivers/media/video/cx231xx/cx231xx-core.c
@@ -679,11 +679,11 @@ void cx231xx_uninit_isoc(struct cx231xx *dev)
 				usb_unlink_urb(urb);
 
 			if (dev->video_mode.isoc_ctl.transfer_buffer[i]) {
-				usb_buffer_free(dev->udev,
-						urb->transfer_buffer_length,
-						dev->video_mode.isoc_ctl.
-						transfer_buffer[i],
-						urb->transfer_dma);
+				usb_free_coherent(dev->udev,
+						  urb->transfer_buffer_length,
+						  dev->video_mode.isoc_ctl.
+						  transfer_buffer[i],
+						  urb->transfer_dma);
 			}
 			usb_free_urb(urb);
 			dev->video_mode.isoc_ctl.urb[i] = NULL;
@@ -770,8 +770,8 @@ int cx231xx_init_isoc(struct cx231xx *dev, int max_packets,
 		dev->video_mode.isoc_ctl.urb[i] = urb;
 
 		dev->video_mode.isoc_ctl.transfer_buffer[i] =
-		    usb_buffer_alloc(dev->udev, sb_size, GFP_KERNEL,
-				     &urb->transfer_dma);
+		    usb_alloc_coherent(dev->udev, sb_size, GFP_KERNEL,
+				       &urb->transfer_dma);
 		if (!dev->video_mode.isoc_ctl.transfer_buffer[i]) {
 			cx231xx_err("unable to allocate %i bytes for transfer"
 				    " buffer %i%s\n",
diff --git a/drivers/media/video/em28xx/em28xx-core.c b/drivers/media/video/em28xx/em28xx-core.c
index a41cc55..d4a9554 100644
--- a/drivers/media/video/em28xx/em28xx-core.c
+++ b/drivers/media/video/em28xx/em28xx-core.c
@@ -966,7 +966,7 @@ void em28xx_uninit_isoc(struct em28xx *dev)
 				usb_unlink_urb(urb);
 
 			if (dev->isoc_ctl.transfer_buffer[i]) {
-				usb_buffer_free(dev->udev,
+				usb_free_coherent(dev->udev,
 					urb->transfer_buffer_length,
 					dev->isoc_ctl.transfer_buffer[i],
 					urb->transfer_dma);
@@ -1041,7 +1041,7 @@ int em28xx_init_isoc(struct em28xx *dev, int max_packets,
 		}
 		dev->isoc_ctl.urb[i] = urb;
 
-		dev->isoc_ctl.transfer_buffer[i] = usb_buffer_alloc(dev->udev,
+		dev->isoc_ctl.transfer_buffer[i] = usb_alloc_coherent(dev->udev,
 			sb_size, GFP_KERNEL, &urb->transfer_dma);
 		if (!dev->isoc_ctl.transfer_buffer[i]) {
 			em28xx_err("unable to allocate %i bytes for transfer"
diff --git a/drivers/media/video/gspca/benq.c b/drivers/media/video/gspca/benq.c
index 43ac4af..fce8d94 100644
--- a/drivers/media/video/gspca/benq.c
+++ b/drivers/media/video/gspca/benq.c
@@ -117,13 +117,13 @@ static int sd_start(struct gspca_dev *gspca_dev)
 			return -ENOMEM;
 		}
 		gspca_dev->urb[n] = urb;
-		urb->transfer_buffer = usb_buffer_alloc(gspca_dev->dev,
+		urb->transfer_buffer = usb_alloc_coherent(gspca_dev->dev,
 						SD_PKT_SZ * SD_NPKT,
 						GFP_KERNEL,
 						&urb->transfer_dma);
 
 		if (urb->transfer_buffer == NULL) {
-			err("usb_buffer_alloc failed");
+			err("usb_alloc_coherent failed");
 			return -ENOMEM;
 		}
 		urb->dev = gspca_dev->dev;
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c
index 222af47..00713f8 100644
--- a/drivers/media/video/gspca/gspca.c
+++ b/drivers/media/video/gspca/gspca.c
@@ -213,7 +213,7 @@ static int alloc_and_submit_int_urb(struct gspca_dev *gspca_dev,
 		goto error;
 	}
 
-	buffer = usb_buffer_alloc(dev, ep->wMaxPacketSize,
+	buffer = usb_alloc_coherent(dev, ep->wMaxPacketSize,
 				GFP_KERNEL, &urb->transfer_dma);
 	if (!buffer) {
 		ret = -ENOMEM;
@@ -232,10 +232,10 @@ static int alloc_and_submit_int_urb(struct gspca_dev *gspca_dev,
 	return ret;
 
 error_submit:
-	usb_buffer_free(dev,
-			urb->transfer_buffer_length,
-			urb->transfer_buffer,
-			urb->transfer_dma);
+	usb_free_coherent(dev,
+			  urb->transfer_buffer_length,
+			  urb->transfer_buffer,
+			  urb->transfer_dma);
 error_buffer:
 	usb_free_urb(urb);
 error:
@@ -272,10 +272,10 @@ static void gspca_input_destroy_urb(struct gspca_dev *gspca_dev)
 	if (urb) {
 		gspca_dev->int_urb = NULL;
 		usb_kill_urb(urb);
-		usb_buffer_free(gspca_dev->dev,
-				urb->transfer_buffer_length,
-				urb->transfer_buffer,
-				urb->transfer_dma);
+		usb_free_coherent(gspca_dev->dev,
+				  urb->transfer_buffer_length,
+				  urb->transfer_buffer,
+				  urb->transfer_dma);
 		usb_free_urb(urb);
 	}
 }
@@ -597,10 +597,10 @@ static void destroy_urbs(struct gspca_dev *gspca_dev)
 		gspca_dev->urb[i] = NULL;
 		usb_kill_urb(urb);
 		if (urb->transfer_buffer != NULL)
-			usb_buffer_free(gspca_dev->dev,
-					urb->transfer_buffer_length,
-					urb->transfer_buffer,
-					urb->transfer_dma);
+			usb_free_coherent(gspca_dev->dev,
+					  urb->transfer_buffer_length,
+					  urb->transfer_buffer,
+					  urb->transfer_dma);
 		usb_free_urb(urb);
 	}
 }
@@ -721,13 +721,13 @@ static int create_urbs(struct gspca_dev *gspca_dev,
 			return -ENOMEM;
 		}
 		gspca_dev->urb[n] = urb;
-		urb->transfer_buffer = usb_buffer_alloc(gspca_dev->dev,
+		urb->transfer_buffer = usb_alloc_coherent(gspca_dev->dev,
 						bsize,
 						GFP_KERNEL,
 						&urb->transfer_dma);
 
 		if (urb->transfer_buffer == NULL) {
-			err("usb_buffer_alloc failed");
+			err("usb_alloc_coherent failed");
 			return -ENOMEM;
 		}
 		urb->dev = gspca_dev->dev;
diff --git a/drivers/media/video/hdpvr/hdpvr-video.c b/drivers/media/video/hdpvr/hdpvr-video.c
index 196f82d..b65efe2 100644
--- a/drivers/media/video/hdpvr/hdpvr-video.c
+++ b/drivers/media/video/hdpvr/hdpvr-video.c
@@ -92,8 +92,8 @@ static int hdpvr_free_queue(struct list_head *q)
 		buf = list_entry(p, struct hdpvr_buffer, buff_list);
 
 		urb = buf->urb;
-		usb_buffer_free(urb->dev, urb->transfer_buffer_length,
-				urb->transfer_buffer, urb->transfer_dma);
+		usb_free_coherent(urb->dev, urb->transfer_buffer_length,
+				  urb->transfer_buffer, urb->transfer_dma);
 		usb_free_urb(urb);
 		tmp = p->next;
 		list_del(p);
@@ -143,8 +143,8 @@ int hdpvr_alloc_buffers(struct hdpvr_device *dev, uint count)
 		}
 		buf->urb = urb;
 
-		mem = usb_buffer_alloc(dev->udev, dev->bulk_in_size, GFP_KERNEL,
-				       &urb->transfer_dma);
+		mem = usb_alloc_coherent(dev->udev, dev->bulk_in_size, GFP_KERNEL,
+					 &urb->transfer_dma);
 		if (!mem) {
 			v4l2_err(&dev->v4l2_dev,
 				 "cannot allocate usb transfer buffer\n");
diff --git a/drivers/media/video/tlg2300/pd-video.c b/drivers/media/video/tlg2300/pd-video.c
index cf8f18c..7bc2906 100644
--- a/drivers/media/video/tlg2300/pd-video.c
+++ b/drivers/media/video/tlg2300/pd-video.c
@@ -476,10 +476,10 @@ static int prepare_iso_urb(struct video_data *video)
 			goto out;
 
 		video->urb_array[i] = urb;
-		mem = usb_buffer_alloc(udev,
-					ISO_PKT_SIZE * PK_PER_URB,
-					GFP_KERNEL,
-					&urb->transfer_dma);
+		mem = usb_alloc_coherent(udev,
+					 ISO_PKT_SIZE * PK_PER_URB,
+					 GFP_KERNEL,
+					 &urb->transfer_dma);
 
 		urb->complete	= urb_complete_iso;	/* handler */
 		urb->dev	= udev;
@@ -519,8 +519,8 @@ int alloc_bulk_urbs_generic(struct urb **urb_array, int num,
 		if (urb == NULL)
 			return i;
 
-		mem = usb_buffer_alloc(udev, buf_size, gfp_flags,
-					&urb->transfer_dma);
+		mem = usb_alloc_coherent(udev, buf_size, gfp_flags,
+					 &urb->transfer_dma);
 		if (mem == NULL)
 			return i;
 
@@ -540,7 +540,7 @@ void free_all_urb_generic(struct urb **urb_array, int num)
 	for (i = 0; i < num; i++) {
 		urb = urb_array[i];
 		if (urb) {
-			usb_buffer_free(urb->dev,
+			usb_free_coherent(urb->dev,
 					urb->transfer_buffer_length,
 					urb->transfer_buffer,
 					urb->transfer_dma);
diff --git a/drivers/media/video/usbvision/usbvision-core.c b/drivers/media/video/usbvision/usbvision-core.c
index f7aae22..b9dd74f 100644
--- a/drivers/media/video/usbvision/usbvision-core.c
+++ b/drivers/media/video/usbvision/usbvision-core.c
@@ -2493,10 +2493,10 @@ int usbvision_init_isoc(struct usb_usbvision *usbvision)
 		}
 		usbvision->sbuf[bufIdx].urb = urb;
 		usbvision->sbuf[bufIdx].data =
-			usb_buffer_alloc(usbvision->dev,
-					 sb_size,
-					 GFP_KERNEL,
-					 &urb->transfer_dma);
+			usb_alloc_coherent(usbvision->dev,
+					   sb_size,
+					   GFP_KERNEL,
+					   &urb->transfer_dma);
 		urb->dev = dev;
 		urb->context = usbvision;
 		urb->pipe = usb_rcvisocpipe(dev, usbvision->video_endp);
@@ -2552,10 +2552,10 @@ void usbvision_stop_isoc(struct usb_usbvision *usbvision)
 	for (bufIdx = 0; bufIdx < USBVISION_NUMSBUF; bufIdx++) {
 		usb_kill_urb(usbvision->sbuf[bufIdx].urb);
 		if (usbvision->sbuf[bufIdx].data){
-			usb_buffer_free(usbvision->dev,
-					sb_size,
-					usbvision->sbuf[bufIdx].data,
-					usbvision->sbuf[bufIdx].urb->transfer_dma);
+			usb_free_coherent(usbvision->dev,
+					  sb_size,
+					  usbvision->sbuf[bufIdx].data,
+					  usbvision->sbuf[bufIdx].urb->transfer_dma);
 		}
 		usb_free_urb(usbvision->sbuf[bufIdx].urb);
 		usbvision->sbuf[bufIdx].urb = NULL;
diff --git a/drivers/media/video/uvc/uvc_video.c b/drivers/media/video/uvc/uvc_video.c
index 821a996..53f3ef4 100644
--- a/drivers/media/video/uvc/uvc_video.c
+++ b/drivers/media/video/uvc/uvc_video.c
@@ -739,7 +739,7 @@ static void uvc_free_urb_buffers(struct uvc_streaming *stream)
 
 	for (i = 0; i < UVC_URBS; ++i) {
 		if (stream->urb_buffer[i]) {
-			usb_buffer_free(stream->dev->udev, stream->urb_size,
+			usb_free_coherent(stream->dev->udev, stream->urb_size,
 				stream->urb_buffer[i], stream->urb_dma[i]);
 			stream->urb_buffer[i] = NULL;
 		}
@@ -780,7 +780,7 @@ static int uvc_alloc_urb_buffers(struct uvc_streaming *stream,
 	for (; npackets > 1; npackets /= 2) {
 		for (i = 0; i < UVC_URBS; ++i) {
 			stream->urb_size = psize * npackets;
-			stream->urb_buffer[i] = usb_buffer_alloc(
+			stream->urb_buffer[i] = usb_alloc_coherent(
 				stream->dev->udev, stream->urb_size,
 				gfp_flags | __GFP_NOWARN, &stream->urb_dma[i]);
 			if (!stream->urb_buffer[i]) {
diff --git a/drivers/net/can/usb/ems_usb.c b/drivers/net/can/usb/ems_usb.c
index 3345109..62be62f 100644
--- a/drivers/net/can/usb/ems_usb.c
+++ b/drivers/net/can/usb/ems_usb.c
@@ -516,8 +516,8 @@ static void ems_usb_write_bulk_callback(struct urb *urb)
 	netdev = dev->netdev;
 
 	/* free up our allocated buffer */
-	usb_buffer_free(urb->dev, urb->transfer_buffer_length,
-			urb->transfer_buffer, urb->transfer_dma);
+	usb_free_coherent(urb->dev, urb->transfer_buffer_length,
+			  urb->transfer_buffer, urb->transfer_dma);
 
 	atomic_dec(&dev->active_tx_urbs);
 
@@ -614,8 +614,8 @@ static int ems_usb_start(struct ems_usb *dev)
 			return -ENOMEM;
 		}
 
-		buf = usb_buffer_alloc(dev->udev, RX_BUFFER_SIZE, GFP_KERNEL,
-				       &urb->transfer_dma);
+		buf = usb_alloc_coherent(dev->udev, RX_BUFFER_SIZE, GFP_KERNEL,
+					 &urb->transfer_dma);
 		if (!buf) {
 			dev_err(netdev->dev.parent,
 				"No memory left for USB buffer\n");
@@ -635,8 +635,8 @@ static int ems_usb_start(struct ems_usb *dev)
 				netif_device_detach(dev->netdev);
 
 			usb_unanchor_urb(urb);
-			usb_buffer_free(dev->udev, RX_BUFFER_SIZE, buf,
-					urb->transfer_dma);
+			usb_free_coherent(dev->udev, RX_BUFFER_SIZE, buf,
+					  urb->transfer_dma);
 			break;
 		}
 
@@ -777,7 +777,7 @@ static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *ne
 		goto nomem;
 	}
 
-	buf = usb_buffer_alloc(dev->udev, size, GFP_ATOMIC, &urb->transfer_dma);
+	buf = usb_alloc_coherent(dev->udev, size, GFP_ATOMIC, &urb->transfer_dma);
 	if (!buf) {
 		dev_err(netdev->dev.parent, "No memory left for USB buffer\n");
 		usb_free_urb(urb);
@@ -820,7 +820,7 @@ static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *ne
 	 */
 	if (!context) {
 		usb_unanchor_urb(urb);
-		usb_buffer_free(dev->udev, size, buf, urb->transfer_dma);
+		usb_free_coherent(dev->udev, size, buf, urb->transfer_dma);
 
 		dev_warn(netdev->dev.parent, "couldn't find free context\n");
 
@@ -845,7 +845,7 @@ static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *ne
 		can_free_echo_skb(netdev, context->echo_index);
 
 		usb_unanchor_urb(urb);
-		usb_buffer_free(dev->udev, size, buf, urb->transfer_dma);
+		usb_free_coherent(dev->udev, size, buf, urb->transfer_dma);
 		dev_kfree_skb(skb);
 
 		atomic_dec(&dev->active_tx_urbs);
diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c
index 52671ea..a790a6d 100644
--- a/drivers/net/usb/kaweth.c
+++ b/drivers/net/usb/kaweth.c
@@ -1155,13 +1155,13 @@ err_fw:
 	if (!kaweth->irq_urb)
 		goto err_tx_and_rx;
 
-	kaweth->intbuffer = usb_buffer_alloc(	kaweth->dev,
+	kaweth->intbuffer = usb_alloc_coherent(	kaweth->dev,
 						INTBUFFERSIZE,
 						GFP_KERNEL,
 						&kaweth->intbufferhandle);
 	if (!kaweth->intbuffer)
 		goto err_tx_and_rx_and_irq;
-	kaweth->rx_buf = usb_buffer_alloc(	kaweth->dev,
+	kaweth->rx_buf = usb_alloc_coherent(	kaweth->dev,
 						KAWETH_BUF_SIZE,
 						GFP_KERNEL,
 						&kaweth->rxbufferhandle);
@@ -1202,9 +1202,9 @@ err_fw:
 
 err_intfdata:
 	usb_set_intfdata(intf, NULL);
-	usb_buffer_free(kaweth->dev, KAWETH_BUF_SIZE, (void *)kaweth->rx_buf, kaweth->rxbufferhandle);
+	usb_free_coherent(kaweth->dev, KAWETH_BUF_SIZE, (void *)kaweth->rx_buf, kaweth->rxbufferhandle);
 err_all_but_rxbuf:
-	usb_buffer_free(kaweth->dev, INTBUFFERSIZE, (void *)kaweth->intbuffer, kaweth->intbufferhandle);
+	usb_free_coherent(kaweth->dev, INTBUFFERSIZE, (void *)kaweth->intbuffer, kaweth->intbufferhandle);
 err_tx_and_rx_and_irq:
 	usb_free_urb(kaweth->irq_urb);
 err_tx_and_rx:
@@ -1241,8 +1241,8 @@ static void kaweth_disconnect(struct usb_interface *intf)
 	usb_free_urb(kaweth->tx_urb);
 	usb_free_urb(kaweth->irq_urb);
 
-	usb_buffer_free(kaweth->dev, KAWETH_BUF_SIZE, (void *)kaweth->rx_buf, kaweth->rxbufferhandle);
-	usb_buffer_free(kaweth->dev, INTBUFFERSIZE, (void *)kaweth->intbuffer, kaweth->intbufferhandle);
+	usb_free_coherent(kaweth->dev, KAWETH_BUF_SIZE, (void *)kaweth->rx_buf, kaweth->rxbufferhandle);
+	usb_free_coherent(kaweth->dev, INTBUFFERSIZE, (void *)kaweth->intbuffer, kaweth->intbufferhandle);
 
 	free_netdev(netdev);
 }
diff --git a/drivers/net/wireless/ath/ar9170/usb.c b/drivers/net/wireless/ath/ar9170/usb.c
index 0b0d2dc..14eda1d 100644
--- a/drivers/net/wireless/ath/ar9170/usb.c
+++ b/drivers/net/wireless/ath/ar9170/usb.c
@@ -200,7 +200,7 @@ resubmit:
 	return;
 
 free:
-	usb_buffer_free(aru->udev, 64, urb->transfer_buffer, urb->transfer_dma);
+	usb_free_coherent(aru->udev, 64, urb->transfer_buffer, urb->transfer_dma);
 }
 
 static void ar9170_usb_rx_completed(struct urb *urb)
@@ -281,7 +281,7 @@ static int ar9170_usb_alloc_rx_irq_urb(struct ar9170_usb *aru)
 	if (!urb)
 		goto out;
 
-	ibuf = usb_buffer_alloc(aru->udev, 64, GFP_KERNEL, &urb->transfer_dma);
+	ibuf = usb_alloc_coherent(aru->udev, 64, GFP_KERNEL, &urb->transfer_dma);
 	if (!ibuf)
 		goto out;
 
@@ -294,8 +294,8 @@ static int ar9170_usb_alloc_rx_irq_urb(struct ar9170_usb *aru)
 	err = usb_submit_urb(urb, GFP_KERNEL);
 	if (err) {
 		usb_unanchor_urb(urb);
-		usb_buffer_free(aru->udev, 64, urb->transfer_buffer,
-				urb->transfer_dma);
+		usb_free_coherent(aru->udev, 64, urb->transfer_buffer,
+				  urb->transfer_dma);
 	}
 
 out:
diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c
index d91ad1a..c257940 100644
--- a/drivers/net/wireless/zd1211rw/zd_usb.c
+++ b/drivers/net/wireless/zd1211rw/zd_usb.c
@@ -664,15 +664,15 @@ static struct urb *alloc_rx_urb(struct zd_usb *usb)
 	urb = usb_alloc_urb(0, GFP_KERNEL);
 	if (!urb)
 		return NULL;
-	buffer = usb_buffer_alloc(udev, USB_MAX_RX_SIZE, GFP_KERNEL,
-		                  &urb->transfer_dma);
+	buffer = usb_alloc_coherent(udev, USB_MAX_RX_SIZE, GFP_KERNEL,
+				    &urb->transfer_dma);
 	if (!buffer) {
 		usb_free_urb(urb);
 		return NULL;
 	}
 
 	usb_fill_bulk_urb(urb, udev, usb_rcvbulkpipe(udev, EP_DATA_IN),
-		          buffer, USB_MAX_RX_SIZE,
+			  buffer, USB_MAX_RX_SIZE,
 			  rx_urb_complete, usb);
 	urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
 
@@ -683,8 +683,8 @@ static void free_rx_urb(struct urb *urb)
 {
 	if (!urb)
 		return;
-	usb_buffer_free(urb->dev, urb->transfer_buffer_length,
-		        urb->transfer_buffer, urb->transfer_dma);
+	usb_free_coherent(urb->dev, urb->transfer_buffer_length,
+			  urb->transfer_buffer, urb->transfer_dma);
 	usb_free_urb(urb);
 }
 
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index be6331e..66713ed 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -892,7 +892,7 @@ static void acm_write_buffers_free(struct acm *acm)
 	struct usb_device *usb_dev = interface_to_usbdev(acm->control);
 
 	for (wb = &acm->wb[0], i = 0; i < ACM_NW; i++, wb++)
-		usb_buffer_free(usb_dev, acm->writesize, wb->buf, wb->dmah);
+		usb_free_coherent(usb_dev, acm->writesize, wb->buf, wb->dmah);
 }
 
 static void acm_read_buffers_free(struct acm *acm)
@@ -901,8 +901,8 @@ static void acm_read_buffers_free(struct acm *acm)
 	int i, n = acm->rx_buflimit;
 
 	for (i = 0; i < n; i++)
-		usb_buffer_free(usb_dev, acm->readsize,
-					acm->rb[i].base, acm->rb[i].dma);
+		usb_free_coherent(usb_dev, acm->readsize,
+				  acm->rb[i].base, acm->rb[i].dma);
 }
 
 /* Little helper: write buffers allocate */
@@ -912,13 +912,13 @@ static int acm_write_buffers_alloc(struct acm *acm)
 	struct acm_wb *wb;
 
 	for (wb = &acm->wb[0], i = 0; i < ACM_NW; i++, wb++) {
-		wb->buf = usb_buffer_alloc(acm->dev, acm->writesize, GFP_KERNEL,
+		wb->buf = usb_alloc_coherent(acm->dev, acm->writesize, GFP_KERNEL,
 		    &wb->dmah);
 		if (!wb->buf) {
 			while (i != 0) {
 				--i;
 				--wb;
-				usb_buffer_free(acm->dev, acm->writesize,
+				usb_free_coherent(acm->dev, acm->writesize,
 				    wb->buf, wb->dmah);
 			}
 			return -ENOMEM;
@@ -1177,7 +1177,7 @@ made_compressed_probe:
 	tty_port_init(&acm->port);
 	acm->port.ops = &acm_port_ops;
 
-	buf = usb_buffer_alloc(usb_dev, ctrlsize, GFP_KERNEL, &acm->ctrl_dma);
+	buf = usb_alloc_coherent(usb_dev, ctrlsize, GFP_KERNEL, &acm->ctrl_dma);
 	if (!buf) {
 		dev_dbg(&intf->dev, "out of memory (ctrl buffer alloc)\n");
 		goto alloc_fail2;
@@ -1210,11 +1210,11 @@ made_compressed_probe:
 	for (i = 0; i < num_rx_buf; i++) {
 		struct acm_rb *rb = &(acm->rb[i]);
 
-		rb->base = usb_buffer_alloc(acm->dev, readsize,
+		rb->base = usb_alloc_coherent(acm->dev, readsize,
 				GFP_KERNEL, &rb->dma);
 		if (!rb->base) {
 			dev_dbg(&intf->dev,
-				"out of memory (read bufs usb_buffer_alloc)\n");
+				"out of memory (read bufs usb_alloc_coherent)\n");
 			goto alloc_fail7;
 		}
 	}
@@ -1306,7 +1306,7 @@ alloc_fail7:
 alloc_fail5:
 	acm_write_buffers_free(acm);
 alloc_fail4:
-	usb_buffer_free(usb_dev, ctrlsize, acm->ctrl_buffer, acm->ctrl_dma);
+	usb_free_coherent(usb_dev, ctrlsize, acm->ctrl_buffer, acm->ctrl_dma);
 alloc_fail2:
 	kfree(acm);
 alloc_fail:
@@ -1356,8 +1356,8 @@ static void acm_disconnect(struct usb_interface *intf)
 	stop_data_traffic(acm);
 
 	acm_write_buffers_free(acm);
-	usb_buffer_free(usb_dev, acm->ctrlsize, acm->ctrl_buffer,
-								acm->ctrl_dma);
+	usb_free_coherent(usb_dev, acm->ctrlsize, acm->ctrl_buffer,
+			  acm->ctrl_dma);
 	acm_read_buffers_free(acm);
 
 	if (!acm->combined_interfaces)
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c
index 189141c..094c76b 100644
--- a/drivers/usb/class/cdc-wdm.c
+++ b/drivers/usb/class/cdc-wdm.c
@@ -276,14 +276,14 @@ static void free_urbs(struct wdm_device *desc)
 
 static void cleanup(struct wdm_device *desc)
 {
-	usb_buffer_free(interface_to_usbdev(desc->intf),
-			desc->wMaxPacketSize,
-			desc->sbuf,
-			desc->validity->transfer_dma);
-	usb_buffer_free(interface_to_usbdev(desc->intf),
-			desc->wMaxCommand,
-			desc->inbuf,
-			desc->response->transfer_dma);
+	usb_free_coherent(interface_to_usbdev(desc->intf),
+			  desc->wMaxPacketSize,
+			  desc->sbuf,
+			  desc->validity->transfer_dma);
+	usb_free_coherent(interface_to_usbdev(desc->intf),
+			  desc->wMaxCommand,
+			  desc->inbuf,
+			  desc->response->transfer_dma);
 	kfree(desc->orq);
 	kfree(desc->irq);
 	kfree(desc->ubuf);
@@ -705,17 +705,17 @@ next_desc:
 	if (!desc->ubuf)
 		goto err;
 
-	desc->sbuf = usb_buffer_alloc(interface_to_usbdev(intf),
+	desc->sbuf = usb_alloc_coherent(interface_to_usbdev(intf),
 					desc->wMaxPacketSize,
 					GFP_KERNEL,
 					&desc->validity->transfer_dma);
 	if (!desc->sbuf)
 		goto err;
 
-	desc->inbuf = usb_buffer_alloc(interface_to_usbdev(intf),
-					desc->bMaxPacketSize0,
-					GFP_KERNEL,
-					&desc->response->transfer_dma);
+	desc->inbuf = usb_alloc_coherent(interface_to_usbdev(intf),
+					 desc->bMaxPacketSize0,
+					 GFP_KERNEL,
+					 &desc->response->transfer_dma);
 	if (!desc->inbuf)
 		goto err2;
 
@@ -742,15 +742,15 @@ out:
 	return rv;
 err3:
 	usb_set_intfdata(intf, NULL);
-	usb_buffer_free(interface_to_usbdev(desc->intf),
-			desc->bMaxPacketSize0,
+	usb_free_coherent(interface_to_usbdev(desc->intf),
+			  desc->bMaxPacketSize0,
 			desc->inbuf,
 			desc->response->transfer_dma);
 err2:
-	usb_buffer_free(interface_to_usbdev(desc->intf),
-			desc->wMaxPacketSize,
-			desc->sbuf,
-			desc->validity->transfer_dma);
+	usb_free_coherent(interface_to_usbdev(desc->intf),
+			  desc->wMaxPacketSize,
+			  desc->sbuf,
+			  desc->validity->transfer_dma);
 err:
 	free_urbs(desc);
 	kfree(desc->ubuf);
diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c
index 93b5f85..2250095 100644
--- a/drivers/usb/class/usblp.c
+++ b/drivers/usb/class/usblp.c
@@ -27,7 +27,7 @@
  *	v0.11 - add proto_bias option (Pete Zaitcev)
  *	v0.12 - add hpoj.sourceforge.net ioctls (David Paschal)
  *	v0.13 - alloc space for statusbuf (<status> not on stack);
- *		use usb_buffer_alloc() for read buf & write buf;
+ *		use usb_alloc_coherent() for read buf & write buf;
  *      none  - Maintained in Linux kernel after v0.13
  */
 
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index 1297e9b..0561430 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -718,7 +718,7 @@ int __usb_get_extra_descriptor(char *buffer, unsigned size,
 EXPORT_SYMBOL_GPL(__usb_get_extra_descriptor);
 
 /**
- * usb_buffer_alloc - allocate dma-consistent buffer for URB_NO_xxx_DMA_MAP
+ * usb_alloc_coherent - allocate dma-consistent buffer for URB_NO_xxx_DMA_MAP
  * @dev: device the buffer will be used with
  * @size: requested buffer size
  * @mem_flags: affect whether allocation may block
@@ -737,30 +737,30 @@ EXPORT_SYMBOL_GPL(__usb_get_extra_descriptor);
  * architectures where CPU caches are not DMA-coherent.  On systems without
  * bus-snooping caches, these buffers are uncached.
  *
- * When the buffer is no longer used, free it with usb_buffer_free().
+ * When the buffer is no longer used, free it with usb_free_coherent().
  */
-void *usb_buffer_alloc(struct usb_device *dev, size_t size, gfp_t mem_flags,
-		       dma_addr_t *dma)
+void *usb_alloc_coherent(struct usb_device *dev, size_t size, gfp_t mem_flags,
+			 dma_addr_t *dma)
 {
 	if (!dev || !dev->bus)
 		return NULL;
 	return hcd_buffer_alloc(dev->bus, size, mem_flags, dma);
 }
-EXPORT_SYMBOL_GPL(usb_buffer_alloc);
+EXPORT_SYMBOL_GPL(usb_alloc_coherent);
 
 /**
- * usb_buffer_free - free memory allocated with usb_buffer_alloc()
+ * usb_free_coherent - free memory allocated with usb_alloc_coherent()
  * @dev: device the buffer was used with
  * @size: requested buffer size
  * @addr: CPU address of buffer
  * @dma: DMA address of buffer
  *
  * This reclaims an I/O buffer, letting it be reused.  The memory must have
- * been allocated using usb_buffer_alloc(), and the parameters must match
+ * been allocated using usb_alloc_coherent(), and the parameters must match
  * those provided in that allocation request.
  */
-void usb_buffer_free(struct usb_device *dev, size_t size, void *addr,
-		     dma_addr_t dma)
+void usb_free_coherent(struct usb_device *dev, size_t size, void *addr,
+		       dma_addr_t dma)
 {
 	if (!dev || !dev->bus)
 		return;
@@ -768,7 +768,7 @@ void usb_buffer_free(struct usb_device *dev, size_t size, void *addr,
 		return;
 	hcd_buffer_free(dev->bus, size, addr, dma);
 }
-EXPORT_SYMBOL_GPL(usb_buffer_free);
+EXPORT_SYMBOL_GPL(usb_free_coherent);
 
 /**
  * usb_buffer_map - create DMA mapping(s) for an urb
diff --git a/drivers/usb/misc/appledisplay.c b/drivers/usb/misc/appledisplay.c
index 094f91c..1fa6ce3 100644
--- a/drivers/usb/misc/appledisplay.c
+++ b/drivers/usb/misc/appledisplay.c
@@ -259,7 +259,7 @@ static int appledisplay_probe(struct usb_interface *iface,
 	}
 
 	/* Allocate buffer for interrupt data */
-	pdata->urbdata = usb_buffer_alloc(pdata->udev, ACD_URB_BUFFER_LEN,
+	pdata->urbdata = usb_alloc_coherent(pdata->udev, ACD_URB_BUFFER_LEN,
 		GFP_KERNEL, &pdata->urb->transfer_dma);
 	if (!pdata->urbdata) {
 		retval = -ENOMEM;
@@ -316,7 +316,7 @@ error:
 		if (pdata->urb) {
 			usb_kill_urb(pdata->urb);
 			if (pdata->urbdata)
-				usb_buffer_free(pdata->udev, ACD_URB_BUFFER_LEN,
+				usb_free_coherent(pdata->udev, ACD_URB_BUFFER_LEN,
 					pdata->urbdata, pdata->urb->transfer_dma);
 			usb_free_urb(pdata->urb);
 		}
@@ -337,7 +337,7 @@ static void appledisplay_disconnect(struct usb_interface *iface)
 		usb_kill_urb(pdata->urb);
 		cancel_delayed_work(&pdata->work);
 		backlight_device_unregister(pdata->bd);
-		usb_buffer_free(pdata->udev, ACD_URB_BUFFER_LEN,
+		usb_free_coherent(pdata->udev, ACD_URB_BUFFER_LEN,
 			pdata->urbdata, pdata->urb->transfer_dma);
 		usb_free_urb(pdata->urb);
 		kfree(pdata->msgdata);
diff --git a/drivers/usb/misc/ftdi-elan.c b/drivers/usb/misc/ftdi-elan.c
index 1edb6d3..a9e0546 100644
--- a/drivers/usb/misc/ftdi-elan.c
+++ b/drivers/usb/misc/ftdi-elan.c
@@ -734,7 +734,7 @@ static void ftdi_elan_write_bulk_callback(struct urb *urb)
                 dev_err(&ftdi->udev->dev, "urb=%p write bulk status received: %"
                         "d\n", urb, status);
         }
-        usb_buffer_free(urb->dev, urb->transfer_buffer_length,
+        usb_free_coherent(urb->dev, urb->transfer_buffer_length,
                 urb->transfer_buffer, urb->transfer_dma);
 }
 
@@ -795,7 +795,7 @@ static int ftdi_elan_command_engine(struct usb_ftdi *ftdi)
                         total_size);
                 return -ENOMEM;
         }
-        buf = usb_buffer_alloc(ftdi->udev, total_size, GFP_KERNEL,
+        buf = usb_alloc_coherent(ftdi->udev, total_size, GFP_KERNEL,
                 &urb->transfer_dma);
         if (!buf) {
                 dev_err(&ftdi->udev->dev, "could not get a buffer to write %d c"
@@ -829,7 +829,7 @@ static int ftdi_elan_command_engine(struct usb_ftdi *ftdi)
                 dev_err(&ftdi->udev->dev, "failed %d to submit urb %p to write "
                         "%d commands totaling %d bytes to the Uxxx\n", retval,
                         urb, command_size, total_size);
-                usb_buffer_free(ftdi->udev, total_size, buf, urb->transfer_dma);
+                usb_free_coherent(ftdi->udev, total_size, buf, urb->transfer_dma);
                 usb_free_urb(urb);
                 return retval;
         }
@@ -1167,7 +1167,7 @@ static ssize_t ftdi_elan_write(struct file *file,
                 retval = -ENOMEM;
                 goto error_1;
         }
-        buf = usb_buffer_alloc(ftdi->udev, count, GFP_KERNEL,
+        buf = usb_alloc_coherent(ftdi->udev, count, GFP_KERNEL,
                 &urb->transfer_dma);
         if (!buf) {
                 retval = -ENOMEM;
@@ -1192,7 +1192,7 @@ static ssize_t ftdi_elan_write(struct file *file,
 exit:
         return count;
 error_3:
-	usb_buffer_free(ftdi->udev, count, buf, urb->transfer_dma);
+	usb_free_coherent(ftdi->udev, count, buf, urb->transfer_dma);
 error_2:
 	usb_free_urb(urb);
 error_1:
@@ -1968,7 +1968,7 @@ static int ftdi_elan_synchronize_flush(struct usb_ftdi *ftdi)
                         "ence\n");
                 return -ENOMEM;
         }
-        buf = usb_buffer_alloc(ftdi->udev, I, GFP_KERNEL, &urb->transfer_dma);
+        buf = usb_alloc_coherent(ftdi->udev, I, GFP_KERNEL, &urb->transfer_dma);
         if (!buf) {
                 dev_err(&ftdi->udev->dev, "could not get a buffer for flush seq"
                         "uence\n");
@@ -1985,7 +1985,7 @@ static int ftdi_elan_synchronize_flush(struct usb_ftdi *ftdi)
         if (retval) {
                 dev_err(&ftdi->udev->dev, "failed to submit urb containing the "
                         "flush sequence\n");
-                usb_buffer_free(ftdi->udev, i, buf, urb->transfer_dma);
+                usb_free_coherent(ftdi->udev, i, buf, urb->transfer_dma);
                 usb_free_urb(urb);
                 return -ENOMEM;
         }
@@ -2011,7 +2011,7 @@ static int ftdi_elan_synchronize_reset(struct usb_ftdi *ftdi)
                         "quence\n");
                 return -ENOMEM;
         }
-        buf = usb_buffer_alloc(ftdi->udev, I, GFP_KERNEL, &urb->transfer_dma);
+        buf = usb_alloc_coherent(ftdi->udev, I, GFP_KERNEL, &urb->transfer_dma);
         if (!buf) {
                 dev_err(&ftdi->udev->dev, "could not get a buffer for the reset"
                         " sequence\n");
@@ -2030,7 +2030,7 @@ static int ftdi_elan_synchronize_reset(struct usb_ftdi *ftdi)
         if (retval) {
                 dev_err(&ftdi->udev->dev, "failed to submit urb containing the "
                         "reset sequence\n");
-                usb_buffer_free(ftdi->udev, i, buf, urb->transfer_dma);
+                usb_free_coherent(ftdi->udev, i, buf, urb->transfer_dma);
                 usb_free_urb(urb);
                 return -ENOMEM;
         }
diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c
index d3c8523..7dc9d3c 100644
--- a/drivers/usb/misc/iowarrior.c
+++ b/drivers/usb/misc/iowarrior.c
@@ -239,8 +239,8 @@ static void iowarrior_write_callback(struct urb *urb)
 		    __func__, status);
 	}
 	/* free up our allocated buffer */
-	usb_buffer_free(urb->dev, urb->transfer_buffer_length,
-			urb->transfer_buffer, urb->transfer_dma);
+	usb_free_coherent(urb->dev, urb->transfer_buffer_length,
+			  urb->transfer_buffer, urb->transfer_dma);
 	/* tell a waiting writer the interrupt-out-pipe is available again */
 	atomic_dec(&dev->write_busy);
 	wake_up_interruptible(&dev->write_wait);
@@ -421,8 +421,8 @@ static ssize_t iowarrior_write(struct file *file,
 			dbg("%s Unable to allocate urb ", __func__);
 			goto error_no_urb;
 		}
-		buf = usb_buffer_alloc(dev->udev, dev->report_size,
-				       GFP_KERNEL, &int_out_urb->transfer_dma);
+		buf = usb_alloc_coherent(dev->udev, dev->report_size,
+					 GFP_KERNEL, &int_out_urb->transfer_dma);
 		if (!buf) {
 			retval = -ENOMEM;
 			dbg("%s Unable to allocate buffer ", __func__);
@@ -459,8 +459,8 @@ static ssize_t iowarrior_write(struct file *file,
 		break;
 	}
 error:
-	usb_buffer_free(dev->udev, dev->report_size, buf,
-			int_out_urb->transfer_dma);
+	usb_free_coherent(dev->udev, dev->report_size, buf,
+			  int_out_urb->transfer_dma);
 error_no_buffer:
 	usb_free_urb(int_out_urb);
 error_no_urb:
diff --git a/drivers/usb/misc/usblcd.c b/drivers/usb/misc/usblcd.c
index 90aede9..7828c76 100644
--- a/drivers/usb/misc/usblcd.c
+++ b/drivers/usb/misc/usblcd.c
@@ -205,8 +205,8 @@ static void lcd_write_bulk_callback(struct urb *urb)
 	}
 
 	/* free up our allocated buffer */
-	usb_buffer_free(urb->dev, urb->transfer_buffer_length,
-			urb->transfer_buffer, urb->transfer_dma);
+	usb_free_coherent(urb->dev, urb->transfer_buffer_length,
+			  urb->transfer_buffer, urb->transfer_dma);
 	up(&dev->limit_sem);
 }
 
@@ -234,7 +234,7 @@ static ssize_t lcd_write(struct file *file, const char __user * user_buffer, siz
 		goto err_no_buf;
 	}
 	
-	buf = usb_buffer_alloc(dev->udev, count, GFP_KERNEL, &urb->transfer_dma);
+	buf = usb_alloc_coherent(dev->udev, count, GFP_KERNEL, &urb->transfer_dma);
 	if (!buf) {
 		retval = -ENOMEM;
 		goto error;
@@ -268,7 +268,7 @@ exit:
 error_unanchor:
 	usb_unanchor_urb(urb);
 error:
-	usb_buffer_free(dev->udev, count, buf, urb->transfer_dma);
+	usb_free_coherent(dev->udev, count, buf, urb->transfer_dma);
 	usb_free_urb(urb);
 err_no_buf:
 	up(&dev->limit_sem);
diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c
index a21cce6..9ecde8c 100644
--- a/drivers/usb/misc/usbtest.c
+++ b/drivers/usb/misc/usbtest.c
@@ -202,7 +202,7 @@ static struct urb *simple_alloc_urb (
 	urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP;
 	if (usb_pipein (pipe))
 		urb->transfer_flags |= URB_SHORT_NOT_OK;
-	urb->transfer_buffer = usb_buffer_alloc (udev, bytes, GFP_KERNEL,
+	urb->transfer_buffer = usb_alloc_coherent (udev, bytes, GFP_KERNEL,
 			&urb->transfer_dma);
 	if (!urb->transfer_buffer) {
 		usb_free_urb (urb);
@@ -272,8 +272,8 @@ static inline int simple_check_buf(struct usbtest_dev *tdev, struct urb *urb)
 
 static void simple_free_urb (struct urb *urb)
 {
-	usb_buffer_free (urb->dev, urb->transfer_buffer_length,
-			urb->transfer_buffer, urb->transfer_dma);
+	usb_free_coherent(urb->dev, urb->transfer_buffer_length,
+			  urb->transfer_buffer, urb->transfer_dma);
 	usb_free_urb (urb);
 }
 
@@ -977,7 +977,7 @@ test_ctrl_queue (struct usbtest_dev *dev, struct usbtest_param *param)
 		if (!u)
 			goto cleanup;
 
-		reqp = usb_buffer_alloc (udev, sizeof *reqp, GFP_KERNEL,
+		reqp = usb_alloc_coherent (udev, sizeof *reqp, GFP_KERNEL,
 				&u->setup_dma);
 		if (!reqp)
 			goto cleanup;
@@ -1018,9 +1018,9 @@ cleanup:
 			continue;
 		urb [i]->dev = udev;
 		if (urb [i]->setup_packet)
-			usb_buffer_free (udev, sizeof (struct usb_ctrlrequest),
-					urb [i]->setup_packet,
-					urb [i]->setup_dma);
+			usb_free_coherent (udev, sizeof (struct usb_ctrlrequest),
+					   urb [i]->setup_packet,
+					   urb [i]->setup_dma);
 		simple_free_urb (urb [i]);
 	}
 	kfree (urb);
@@ -1421,7 +1421,7 @@ static struct urb *iso_alloc_urb (
 
 	urb->number_of_packets = packets;
 	urb->transfer_buffer_length = bytes;
-	urb->transfer_buffer = usb_buffer_alloc (udev, bytes, GFP_KERNEL,
+	urb->transfer_buffer = usb_alloc_coherent (udev, bytes, GFP_KERNEL,
 			&urb->transfer_dma);
 	if (!urb->transfer_buffer) {
 		usb_free_urb (urb);
diff --git a/drivers/usb/storage/onetouch.c b/drivers/usb/storage/onetouch.c
index 198bb3e..1943be5 100644
--- a/drivers/usb/storage/onetouch.c
+++ b/drivers/usb/storage/onetouch.c
@@ -201,8 +201,8 @@ static int onetouch_connect_input(struct us_data *ss)
 	if (!onetouch || !input_dev)
 		goto fail1;
 
-	onetouch->data = usb_buffer_alloc(udev, ONETOUCH_PKT_LEN,
-					  GFP_KERNEL, &onetouch->data_dma);
+	onetouch->data = usb_alloc_coherent(udev, ONETOUCH_PKT_LEN,
+					    GFP_KERNEL, &onetouch->data_dma);
 	if (!onetouch->data)
 		goto fail1;
 
@@ -264,8 +264,8 @@ static int onetouch_connect_input(struct us_data *ss)
 	return 0;
 
  fail3:	usb_free_urb(onetouch->irq);
- fail2:	usb_buffer_free(udev, ONETOUCH_PKT_LEN,
-			onetouch->data, onetouch->data_dma);
+ fail2:	usb_free_coherent(udev, ONETOUCH_PKT_LEN,
+			  onetouch->data, onetouch->data_dma);
  fail1:	kfree(onetouch);
 	input_free_device(input_dev);
 	return error;
@@ -279,8 +279,8 @@ static void onetouch_release_input(void *onetouch_)
 		usb_kill_urb(onetouch->irq);
 		input_unregister_device(onetouch->dev);
 		usb_free_urb(onetouch->irq);
-		usb_buffer_free(onetouch->udev, ONETOUCH_PKT_LEN,
-				onetouch->data, onetouch->data_dma);
+		usb_free_coherent(onetouch->udev, ONETOUCH_PKT_LEN,
+				  onetouch->data, onetouch->data_dma);
 	}
 }
 
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
index bbeeb92..ef00584 100644
--- a/drivers/usb/storage/usb.c
+++ b/drivers/usb/storage/usb.c
@@ -408,14 +408,14 @@ static int associate_dev(struct us_data *us, struct usb_interface *intf)
 	usb_set_intfdata(intf, us);
 
 	/* Allocate the device-related DMA-mapped buffers */
-	us->cr = usb_buffer_alloc(us->pusb_dev, sizeof(*us->cr),
+	us->cr = usb_alloc_coherent(us->pusb_dev, sizeof(*us->cr),
 			GFP_KERNEL, &us->cr_dma);
 	if (!us->cr) {
 		US_DEBUGP("usb_ctrlrequest allocation failed\n");
 		return -ENOMEM;
 	}
 
-	us->iobuf = usb_buffer_alloc(us->pusb_dev, US_IOBUF_SIZE,
+	us->iobuf = usb_alloc_coherent(us->pusb_dev, US_IOBUF_SIZE,
 			GFP_KERNEL, &us->iobuf_dma);
 	if (!us->iobuf) {
 		US_DEBUGP("I/O buffer allocation failed\n");
@@ -759,11 +759,11 @@ static void dissociate_dev(struct us_data *us)
 
 	/* Free the device-related DMA-mapped buffers */
 	if (us->cr)
-		usb_buffer_free(us->pusb_dev, sizeof(*us->cr), us->cr,
-				us->cr_dma);
+		usb_free_coherent(us->pusb_dev, sizeof(*us->cr), us->cr,
+				  us->cr_dma);
 	if (us->iobuf)
-		usb_buffer_free(us->pusb_dev, US_IOBUF_SIZE, us->iobuf,
-				us->iobuf_dma);
+		usb_free_coherent(us->pusb_dev, US_IOBUF_SIZE, us->iobuf,
+				  us->iobuf_dma);
 
 	/* Remove our private data from the interface */
 	usb_set_intfdata(us->pusb_intf, NULL);
diff --git a/drivers/usb/usb-skeleton.c b/drivers/usb/usb-skeleton.c
index 6152278..d110588 100644
--- a/drivers/usb/usb-skeleton.c
+++ b/drivers/usb/usb-skeleton.c
@@ -387,8 +387,8 @@ static void skel_write_bulk_callback(struct urb *urb)
 	}
 
 	/* free up our allocated buffer */
-	usb_buffer_free(urb->dev, urb->transfer_buffer_length,
-			urb->transfer_buffer, urb->transfer_dma);
+	usb_free_coherent(urb->dev, urb->transfer_buffer_length,
+			  urb->transfer_buffer, urb->transfer_dma);
 	up(&dev->limit_sem);
 }
 
@@ -442,8 +442,8 @@ static ssize_t skel_write(struct file *file, const char *user_buffer,
 		goto error;
 	}
 
-	buf = usb_buffer_alloc(dev->udev, writesize, GFP_KERNEL,
-			       &urb->transfer_dma);
+	buf = usb_alloc_coherent(dev->udev, writesize, GFP_KERNEL,
+				 &urb->transfer_dma);
 	if (!buf) {
 		retval = -ENOMEM;
 		goto error;
@@ -491,7 +491,7 @@ error_unanchor:
 	usb_unanchor_urb(urb);
 error:
 	if (urb) {
-		usb_buffer_free(dev->udev, writesize, buf, urb->transfer_dma);
+		usb_free_coherent(dev->udev, writesize, buf, urb->transfer_dma);
 		usb_free_urb(urb);
 	}
 	up(&dev->limit_sem);
diff --git a/drivers/watchdog/pcwd_usb.c b/drivers/watchdog/pcwd_usb.c
index 8e4eacc..748a74b 100644
--- a/drivers/watchdog/pcwd_usb.c
+++ b/drivers/watchdog/pcwd_usb.c
@@ -600,8 +600,8 @@ static inline void usb_pcwd_delete(struct usb_pcwd_private *usb_pcwd)
 {
 	usb_free_urb(usb_pcwd->intr_urb);
 	if (usb_pcwd->intr_buffer != NULL)
-		usb_buffer_free(usb_pcwd->udev, usb_pcwd->intr_size,
-				usb_pcwd->intr_buffer, usb_pcwd->intr_dma);
+		usb_free_coherent(usb_pcwd->udev, usb_pcwd->intr_size,
+				  usb_pcwd->intr_buffer, usb_pcwd->intr_dma);
 	kfree(usb_pcwd);
 }
 
@@ -671,7 +671,7 @@ static int usb_pcwd_probe(struct usb_interface *interface,
 				le16_to_cpu(endpoint->wMaxPacketSize) : 8);
 
 	/* set up the memory buffer's */
-	usb_pcwd->intr_buffer = usb_buffer_alloc(udev, usb_pcwd->intr_size,
+	usb_pcwd->intr_buffer = usb_alloc_coherent(udev, usb_pcwd->intr_size,
 					GFP_ATOMIC, &usb_pcwd->intr_dma);
 	if (!usb_pcwd->intr_buffer) {
 		printk(KERN_ERR PFX "Out of memory\n");
diff --git a/include/linux/usb.h b/include/linux/usb.h
index ce1323c..4f485d0 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -1085,7 +1085,7 @@ typedef void (*usb_complete_t)(struct urb *);
  * Alternatively, drivers may pass the URB_NO_xxx_DMA_MAP transfer flags,
  * which tell the host controller driver that no such mapping is needed since
  * the device driver is DMA-aware.  For example, a device driver might
- * allocate a DMA buffer with usb_buffer_alloc() or call usb_buffer_map().
+ * allocate a DMA buffer with usb_alloc_coherent() or call usb_buffer_map().
  * When these transfer flags are provided, host controller drivers will
  * attempt to use the dma addresses found in the transfer_dma and/or
  * setup_dma fields rather than determining a dma address themselves.
@@ -1366,9 +1366,9 @@ static inline int usb_urb_dir_out(struct urb *urb)
 	return (urb->transfer_flags & URB_DIR_MASK) == URB_DIR_OUT;
 }
 
-void *usb_buffer_alloc(struct usb_device *dev, size_t size,
+void *usb_alloc_coherent(struct usb_device *dev, size_t size,
 	gfp_t mem_flags, dma_addr_t *dma);
-void usb_buffer_free(struct usb_device *dev, size_t size,
+void usb_free_coherent(struct usb_device *dev, size_t size,
 	void *addr, dma_addr_t dma);
 
 #if 0
diff --git a/sound/usb/midi.c b/sound/usb/midi.c
index c6ee4a1..00f7d8e 100644
--- a/sound/usb/midi.c
+++ b/sound/usb/midi.c
@@ -1046,8 +1046,8 @@ static struct snd_rawmidi_ops snd_usbmidi_input_ops = {
 static void free_urb_and_buffer(struct snd_usb_midi *umidi, struct urb *urb,
 				unsigned int buffer_length)
 {
-	usb_buffer_free(umidi->dev, buffer_length,
-			urb->transfer_buffer, urb->transfer_dma);
+	usb_free_coherent(umidi->dev, buffer_length,
+			  urb->transfer_buffer, urb->transfer_dma);
 	usb_free_urb(urb);
 }
 
@@ -1098,8 +1098,8 @@ static int snd_usbmidi_in_endpoint_create(struct snd_usb_midi* umidi,
 		pipe = usb_rcvbulkpipe(umidi->dev, ep_info->in_ep);
 	length = usb_maxpacket(umidi->dev, pipe, 0);
 	for (i = 0; i < INPUT_URBS; ++i) {
-		buffer = usb_buffer_alloc(umidi->dev, length, GFP_KERNEL,
-					  &ep->urbs[i]->transfer_dma);
+		buffer = usb_alloc_coherent(umidi->dev, length, GFP_KERNEL,
+					    &ep->urbs[i]->transfer_dma);
 		if (!buffer) {
 			snd_usbmidi_in_endpoint_delete(ep);
 			return -ENOMEM;
@@ -1182,9 +1182,9 @@ static int snd_usbmidi_out_endpoint_create(struct snd_usb_midi* umidi,
 		break;
 	}
 	for (i = 0; i < OUTPUT_URBS; ++i) {
-		buffer = usb_buffer_alloc(umidi->dev,
-					  ep->max_transfer, GFP_KERNEL,
-					  &ep->urbs[i].urb->transfer_dma);
+		buffer = usb_alloc_coherent(umidi->dev,
+					    ep->max_transfer, GFP_KERNEL,
+					    &ep->urbs[i].urb->transfer_dma);
 		if (!buffer) {
 			snd_usbmidi_out_endpoint_delete(ep);
 			return -ENOMEM;
diff --git a/sound/usb/misc/ua101.c b/sound/usb/misc/ua101.c
index 796d8b2..fb5d68f 100644
--- a/sound/usb/misc/ua101.c
+++ b/sound/usb/misc/ua101.c
@@ -42,7 +42,7 @@ MODULE_SUPPORTED_DEVICE("{{Edirol,UA-101},{Edirol,UA-1000}}");
 /*
  * This magic value optimizes memory usage efficiency for the UA-101's packet
  * sizes at all sample rates, taking into account the stupid cache pool sizes
- * that usb_buffer_alloc() uses.
+ * that usb_alloc_coherent() uses.
  */
 #define DEFAULT_QUEUE_LENGTH	21
 
@@ -1057,7 +1057,7 @@ static int alloc_stream_buffers(struct ua101 *ua, struct ua101_stream *stream)
 				   (unsigned int)MAX_QUEUE_LENGTH);
 
 	/*
-	 * The cache pool sizes used by usb_buffer_alloc() (128, 512, 2048) are
+	 * The cache pool sizes used by usb_alloc_coherent() (128, 512, 2048) are
 	 * quite bad when used with the packet sizes of this device (e.g. 280,
 	 * 520, 624).  Therefore, we allocate and subdivide entire pages, using
 	 * a smaller buffer only for the last chunk.
@@ -1068,8 +1068,8 @@ static int alloc_stream_buffers(struct ua101 *ua, struct ua101_stream *stream)
 		packets = min(remaining_packets, packets_per_page);
 		size = packets * stream->max_packet_bytes;
 		stream->buffers[i].addr =
-			usb_buffer_alloc(ua->dev, size, GFP_KERNEL,
-					 &stream->buffers[i].dma);
+			usb_alloc_coherent(ua->dev, size, GFP_KERNEL,
+					   &stream->buffers[i].dma);
 		if (!stream->buffers[i].addr)
 			return -ENOMEM;
 		stream->buffers[i].size = size;
@@ -1089,10 +1089,10 @@ static void free_stream_buffers(struct ua101 *ua, struct ua101_stream *stream)
 	unsigned int i;
 
 	for (i = 0; i < ARRAY_SIZE(stream->buffers); ++i)
-		usb_buffer_free(ua->dev,
-				stream->buffers[i].size,
-				stream->buffers[i].addr,
-				stream->buffers[i].dma);
+		usb_free_coherent(ua->dev,
+				  stream->buffers[i].size,
+				  stream->buffers[i].addr,
+				  stream->buffers[i].dma);
 }
 
 static int alloc_stream_urbs(struct ua101 *ua, struct ua101_stream *stream,
diff --git a/sound/usb/urb.c b/sound/usb/urb.c
index 5570a2b..8c7b3e5 100644
--- a/sound/usb/urb.c
+++ b/sound/usb/urb.c
@@ -101,9 +101,9 @@ static void release_urb_ctx(struct snd_urb_ctx *u)
 {
 	if (u->urb) {
 		if (u->buffer_size)
-			usb_buffer_free(u->subs->dev, u->buffer_size,
-					u->urb->transfer_buffer,
-					u->urb->transfer_dma);
+			usb_free_coherent(u->subs->dev, u->buffer_size,
+					  u->urb->transfer_buffer,
+					  u->urb->transfer_dma);
 		usb_free_urb(u->urb);
 		u->urb = NULL;
 	}
@@ -154,8 +154,8 @@ void snd_usb_release_substream_urbs(struct snd_usb_substream *subs, int force)
 		release_urb_ctx(&subs->dataurb[i]);
 	for (i = 0; i < SYNC_URBS; i++)
 		release_urb_ctx(&subs->syncurb[i]);
-	usb_buffer_free(subs->dev, SYNC_URBS * 4,
-			subs->syncbuf, subs->sync_dma);
+	usb_free_coherent(subs->dev, SYNC_URBS * 4,
+			  subs->syncbuf, subs->sync_dma);
 	subs->syncbuf = NULL;
 	subs->nurbs = 0;
 }
@@ -308,8 +308,8 @@ int snd_usb_init_substream_urbs(struct snd_usb_substream *subs,
 		if (!u->urb)
 			goto out_of_memory;
 		u->urb->transfer_buffer =
-			usb_buffer_alloc(subs->dev, u->buffer_size, GFP_KERNEL,
-					 &u->urb->transfer_dma);
+			usb_alloc_coherent(subs->dev, u->buffer_size, GFP_KERNEL,
+					   &u->urb->transfer_dma);
 		if (!u->urb->transfer_buffer)
 			goto out_of_memory;
 		u->urb->pipe = subs->datapipe;
@@ -321,8 +321,8 @@ int snd_usb_init_substream_urbs(struct snd_usb_substream *subs,
 
 	if (subs->syncpipe) {
 		/* allocate and initialize sync urbs */
-		subs->syncbuf = usb_buffer_alloc(subs->dev, SYNC_URBS * 4,
-						 GFP_KERNEL, &subs->sync_dma);
+		subs->syncbuf = usb_alloc_coherent(subs->dev, SYNC_URBS * 4,
+						   GFP_KERNEL, &subs->sync_dma);
 		if (!subs->syncbuf)
 			goto out_of_memory;
 		for (i = 0; i < SYNC_URBS; i++) {
-- 
1.6.6.1

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-12 11:53         ` Andi Kleen
  0 siblings, 0 replies; 221+ messages in thread
From: Andi Kleen @ 2010-04-12 11:53 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Andi Kleen, Alan Stern, linux-kernel, Pedro Ribeiro, akpm,
	Greg KH, alsa-devel, linux-usb

> Which is exactly what usb_buffer_alloc() does already. So at least for
> x86 you say this is the right thing to do? However, we don't necessarily
> need coherent memory on other platforms, which is why I hessitate to
> enforce that type of memory for all transfer_buffer allocations.

Yes today it's faster at least.

Probably we should have better interfaces for this, but we don't.

> 
> > Or just use GFP_KERNEL and pci_map_* later.
> 
> The USB core does this already, but at least on Pedro's machine, this
> seems unsufficient. Unfortunately, I can't reproduce the issue yet, even
> with more than 4GB of RAM installed.

Then something must be broken in Pedro's system and likely other drivers
will also not work. I don't think it should be worked around in the USB layer.

-Andi
-- 
ak@linux.intel.com -- Speaking for myself only.

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-12 11:53         ` Andi Kleen
  0 siblings, 0 replies; 221+ messages in thread
From: Andi Kleen @ 2010-04-12 11:53 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Andi Kleen, Alan Stern, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	Pedro Ribeiro, akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b, Greg KH,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-usb-u79uwXL29TY76Z2rM5mHXA

> Which is exactly what usb_buffer_alloc() does already. So at least for
> x86 you say this is the right thing to do? However, we don't necessarily
> need coherent memory on other platforms, which is why I hessitate to
> enforce that type of memory for all transfer_buffer allocations.

Yes today it's faster at least.

Probably we should have better interfaces for this, but we don't.

> 
> > Or just use GFP_KERNEL and pci_map_* later.
> 
> The USB core does this already, but at least on Pedro's machine, this
> seems unsufficient. Unfortunately, I can't reproduce the issue yet, even
> with more than 4GB of RAM installed.

Then something must be broken in Pedro's system and likely other drivers
will also not work. I don't think it should be worked around in the USB layer.

-Andi
-- 
ak-VuQAYsv1563Yd54FQh9/CA@public.gmane.org -- Speaking for myself only.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [LKML] Re: USB transfer_buffer allocations on 64bit systems
  2010-04-12 10:48                             ` Daniel Mack
  (?)
@ 2010-04-12 12:06                             ` Pedro Ribeiro
  -1 siblings, 0 replies; 221+ messages in thread
From: Pedro Ribeiro @ 2010-04-12 12:06 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Robert Hancock, Alan Stern, Konrad Rzeszutek Wilk, linux-kernel,
	akpm, Greg KH, alsa-devel, linux-usb

[-- Attachment #1: Type: text/plain, Size: 1589 bytes --]

On 12 April 2010 11:48, Daniel Mack <daniel@caiaq.de> wrote:
> On Fri, Apr 09, 2010 at 04:11:52PM -0600, Robert Hancock wrote:
>> On Fri, Apr 9, 2010 at 3:23 PM, Alan Stern <stern@rowland.harvard.edu> wrote:
>> > On Fri, 9 Apr 2010, Konrad Rzeszutek Wilk wrote:
>> >
>> >> On Fri, Apr 09, 2010 at 03:34:06PM -0400, Alan Stern wrote:
>> >> > On Fri, 9 Apr 2010, Pedro Ribeiro wrote:
>> >> >
>> >> > > > The DMA pointers do indeed look sane. I wanted to take a deeper look at
>> >> > > > this and set up a 64bit system today. However, I fail to see the problem
>> >> > > > here. Pedro, how much RAM does your machine have installed?
>> >> >
>> >> > > It has 4 GB.
>> >> >
>> >> > That means DMA mapping cannot be the cause of the problem.  :-(
>> >>
>> >> That isn't entirely true. The BIOS usually allocates a 256 MB ACPI/PCI hole
>> >> that is under the 4GB.
>> >>
>> >> So end up with 3.7 GB, then the 256MB hole, and then right above the 4GB
>> >> you the the remaining memory: 4.3GB.
>> >
>> > How can Pedro find out what physical addresses are in use on his
>> > system?
>>
>> If you have 4GB of RAM then almost certainly you have memory located
>> at addresses over 4GB. If you look at the e820 memory map printed at
>> the start of dmesg on bootup and see entries with addresses of
>> 100000000 or higher reported as usable, then this is the case.
>
> Pedro, can you provide your dmesg output, please? I installed 5GB or RAM
> to my machine now, and even with your .config, I can't see the problem.
>
> Daniel
>
>

There you go Daniel.

Pedro

[-- Attachment #2: dmesg2.gz --]
[-- Type: application/x-gzip, Size: 19825 bytes --]

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-12 11:53         ` Andi Kleen
  (?)
@ 2010-04-12 12:11         ` Pedro Ribeiro
  2010-04-12 12:12             ` Andi Kleen
  -1 siblings, 1 reply; 221+ messages in thread
From: Pedro Ribeiro @ 2010-04-12 12:11 UTC (permalink / raw)
  To: Andi Kleen
  Cc: Daniel Mack, Alan Stern, linux-kernel, akpm, Greg KH, alsa-devel,
	linux-usb

On 12 April 2010 12:53, Andi Kleen <andi@firstfloor.org> wrote:
>> Which is exactly what usb_buffer_alloc() does already. So at least for
>> x86 you say this is the right thing to do? However, we don't necessarily
>> need coherent memory on other platforms, which is why I hessitate to
>> enforce that type of memory for all transfer_buffer allocations.
>
> Yes today it's faster at least.
>
> Probably we should have better interfaces for this, but we don't.
>
>>
>> > Or just use GFP_KERNEL and pci_map_* later.
>>
>> The USB core does this already, but at least on Pedro's machine, this
>> seems unsufficient. Unfortunately, I can't reproduce the issue yet, even
>> with more than 4GB of RAM installed.
>
> Then something must be broken in Pedro's system and likely other drivers
> will also not work. I don't think it should be worked around in the USB layer.
>
> -Andi


I'm not putting into question whether something is broken in my
system, but if it is, it must be the ICH9 platform, because I was able
to reproduce it in another laptop.

My laptop is a Lenovo T400 and I was able to reproduce it in a Acer
Aspire 59xx (I don't remember the exact model, but it is one of the
new ones with 15.6 inch - i think they all use the same base). And the
common thing between them is the ICH9 platform.

The only which solved this problem was the first patch sent to me by
Daniel Mack. I've been using it for days straight and it works fine.

Pedro

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-12 12:12             ` Andi Kleen
  0 siblings, 0 replies; 221+ messages in thread
From: Andi Kleen @ 2010-04-12 12:12 UTC (permalink / raw)
  To: Pedro Ribeiro
  Cc: Andi Kleen, Daniel Mack, Alan Stern, linux-kernel, akpm, Greg KH,
	alsa-devel, linux-usb

> 
> I'm not putting into question whether something is broken in my
> system, but if it is, it must be the ICH9 platform, because I was able
> to reproduce it in another laptop.
> 
> My laptop is a Lenovo T400 and I was able to reproduce it in a Acer
> Aspire 59xx (I don't remember the exact model, but it is one of the
> new ones with 15.6 inch - i think they all use the same base). And the
> common thing between them is the ICH9 platform.

There are lots of systems around with ICH9 that work fine.
I'm typing on one.

> 
> The only which solved this problem was the first patch sent to me by
> Daniel Mack. I've been using it for days straight and it works fine.

Can you send a full boot log?

-Andi
-- 
ak@linux.intel.com -- Speaking for myself only.

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-12 12:12             ` Andi Kleen
  0 siblings, 0 replies; 221+ messages in thread
From: Andi Kleen @ 2010-04-12 12:12 UTC (permalink / raw)
  To: Pedro Ribeiro
  Cc: Andi Kleen, Daniel Mack, Alan Stern,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b, Greg KH,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-usb-u79uwXL29TY76Z2rM5mHXA

> 
> I'm not putting into question whether something is broken in my
> system, but if it is, it must be the ICH9 platform, because I was able
> to reproduce it in another laptop.
> 
> My laptop is a Lenovo T400 and I was able to reproduce it in a Acer
> Aspire 59xx (I don't remember the exact model, but it is one of the
> new ones with 15.6 inch - i think they all use the same base). And the
> common thing between them is the ICH9 platform.

There are lots of systems around with ICH9 that work fine.
I'm typing on one.

> 
> The only which solved this problem was the first patch sent to me by
> Daniel Mack. I've been using it for days straight and it works fine.

Can you send a full boot log?

-Andi
-- 
ak-VuQAYsv1563Yd54FQh9/CA@public.gmane.org -- Speaking for myself only.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-12 12:12             ` Andi Kleen
  (?)
@ 2010-04-12 12:32             ` Daniel Mack
  2010-04-12 12:47               ` Andi Kleen
  -1 siblings, 1 reply; 221+ messages in thread
From: Daniel Mack @ 2010-04-12 12:32 UTC (permalink / raw)
  To: Andi Kleen
  Cc: Pedro Ribeiro, Alan Stern, linux-kernel, akpm, Greg KH,
	alsa-devel, linux-usb

On Mon, Apr 12, 2010 at 02:12:43PM +0200, Andi Kleen wrote:
> > I'm not putting into question whether something is broken in my
> > system, but if it is, it must be the ICH9 platform, because I was able
> > to reproduce it in another laptop.
> > 
> > My laptop is a Lenovo T400 and I was able to reproduce it in a Acer
> > Aspire 59xx (I don't remember the exact model, but it is one of the
> > new ones with 15.6 inch - i think they all use the same base). And the
> > common thing between them is the ICH9 platform.
> 
> There are lots of systems around with ICH9 that work fine.
> I'm typing on one.

FWIW, the fix that made it work for Pedro was to use usb_buffer_alloc()
for the transfer_buffer of the audio module.

Another detail I can't explain is that on his machine, the kernel oopses
when kmalloc() with GFP_DMA32 is used. The patch to try this also only
touched the allocation in sound/usb/caiaq/audio.c.

> > The only which solved this problem was the first patch sent to me by
> > Daniel Mack. I've been using it for days straight and it works fine.
> 
> Can you send a full boot log?

He just did. I put it online here:

  http://caiaq.de/download/tmp/pedro-dmesg

Daniel

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-12 12:32             ` Daniel Mack
@ 2010-04-12 12:47               ` Andi Kleen
  2010-04-12 12:54                   ` Daniel Mack
  0 siblings, 1 reply; 221+ messages in thread
From: Andi Kleen @ 2010-04-12 12:47 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Andi Kleen, Pedro Ribeiro, Alan Stern, linux-kernel, akpm,
	Greg KH, alsa-devel, linux-usb

On Mon, Apr 12, 2010 at 02:32:38PM +0200, Daniel Mack wrote:
> Another detail I can't explain is that on his machine, the kernel oopses
> when kmalloc() with GFP_DMA32 is used. The patch to try this also only
> touched the allocation in sound/usb/caiaq/audio.c.

Where did it oops?

> 
> > > The only which solved this problem was the first patch sent to me by
> > > Daniel Mack. I've been using it for days straight and it works fine.
> > 
> > Can you send a full boot log?
> 
> He just did. I put it online here:
> 
>   http://caiaq.de/download/tmp/pedro-dmesg

The system seems to set up the soft iotlb correctly.

[    0.468472] PCI-DMA: Using software bounce buffering for IO (SWIOTLB)
[    0.468539] Placing 64MB software IO TLB between ffff880020000000 - ffff880024000000
[    0.468610] software IO TLB at phys 0x20000000 - 0x24000000

Also if that was wrong a lot more things would go wrong.

I would suspect the driver. Are you sure:

- it sets up it's dma_masks correctly?
- it uses pci_map_single/sg correctly for all transferred data?

-Andi

-- 
ak@linux.intel.com -- Speaking for myself only.

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-12 12:47               ` Andi Kleen
@ 2010-04-12 12:54                   ` Daniel Mack
  0 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-12 12:54 UTC (permalink / raw)
  To: Andi Kleen
  Cc: Pedro Ribeiro, Alan Stern, linux-kernel, akpm, Greg KH,
	alsa-devel, linux-usb

On Mon, Apr 12, 2010 at 02:47:08PM +0200, Andi Kleen wrote:
> On Mon, Apr 12, 2010 at 02:32:38PM +0200, Daniel Mack wrote:
> > Another detail I can't explain is that on his machine, the kernel oopses
> > when kmalloc() with GFP_DMA32 is used. The patch to try this also only
> > touched the allocation in sound/usb/caiaq/audio.c.
> 
> Where did it oops?

Pedro sent me an image:

  http://caiaq.de/download/tmp/GFP_DMA32.JPG

The patch I sent him for testing and that lead to this Oops was:

> diff --git a/sound/usb/caiaq/audio.c b/sound/usb/caiaq/audio.c                                                                              
> index 4328cad..26013be 100644                                                                                                               
> --- a/sound/usb/caiaq/audio.c                                                                                                               
> +++ b/sound/usb/caiaq/audio.c                                                                                                               
> @@ -560,7 +560,7 @@ static struct urb **alloc_urbs(struct snd_usb_caiaqdev *dev, int dir, int *ret)                                         
>                }                                                                                                                            
>                                                                                                                                             
>                urbs[i]->transfer_buffer =                                                                                                   
> -                       kmalloc(FRAMES_PER_URB * BYTES_PER_FRAME, GFP_KERNEL);                                                              
> +                       kmalloc(FRAMES_PER_URB * BYTES_PER_FRAME, GFP_KERNEL | GFP_DMA32);                                                  
>                if (!urbs[i]->transfer_buffer) {                                                                                             
>                        log("unable to kmalloc() transfer buffer, OOM!?\n");                                                                 
>                        *ret = -ENOMEM;                                                                                                      
>                                                                                                                                             


> >   http://caiaq.de/download/tmp/pedro-dmesg
> 
> The system seems to set up the soft iotlb correctly.
> 
> [    0.468472] PCI-DMA: Using software bounce buffering for IO (SWIOTLB)
> [    0.468539] Placing 64MB software IO TLB between ffff880020000000 - ffff880024000000
> [    0.468610] software IO TLB at phys 0x20000000 - 0x24000000
> 
> Also if that was wrong a lot more things would go wrong.
> 
> I would suspect the driver. Are you sure:
> 
> - it sets up it's dma_masks correctly?
> - it uses pci_map_single/sg correctly for all transferred data?

Well, the sound driver itself doesn't care for any of those things, just
like any other USB driver doesn't. The USB core itself of the host
controller driver should do, and as far as I can see, it does that, yes.

Daniel


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-12 12:54                   ` Daniel Mack
  0 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-12 12:54 UTC (permalink / raw)
  To: Andi Kleen
  Cc: alsa-devel, linux-usb, Greg KH, linux-kernel, Alan Stern,
	Pedro Ribeiro, akpm

On Mon, Apr 12, 2010 at 02:47:08PM +0200, Andi Kleen wrote:
> On Mon, Apr 12, 2010 at 02:32:38PM +0200, Daniel Mack wrote:
> > Another detail I can't explain is that on his machine, the kernel oopses
> > when kmalloc() with GFP_DMA32 is used. The patch to try this also only
> > touched the allocation in sound/usb/caiaq/audio.c.
> 
> Where did it oops?

Pedro sent me an image:

  http://caiaq.de/download/tmp/GFP_DMA32.JPG

The patch I sent him for testing and that lead to this Oops was:

> diff --git a/sound/usb/caiaq/audio.c b/sound/usb/caiaq/audio.c                                                                              
> index 4328cad..26013be 100644                                                                                                               
> --- a/sound/usb/caiaq/audio.c                                                                                                               
> +++ b/sound/usb/caiaq/audio.c                                                                                                               
> @@ -560,7 +560,7 @@ static struct urb **alloc_urbs(struct snd_usb_caiaqdev *dev, int dir, int *ret)                                         
>                }                                                                                                                            
>                                                                                                                                             
>                urbs[i]->transfer_buffer =                                                                                                   
> -                       kmalloc(FRAMES_PER_URB * BYTES_PER_FRAME, GFP_KERNEL);                                                              
> +                       kmalloc(FRAMES_PER_URB * BYTES_PER_FRAME, GFP_KERNEL | GFP_DMA32);                                                  
>                if (!urbs[i]->transfer_buffer) {                                                                                             
>                        log("unable to kmalloc() transfer buffer, OOM!?\n");                                                                 
>                        *ret = -ENOMEM;                                                                                                      
>                                                                                                                                             


> >   http://caiaq.de/download/tmp/pedro-dmesg
> 
> The system seems to set up the soft iotlb correctly.
> 
> [    0.468472] PCI-DMA: Using software bounce buffering for IO (SWIOTLB)
> [    0.468539] Placing 64MB software IO TLB between ffff880020000000 - ffff880024000000
> [    0.468610] software IO TLB at phys 0x20000000 - 0x24000000
> 
> Also if that was wrong a lot more things would go wrong.
> 
> I would suspect the driver. Are you sure:
> 
> - it sets up it's dma_masks correctly?
> - it uses pci_map_single/sg correctly for all transferred data?

Well, the sound driver itself doesn't care for any of those things, just
like any other USB driver doesn't. The USB core itself of the host
controller driver should do, and as far as I can see, it does that, yes.

Daniel

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-12 12:54                   ` Daniel Mack
  (?)
@ 2010-04-12 15:43                   ` Andi Kleen
  2010-04-12 16:17                       ` Alan Stern
  -1 siblings, 1 reply; 221+ messages in thread
From: Andi Kleen @ 2010-04-12 15:43 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Andi Kleen, Pedro Ribeiro, Alan Stern, linux-kernel, akpm,
	Greg KH, alsa-devel, linux-usb

> >                urbs[i]->transfer_buffer =                                                                                                   
> > -                       kmalloc(FRAMES_PER_URB * BYTES_PER_FRAME, GFP_KERNEL);                                                              
> > +                       kmalloc(FRAMES_PER_URB * BYTES_PER_FRAME, GFP_KERNEL | GFP_DMA32);                                                  

Ah you can't use GFP_DMA32 with kmalloc, only GFP_DMA.

Actually there should be a WARN_ON for this when slab debugging 
is enabled.

Slab needs separate caches for dma, and it only has them for GFP_DMA,
but not DMA32.  Use __get_free_pages() for GFP_DMA32

> Well, the sound driver itself doesn't care for any of those things, just
> like any other USB driver doesn't. The USB core itself of the host
> controller driver should do, and as far as I can see, it does that, yes.

Hmm, still things must go wrong somewhere. Perhaps need some instrumentation
to see if all the transfer buffers really hit the PCI mapping functions.

It might be interesting to test if the device works with enabled
IOMMU. That would trigger any failures to properly map the buffers
earlier.

-Andi

-- 
ak@linux.intel.com -- Speaking for myself only.

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-12 16:17                       ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-12 16:17 UTC (permalink / raw)
  To: Andi Kleen
  Cc: Daniel Mack, Pedro Ribeiro, linux-kernel, akpm, Greg KH,
	alsa-devel, linux-usb

On Mon, 12 Apr 2010, Andi Kleen wrote:

> > Well, the sound driver itself doesn't care for any of those things, just
> > like any other USB driver doesn't. The USB core itself of the host
> > controller driver should do, and as far as I can see, it does that, yes.
> 
> Hmm, still things must go wrong somewhere. Perhaps need some instrumentation
> to see if all the transfer buffers really hit the PCI mapping functions.

Such a test has already been carried out earlier in this thread:

	http://marc.info/?l=linux-usb&m=127074587029353&w=2
	http://marc.info/?l=linux-usb&m=127076841801051&w=2
	http://marc.info/?l=linux-usb&m=127082890510415&w=2

> It might be interesting to test if the device works with enabled
> IOMMU. That would trigger any failures to properly map the buffers
> earlier.

Alan Stern


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-12 16:17                       ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-12 16:17 UTC (permalink / raw)
  To: Andi Kleen
  Cc: Daniel Mack, Pedro Ribeiro, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b, Greg KH,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-usb-u79uwXL29TY76Z2rM5mHXA

On Mon, 12 Apr 2010, Andi Kleen wrote:

> > Well, the sound driver itself doesn't care for any of those things, just
> > like any other USB driver doesn't. The USB core itself of the host
> > controller driver should do, and as far as I can see, it does that, yes.
> 
> Hmm, still things must go wrong somewhere. Perhaps need some instrumentation
> to see if all the transfer buffers really hit the PCI mapping functions.

Such a test has already been carried out earlier in this thread:

	http://marc.info/?l=linux-usb&m=127074587029353&w=2
	http://marc.info/?l=linux-usb&m=127076841801051&w=2
	http://marc.info/?l=linux-usb&m=127082890510415&w=2

> It might be interesting to test if the device works with enabled
> IOMMU. That would trigger any failures to properly map the buffers
> earlier.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-12 16:17                       ` Alan Stern
  (?)
@ 2010-04-12 16:29                       ` Andi Kleen
  2010-04-12 16:57                           ` Alan Stern
  -1 siblings, 1 reply; 221+ messages in thread
From: Andi Kleen @ 2010-04-12 16:29 UTC (permalink / raw)
  To: Alan Stern
  Cc: Andi Kleen, Daniel Mack, Pedro Ribeiro, linux-kernel, akpm,
	Greg KH, alsa-devel, linux-usb

On Mon, Apr 12, 2010 at 12:17:22PM -0400, Alan Stern wrote:
> On Mon, 12 Apr 2010, Andi Kleen wrote:
> 
> > > Well, the sound driver itself doesn't care for any of those things, just
> > > like any other USB driver doesn't. The USB core itself of the host
> > > controller driver should do, and as far as I can see, it does that, yes.
> > 
> > Hmm, still things must go wrong somewhere. Perhaps need some instrumentation
> > to see if all the transfer buffers really hit the PCI mapping functions.
> 
> Such a test has already been carried out earlier in this thread:
> 
> 	http://marc.info/?l=linux-usb&m=127074587029353&w=2
> 	http://marc.info/?l=linux-usb&m=127076841801051&w=2
> 	http://marc.info/?l=linux-usb&m=127082890510415&w=2

Hmm, thanks. But things must still go wrong somewhere, otherwise
the GFP_DMA32 wouldn't be needed?

-Andi

-- 
ak@linux.intel.com -- Speaking for myself only.

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-12 16:29                       ` Andi Kleen
@ 2010-04-12 16:57                           ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-12 16:57 UTC (permalink / raw)
  To: Andi Kleen
  Cc: Daniel Mack, Pedro Ribeiro, linux-kernel, akpm, Greg KH,
	alsa-devel, linux-usb

On Mon, 12 Apr 2010, Andi Kleen wrote:

> On Mon, Apr 12, 2010 at 12:17:22PM -0400, Alan Stern wrote:
> > On Mon, 12 Apr 2010, Andi Kleen wrote:
> > 
> > > > Well, the sound driver itself doesn't care for any of those things, just
> > > > like any other USB driver doesn't. The USB core itself of the host
> > > > controller driver should do, and as far as I can see, it does that, yes.
> > > 
> > > Hmm, still things must go wrong somewhere. Perhaps need some instrumentation
> > > to see if all the transfer buffers really hit the PCI mapping functions.
> > 
> > Such a test has already been carried out earlier in this thread:
> > 
> > 	http://marc.info/?l=linux-usb&m=127074587029353&w=2
> > 	http://marc.info/?l=linux-usb&m=127076841801051&w=2
> > 	http://marc.info/?l=linux-usb&m=127082890510415&w=2
> 
> Hmm, thanks. But things must still go wrong somewhere, otherwise
> the GFP_DMA32 wouldn't be needed?

Indeed, something must go wrong somewhere.  Since Daniel's patch fixed
the problem by changing the buffer from a streaming mapping to a
coherent mapping, it's logical to assume that bad DMA addresses have
something to do with it.  But we don't really know for certain.

Alan Stern


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-12 16:57                           ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-12 16:57 UTC (permalink / raw)
  To: Andi Kleen
  Cc: Daniel Mack, Pedro Ribeiro, linux-kernel, akpm, Greg KH,
	alsa-devel, linux-usb

On Mon, 12 Apr 2010, Andi Kleen wrote:

> On Mon, Apr 12, 2010 at 12:17:22PM -0400, Alan Stern wrote:
> > On Mon, 12 Apr 2010, Andi Kleen wrote:
> > 
> > > > Well, the sound driver itself doesn't care for any of those things, just
> > > > like any other USB driver doesn't. The USB core itself of the host
> > > > controller driver should do, and as far as I can see, it does that, yes.
> > > 
> > > Hmm, still things must go wrong somewhere. Perhaps need some instrumentation
> > > to see if all the transfer buffers really hit the PCI mapping functions.
> > 
> > Such a test has already been carried out earlier in this thread:
> > 
> > 	http://marc.info/?l=linux-usb&m=127074587029353&w=2
> > 	http://marc.info/?l=linux-usb&m=127076841801051&w=2
> > 	http://marc.info/?l=linux-usb&m=127082890510415&w=2
> 
> Hmm, thanks. But things must still go wrong somewhere, otherwise
> the GFP_DMA32 wouldn't be needed?

Indeed, something must go wrong somewhere.  Since Daniel's patch fixed
the problem by changing the buffer from a streaming mapping to a
coherent mapping, it's logical to assume that bad DMA addresses have
something to do with it.  But we don't really know for certain.

Alan Stern

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-12 16:57                           ` Alan Stern
@ 2010-04-12 17:15                             ` Daniel Mack
  -1 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-12 17:15 UTC (permalink / raw)
  To: Alan Stern
  Cc: Andi Kleen, Pedro Ribeiro, linux-kernel, akpm, Greg KH,
	alsa-devel, linux-usb

On Mon, Apr 12, 2010 at 12:57:16PM -0400, Alan Stern wrote:
> On Mon, 12 Apr 2010, Andi Kleen wrote:
> > Hmm, thanks. But things must still go wrong somewhere, otherwise
> > the GFP_DMA32 wouldn't be needed?
> 
> Indeed, something must go wrong somewhere.  Since Daniel's patch fixed
> the problem by changing the buffer from a streaming mapping to a
> coherent mapping, it's logical to assume that bad DMA addresses have
> something to do with it.  But we don't really know for certain.

Given that - at least for non-64-aware host controllers - we want memory
<4GB anyway for USB transfers to avoid DMA bouncing buffers, maybe we
should just do that and fix the problem at this level? I already started
to implement usb_[mz]alloc() and use it in some USB drivers.

But even after all collected wisdom about memory management in this
thread, I'm still uncertain of how to get suitable memory. Using
dma_alloc_coherent() seems overdone as that type of memory is not
necessarily needed and might be a costly good on some platforms. And as
fas as I understand, kmalloc(GFP_DMA) does not avoid memory >4GB.

Can anyone explain which is the right way to go?

Daniel

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-12 17:15                             ` Daniel Mack
  0 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-12 17:15 UTC (permalink / raw)
  To: Alan Stern
  Cc: alsa-devel, linux-usb, Greg KH, linux-kernel, Andi Kleen,
	Pedro Ribeiro, akpm

On Mon, Apr 12, 2010 at 12:57:16PM -0400, Alan Stern wrote:
> On Mon, 12 Apr 2010, Andi Kleen wrote:
> > Hmm, thanks. But things must still go wrong somewhere, otherwise
> > the GFP_DMA32 wouldn't be needed?
> 
> Indeed, something must go wrong somewhere.  Since Daniel's patch fixed
> the problem by changing the buffer from a streaming mapping to a
> coherent mapping, it's logical to assume that bad DMA addresses have
> something to do with it.  But we don't really know for certain.

Given that - at least for non-64-aware host controllers - we want memory
<4GB anyway for USB transfers to avoid DMA bouncing buffers, maybe we
should just do that and fix the problem at this level? I already started
to implement usb_[mz]alloc() and use it in some USB drivers.

But even after all collected wisdom about memory management in this
thread, I'm still uncertain of how to get suitable memory. Using
dma_alloc_coherent() seems overdone as that type of memory is not
necessarily needed and might be a costly good on some platforms. And as
fas as I understand, kmalloc(GFP_DMA) does not avoid memory >4GB.

Can anyone explain which is the right way to go?

Daniel

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-12 17:22                               ` Andi Kleen
  0 siblings, 0 replies; 221+ messages in thread
From: Andi Kleen @ 2010-04-12 17:22 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Alan Stern, Andi Kleen, Pedro Ribeiro, linux-kernel, akpm,
	Greg KH, alsa-devel, linux-usb

On Mon, Apr 12, 2010 at 07:15:07PM +0200, Daniel Mack wrote:
> On Mon, Apr 12, 2010 at 12:57:16PM -0400, Alan Stern wrote:
> > On Mon, 12 Apr 2010, Andi Kleen wrote:
> > > Hmm, thanks. But things must still go wrong somewhere, otherwise
> > > the GFP_DMA32 wouldn't be needed?
> > 
> > Indeed, something must go wrong somewhere.  Since Daniel's patch fixed
> > the problem by changing the buffer from a streaming mapping to a
> > coherent mapping, it's logical to assume that bad DMA addresses have
> > something to do with it.  But we don't really know for certain.
> 
> Given that - at least for non-64-aware host controllers - we want memory
> <4GB anyway for USB transfers to avoid DMA bouncing buffers, maybe we
> should just do that and fix the problem at this level? I already started
> to implement usb_[mz]alloc() and use it in some USB drivers.

If the area is not mapped correctly it will fail in other situations,
e.g. with an IOMMU active or in virtualized setups. So the bug
has to be eventually tracked down.

> 
> But even after all collected wisdom about memory management in this
> thread, I'm still uncertain of how to get suitable memory. Using
> dma_alloc_coherent() seems overdone as that type of memory is not
> necessarily needed and might be a costly good on some platforms. And as
> fas as I understand, kmalloc(GFP_DMA) does not avoid memory >4GB.

It does actually, but it only has 16MB to play with. Don't use it.
If anything use __get_free_pages(GFP_DMA32), but it's a x86-64 
specific code.

> Can anyone explain which is the right way to go?

The right thing would be to define a proper interface for it.

I had an attempt for it a couple of years ago with the mask allocator, 
but it didn't make it into the tree.

-Andi
-- 
ak@linux.intel.com -- Speaking for myself only.

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-12 17:22                               ` Andi Kleen
  0 siblings, 0 replies; 221+ messages in thread
From: Andi Kleen @ 2010-04-12 17:22 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Alan Stern, Andi Kleen, Pedro Ribeiro,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b, Greg KH,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-usb-u79uwXL29TY76Z2rM5mHXA

On Mon, Apr 12, 2010 at 07:15:07PM +0200, Daniel Mack wrote:
> On Mon, Apr 12, 2010 at 12:57:16PM -0400, Alan Stern wrote:
> > On Mon, 12 Apr 2010, Andi Kleen wrote:
> > > Hmm, thanks. But things must still go wrong somewhere, otherwise
> > > the GFP_DMA32 wouldn't be needed?
> > 
> > Indeed, something must go wrong somewhere.  Since Daniel's patch fixed
> > the problem by changing the buffer from a streaming mapping to a
> > coherent mapping, it's logical to assume that bad DMA addresses have
> > something to do with it.  But we don't really know for certain.
> 
> Given that - at least for non-64-aware host controllers - we want memory
> <4GB anyway for USB transfers to avoid DMA bouncing buffers, maybe we
> should just do that and fix the problem at this level? I already started
> to implement usb_[mz]alloc() and use it in some USB drivers.

If the area is not mapped correctly it will fail in other situations,
e.g. with an IOMMU active or in virtualized setups. So the bug
has to be eventually tracked down.

> 
> But even after all collected wisdom about memory management in this
> thread, I'm still uncertain of how to get suitable memory. Using
> dma_alloc_coherent() seems overdone as that type of memory is not
> necessarily needed and might be a costly good on some platforms. And as
> fas as I understand, kmalloc(GFP_DMA) does not avoid memory >4GB.

It does actually, but it only has 16MB to play with. Don't use it.
If anything use __get_free_pages(GFP_DMA32), but it's a x86-64 
specific code.

> Can anyone explain which is the right way to go?

The right thing would be to define a proper interface for it.

I had an attempt for it a couple of years ago with the mask allocator, 
but it didn't make it into the tree.

-Andi
-- 
ak-VuQAYsv1563Yd54FQh9/CA@public.gmane.org -- Speaking for myself only.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [LKML] Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-12 17:52                               ` Konrad Rzeszutek Wilk
  0 siblings, 0 replies; 221+ messages in thread
From: Konrad Rzeszutek Wilk @ 2010-04-12 17:52 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Alan Stern, Andi Kleen, Pedro Ribeiro, linux-kernel, akpm,
	Greg KH, alsa-devel, linux-usb

On Mon, Apr 12, 2010 at 07:15:07PM +0200, Daniel Mack wrote:
> On Mon, Apr 12, 2010 at 12:57:16PM -0400, Alan Stern wrote:
> > On Mon, 12 Apr 2010, Andi Kleen wrote:
> > > Hmm, thanks. But things must still go wrong somewhere, otherwise
> > > the GFP_DMA32 wouldn't be needed?
> > 
> > Indeed, something must go wrong somewhere.  Since Daniel's patch fixed
> > the problem by changing the buffer from a streaming mapping to a
> > coherent mapping, it's logical to assume that bad DMA addresses have
> > something to do with it.  But we don't really know for certain.
> 
> Given that - at least for non-64-aware host controllers - we want memory
> <4GB anyway for USB transfers to avoid DMA bouncing buffers, maybe we
> should just do that and fix the problem at this level? I already started
> to implement usb_[mz]alloc() and use it in some USB drivers.

You might want to run some benchmarks first to see if it is such a
problem. Keep in mind that you would be addressing only the host-side of
this: all DMA transfers from the USB controller to the memory. But for any
transfer from the user space to the USB device you can't make
the <4GB assumption as the stack/heap in the user-land is stiched from
various memory areas - some of them above your 4GB mark. So when you
write your response to this e-mail, and your /var/spool/clientmqueue is on your
USB disk, the page with your response that is being written to the disk, can be
allocated from a page above the 4GB mark and then has to be bounced-buffered
for the USB controller. Note, I am only talking about 64-bit kernels,
the 32-bit are a different beast altogether when it comes to

Thought please keep in mind that this issue of bounce-buffer is less of
a problem nowadays. Both AMD and Intel are outfitting their machines
with hardware IOMMU's that replace the SWIOTLB (and IBM's high-end boxes
with the Calgary ones). And on AMD the GART has been used for many years
as a poor-man IOMMU.

> 
> But even after all collected wisdom about memory management in this
> thread, I'm still uncertain of how to get suitable memory. Using
> dma_alloc_coherent() seems overdone as that type of memory is not
> necessarily needed and might be a costly good on some platforms. And as
> fas as I understand, kmalloc(GFP_DMA) does not avoid memory >4GB.
> 
> Can anyone explain which is the right way to go?

Fix whatever makes the DMA address have the wrong value. In the 
0x08...00<bus address> address the 0x08 looks quite suspicious. Like it
has been used as a flag or the generated casting code (by GCC) from 64-bit
to 32-bit didn't get the right thing (I remember seeing this with
InfiniBand with RHEL5.. which was GCC 4.1 I think?)

It would be worth instrumenting the PCI-DMA API code and trigger a
dump_stack when that flag (0x008) is detected in the return from the
underlaying page mapping code. If you need help with this I can
give you some debug patches.

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [LKML] Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-12 17:52                               ` Konrad Rzeszutek Wilk
  0 siblings, 0 replies; 221+ messages in thread
From: Konrad Rzeszutek Wilk @ 2010-04-12 17:52 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Alan Stern, Andi Kleen, Pedro Ribeiro,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b, Greg KH,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-usb-u79uwXL29TY76Z2rM5mHXA

On Mon, Apr 12, 2010 at 07:15:07PM +0200, Daniel Mack wrote:
> On Mon, Apr 12, 2010 at 12:57:16PM -0400, Alan Stern wrote:
> > On Mon, 12 Apr 2010, Andi Kleen wrote:
> > > Hmm, thanks. But things must still go wrong somewhere, otherwise
> > > the GFP_DMA32 wouldn't be needed?
> > 
> > Indeed, something must go wrong somewhere.  Since Daniel's patch fixed
> > the problem by changing the buffer from a streaming mapping to a
> > coherent mapping, it's logical to assume that bad DMA addresses have
> > something to do with it.  But we don't really know for certain.
> 
> Given that - at least for non-64-aware host controllers - we want memory
> <4GB anyway for USB transfers to avoid DMA bouncing buffers, maybe we
> should just do that and fix the problem at this level? I already started
> to implement usb_[mz]alloc() and use it in some USB drivers.

You might want to run some benchmarks first to see if it is such a
problem. Keep in mind that you would be addressing only the host-side of
this: all DMA transfers from the USB controller to the memory. But for any
transfer from the user space to the USB device you can't make
the <4GB assumption as the stack/heap in the user-land is stiched from
various memory areas - some of them above your 4GB mark. So when you
write your response to this e-mail, and your /var/spool/clientmqueue is on your
USB disk, the page with your response that is being written to the disk, can be
allocated from a page above the 4GB mark and then has to be bounced-buffered
for the USB controller. Note, I am only talking about 64-bit kernels,
the 32-bit are a different beast altogether when it comes to

Thought please keep in mind that this issue of bounce-buffer is less of
a problem nowadays. Both AMD and Intel are outfitting their machines
with hardware IOMMU's that replace the SWIOTLB (and IBM's high-end boxes
with the Calgary ones). And on AMD the GART has been used for many years
as a poor-man IOMMU.

> 
> But even after all collected wisdom about memory management in this
> thread, I'm still uncertain of how to get suitable memory. Using
> dma_alloc_coherent() seems overdone as that type of memory is not
> necessarily needed and might be a costly good on some platforms. And as
> fas as I understand, kmalloc(GFP_DMA) does not avoid memory >4GB.
> 
> Can anyone explain which is the right way to go?

Fix whatever makes the DMA address have the wrong value. In the 
0x08...00<bus address> address the 0x08 looks quite suspicious. Like it
has been used as a flag or the generated casting code (by GCC) from 64-bit
to 32-bit didn't get the right thing (I remember seeing this with
InfiniBand with RHEL5.. which was GCC 4.1 I think?)

It would be worth instrumenting the PCI-DMA API code and trigger a
dump_stack when that flag (0x008) is detected in the return from the
underlaying page mapping code. If you need help with this I can
give you some debug patches.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-12 17:22                               ` Andi Kleen
@ 2010-04-12 17:56                                 ` Daniel Mack
  -1 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-12 17:56 UTC (permalink / raw)
  To: Andi Kleen
  Cc: Alan Stern, Pedro Ribeiro, linux-kernel, akpm, Greg KH,
	alsa-devel, linux-usb

On Mon, Apr 12, 2010 at 07:22:33PM +0200, Andi Kleen wrote:
> On Mon, Apr 12, 2010 at 07:15:07PM +0200, Daniel Mack wrote:
> > Given that - at least for non-64-aware host controllers - we want memory
> > <4GB anyway for USB transfers to avoid DMA bouncing buffers, maybe we
> > should just do that and fix the problem at this level? I already started
> > to implement usb_[mz]alloc() and use it in some USB drivers.
> 
> If the area is not mapped correctly it will fail in other situations,
> e.g. with an IOMMU active or in virtualized setups. So the bug
> has to be eventually tracked down.

Ok, agreed. But we all agree to the fact that we need an interface for
such allocations to avoid bounce buffers? If that is the case, we could
already start to implement that while we're tracking down the actual
bug.

[...]

> > Can anyone explain which is the right way to go?
> 
> The right thing would be to define a proper interface for it.
> 
> I had an attempt for it a couple of years ago with the mask allocator, 
> but it didn't make it into the tree.

Any plans to continue on this? Or can you dig it out again so others can
pick up the idea?

Daniel


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-12 17:56                                 ` Daniel Mack
  0 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-12 17:56 UTC (permalink / raw)
  To: Andi Kleen
  Cc: alsa-devel, linux-usb, Greg KH, linux-kernel, Alan Stern,
	Pedro Ribeiro, akpm

On Mon, Apr 12, 2010 at 07:22:33PM +0200, Andi Kleen wrote:
> On Mon, Apr 12, 2010 at 07:15:07PM +0200, Daniel Mack wrote:
> > Given that - at least for non-64-aware host controllers - we want memory
> > <4GB anyway for USB transfers to avoid DMA bouncing buffers, maybe we
> > should just do that and fix the problem at this level? I already started
> > to implement usb_[mz]alloc() and use it in some USB drivers.
> 
> If the area is not mapped correctly it will fail in other situations,
> e.g. with an IOMMU active or in virtualized setups. So the bug
> has to be eventually tracked down.

Ok, agreed. But we all agree to the fact that we need an interface for
such allocations to avoid bounce buffers? If that is the case, we could
already start to implement that while we're tracking down the actual
bug.

[...]

> > Can anyone explain which is the right way to go?
> 
> The right thing would be to define a proper interface for it.
> 
> I had an attempt for it a couple of years ago with the mask allocator, 
> but it didn't make it into the tree.

Any plans to continue on this? Or can you dig it out again so others can
pick up the idea?

Daniel

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
  2010-04-10 17:02                         ` [alsa-devel] " Robert Hancock
@ 2010-04-12 18:56                           ` Sarah Sharp
  2010-04-12 20:39                               ` Robert Hancock
  0 siblings, 1 reply; 221+ messages in thread
From: Sarah Sharp @ 2010-04-12 18:56 UTC (permalink / raw)
  To: Robert Hancock
  Cc: Daniel Mack, alsa-devel, Greg KH, Takashi Iwai, Greg KH,
	linux-usb, linux-kernel, Alan Stern, Pedro Ribeiro, akpm

On Sat, Apr 10, 2010 at 11:02:53AM -0600, Robert Hancock wrote:
> On Sat, Apr 10, 2010 at 2:34 AM, Daniel Mack <daniel@caiaq.de> wrote:
> > On Fri, Apr 09, 2010 at 05:38:13PM -0600, Robert Hancock wrote:
> >> On Fri, Apr 9, 2010 at 10:50 AM, Sarah Sharp
> >> <sarah.a.sharp@linux.intel.com> wrote:
> >> > What makes you think that?  I've seen URB buffers with 64-bit DMA
> >> > addresses.  I can tell when the debug polling loop runs and I look at
> >> > the DMA addresses the xHCI driver is feeding to the hardware:
> >> >
> >> > Dev 1 endpoint ring 0:
> >> > xhci_hcd 0000:05:00.0: @71a49800 01000680 00080000 00000008 00000841
> >> >
> >> > So the TRB at address 71a49800 is pointing to a buffer at address
> >> > 0x0008000001000680.
> >>
> >> I'm not sure why the address would be that huge, unless it's not
> >> actually a physical address, or there's some kind of remapping going
> >> on?
> >>
> >> >
> >> > If I'm setting a DMA mask wrong somewhere, or doing something else to
> >> > limit the DMA to 32-bit, then please let me know.
> >>
> >> The DMA mask for the controller isn't being set anywhere (in the
> >> version that's in Linus' current git anyway). In that case it'll
> >> default to 32-bit and any DMA mappings above 4GB will need to be
> >> remapped. The controller driver doesn't do the mapping itself but the
> >> USB core does, passing in the controller device as the one doing the
> >> DMA, so if the controller's DMA mask is set to 32-bit then the buffers
> >> passed in will get remapped/bounced accordingly.
> >
> > So if we're seeing physical addresses in the log above, and the xHCI
> > driver does not explicitly allow the USB core to use addresses above
> > 4GB, why shouldn't the same thing be true as well for EHCI?
> > (Which would then be exactly the case we're seeing)
> 
> That is a bit suspicious, yes. With the DMA mask at default I don't
> expect that should happen. Sarah, what kind of traffic was happening
> when you saw that (bulk, isochronous, etc)?

Ring 0 is the default control ring, so it must be control transfers.
That's the first control transfer on the ring (and it didn't fill), so
it must have come from the USB core.

I was running the USB mass storage driver, and the bulk endpoint rings
don't have the high 32-bits of the address set.  It mostly uses the
scatter-gather interface, which calls usb_buffer_map_sg(), so that's not
surprising.

Sarah Sharp

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
  2010-04-12 18:56                           ` Sarah Sharp
@ 2010-04-12 20:39                               ` Robert Hancock
  0 siblings, 0 replies; 221+ messages in thread
From: Robert Hancock @ 2010-04-12 20:39 UTC (permalink / raw)
  To: Sarah Sharp
  Cc: Daniel Mack, alsa-devel, Greg KH, Takashi Iwai, Greg KH,
	linux-usb, linux-kernel, Alan Stern, Pedro Ribeiro, akpm

On Mon, Apr 12, 2010 at 12:56 PM, Sarah Sharp
<sarah.a.sharp@linux.intel.com> wrote:
> On Sat, Apr 10, 2010 at 11:02:53AM -0600, Robert Hancock wrote:
>> On Sat, Apr 10, 2010 at 2:34 AM, Daniel Mack <daniel@caiaq.de> wrote:
>> > On Fri, Apr 09, 2010 at 05:38:13PM -0600, Robert Hancock wrote:
>> >> On Fri, Apr 9, 2010 at 10:50 AM, Sarah Sharp
>> >> <sarah.a.sharp@linux.intel.com> wrote:
>> >> > What makes you think that?  I've seen URB buffers with 64-bit DMA
>> >> > addresses.  I can tell when the debug polling loop runs and I look at
>> >> > the DMA addresses the xHCI driver is feeding to the hardware:
>> >> >
>> >> > Dev 1 endpoint ring 0:
>> >> > xhci_hcd 0000:05:00.0: @71a49800 01000680 00080000 00000008 00000841
>> >> >
>> >> > So the TRB at address 71a49800 is pointing to a buffer at address
>> >> > 0x0008000001000680.
>> >>
>> >> I'm not sure why the address would be that huge, unless it's not
>> >> actually a physical address, or there's some kind of remapping going
>> >> on?
>> >>
>> >> >
>> >> > If I'm setting a DMA mask wrong somewhere, or doing something else to
>> >> > limit the DMA to 32-bit, then please let me know.
>> >>
>> >> The DMA mask for the controller isn't being set anywhere (in the
>> >> version that's in Linus' current git anyway). In that case it'll
>> >> default to 32-bit and any DMA mappings above 4GB will need to be
>> >> remapped. The controller driver doesn't do the mapping itself but the
>> >> USB core does, passing in the controller device as the one doing the
>> >> DMA, so if the controller's DMA mask is set to 32-bit then the buffers
>> >> passed in will get remapped/bounced accordingly.
>> >
>> > So if we're seeing physical addresses in the log above, and the xHCI
>> > driver does not explicitly allow the USB core to use addresses above
>> > 4GB, why shouldn't the same thing be true as well for EHCI?
>> > (Which would then be exactly the case we're seeing)
>>
>> That is a bit suspicious, yes. With the DMA mask at default I don't
>> expect that should happen. Sarah, what kind of traffic was happening
>> when you saw that (bulk, isochronous, etc)?
>
> Ring 0 is the default control ring, so it must be control transfers.
> That's the first control transfer on the ring (and it didn't fill), so
> it must have come from the USB core.
>
> I was running the USB mass storage driver, and the bulk endpoint rings
> don't have the high 32-bits of the address set.  It mostly uses the
> scatter-gather interface, which calls usb_buffer_map_sg(), so that's not
> surprising.

Is this machine using an IOMMU or something which would be remapping
physical addresses? That address 0x0008000001000680 seems huge, I
don't see how it could even be a valid bus address otherwise..

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
@ 2010-04-12 20:39                               ` Robert Hancock
  0 siblings, 0 replies; 221+ messages in thread
From: Robert Hancock @ 2010-04-12 20:39 UTC (permalink / raw)
  To: Sarah Sharp
  Cc: Daniel Mack, alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw, Greg KH,
	Takashi Iwai, Greg KH, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Alan Stern, Pedro Ribeiro,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b

On Mon, Apr 12, 2010 at 12:56 PM, Sarah Sharp
<sarah.a.sharp-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> wrote:
> On Sat, Apr 10, 2010 at 11:02:53AM -0600, Robert Hancock wrote:
>> On Sat, Apr 10, 2010 at 2:34 AM, Daniel Mack <daniel-rDUAYElUppE@public.gmane.org> wrote:
>> > On Fri, Apr 09, 2010 at 05:38:13PM -0600, Robert Hancock wrote:
>> >> On Fri, Apr 9, 2010 at 10:50 AM, Sarah Sharp
>> >> <sarah.a.sharp-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> wrote:
>> >> > What makes you think that?  I've seen URB buffers with 64-bit DMA
>> >> > addresses.  I can tell when the debug polling loop runs and I look at
>> >> > the DMA addresses the xHCI driver is feeding to the hardware:
>> >> >
>> >> > Dev 1 endpoint ring 0:
>> >> > xhci_hcd 0000:05:00.0: @71a49800 01000680 00080000 00000008 00000841
>> >> >
>> >> > So the TRB at address 71a49800 is pointing to a buffer at address
>> >> > 0x0008000001000680.
>> >>
>> >> I'm not sure why the address would be that huge, unless it's not
>> >> actually a physical address, or there's some kind of remapping going
>> >> on?
>> >>
>> >> >
>> >> > If I'm setting a DMA mask wrong somewhere, or doing something else to
>> >> > limit the DMA to 32-bit, then please let me know.
>> >>
>> >> The DMA mask for the controller isn't being set anywhere (in the
>> >> version that's in Linus' current git anyway). In that case it'll
>> >> default to 32-bit and any DMA mappings above 4GB will need to be
>> >> remapped. The controller driver doesn't do the mapping itself but the
>> >> USB core does, passing in the controller device as the one doing the
>> >> DMA, so if the controller's DMA mask is set to 32-bit then the buffers
>> >> passed in will get remapped/bounced accordingly.
>> >
>> > So if we're seeing physical addresses in the log above, and the xHCI
>> > driver does not explicitly allow the USB core to use addresses above
>> > 4GB, why shouldn't the same thing be true as well for EHCI?
>> > (Which would then be exactly the case we're seeing)
>>
>> That is a bit suspicious, yes. With the DMA mask at default I don't
>> expect that should happen. Sarah, what kind of traffic was happening
>> when you saw that (bulk, isochronous, etc)?
>
> Ring 0 is the default control ring, so it must be control transfers.
> That's the first control transfer on the ring (and it didn't fill), so
> it must have come from the USB core.
>
> I was running the USB mass storage driver, and the bulk endpoint rings
> don't have the high 32-bits of the address set.  It mostly uses the
> scatter-gather interface, which calls usb_buffer_map_sg(), so that's not
> surprising.

Is this machine using an IOMMU or something which would be remapping
physical addresses? That address 0x0008000001000680 seems huge, I
don't see how it could even be a valid bus address otherwise..
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
  2010-04-12 20:39                               ` Robert Hancock
  (?)
@ 2010-04-12 20:58                               ` Sarah Sharp
  -1 siblings, 0 replies; 221+ messages in thread
From: Sarah Sharp @ 2010-04-12 20:58 UTC (permalink / raw)
  To: Robert Hancock
  Cc: Daniel Mack, alsa-devel, Greg KH, Takashi Iwai, Greg KH,
	linux-usb, linux-kernel, Alan Stern, Pedro Ribeiro, akpm

On Mon, Apr 12, 2010 at 02:39:04PM -0600, Robert Hancock wrote:
> On Mon, Apr 12, 2010 at 12:56 PM, Sarah Sharp
> <sarah.a.sharp@linux.intel.com> wrote:
> > On Sat, Apr 10, 2010 at 11:02:53AM -0600, Robert Hancock wrote:
> >> On Sat, Apr 10, 2010 at 2:34 AM, Daniel Mack <daniel@caiaq.de> wrote:
> >> > On Fri, Apr 09, 2010 at 05:38:13PM -0600, Robert Hancock wrote:
> >> >> On Fri, Apr 9, 2010 at 10:50 AM, Sarah Sharp
> >> >> <sarah.a.sharp@linux.intel.com> wrote:
> >> >> > What makes you think that?  I've seen URB buffers with 64-bit DMA
> >> >> > addresses.  I can tell when the debug polling loop runs and I look at
> >> >> > the DMA addresses the xHCI driver is feeding to the hardware:
> >> >> >
> >> >> > Dev 1 endpoint ring 0:
> >> >> > xhci_hcd 0000:05:00.0: @71a49800 01000680 00080000 00000008 00000841
> >> >> >
> >> >> > So the TRB at address 71a49800 is pointing to a buffer at address
> >> >> > 0x0008000001000680.
> >> >>
> >> >> I'm not sure why the address would be that huge, unless it's not
> >> >> actually a physical address, or there's some kind of remapping going
> >> >> on?
> >> >>
> >> >> >
> >> >> > If I'm setting a DMA mask wrong somewhere, or doing something else to
> >> >> > limit the DMA to 32-bit, then please let me know.
> >> >>
> >> >> The DMA mask for the controller isn't being set anywhere (in the
> >> >> version that's in Linus' current git anyway). In that case it'll
> >> >> default to 32-bit and any DMA mappings above 4GB will need to be
> >> >> remapped. The controller driver doesn't do the mapping itself but the
> >> >> USB core does, passing in the controller device as the one doing the
> >> >> DMA, so if the controller's DMA mask is set to 32-bit then the buffers
> >> >> passed in will get remapped/bounced accordingly.
> >> >
> >> > So if we're seeing physical addresses in the log above, and the xHCI
> >> > driver does not explicitly allow the USB core to use addresses above
> >> > 4GB, why shouldn't the same thing be true as well for EHCI?
> >> > (Which would then be exactly the case we're seeing)
> >>
> >> That is a bit suspicious, yes. With the DMA mask at default I don't
> >> expect that should happen. Sarah, what kind of traffic was happening
> >> when you saw that (bulk, isochronous, etc)?
> >
> > Ring 0 is the default control ring, so it must be control transfers.
> > That's the first control transfer on the ring (and it didn't fill), so
> > it must have come from the USB core.
> >
> > I was running the USB mass storage driver, and the bulk endpoint rings
> > don't have the high 32-bits of the address set.  It mostly uses the
> > scatter-gather interface, which calls usb_buffer_map_sg(), so that's not
> > surprising.
> 
> Is this machine using an IOMMU or something which would be remapping
> physical addresses? That address 0x0008000001000680 seems huge, I
> don't see how it could even be a valid bus address otherwise..

Oh, shoot, nevermind.  That TRB has a slightly different format, where
the setup data for the control transfer is substituted for the DMA
buffer address.  I'll have to look through my logs to see if there's any
real 64-bit DMA addresses in there, and fix xHCI's DMA mask.

Sarah Sharp

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [PATCH] USB: rename usb_buffer_alloc() and usb_buffer_free()
@ 2010-04-13 18:16                   ` Daniel Mack
  0 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-13 18:16 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alan Stern, Greg KH, Pedro Ribeiro, akpm, linux-usb, alsa-devel,
	Robert Hancock, Andi Kleen

On Mon, Apr 12, 2010 at 01:17:25PM +0200, Daniel Mack wrote:
> For more clearance what the functions actually do,
> 
>   usb_buffer_alloc() is renamed to usb_alloc_coherent()
>   usb_buffer_free()  is renamed to usb_free_coherent()
> 
> They should only be used in code which really needs DMA coherency.
> 
> All call sites have been changed accordingly, except for staging
> drivers.

Is this ok? As it's quite big, I think it should be merged soon if there
are no objections.

Thanks,
Daniel


> Signed-off-by: Daniel Mack <daniel@caiaq.de>
> Cc: Alan Stern <stern@rowland.harvard.edu>
> Cc: Greg KH <gregkh@suse.de>
> Cc: Pedro Ribeiro <pedrib@gmail.com>
> Cc: akpm@linux-foundation.org
> Cc: linux-usb@vger.kernel.org
> Cc: alsa-devel@alsa-project.org
> ---
>  Documentation/DocBook/writing_usb_driver.tmpl  |    2 +-
>  Documentation/usb/dma.txt                      |    4 +-
>  drivers/hid/usbhid/hid-core.c                  |   16 +++++-----
>  drivers/hid/usbhid/usbkbd.c                    |   12 ++++----
>  drivers/hid/usbhid/usbmouse.c                  |    6 ++--
>  drivers/input/joystick/xpad.c                  |   16 +++++-----
>  drivers/input/misc/ati_remote.c                |   12 ++++----
>  drivers/input/misc/ati_remote2.c               |    4 +-
>  drivers/input/misc/cm109.c                     |   24 +++++++-------
>  drivers/input/misc/keyspan_remote.c            |    6 ++--
>  drivers/input/misc/powermate.c                 |   16 +++++-----
>  drivers/input/misc/yealink.c                   |   24 +++++++-------
>  drivers/input/mouse/appletouch.c               |   12 ++++----
>  drivers/input/mouse/bcm5974.c                  |   24 +++++++-------
>  drivers/input/tablet/acecad.c                  |    6 ++--
>  drivers/input/tablet/aiptek.c                  |   14 ++++----
>  drivers/input/tablet/gtco.c                    |   12 ++++----
>  drivers/input/tablet/kbtab.c                   |    6 ++--
>  drivers/input/tablet/wacom_sys.c               |   10 +++---
>  drivers/input/touchscreen/usbtouchscreen.c     |    8 ++--
>  drivers/media/dvb/dvb-usb/usb-urb.c            |    7 ++--
>  drivers/media/dvb/ttusb-dec/ttusb_dec.c        |    6 ++--
>  drivers/media/video/au0828/au0828-video.c      |    4 +-
>  drivers/media/video/cx231xx/cx231xx-core.c     |   14 ++++----
>  drivers/media/video/em28xx/em28xx-core.c       |    4 +-
>  drivers/media/video/gspca/benq.c               |    4 +-
>  drivers/media/video/gspca/gspca.c              |   30 +++++++++---------
>  drivers/media/video/hdpvr/hdpvr-video.c        |    8 ++--
>  drivers/media/video/tlg2300/pd-video.c         |   14 ++++----
>  drivers/media/video/usbvision/usbvision-core.c |   16 +++++-----
>  drivers/media/video/uvc/uvc_video.c            |    4 +-
>  drivers/net/can/usb/ems_usb.c                  |   18 +++++-----
>  drivers/net/usb/kaweth.c                       |   12 ++++----
>  drivers/net/wireless/ath/ar9170/usb.c          |    8 ++--
>  drivers/net/wireless/zd1211rw/zd_usb.c         |   10 +++---
>  drivers/usb/class/cdc-acm.c                    |   22 +++++++-------
>  drivers/usb/class/cdc-wdm.c                    |   38 ++++++++++++------------
>  drivers/usb/class/usblp.c                      |    2 +-
>  drivers/usb/core/usb.c                         |   20 ++++++------
>  drivers/usb/misc/appledisplay.c                |    6 ++--
>  drivers/usb/misc/ftdi-elan.c                   |   18 +++++-----
>  drivers/usb/misc/iowarrior.c                   |   12 ++++----
>  drivers/usb/misc/usblcd.c                      |    8 ++--
>  drivers/usb/misc/usbtest.c                     |   16 +++++-----
>  drivers/usb/storage/onetouch.c                 |   12 ++++----
>  drivers/usb/storage/usb.c                      |   12 ++++----
>  drivers/usb/usb-skeleton.c                     |   10 +++---
>  drivers/watchdog/pcwd_usb.c                    |    6 ++--
>  include/linux/usb.h                            |    6 ++--
>  sound/usb/midi.c                               |   14 ++++----
>  sound/usb/misc/ua101.c                         |   16 +++++-----
>  sound/usb/urb.c                                |   18 +++++-----
>  52 files changed, 315 insertions(+), 314 deletions(-)
> 
> diff --git a/Documentation/DocBook/writing_usb_driver.tmpl b/Documentation/DocBook/writing_usb_driver.tmpl
> index eeff19c..bd97a13 100644
> --- a/Documentation/DocBook/writing_usb_driver.tmpl
> +++ b/Documentation/DocBook/writing_usb_driver.tmpl
> @@ -342,7 +342,7 @@ static inline void skel_delete (struct usb_skel *dev)
>  {
>      kfree (dev->bulk_in_buffer);
>      if (dev->bulk_out_buffer != NULL)
> -        usb_buffer_free (dev->udev, dev->bulk_out_size,
> +        usb_free_coherent (dev->udev, dev->bulk_out_size,
>              dev->bulk_out_buffer,
>              dev->write_urb->transfer_dma);
>      usb_free_urb (dev->write_urb);
> diff --git a/Documentation/usb/dma.txt b/Documentation/usb/dma.txt
> index cfdcd16..a37e59c 100644
> --- a/Documentation/usb/dma.txt
> +++ b/Documentation/usb/dma.txt
> @@ -43,10 +43,10 @@ and effects like cache-trashing can impose subtle penalties.
>    kind of addresses to store in urb->transfer_buffer and urb->transfer_dma.
>    You'd also set URB_NO_TRANSFER_DMA_MAP in urb->transfer_flags:
>  
> -	void *usb_buffer_alloc (struct usb_device *dev, size_t size,
> +	void *usb_alloc_coherent (struct usb_device *dev, size_t size,
>  		int mem_flags, dma_addr_t *dma);
>  
> -	void usb_buffer_free (struct usb_device *dev, size_t size,
> +	void usb_free_coherent (struct usb_device *dev, size_t size,
>  		void *addr, dma_addr_t dma);
>  
>    Most drivers should *NOT* be using these primitives; they don't need
> diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
> index 56d06cd..8496f3a 100644
> --- a/drivers/hid/usbhid/hid-core.c
> +++ b/drivers/hid/usbhid/hid-core.c
> @@ -783,13 +783,13 @@ static int hid_alloc_buffers(struct usb_device *dev, struct hid_device *hid)
>  {
>  	struct usbhid_device *usbhid = hid->driver_data;
>  
> -	usbhid->inbuf = usb_buffer_alloc(dev, usbhid->bufsize, GFP_KERNEL,
> +	usbhid->inbuf = usb_alloc_coherent(dev, usbhid->bufsize, GFP_KERNEL,
>  			&usbhid->inbuf_dma);
> -	usbhid->outbuf = usb_buffer_alloc(dev, usbhid->bufsize, GFP_KERNEL,
> +	usbhid->outbuf = usb_alloc_coherent(dev, usbhid->bufsize, GFP_KERNEL,
>  			&usbhid->outbuf_dma);
> -	usbhid->cr = usb_buffer_alloc(dev, sizeof(*usbhid->cr), GFP_KERNEL,
> +	usbhid->cr = usb_alloc_coherent(dev, sizeof(*usbhid->cr), GFP_KERNEL,
>  			&usbhid->cr_dma);
> -	usbhid->ctrlbuf = usb_buffer_alloc(dev, usbhid->bufsize, GFP_KERNEL,
> +	usbhid->ctrlbuf = usb_alloc_coherent(dev, usbhid->bufsize, GFP_KERNEL,
>  			&usbhid->ctrlbuf_dma);
>  	if (!usbhid->inbuf || !usbhid->outbuf || !usbhid->cr ||
>  			!usbhid->ctrlbuf)
> @@ -844,10 +844,10 @@ static void hid_free_buffers(struct usb_device *dev, struct hid_device *hid)
>  {
>  	struct usbhid_device *usbhid = hid->driver_data;
>  
> -	usb_buffer_free(dev, usbhid->bufsize, usbhid->inbuf, usbhid->inbuf_dma);
> -	usb_buffer_free(dev, usbhid->bufsize, usbhid->outbuf, usbhid->outbuf_dma);
> -	usb_buffer_free(dev, sizeof(*(usbhid->cr)), usbhid->cr, usbhid->cr_dma);
> -	usb_buffer_free(dev, usbhid->bufsize, usbhid->ctrlbuf, usbhid->ctrlbuf_dma);
> +	usb_free_coherent(dev, usbhid->bufsize, usbhid->inbuf, usbhid->inbuf_dma);
> +	usb_free_coherent(dev, usbhid->bufsize, usbhid->outbuf, usbhid->outbuf_dma);
> +	usb_free_coherent(dev, sizeof(*(usbhid->cr)), usbhid->cr, usbhid->cr_dma);
> +	usb_free_coherent(dev, usbhid->bufsize, usbhid->ctrlbuf, usbhid->ctrlbuf_dma);
>  }
>  
>  static int usbhid_parse(struct hid_device *hid)
> diff --git a/drivers/hid/usbhid/usbkbd.c b/drivers/hid/usbhid/usbkbd.c
> index f843443..b86f866 100644
> --- a/drivers/hid/usbhid/usbkbd.c
> +++ b/drivers/hid/usbhid/usbkbd.c
> @@ -197,11 +197,11 @@ static int usb_kbd_alloc_mem(struct usb_device *dev, struct usb_kbd *kbd)
>  		return -1;
>  	if (!(kbd->led = usb_alloc_urb(0, GFP_KERNEL)))
>  		return -1;
> -	if (!(kbd->new = usb_buffer_alloc(dev, 8, GFP_ATOMIC, &kbd->new_dma)))
> +	if (!(kbd->new = usb_alloc_coherent(dev, 8, GFP_ATOMIC, &kbd->new_dma)))
>  		return -1;
> -	if (!(kbd->cr = usb_buffer_alloc(dev, sizeof(struct usb_ctrlrequest), GFP_ATOMIC, &kbd->cr_dma)))
> +	if (!(kbd->cr = usb_alloc_coherent(dev, sizeof(struct usb_ctrlrequest), GFP_ATOMIC, &kbd->cr_dma)))
>  		return -1;
> -	if (!(kbd->leds = usb_buffer_alloc(dev, 1, GFP_ATOMIC, &kbd->leds_dma)))
> +	if (!(kbd->leds = usb_alloc_coherent(dev, 1, GFP_ATOMIC, &kbd->leds_dma)))
>  		return -1;
>  
>  	return 0;
> @@ -211,9 +211,9 @@ static void usb_kbd_free_mem(struct usb_device *dev, struct usb_kbd *kbd)
>  {
>  	usb_free_urb(kbd->irq);
>  	usb_free_urb(kbd->led);
> -	usb_buffer_free(dev, 8, kbd->new, kbd->new_dma);
> -	usb_buffer_free(dev, sizeof(struct usb_ctrlrequest), kbd->cr, kbd->cr_dma);
> -	usb_buffer_free(dev, 1, kbd->leds, kbd->leds_dma);
> +	usb_free_coherent(dev, 8, kbd->new, kbd->new_dma);
> +	usb_free_coherent(dev, sizeof(struct usb_ctrlrequest), kbd->cr, kbd->cr_dma);
> +	usb_free_coherent(dev, 1, kbd->leds, kbd->leds_dma);
>  }
>  
>  static int usb_kbd_probe(struct usb_interface *iface,
> diff --git a/drivers/hid/usbhid/usbmouse.c b/drivers/hid/usbhid/usbmouse.c
> index 72ab4b2..79b2bf8 100644
> --- a/drivers/hid/usbhid/usbmouse.c
> +++ b/drivers/hid/usbhid/usbmouse.c
> @@ -142,7 +142,7 @@ static int usb_mouse_probe(struct usb_interface *intf, const struct usb_device_i
>  	if (!mouse || !input_dev)
>  		goto fail1;
>  
> -	mouse->data = usb_buffer_alloc(dev, 8, GFP_ATOMIC, &mouse->data_dma);
> +	mouse->data = usb_alloc_coherent(dev, 8, GFP_ATOMIC, &mouse->data_dma);
>  	if (!mouse->data)
>  		goto fail1;
>  
> @@ -205,7 +205,7 @@ static int usb_mouse_probe(struct usb_interface *intf, const struct usb_device_i
>  fail3:	
>  	usb_free_urb(mouse->irq);
>  fail2:	
> -	usb_buffer_free(dev, 8, mouse->data, mouse->data_dma);
> +	usb_free_coherent(dev, 8, mouse->data, mouse->data_dma);
>  fail1:	
>  	input_free_device(input_dev);
>  	kfree(mouse);
> @@ -221,7 +221,7 @@ static void usb_mouse_disconnect(struct usb_interface *intf)
>  		usb_kill_urb(mouse->irq);
>  		input_unregister_device(mouse->dev);
>  		usb_free_urb(mouse->irq);
> -		usb_buffer_free(interface_to_usbdev(intf), 8, mouse->data, mouse->data_dma);
> +		usb_free_coherent(interface_to_usbdev(intf), 8, mouse->data, mouse->data_dma);
>  		kfree(mouse);
>  	}
>  }
> diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
> index 9b3353b..c1087ce 100644
> --- a/drivers/input/joystick/xpad.c
> +++ b/drivers/input/joystick/xpad.c
> @@ -533,8 +533,8 @@ static int xpad_init_output(struct usb_interface *intf, struct usb_xpad *xpad)
>  	if (xpad->xtype != XTYPE_XBOX360 && xpad->xtype != XTYPE_XBOX)
>  		return 0;
>  
> -	xpad->odata = usb_buffer_alloc(xpad->udev, XPAD_PKT_LEN,
> -				       GFP_KERNEL, &xpad->odata_dma);
> +	xpad->odata = usb_alloc_coherent(xpad->udev, XPAD_PKT_LEN,
> +					 GFP_KERNEL, &xpad->odata_dma);
>  	if (!xpad->odata)
>  		goto fail1;
>  
> @@ -554,7 +554,7 @@ static int xpad_init_output(struct usb_interface *intf, struct usb_xpad *xpad)
>  
>  	return 0;
>  
> - fail2:	usb_buffer_free(xpad->udev, XPAD_PKT_LEN, xpad->odata, xpad->odata_dma);
> + fail2:	usb_free_coherent(xpad->udev, XPAD_PKT_LEN, xpad->odata, xpad->odata_dma);
>   fail1:	return error;
>  }
>  
> @@ -568,7 +568,7 @@ static void xpad_deinit_output(struct usb_xpad *xpad)
>  {
>  	if (xpad->xtype == XTYPE_XBOX360 || xpad->xtype == XTYPE_XBOX) {
>  		usb_free_urb(xpad->irq_out);
> -		usb_buffer_free(xpad->udev, XPAD_PKT_LEN,
> +		usb_free_coherent(xpad->udev, XPAD_PKT_LEN,
>  				xpad->odata, xpad->odata_dma);
>  	}
>  }
> @@ -788,8 +788,8 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id
>  	if (!xpad || !input_dev)
>  		goto fail1;
>  
> -	xpad->idata = usb_buffer_alloc(udev, XPAD_PKT_LEN,
> -				       GFP_KERNEL, &xpad->idata_dma);
> +	xpad->idata = usb_alloc_coherent(udev, XPAD_PKT_LEN,
> +					 GFP_KERNEL, &xpad->idata_dma);
>  	if (!xpad->idata)
>  		goto fail1;
>  
> @@ -942,7 +942,7 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id
>   fail5:	usb_kill_urb(xpad->irq_in);
>   fail4:	usb_free_urb(xpad->irq_in);
>   fail3:	xpad_deinit_output(xpad);
> - fail2:	usb_buffer_free(udev, XPAD_PKT_LEN, xpad->idata, xpad->idata_dma);
> + fail2:	usb_free_coherent(udev, XPAD_PKT_LEN, xpad->idata, xpad->idata_dma);
>   fail1:	input_free_device(input_dev);
>  	kfree(xpad);
>  	return error;
> @@ -964,7 +964,7 @@ static void xpad_disconnect(struct usb_interface *intf)
>  			usb_kill_urb(xpad->irq_in);
>  		}
>  		usb_free_urb(xpad->irq_in);
> -		usb_buffer_free(xpad->udev, XPAD_PKT_LEN,
> +		usb_free_coherent(xpad->udev, XPAD_PKT_LEN,
>  				xpad->idata, xpad->idata_dma);
>  		kfree(xpad);
>  	}
> diff --git a/drivers/input/misc/ati_remote.c b/drivers/input/misc/ati_remote.c
> index 614b65d..2b9a2c8 100644
> --- a/drivers/input/misc/ati_remote.c
> +++ b/drivers/input/misc/ati_remote.c
> @@ -620,13 +620,13 @@ static void ati_remote_irq_in(struct urb *urb)
>  static int ati_remote_alloc_buffers(struct usb_device *udev,
>  				    struct ati_remote *ati_remote)
>  {
> -	ati_remote->inbuf = usb_buffer_alloc(udev, DATA_BUFSIZE, GFP_ATOMIC,
> -					     &ati_remote->inbuf_dma);
> +	ati_remote->inbuf = usb_alloc_coherent(udev, DATA_BUFSIZE, GFP_ATOMIC,
> +					       &ati_remote->inbuf_dma);
>  	if (!ati_remote->inbuf)
>  		return -1;
>  
> -	ati_remote->outbuf = usb_buffer_alloc(udev, DATA_BUFSIZE, GFP_ATOMIC,
> -					      &ati_remote->outbuf_dma);
> +	ati_remote->outbuf = usb_alloc_coherent(udev, DATA_BUFSIZE, GFP_ATOMIC,
> +					        &ati_remote->outbuf_dma);
>  	if (!ati_remote->outbuf)
>  		return -1;
>  
> @@ -649,10 +649,10 @@ static void ati_remote_free_buffers(struct ati_remote *ati_remote)
>  	usb_free_urb(ati_remote->irq_urb);
>  	usb_free_urb(ati_remote->out_urb);
>  
> -	usb_buffer_free(ati_remote->udev, DATA_BUFSIZE,
> +	usb_free_coherent(ati_remote->udev, DATA_BUFSIZE,
>  		ati_remote->inbuf, ati_remote->inbuf_dma);
>  
> -	usb_buffer_free(ati_remote->udev, DATA_BUFSIZE,
> +	usb_free_coherent(ati_remote->udev, DATA_BUFSIZE,
>  		ati_remote->outbuf, ati_remote->outbuf_dma);
>  }
>  
> diff --git a/drivers/input/misc/ati_remote2.c b/drivers/input/misc/ati_remote2.c
> index 2124b99..e148749 100644
> --- a/drivers/input/misc/ati_remote2.c
> +++ b/drivers/input/misc/ati_remote2.c
> @@ -589,7 +589,7 @@ static int ati_remote2_urb_init(struct ati_remote2 *ar2)
>  	int i, pipe, maxp;
>  
>  	for (i = 0; i < 2; i++) {
> -		ar2->buf[i] = usb_buffer_alloc(udev, 4, GFP_KERNEL, &ar2->buf_dma[i]);
> +		ar2->buf[i] = usb_alloc_coherent(udev, 4, GFP_KERNEL, &ar2->buf_dma[i]);
>  		if (!ar2->buf[i])
>  			return -ENOMEM;
>  
> @@ -617,7 +617,7 @@ static void ati_remote2_urb_cleanup(struct ati_remote2 *ar2)
>  
>  	for (i = 0; i < 2; i++) {
>  		usb_free_urb(ar2->urb[i]);
> -		usb_buffer_free(ar2->udev, 4, ar2->buf[i], ar2->buf_dma[i]);
> +		usb_free_coherent(ar2->udev, 4, ar2->buf[i], ar2->buf_dma[i]);
>  	}
>  }
>  
> diff --git a/drivers/input/misc/cm109.c b/drivers/input/misc/cm109.c
> index 86457fe..635b7ac 100644
> --- a/drivers/input/misc/cm109.c
> +++ b/drivers/input/misc/cm109.c
> @@ -630,14 +630,14 @@ static const struct usb_device_id cm109_usb_table[] = {
>  static void cm109_usb_cleanup(struct cm109_dev *dev)
>  {
>  	if (dev->ctl_req)
> -		usb_buffer_free(dev->udev, sizeof(*(dev->ctl_req)),
> -				dev->ctl_req, dev->ctl_req_dma);
> +		usb_free_coherent(dev->udev, sizeof(*(dev->ctl_req)),
> +				  dev->ctl_req, dev->ctl_req_dma);
>  	if (dev->ctl_data)
> -		usb_buffer_free(dev->udev, USB_PKT_LEN,
> -				dev->ctl_data, dev->ctl_dma);
> +		usb_free_coherent(dev->udev, USB_PKT_LEN,
> +				  dev->ctl_data, dev->ctl_dma);
>  	if (dev->irq_data)
> -		usb_buffer_free(dev->udev, USB_PKT_LEN,
> -				dev->irq_data, dev->irq_dma);
> +		usb_free_coherent(dev->udev, USB_PKT_LEN,
> +				  dev->irq_data, dev->irq_dma);
>  
>  	usb_free_urb(dev->urb_irq);	/* parameter validation in core/urb */
>  	usb_free_urb(dev->urb_ctl);	/* parameter validation in core/urb */
> @@ -686,18 +686,18 @@ static int cm109_usb_probe(struct usb_interface *intf,
>  		goto err_out;
>  
>  	/* allocate usb buffers */
> -	dev->irq_data = usb_buffer_alloc(udev, USB_PKT_LEN,
> -					 GFP_KERNEL, &dev->irq_dma);
> +	dev->irq_data = usb_alloc_coherent(udev, USB_PKT_LEN,
> +					   GFP_KERNEL, &dev->irq_dma);
>  	if (!dev->irq_data)
>  		goto err_out;
>  
> -	dev->ctl_data = usb_buffer_alloc(udev, USB_PKT_LEN,
> -					 GFP_KERNEL, &dev->ctl_dma);
> +	dev->ctl_data = usb_alloc_coherent(udev, USB_PKT_LEN,
> +					   GFP_KERNEL, &dev->ctl_dma);
>  	if (!dev->ctl_data)
>  		goto err_out;
>  
> -	dev->ctl_req = usb_buffer_alloc(udev, sizeof(*(dev->ctl_req)),
> -					GFP_KERNEL, &dev->ctl_req_dma);
> +	dev->ctl_req = usb_alloc_coherent(udev, sizeof(*(dev->ctl_req)),
> +					  GFP_KERNEL, &dev->ctl_req_dma);
>  	if (!dev->ctl_req)
>  		goto err_out;
>  
> diff --git a/drivers/input/misc/keyspan_remote.c b/drivers/input/misc/keyspan_remote.c
> index 86afdd1..a93c525 100644
> --- a/drivers/input/misc/keyspan_remote.c
> +++ b/drivers/input/misc/keyspan_remote.c
> @@ -464,7 +464,7 @@ static int keyspan_probe(struct usb_interface *interface, const struct usb_devic
>  	remote->in_endpoint = endpoint;
>  	remote->toggle = -1;	/* Set to -1 so we will always not match the toggle from the first remote message. */
>  
> -	remote->in_buffer = usb_buffer_alloc(udev, RECV_SIZE, GFP_ATOMIC, &remote->in_dma);
> +	remote->in_buffer = usb_alloc_coherent(udev, RECV_SIZE, GFP_ATOMIC, &remote->in_dma);
>  	if (!remote->in_buffer) {
>  		error = -ENOMEM;
>  		goto fail1;
> @@ -543,7 +543,7 @@ static int keyspan_probe(struct usb_interface *interface, const struct usb_devic
>  	return 0;
>  
>   fail3:	usb_free_urb(remote->irq_urb);
> - fail2:	usb_buffer_free(udev, RECV_SIZE, remote->in_buffer, remote->in_dma);
> + fail2:	usb_free_coherent(udev, RECV_SIZE, remote->in_buffer, remote->in_dma);
>   fail1:	kfree(remote);
>  	input_free_device(input_dev);
>  
> @@ -564,7 +564,7 @@ static void keyspan_disconnect(struct usb_interface *interface)
>  		input_unregister_device(remote->input);
>  		usb_kill_urb(remote->irq_urb);
>  		usb_free_urb(remote->irq_urb);
> -		usb_buffer_free(remote->udev, RECV_SIZE, remote->in_buffer, remote->in_dma);
> +		usb_free_coherent(remote->udev, RECV_SIZE, remote->in_buffer, remote->in_dma);
>  		kfree(remote);
>  	}
>  }
> diff --git a/drivers/input/misc/powermate.c b/drivers/input/misc/powermate.c
> index 668913d..a0b00d6 100644
> --- a/drivers/input/misc/powermate.c
> +++ b/drivers/input/misc/powermate.c
> @@ -276,13 +276,13 @@ static int powermate_input_event(struct input_dev *dev, unsigned int type, unsig
>  
>  static int powermate_alloc_buffers(struct usb_device *udev, struct powermate_device *pm)
>  {
> -	pm->data = usb_buffer_alloc(udev, POWERMATE_PAYLOAD_SIZE_MAX,
> -				    GFP_ATOMIC, &pm->data_dma);
> +	pm->data = usb_alloc_coherent(udev, POWERMATE_PAYLOAD_SIZE_MAX,
> +				      GFP_ATOMIC, &pm->data_dma);
>  	if (!pm->data)
>  		return -1;
>  
> -	pm->configcr = usb_buffer_alloc(udev, sizeof(*(pm->configcr)),
> -					GFP_ATOMIC, &pm->configcr_dma);
> +	pm->configcr = usb_alloc_coherent(udev, sizeof(*(pm->configcr)),
> +					  GFP_ATOMIC, &pm->configcr_dma);
>  	if (!pm->configcr)
>  		return -1;
>  
> @@ -291,10 +291,10 @@ static int powermate_alloc_buffers(struct usb_device *udev, struct powermate_dev
>  
>  static void powermate_free_buffers(struct usb_device *udev, struct powermate_device *pm)
>  {
> -	usb_buffer_free(udev, POWERMATE_PAYLOAD_SIZE_MAX,
> -			pm->data, pm->data_dma);
> -	usb_buffer_free(udev, sizeof(*(pm->configcr)),
> -			pm->configcr, pm->configcr_dma);
> +	usb_free_coherent(udev, POWERMATE_PAYLOAD_SIZE_MAX,
> +			  pm->data, pm->data_dma);
> +	usb_free_coherent(udev, sizeof(*(pm->configcr)),
> +			  pm->configcr, pm->configcr_dma);
>  }
>  
>  /* Called whenever a USB device matching one in our supported devices table is connected */
> diff --git a/drivers/input/misc/yealink.c b/drivers/input/misc/yealink.c
> index 93a22ac..f584985 100644
> --- a/drivers/input/misc/yealink.c
> +++ b/drivers/input/misc/yealink.c
> @@ -836,12 +836,12 @@ static int usb_cleanup(struct yealink_dev *yld, int err)
>  	usb_free_urb(yld->urb_irq);
>  	usb_free_urb(yld->urb_ctl);
>  
> -	usb_buffer_free(yld->udev, sizeof(*(yld->ctl_req)),
> -			yld->ctl_req, yld->ctl_req_dma);
> -	usb_buffer_free(yld->udev, USB_PKT_LEN,
> -			yld->ctl_data, yld->ctl_dma);
> -	usb_buffer_free(yld->udev, USB_PKT_LEN,
> -			yld->irq_data, yld->irq_dma);
> +	usb_free_coherent(yld->udev, sizeof(*(yld->ctl_req)),
> +			  yld->ctl_req, yld->ctl_req_dma);
> +	usb_free_coherent(yld->udev, USB_PKT_LEN,
> +			  yld->ctl_data, yld->ctl_dma);
> +	usb_free_coherent(yld->udev, USB_PKT_LEN,
> +			  yld->irq_data, yld->irq_dma);
>  
>  	kfree(yld);
>  	return err;
> @@ -886,18 +886,18 @@ static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
>  		return usb_cleanup(yld, -ENOMEM);
>  
>  	/* allocate usb buffers */
> -	yld->irq_data = usb_buffer_alloc(udev, USB_PKT_LEN,
> -					GFP_ATOMIC, &yld->irq_dma);
> +	yld->irq_data = usb_alloc_coherent(udev, USB_PKT_LEN,
> +					  GFP_ATOMIC, &yld->irq_dma);
>  	if (yld->irq_data == NULL)
>  		return usb_cleanup(yld, -ENOMEM);
>  
> -	yld->ctl_data = usb_buffer_alloc(udev, USB_PKT_LEN,
> -					GFP_ATOMIC, &yld->ctl_dma);
> +	yld->ctl_data = usb_alloc_coherent(udev, USB_PKT_LEN,
> +					  GFP_ATOMIC, &yld->ctl_dma);
>  	if (!yld->ctl_data)
>  		return usb_cleanup(yld, -ENOMEM);
>  
> -	yld->ctl_req = usb_buffer_alloc(udev, sizeof(*(yld->ctl_req)),
> -					GFP_ATOMIC, &yld->ctl_req_dma);
> +	yld->ctl_req = usb_alloc_coherent(udev, sizeof(*(yld->ctl_req)),
> +					  GFP_ATOMIC, &yld->ctl_req_dma);
>  	if (yld->ctl_req == NULL)
>  		return usb_cleanup(yld, -ENOMEM);
>  
> diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c
> index 53ec7dd..05edd75 100644
> --- a/drivers/input/mouse/appletouch.c
> +++ b/drivers/input/mouse/appletouch.c
> @@ -806,8 +806,8 @@ static int atp_probe(struct usb_interface *iface,
>  	if (!dev->urb)
>  		goto err_free_devs;
>  
> -	dev->data = usb_buffer_alloc(dev->udev, dev->info->datalen, GFP_KERNEL,
> -				     &dev->urb->transfer_dma);
> +	dev->data = usb_alloc_coherent(dev->udev, dev->info->datalen, GFP_KERNEL,
> +				       &dev->urb->transfer_dma);
>  	if (!dev->data)
>  		goto err_free_urb;
>  
> @@ -862,8 +862,8 @@ static int atp_probe(struct usb_interface *iface,
>  	return 0;
>  
>   err_free_buffer:
> -	usb_buffer_free(dev->udev, dev->info->datalen,
> -			dev->data, dev->urb->transfer_dma);
> +	usb_free_coherent(dev->udev, dev->info->datalen,
> +			  dev->data, dev->urb->transfer_dma);
>   err_free_urb:
>  	usb_free_urb(dev->urb);
>   err_free_devs:
> @@ -881,8 +881,8 @@ static void atp_disconnect(struct usb_interface *iface)
>  	if (dev) {
>  		usb_kill_urb(dev->urb);
>  		input_unregister_device(dev->input);
> -		usb_buffer_free(dev->udev, dev->info->datalen,
> -				dev->data, dev->urb->transfer_dma);
> +		usb_free_coherent(dev->udev, dev->info->datalen,
> +				  dev->data, dev->urb->transfer_dma);
>  		usb_free_urb(dev->urb);
>  		kfree(dev);
>  	}
> diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c
> index 4f8fe08..aa3359a 100644
> --- a/drivers/input/mouse/bcm5974.c
> +++ b/drivers/input/mouse/bcm5974.c
> @@ -715,15 +715,15 @@ static int bcm5974_probe(struct usb_interface *iface,
>  	if (!dev->tp_urb)
>  		goto err_free_bt_urb;
>  
> -	dev->bt_data = usb_buffer_alloc(dev->udev,
> -					dev->cfg.bt_datalen, GFP_KERNEL,
> -					&dev->bt_urb->transfer_dma);
> +	dev->bt_data = usb_alloc_coherent(dev->udev,
> +					  dev->cfg.bt_datalen, GFP_KERNEL,
> +					  &dev->bt_urb->transfer_dma);
>  	if (!dev->bt_data)
>  		goto err_free_urb;
>  
> -	dev->tp_data = usb_buffer_alloc(dev->udev,
> -					dev->cfg.tp_datalen, GFP_KERNEL,
> -					&dev->tp_urb->transfer_dma);
> +	dev->tp_data = usb_alloc_coherent(dev->udev,
> +					  dev->cfg.tp_datalen, GFP_KERNEL,
> +					  &dev->tp_urb->transfer_dma);
>  	if (!dev->tp_data)
>  		goto err_free_bt_buffer;
>  
> @@ -765,10 +765,10 @@ static int bcm5974_probe(struct usb_interface *iface,
>  	return 0;
>  
>  err_free_buffer:
> -	usb_buffer_free(dev->udev, dev->cfg.tp_datalen,
> +	usb_free_coherent(dev->udev, dev->cfg.tp_datalen,
>  		dev->tp_data, dev->tp_urb->transfer_dma);
>  err_free_bt_buffer:
> -	usb_buffer_free(dev->udev, dev->cfg.bt_datalen,
> +	usb_free_coherent(dev->udev, dev->cfg.bt_datalen,
>  		dev->bt_data, dev->bt_urb->transfer_dma);
>  err_free_urb:
>  	usb_free_urb(dev->tp_urb);
> @@ -788,10 +788,10 @@ static void bcm5974_disconnect(struct usb_interface *iface)
>  	usb_set_intfdata(iface, NULL);
>  
>  	input_unregister_device(dev->input);
> -	usb_buffer_free(dev->udev, dev->cfg.tp_datalen,
> -			dev->tp_data, dev->tp_urb->transfer_dma);
> -	usb_buffer_free(dev->udev, dev->cfg.bt_datalen,
> -			dev->bt_data, dev->bt_urb->transfer_dma);
> +	usb_free_coherent(dev->udev, dev->cfg.tp_datalen,
> +			  dev->tp_data, dev->tp_urb->transfer_dma);
> +	usb_free_coherent(dev->udev, dev->cfg.bt_datalen,
> +			  dev->bt_data, dev->bt_urb->transfer_dma);
>  	usb_free_urb(dev->tp_urb);
>  	usb_free_urb(dev->bt_urb);
>  	kfree(dev);
> diff --git a/drivers/input/tablet/acecad.c b/drivers/input/tablet/acecad.c
> index 670c61c..c047016 100644
> --- a/drivers/input/tablet/acecad.c
> +++ b/drivers/input/tablet/acecad.c
> @@ -155,7 +155,7 @@ static int usb_acecad_probe(struct usb_interface *intf, const struct usb_device_
>  		goto fail1;
>  	}
>  
> -	acecad->data = usb_buffer_alloc(dev, 8, GFP_KERNEL, &acecad->data_dma);
> +	acecad->data = usb_alloc_coherent(dev, 8, GFP_KERNEL, &acecad->data_dma);
>  	if (!acecad->data) {
>  		err= -ENOMEM;
>  		goto fail1;
> @@ -241,7 +241,7 @@ static int usb_acecad_probe(struct usb_interface *intf, const struct usb_device_
>  
>  	return 0;
>  
> - fail2:	usb_buffer_free(dev, 8, acecad->data, acecad->data_dma);
> + fail2:	usb_free_coherent(dev, 8, acecad->data, acecad->data_dma);
>   fail1: input_free_device(input_dev);
>  	kfree(acecad);
>  	return err;
> @@ -256,7 +256,7 @@ static void usb_acecad_disconnect(struct usb_interface *intf)
>  		usb_kill_urb(acecad->irq);
>  		input_unregister_device(acecad->input);
>  		usb_free_urb(acecad->irq);
> -		usb_buffer_free(interface_to_usbdev(intf), 10, acecad->data, acecad->data_dma);
> +		usb_free_coherent(interface_to_usbdev(intf), 10, acecad->data, acecad->data_dma);
>  		kfree(acecad);
>  	}
>  }
> diff --git a/drivers/input/tablet/aiptek.c b/drivers/input/tablet/aiptek.c
> index 4be039d..51b80b0 100644
> --- a/drivers/input/tablet/aiptek.c
> +++ b/drivers/input/tablet/aiptek.c
> @@ -1711,8 +1711,8 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id)
>  		goto fail1;
>          }
>  
> -	aiptek->data = usb_buffer_alloc(usbdev, AIPTEK_PACKET_LENGTH,
> -					GFP_ATOMIC, &aiptek->data_dma);
> +	aiptek->data = usb_alloc_coherent(usbdev, AIPTEK_PACKET_LENGTH,
> +					  GFP_ATOMIC, &aiptek->data_dma);
>          if (!aiptek->data) {
>  		dev_warn(&intf->dev, "cannot allocate usb buffer\n");
>  		goto fail1;
> @@ -1884,8 +1884,8 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id)
>  
>   fail4:	sysfs_remove_group(&intf->dev.kobj, &aiptek_attribute_group);
>   fail3: usb_free_urb(aiptek->urb);
> - fail2:	usb_buffer_free(usbdev, AIPTEK_PACKET_LENGTH, aiptek->data,
> -			aiptek->data_dma);
> + fail2:	usb_free_coherent(usbdev, AIPTEK_PACKET_LENGTH, aiptek->data,
> +			  aiptek->data_dma);
>   fail1: usb_set_intfdata(intf, NULL);
>  	input_free_device(inputdev);
>  	kfree(aiptek);
> @@ -1909,9 +1909,9 @@ static void aiptek_disconnect(struct usb_interface *intf)
>  		input_unregister_device(aiptek->inputdev);
>  		sysfs_remove_group(&intf->dev.kobj, &aiptek_attribute_group);
>  		usb_free_urb(aiptek->urb);
> -		usb_buffer_free(interface_to_usbdev(intf),
> -				AIPTEK_PACKET_LENGTH,
> -				aiptek->data, aiptek->data_dma);
> +		usb_free_coherent(interface_to_usbdev(intf),
> +				  AIPTEK_PACKET_LENGTH,
> +				  aiptek->data, aiptek->data_dma);
>  		kfree(aiptek);
>  	}
>  }
> diff --git a/drivers/input/tablet/gtco.c b/drivers/input/tablet/gtco.c
> index 866a9ee..8ea6afe 100644
> --- a/drivers/input/tablet/gtco.c
> +++ b/drivers/input/tablet/gtco.c
> @@ -850,8 +850,8 @@ static int gtco_probe(struct usb_interface *usbinterface,
>  	gtco->usbdev = usb_get_dev(interface_to_usbdev(usbinterface));
>  
>  	/* Allocate some data for incoming reports */
> -	gtco->buffer = usb_buffer_alloc(gtco->usbdev, REPORT_MAX_SIZE,
> -					GFP_KERNEL, &gtco->buf_dma);
> +	gtco->buffer = usb_alloc_coherent(gtco->usbdev, REPORT_MAX_SIZE,
> +					  GFP_KERNEL, &gtco->buf_dma);
>  	if (!gtco->buffer) {
>  		err("No more memory for us buffers");
>  		error = -ENOMEM;
> @@ -982,8 +982,8 @@ static int gtco_probe(struct usb_interface *usbinterface,
>   err_free_urb:
>  	usb_free_urb(gtco->urbinfo);
>   err_free_buf:
> -	usb_buffer_free(gtco->usbdev, REPORT_MAX_SIZE,
> -			gtco->buffer, gtco->buf_dma);
> +	usb_free_coherent(gtco->usbdev, REPORT_MAX_SIZE,
> +			  gtco->buffer, gtco->buf_dma);
>   err_free_devs:
>  	input_free_device(input_dev);
>  	kfree(gtco);
> @@ -1005,8 +1005,8 @@ static void gtco_disconnect(struct usb_interface *interface)
>  		input_unregister_device(gtco->inputdevice);
>  		usb_kill_urb(gtco->urbinfo);
>  		usb_free_urb(gtco->urbinfo);
> -		usb_buffer_free(gtco->usbdev, REPORT_MAX_SIZE,
> -				gtco->buffer, gtco->buf_dma);
> +		usb_free_coherent(gtco->usbdev, REPORT_MAX_SIZE,
> +				  gtco->buffer, gtco->buf_dma);
>  		kfree(gtco);
>  	}
>  
> diff --git a/drivers/input/tablet/kbtab.c b/drivers/input/tablet/kbtab.c
> index 6682b17..d31b9c7 100644
> --- a/drivers/input/tablet/kbtab.c
> +++ b/drivers/input/tablet/kbtab.c
> @@ -129,7 +129,7 @@ static int kbtab_probe(struct usb_interface *intf, const struct usb_device_id *i
>  	if (!kbtab || !input_dev)
>  		goto fail1;
>  
> -	kbtab->data = usb_buffer_alloc(dev, 8, GFP_KERNEL, &kbtab->data_dma);
> +	kbtab->data = usb_alloc_coherent(dev, 8, GFP_KERNEL, &kbtab->data_dma);
>  	if (!kbtab->data)
>  		goto fail1;
>  
> @@ -182,7 +182,7 @@ static int kbtab_probe(struct usb_interface *intf, const struct usb_device_id *i
>  	return 0;
>  
>   fail3:	usb_free_urb(kbtab->irq);
> - fail2:	usb_buffer_free(dev, 10, kbtab->data, kbtab->data_dma);
> + fail2:	usb_free_coherent(dev, 10, kbtab->data, kbtab->data_dma);
>   fail1:	input_free_device(input_dev);
>  	kfree(kbtab);
>  	return error;
> @@ -197,7 +197,7 @@ static void kbtab_disconnect(struct usb_interface *intf)
>  		usb_kill_urb(kbtab->irq);
>  		input_unregister_device(kbtab->dev);
>  		usb_free_urb(kbtab->irq);
> -		usb_buffer_free(interface_to_usbdev(intf), 10, kbtab->data, kbtab->data_dma);
> +		usb_free_coherent(interface_to_usbdev(intf), 10, kbtab->data, kbtab->data_dma);
>  		kfree(kbtab);
>  	}
>  }
> diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
> index 8b5d287..5d5b3c3 100644
> --- a/drivers/input/tablet/wacom_sys.c
> +++ b/drivers/input/tablet/wacom_sys.c
> @@ -556,8 +556,8 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
>  		goto fail1;
>  	}
>  
> -	wacom_wac->data = usb_buffer_alloc(dev, WACOM_PKGLEN_MAX,
> -					   GFP_KERNEL, &wacom->data_dma);
> +	wacom_wac->data = usb_alloc_coherent(dev, WACOM_PKGLEN_MAX,
> +					     GFP_KERNEL, &wacom->data_dma);
>  	if (!wacom_wac->data) {
>  		error = -ENOMEM;
>  		goto fail1;
> @@ -633,7 +633,7 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
>  	return 0;
>  
>   fail3:	usb_free_urb(wacom->irq);
> - fail2:	usb_buffer_free(dev, WACOM_PKGLEN_MAX, wacom_wac->data, wacom->data_dma);
> + fail2:	usb_free_coherent(dev, WACOM_PKGLEN_MAX, wacom_wac->data, wacom->data_dma);
>   fail1:	input_free_device(input_dev);
>  	kfree(wacom);
>  	kfree(wacom_wac);
> @@ -649,8 +649,8 @@ static void wacom_disconnect(struct usb_interface *intf)
>  	usb_kill_urb(wacom->irq);
>  	input_unregister_device(wacom->dev);
>  	usb_free_urb(wacom->irq);
> -	usb_buffer_free(interface_to_usbdev(intf), WACOM_PKGLEN_MAX,
> -			wacom->wacom_wac->data, wacom->data_dma);
> +	usb_free_coherent(interface_to_usbdev(intf), WACOM_PKGLEN_MAX,
> +			  wacom->wacom_wac->data, wacom->data_dma);
>  	kfree(wacom->wacom_wac);
>  	kfree(wacom);
>  }
> diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c
> index 99330bb..ea41a85 100644
> --- a/drivers/input/touchscreen/usbtouchscreen.c
> +++ b/drivers/input/touchscreen/usbtouchscreen.c
> @@ -1291,8 +1291,8 @@ static void usbtouch_close(struct input_dev *input)
>  static void usbtouch_free_buffers(struct usb_device *udev,
>  				  struct usbtouch_usb *usbtouch)
>  {
> -	usb_buffer_free(udev, usbtouch->type->rept_size,
> -	                usbtouch->data, usbtouch->data_dma);
> +	usb_free_coherent(udev, usbtouch->type->rept_size,
> +			  usbtouch->data, usbtouch->data_dma);
>  	kfree(usbtouch->buffer);
>  }
>  
> @@ -1336,8 +1336,8 @@ static int usbtouch_probe(struct usb_interface *intf,
>  	if (!type->process_pkt)
>  		type->process_pkt = usbtouch_process_pkt;
>  
> -	usbtouch->data = usb_buffer_alloc(udev, type->rept_size,
> -	                                  GFP_KERNEL, &usbtouch->data_dma);
> +	usbtouch->data = usb_alloc_coherent(udev, type->rept_size,
> +					    GFP_KERNEL, &usbtouch->data_dma);
>  	if (!usbtouch->data)
>  		goto out_free;
>  
> diff --git a/drivers/media/dvb/dvb-usb/usb-urb.c b/drivers/media/dvb/dvb-usb/usb-urb.c
> index f9702e3..86d6893 100644
> --- a/drivers/media/dvb/dvb-usb/usb-urb.c
> +++ b/drivers/media/dvb/dvb-usb/usb-urb.c
> @@ -96,8 +96,9 @@ static int usb_free_stream_buffers(struct usb_data_stream *stream)
>  		while (stream->buf_num) {
>  			stream->buf_num--;
>  			deb_mem("freeing buffer %d\n",stream->buf_num);
> -			usb_buffer_free(stream->udev, stream->buf_size,
> -					stream->buf_list[stream->buf_num], stream->dma_addr[stream->buf_num]);
> +			usb_free_coherent(stream->udev, stream->buf_size,
> +					  stream->buf_list[stream->buf_num],
> +					  stream->dma_addr[stream->buf_num]);
>  		}
>  	}
>  
> @@ -116,7 +117,7 @@ static int usb_allocate_stream_buffers(struct usb_data_stream *stream, int num,
>  	for (stream->buf_num = 0; stream->buf_num < num; stream->buf_num++) {
>  		deb_mem("allocating buffer %d\n",stream->buf_num);
>  		if (( stream->buf_list[stream->buf_num] =
> -					usb_buffer_alloc(stream->udev, size, GFP_ATOMIC,
> +					usb_alloc_coherent(stream->udev, size, GFP_ATOMIC,
>  					&stream->dma_addr[stream->buf_num]) ) == NULL) {
>  			deb_mem("not enough memory for urb-buffer allocation.\n");
>  			usb_free_stream_buffers(stream);
> diff --git a/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/drivers/media/dvb/ttusb-dec/ttusb_dec.c
> index 53baccb..fe1b803 100644
> --- a/drivers/media/dvb/ttusb-dec/ttusb_dec.c
> +++ b/drivers/media/dvb/ttusb-dec/ttusb_dec.c
> @@ -1257,7 +1257,7 @@ static int ttusb_dec_init_usb(struct ttusb_dec *dec)
>  		if(!dec->irq_urb) {
>  			return -ENOMEM;
>  		}
> -		dec->irq_buffer = usb_buffer_alloc(dec->udev,IRQ_PACKET_SIZE,
> +		dec->irq_buffer = usb_alloc_coherent(dec->udev,IRQ_PACKET_SIZE,
>  					GFP_ATOMIC, &dec->irq_dma_handle);
>  		if(!dec->irq_buffer) {
>  			usb_free_urb(dec->irq_urb);
> @@ -1550,8 +1550,8 @@ static void ttusb_dec_exit_rc(struct ttusb_dec *dec)
>  
>  	usb_free_urb(dec->irq_urb);
>  
> -	usb_buffer_free(dec->udev,IRQ_PACKET_SIZE,
> -			   dec->irq_buffer, dec->irq_dma_handle);
> +	usb_free_coherent(dec->udev,IRQ_PACKET_SIZE,
> +			  dec->irq_buffer, dec->irq_dma_handle);
>  
>  	if (dec->rc_input_dev) {
>  		input_unregister_device(dec->rc_input_dev);
> diff --git a/drivers/media/video/au0828/au0828-video.c b/drivers/media/video/au0828/au0828-video.c
> index 8c140c0..a2a0f79 100644
> --- a/drivers/media/video/au0828/au0828-video.c
> +++ b/drivers/media/video/au0828/au0828-video.c
> @@ -177,7 +177,7 @@ void au0828_uninit_isoc(struct au0828_dev *dev)
>  				usb_unlink_urb(urb);
>  
>  			if (dev->isoc_ctl.transfer_buffer[i]) {
> -				usb_buffer_free(dev->usbdev,
> +				usb_free_coherent(dev->usbdev,
>  					urb->transfer_buffer_length,
>  					dev->isoc_ctl.transfer_buffer[i],
>  					urb->transfer_dma);
> @@ -247,7 +247,7 @@ int au0828_init_isoc(struct au0828_dev *dev, int max_packets,
>  		}
>  		dev->isoc_ctl.urb[i] = urb;
>  
> -		dev->isoc_ctl.transfer_buffer[i] = usb_buffer_alloc(dev->usbdev,
> +		dev->isoc_ctl.transfer_buffer[i] = usb_alloc_coherent(dev->usbdev,
>  			sb_size, GFP_KERNEL, &urb->transfer_dma);
>  		if (!dev->isoc_ctl.transfer_buffer[i]) {
>  			printk("unable to allocate %i bytes for transfer"
> diff --git a/drivers/media/video/cx231xx/cx231xx-core.c b/drivers/media/video/cx231xx/cx231xx-core.c
> index b24eee1..6ccd87d 100644
> --- a/drivers/media/video/cx231xx/cx231xx-core.c
> +++ b/drivers/media/video/cx231xx/cx231xx-core.c
> @@ -679,11 +679,11 @@ void cx231xx_uninit_isoc(struct cx231xx *dev)
>  				usb_unlink_urb(urb);
>  
>  			if (dev->video_mode.isoc_ctl.transfer_buffer[i]) {
> -				usb_buffer_free(dev->udev,
> -						urb->transfer_buffer_length,
> -						dev->video_mode.isoc_ctl.
> -						transfer_buffer[i],
> -						urb->transfer_dma);
> +				usb_free_coherent(dev->udev,
> +						  urb->transfer_buffer_length,
> +						  dev->video_mode.isoc_ctl.
> +						  transfer_buffer[i],
> +						  urb->transfer_dma);
>  			}
>  			usb_free_urb(urb);
>  			dev->video_mode.isoc_ctl.urb[i] = NULL;
> @@ -770,8 +770,8 @@ int cx231xx_init_isoc(struct cx231xx *dev, int max_packets,
>  		dev->video_mode.isoc_ctl.urb[i] = urb;
>  
>  		dev->video_mode.isoc_ctl.transfer_buffer[i] =
> -		    usb_buffer_alloc(dev->udev, sb_size, GFP_KERNEL,
> -				     &urb->transfer_dma);
> +		    usb_alloc_coherent(dev->udev, sb_size, GFP_KERNEL,
> +				       &urb->transfer_dma);
>  		if (!dev->video_mode.isoc_ctl.transfer_buffer[i]) {
>  			cx231xx_err("unable to allocate %i bytes for transfer"
>  				    " buffer %i%s\n",
> diff --git a/drivers/media/video/em28xx/em28xx-core.c b/drivers/media/video/em28xx/em28xx-core.c
> index a41cc55..d4a9554 100644
> --- a/drivers/media/video/em28xx/em28xx-core.c
> +++ b/drivers/media/video/em28xx/em28xx-core.c
> @@ -966,7 +966,7 @@ void em28xx_uninit_isoc(struct em28xx *dev)
>  				usb_unlink_urb(urb);
>  
>  			if (dev->isoc_ctl.transfer_buffer[i]) {
> -				usb_buffer_free(dev->udev,
> +				usb_free_coherent(dev->udev,
>  					urb->transfer_buffer_length,
>  					dev->isoc_ctl.transfer_buffer[i],
>  					urb->transfer_dma);
> @@ -1041,7 +1041,7 @@ int em28xx_init_isoc(struct em28xx *dev, int max_packets,
>  		}
>  		dev->isoc_ctl.urb[i] = urb;
>  
> -		dev->isoc_ctl.transfer_buffer[i] = usb_buffer_alloc(dev->udev,
> +		dev->isoc_ctl.transfer_buffer[i] = usb_alloc_coherent(dev->udev,
>  			sb_size, GFP_KERNEL, &urb->transfer_dma);
>  		if (!dev->isoc_ctl.transfer_buffer[i]) {
>  			em28xx_err("unable to allocate %i bytes for transfer"
> diff --git a/drivers/media/video/gspca/benq.c b/drivers/media/video/gspca/benq.c
> index 43ac4af..fce8d94 100644
> --- a/drivers/media/video/gspca/benq.c
> +++ b/drivers/media/video/gspca/benq.c
> @@ -117,13 +117,13 @@ static int sd_start(struct gspca_dev *gspca_dev)
>  			return -ENOMEM;
>  		}
>  		gspca_dev->urb[n] = urb;
> -		urb->transfer_buffer = usb_buffer_alloc(gspca_dev->dev,
> +		urb->transfer_buffer = usb_alloc_coherent(gspca_dev->dev,
>  						SD_PKT_SZ * SD_NPKT,
>  						GFP_KERNEL,
>  						&urb->transfer_dma);
>  
>  		if (urb->transfer_buffer == NULL) {
> -			err("usb_buffer_alloc failed");
> +			err("usb_alloc_coherent failed");
>  			return -ENOMEM;
>  		}
>  		urb->dev = gspca_dev->dev;
> diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c
> index 222af47..00713f8 100644
> --- a/drivers/media/video/gspca/gspca.c
> +++ b/drivers/media/video/gspca/gspca.c
> @@ -213,7 +213,7 @@ static int alloc_and_submit_int_urb(struct gspca_dev *gspca_dev,
>  		goto error;
>  	}
>  
> -	buffer = usb_buffer_alloc(dev, ep->wMaxPacketSize,
> +	buffer = usb_alloc_coherent(dev, ep->wMaxPacketSize,
>  				GFP_KERNEL, &urb->transfer_dma);
>  	if (!buffer) {
>  		ret = -ENOMEM;
> @@ -232,10 +232,10 @@ static int alloc_and_submit_int_urb(struct gspca_dev *gspca_dev,
>  	return ret;
>  
>  error_submit:
> -	usb_buffer_free(dev,
> -			urb->transfer_buffer_length,
> -			urb->transfer_buffer,
> -			urb->transfer_dma);
> +	usb_free_coherent(dev,
> +			  urb->transfer_buffer_length,
> +			  urb->transfer_buffer,
> +			  urb->transfer_dma);
>  error_buffer:
>  	usb_free_urb(urb);
>  error:
> @@ -272,10 +272,10 @@ static void gspca_input_destroy_urb(struct gspca_dev *gspca_dev)
>  	if (urb) {
>  		gspca_dev->int_urb = NULL;
>  		usb_kill_urb(urb);
> -		usb_buffer_free(gspca_dev->dev,
> -				urb->transfer_buffer_length,
> -				urb->transfer_buffer,
> -				urb->transfer_dma);
> +		usb_free_coherent(gspca_dev->dev,
> +				  urb->transfer_buffer_length,
> +				  urb->transfer_buffer,
> +				  urb->transfer_dma);
>  		usb_free_urb(urb);
>  	}
>  }
> @@ -597,10 +597,10 @@ static void destroy_urbs(struct gspca_dev *gspca_dev)
>  		gspca_dev->urb[i] = NULL;
>  		usb_kill_urb(urb);
>  		if (urb->transfer_buffer != NULL)
> -			usb_buffer_free(gspca_dev->dev,
> -					urb->transfer_buffer_length,
> -					urb->transfer_buffer,
> -					urb->transfer_dma);
> +			usb_free_coherent(gspca_dev->dev,
> +					  urb->transfer_buffer_length,
> +					  urb->transfer_buffer,
> +					  urb->transfer_dma);
>  		usb_free_urb(urb);
>  	}
>  }
> @@ -721,13 +721,13 @@ static int create_urbs(struct gspca_dev *gspca_dev,
>  			return -ENOMEM;
>  		}
>  		gspca_dev->urb[n] = urb;
> -		urb->transfer_buffer = usb_buffer_alloc(gspca_dev->dev,
> +		urb->transfer_buffer = usb_alloc_coherent(gspca_dev->dev,
>  						bsize,
>  						GFP_KERNEL,
>  						&urb->transfer_dma);
>  
>  		if (urb->transfer_buffer == NULL) {
> -			err("usb_buffer_alloc failed");
> +			err("usb_alloc_coherent failed");
>  			return -ENOMEM;
>  		}
>  		urb->dev = gspca_dev->dev;
> diff --git a/drivers/media/video/hdpvr/hdpvr-video.c b/drivers/media/video/hdpvr/hdpvr-video.c
> index 196f82d..b65efe2 100644
> --- a/drivers/media/video/hdpvr/hdpvr-video.c
> +++ b/drivers/media/video/hdpvr/hdpvr-video.c
> @@ -92,8 +92,8 @@ static int hdpvr_free_queue(struct list_head *q)
>  		buf = list_entry(p, struct hdpvr_buffer, buff_list);
>  
>  		urb = buf->urb;
> -		usb_buffer_free(urb->dev, urb->transfer_buffer_length,
> -				urb->transfer_buffer, urb->transfer_dma);
> +		usb_free_coherent(urb->dev, urb->transfer_buffer_length,
> +				  urb->transfer_buffer, urb->transfer_dma);
>  		usb_free_urb(urb);
>  		tmp = p->next;
>  		list_del(p);
> @@ -143,8 +143,8 @@ int hdpvr_alloc_buffers(struct hdpvr_device *dev, uint count)
>  		}
>  		buf->urb = urb;
>  
> -		mem = usb_buffer_alloc(dev->udev, dev->bulk_in_size, GFP_KERNEL,
> -				       &urb->transfer_dma);
> +		mem = usb_alloc_coherent(dev->udev, dev->bulk_in_size, GFP_KERNEL,
> +					 &urb->transfer_dma);
>  		if (!mem) {
>  			v4l2_err(&dev->v4l2_dev,
>  				 "cannot allocate usb transfer buffer\n");
> diff --git a/drivers/media/video/tlg2300/pd-video.c b/drivers/media/video/tlg2300/pd-video.c
> index cf8f18c..7bc2906 100644
> --- a/drivers/media/video/tlg2300/pd-video.c
> +++ b/drivers/media/video/tlg2300/pd-video.c
> @@ -476,10 +476,10 @@ static int prepare_iso_urb(struct video_data *video)
>  			goto out;
>  
>  		video->urb_array[i] = urb;
> -		mem = usb_buffer_alloc(udev,
> -					ISO_PKT_SIZE * PK_PER_URB,
> -					GFP_KERNEL,
> -					&urb->transfer_dma);
> +		mem = usb_alloc_coherent(udev,
> +					 ISO_PKT_SIZE * PK_PER_URB,
> +					 GFP_KERNEL,
> +					 &urb->transfer_dma);
>  
>  		urb->complete	= urb_complete_iso;	/* handler */
>  		urb->dev	= udev;
> @@ -519,8 +519,8 @@ int alloc_bulk_urbs_generic(struct urb **urb_array, int num,
>  		if (urb == NULL)
>  			return i;
>  
> -		mem = usb_buffer_alloc(udev, buf_size, gfp_flags,
> -					&urb->transfer_dma);
> +		mem = usb_alloc_coherent(udev, buf_size, gfp_flags,
> +					 &urb->transfer_dma);
>  		if (mem == NULL)
>  			return i;
>  
> @@ -540,7 +540,7 @@ void free_all_urb_generic(struct urb **urb_array, int num)
>  	for (i = 0; i < num; i++) {
>  		urb = urb_array[i];
>  		if (urb) {
> -			usb_buffer_free(urb->dev,
> +			usb_free_coherent(urb->dev,
>  					urb->transfer_buffer_length,
>  					urb->transfer_buffer,
>  					urb->transfer_dma);
> diff --git a/drivers/media/video/usbvision/usbvision-core.c b/drivers/media/video/usbvision/usbvision-core.c
> index f7aae22..b9dd74f 100644
> --- a/drivers/media/video/usbvision/usbvision-core.c
> +++ b/drivers/media/video/usbvision/usbvision-core.c
> @@ -2493,10 +2493,10 @@ int usbvision_init_isoc(struct usb_usbvision *usbvision)
>  		}
>  		usbvision->sbuf[bufIdx].urb = urb;
>  		usbvision->sbuf[bufIdx].data =
> -			usb_buffer_alloc(usbvision->dev,
> -					 sb_size,
> -					 GFP_KERNEL,
> -					 &urb->transfer_dma);
> +			usb_alloc_coherent(usbvision->dev,
> +					   sb_size,
> +					   GFP_KERNEL,
> +					   &urb->transfer_dma);
>  		urb->dev = dev;
>  		urb->context = usbvision;
>  		urb->pipe = usb_rcvisocpipe(dev, usbvision->video_endp);
> @@ -2552,10 +2552,10 @@ void usbvision_stop_isoc(struct usb_usbvision *usbvision)
>  	for (bufIdx = 0; bufIdx < USBVISION_NUMSBUF; bufIdx++) {
>  		usb_kill_urb(usbvision->sbuf[bufIdx].urb);
>  		if (usbvision->sbuf[bufIdx].data){
> -			usb_buffer_free(usbvision->dev,
> -					sb_size,
> -					usbvision->sbuf[bufIdx].data,
> -					usbvision->sbuf[bufIdx].urb->transfer_dma);
> +			usb_free_coherent(usbvision->dev,
> +					  sb_size,
> +					  usbvision->sbuf[bufIdx].data,
> +					  usbvision->sbuf[bufIdx].urb->transfer_dma);
>  		}
>  		usb_free_urb(usbvision->sbuf[bufIdx].urb);
>  		usbvision->sbuf[bufIdx].urb = NULL;
> diff --git a/drivers/media/video/uvc/uvc_video.c b/drivers/media/video/uvc/uvc_video.c
> index 821a996..53f3ef4 100644
> --- a/drivers/media/video/uvc/uvc_video.c
> +++ b/drivers/media/video/uvc/uvc_video.c
> @@ -739,7 +739,7 @@ static void uvc_free_urb_buffers(struct uvc_streaming *stream)
>  
>  	for (i = 0; i < UVC_URBS; ++i) {
>  		if (stream->urb_buffer[i]) {
> -			usb_buffer_free(stream->dev->udev, stream->urb_size,
> +			usb_free_coherent(stream->dev->udev, stream->urb_size,
>  				stream->urb_buffer[i], stream->urb_dma[i]);
>  			stream->urb_buffer[i] = NULL;
>  		}
> @@ -780,7 +780,7 @@ static int uvc_alloc_urb_buffers(struct uvc_streaming *stream,
>  	for (; npackets > 1; npackets /= 2) {
>  		for (i = 0; i < UVC_URBS; ++i) {
>  			stream->urb_size = psize * npackets;
> -			stream->urb_buffer[i] = usb_buffer_alloc(
> +			stream->urb_buffer[i] = usb_alloc_coherent(
>  				stream->dev->udev, stream->urb_size,
>  				gfp_flags | __GFP_NOWARN, &stream->urb_dma[i]);
>  			if (!stream->urb_buffer[i]) {
> diff --git a/drivers/net/can/usb/ems_usb.c b/drivers/net/can/usb/ems_usb.c
> index 3345109..62be62f 100644
> --- a/drivers/net/can/usb/ems_usb.c
> +++ b/drivers/net/can/usb/ems_usb.c
> @@ -516,8 +516,8 @@ static void ems_usb_write_bulk_callback(struct urb *urb)
>  	netdev = dev->netdev;
>  
>  	/* free up our allocated buffer */
> -	usb_buffer_free(urb->dev, urb->transfer_buffer_length,
> -			urb->transfer_buffer, urb->transfer_dma);
> +	usb_free_coherent(urb->dev, urb->transfer_buffer_length,
> +			  urb->transfer_buffer, urb->transfer_dma);
>  
>  	atomic_dec(&dev->active_tx_urbs);
>  
> @@ -614,8 +614,8 @@ static int ems_usb_start(struct ems_usb *dev)
>  			return -ENOMEM;
>  		}
>  
> -		buf = usb_buffer_alloc(dev->udev, RX_BUFFER_SIZE, GFP_KERNEL,
> -				       &urb->transfer_dma);
> +		buf = usb_alloc_coherent(dev->udev, RX_BUFFER_SIZE, GFP_KERNEL,
> +					 &urb->transfer_dma);
>  		if (!buf) {
>  			dev_err(netdev->dev.parent,
>  				"No memory left for USB buffer\n");
> @@ -635,8 +635,8 @@ static int ems_usb_start(struct ems_usb *dev)
>  				netif_device_detach(dev->netdev);
>  
>  			usb_unanchor_urb(urb);
> -			usb_buffer_free(dev->udev, RX_BUFFER_SIZE, buf,
> -					urb->transfer_dma);
> +			usb_free_coherent(dev->udev, RX_BUFFER_SIZE, buf,
> +					  urb->transfer_dma);
>  			break;
>  		}
>  
> @@ -777,7 +777,7 @@ static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *ne
>  		goto nomem;
>  	}
>  
> -	buf = usb_buffer_alloc(dev->udev, size, GFP_ATOMIC, &urb->transfer_dma);
> +	buf = usb_alloc_coherent(dev->udev, size, GFP_ATOMIC, &urb->transfer_dma);
>  	if (!buf) {
>  		dev_err(netdev->dev.parent, "No memory left for USB buffer\n");
>  		usb_free_urb(urb);
> @@ -820,7 +820,7 @@ static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *ne
>  	 */
>  	if (!context) {
>  		usb_unanchor_urb(urb);
> -		usb_buffer_free(dev->udev, size, buf, urb->transfer_dma);
> +		usb_free_coherent(dev->udev, size, buf, urb->transfer_dma);
>  
>  		dev_warn(netdev->dev.parent, "couldn't find free context\n");
>  
> @@ -845,7 +845,7 @@ static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *ne
>  		can_free_echo_skb(netdev, context->echo_index);
>  
>  		usb_unanchor_urb(urb);
> -		usb_buffer_free(dev->udev, size, buf, urb->transfer_dma);
> +		usb_free_coherent(dev->udev, size, buf, urb->transfer_dma);
>  		dev_kfree_skb(skb);
>  
>  		atomic_dec(&dev->active_tx_urbs);
> diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c
> index 52671ea..a790a6d 100644
> --- a/drivers/net/usb/kaweth.c
> +++ b/drivers/net/usb/kaweth.c
> @@ -1155,13 +1155,13 @@ err_fw:
>  	if (!kaweth->irq_urb)
>  		goto err_tx_and_rx;
>  
> -	kaweth->intbuffer = usb_buffer_alloc(	kaweth->dev,
> +	kaweth->intbuffer = usb_alloc_coherent(	kaweth->dev,
>  						INTBUFFERSIZE,
>  						GFP_KERNEL,
>  						&kaweth->intbufferhandle);
>  	if (!kaweth->intbuffer)
>  		goto err_tx_and_rx_and_irq;
> -	kaweth->rx_buf = usb_buffer_alloc(	kaweth->dev,
> +	kaweth->rx_buf = usb_alloc_coherent(	kaweth->dev,
>  						KAWETH_BUF_SIZE,
>  						GFP_KERNEL,
>  						&kaweth->rxbufferhandle);
> @@ -1202,9 +1202,9 @@ err_fw:
>  
>  err_intfdata:
>  	usb_set_intfdata(intf, NULL);
> -	usb_buffer_free(kaweth->dev, KAWETH_BUF_SIZE, (void *)kaweth->rx_buf, kaweth->rxbufferhandle);
> +	usb_free_coherent(kaweth->dev, KAWETH_BUF_SIZE, (void *)kaweth->rx_buf, kaweth->rxbufferhandle);
>  err_all_but_rxbuf:
> -	usb_buffer_free(kaweth->dev, INTBUFFERSIZE, (void *)kaweth->intbuffer, kaweth->intbufferhandle);
> +	usb_free_coherent(kaweth->dev, INTBUFFERSIZE, (void *)kaweth->intbuffer, kaweth->intbufferhandle);
>  err_tx_and_rx_and_irq:
>  	usb_free_urb(kaweth->irq_urb);
>  err_tx_and_rx:
> @@ -1241,8 +1241,8 @@ static void kaweth_disconnect(struct usb_interface *intf)
>  	usb_free_urb(kaweth->tx_urb);
>  	usb_free_urb(kaweth->irq_urb);
>  
> -	usb_buffer_free(kaweth->dev, KAWETH_BUF_SIZE, (void *)kaweth->rx_buf, kaweth->rxbufferhandle);
> -	usb_buffer_free(kaweth->dev, INTBUFFERSIZE, (void *)kaweth->intbuffer, kaweth->intbufferhandle);
> +	usb_free_coherent(kaweth->dev, KAWETH_BUF_SIZE, (void *)kaweth->rx_buf, kaweth->rxbufferhandle);
> +	usb_free_coherent(kaweth->dev, INTBUFFERSIZE, (void *)kaweth->intbuffer, kaweth->intbufferhandle);
>  
>  	free_netdev(netdev);
>  }
> diff --git a/drivers/net/wireless/ath/ar9170/usb.c b/drivers/net/wireless/ath/ar9170/usb.c
> index 0b0d2dc..14eda1d 100644
> --- a/drivers/net/wireless/ath/ar9170/usb.c
> +++ b/drivers/net/wireless/ath/ar9170/usb.c
> @@ -200,7 +200,7 @@ resubmit:
>  	return;
>  
>  free:
> -	usb_buffer_free(aru->udev, 64, urb->transfer_buffer, urb->transfer_dma);
> +	usb_free_coherent(aru->udev, 64, urb->transfer_buffer, urb->transfer_dma);
>  }
>  
>  static void ar9170_usb_rx_completed(struct urb *urb)
> @@ -281,7 +281,7 @@ static int ar9170_usb_alloc_rx_irq_urb(struct ar9170_usb *aru)
>  	if (!urb)
>  		goto out;
>  
> -	ibuf = usb_buffer_alloc(aru->udev, 64, GFP_KERNEL, &urb->transfer_dma);
> +	ibuf = usb_alloc_coherent(aru->udev, 64, GFP_KERNEL, &urb->transfer_dma);
>  	if (!ibuf)
>  		goto out;
>  
> @@ -294,8 +294,8 @@ static int ar9170_usb_alloc_rx_irq_urb(struct ar9170_usb *aru)
>  	err = usb_submit_urb(urb, GFP_KERNEL);
>  	if (err) {
>  		usb_unanchor_urb(urb);
> -		usb_buffer_free(aru->udev, 64, urb->transfer_buffer,
> -				urb->transfer_dma);
> +		usb_free_coherent(aru->udev, 64, urb->transfer_buffer,
> +				  urb->transfer_dma);
>  	}
>  
>  out:
> diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c
> index d91ad1a..c257940 100644
> --- a/drivers/net/wireless/zd1211rw/zd_usb.c
> +++ b/drivers/net/wireless/zd1211rw/zd_usb.c
> @@ -664,15 +664,15 @@ static struct urb *alloc_rx_urb(struct zd_usb *usb)
>  	urb = usb_alloc_urb(0, GFP_KERNEL);
>  	if (!urb)
>  		return NULL;
> -	buffer = usb_buffer_alloc(udev, USB_MAX_RX_SIZE, GFP_KERNEL,
> -		                  &urb->transfer_dma);
> +	buffer = usb_alloc_coherent(udev, USB_MAX_RX_SIZE, GFP_KERNEL,
> +				    &urb->transfer_dma);
>  	if (!buffer) {
>  		usb_free_urb(urb);
>  		return NULL;
>  	}
>  
>  	usb_fill_bulk_urb(urb, udev, usb_rcvbulkpipe(udev, EP_DATA_IN),
> -		          buffer, USB_MAX_RX_SIZE,
> +			  buffer, USB_MAX_RX_SIZE,
>  			  rx_urb_complete, usb);
>  	urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
>  
> @@ -683,8 +683,8 @@ static void free_rx_urb(struct urb *urb)
>  {
>  	if (!urb)
>  		return;
> -	usb_buffer_free(urb->dev, urb->transfer_buffer_length,
> -		        urb->transfer_buffer, urb->transfer_dma);
> +	usb_free_coherent(urb->dev, urb->transfer_buffer_length,
> +			  urb->transfer_buffer, urb->transfer_dma);
>  	usb_free_urb(urb);
>  }
>  
> diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
> index be6331e..66713ed 100644
> --- a/drivers/usb/class/cdc-acm.c
> +++ b/drivers/usb/class/cdc-acm.c
> @@ -892,7 +892,7 @@ static void acm_write_buffers_free(struct acm *acm)
>  	struct usb_device *usb_dev = interface_to_usbdev(acm->control);
>  
>  	for (wb = &acm->wb[0], i = 0; i < ACM_NW; i++, wb++)
> -		usb_buffer_free(usb_dev, acm->writesize, wb->buf, wb->dmah);
> +		usb_free_coherent(usb_dev, acm->writesize, wb->buf, wb->dmah);
>  }
>  
>  static void acm_read_buffers_free(struct acm *acm)
> @@ -901,8 +901,8 @@ static void acm_read_buffers_free(struct acm *acm)
>  	int i, n = acm->rx_buflimit;
>  
>  	for (i = 0; i < n; i++)
> -		usb_buffer_free(usb_dev, acm->readsize,
> -					acm->rb[i].base, acm->rb[i].dma);
> +		usb_free_coherent(usb_dev, acm->readsize,
> +				  acm->rb[i].base, acm->rb[i].dma);
>  }
>  
>  /* Little helper: write buffers allocate */
> @@ -912,13 +912,13 @@ static int acm_write_buffers_alloc(struct acm *acm)
>  	struct acm_wb *wb;
>  
>  	for (wb = &acm->wb[0], i = 0; i < ACM_NW; i++, wb++) {
> -		wb->buf = usb_buffer_alloc(acm->dev, acm->writesize, GFP_KERNEL,
> +		wb->buf = usb_alloc_coherent(acm->dev, acm->writesize, GFP_KERNEL,
>  		    &wb->dmah);
>  		if (!wb->buf) {
>  			while (i != 0) {
>  				--i;
>  				--wb;
> -				usb_buffer_free(acm->dev, acm->writesize,
> +				usb_free_coherent(acm->dev, acm->writesize,
>  				    wb->buf, wb->dmah);
>  			}
>  			return -ENOMEM;
> @@ -1177,7 +1177,7 @@ made_compressed_probe:
>  	tty_port_init(&acm->port);
>  	acm->port.ops = &acm_port_ops;
>  
> -	buf = usb_buffer_alloc(usb_dev, ctrlsize, GFP_KERNEL, &acm->ctrl_dma);
> +	buf = usb_alloc_coherent(usb_dev, ctrlsize, GFP_KERNEL, &acm->ctrl_dma);
>  	if (!buf) {
>  		dev_dbg(&intf->dev, "out of memory (ctrl buffer alloc)\n");
>  		goto alloc_fail2;
> @@ -1210,11 +1210,11 @@ made_compressed_probe:
>  	for (i = 0; i < num_rx_buf; i++) {
>  		struct acm_rb *rb = &(acm->rb[i]);
>  
> -		rb->base = usb_buffer_alloc(acm->dev, readsize,
> +		rb->base = usb_alloc_coherent(acm->dev, readsize,
>  				GFP_KERNEL, &rb->dma);
>  		if (!rb->base) {
>  			dev_dbg(&intf->dev,
> -				"out of memory (read bufs usb_buffer_alloc)\n");
> +				"out of memory (read bufs usb_alloc_coherent)\n");
>  			goto alloc_fail7;
>  		}
>  	}
> @@ -1306,7 +1306,7 @@ alloc_fail7:
>  alloc_fail5:
>  	acm_write_buffers_free(acm);
>  alloc_fail4:
> -	usb_buffer_free(usb_dev, ctrlsize, acm->ctrl_buffer, acm->ctrl_dma);
> +	usb_free_coherent(usb_dev, ctrlsize, acm->ctrl_buffer, acm->ctrl_dma);
>  alloc_fail2:
>  	kfree(acm);
>  alloc_fail:
> @@ -1356,8 +1356,8 @@ static void acm_disconnect(struct usb_interface *intf)
>  	stop_data_traffic(acm);
>  
>  	acm_write_buffers_free(acm);
> -	usb_buffer_free(usb_dev, acm->ctrlsize, acm->ctrl_buffer,
> -								acm->ctrl_dma);
> +	usb_free_coherent(usb_dev, acm->ctrlsize, acm->ctrl_buffer,
> +			  acm->ctrl_dma);
>  	acm_read_buffers_free(acm);
>  
>  	if (!acm->combined_interfaces)
> diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c
> index 189141c..094c76b 100644
> --- a/drivers/usb/class/cdc-wdm.c
> +++ b/drivers/usb/class/cdc-wdm.c
> @@ -276,14 +276,14 @@ static void free_urbs(struct wdm_device *desc)
>  
>  static void cleanup(struct wdm_device *desc)
>  {
> -	usb_buffer_free(interface_to_usbdev(desc->intf),
> -			desc->wMaxPacketSize,
> -			desc->sbuf,
> -			desc->validity->transfer_dma);
> -	usb_buffer_free(interface_to_usbdev(desc->intf),
> -			desc->wMaxCommand,
> -			desc->inbuf,
> -			desc->response->transfer_dma);
> +	usb_free_coherent(interface_to_usbdev(desc->intf),
> +			  desc->wMaxPacketSize,
> +			  desc->sbuf,
> +			  desc->validity->transfer_dma);
> +	usb_free_coherent(interface_to_usbdev(desc->intf),
> +			  desc->wMaxCommand,
> +			  desc->inbuf,
> +			  desc->response->transfer_dma);
>  	kfree(desc->orq);
>  	kfree(desc->irq);
>  	kfree(desc->ubuf);
> @@ -705,17 +705,17 @@ next_desc:
>  	if (!desc->ubuf)
>  		goto err;
>  
> -	desc->sbuf = usb_buffer_alloc(interface_to_usbdev(intf),
> +	desc->sbuf = usb_alloc_coherent(interface_to_usbdev(intf),
>  					desc->wMaxPacketSize,
>  					GFP_KERNEL,
>  					&desc->validity->transfer_dma);
>  	if (!desc->sbuf)
>  		goto err;
>  
> -	desc->inbuf = usb_buffer_alloc(interface_to_usbdev(intf),
> -					desc->bMaxPacketSize0,
> -					GFP_KERNEL,
> -					&desc->response->transfer_dma);
> +	desc->inbuf = usb_alloc_coherent(interface_to_usbdev(intf),
> +					 desc->bMaxPacketSize0,
> +					 GFP_KERNEL,
> +					 &desc->response->transfer_dma);
>  	if (!desc->inbuf)
>  		goto err2;
>  
> @@ -742,15 +742,15 @@ out:
>  	return rv;
>  err3:
>  	usb_set_intfdata(intf, NULL);
> -	usb_buffer_free(interface_to_usbdev(desc->intf),
> -			desc->bMaxPacketSize0,
> +	usb_free_coherent(interface_to_usbdev(desc->intf),
> +			  desc->bMaxPacketSize0,
>  			desc->inbuf,
>  			desc->response->transfer_dma);
>  err2:
> -	usb_buffer_free(interface_to_usbdev(desc->intf),
> -			desc->wMaxPacketSize,
> -			desc->sbuf,
> -			desc->validity->transfer_dma);
> +	usb_free_coherent(interface_to_usbdev(desc->intf),
> +			  desc->wMaxPacketSize,
> +			  desc->sbuf,
> +			  desc->validity->transfer_dma);
>  err:
>  	free_urbs(desc);
>  	kfree(desc->ubuf);
> diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c
> index 93b5f85..2250095 100644
> --- a/drivers/usb/class/usblp.c
> +++ b/drivers/usb/class/usblp.c
> @@ -27,7 +27,7 @@
>   *	v0.11 - add proto_bias option (Pete Zaitcev)
>   *	v0.12 - add hpoj.sourceforge.net ioctls (David Paschal)
>   *	v0.13 - alloc space for statusbuf (<status> not on stack);
> - *		use usb_buffer_alloc() for read buf & write buf;
> + *		use usb_alloc_coherent() for read buf & write buf;
>   *      none  - Maintained in Linux kernel after v0.13
>   */
>  
> diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
> index 1297e9b..0561430 100644
> --- a/drivers/usb/core/usb.c
> +++ b/drivers/usb/core/usb.c
> @@ -718,7 +718,7 @@ int __usb_get_extra_descriptor(char *buffer, unsigned size,
>  EXPORT_SYMBOL_GPL(__usb_get_extra_descriptor);
>  
>  /**
> - * usb_buffer_alloc - allocate dma-consistent buffer for URB_NO_xxx_DMA_MAP
> + * usb_alloc_coherent - allocate dma-consistent buffer for URB_NO_xxx_DMA_MAP
>   * @dev: device the buffer will be used with
>   * @size: requested buffer size
>   * @mem_flags: affect whether allocation may block
> @@ -737,30 +737,30 @@ EXPORT_SYMBOL_GPL(__usb_get_extra_descriptor);
>   * architectures where CPU caches are not DMA-coherent.  On systems without
>   * bus-snooping caches, these buffers are uncached.
>   *
> - * When the buffer is no longer used, free it with usb_buffer_free().
> + * When the buffer is no longer used, free it with usb_free_coherent().
>   */
> -void *usb_buffer_alloc(struct usb_device *dev, size_t size, gfp_t mem_flags,
> -		       dma_addr_t *dma)
> +void *usb_alloc_coherent(struct usb_device *dev, size_t size, gfp_t mem_flags,
> +			 dma_addr_t *dma)
>  {
>  	if (!dev || !dev->bus)
>  		return NULL;
>  	return hcd_buffer_alloc(dev->bus, size, mem_flags, dma);
>  }
> -EXPORT_SYMBOL_GPL(usb_buffer_alloc);
> +EXPORT_SYMBOL_GPL(usb_alloc_coherent);
>  
>  /**
> - * usb_buffer_free - free memory allocated with usb_buffer_alloc()
> + * usb_free_coherent - free memory allocated with usb_alloc_coherent()
>   * @dev: device the buffer was used with
>   * @size: requested buffer size
>   * @addr: CPU address of buffer
>   * @dma: DMA address of buffer
>   *
>   * This reclaims an I/O buffer, letting it be reused.  The memory must have
> - * been allocated using usb_buffer_alloc(), and the parameters must match
> + * been allocated using usb_alloc_coherent(), and the parameters must match
>   * those provided in that allocation request.
>   */
> -void usb_buffer_free(struct usb_device *dev, size_t size, void *addr,
> -		     dma_addr_t dma)
> +void usb_free_coherent(struct usb_device *dev, size_t size, void *addr,
> +		       dma_addr_t dma)
>  {
>  	if (!dev || !dev->bus)
>  		return;
> @@ -768,7 +768,7 @@ void usb_buffer_free(struct usb_device *dev, size_t size, void *addr,
>  		return;
>  	hcd_buffer_free(dev->bus, size, addr, dma);
>  }
> -EXPORT_SYMBOL_GPL(usb_buffer_free);
> +EXPORT_SYMBOL_GPL(usb_free_coherent);
>  
>  /**
>   * usb_buffer_map - create DMA mapping(s) for an urb
> diff --git a/drivers/usb/misc/appledisplay.c b/drivers/usb/misc/appledisplay.c
> index 094f91c..1fa6ce3 100644
> --- a/drivers/usb/misc/appledisplay.c
> +++ b/drivers/usb/misc/appledisplay.c
> @@ -259,7 +259,7 @@ static int appledisplay_probe(struct usb_interface *iface,
>  	}
>  
>  	/* Allocate buffer for interrupt data */
> -	pdata->urbdata = usb_buffer_alloc(pdata->udev, ACD_URB_BUFFER_LEN,
> +	pdata->urbdata = usb_alloc_coherent(pdata->udev, ACD_URB_BUFFER_LEN,
>  		GFP_KERNEL, &pdata->urb->transfer_dma);
>  	if (!pdata->urbdata) {
>  		retval = -ENOMEM;
> @@ -316,7 +316,7 @@ error:
>  		if (pdata->urb) {
>  			usb_kill_urb(pdata->urb);
>  			if (pdata->urbdata)
> -				usb_buffer_free(pdata->udev, ACD_URB_BUFFER_LEN,
> +				usb_free_coherent(pdata->udev, ACD_URB_BUFFER_LEN,
>  					pdata->urbdata, pdata->urb->transfer_dma);
>  			usb_free_urb(pdata->urb);
>  		}
> @@ -337,7 +337,7 @@ static void appledisplay_disconnect(struct usb_interface *iface)
>  		usb_kill_urb(pdata->urb);
>  		cancel_delayed_work(&pdata->work);
>  		backlight_device_unregister(pdata->bd);
> -		usb_buffer_free(pdata->udev, ACD_URB_BUFFER_LEN,
> +		usb_free_coherent(pdata->udev, ACD_URB_BUFFER_LEN,
>  			pdata->urbdata, pdata->urb->transfer_dma);
>  		usb_free_urb(pdata->urb);
>  		kfree(pdata->msgdata);
> diff --git a/drivers/usb/misc/ftdi-elan.c b/drivers/usb/misc/ftdi-elan.c
> index 1edb6d3..a9e0546 100644
> --- a/drivers/usb/misc/ftdi-elan.c
> +++ b/drivers/usb/misc/ftdi-elan.c
> @@ -734,7 +734,7 @@ static void ftdi_elan_write_bulk_callback(struct urb *urb)
>                  dev_err(&ftdi->udev->dev, "urb=%p write bulk status received: %"
>                          "d\n", urb, status);
>          }
> -        usb_buffer_free(urb->dev, urb->transfer_buffer_length,
> +        usb_free_coherent(urb->dev, urb->transfer_buffer_length,
>                  urb->transfer_buffer, urb->transfer_dma);
>  }
>  
> @@ -795,7 +795,7 @@ static int ftdi_elan_command_engine(struct usb_ftdi *ftdi)
>                          total_size);
>                  return -ENOMEM;
>          }
> -        buf = usb_buffer_alloc(ftdi->udev, total_size, GFP_KERNEL,
> +        buf = usb_alloc_coherent(ftdi->udev, total_size, GFP_KERNEL,
>                  &urb->transfer_dma);
>          if (!buf) {
>                  dev_err(&ftdi->udev->dev, "could not get a buffer to write %d c"
> @@ -829,7 +829,7 @@ static int ftdi_elan_command_engine(struct usb_ftdi *ftdi)
>                  dev_err(&ftdi->udev->dev, "failed %d to submit urb %p to write "
>                          "%d commands totaling %d bytes to the Uxxx\n", retval,
>                          urb, command_size, total_size);
> -                usb_buffer_free(ftdi->udev, total_size, buf, urb->transfer_dma);
> +                usb_free_coherent(ftdi->udev, total_size, buf, urb->transfer_dma);
>                  usb_free_urb(urb);
>                  return retval;
>          }
> @@ -1167,7 +1167,7 @@ static ssize_t ftdi_elan_write(struct file *file,
>                  retval = -ENOMEM;
>                  goto error_1;
>          }
> -        buf = usb_buffer_alloc(ftdi->udev, count, GFP_KERNEL,
> +        buf = usb_alloc_coherent(ftdi->udev, count, GFP_KERNEL,
>                  &urb->transfer_dma);
>          if (!buf) {
>                  retval = -ENOMEM;
> @@ -1192,7 +1192,7 @@ static ssize_t ftdi_elan_write(struct file *file,
>  exit:
>          return count;
>  error_3:
> -	usb_buffer_free(ftdi->udev, count, buf, urb->transfer_dma);
> +	usb_free_coherent(ftdi->udev, count, buf, urb->transfer_dma);
>  error_2:
>  	usb_free_urb(urb);
>  error_1:
> @@ -1968,7 +1968,7 @@ static int ftdi_elan_synchronize_flush(struct usb_ftdi *ftdi)
>                          "ence\n");
>                  return -ENOMEM;
>          }
> -        buf = usb_buffer_alloc(ftdi->udev, I, GFP_KERNEL, &urb->transfer_dma);
> +        buf = usb_alloc_coherent(ftdi->udev, I, GFP_KERNEL, &urb->transfer_dma);
>          if (!buf) {
>                  dev_err(&ftdi->udev->dev, "could not get a buffer for flush seq"
>                          "uence\n");
> @@ -1985,7 +1985,7 @@ static int ftdi_elan_synchronize_flush(struct usb_ftdi *ftdi)
>          if (retval) {
>                  dev_err(&ftdi->udev->dev, "failed to submit urb containing the "
>                          "flush sequence\n");
> -                usb_buffer_free(ftdi->udev, i, buf, urb->transfer_dma);
> +                usb_free_coherent(ftdi->udev, i, buf, urb->transfer_dma);
>                  usb_free_urb(urb);
>                  return -ENOMEM;
>          }
> @@ -2011,7 +2011,7 @@ static int ftdi_elan_synchronize_reset(struct usb_ftdi *ftdi)
>                          "quence\n");
>                  return -ENOMEM;
>          }
> -        buf = usb_buffer_alloc(ftdi->udev, I, GFP_KERNEL, &urb->transfer_dma);
> +        buf = usb_alloc_coherent(ftdi->udev, I, GFP_KERNEL, &urb->transfer_dma);
>          if (!buf) {
>                  dev_err(&ftdi->udev->dev, "could not get a buffer for the reset"
>                          " sequence\n");
> @@ -2030,7 +2030,7 @@ static int ftdi_elan_synchronize_reset(struct usb_ftdi *ftdi)
>          if (retval) {
>                  dev_err(&ftdi->udev->dev, "failed to submit urb containing the "
>                          "reset sequence\n");
> -                usb_buffer_free(ftdi->udev, i, buf, urb->transfer_dma);
> +                usb_free_coherent(ftdi->udev, i, buf, urb->transfer_dma);
>                  usb_free_urb(urb);
>                  return -ENOMEM;
>          }
> diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c
> index d3c8523..7dc9d3c 100644
> --- a/drivers/usb/misc/iowarrior.c
> +++ b/drivers/usb/misc/iowarrior.c
> @@ -239,8 +239,8 @@ static void iowarrior_write_callback(struct urb *urb)
>  		    __func__, status);
>  	}
>  	/* free up our allocated buffer */
> -	usb_buffer_free(urb->dev, urb->transfer_buffer_length,
> -			urb->transfer_buffer, urb->transfer_dma);
> +	usb_free_coherent(urb->dev, urb->transfer_buffer_length,
> +			  urb->transfer_buffer, urb->transfer_dma);
>  	/* tell a waiting writer the interrupt-out-pipe is available again */
>  	atomic_dec(&dev->write_busy);
>  	wake_up_interruptible(&dev->write_wait);
> @@ -421,8 +421,8 @@ static ssize_t iowarrior_write(struct file *file,
>  			dbg("%s Unable to allocate urb ", __func__);
>  			goto error_no_urb;
>  		}
> -		buf = usb_buffer_alloc(dev->udev, dev->report_size,
> -				       GFP_KERNEL, &int_out_urb->transfer_dma);
> +		buf = usb_alloc_coherent(dev->udev, dev->report_size,
> +					 GFP_KERNEL, &int_out_urb->transfer_dma);
>  		if (!buf) {
>  			retval = -ENOMEM;
>  			dbg("%s Unable to allocate buffer ", __func__);
> @@ -459,8 +459,8 @@ static ssize_t iowarrior_write(struct file *file,
>  		break;
>  	}
>  error:
> -	usb_buffer_free(dev->udev, dev->report_size, buf,
> -			int_out_urb->transfer_dma);
> +	usb_free_coherent(dev->udev, dev->report_size, buf,
> +			  int_out_urb->transfer_dma);
>  error_no_buffer:
>  	usb_free_urb(int_out_urb);
>  error_no_urb:
> diff --git a/drivers/usb/misc/usblcd.c b/drivers/usb/misc/usblcd.c
> index 90aede9..7828c76 100644
> --- a/drivers/usb/misc/usblcd.c
> +++ b/drivers/usb/misc/usblcd.c
> @@ -205,8 +205,8 @@ static void lcd_write_bulk_callback(struct urb *urb)
>  	}
>  
>  	/* free up our allocated buffer */
> -	usb_buffer_free(urb->dev, urb->transfer_buffer_length,
> -			urb->transfer_buffer, urb->transfer_dma);
> +	usb_free_coherent(urb->dev, urb->transfer_buffer_length,
> +			  urb->transfer_buffer, urb->transfer_dma);
>  	up(&dev->limit_sem);
>  }
>  
> @@ -234,7 +234,7 @@ static ssize_t lcd_write(struct file *file, const char __user * user_buffer, siz
>  		goto err_no_buf;
>  	}
>  	
> -	buf = usb_buffer_alloc(dev->udev, count, GFP_KERNEL, &urb->transfer_dma);
> +	buf = usb_alloc_coherent(dev->udev, count, GFP_KERNEL, &urb->transfer_dma);
>  	if (!buf) {
>  		retval = -ENOMEM;
>  		goto error;
> @@ -268,7 +268,7 @@ exit:
>  error_unanchor:
>  	usb_unanchor_urb(urb);
>  error:
> -	usb_buffer_free(dev->udev, count, buf, urb->transfer_dma);
> +	usb_free_coherent(dev->udev, count, buf, urb->transfer_dma);
>  	usb_free_urb(urb);
>  err_no_buf:
>  	up(&dev->limit_sem);
> diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c
> index a21cce6..9ecde8c 100644
> --- a/drivers/usb/misc/usbtest.c
> +++ b/drivers/usb/misc/usbtest.c
> @@ -202,7 +202,7 @@ static struct urb *simple_alloc_urb (
>  	urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP;
>  	if (usb_pipein (pipe))
>  		urb->transfer_flags |= URB_SHORT_NOT_OK;
> -	urb->transfer_buffer = usb_buffer_alloc (udev, bytes, GFP_KERNEL,
> +	urb->transfer_buffer = usb_alloc_coherent (udev, bytes, GFP_KERNEL,
>  			&urb->transfer_dma);
>  	if (!urb->transfer_buffer) {
>  		usb_free_urb (urb);
> @@ -272,8 +272,8 @@ static inline int simple_check_buf(struct usbtest_dev *tdev, struct urb *urb)
>  
>  static void simple_free_urb (struct urb *urb)
>  {
> -	usb_buffer_free (urb->dev, urb->transfer_buffer_length,
> -			urb->transfer_buffer, urb->transfer_dma);
> +	usb_free_coherent(urb->dev, urb->transfer_buffer_length,
> +			  urb->transfer_buffer, urb->transfer_dma);
>  	usb_free_urb (urb);
>  }
>  
> @@ -977,7 +977,7 @@ test_ctrl_queue (struct usbtest_dev *dev, struct usbtest_param *param)
>  		if (!u)
>  			goto cleanup;
>  
> -		reqp = usb_buffer_alloc (udev, sizeof *reqp, GFP_KERNEL,
> +		reqp = usb_alloc_coherent (udev, sizeof *reqp, GFP_KERNEL,
>  				&u->setup_dma);
>  		if (!reqp)
>  			goto cleanup;
> @@ -1018,9 +1018,9 @@ cleanup:
>  			continue;
>  		urb [i]->dev = udev;
>  		if (urb [i]->setup_packet)
> -			usb_buffer_free (udev, sizeof (struct usb_ctrlrequest),
> -					urb [i]->setup_packet,
> -					urb [i]->setup_dma);
> +			usb_free_coherent (udev, sizeof (struct usb_ctrlrequest),
> +					   urb [i]->setup_packet,
> +					   urb [i]->setup_dma);
>  		simple_free_urb (urb [i]);
>  	}
>  	kfree (urb);
> @@ -1421,7 +1421,7 @@ static struct urb *iso_alloc_urb (
>  
>  	urb->number_of_packets = packets;
>  	urb->transfer_buffer_length = bytes;
> -	urb->transfer_buffer = usb_buffer_alloc (udev, bytes, GFP_KERNEL,
> +	urb->transfer_buffer = usb_alloc_coherent (udev, bytes, GFP_KERNEL,
>  			&urb->transfer_dma);
>  	if (!urb->transfer_buffer) {
>  		usb_free_urb (urb);
> diff --git a/drivers/usb/storage/onetouch.c b/drivers/usb/storage/onetouch.c
> index 198bb3e..1943be5 100644
> --- a/drivers/usb/storage/onetouch.c
> +++ b/drivers/usb/storage/onetouch.c
> @@ -201,8 +201,8 @@ static int onetouch_connect_input(struct us_data *ss)
>  	if (!onetouch || !input_dev)
>  		goto fail1;
>  
> -	onetouch->data = usb_buffer_alloc(udev, ONETOUCH_PKT_LEN,
> -					  GFP_KERNEL, &onetouch->data_dma);
> +	onetouch->data = usb_alloc_coherent(udev, ONETOUCH_PKT_LEN,
> +					    GFP_KERNEL, &onetouch->data_dma);
>  	if (!onetouch->data)
>  		goto fail1;
>  
> @@ -264,8 +264,8 @@ static int onetouch_connect_input(struct us_data *ss)
>  	return 0;
>  
>   fail3:	usb_free_urb(onetouch->irq);
> - fail2:	usb_buffer_free(udev, ONETOUCH_PKT_LEN,
> -			onetouch->data, onetouch->data_dma);
> + fail2:	usb_free_coherent(udev, ONETOUCH_PKT_LEN,
> +			  onetouch->data, onetouch->data_dma);
>   fail1:	kfree(onetouch);
>  	input_free_device(input_dev);
>  	return error;
> @@ -279,8 +279,8 @@ static void onetouch_release_input(void *onetouch_)
>  		usb_kill_urb(onetouch->irq);
>  		input_unregister_device(onetouch->dev);
>  		usb_free_urb(onetouch->irq);
> -		usb_buffer_free(onetouch->udev, ONETOUCH_PKT_LEN,
> -				onetouch->data, onetouch->data_dma);
> +		usb_free_coherent(onetouch->udev, ONETOUCH_PKT_LEN,
> +				  onetouch->data, onetouch->data_dma);
>  	}
>  }
>  
> diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
> index bbeeb92..ef00584 100644
> --- a/drivers/usb/storage/usb.c
> +++ b/drivers/usb/storage/usb.c
> @@ -408,14 +408,14 @@ static int associate_dev(struct us_data *us, struct usb_interface *intf)
>  	usb_set_intfdata(intf, us);
>  
>  	/* Allocate the device-related DMA-mapped buffers */
> -	us->cr = usb_buffer_alloc(us->pusb_dev, sizeof(*us->cr),
> +	us->cr = usb_alloc_coherent(us->pusb_dev, sizeof(*us->cr),
>  			GFP_KERNEL, &us->cr_dma);
>  	if (!us->cr) {
>  		US_DEBUGP("usb_ctrlrequest allocation failed\n");
>  		return -ENOMEM;
>  	}
>  
> -	us->iobuf = usb_buffer_alloc(us->pusb_dev, US_IOBUF_SIZE,
> +	us->iobuf = usb_alloc_coherent(us->pusb_dev, US_IOBUF_SIZE,
>  			GFP_KERNEL, &us->iobuf_dma);
>  	if (!us->iobuf) {
>  		US_DEBUGP("I/O buffer allocation failed\n");
> @@ -759,11 +759,11 @@ static void dissociate_dev(struct us_data *us)
>  
>  	/* Free the device-related DMA-mapped buffers */
>  	if (us->cr)
> -		usb_buffer_free(us->pusb_dev, sizeof(*us->cr), us->cr,
> -				us->cr_dma);
> +		usb_free_coherent(us->pusb_dev, sizeof(*us->cr), us->cr,
> +				  us->cr_dma);
>  	if (us->iobuf)
> -		usb_buffer_free(us->pusb_dev, US_IOBUF_SIZE, us->iobuf,
> -				us->iobuf_dma);
> +		usb_free_coherent(us->pusb_dev, US_IOBUF_SIZE, us->iobuf,
> +				  us->iobuf_dma);
>  
>  	/* Remove our private data from the interface */
>  	usb_set_intfdata(us->pusb_intf, NULL);
> diff --git a/drivers/usb/usb-skeleton.c b/drivers/usb/usb-skeleton.c
> index 6152278..d110588 100644
> --- a/drivers/usb/usb-skeleton.c
> +++ b/drivers/usb/usb-skeleton.c
> @@ -387,8 +387,8 @@ static void skel_write_bulk_callback(struct urb *urb)
>  	}
>  
>  	/* free up our allocated buffer */
> -	usb_buffer_free(urb->dev, urb->transfer_buffer_length,
> -			urb->transfer_buffer, urb->transfer_dma);
> +	usb_free_coherent(urb->dev, urb->transfer_buffer_length,
> +			  urb->transfer_buffer, urb->transfer_dma);
>  	up(&dev->limit_sem);
>  }
>  
> @@ -442,8 +442,8 @@ static ssize_t skel_write(struct file *file, const char *user_buffer,
>  		goto error;
>  	}
>  
> -	buf = usb_buffer_alloc(dev->udev, writesize, GFP_KERNEL,
> -			       &urb->transfer_dma);
> +	buf = usb_alloc_coherent(dev->udev, writesize, GFP_KERNEL,
> +				 &urb->transfer_dma);
>  	if (!buf) {
>  		retval = -ENOMEM;
>  		goto error;
> @@ -491,7 +491,7 @@ error_unanchor:
>  	usb_unanchor_urb(urb);
>  error:
>  	if (urb) {
> -		usb_buffer_free(dev->udev, writesize, buf, urb->transfer_dma);
> +		usb_free_coherent(dev->udev, writesize, buf, urb->transfer_dma);
>  		usb_free_urb(urb);
>  	}
>  	up(&dev->limit_sem);
> diff --git a/drivers/watchdog/pcwd_usb.c b/drivers/watchdog/pcwd_usb.c
> index 8e4eacc..748a74b 100644
> --- a/drivers/watchdog/pcwd_usb.c
> +++ b/drivers/watchdog/pcwd_usb.c
> @@ -600,8 +600,8 @@ static inline void usb_pcwd_delete(struct usb_pcwd_private *usb_pcwd)
>  {
>  	usb_free_urb(usb_pcwd->intr_urb);
>  	if (usb_pcwd->intr_buffer != NULL)
> -		usb_buffer_free(usb_pcwd->udev, usb_pcwd->intr_size,
> -				usb_pcwd->intr_buffer, usb_pcwd->intr_dma);
> +		usb_free_coherent(usb_pcwd->udev, usb_pcwd->intr_size,
> +				  usb_pcwd->intr_buffer, usb_pcwd->intr_dma);
>  	kfree(usb_pcwd);
>  }
>  
> @@ -671,7 +671,7 @@ static int usb_pcwd_probe(struct usb_interface *interface,
>  				le16_to_cpu(endpoint->wMaxPacketSize) : 8);
>  
>  	/* set up the memory buffer's */
> -	usb_pcwd->intr_buffer = usb_buffer_alloc(udev, usb_pcwd->intr_size,
> +	usb_pcwd->intr_buffer = usb_alloc_coherent(udev, usb_pcwd->intr_size,
>  					GFP_ATOMIC, &usb_pcwd->intr_dma);
>  	if (!usb_pcwd->intr_buffer) {
>  		printk(KERN_ERR PFX "Out of memory\n");
> diff --git a/include/linux/usb.h b/include/linux/usb.h
> index ce1323c..4f485d0 100644
> --- a/include/linux/usb.h
> +++ b/include/linux/usb.h
> @@ -1085,7 +1085,7 @@ typedef void (*usb_complete_t)(struct urb *);
>   * Alternatively, drivers may pass the URB_NO_xxx_DMA_MAP transfer flags,
>   * which tell the host controller driver that no such mapping is needed since
>   * the device driver is DMA-aware.  For example, a device driver might
> - * allocate a DMA buffer with usb_buffer_alloc() or call usb_buffer_map().
> + * allocate a DMA buffer with usb_alloc_coherent() or call usb_buffer_map().
>   * When these transfer flags are provided, host controller drivers will
>   * attempt to use the dma addresses found in the transfer_dma and/or
>   * setup_dma fields rather than determining a dma address themselves.
> @@ -1366,9 +1366,9 @@ static inline int usb_urb_dir_out(struct urb *urb)
>  	return (urb->transfer_flags & URB_DIR_MASK) == URB_DIR_OUT;
>  }
>  
> -void *usb_buffer_alloc(struct usb_device *dev, size_t size,
> +void *usb_alloc_coherent(struct usb_device *dev, size_t size,
>  	gfp_t mem_flags, dma_addr_t *dma);
> -void usb_buffer_free(struct usb_device *dev, size_t size,
> +void usb_free_coherent(struct usb_device *dev, size_t size,
>  	void *addr, dma_addr_t dma);
>  
>  #if 0
> diff --git a/sound/usb/midi.c b/sound/usb/midi.c
> index c6ee4a1..00f7d8e 100644
> --- a/sound/usb/midi.c
> +++ b/sound/usb/midi.c
> @@ -1046,8 +1046,8 @@ static struct snd_rawmidi_ops snd_usbmidi_input_ops = {
>  static void free_urb_and_buffer(struct snd_usb_midi *umidi, struct urb *urb,
>  				unsigned int buffer_length)
>  {
> -	usb_buffer_free(umidi->dev, buffer_length,
> -			urb->transfer_buffer, urb->transfer_dma);
> +	usb_free_coherent(umidi->dev, buffer_length,
> +			  urb->transfer_buffer, urb->transfer_dma);
>  	usb_free_urb(urb);
>  }
>  
> @@ -1098,8 +1098,8 @@ static int snd_usbmidi_in_endpoint_create(struct snd_usb_midi* umidi,
>  		pipe = usb_rcvbulkpipe(umidi->dev, ep_info->in_ep);
>  	length = usb_maxpacket(umidi->dev, pipe, 0);
>  	for (i = 0; i < INPUT_URBS; ++i) {
> -		buffer = usb_buffer_alloc(umidi->dev, length, GFP_KERNEL,
> -					  &ep->urbs[i]->transfer_dma);
> +		buffer = usb_alloc_coherent(umidi->dev, length, GFP_KERNEL,
> +					    &ep->urbs[i]->transfer_dma);
>  		if (!buffer) {
>  			snd_usbmidi_in_endpoint_delete(ep);
>  			return -ENOMEM;
> @@ -1182,9 +1182,9 @@ static int snd_usbmidi_out_endpoint_create(struct snd_usb_midi* umidi,
>  		break;
>  	}
>  	for (i = 0; i < OUTPUT_URBS; ++i) {
> -		buffer = usb_buffer_alloc(umidi->dev,
> -					  ep->max_transfer, GFP_KERNEL,
> -					  &ep->urbs[i].urb->transfer_dma);
> +		buffer = usb_alloc_coherent(umidi->dev,
> +					    ep->max_transfer, GFP_KERNEL,
> +					    &ep->urbs[i].urb->transfer_dma);
>  		if (!buffer) {
>  			snd_usbmidi_out_endpoint_delete(ep);
>  			return -ENOMEM;
> diff --git a/sound/usb/misc/ua101.c b/sound/usb/misc/ua101.c
> index 796d8b2..fb5d68f 100644
> --- a/sound/usb/misc/ua101.c
> +++ b/sound/usb/misc/ua101.c
> @@ -42,7 +42,7 @@ MODULE_SUPPORTED_DEVICE("{{Edirol,UA-101},{Edirol,UA-1000}}");
>  /*
>   * This magic value optimizes memory usage efficiency for the UA-101's packet
>   * sizes at all sample rates, taking into account the stupid cache pool sizes
> - * that usb_buffer_alloc() uses.
> + * that usb_alloc_coherent() uses.
>   */
>  #define DEFAULT_QUEUE_LENGTH	21
>  
> @@ -1057,7 +1057,7 @@ static int alloc_stream_buffers(struct ua101 *ua, struct ua101_stream *stream)
>  				   (unsigned int)MAX_QUEUE_LENGTH);
>  
>  	/*
> -	 * The cache pool sizes used by usb_buffer_alloc() (128, 512, 2048) are
> +	 * The cache pool sizes used by usb_alloc_coherent() (128, 512, 2048) are
>  	 * quite bad when used with the packet sizes of this device (e.g. 280,
>  	 * 520, 624).  Therefore, we allocate and subdivide entire pages, using
>  	 * a smaller buffer only for the last chunk.
> @@ -1068,8 +1068,8 @@ static int alloc_stream_buffers(struct ua101 *ua, struct ua101_stream *stream)
>  		packets = min(remaining_packets, packets_per_page);
>  		size = packets * stream->max_packet_bytes;
>  		stream->buffers[i].addr =
> -			usb_buffer_alloc(ua->dev, size, GFP_KERNEL,
> -					 &stream->buffers[i].dma);
> +			usb_alloc_coherent(ua->dev, size, GFP_KERNEL,
> +					   &stream->buffers[i].dma);
>  		if (!stream->buffers[i].addr)
>  			return -ENOMEM;
>  		stream->buffers[i].size = size;
> @@ -1089,10 +1089,10 @@ static void free_stream_buffers(struct ua101 *ua, struct ua101_stream *stream)
>  	unsigned int i;
>  
>  	for (i = 0; i < ARRAY_SIZE(stream->buffers); ++i)
> -		usb_buffer_free(ua->dev,
> -				stream->buffers[i].size,
> -				stream->buffers[i].addr,
> -				stream->buffers[i].dma);
> +		usb_free_coherent(ua->dev,
> +				  stream->buffers[i].size,
> +				  stream->buffers[i].addr,
> +				  stream->buffers[i].dma);
>  }
>  
>  static int alloc_stream_urbs(struct ua101 *ua, struct ua101_stream *stream,
> diff --git a/sound/usb/urb.c b/sound/usb/urb.c
> index 5570a2b..8c7b3e5 100644
> --- a/sound/usb/urb.c
> +++ b/sound/usb/urb.c
> @@ -101,9 +101,9 @@ static void release_urb_ctx(struct snd_urb_ctx *u)
>  {
>  	if (u->urb) {
>  		if (u->buffer_size)
> -			usb_buffer_free(u->subs->dev, u->buffer_size,
> -					u->urb->transfer_buffer,
> -					u->urb->transfer_dma);
> +			usb_free_coherent(u->subs->dev, u->buffer_size,
> +					  u->urb->transfer_buffer,
> +					  u->urb->transfer_dma);
>  		usb_free_urb(u->urb);
>  		u->urb = NULL;
>  	}
> @@ -154,8 +154,8 @@ void snd_usb_release_substream_urbs(struct snd_usb_substream *subs, int force)
>  		release_urb_ctx(&subs->dataurb[i]);
>  	for (i = 0; i < SYNC_URBS; i++)
>  		release_urb_ctx(&subs->syncurb[i]);
> -	usb_buffer_free(subs->dev, SYNC_URBS * 4,
> -			subs->syncbuf, subs->sync_dma);
> +	usb_free_coherent(subs->dev, SYNC_URBS * 4,
> +			  subs->syncbuf, subs->sync_dma);
>  	subs->syncbuf = NULL;
>  	subs->nurbs = 0;
>  }
> @@ -308,8 +308,8 @@ int snd_usb_init_substream_urbs(struct snd_usb_substream *subs,
>  		if (!u->urb)
>  			goto out_of_memory;
>  		u->urb->transfer_buffer =
> -			usb_buffer_alloc(subs->dev, u->buffer_size, GFP_KERNEL,
> -					 &u->urb->transfer_dma);
> +			usb_alloc_coherent(subs->dev, u->buffer_size, GFP_KERNEL,
> +					   &u->urb->transfer_dma);
>  		if (!u->urb->transfer_buffer)
>  			goto out_of_memory;
>  		u->urb->pipe = subs->datapipe;
> @@ -321,8 +321,8 @@ int snd_usb_init_substream_urbs(struct snd_usb_substream *subs,
>  
>  	if (subs->syncpipe) {
>  		/* allocate and initialize sync urbs */
> -		subs->syncbuf = usb_buffer_alloc(subs->dev, SYNC_URBS * 4,
> -						 GFP_KERNEL, &subs->sync_dma);
> +		subs->syncbuf = usb_alloc_coherent(subs->dev, SYNC_URBS * 4,
> +						   GFP_KERNEL, &subs->sync_dma);
>  		if (!subs->syncbuf)
>  			goto out_of_memory;
>  		for (i = 0; i < SYNC_URBS; i++) {
> -- 
> 1.6.6.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 
> 

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [PATCH] USB: rename usb_buffer_alloc() and usb_buffer_free()
@ 2010-04-13 18:16                   ` Daniel Mack
  0 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-13 18:16 UTC (permalink / raw)
  To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: Alan Stern, Greg KH, Pedro Ribeiro,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
	linux-usb-u79uwXL29TY76Z2rM5mHXA,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw, Robert Hancock, Andi Kleen

On Mon, Apr 12, 2010 at 01:17:25PM +0200, Daniel Mack wrote:
> For more clearance what the functions actually do,
> 
>   usb_buffer_alloc() is renamed to usb_alloc_coherent()
>   usb_buffer_free()  is renamed to usb_free_coherent()
> 
> They should only be used in code which really needs DMA coherency.
> 
> All call sites have been changed accordingly, except for staging
> drivers.

Is this ok? As it's quite big, I think it should be merged soon if there
are no objections.

Thanks,
Daniel


> Signed-off-by: Daniel Mack <daniel-rDUAYElUppE@public.gmane.org>
> Cc: Alan Stern <stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org>
> Cc: Greg KH <gregkh-l3A5Bk7waGM@public.gmane.org>
> Cc: Pedro Ribeiro <pedrib-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Cc: akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org
> Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> Cc: alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org
> ---
>  Documentation/DocBook/writing_usb_driver.tmpl  |    2 +-
>  Documentation/usb/dma.txt                      |    4 +-
>  drivers/hid/usbhid/hid-core.c                  |   16 +++++-----
>  drivers/hid/usbhid/usbkbd.c                    |   12 ++++----
>  drivers/hid/usbhid/usbmouse.c                  |    6 ++--
>  drivers/input/joystick/xpad.c                  |   16 +++++-----
>  drivers/input/misc/ati_remote.c                |   12 ++++----
>  drivers/input/misc/ati_remote2.c               |    4 +-
>  drivers/input/misc/cm109.c                     |   24 +++++++-------
>  drivers/input/misc/keyspan_remote.c            |    6 ++--
>  drivers/input/misc/powermate.c                 |   16 +++++-----
>  drivers/input/misc/yealink.c                   |   24 +++++++-------
>  drivers/input/mouse/appletouch.c               |   12 ++++----
>  drivers/input/mouse/bcm5974.c                  |   24 +++++++-------
>  drivers/input/tablet/acecad.c                  |    6 ++--
>  drivers/input/tablet/aiptek.c                  |   14 ++++----
>  drivers/input/tablet/gtco.c                    |   12 ++++----
>  drivers/input/tablet/kbtab.c                   |    6 ++--
>  drivers/input/tablet/wacom_sys.c               |   10 +++---
>  drivers/input/touchscreen/usbtouchscreen.c     |    8 ++--
>  drivers/media/dvb/dvb-usb/usb-urb.c            |    7 ++--
>  drivers/media/dvb/ttusb-dec/ttusb_dec.c        |    6 ++--
>  drivers/media/video/au0828/au0828-video.c      |    4 +-
>  drivers/media/video/cx231xx/cx231xx-core.c     |   14 ++++----
>  drivers/media/video/em28xx/em28xx-core.c       |    4 +-
>  drivers/media/video/gspca/benq.c               |    4 +-
>  drivers/media/video/gspca/gspca.c              |   30 +++++++++---------
>  drivers/media/video/hdpvr/hdpvr-video.c        |    8 ++--
>  drivers/media/video/tlg2300/pd-video.c         |   14 ++++----
>  drivers/media/video/usbvision/usbvision-core.c |   16 +++++-----
>  drivers/media/video/uvc/uvc_video.c            |    4 +-
>  drivers/net/can/usb/ems_usb.c                  |   18 +++++-----
>  drivers/net/usb/kaweth.c                       |   12 ++++----
>  drivers/net/wireless/ath/ar9170/usb.c          |    8 ++--
>  drivers/net/wireless/zd1211rw/zd_usb.c         |   10 +++---
>  drivers/usb/class/cdc-acm.c                    |   22 +++++++-------
>  drivers/usb/class/cdc-wdm.c                    |   38 ++++++++++++------------
>  drivers/usb/class/usblp.c                      |    2 +-
>  drivers/usb/core/usb.c                         |   20 ++++++------
>  drivers/usb/misc/appledisplay.c                |    6 ++--
>  drivers/usb/misc/ftdi-elan.c                   |   18 +++++-----
>  drivers/usb/misc/iowarrior.c                   |   12 ++++----
>  drivers/usb/misc/usblcd.c                      |    8 ++--
>  drivers/usb/misc/usbtest.c                     |   16 +++++-----
>  drivers/usb/storage/onetouch.c                 |   12 ++++----
>  drivers/usb/storage/usb.c                      |   12 ++++----
>  drivers/usb/usb-skeleton.c                     |   10 +++---
>  drivers/watchdog/pcwd_usb.c                    |    6 ++--
>  include/linux/usb.h                            |    6 ++--
>  sound/usb/midi.c                               |   14 ++++----
>  sound/usb/misc/ua101.c                         |   16 +++++-----
>  sound/usb/urb.c                                |   18 +++++-----
>  52 files changed, 315 insertions(+), 314 deletions(-)
> 
> diff --git a/Documentation/DocBook/writing_usb_driver.tmpl b/Documentation/DocBook/writing_usb_driver.tmpl
> index eeff19c..bd97a13 100644
> --- a/Documentation/DocBook/writing_usb_driver.tmpl
> +++ b/Documentation/DocBook/writing_usb_driver.tmpl
> @@ -342,7 +342,7 @@ static inline void skel_delete (struct usb_skel *dev)
>  {
>      kfree (dev->bulk_in_buffer);
>      if (dev->bulk_out_buffer != NULL)
> -        usb_buffer_free (dev->udev, dev->bulk_out_size,
> +        usb_free_coherent (dev->udev, dev->bulk_out_size,
>              dev->bulk_out_buffer,
>              dev->write_urb->transfer_dma);
>      usb_free_urb (dev->write_urb);
> diff --git a/Documentation/usb/dma.txt b/Documentation/usb/dma.txt
> index cfdcd16..a37e59c 100644
> --- a/Documentation/usb/dma.txt
> +++ b/Documentation/usb/dma.txt
> @@ -43,10 +43,10 @@ and effects like cache-trashing can impose subtle penalties.
>    kind of addresses to store in urb->transfer_buffer and urb->transfer_dma.
>    You'd also set URB_NO_TRANSFER_DMA_MAP in urb->transfer_flags:
>  
> -	void *usb_buffer_alloc (struct usb_device *dev, size_t size,
> +	void *usb_alloc_coherent (struct usb_device *dev, size_t size,
>  		int mem_flags, dma_addr_t *dma);
>  
> -	void usb_buffer_free (struct usb_device *dev, size_t size,
> +	void usb_free_coherent (struct usb_device *dev, size_t size,
>  		void *addr, dma_addr_t dma);
>  
>    Most drivers should *NOT* be using these primitives; they don't need
> diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
> index 56d06cd..8496f3a 100644
> --- a/drivers/hid/usbhid/hid-core.c
> +++ b/drivers/hid/usbhid/hid-core.c
> @@ -783,13 +783,13 @@ static int hid_alloc_buffers(struct usb_device *dev, struct hid_device *hid)
>  {
>  	struct usbhid_device *usbhid = hid->driver_data;
>  
> -	usbhid->inbuf = usb_buffer_alloc(dev, usbhid->bufsize, GFP_KERNEL,
> +	usbhid->inbuf = usb_alloc_coherent(dev, usbhid->bufsize, GFP_KERNEL,
>  			&usbhid->inbuf_dma);
> -	usbhid->outbuf = usb_buffer_alloc(dev, usbhid->bufsize, GFP_KERNEL,
> +	usbhid->outbuf = usb_alloc_coherent(dev, usbhid->bufsize, GFP_KERNEL,
>  			&usbhid->outbuf_dma);
> -	usbhid->cr = usb_buffer_alloc(dev, sizeof(*usbhid->cr), GFP_KERNEL,
> +	usbhid->cr = usb_alloc_coherent(dev, sizeof(*usbhid->cr), GFP_KERNEL,
>  			&usbhid->cr_dma);
> -	usbhid->ctrlbuf = usb_buffer_alloc(dev, usbhid->bufsize, GFP_KERNEL,
> +	usbhid->ctrlbuf = usb_alloc_coherent(dev, usbhid->bufsize, GFP_KERNEL,
>  			&usbhid->ctrlbuf_dma);
>  	if (!usbhid->inbuf || !usbhid->outbuf || !usbhid->cr ||
>  			!usbhid->ctrlbuf)
> @@ -844,10 +844,10 @@ static void hid_free_buffers(struct usb_device *dev, struct hid_device *hid)
>  {
>  	struct usbhid_device *usbhid = hid->driver_data;
>  
> -	usb_buffer_free(dev, usbhid->bufsize, usbhid->inbuf, usbhid->inbuf_dma);
> -	usb_buffer_free(dev, usbhid->bufsize, usbhid->outbuf, usbhid->outbuf_dma);
> -	usb_buffer_free(dev, sizeof(*(usbhid->cr)), usbhid->cr, usbhid->cr_dma);
> -	usb_buffer_free(dev, usbhid->bufsize, usbhid->ctrlbuf, usbhid->ctrlbuf_dma);
> +	usb_free_coherent(dev, usbhid->bufsize, usbhid->inbuf, usbhid->inbuf_dma);
> +	usb_free_coherent(dev, usbhid->bufsize, usbhid->outbuf, usbhid->outbuf_dma);
> +	usb_free_coherent(dev, sizeof(*(usbhid->cr)), usbhid->cr, usbhid->cr_dma);
> +	usb_free_coherent(dev, usbhid->bufsize, usbhid->ctrlbuf, usbhid->ctrlbuf_dma);
>  }
>  
>  static int usbhid_parse(struct hid_device *hid)
> diff --git a/drivers/hid/usbhid/usbkbd.c b/drivers/hid/usbhid/usbkbd.c
> index f843443..b86f866 100644
> --- a/drivers/hid/usbhid/usbkbd.c
> +++ b/drivers/hid/usbhid/usbkbd.c
> @@ -197,11 +197,11 @@ static int usb_kbd_alloc_mem(struct usb_device *dev, struct usb_kbd *kbd)
>  		return -1;
>  	if (!(kbd->led = usb_alloc_urb(0, GFP_KERNEL)))
>  		return -1;
> -	if (!(kbd->new = usb_buffer_alloc(dev, 8, GFP_ATOMIC, &kbd->new_dma)))
> +	if (!(kbd->new = usb_alloc_coherent(dev, 8, GFP_ATOMIC, &kbd->new_dma)))
>  		return -1;
> -	if (!(kbd->cr = usb_buffer_alloc(dev, sizeof(struct usb_ctrlrequest), GFP_ATOMIC, &kbd->cr_dma)))
> +	if (!(kbd->cr = usb_alloc_coherent(dev, sizeof(struct usb_ctrlrequest), GFP_ATOMIC, &kbd->cr_dma)))
>  		return -1;
> -	if (!(kbd->leds = usb_buffer_alloc(dev, 1, GFP_ATOMIC, &kbd->leds_dma)))
> +	if (!(kbd->leds = usb_alloc_coherent(dev, 1, GFP_ATOMIC, &kbd->leds_dma)))
>  		return -1;
>  
>  	return 0;
> @@ -211,9 +211,9 @@ static void usb_kbd_free_mem(struct usb_device *dev, struct usb_kbd *kbd)
>  {
>  	usb_free_urb(kbd->irq);
>  	usb_free_urb(kbd->led);
> -	usb_buffer_free(dev, 8, kbd->new, kbd->new_dma);
> -	usb_buffer_free(dev, sizeof(struct usb_ctrlrequest), kbd->cr, kbd->cr_dma);
> -	usb_buffer_free(dev, 1, kbd->leds, kbd->leds_dma);
> +	usb_free_coherent(dev, 8, kbd->new, kbd->new_dma);
> +	usb_free_coherent(dev, sizeof(struct usb_ctrlrequest), kbd->cr, kbd->cr_dma);
> +	usb_free_coherent(dev, 1, kbd->leds, kbd->leds_dma);
>  }
>  
>  static int usb_kbd_probe(struct usb_interface *iface,
> diff --git a/drivers/hid/usbhid/usbmouse.c b/drivers/hid/usbhid/usbmouse.c
> index 72ab4b2..79b2bf8 100644
> --- a/drivers/hid/usbhid/usbmouse.c
> +++ b/drivers/hid/usbhid/usbmouse.c
> @@ -142,7 +142,7 @@ static int usb_mouse_probe(struct usb_interface *intf, const struct usb_device_i
>  	if (!mouse || !input_dev)
>  		goto fail1;
>  
> -	mouse->data = usb_buffer_alloc(dev, 8, GFP_ATOMIC, &mouse->data_dma);
> +	mouse->data = usb_alloc_coherent(dev, 8, GFP_ATOMIC, &mouse->data_dma);
>  	if (!mouse->data)
>  		goto fail1;
>  
> @@ -205,7 +205,7 @@ static int usb_mouse_probe(struct usb_interface *intf, const struct usb_device_i
>  fail3:	
>  	usb_free_urb(mouse->irq);
>  fail2:	
> -	usb_buffer_free(dev, 8, mouse->data, mouse->data_dma);
> +	usb_free_coherent(dev, 8, mouse->data, mouse->data_dma);
>  fail1:	
>  	input_free_device(input_dev);
>  	kfree(mouse);
> @@ -221,7 +221,7 @@ static void usb_mouse_disconnect(struct usb_interface *intf)
>  		usb_kill_urb(mouse->irq);
>  		input_unregister_device(mouse->dev);
>  		usb_free_urb(mouse->irq);
> -		usb_buffer_free(interface_to_usbdev(intf), 8, mouse->data, mouse->data_dma);
> +		usb_free_coherent(interface_to_usbdev(intf), 8, mouse->data, mouse->data_dma);
>  		kfree(mouse);
>  	}
>  }
> diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
> index 9b3353b..c1087ce 100644
> --- a/drivers/input/joystick/xpad.c
> +++ b/drivers/input/joystick/xpad.c
> @@ -533,8 +533,8 @@ static int xpad_init_output(struct usb_interface *intf, struct usb_xpad *xpad)
>  	if (xpad->xtype != XTYPE_XBOX360 && xpad->xtype != XTYPE_XBOX)
>  		return 0;
>  
> -	xpad->odata = usb_buffer_alloc(xpad->udev, XPAD_PKT_LEN,
> -				       GFP_KERNEL, &xpad->odata_dma);
> +	xpad->odata = usb_alloc_coherent(xpad->udev, XPAD_PKT_LEN,
> +					 GFP_KERNEL, &xpad->odata_dma);
>  	if (!xpad->odata)
>  		goto fail1;
>  
> @@ -554,7 +554,7 @@ static int xpad_init_output(struct usb_interface *intf, struct usb_xpad *xpad)
>  
>  	return 0;
>  
> - fail2:	usb_buffer_free(xpad->udev, XPAD_PKT_LEN, xpad->odata, xpad->odata_dma);
> + fail2:	usb_free_coherent(xpad->udev, XPAD_PKT_LEN, xpad->odata, xpad->odata_dma);
>   fail1:	return error;
>  }
>  
> @@ -568,7 +568,7 @@ static void xpad_deinit_output(struct usb_xpad *xpad)
>  {
>  	if (xpad->xtype == XTYPE_XBOX360 || xpad->xtype == XTYPE_XBOX) {
>  		usb_free_urb(xpad->irq_out);
> -		usb_buffer_free(xpad->udev, XPAD_PKT_LEN,
> +		usb_free_coherent(xpad->udev, XPAD_PKT_LEN,
>  				xpad->odata, xpad->odata_dma);
>  	}
>  }
> @@ -788,8 +788,8 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id
>  	if (!xpad || !input_dev)
>  		goto fail1;
>  
> -	xpad->idata = usb_buffer_alloc(udev, XPAD_PKT_LEN,
> -				       GFP_KERNEL, &xpad->idata_dma);
> +	xpad->idata = usb_alloc_coherent(udev, XPAD_PKT_LEN,
> +					 GFP_KERNEL, &xpad->idata_dma);
>  	if (!xpad->idata)
>  		goto fail1;
>  
> @@ -942,7 +942,7 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id
>   fail5:	usb_kill_urb(xpad->irq_in);
>   fail4:	usb_free_urb(xpad->irq_in);
>   fail3:	xpad_deinit_output(xpad);
> - fail2:	usb_buffer_free(udev, XPAD_PKT_LEN, xpad->idata, xpad->idata_dma);
> + fail2:	usb_free_coherent(udev, XPAD_PKT_LEN, xpad->idata, xpad->idata_dma);
>   fail1:	input_free_device(input_dev);
>  	kfree(xpad);
>  	return error;
> @@ -964,7 +964,7 @@ static void xpad_disconnect(struct usb_interface *intf)
>  			usb_kill_urb(xpad->irq_in);
>  		}
>  		usb_free_urb(xpad->irq_in);
> -		usb_buffer_free(xpad->udev, XPAD_PKT_LEN,
> +		usb_free_coherent(xpad->udev, XPAD_PKT_LEN,
>  				xpad->idata, xpad->idata_dma);
>  		kfree(xpad);
>  	}
> diff --git a/drivers/input/misc/ati_remote.c b/drivers/input/misc/ati_remote.c
> index 614b65d..2b9a2c8 100644
> --- a/drivers/input/misc/ati_remote.c
> +++ b/drivers/input/misc/ati_remote.c
> @@ -620,13 +620,13 @@ static void ati_remote_irq_in(struct urb *urb)
>  static int ati_remote_alloc_buffers(struct usb_device *udev,
>  				    struct ati_remote *ati_remote)
>  {
> -	ati_remote->inbuf = usb_buffer_alloc(udev, DATA_BUFSIZE, GFP_ATOMIC,
> -					     &ati_remote->inbuf_dma);
> +	ati_remote->inbuf = usb_alloc_coherent(udev, DATA_BUFSIZE, GFP_ATOMIC,
> +					       &ati_remote->inbuf_dma);
>  	if (!ati_remote->inbuf)
>  		return -1;
>  
> -	ati_remote->outbuf = usb_buffer_alloc(udev, DATA_BUFSIZE, GFP_ATOMIC,
> -					      &ati_remote->outbuf_dma);
> +	ati_remote->outbuf = usb_alloc_coherent(udev, DATA_BUFSIZE, GFP_ATOMIC,
> +					        &ati_remote->outbuf_dma);
>  	if (!ati_remote->outbuf)
>  		return -1;
>  
> @@ -649,10 +649,10 @@ static void ati_remote_free_buffers(struct ati_remote *ati_remote)
>  	usb_free_urb(ati_remote->irq_urb);
>  	usb_free_urb(ati_remote->out_urb);
>  
> -	usb_buffer_free(ati_remote->udev, DATA_BUFSIZE,
> +	usb_free_coherent(ati_remote->udev, DATA_BUFSIZE,
>  		ati_remote->inbuf, ati_remote->inbuf_dma);
>  
> -	usb_buffer_free(ati_remote->udev, DATA_BUFSIZE,
> +	usb_free_coherent(ati_remote->udev, DATA_BUFSIZE,
>  		ati_remote->outbuf, ati_remote->outbuf_dma);
>  }
>  
> diff --git a/drivers/input/misc/ati_remote2.c b/drivers/input/misc/ati_remote2.c
> index 2124b99..e148749 100644
> --- a/drivers/input/misc/ati_remote2.c
> +++ b/drivers/input/misc/ati_remote2.c
> @@ -589,7 +589,7 @@ static int ati_remote2_urb_init(struct ati_remote2 *ar2)
>  	int i, pipe, maxp;
>  
>  	for (i = 0; i < 2; i++) {
> -		ar2->buf[i] = usb_buffer_alloc(udev, 4, GFP_KERNEL, &ar2->buf_dma[i]);
> +		ar2->buf[i] = usb_alloc_coherent(udev, 4, GFP_KERNEL, &ar2->buf_dma[i]);
>  		if (!ar2->buf[i])
>  			return -ENOMEM;
>  
> @@ -617,7 +617,7 @@ static void ati_remote2_urb_cleanup(struct ati_remote2 *ar2)
>  
>  	for (i = 0; i < 2; i++) {
>  		usb_free_urb(ar2->urb[i]);
> -		usb_buffer_free(ar2->udev, 4, ar2->buf[i], ar2->buf_dma[i]);
> +		usb_free_coherent(ar2->udev, 4, ar2->buf[i], ar2->buf_dma[i]);
>  	}
>  }
>  
> diff --git a/drivers/input/misc/cm109.c b/drivers/input/misc/cm109.c
> index 86457fe..635b7ac 100644
> --- a/drivers/input/misc/cm109.c
> +++ b/drivers/input/misc/cm109.c
> @@ -630,14 +630,14 @@ static const struct usb_device_id cm109_usb_table[] = {
>  static void cm109_usb_cleanup(struct cm109_dev *dev)
>  {
>  	if (dev->ctl_req)
> -		usb_buffer_free(dev->udev, sizeof(*(dev->ctl_req)),
> -				dev->ctl_req, dev->ctl_req_dma);
> +		usb_free_coherent(dev->udev, sizeof(*(dev->ctl_req)),
> +				  dev->ctl_req, dev->ctl_req_dma);
>  	if (dev->ctl_data)
> -		usb_buffer_free(dev->udev, USB_PKT_LEN,
> -				dev->ctl_data, dev->ctl_dma);
> +		usb_free_coherent(dev->udev, USB_PKT_LEN,
> +				  dev->ctl_data, dev->ctl_dma);
>  	if (dev->irq_data)
> -		usb_buffer_free(dev->udev, USB_PKT_LEN,
> -				dev->irq_data, dev->irq_dma);
> +		usb_free_coherent(dev->udev, USB_PKT_LEN,
> +				  dev->irq_data, dev->irq_dma);
>  
>  	usb_free_urb(dev->urb_irq);	/* parameter validation in core/urb */
>  	usb_free_urb(dev->urb_ctl);	/* parameter validation in core/urb */
> @@ -686,18 +686,18 @@ static int cm109_usb_probe(struct usb_interface *intf,
>  		goto err_out;
>  
>  	/* allocate usb buffers */
> -	dev->irq_data = usb_buffer_alloc(udev, USB_PKT_LEN,
> -					 GFP_KERNEL, &dev->irq_dma);
> +	dev->irq_data = usb_alloc_coherent(udev, USB_PKT_LEN,
> +					   GFP_KERNEL, &dev->irq_dma);
>  	if (!dev->irq_data)
>  		goto err_out;
>  
> -	dev->ctl_data = usb_buffer_alloc(udev, USB_PKT_LEN,
> -					 GFP_KERNEL, &dev->ctl_dma);
> +	dev->ctl_data = usb_alloc_coherent(udev, USB_PKT_LEN,
> +					   GFP_KERNEL, &dev->ctl_dma);
>  	if (!dev->ctl_data)
>  		goto err_out;
>  
> -	dev->ctl_req = usb_buffer_alloc(udev, sizeof(*(dev->ctl_req)),
> -					GFP_KERNEL, &dev->ctl_req_dma);
> +	dev->ctl_req = usb_alloc_coherent(udev, sizeof(*(dev->ctl_req)),
> +					  GFP_KERNEL, &dev->ctl_req_dma);
>  	if (!dev->ctl_req)
>  		goto err_out;
>  
> diff --git a/drivers/input/misc/keyspan_remote.c b/drivers/input/misc/keyspan_remote.c
> index 86afdd1..a93c525 100644
> --- a/drivers/input/misc/keyspan_remote.c
> +++ b/drivers/input/misc/keyspan_remote.c
> @@ -464,7 +464,7 @@ static int keyspan_probe(struct usb_interface *interface, const struct usb_devic
>  	remote->in_endpoint = endpoint;
>  	remote->toggle = -1;	/* Set to -1 so we will always not match the toggle from the first remote message. */
>  
> -	remote->in_buffer = usb_buffer_alloc(udev, RECV_SIZE, GFP_ATOMIC, &remote->in_dma);
> +	remote->in_buffer = usb_alloc_coherent(udev, RECV_SIZE, GFP_ATOMIC, &remote->in_dma);
>  	if (!remote->in_buffer) {
>  		error = -ENOMEM;
>  		goto fail1;
> @@ -543,7 +543,7 @@ static int keyspan_probe(struct usb_interface *interface, const struct usb_devic
>  	return 0;
>  
>   fail3:	usb_free_urb(remote->irq_urb);
> - fail2:	usb_buffer_free(udev, RECV_SIZE, remote->in_buffer, remote->in_dma);
> + fail2:	usb_free_coherent(udev, RECV_SIZE, remote->in_buffer, remote->in_dma);
>   fail1:	kfree(remote);
>  	input_free_device(input_dev);
>  
> @@ -564,7 +564,7 @@ static void keyspan_disconnect(struct usb_interface *interface)
>  		input_unregister_device(remote->input);
>  		usb_kill_urb(remote->irq_urb);
>  		usb_free_urb(remote->irq_urb);
> -		usb_buffer_free(remote->udev, RECV_SIZE, remote->in_buffer, remote->in_dma);
> +		usb_free_coherent(remote->udev, RECV_SIZE, remote->in_buffer, remote->in_dma);
>  		kfree(remote);
>  	}
>  }
> diff --git a/drivers/input/misc/powermate.c b/drivers/input/misc/powermate.c
> index 668913d..a0b00d6 100644
> --- a/drivers/input/misc/powermate.c
> +++ b/drivers/input/misc/powermate.c
> @@ -276,13 +276,13 @@ static int powermate_input_event(struct input_dev *dev, unsigned int type, unsig
>  
>  static int powermate_alloc_buffers(struct usb_device *udev, struct powermate_device *pm)
>  {
> -	pm->data = usb_buffer_alloc(udev, POWERMATE_PAYLOAD_SIZE_MAX,
> -				    GFP_ATOMIC, &pm->data_dma);
> +	pm->data = usb_alloc_coherent(udev, POWERMATE_PAYLOAD_SIZE_MAX,
> +				      GFP_ATOMIC, &pm->data_dma);
>  	if (!pm->data)
>  		return -1;
>  
> -	pm->configcr = usb_buffer_alloc(udev, sizeof(*(pm->configcr)),
> -					GFP_ATOMIC, &pm->configcr_dma);
> +	pm->configcr = usb_alloc_coherent(udev, sizeof(*(pm->configcr)),
> +					  GFP_ATOMIC, &pm->configcr_dma);
>  	if (!pm->configcr)
>  		return -1;
>  
> @@ -291,10 +291,10 @@ static int powermate_alloc_buffers(struct usb_device *udev, struct powermate_dev
>  
>  static void powermate_free_buffers(struct usb_device *udev, struct powermate_device *pm)
>  {
> -	usb_buffer_free(udev, POWERMATE_PAYLOAD_SIZE_MAX,
> -			pm->data, pm->data_dma);
> -	usb_buffer_free(udev, sizeof(*(pm->configcr)),
> -			pm->configcr, pm->configcr_dma);
> +	usb_free_coherent(udev, POWERMATE_PAYLOAD_SIZE_MAX,
> +			  pm->data, pm->data_dma);
> +	usb_free_coherent(udev, sizeof(*(pm->configcr)),
> +			  pm->configcr, pm->configcr_dma);
>  }
>  
>  /* Called whenever a USB device matching one in our supported devices table is connected */
> diff --git a/drivers/input/misc/yealink.c b/drivers/input/misc/yealink.c
> index 93a22ac..f584985 100644
> --- a/drivers/input/misc/yealink.c
> +++ b/drivers/input/misc/yealink.c
> @@ -836,12 +836,12 @@ static int usb_cleanup(struct yealink_dev *yld, int err)
>  	usb_free_urb(yld->urb_irq);
>  	usb_free_urb(yld->urb_ctl);
>  
> -	usb_buffer_free(yld->udev, sizeof(*(yld->ctl_req)),
> -			yld->ctl_req, yld->ctl_req_dma);
> -	usb_buffer_free(yld->udev, USB_PKT_LEN,
> -			yld->ctl_data, yld->ctl_dma);
> -	usb_buffer_free(yld->udev, USB_PKT_LEN,
> -			yld->irq_data, yld->irq_dma);
> +	usb_free_coherent(yld->udev, sizeof(*(yld->ctl_req)),
> +			  yld->ctl_req, yld->ctl_req_dma);
> +	usb_free_coherent(yld->udev, USB_PKT_LEN,
> +			  yld->ctl_data, yld->ctl_dma);
> +	usb_free_coherent(yld->udev, USB_PKT_LEN,
> +			  yld->irq_data, yld->irq_dma);
>  
>  	kfree(yld);
>  	return err;
> @@ -886,18 +886,18 @@ static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
>  		return usb_cleanup(yld, -ENOMEM);
>  
>  	/* allocate usb buffers */
> -	yld->irq_data = usb_buffer_alloc(udev, USB_PKT_LEN,
> -					GFP_ATOMIC, &yld->irq_dma);
> +	yld->irq_data = usb_alloc_coherent(udev, USB_PKT_LEN,
> +					  GFP_ATOMIC, &yld->irq_dma);
>  	if (yld->irq_data == NULL)
>  		return usb_cleanup(yld, -ENOMEM);
>  
> -	yld->ctl_data = usb_buffer_alloc(udev, USB_PKT_LEN,
> -					GFP_ATOMIC, &yld->ctl_dma);
> +	yld->ctl_data = usb_alloc_coherent(udev, USB_PKT_LEN,
> +					  GFP_ATOMIC, &yld->ctl_dma);
>  	if (!yld->ctl_data)
>  		return usb_cleanup(yld, -ENOMEM);
>  
> -	yld->ctl_req = usb_buffer_alloc(udev, sizeof(*(yld->ctl_req)),
> -					GFP_ATOMIC, &yld->ctl_req_dma);
> +	yld->ctl_req = usb_alloc_coherent(udev, sizeof(*(yld->ctl_req)),
> +					  GFP_ATOMIC, &yld->ctl_req_dma);
>  	if (yld->ctl_req == NULL)
>  		return usb_cleanup(yld, -ENOMEM);
>  
> diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c
> index 53ec7dd..05edd75 100644
> --- a/drivers/input/mouse/appletouch.c
> +++ b/drivers/input/mouse/appletouch.c
> @@ -806,8 +806,8 @@ static int atp_probe(struct usb_interface *iface,
>  	if (!dev->urb)
>  		goto err_free_devs;
>  
> -	dev->data = usb_buffer_alloc(dev->udev, dev->info->datalen, GFP_KERNEL,
> -				     &dev->urb->transfer_dma);
> +	dev->data = usb_alloc_coherent(dev->udev, dev->info->datalen, GFP_KERNEL,
> +				       &dev->urb->transfer_dma);
>  	if (!dev->data)
>  		goto err_free_urb;
>  
> @@ -862,8 +862,8 @@ static int atp_probe(struct usb_interface *iface,
>  	return 0;
>  
>   err_free_buffer:
> -	usb_buffer_free(dev->udev, dev->info->datalen,
> -			dev->data, dev->urb->transfer_dma);
> +	usb_free_coherent(dev->udev, dev->info->datalen,
> +			  dev->data, dev->urb->transfer_dma);
>   err_free_urb:
>  	usb_free_urb(dev->urb);
>   err_free_devs:
> @@ -881,8 +881,8 @@ static void atp_disconnect(struct usb_interface *iface)
>  	if (dev) {
>  		usb_kill_urb(dev->urb);
>  		input_unregister_device(dev->input);
> -		usb_buffer_free(dev->udev, dev->info->datalen,
> -				dev->data, dev->urb->transfer_dma);
> +		usb_free_coherent(dev->udev, dev->info->datalen,
> +				  dev->data, dev->urb->transfer_dma);
>  		usb_free_urb(dev->urb);
>  		kfree(dev);
>  	}
> diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c
> index 4f8fe08..aa3359a 100644
> --- a/drivers/input/mouse/bcm5974.c
> +++ b/drivers/input/mouse/bcm5974.c
> @@ -715,15 +715,15 @@ static int bcm5974_probe(struct usb_interface *iface,
>  	if (!dev->tp_urb)
>  		goto err_free_bt_urb;
>  
> -	dev->bt_data = usb_buffer_alloc(dev->udev,
> -					dev->cfg.bt_datalen, GFP_KERNEL,
> -					&dev->bt_urb->transfer_dma);
> +	dev->bt_data = usb_alloc_coherent(dev->udev,
> +					  dev->cfg.bt_datalen, GFP_KERNEL,
> +					  &dev->bt_urb->transfer_dma);
>  	if (!dev->bt_data)
>  		goto err_free_urb;
>  
> -	dev->tp_data = usb_buffer_alloc(dev->udev,
> -					dev->cfg.tp_datalen, GFP_KERNEL,
> -					&dev->tp_urb->transfer_dma);
> +	dev->tp_data = usb_alloc_coherent(dev->udev,
> +					  dev->cfg.tp_datalen, GFP_KERNEL,
> +					  &dev->tp_urb->transfer_dma);
>  	if (!dev->tp_data)
>  		goto err_free_bt_buffer;
>  
> @@ -765,10 +765,10 @@ static int bcm5974_probe(struct usb_interface *iface,
>  	return 0;
>  
>  err_free_buffer:
> -	usb_buffer_free(dev->udev, dev->cfg.tp_datalen,
> +	usb_free_coherent(dev->udev, dev->cfg.tp_datalen,
>  		dev->tp_data, dev->tp_urb->transfer_dma);
>  err_free_bt_buffer:
> -	usb_buffer_free(dev->udev, dev->cfg.bt_datalen,
> +	usb_free_coherent(dev->udev, dev->cfg.bt_datalen,
>  		dev->bt_data, dev->bt_urb->transfer_dma);
>  err_free_urb:
>  	usb_free_urb(dev->tp_urb);
> @@ -788,10 +788,10 @@ static void bcm5974_disconnect(struct usb_interface *iface)
>  	usb_set_intfdata(iface, NULL);
>  
>  	input_unregister_device(dev->input);
> -	usb_buffer_free(dev->udev, dev->cfg.tp_datalen,
> -			dev->tp_data, dev->tp_urb->transfer_dma);
> -	usb_buffer_free(dev->udev, dev->cfg.bt_datalen,
> -			dev->bt_data, dev->bt_urb->transfer_dma);
> +	usb_free_coherent(dev->udev, dev->cfg.tp_datalen,
> +			  dev->tp_data, dev->tp_urb->transfer_dma);
> +	usb_free_coherent(dev->udev, dev->cfg.bt_datalen,
> +			  dev->bt_data, dev->bt_urb->transfer_dma);
>  	usb_free_urb(dev->tp_urb);
>  	usb_free_urb(dev->bt_urb);
>  	kfree(dev);
> diff --git a/drivers/input/tablet/acecad.c b/drivers/input/tablet/acecad.c
> index 670c61c..c047016 100644
> --- a/drivers/input/tablet/acecad.c
> +++ b/drivers/input/tablet/acecad.c
> @@ -155,7 +155,7 @@ static int usb_acecad_probe(struct usb_interface *intf, const struct usb_device_
>  		goto fail1;
>  	}
>  
> -	acecad->data = usb_buffer_alloc(dev, 8, GFP_KERNEL, &acecad->data_dma);
> +	acecad->data = usb_alloc_coherent(dev, 8, GFP_KERNEL, &acecad->data_dma);
>  	if (!acecad->data) {
>  		err= -ENOMEM;
>  		goto fail1;
> @@ -241,7 +241,7 @@ static int usb_acecad_probe(struct usb_interface *intf, const struct usb_device_
>  
>  	return 0;
>  
> - fail2:	usb_buffer_free(dev, 8, acecad->data, acecad->data_dma);
> + fail2:	usb_free_coherent(dev, 8, acecad->data, acecad->data_dma);
>   fail1: input_free_device(input_dev);
>  	kfree(acecad);
>  	return err;
> @@ -256,7 +256,7 @@ static void usb_acecad_disconnect(struct usb_interface *intf)
>  		usb_kill_urb(acecad->irq);
>  		input_unregister_device(acecad->input);
>  		usb_free_urb(acecad->irq);
> -		usb_buffer_free(interface_to_usbdev(intf), 10, acecad->data, acecad->data_dma);
> +		usb_free_coherent(interface_to_usbdev(intf), 10, acecad->data, acecad->data_dma);
>  		kfree(acecad);
>  	}
>  }
> diff --git a/drivers/input/tablet/aiptek.c b/drivers/input/tablet/aiptek.c
> index 4be039d..51b80b0 100644
> --- a/drivers/input/tablet/aiptek.c
> +++ b/drivers/input/tablet/aiptek.c
> @@ -1711,8 +1711,8 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id)
>  		goto fail1;
>          }
>  
> -	aiptek->data = usb_buffer_alloc(usbdev, AIPTEK_PACKET_LENGTH,
> -					GFP_ATOMIC, &aiptek->data_dma);
> +	aiptek->data = usb_alloc_coherent(usbdev, AIPTEK_PACKET_LENGTH,
> +					  GFP_ATOMIC, &aiptek->data_dma);
>          if (!aiptek->data) {
>  		dev_warn(&intf->dev, "cannot allocate usb buffer\n");
>  		goto fail1;
> @@ -1884,8 +1884,8 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id)
>  
>   fail4:	sysfs_remove_group(&intf->dev.kobj, &aiptek_attribute_group);
>   fail3: usb_free_urb(aiptek->urb);
> - fail2:	usb_buffer_free(usbdev, AIPTEK_PACKET_LENGTH, aiptek->data,
> -			aiptek->data_dma);
> + fail2:	usb_free_coherent(usbdev, AIPTEK_PACKET_LENGTH, aiptek->data,
> +			  aiptek->data_dma);
>   fail1: usb_set_intfdata(intf, NULL);
>  	input_free_device(inputdev);
>  	kfree(aiptek);
> @@ -1909,9 +1909,9 @@ static void aiptek_disconnect(struct usb_interface *intf)
>  		input_unregister_device(aiptek->inputdev);
>  		sysfs_remove_group(&intf->dev.kobj, &aiptek_attribute_group);
>  		usb_free_urb(aiptek->urb);
> -		usb_buffer_free(interface_to_usbdev(intf),
> -				AIPTEK_PACKET_LENGTH,
> -				aiptek->data, aiptek->data_dma);
> +		usb_free_coherent(interface_to_usbdev(intf),
> +				  AIPTEK_PACKET_LENGTH,
> +				  aiptek->data, aiptek->data_dma);
>  		kfree(aiptek);
>  	}
>  }
> diff --git a/drivers/input/tablet/gtco.c b/drivers/input/tablet/gtco.c
> index 866a9ee..8ea6afe 100644
> --- a/drivers/input/tablet/gtco.c
> +++ b/drivers/input/tablet/gtco.c
> @@ -850,8 +850,8 @@ static int gtco_probe(struct usb_interface *usbinterface,
>  	gtco->usbdev = usb_get_dev(interface_to_usbdev(usbinterface));
>  
>  	/* Allocate some data for incoming reports */
> -	gtco->buffer = usb_buffer_alloc(gtco->usbdev, REPORT_MAX_SIZE,
> -					GFP_KERNEL, &gtco->buf_dma);
> +	gtco->buffer = usb_alloc_coherent(gtco->usbdev, REPORT_MAX_SIZE,
> +					  GFP_KERNEL, &gtco->buf_dma);
>  	if (!gtco->buffer) {
>  		err("No more memory for us buffers");
>  		error = -ENOMEM;
> @@ -982,8 +982,8 @@ static int gtco_probe(struct usb_interface *usbinterface,
>   err_free_urb:
>  	usb_free_urb(gtco->urbinfo);
>   err_free_buf:
> -	usb_buffer_free(gtco->usbdev, REPORT_MAX_SIZE,
> -			gtco->buffer, gtco->buf_dma);
> +	usb_free_coherent(gtco->usbdev, REPORT_MAX_SIZE,
> +			  gtco->buffer, gtco->buf_dma);
>   err_free_devs:
>  	input_free_device(input_dev);
>  	kfree(gtco);
> @@ -1005,8 +1005,8 @@ static void gtco_disconnect(struct usb_interface *interface)
>  		input_unregister_device(gtco->inputdevice);
>  		usb_kill_urb(gtco->urbinfo);
>  		usb_free_urb(gtco->urbinfo);
> -		usb_buffer_free(gtco->usbdev, REPORT_MAX_SIZE,
> -				gtco->buffer, gtco->buf_dma);
> +		usb_free_coherent(gtco->usbdev, REPORT_MAX_SIZE,
> +				  gtco->buffer, gtco->buf_dma);
>  		kfree(gtco);
>  	}
>  
> diff --git a/drivers/input/tablet/kbtab.c b/drivers/input/tablet/kbtab.c
> index 6682b17..d31b9c7 100644
> --- a/drivers/input/tablet/kbtab.c
> +++ b/drivers/input/tablet/kbtab.c
> @@ -129,7 +129,7 @@ static int kbtab_probe(struct usb_interface *intf, const struct usb_device_id *i
>  	if (!kbtab || !input_dev)
>  		goto fail1;
>  
> -	kbtab->data = usb_buffer_alloc(dev, 8, GFP_KERNEL, &kbtab->data_dma);
> +	kbtab->data = usb_alloc_coherent(dev, 8, GFP_KERNEL, &kbtab->data_dma);
>  	if (!kbtab->data)
>  		goto fail1;
>  
> @@ -182,7 +182,7 @@ static int kbtab_probe(struct usb_interface *intf, const struct usb_device_id *i
>  	return 0;
>  
>   fail3:	usb_free_urb(kbtab->irq);
> - fail2:	usb_buffer_free(dev, 10, kbtab->data, kbtab->data_dma);
> + fail2:	usb_free_coherent(dev, 10, kbtab->data, kbtab->data_dma);
>   fail1:	input_free_device(input_dev);
>  	kfree(kbtab);
>  	return error;
> @@ -197,7 +197,7 @@ static void kbtab_disconnect(struct usb_interface *intf)
>  		usb_kill_urb(kbtab->irq);
>  		input_unregister_device(kbtab->dev);
>  		usb_free_urb(kbtab->irq);
> -		usb_buffer_free(interface_to_usbdev(intf), 10, kbtab->data, kbtab->data_dma);
> +		usb_free_coherent(interface_to_usbdev(intf), 10, kbtab->data, kbtab->data_dma);
>  		kfree(kbtab);
>  	}
>  }
> diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
> index 8b5d287..5d5b3c3 100644
> --- a/drivers/input/tablet/wacom_sys.c
> +++ b/drivers/input/tablet/wacom_sys.c
> @@ -556,8 +556,8 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
>  		goto fail1;
>  	}
>  
> -	wacom_wac->data = usb_buffer_alloc(dev, WACOM_PKGLEN_MAX,
> -					   GFP_KERNEL, &wacom->data_dma);
> +	wacom_wac->data = usb_alloc_coherent(dev, WACOM_PKGLEN_MAX,
> +					     GFP_KERNEL, &wacom->data_dma);
>  	if (!wacom_wac->data) {
>  		error = -ENOMEM;
>  		goto fail1;
> @@ -633,7 +633,7 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
>  	return 0;
>  
>   fail3:	usb_free_urb(wacom->irq);
> - fail2:	usb_buffer_free(dev, WACOM_PKGLEN_MAX, wacom_wac->data, wacom->data_dma);
> + fail2:	usb_free_coherent(dev, WACOM_PKGLEN_MAX, wacom_wac->data, wacom->data_dma);
>   fail1:	input_free_device(input_dev);
>  	kfree(wacom);
>  	kfree(wacom_wac);
> @@ -649,8 +649,8 @@ static void wacom_disconnect(struct usb_interface *intf)
>  	usb_kill_urb(wacom->irq);
>  	input_unregister_device(wacom->dev);
>  	usb_free_urb(wacom->irq);
> -	usb_buffer_free(interface_to_usbdev(intf), WACOM_PKGLEN_MAX,
> -			wacom->wacom_wac->data, wacom->data_dma);
> +	usb_free_coherent(interface_to_usbdev(intf), WACOM_PKGLEN_MAX,
> +			  wacom->wacom_wac->data, wacom->data_dma);
>  	kfree(wacom->wacom_wac);
>  	kfree(wacom);
>  }
> diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c
> index 99330bb..ea41a85 100644
> --- a/drivers/input/touchscreen/usbtouchscreen.c
> +++ b/drivers/input/touchscreen/usbtouchscreen.c
> @@ -1291,8 +1291,8 @@ static void usbtouch_close(struct input_dev *input)
>  static void usbtouch_free_buffers(struct usb_device *udev,
>  				  struct usbtouch_usb *usbtouch)
>  {
> -	usb_buffer_free(udev, usbtouch->type->rept_size,
> -	                usbtouch->data, usbtouch->data_dma);
> +	usb_free_coherent(udev, usbtouch->type->rept_size,
> +			  usbtouch->data, usbtouch->data_dma);
>  	kfree(usbtouch->buffer);
>  }
>  
> @@ -1336,8 +1336,8 @@ static int usbtouch_probe(struct usb_interface *intf,
>  	if (!type->process_pkt)
>  		type->process_pkt = usbtouch_process_pkt;
>  
> -	usbtouch->data = usb_buffer_alloc(udev, type->rept_size,
> -	                                  GFP_KERNEL, &usbtouch->data_dma);
> +	usbtouch->data = usb_alloc_coherent(udev, type->rept_size,
> +					    GFP_KERNEL, &usbtouch->data_dma);
>  	if (!usbtouch->data)
>  		goto out_free;
>  
> diff --git a/drivers/media/dvb/dvb-usb/usb-urb.c b/drivers/media/dvb/dvb-usb/usb-urb.c
> index f9702e3..86d6893 100644
> --- a/drivers/media/dvb/dvb-usb/usb-urb.c
> +++ b/drivers/media/dvb/dvb-usb/usb-urb.c
> @@ -96,8 +96,9 @@ static int usb_free_stream_buffers(struct usb_data_stream *stream)
>  		while (stream->buf_num) {
>  			stream->buf_num--;
>  			deb_mem("freeing buffer %d\n",stream->buf_num);
> -			usb_buffer_free(stream->udev, stream->buf_size,
> -					stream->buf_list[stream->buf_num], stream->dma_addr[stream->buf_num]);
> +			usb_free_coherent(stream->udev, stream->buf_size,
> +					  stream->buf_list[stream->buf_num],
> +					  stream->dma_addr[stream->buf_num]);
>  		}
>  	}
>  
> @@ -116,7 +117,7 @@ static int usb_allocate_stream_buffers(struct usb_data_stream *stream, int num,
>  	for (stream->buf_num = 0; stream->buf_num < num; stream->buf_num++) {
>  		deb_mem("allocating buffer %d\n",stream->buf_num);
>  		if (( stream->buf_list[stream->buf_num] =
> -					usb_buffer_alloc(stream->udev, size, GFP_ATOMIC,
> +					usb_alloc_coherent(stream->udev, size, GFP_ATOMIC,
>  					&stream->dma_addr[stream->buf_num]) ) == NULL) {
>  			deb_mem("not enough memory for urb-buffer allocation.\n");
>  			usb_free_stream_buffers(stream);
> diff --git a/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/drivers/media/dvb/ttusb-dec/ttusb_dec.c
> index 53baccb..fe1b803 100644
> --- a/drivers/media/dvb/ttusb-dec/ttusb_dec.c
> +++ b/drivers/media/dvb/ttusb-dec/ttusb_dec.c
> @@ -1257,7 +1257,7 @@ static int ttusb_dec_init_usb(struct ttusb_dec *dec)
>  		if(!dec->irq_urb) {
>  			return -ENOMEM;
>  		}
> -		dec->irq_buffer = usb_buffer_alloc(dec->udev,IRQ_PACKET_SIZE,
> +		dec->irq_buffer = usb_alloc_coherent(dec->udev,IRQ_PACKET_SIZE,
>  					GFP_ATOMIC, &dec->irq_dma_handle);
>  		if(!dec->irq_buffer) {
>  			usb_free_urb(dec->irq_urb);
> @@ -1550,8 +1550,8 @@ static void ttusb_dec_exit_rc(struct ttusb_dec *dec)
>  
>  	usb_free_urb(dec->irq_urb);
>  
> -	usb_buffer_free(dec->udev,IRQ_PACKET_SIZE,
> -			   dec->irq_buffer, dec->irq_dma_handle);
> +	usb_free_coherent(dec->udev,IRQ_PACKET_SIZE,
> +			  dec->irq_buffer, dec->irq_dma_handle);
>  
>  	if (dec->rc_input_dev) {
>  		input_unregister_device(dec->rc_input_dev);
> diff --git a/drivers/media/video/au0828/au0828-video.c b/drivers/media/video/au0828/au0828-video.c
> index 8c140c0..a2a0f79 100644
> --- a/drivers/media/video/au0828/au0828-video.c
> +++ b/drivers/media/video/au0828/au0828-video.c
> @@ -177,7 +177,7 @@ void au0828_uninit_isoc(struct au0828_dev *dev)
>  				usb_unlink_urb(urb);
>  
>  			if (dev->isoc_ctl.transfer_buffer[i]) {
> -				usb_buffer_free(dev->usbdev,
> +				usb_free_coherent(dev->usbdev,
>  					urb->transfer_buffer_length,
>  					dev->isoc_ctl.transfer_buffer[i],
>  					urb->transfer_dma);
> @@ -247,7 +247,7 @@ int au0828_init_isoc(struct au0828_dev *dev, int max_packets,
>  		}
>  		dev->isoc_ctl.urb[i] = urb;
>  
> -		dev->isoc_ctl.transfer_buffer[i] = usb_buffer_alloc(dev->usbdev,
> +		dev->isoc_ctl.transfer_buffer[i] = usb_alloc_coherent(dev->usbdev,
>  			sb_size, GFP_KERNEL, &urb->transfer_dma);
>  		if (!dev->isoc_ctl.transfer_buffer[i]) {
>  			printk("unable to allocate %i bytes for transfer"
> diff --git a/drivers/media/video/cx231xx/cx231xx-core.c b/drivers/media/video/cx231xx/cx231xx-core.c
> index b24eee1..6ccd87d 100644
> --- a/drivers/media/video/cx231xx/cx231xx-core.c
> +++ b/drivers/media/video/cx231xx/cx231xx-core.c
> @@ -679,11 +679,11 @@ void cx231xx_uninit_isoc(struct cx231xx *dev)
>  				usb_unlink_urb(urb);
>  
>  			if (dev->video_mode.isoc_ctl.transfer_buffer[i]) {
> -				usb_buffer_free(dev->udev,
> -						urb->transfer_buffer_length,
> -						dev->video_mode.isoc_ctl.
> -						transfer_buffer[i],
> -						urb->transfer_dma);
> +				usb_free_coherent(dev->udev,
> +						  urb->transfer_buffer_length,
> +						  dev->video_mode.isoc_ctl.
> +						  transfer_buffer[i],
> +						  urb->transfer_dma);
>  			}
>  			usb_free_urb(urb);
>  			dev->video_mode.isoc_ctl.urb[i] = NULL;
> @@ -770,8 +770,8 @@ int cx231xx_init_isoc(struct cx231xx *dev, int max_packets,
>  		dev->video_mode.isoc_ctl.urb[i] = urb;
>  
>  		dev->video_mode.isoc_ctl.transfer_buffer[i] =
> -		    usb_buffer_alloc(dev->udev, sb_size, GFP_KERNEL,
> -				     &urb->transfer_dma);
> +		    usb_alloc_coherent(dev->udev, sb_size, GFP_KERNEL,
> +				       &urb->transfer_dma);
>  		if (!dev->video_mode.isoc_ctl.transfer_buffer[i]) {
>  			cx231xx_err("unable to allocate %i bytes for transfer"
>  				    " buffer %i%s\n",
> diff --git a/drivers/media/video/em28xx/em28xx-core.c b/drivers/media/video/em28xx/em28xx-core.c
> index a41cc55..d4a9554 100644
> --- a/drivers/media/video/em28xx/em28xx-core.c
> +++ b/drivers/media/video/em28xx/em28xx-core.c
> @@ -966,7 +966,7 @@ void em28xx_uninit_isoc(struct em28xx *dev)
>  				usb_unlink_urb(urb);
>  
>  			if (dev->isoc_ctl.transfer_buffer[i]) {
> -				usb_buffer_free(dev->udev,
> +				usb_free_coherent(dev->udev,
>  					urb->transfer_buffer_length,
>  					dev->isoc_ctl.transfer_buffer[i],
>  					urb->transfer_dma);
> @@ -1041,7 +1041,7 @@ int em28xx_init_isoc(struct em28xx *dev, int max_packets,
>  		}
>  		dev->isoc_ctl.urb[i] = urb;
>  
> -		dev->isoc_ctl.transfer_buffer[i] = usb_buffer_alloc(dev->udev,
> +		dev->isoc_ctl.transfer_buffer[i] = usb_alloc_coherent(dev->udev,
>  			sb_size, GFP_KERNEL, &urb->transfer_dma);
>  		if (!dev->isoc_ctl.transfer_buffer[i]) {
>  			em28xx_err("unable to allocate %i bytes for transfer"
> diff --git a/drivers/media/video/gspca/benq.c b/drivers/media/video/gspca/benq.c
> index 43ac4af..fce8d94 100644
> --- a/drivers/media/video/gspca/benq.c
> +++ b/drivers/media/video/gspca/benq.c
> @@ -117,13 +117,13 @@ static int sd_start(struct gspca_dev *gspca_dev)
>  			return -ENOMEM;
>  		}
>  		gspca_dev->urb[n] = urb;
> -		urb->transfer_buffer = usb_buffer_alloc(gspca_dev->dev,
> +		urb->transfer_buffer = usb_alloc_coherent(gspca_dev->dev,
>  						SD_PKT_SZ * SD_NPKT,
>  						GFP_KERNEL,
>  						&urb->transfer_dma);
>  
>  		if (urb->transfer_buffer == NULL) {
> -			err("usb_buffer_alloc failed");
> +			err("usb_alloc_coherent failed");
>  			return -ENOMEM;
>  		}
>  		urb->dev = gspca_dev->dev;
> diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c
> index 222af47..00713f8 100644
> --- a/drivers/media/video/gspca/gspca.c
> +++ b/drivers/media/video/gspca/gspca.c
> @@ -213,7 +213,7 @@ static int alloc_and_submit_int_urb(struct gspca_dev *gspca_dev,
>  		goto error;
>  	}
>  
> -	buffer = usb_buffer_alloc(dev, ep->wMaxPacketSize,
> +	buffer = usb_alloc_coherent(dev, ep->wMaxPacketSize,
>  				GFP_KERNEL, &urb->transfer_dma);
>  	if (!buffer) {
>  		ret = -ENOMEM;
> @@ -232,10 +232,10 @@ static int alloc_and_submit_int_urb(struct gspca_dev *gspca_dev,
>  	return ret;
>  
>  error_submit:
> -	usb_buffer_free(dev,
> -			urb->transfer_buffer_length,
> -			urb->transfer_buffer,
> -			urb->transfer_dma);
> +	usb_free_coherent(dev,
> +			  urb->transfer_buffer_length,
> +			  urb->transfer_buffer,
> +			  urb->transfer_dma);
>  error_buffer:
>  	usb_free_urb(urb);
>  error:
> @@ -272,10 +272,10 @@ static void gspca_input_destroy_urb(struct gspca_dev *gspca_dev)
>  	if (urb) {
>  		gspca_dev->int_urb = NULL;
>  		usb_kill_urb(urb);
> -		usb_buffer_free(gspca_dev->dev,
> -				urb->transfer_buffer_length,
> -				urb->transfer_buffer,
> -				urb->transfer_dma);
> +		usb_free_coherent(gspca_dev->dev,
> +				  urb->transfer_buffer_length,
> +				  urb->transfer_buffer,
> +				  urb->transfer_dma);
>  		usb_free_urb(urb);
>  	}
>  }
> @@ -597,10 +597,10 @@ static void destroy_urbs(struct gspca_dev *gspca_dev)
>  		gspca_dev->urb[i] = NULL;
>  		usb_kill_urb(urb);
>  		if (urb->transfer_buffer != NULL)
> -			usb_buffer_free(gspca_dev->dev,
> -					urb->transfer_buffer_length,
> -					urb->transfer_buffer,
> -					urb->transfer_dma);
> +			usb_free_coherent(gspca_dev->dev,
> +					  urb->transfer_buffer_length,
> +					  urb->transfer_buffer,
> +					  urb->transfer_dma);
>  		usb_free_urb(urb);
>  	}
>  }
> @@ -721,13 +721,13 @@ static int create_urbs(struct gspca_dev *gspca_dev,
>  			return -ENOMEM;
>  		}
>  		gspca_dev->urb[n] = urb;
> -		urb->transfer_buffer = usb_buffer_alloc(gspca_dev->dev,
> +		urb->transfer_buffer = usb_alloc_coherent(gspca_dev->dev,
>  						bsize,
>  						GFP_KERNEL,
>  						&urb->transfer_dma);
>  
>  		if (urb->transfer_buffer == NULL) {
> -			err("usb_buffer_alloc failed");
> +			err("usb_alloc_coherent failed");
>  			return -ENOMEM;
>  		}
>  		urb->dev = gspca_dev->dev;
> diff --git a/drivers/media/video/hdpvr/hdpvr-video.c b/drivers/media/video/hdpvr/hdpvr-video.c
> index 196f82d..b65efe2 100644
> --- a/drivers/media/video/hdpvr/hdpvr-video.c
> +++ b/drivers/media/video/hdpvr/hdpvr-video.c
> @@ -92,8 +92,8 @@ static int hdpvr_free_queue(struct list_head *q)
>  		buf = list_entry(p, struct hdpvr_buffer, buff_list);
>  
>  		urb = buf->urb;
> -		usb_buffer_free(urb->dev, urb->transfer_buffer_length,
> -				urb->transfer_buffer, urb->transfer_dma);
> +		usb_free_coherent(urb->dev, urb->transfer_buffer_length,
> +				  urb->transfer_buffer, urb->transfer_dma);
>  		usb_free_urb(urb);
>  		tmp = p->next;
>  		list_del(p);
> @@ -143,8 +143,8 @@ int hdpvr_alloc_buffers(struct hdpvr_device *dev, uint count)
>  		}
>  		buf->urb = urb;
>  
> -		mem = usb_buffer_alloc(dev->udev, dev->bulk_in_size, GFP_KERNEL,
> -				       &urb->transfer_dma);
> +		mem = usb_alloc_coherent(dev->udev, dev->bulk_in_size, GFP_KERNEL,
> +					 &urb->transfer_dma);
>  		if (!mem) {
>  			v4l2_err(&dev->v4l2_dev,
>  				 "cannot allocate usb transfer buffer\n");
> diff --git a/drivers/media/video/tlg2300/pd-video.c b/drivers/media/video/tlg2300/pd-video.c
> index cf8f18c..7bc2906 100644
> --- a/drivers/media/video/tlg2300/pd-video.c
> +++ b/drivers/media/video/tlg2300/pd-video.c
> @@ -476,10 +476,10 @@ static int prepare_iso_urb(struct video_data *video)
>  			goto out;
>  
>  		video->urb_array[i] = urb;
> -		mem = usb_buffer_alloc(udev,
> -					ISO_PKT_SIZE * PK_PER_URB,
> -					GFP_KERNEL,
> -					&urb->transfer_dma);
> +		mem = usb_alloc_coherent(udev,
> +					 ISO_PKT_SIZE * PK_PER_URB,
> +					 GFP_KERNEL,
> +					 &urb->transfer_dma);
>  
>  		urb->complete	= urb_complete_iso;	/* handler */
>  		urb->dev	= udev;
> @@ -519,8 +519,8 @@ int alloc_bulk_urbs_generic(struct urb **urb_array, int num,
>  		if (urb == NULL)
>  			return i;
>  
> -		mem = usb_buffer_alloc(udev, buf_size, gfp_flags,
> -					&urb->transfer_dma);
> +		mem = usb_alloc_coherent(udev, buf_size, gfp_flags,
> +					 &urb->transfer_dma);
>  		if (mem == NULL)
>  			return i;
>  
> @@ -540,7 +540,7 @@ void free_all_urb_generic(struct urb **urb_array, int num)
>  	for (i = 0; i < num; i++) {
>  		urb = urb_array[i];
>  		if (urb) {
> -			usb_buffer_free(urb->dev,
> +			usb_free_coherent(urb->dev,
>  					urb->transfer_buffer_length,
>  					urb->transfer_buffer,
>  					urb->transfer_dma);
> diff --git a/drivers/media/video/usbvision/usbvision-core.c b/drivers/media/video/usbvision/usbvision-core.c
> index f7aae22..b9dd74f 100644
> --- a/drivers/media/video/usbvision/usbvision-core.c
> +++ b/drivers/media/video/usbvision/usbvision-core.c
> @@ -2493,10 +2493,10 @@ int usbvision_init_isoc(struct usb_usbvision *usbvision)
>  		}
>  		usbvision->sbuf[bufIdx].urb = urb;
>  		usbvision->sbuf[bufIdx].data =
> -			usb_buffer_alloc(usbvision->dev,
> -					 sb_size,
> -					 GFP_KERNEL,
> -					 &urb->transfer_dma);
> +			usb_alloc_coherent(usbvision->dev,
> +					   sb_size,
> +					   GFP_KERNEL,
> +					   &urb->transfer_dma);
>  		urb->dev = dev;
>  		urb->context = usbvision;
>  		urb->pipe = usb_rcvisocpipe(dev, usbvision->video_endp);
> @@ -2552,10 +2552,10 @@ void usbvision_stop_isoc(struct usb_usbvision *usbvision)
>  	for (bufIdx = 0; bufIdx < USBVISION_NUMSBUF; bufIdx++) {
>  		usb_kill_urb(usbvision->sbuf[bufIdx].urb);
>  		if (usbvision->sbuf[bufIdx].data){
> -			usb_buffer_free(usbvision->dev,
> -					sb_size,
> -					usbvision->sbuf[bufIdx].data,
> -					usbvision->sbuf[bufIdx].urb->transfer_dma);
> +			usb_free_coherent(usbvision->dev,
> +					  sb_size,
> +					  usbvision->sbuf[bufIdx].data,
> +					  usbvision->sbuf[bufIdx].urb->transfer_dma);
>  		}
>  		usb_free_urb(usbvision->sbuf[bufIdx].urb);
>  		usbvision->sbuf[bufIdx].urb = NULL;
> diff --git a/drivers/media/video/uvc/uvc_video.c b/drivers/media/video/uvc/uvc_video.c
> index 821a996..53f3ef4 100644
> --- a/drivers/media/video/uvc/uvc_video.c
> +++ b/drivers/media/video/uvc/uvc_video.c
> @@ -739,7 +739,7 @@ static void uvc_free_urb_buffers(struct uvc_streaming *stream)
>  
>  	for (i = 0; i < UVC_URBS; ++i) {
>  		if (stream->urb_buffer[i]) {
> -			usb_buffer_free(stream->dev->udev, stream->urb_size,
> +			usb_free_coherent(stream->dev->udev, stream->urb_size,
>  				stream->urb_buffer[i], stream->urb_dma[i]);
>  			stream->urb_buffer[i] = NULL;
>  		}
> @@ -780,7 +780,7 @@ static int uvc_alloc_urb_buffers(struct uvc_streaming *stream,
>  	for (; npackets > 1; npackets /= 2) {
>  		for (i = 0; i < UVC_URBS; ++i) {
>  			stream->urb_size = psize * npackets;
> -			stream->urb_buffer[i] = usb_buffer_alloc(
> +			stream->urb_buffer[i] = usb_alloc_coherent(
>  				stream->dev->udev, stream->urb_size,
>  				gfp_flags | __GFP_NOWARN, &stream->urb_dma[i]);
>  			if (!stream->urb_buffer[i]) {
> diff --git a/drivers/net/can/usb/ems_usb.c b/drivers/net/can/usb/ems_usb.c
> index 3345109..62be62f 100644
> --- a/drivers/net/can/usb/ems_usb.c
> +++ b/drivers/net/can/usb/ems_usb.c
> @@ -516,8 +516,8 @@ static void ems_usb_write_bulk_callback(struct urb *urb)
>  	netdev = dev->netdev;
>  
>  	/* free up our allocated buffer */
> -	usb_buffer_free(urb->dev, urb->transfer_buffer_length,
> -			urb->transfer_buffer, urb->transfer_dma);
> +	usb_free_coherent(urb->dev, urb->transfer_buffer_length,
> +			  urb->transfer_buffer, urb->transfer_dma);
>  
>  	atomic_dec(&dev->active_tx_urbs);
>  
> @@ -614,8 +614,8 @@ static int ems_usb_start(struct ems_usb *dev)
>  			return -ENOMEM;
>  		}
>  
> -		buf = usb_buffer_alloc(dev->udev, RX_BUFFER_SIZE, GFP_KERNEL,
> -				       &urb->transfer_dma);
> +		buf = usb_alloc_coherent(dev->udev, RX_BUFFER_SIZE, GFP_KERNEL,
> +					 &urb->transfer_dma);
>  		if (!buf) {
>  			dev_err(netdev->dev.parent,
>  				"No memory left for USB buffer\n");
> @@ -635,8 +635,8 @@ static int ems_usb_start(struct ems_usb *dev)
>  				netif_device_detach(dev->netdev);
>  
>  			usb_unanchor_urb(urb);
> -			usb_buffer_free(dev->udev, RX_BUFFER_SIZE, buf,
> -					urb->transfer_dma);
> +			usb_free_coherent(dev->udev, RX_BUFFER_SIZE, buf,
> +					  urb->transfer_dma);
>  			break;
>  		}
>  
> @@ -777,7 +777,7 @@ static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *ne
>  		goto nomem;
>  	}
>  
> -	buf = usb_buffer_alloc(dev->udev, size, GFP_ATOMIC, &urb->transfer_dma);
> +	buf = usb_alloc_coherent(dev->udev, size, GFP_ATOMIC, &urb->transfer_dma);
>  	if (!buf) {
>  		dev_err(netdev->dev.parent, "No memory left for USB buffer\n");
>  		usb_free_urb(urb);
> @@ -820,7 +820,7 @@ static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *ne
>  	 */
>  	if (!context) {
>  		usb_unanchor_urb(urb);
> -		usb_buffer_free(dev->udev, size, buf, urb->transfer_dma);
> +		usb_free_coherent(dev->udev, size, buf, urb->transfer_dma);
>  
>  		dev_warn(netdev->dev.parent, "couldn't find free context\n");
>  
> @@ -845,7 +845,7 @@ static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *ne
>  		can_free_echo_skb(netdev, context->echo_index);
>  
>  		usb_unanchor_urb(urb);
> -		usb_buffer_free(dev->udev, size, buf, urb->transfer_dma);
> +		usb_free_coherent(dev->udev, size, buf, urb->transfer_dma);
>  		dev_kfree_skb(skb);
>  
>  		atomic_dec(&dev->active_tx_urbs);
> diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c
> index 52671ea..a790a6d 100644
> --- a/drivers/net/usb/kaweth.c
> +++ b/drivers/net/usb/kaweth.c
> @@ -1155,13 +1155,13 @@ err_fw:
>  	if (!kaweth->irq_urb)
>  		goto err_tx_and_rx;
>  
> -	kaweth->intbuffer = usb_buffer_alloc(	kaweth->dev,
> +	kaweth->intbuffer = usb_alloc_coherent(	kaweth->dev,
>  						INTBUFFERSIZE,
>  						GFP_KERNEL,
>  						&kaweth->intbufferhandle);
>  	if (!kaweth->intbuffer)
>  		goto err_tx_and_rx_and_irq;
> -	kaweth->rx_buf = usb_buffer_alloc(	kaweth->dev,
> +	kaweth->rx_buf = usb_alloc_coherent(	kaweth->dev,
>  						KAWETH_BUF_SIZE,
>  						GFP_KERNEL,
>  						&kaweth->rxbufferhandle);
> @@ -1202,9 +1202,9 @@ err_fw:
>  
>  err_intfdata:
>  	usb_set_intfdata(intf, NULL);
> -	usb_buffer_free(kaweth->dev, KAWETH_BUF_SIZE, (void *)kaweth->rx_buf, kaweth->rxbufferhandle);
> +	usb_free_coherent(kaweth->dev, KAWETH_BUF_SIZE, (void *)kaweth->rx_buf, kaweth->rxbufferhandle);
>  err_all_but_rxbuf:
> -	usb_buffer_free(kaweth->dev, INTBUFFERSIZE, (void *)kaweth->intbuffer, kaweth->intbufferhandle);
> +	usb_free_coherent(kaweth->dev, INTBUFFERSIZE, (void *)kaweth->intbuffer, kaweth->intbufferhandle);
>  err_tx_and_rx_and_irq:
>  	usb_free_urb(kaweth->irq_urb);
>  err_tx_and_rx:
> @@ -1241,8 +1241,8 @@ static void kaweth_disconnect(struct usb_interface *intf)
>  	usb_free_urb(kaweth->tx_urb);
>  	usb_free_urb(kaweth->irq_urb);
>  
> -	usb_buffer_free(kaweth->dev, KAWETH_BUF_SIZE, (void *)kaweth->rx_buf, kaweth->rxbufferhandle);
> -	usb_buffer_free(kaweth->dev, INTBUFFERSIZE, (void *)kaweth->intbuffer, kaweth->intbufferhandle);
> +	usb_free_coherent(kaweth->dev, KAWETH_BUF_SIZE, (void *)kaweth->rx_buf, kaweth->rxbufferhandle);
> +	usb_free_coherent(kaweth->dev, INTBUFFERSIZE, (void *)kaweth->intbuffer, kaweth->intbufferhandle);
>  
>  	free_netdev(netdev);
>  }
> diff --git a/drivers/net/wireless/ath/ar9170/usb.c b/drivers/net/wireless/ath/ar9170/usb.c
> index 0b0d2dc..14eda1d 100644
> --- a/drivers/net/wireless/ath/ar9170/usb.c
> +++ b/drivers/net/wireless/ath/ar9170/usb.c
> @@ -200,7 +200,7 @@ resubmit:
>  	return;
>  
>  free:
> -	usb_buffer_free(aru->udev, 64, urb->transfer_buffer, urb->transfer_dma);
> +	usb_free_coherent(aru->udev, 64, urb->transfer_buffer, urb->transfer_dma);
>  }
>  
>  static void ar9170_usb_rx_completed(struct urb *urb)
> @@ -281,7 +281,7 @@ static int ar9170_usb_alloc_rx_irq_urb(struct ar9170_usb *aru)
>  	if (!urb)
>  		goto out;
>  
> -	ibuf = usb_buffer_alloc(aru->udev, 64, GFP_KERNEL, &urb->transfer_dma);
> +	ibuf = usb_alloc_coherent(aru->udev, 64, GFP_KERNEL, &urb->transfer_dma);
>  	if (!ibuf)
>  		goto out;
>  
> @@ -294,8 +294,8 @@ static int ar9170_usb_alloc_rx_irq_urb(struct ar9170_usb *aru)
>  	err = usb_submit_urb(urb, GFP_KERNEL);
>  	if (err) {
>  		usb_unanchor_urb(urb);
> -		usb_buffer_free(aru->udev, 64, urb->transfer_buffer,
> -				urb->transfer_dma);
> +		usb_free_coherent(aru->udev, 64, urb->transfer_buffer,
> +				  urb->transfer_dma);
>  	}
>  
>  out:
> diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c
> index d91ad1a..c257940 100644
> --- a/drivers/net/wireless/zd1211rw/zd_usb.c
> +++ b/drivers/net/wireless/zd1211rw/zd_usb.c
> @@ -664,15 +664,15 @@ static struct urb *alloc_rx_urb(struct zd_usb *usb)
>  	urb = usb_alloc_urb(0, GFP_KERNEL);
>  	if (!urb)
>  		return NULL;
> -	buffer = usb_buffer_alloc(udev, USB_MAX_RX_SIZE, GFP_KERNEL,
> -		                  &urb->transfer_dma);
> +	buffer = usb_alloc_coherent(udev, USB_MAX_RX_SIZE, GFP_KERNEL,
> +				    &urb->transfer_dma);
>  	if (!buffer) {
>  		usb_free_urb(urb);
>  		return NULL;
>  	}
>  
>  	usb_fill_bulk_urb(urb, udev, usb_rcvbulkpipe(udev, EP_DATA_IN),
> -		          buffer, USB_MAX_RX_SIZE,
> +			  buffer, USB_MAX_RX_SIZE,
>  			  rx_urb_complete, usb);
>  	urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
>  
> @@ -683,8 +683,8 @@ static void free_rx_urb(struct urb *urb)
>  {
>  	if (!urb)
>  		return;
> -	usb_buffer_free(urb->dev, urb->transfer_buffer_length,
> -		        urb->transfer_buffer, urb->transfer_dma);
> +	usb_free_coherent(urb->dev, urb->transfer_buffer_length,
> +			  urb->transfer_buffer, urb->transfer_dma);
>  	usb_free_urb(urb);
>  }
>  
> diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
> index be6331e..66713ed 100644
> --- a/drivers/usb/class/cdc-acm.c
> +++ b/drivers/usb/class/cdc-acm.c
> @@ -892,7 +892,7 @@ static void acm_write_buffers_free(struct acm *acm)
>  	struct usb_device *usb_dev = interface_to_usbdev(acm->control);
>  
>  	for (wb = &acm->wb[0], i = 0; i < ACM_NW; i++, wb++)
> -		usb_buffer_free(usb_dev, acm->writesize, wb->buf, wb->dmah);
> +		usb_free_coherent(usb_dev, acm->writesize, wb->buf, wb->dmah);
>  }
>  
>  static void acm_read_buffers_free(struct acm *acm)
> @@ -901,8 +901,8 @@ static void acm_read_buffers_free(struct acm *acm)
>  	int i, n = acm->rx_buflimit;
>  
>  	for (i = 0; i < n; i++)
> -		usb_buffer_free(usb_dev, acm->readsize,
> -					acm->rb[i].base, acm->rb[i].dma);
> +		usb_free_coherent(usb_dev, acm->readsize,
> +				  acm->rb[i].base, acm->rb[i].dma);
>  }
>  
>  /* Little helper: write buffers allocate */
> @@ -912,13 +912,13 @@ static int acm_write_buffers_alloc(struct acm *acm)
>  	struct acm_wb *wb;
>  
>  	for (wb = &acm->wb[0], i = 0; i < ACM_NW; i++, wb++) {
> -		wb->buf = usb_buffer_alloc(acm->dev, acm->writesize, GFP_KERNEL,
> +		wb->buf = usb_alloc_coherent(acm->dev, acm->writesize, GFP_KERNEL,
>  		    &wb->dmah);
>  		if (!wb->buf) {
>  			while (i != 0) {
>  				--i;
>  				--wb;
> -				usb_buffer_free(acm->dev, acm->writesize,
> +				usb_free_coherent(acm->dev, acm->writesize,
>  				    wb->buf, wb->dmah);
>  			}
>  			return -ENOMEM;
> @@ -1177,7 +1177,7 @@ made_compressed_probe:
>  	tty_port_init(&acm->port);
>  	acm->port.ops = &acm_port_ops;
>  
> -	buf = usb_buffer_alloc(usb_dev, ctrlsize, GFP_KERNEL, &acm->ctrl_dma);
> +	buf = usb_alloc_coherent(usb_dev, ctrlsize, GFP_KERNEL, &acm->ctrl_dma);
>  	if (!buf) {
>  		dev_dbg(&intf->dev, "out of memory (ctrl buffer alloc)\n");
>  		goto alloc_fail2;
> @@ -1210,11 +1210,11 @@ made_compressed_probe:
>  	for (i = 0; i < num_rx_buf; i++) {
>  		struct acm_rb *rb = &(acm->rb[i]);
>  
> -		rb->base = usb_buffer_alloc(acm->dev, readsize,
> +		rb->base = usb_alloc_coherent(acm->dev, readsize,
>  				GFP_KERNEL, &rb->dma);
>  		if (!rb->base) {
>  			dev_dbg(&intf->dev,
> -				"out of memory (read bufs usb_buffer_alloc)\n");
> +				"out of memory (read bufs usb_alloc_coherent)\n");
>  			goto alloc_fail7;
>  		}
>  	}
> @@ -1306,7 +1306,7 @@ alloc_fail7:
>  alloc_fail5:
>  	acm_write_buffers_free(acm);
>  alloc_fail4:
> -	usb_buffer_free(usb_dev, ctrlsize, acm->ctrl_buffer, acm->ctrl_dma);
> +	usb_free_coherent(usb_dev, ctrlsize, acm->ctrl_buffer, acm->ctrl_dma);
>  alloc_fail2:
>  	kfree(acm);
>  alloc_fail:
> @@ -1356,8 +1356,8 @@ static void acm_disconnect(struct usb_interface *intf)
>  	stop_data_traffic(acm);
>  
>  	acm_write_buffers_free(acm);
> -	usb_buffer_free(usb_dev, acm->ctrlsize, acm->ctrl_buffer,
> -								acm->ctrl_dma);
> +	usb_free_coherent(usb_dev, acm->ctrlsize, acm->ctrl_buffer,
> +			  acm->ctrl_dma);
>  	acm_read_buffers_free(acm);
>  
>  	if (!acm->combined_interfaces)
> diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c
> index 189141c..094c76b 100644
> --- a/drivers/usb/class/cdc-wdm.c
> +++ b/drivers/usb/class/cdc-wdm.c
> @@ -276,14 +276,14 @@ static void free_urbs(struct wdm_device *desc)
>  
>  static void cleanup(struct wdm_device *desc)
>  {
> -	usb_buffer_free(interface_to_usbdev(desc->intf),
> -			desc->wMaxPacketSize,
> -			desc->sbuf,
> -			desc->validity->transfer_dma);
> -	usb_buffer_free(interface_to_usbdev(desc->intf),
> -			desc->wMaxCommand,
> -			desc->inbuf,
> -			desc->response->transfer_dma);
> +	usb_free_coherent(interface_to_usbdev(desc->intf),
> +			  desc->wMaxPacketSize,
> +			  desc->sbuf,
> +			  desc->validity->transfer_dma);
> +	usb_free_coherent(interface_to_usbdev(desc->intf),
> +			  desc->wMaxCommand,
> +			  desc->inbuf,
> +			  desc->response->transfer_dma);
>  	kfree(desc->orq);
>  	kfree(desc->irq);
>  	kfree(desc->ubuf);
> @@ -705,17 +705,17 @@ next_desc:
>  	if (!desc->ubuf)
>  		goto err;
>  
> -	desc->sbuf = usb_buffer_alloc(interface_to_usbdev(intf),
> +	desc->sbuf = usb_alloc_coherent(interface_to_usbdev(intf),
>  					desc->wMaxPacketSize,
>  					GFP_KERNEL,
>  					&desc->validity->transfer_dma);
>  	if (!desc->sbuf)
>  		goto err;
>  
> -	desc->inbuf = usb_buffer_alloc(interface_to_usbdev(intf),
> -					desc->bMaxPacketSize0,
> -					GFP_KERNEL,
> -					&desc->response->transfer_dma);
> +	desc->inbuf = usb_alloc_coherent(interface_to_usbdev(intf),
> +					 desc->bMaxPacketSize0,
> +					 GFP_KERNEL,
> +					 &desc->response->transfer_dma);
>  	if (!desc->inbuf)
>  		goto err2;
>  
> @@ -742,15 +742,15 @@ out:
>  	return rv;
>  err3:
>  	usb_set_intfdata(intf, NULL);
> -	usb_buffer_free(interface_to_usbdev(desc->intf),
> -			desc->bMaxPacketSize0,
> +	usb_free_coherent(interface_to_usbdev(desc->intf),
> +			  desc->bMaxPacketSize0,
>  			desc->inbuf,
>  			desc->response->transfer_dma);
>  err2:
> -	usb_buffer_free(interface_to_usbdev(desc->intf),
> -			desc->wMaxPacketSize,
> -			desc->sbuf,
> -			desc->validity->transfer_dma);
> +	usb_free_coherent(interface_to_usbdev(desc->intf),
> +			  desc->wMaxPacketSize,
> +			  desc->sbuf,
> +			  desc->validity->transfer_dma);
>  err:
>  	free_urbs(desc);
>  	kfree(desc->ubuf);
> diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c
> index 93b5f85..2250095 100644
> --- a/drivers/usb/class/usblp.c
> +++ b/drivers/usb/class/usblp.c
> @@ -27,7 +27,7 @@
>   *	v0.11 - add proto_bias option (Pete Zaitcev)
>   *	v0.12 - add hpoj.sourceforge.net ioctls (David Paschal)
>   *	v0.13 - alloc space for statusbuf (<status> not on stack);
> - *		use usb_buffer_alloc() for read buf & write buf;
> + *		use usb_alloc_coherent() for read buf & write buf;
>   *      none  - Maintained in Linux kernel after v0.13
>   */
>  
> diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
> index 1297e9b..0561430 100644
> --- a/drivers/usb/core/usb.c
> +++ b/drivers/usb/core/usb.c
> @@ -718,7 +718,7 @@ int __usb_get_extra_descriptor(char *buffer, unsigned size,
>  EXPORT_SYMBOL_GPL(__usb_get_extra_descriptor);
>  
>  /**
> - * usb_buffer_alloc - allocate dma-consistent buffer for URB_NO_xxx_DMA_MAP
> + * usb_alloc_coherent - allocate dma-consistent buffer for URB_NO_xxx_DMA_MAP
>   * @dev: device the buffer will be used with
>   * @size: requested buffer size
>   * @mem_flags: affect whether allocation may block
> @@ -737,30 +737,30 @@ EXPORT_SYMBOL_GPL(__usb_get_extra_descriptor);
>   * architectures where CPU caches are not DMA-coherent.  On systems without
>   * bus-snooping caches, these buffers are uncached.
>   *
> - * When the buffer is no longer used, free it with usb_buffer_free().
> + * When the buffer is no longer used, free it with usb_free_coherent().
>   */
> -void *usb_buffer_alloc(struct usb_device *dev, size_t size, gfp_t mem_flags,
> -		       dma_addr_t *dma)
> +void *usb_alloc_coherent(struct usb_device *dev, size_t size, gfp_t mem_flags,
> +			 dma_addr_t *dma)
>  {
>  	if (!dev || !dev->bus)
>  		return NULL;
>  	return hcd_buffer_alloc(dev->bus, size, mem_flags, dma);
>  }
> -EXPORT_SYMBOL_GPL(usb_buffer_alloc);
> +EXPORT_SYMBOL_GPL(usb_alloc_coherent);
>  
>  /**
> - * usb_buffer_free - free memory allocated with usb_buffer_alloc()
> + * usb_free_coherent - free memory allocated with usb_alloc_coherent()
>   * @dev: device the buffer was used with
>   * @size: requested buffer size
>   * @addr: CPU address of buffer
>   * @dma: DMA address of buffer
>   *
>   * This reclaims an I/O buffer, letting it be reused.  The memory must have
> - * been allocated using usb_buffer_alloc(), and the parameters must match
> + * been allocated using usb_alloc_coherent(), and the parameters must match
>   * those provided in that allocation request.
>   */
> -void usb_buffer_free(struct usb_device *dev, size_t size, void *addr,
> -		     dma_addr_t dma)
> +void usb_free_coherent(struct usb_device *dev, size_t size, void *addr,
> +		       dma_addr_t dma)
>  {
>  	if (!dev || !dev->bus)
>  		return;
> @@ -768,7 +768,7 @@ void usb_buffer_free(struct usb_device *dev, size_t size, void *addr,
>  		return;
>  	hcd_buffer_free(dev->bus, size, addr, dma);
>  }
> -EXPORT_SYMBOL_GPL(usb_buffer_free);
> +EXPORT_SYMBOL_GPL(usb_free_coherent);
>  
>  /**
>   * usb_buffer_map - create DMA mapping(s) for an urb
> diff --git a/drivers/usb/misc/appledisplay.c b/drivers/usb/misc/appledisplay.c
> index 094f91c..1fa6ce3 100644
> --- a/drivers/usb/misc/appledisplay.c
> +++ b/drivers/usb/misc/appledisplay.c
> @@ -259,7 +259,7 @@ static int appledisplay_probe(struct usb_interface *iface,
>  	}
>  
>  	/* Allocate buffer for interrupt data */
> -	pdata->urbdata = usb_buffer_alloc(pdata->udev, ACD_URB_BUFFER_LEN,
> +	pdata->urbdata = usb_alloc_coherent(pdata->udev, ACD_URB_BUFFER_LEN,
>  		GFP_KERNEL, &pdata->urb->transfer_dma);
>  	if (!pdata->urbdata) {
>  		retval = -ENOMEM;
> @@ -316,7 +316,7 @@ error:
>  		if (pdata->urb) {
>  			usb_kill_urb(pdata->urb);
>  			if (pdata->urbdata)
> -				usb_buffer_free(pdata->udev, ACD_URB_BUFFER_LEN,
> +				usb_free_coherent(pdata->udev, ACD_URB_BUFFER_LEN,
>  					pdata->urbdata, pdata->urb->transfer_dma);
>  			usb_free_urb(pdata->urb);
>  		}
> @@ -337,7 +337,7 @@ static void appledisplay_disconnect(struct usb_interface *iface)
>  		usb_kill_urb(pdata->urb);
>  		cancel_delayed_work(&pdata->work);
>  		backlight_device_unregister(pdata->bd);
> -		usb_buffer_free(pdata->udev, ACD_URB_BUFFER_LEN,
> +		usb_free_coherent(pdata->udev, ACD_URB_BUFFER_LEN,
>  			pdata->urbdata, pdata->urb->transfer_dma);
>  		usb_free_urb(pdata->urb);
>  		kfree(pdata->msgdata);
> diff --git a/drivers/usb/misc/ftdi-elan.c b/drivers/usb/misc/ftdi-elan.c
> index 1edb6d3..a9e0546 100644
> --- a/drivers/usb/misc/ftdi-elan.c
> +++ b/drivers/usb/misc/ftdi-elan.c
> @@ -734,7 +734,7 @@ static void ftdi_elan_write_bulk_callback(struct urb *urb)
>                  dev_err(&ftdi->udev->dev, "urb=%p write bulk status received: %"
>                          "d\n", urb, status);
>          }
> -        usb_buffer_free(urb->dev, urb->transfer_buffer_length,
> +        usb_free_coherent(urb->dev, urb->transfer_buffer_length,
>                  urb->transfer_buffer, urb->transfer_dma);
>  }
>  
> @@ -795,7 +795,7 @@ static int ftdi_elan_command_engine(struct usb_ftdi *ftdi)
>                          total_size);
>                  return -ENOMEM;
>          }
> -        buf = usb_buffer_alloc(ftdi->udev, total_size, GFP_KERNEL,
> +        buf = usb_alloc_coherent(ftdi->udev, total_size, GFP_KERNEL,
>                  &urb->transfer_dma);
>          if (!buf) {
>                  dev_err(&ftdi->udev->dev, "could not get a buffer to write %d c"
> @@ -829,7 +829,7 @@ static int ftdi_elan_command_engine(struct usb_ftdi *ftdi)
>                  dev_err(&ftdi->udev->dev, "failed %d to submit urb %p to write "
>                          "%d commands totaling %d bytes to the Uxxx\n", retval,
>                          urb, command_size, total_size);
> -                usb_buffer_free(ftdi->udev, total_size, buf, urb->transfer_dma);
> +                usb_free_coherent(ftdi->udev, total_size, buf, urb->transfer_dma);
>                  usb_free_urb(urb);
>                  return retval;
>          }
> @@ -1167,7 +1167,7 @@ static ssize_t ftdi_elan_write(struct file *file,
>                  retval = -ENOMEM;
>                  goto error_1;
>          }
> -        buf = usb_buffer_alloc(ftdi->udev, count, GFP_KERNEL,
> +        buf = usb_alloc_coherent(ftdi->udev, count, GFP_KERNEL,
>                  &urb->transfer_dma);
>          if (!buf) {
>                  retval = -ENOMEM;
> @@ -1192,7 +1192,7 @@ static ssize_t ftdi_elan_write(struct file *file,
>  exit:
>          return count;
>  error_3:
> -	usb_buffer_free(ftdi->udev, count, buf, urb->transfer_dma);
> +	usb_free_coherent(ftdi->udev, count, buf, urb->transfer_dma);
>  error_2:
>  	usb_free_urb(urb);
>  error_1:
> @@ -1968,7 +1968,7 @@ static int ftdi_elan_synchronize_flush(struct usb_ftdi *ftdi)
>                          "ence\n");
>                  return -ENOMEM;
>          }
> -        buf = usb_buffer_alloc(ftdi->udev, I, GFP_KERNEL, &urb->transfer_dma);
> +        buf = usb_alloc_coherent(ftdi->udev, I, GFP_KERNEL, &urb->transfer_dma);
>          if (!buf) {
>                  dev_err(&ftdi->udev->dev, "could not get a buffer for flush seq"
>                          "uence\n");
> @@ -1985,7 +1985,7 @@ static int ftdi_elan_synchronize_flush(struct usb_ftdi *ftdi)
>          if (retval) {
>                  dev_err(&ftdi->udev->dev, "failed to submit urb containing the "
>                          "flush sequence\n");
> -                usb_buffer_free(ftdi->udev, i, buf, urb->transfer_dma);
> +                usb_free_coherent(ftdi->udev, i, buf, urb->transfer_dma);
>                  usb_free_urb(urb);
>                  return -ENOMEM;
>          }
> @@ -2011,7 +2011,7 @@ static int ftdi_elan_synchronize_reset(struct usb_ftdi *ftdi)
>                          "quence\n");
>                  return -ENOMEM;
>          }
> -        buf = usb_buffer_alloc(ftdi->udev, I, GFP_KERNEL, &urb->transfer_dma);
> +        buf = usb_alloc_coherent(ftdi->udev, I, GFP_KERNEL, &urb->transfer_dma);
>          if (!buf) {
>                  dev_err(&ftdi->udev->dev, "could not get a buffer for the reset"
>                          " sequence\n");
> @@ -2030,7 +2030,7 @@ static int ftdi_elan_synchronize_reset(struct usb_ftdi *ftdi)
>          if (retval) {
>                  dev_err(&ftdi->udev->dev, "failed to submit urb containing the "
>                          "reset sequence\n");
> -                usb_buffer_free(ftdi->udev, i, buf, urb->transfer_dma);
> +                usb_free_coherent(ftdi->udev, i, buf, urb->transfer_dma);
>                  usb_free_urb(urb);
>                  return -ENOMEM;
>          }
> diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c
> index d3c8523..7dc9d3c 100644
> --- a/drivers/usb/misc/iowarrior.c
> +++ b/drivers/usb/misc/iowarrior.c
> @@ -239,8 +239,8 @@ static void iowarrior_write_callback(struct urb *urb)
>  		    __func__, status);
>  	}
>  	/* free up our allocated buffer */
> -	usb_buffer_free(urb->dev, urb->transfer_buffer_length,
> -			urb->transfer_buffer, urb->transfer_dma);
> +	usb_free_coherent(urb->dev, urb->transfer_buffer_length,
> +			  urb->transfer_buffer, urb->transfer_dma);
>  	/* tell a waiting writer the interrupt-out-pipe is available again */
>  	atomic_dec(&dev->write_busy);
>  	wake_up_interruptible(&dev->write_wait);
> @@ -421,8 +421,8 @@ static ssize_t iowarrior_write(struct file *file,
>  			dbg("%s Unable to allocate urb ", __func__);
>  			goto error_no_urb;
>  		}
> -		buf = usb_buffer_alloc(dev->udev, dev->report_size,
> -				       GFP_KERNEL, &int_out_urb->transfer_dma);
> +		buf = usb_alloc_coherent(dev->udev, dev->report_size,
> +					 GFP_KERNEL, &int_out_urb->transfer_dma);
>  		if (!buf) {
>  			retval = -ENOMEM;
>  			dbg("%s Unable to allocate buffer ", __func__);
> @@ -459,8 +459,8 @@ static ssize_t iowarrior_write(struct file *file,
>  		break;
>  	}
>  error:
> -	usb_buffer_free(dev->udev, dev->report_size, buf,
> -			int_out_urb->transfer_dma);
> +	usb_free_coherent(dev->udev, dev->report_size, buf,
> +			  int_out_urb->transfer_dma);
>  error_no_buffer:
>  	usb_free_urb(int_out_urb);
>  error_no_urb:
> diff --git a/drivers/usb/misc/usblcd.c b/drivers/usb/misc/usblcd.c
> index 90aede9..7828c76 100644
> --- a/drivers/usb/misc/usblcd.c
> +++ b/drivers/usb/misc/usblcd.c
> @@ -205,8 +205,8 @@ static void lcd_write_bulk_callback(struct urb *urb)
>  	}
>  
>  	/* free up our allocated buffer */
> -	usb_buffer_free(urb->dev, urb->transfer_buffer_length,
> -			urb->transfer_buffer, urb->transfer_dma);
> +	usb_free_coherent(urb->dev, urb->transfer_buffer_length,
> +			  urb->transfer_buffer, urb->transfer_dma);
>  	up(&dev->limit_sem);
>  }
>  
> @@ -234,7 +234,7 @@ static ssize_t lcd_write(struct file *file, const char __user * user_buffer, siz
>  		goto err_no_buf;
>  	}
>  	
> -	buf = usb_buffer_alloc(dev->udev, count, GFP_KERNEL, &urb->transfer_dma);
> +	buf = usb_alloc_coherent(dev->udev, count, GFP_KERNEL, &urb->transfer_dma);
>  	if (!buf) {
>  		retval = -ENOMEM;
>  		goto error;
> @@ -268,7 +268,7 @@ exit:
>  error_unanchor:
>  	usb_unanchor_urb(urb);
>  error:
> -	usb_buffer_free(dev->udev, count, buf, urb->transfer_dma);
> +	usb_free_coherent(dev->udev, count, buf, urb->transfer_dma);
>  	usb_free_urb(urb);
>  err_no_buf:
>  	up(&dev->limit_sem);
> diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c
> index a21cce6..9ecde8c 100644
> --- a/drivers/usb/misc/usbtest.c
> +++ b/drivers/usb/misc/usbtest.c
> @@ -202,7 +202,7 @@ static struct urb *simple_alloc_urb (
>  	urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP;
>  	if (usb_pipein (pipe))
>  		urb->transfer_flags |= URB_SHORT_NOT_OK;
> -	urb->transfer_buffer = usb_buffer_alloc (udev, bytes, GFP_KERNEL,
> +	urb->transfer_buffer = usb_alloc_coherent (udev, bytes, GFP_KERNEL,
>  			&urb->transfer_dma);
>  	if (!urb->transfer_buffer) {
>  		usb_free_urb (urb);
> @@ -272,8 +272,8 @@ static inline int simple_check_buf(struct usbtest_dev *tdev, struct urb *urb)
>  
>  static void simple_free_urb (struct urb *urb)
>  {
> -	usb_buffer_free (urb->dev, urb->transfer_buffer_length,
> -			urb->transfer_buffer, urb->transfer_dma);
> +	usb_free_coherent(urb->dev, urb->transfer_buffer_length,
> +			  urb->transfer_buffer, urb->transfer_dma);
>  	usb_free_urb (urb);
>  }
>  
> @@ -977,7 +977,7 @@ test_ctrl_queue (struct usbtest_dev *dev, struct usbtest_param *param)
>  		if (!u)
>  			goto cleanup;
>  
> -		reqp = usb_buffer_alloc (udev, sizeof *reqp, GFP_KERNEL,
> +		reqp = usb_alloc_coherent (udev, sizeof *reqp, GFP_KERNEL,
>  				&u->setup_dma);
>  		if (!reqp)
>  			goto cleanup;
> @@ -1018,9 +1018,9 @@ cleanup:
>  			continue;
>  		urb [i]->dev = udev;
>  		if (urb [i]->setup_packet)
> -			usb_buffer_free (udev, sizeof (struct usb_ctrlrequest),
> -					urb [i]->setup_packet,
> -					urb [i]->setup_dma);
> +			usb_free_coherent (udev, sizeof (struct usb_ctrlrequest),
> +					   urb [i]->setup_packet,
> +					   urb [i]->setup_dma);
>  		simple_free_urb (urb [i]);
>  	}
>  	kfree (urb);
> @@ -1421,7 +1421,7 @@ static struct urb *iso_alloc_urb (
>  
>  	urb->number_of_packets = packets;
>  	urb->transfer_buffer_length = bytes;
> -	urb->transfer_buffer = usb_buffer_alloc (udev, bytes, GFP_KERNEL,
> +	urb->transfer_buffer = usb_alloc_coherent (udev, bytes, GFP_KERNEL,
>  			&urb->transfer_dma);
>  	if (!urb->transfer_buffer) {
>  		usb_free_urb (urb);
> diff --git a/drivers/usb/storage/onetouch.c b/drivers/usb/storage/onetouch.c
> index 198bb3e..1943be5 100644
> --- a/drivers/usb/storage/onetouch.c
> +++ b/drivers/usb/storage/onetouch.c
> @@ -201,8 +201,8 @@ static int onetouch_connect_input(struct us_data *ss)
>  	if (!onetouch || !input_dev)
>  		goto fail1;
>  
> -	onetouch->data = usb_buffer_alloc(udev, ONETOUCH_PKT_LEN,
> -					  GFP_KERNEL, &onetouch->data_dma);
> +	onetouch->data = usb_alloc_coherent(udev, ONETOUCH_PKT_LEN,
> +					    GFP_KERNEL, &onetouch->data_dma);
>  	if (!onetouch->data)
>  		goto fail1;
>  
> @@ -264,8 +264,8 @@ static int onetouch_connect_input(struct us_data *ss)
>  	return 0;
>  
>   fail3:	usb_free_urb(onetouch->irq);
> - fail2:	usb_buffer_free(udev, ONETOUCH_PKT_LEN,
> -			onetouch->data, onetouch->data_dma);
> + fail2:	usb_free_coherent(udev, ONETOUCH_PKT_LEN,
> +			  onetouch->data, onetouch->data_dma);
>   fail1:	kfree(onetouch);
>  	input_free_device(input_dev);
>  	return error;
> @@ -279,8 +279,8 @@ static void onetouch_release_input(void *onetouch_)
>  		usb_kill_urb(onetouch->irq);
>  		input_unregister_device(onetouch->dev);
>  		usb_free_urb(onetouch->irq);
> -		usb_buffer_free(onetouch->udev, ONETOUCH_PKT_LEN,
> -				onetouch->data, onetouch->data_dma);
> +		usb_free_coherent(onetouch->udev, ONETOUCH_PKT_LEN,
> +				  onetouch->data, onetouch->data_dma);
>  	}
>  }
>  
> diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
> index bbeeb92..ef00584 100644
> --- a/drivers/usb/storage/usb.c
> +++ b/drivers/usb/storage/usb.c
> @@ -408,14 +408,14 @@ static int associate_dev(struct us_data *us, struct usb_interface *intf)
>  	usb_set_intfdata(intf, us);
>  
>  	/* Allocate the device-related DMA-mapped buffers */
> -	us->cr = usb_buffer_alloc(us->pusb_dev, sizeof(*us->cr),
> +	us->cr = usb_alloc_coherent(us->pusb_dev, sizeof(*us->cr),
>  			GFP_KERNEL, &us->cr_dma);
>  	if (!us->cr) {
>  		US_DEBUGP("usb_ctrlrequest allocation failed\n");
>  		return -ENOMEM;
>  	}
>  
> -	us->iobuf = usb_buffer_alloc(us->pusb_dev, US_IOBUF_SIZE,
> +	us->iobuf = usb_alloc_coherent(us->pusb_dev, US_IOBUF_SIZE,
>  			GFP_KERNEL, &us->iobuf_dma);
>  	if (!us->iobuf) {
>  		US_DEBUGP("I/O buffer allocation failed\n");
> @@ -759,11 +759,11 @@ static void dissociate_dev(struct us_data *us)
>  
>  	/* Free the device-related DMA-mapped buffers */
>  	if (us->cr)
> -		usb_buffer_free(us->pusb_dev, sizeof(*us->cr), us->cr,
> -				us->cr_dma);
> +		usb_free_coherent(us->pusb_dev, sizeof(*us->cr), us->cr,
> +				  us->cr_dma);
>  	if (us->iobuf)
> -		usb_buffer_free(us->pusb_dev, US_IOBUF_SIZE, us->iobuf,
> -				us->iobuf_dma);
> +		usb_free_coherent(us->pusb_dev, US_IOBUF_SIZE, us->iobuf,
> +				  us->iobuf_dma);
>  
>  	/* Remove our private data from the interface */
>  	usb_set_intfdata(us->pusb_intf, NULL);
> diff --git a/drivers/usb/usb-skeleton.c b/drivers/usb/usb-skeleton.c
> index 6152278..d110588 100644
> --- a/drivers/usb/usb-skeleton.c
> +++ b/drivers/usb/usb-skeleton.c
> @@ -387,8 +387,8 @@ static void skel_write_bulk_callback(struct urb *urb)
>  	}
>  
>  	/* free up our allocated buffer */
> -	usb_buffer_free(urb->dev, urb->transfer_buffer_length,
> -			urb->transfer_buffer, urb->transfer_dma);
> +	usb_free_coherent(urb->dev, urb->transfer_buffer_length,
> +			  urb->transfer_buffer, urb->transfer_dma);
>  	up(&dev->limit_sem);
>  }
>  
> @@ -442,8 +442,8 @@ static ssize_t skel_write(struct file *file, const char *user_buffer,
>  		goto error;
>  	}
>  
> -	buf = usb_buffer_alloc(dev->udev, writesize, GFP_KERNEL,
> -			       &urb->transfer_dma);
> +	buf = usb_alloc_coherent(dev->udev, writesize, GFP_KERNEL,
> +				 &urb->transfer_dma);
>  	if (!buf) {
>  		retval = -ENOMEM;
>  		goto error;
> @@ -491,7 +491,7 @@ error_unanchor:
>  	usb_unanchor_urb(urb);
>  error:
>  	if (urb) {
> -		usb_buffer_free(dev->udev, writesize, buf, urb->transfer_dma);
> +		usb_free_coherent(dev->udev, writesize, buf, urb->transfer_dma);
>  		usb_free_urb(urb);
>  	}
>  	up(&dev->limit_sem);
> diff --git a/drivers/watchdog/pcwd_usb.c b/drivers/watchdog/pcwd_usb.c
> index 8e4eacc..748a74b 100644
> --- a/drivers/watchdog/pcwd_usb.c
> +++ b/drivers/watchdog/pcwd_usb.c
> @@ -600,8 +600,8 @@ static inline void usb_pcwd_delete(struct usb_pcwd_private *usb_pcwd)
>  {
>  	usb_free_urb(usb_pcwd->intr_urb);
>  	if (usb_pcwd->intr_buffer != NULL)
> -		usb_buffer_free(usb_pcwd->udev, usb_pcwd->intr_size,
> -				usb_pcwd->intr_buffer, usb_pcwd->intr_dma);
> +		usb_free_coherent(usb_pcwd->udev, usb_pcwd->intr_size,
> +				  usb_pcwd->intr_buffer, usb_pcwd->intr_dma);
>  	kfree(usb_pcwd);
>  }
>  
> @@ -671,7 +671,7 @@ static int usb_pcwd_probe(struct usb_interface *interface,
>  				le16_to_cpu(endpoint->wMaxPacketSize) : 8);
>  
>  	/* set up the memory buffer's */
> -	usb_pcwd->intr_buffer = usb_buffer_alloc(udev, usb_pcwd->intr_size,
> +	usb_pcwd->intr_buffer = usb_alloc_coherent(udev, usb_pcwd->intr_size,
>  					GFP_ATOMIC, &usb_pcwd->intr_dma);
>  	if (!usb_pcwd->intr_buffer) {
>  		printk(KERN_ERR PFX "Out of memory\n");
> diff --git a/include/linux/usb.h b/include/linux/usb.h
> index ce1323c..4f485d0 100644
> --- a/include/linux/usb.h
> +++ b/include/linux/usb.h
> @@ -1085,7 +1085,7 @@ typedef void (*usb_complete_t)(struct urb *);
>   * Alternatively, drivers may pass the URB_NO_xxx_DMA_MAP transfer flags,
>   * which tell the host controller driver that no such mapping is needed since
>   * the device driver is DMA-aware.  For example, a device driver might
> - * allocate a DMA buffer with usb_buffer_alloc() or call usb_buffer_map().
> + * allocate a DMA buffer with usb_alloc_coherent() or call usb_buffer_map().
>   * When these transfer flags are provided, host controller drivers will
>   * attempt to use the dma addresses found in the transfer_dma and/or
>   * setup_dma fields rather than determining a dma address themselves.
> @@ -1366,9 +1366,9 @@ static inline int usb_urb_dir_out(struct urb *urb)
>  	return (urb->transfer_flags & URB_DIR_MASK) == URB_DIR_OUT;
>  }
>  
> -void *usb_buffer_alloc(struct usb_device *dev, size_t size,
> +void *usb_alloc_coherent(struct usb_device *dev, size_t size,
>  	gfp_t mem_flags, dma_addr_t *dma);
> -void usb_buffer_free(struct usb_device *dev, size_t size,
> +void usb_free_coherent(struct usb_device *dev, size_t size,
>  	void *addr, dma_addr_t dma);
>  
>  #if 0
> diff --git a/sound/usb/midi.c b/sound/usb/midi.c
> index c6ee4a1..00f7d8e 100644
> --- a/sound/usb/midi.c
> +++ b/sound/usb/midi.c
> @@ -1046,8 +1046,8 @@ static struct snd_rawmidi_ops snd_usbmidi_input_ops = {
>  static void free_urb_and_buffer(struct snd_usb_midi *umidi, struct urb *urb,
>  				unsigned int buffer_length)
>  {
> -	usb_buffer_free(umidi->dev, buffer_length,
> -			urb->transfer_buffer, urb->transfer_dma);
> +	usb_free_coherent(umidi->dev, buffer_length,
> +			  urb->transfer_buffer, urb->transfer_dma);
>  	usb_free_urb(urb);
>  }
>  
> @@ -1098,8 +1098,8 @@ static int snd_usbmidi_in_endpoint_create(struct snd_usb_midi* umidi,
>  		pipe = usb_rcvbulkpipe(umidi->dev, ep_info->in_ep);
>  	length = usb_maxpacket(umidi->dev, pipe, 0);
>  	for (i = 0; i < INPUT_URBS; ++i) {
> -		buffer = usb_buffer_alloc(umidi->dev, length, GFP_KERNEL,
> -					  &ep->urbs[i]->transfer_dma);
> +		buffer = usb_alloc_coherent(umidi->dev, length, GFP_KERNEL,
> +					    &ep->urbs[i]->transfer_dma);
>  		if (!buffer) {
>  			snd_usbmidi_in_endpoint_delete(ep);
>  			return -ENOMEM;
> @@ -1182,9 +1182,9 @@ static int snd_usbmidi_out_endpoint_create(struct snd_usb_midi* umidi,
>  		break;
>  	}
>  	for (i = 0; i < OUTPUT_URBS; ++i) {
> -		buffer = usb_buffer_alloc(umidi->dev,
> -					  ep->max_transfer, GFP_KERNEL,
> -					  &ep->urbs[i].urb->transfer_dma);
> +		buffer = usb_alloc_coherent(umidi->dev,
> +					    ep->max_transfer, GFP_KERNEL,
> +					    &ep->urbs[i].urb->transfer_dma);
>  		if (!buffer) {
>  			snd_usbmidi_out_endpoint_delete(ep);
>  			return -ENOMEM;
> diff --git a/sound/usb/misc/ua101.c b/sound/usb/misc/ua101.c
> index 796d8b2..fb5d68f 100644
> --- a/sound/usb/misc/ua101.c
> +++ b/sound/usb/misc/ua101.c
> @@ -42,7 +42,7 @@ MODULE_SUPPORTED_DEVICE("{{Edirol,UA-101},{Edirol,UA-1000}}");
>  /*
>   * This magic value optimizes memory usage efficiency for the UA-101's packet
>   * sizes at all sample rates, taking into account the stupid cache pool sizes
> - * that usb_buffer_alloc() uses.
> + * that usb_alloc_coherent() uses.
>   */
>  #define DEFAULT_QUEUE_LENGTH	21
>  
> @@ -1057,7 +1057,7 @@ static int alloc_stream_buffers(struct ua101 *ua, struct ua101_stream *stream)
>  				   (unsigned int)MAX_QUEUE_LENGTH);
>  
>  	/*
> -	 * The cache pool sizes used by usb_buffer_alloc() (128, 512, 2048) are
> +	 * The cache pool sizes used by usb_alloc_coherent() (128, 512, 2048) are
>  	 * quite bad when used with the packet sizes of this device (e.g. 280,
>  	 * 520, 624).  Therefore, we allocate and subdivide entire pages, using
>  	 * a smaller buffer only for the last chunk.
> @@ -1068,8 +1068,8 @@ static int alloc_stream_buffers(struct ua101 *ua, struct ua101_stream *stream)
>  		packets = min(remaining_packets, packets_per_page);
>  		size = packets * stream->max_packet_bytes;
>  		stream->buffers[i].addr =
> -			usb_buffer_alloc(ua->dev, size, GFP_KERNEL,
> -					 &stream->buffers[i].dma);
> +			usb_alloc_coherent(ua->dev, size, GFP_KERNEL,
> +					   &stream->buffers[i].dma);
>  		if (!stream->buffers[i].addr)
>  			return -ENOMEM;
>  		stream->buffers[i].size = size;
> @@ -1089,10 +1089,10 @@ static void free_stream_buffers(struct ua101 *ua, struct ua101_stream *stream)
>  	unsigned int i;
>  
>  	for (i = 0; i < ARRAY_SIZE(stream->buffers); ++i)
> -		usb_buffer_free(ua->dev,
> -				stream->buffers[i].size,
> -				stream->buffers[i].addr,
> -				stream->buffers[i].dma);
> +		usb_free_coherent(ua->dev,
> +				  stream->buffers[i].size,
> +				  stream->buffers[i].addr,
> +				  stream->buffers[i].dma);
>  }
>  
>  static int alloc_stream_urbs(struct ua101 *ua, struct ua101_stream *stream,
> diff --git a/sound/usb/urb.c b/sound/usb/urb.c
> index 5570a2b..8c7b3e5 100644
> --- a/sound/usb/urb.c
> +++ b/sound/usb/urb.c
> @@ -101,9 +101,9 @@ static void release_urb_ctx(struct snd_urb_ctx *u)
>  {
>  	if (u->urb) {
>  		if (u->buffer_size)
> -			usb_buffer_free(u->subs->dev, u->buffer_size,
> -					u->urb->transfer_buffer,
> -					u->urb->transfer_dma);
> +			usb_free_coherent(u->subs->dev, u->buffer_size,
> +					  u->urb->transfer_buffer,
> +					  u->urb->transfer_dma);
>  		usb_free_urb(u->urb);
>  		u->urb = NULL;
>  	}
> @@ -154,8 +154,8 @@ void snd_usb_release_substream_urbs(struct snd_usb_substream *subs, int force)
>  		release_urb_ctx(&subs->dataurb[i]);
>  	for (i = 0; i < SYNC_URBS; i++)
>  		release_urb_ctx(&subs->syncurb[i]);
> -	usb_buffer_free(subs->dev, SYNC_URBS * 4,
> -			subs->syncbuf, subs->sync_dma);
> +	usb_free_coherent(subs->dev, SYNC_URBS * 4,
> +			  subs->syncbuf, subs->sync_dma);
>  	subs->syncbuf = NULL;
>  	subs->nurbs = 0;
>  }
> @@ -308,8 +308,8 @@ int snd_usb_init_substream_urbs(struct snd_usb_substream *subs,
>  		if (!u->urb)
>  			goto out_of_memory;
>  		u->urb->transfer_buffer =
> -			usb_buffer_alloc(subs->dev, u->buffer_size, GFP_KERNEL,
> -					 &u->urb->transfer_dma);
> +			usb_alloc_coherent(subs->dev, u->buffer_size, GFP_KERNEL,
> +					   &u->urb->transfer_dma);
>  		if (!u->urb->transfer_buffer)
>  			goto out_of_memory;
>  		u->urb->pipe = subs->datapipe;
> @@ -321,8 +321,8 @@ int snd_usb_init_substream_urbs(struct snd_usb_substream *subs,
>  
>  	if (subs->syncpipe) {
>  		/* allocate and initialize sync urbs */
> -		subs->syncbuf = usb_buffer_alloc(subs->dev, SYNC_URBS * 4,
> -						 GFP_KERNEL, &subs->sync_dma);
> +		subs->syncbuf = usb_alloc_coherent(subs->dev, SYNC_URBS * 4,
> +						   GFP_KERNEL, &subs->sync_dma);
>  		if (!subs->syncbuf)
>  			goto out_of_memory;
>  		for (i = 0; i < SYNC_URBS; i++) {
> -- 
> 1.6.6.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-12 16:57                           ` Alan Stern
@ 2010-04-13 18:22                             ` Daniel Mack
  -1 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-13 18:22 UTC (permalink / raw)
  To: Alan Stern
  Cc: Andi Kleen, Pedro Ribeiro, linux-kernel, akpm, Greg KH,
	alsa-devel, linux-usb

On Mon, Apr 12, 2010 at 12:57:16PM -0400, Alan Stern wrote:
> On Mon, 12 Apr 2010, Andi Kleen wrote:
> > On Mon, Apr 12, 2010 at 12:17:22PM -0400, Alan Stern wrote:
> > > On Mon, 12 Apr 2010, Andi Kleen wrote:
> > >
> > > > > Well, the sound driver itself doesn't care for any of those things, just
> > > > > like any other USB driver doesn't. The USB core itself of the host
> > > > > controller driver should do, and as far as I can see, it does that, yes.
> > > >
> > > > Hmm, still things must go wrong somewhere. Perhaps need some instrumentation
> > > > to see if all the transfer buffers really hit the PCI mapping functions.
> > >
> > > Such a test has already been carried out earlier in this thread:
> > >
> > > 	http://marc.info/?l=linux-usb&m=127074587029353&w=2
> > > 	http://marc.info/?l=linux-usb&m=127076841801051&w=2
> > > 	http://marc.info/?l=linux-usb&m=127082890510415&w=2
> >
> > Hmm, thanks. But things must still go wrong somewhere, otherwise
> > the GFP_DMA32 wouldn't be needed?
>
> Indeed, something must go wrong somewhere.  Since Daniel's patch fixed
> the problem by changing the buffer from a streaming mapping to a
> coherent mapping, it's logical to assume that bad DMA addresses have
> something to do with it.  But we don't really know for certain.

Some more ideas to nail this down would be to boot the machine with
mem=4096M and mem=2048M to see whether this makes any difference. Also,
I think it would be interesting to know whether the patch below helps.

As the real reason seems entirely obfuscated, there's unfortunately need
for some trial error approach. Pedro, as you're the only one who can
actually reproduce the problem, do you see any chance to do that?

Thanks,
Daniel


diff --git a/sound/usb/caiaq/audio.c b/sound/usb/caiaq/audio.c
index 4328cad..26013be 100644
--- a/sound/usb/caiaq/audio.c
+++ b/sound/usb/caiaq/audio.c
@@ -560,7 +560,7 @@ static struct urb **alloc_urbs(struct snd_usb_caiaqdev *dev, int dir, int *ret)
               }

               urbs[i]->transfer_buffer =
-                       kmalloc(FRAMES_PER_URB * BYTES_PER_FRAME, GFP_KERNEL);
+                       kmalloc(FRAMES_PER_URB * BYTES_PER_FRAME, GFP_KERNEL | GFP_DMA);
               if (!urbs[i]->transfer_buffer) {
                       log("unable to kmalloc() transfer buffer, OOM!?\n");
                       *ret = -ENOMEM;


^ permalink raw reply related	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-13 18:22                             ` Daniel Mack
  0 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-13 18:22 UTC (permalink / raw)
  To: Alan Stern
  Cc: alsa-devel, linux-usb, Greg KH, linux-kernel, Andi Kleen,
	Pedro Ribeiro, akpm

On Mon, Apr 12, 2010 at 12:57:16PM -0400, Alan Stern wrote:
> On Mon, 12 Apr 2010, Andi Kleen wrote:
> > On Mon, Apr 12, 2010 at 12:17:22PM -0400, Alan Stern wrote:
> > > On Mon, 12 Apr 2010, Andi Kleen wrote:
> > >
> > > > > Well, the sound driver itself doesn't care for any of those things, just
> > > > > like any other USB driver doesn't. The USB core itself of the host
> > > > > controller driver should do, and as far as I can see, it does that, yes.
> > > >
> > > > Hmm, still things must go wrong somewhere. Perhaps need some instrumentation
> > > > to see if all the transfer buffers really hit the PCI mapping functions.
> > >
> > > Such a test has already been carried out earlier in this thread:
> > >
> > > 	http://marc.info/?l=linux-usb&m=127074587029353&w=2
> > > 	http://marc.info/?l=linux-usb&m=127076841801051&w=2
> > > 	http://marc.info/?l=linux-usb&m=127082890510415&w=2
> >
> > Hmm, thanks. But things must still go wrong somewhere, otherwise
> > the GFP_DMA32 wouldn't be needed?
>
> Indeed, something must go wrong somewhere.  Since Daniel's patch fixed
> the problem by changing the buffer from a streaming mapping to a
> coherent mapping, it's logical to assume that bad DMA addresses have
> something to do with it.  But we don't really know for certain.

Some more ideas to nail this down would be to boot the machine with
mem=4096M and mem=2048M to see whether this makes any difference. Also,
I think it would be interesting to know whether the patch below helps.

As the real reason seems entirely obfuscated, there's unfortunately need
for some trial error approach. Pedro, as you're the only one who can
actually reproduce the problem, do you see any chance to do that?

Thanks,
Daniel


diff --git a/sound/usb/caiaq/audio.c b/sound/usb/caiaq/audio.c
index 4328cad..26013be 100644
--- a/sound/usb/caiaq/audio.c
+++ b/sound/usb/caiaq/audio.c
@@ -560,7 +560,7 @@ static struct urb **alloc_urbs(struct snd_usb_caiaqdev *dev, int dir, int *ret)
               }

               urbs[i]->transfer_buffer =
-                       kmalloc(FRAMES_PER_URB * BYTES_PER_FRAME, GFP_KERNEL);
+                       kmalloc(FRAMES_PER_URB * BYTES_PER_FRAME, GFP_KERNEL | GFP_DMA);
               if (!urbs[i]->transfer_buffer) {
                       log("unable to kmalloc() transfer buffer, OOM!?\n");
                       *ret = -ENOMEM;

^ permalink raw reply related	[flat|nested] 221+ messages in thread

* Re: [PATCH] USB: rename usb_buffer_alloc() and usb_buffer_free()
@ 2010-04-13 19:27                     ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-13 19:27 UTC (permalink / raw)
  To: Daniel Mack
  Cc: linux-kernel, Greg KH, Pedro Ribeiro, akpm, linux-usb,
	alsa-devel, Robert Hancock, Andi Kleen

On Tue, 13 Apr 2010, Daniel Mack wrote:

> On Mon, Apr 12, 2010 at 01:17:25PM +0200, Daniel Mack wrote:
> > For more clearance what the functions actually do,
> > 
> >   usb_buffer_alloc() is renamed to usb_alloc_coherent()
> >   usb_buffer_free()  is renamed to usb_free_coherent()
> > 
> > They should only be used in code which really needs DMA coherency.
> > 
> > All call sites have been changed accordingly, except for staging
> > drivers.
> 
> Is this ok? As it's quite big, I think it should be merged soon if there
> are no objections.

I have no objection.  All it does is rename a couple of functions.  
There's no reason for this to go into 2.6.34; it can wait for the next 
merge window.

Alan Stern


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [PATCH] USB: rename usb_buffer_alloc() and usb_buffer_free()
@ 2010-04-13 19:27                     ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-13 19:27 UTC (permalink / raw)
  To: Daniel Mack
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA, Greg KH, Pedro Ribeiro,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
	linux-usb-u79uwXL29TY76Z2rM5mHXA,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw, Robert Hancock, Andi Kleen

On Tue, 13 Apr 2010, Daniel Mack wrote:

> On Mon, Apr 12, 2010 at 01:17:25PM +0200, Daniel Mack wrote:
> > For more clearance what the functions actually do,
> > 
> >   usb_buffer_alloc() is renamed to usb_alloc_coherent()
> >   usb_buffer_free()  is renamed to usb_free_coherent()
> > 
> > They should only be used in code which really needs DMA coherency.
> > 
> > All call sites have been changed accordingly, except for staging
> > drivers.
> 
> Is this ok? As it's quite big, I think it should be merged soon if there
> are no objections.

I have no objection.  All it does is rename a couple of functions.  
There's no reason for this to go into 2.6.34; it can wait for the next 
merge window.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [PATCH] USB: rename usb_buffer_alloc() and usb_buffer_free()
  2010-04-13 19:27                     ` Alan Stern
  (?)
@ 2010-04-13 20:26                     ` Greg KH
  2010-04-13 21:47                         ` Daniel Mack
  -1 siblings, 1 reply; 221+ messages in thread
From: Greg KH @ 2010-04-13 20:26 UTC (permalink / raw)
  To: Alan Stern
  Cc: Daniel Mack, linux-kernel, Pedro Ribeiro, akpm, linux-usb,
	alsa-devel, Robert Hancock, Andi Kleen

On Tue, Apr 13, 2010 at 03:27:36PM -0400, Alan Stern wrote:
> On Tue, 13 Apr 2010, Daniel Mack wrote:
> 
> > On Mon, Apr 12, 2010 at 01:17:25PM +0200, Daniel Mack wrote:
> > > For more clearance what the functions actually do,
> > > 
> > >   usb_buffer_alloc() is renamed to usb_alloc_coherent()
> > >   usb_buffer_free()  is renamed to usb_free_coherent()
> > > 
> > > They should only be used in code which really needs DMA coherency.
> > > 
> > > All call sites have been changed accordingly, except for staging
> > > drivers.
> > 
> > Is this ok? As it's quite big, I think it should be merged soon if there
> > are no objections.
> 
> I have no objection.  All it does is rename a couple of functions.  
> There's no reason for this to go into 2.6.34; it can wait for the next 
> merge window.

I think I will split this up into the following set of patches:
	- rename the functions and add a macro for the old names
	- rename all in-kernel usages
	- rename the staging tree usages
	- remove the macros

the first patch can go in to Linus's tree now, to make it easier for the
2nd and 3rd patches to live in linux-next easier as we might need to
look at the usages in other development trees before we can add the last
one.

Sound good?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [PATCH] USB: rename usb_buffer_alloc() and usb_buffer_free()
  2010-04-13 20:26                     ` Greg KH
@ 2010-04-13 21:47                         ` Daniel Mack
  0 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-13 21:47 UTC (permalink / raw)
  To: Greg KH
  Cc: Alan Stern, linux-kernel, Pedro Ribeiro, akpm, linux-usb,
	alsa-devel, Robert Hancock, Andi Kleen

On Tue, Apr 13, 2010 at 01:26:07PM -0700, Greg KH wrote:
> I think I will split this up into the following set of patches:
> 	- rename the functions and add a macro for the old names
> 	- rename all in-kernel usages
> 	- rename the staging tree usages
> 	- remove the macros
> 
> the first patch can go in to Linus's tree now, to make it easier for the
> 2nd and 3rd patches to live in linux-next easier as we might need to
> look at the usages in other development trees before we can add the last
> one.
> 
> Sound good?

Yes, thanks a lot.

Daniel

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [PATCH] USB: rename usb_buffer_alloc() and usb_buffer_free()
@ 2010-04-13 21:47                         ` Daniel Mack
  0 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-13 21:47 UTC (permalink / raw)
  To: Greg KH
  Cc: alsa-devel, linux-usb, linux-kernel, Andi Kleen, Alan Stern,
	Pedro Ribeiro, akpm, Robert Hancock

On Tue, Apr 13, 2010 at 01:26:07PM -0700, Greg KH wrote:
> I think I will split this up into the following set of patches:
> 	- rename the functions and add a macro for the old names
> 	- rename all in-kernel usages
> 	- rename the staging tree usages
> 	- remove the macros
> 
> the first patch can go in to Linus's tree now, to make it easier for the
> 2nd and 3rd patches to live in linux-next easier as we might need to
> look at the usages in other development trees before we can add the last
> one.
> 
> Sound good?

Yes, thanks a lot.

Daniel

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-13 23:46                               ` Pedro Ribeiro
  0 siblings, 0 replies; 221+ messages in thread
From: Pedro Ribeiro @ 2010-04-13 23:46 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Alan Stern, Andi Kleen, linux-kernel, akpm, Greg KH, alsa-devel,
	linux-usb

On 13 April 2010 19:22, Daniel Mack <daniel@caiaq.de> wrote:
> On Mon, Apr 12, 2010 at 12:57:16PM -0400, Alan Stern wrote:
>> On Mon, 12 Apr 2010, Andi Kleen wrote:
>> > On Mon, Apr 12, 2010 at 12:17:22PM -0400, Alan Stern wrote:
>> > > On Mon, 12 Apr 2010, Andi Kleen wrote:
>> > >
>> > > > > Well, the sound driver itself doesn't care for any of those things, just
>> > > > > like any other USB driver doesn't. The USB core itself of the host
>> > > > > controller driver should do, and as far as I can see, it does that, yes.
>> > > >
>> > > > Hmm, still things must go wrong somewhere. Perhaps need some instrumentation
>> > > > to see if all the transfer buffers really hit the PCI mapping functions.
>> > >
>> > > Such a test has already been carried out earlier in this thread:
>> > >
>> > >   http://marc.info/?l=linux-usb&m=127074587029353&w=2
>> > >   http://marc.info/?l=linux-usb&m=127076841801051&w=2
>> > >   http://marc.info/?l=linux-usb&m=127082890510415&w=2
>> >
>> > Hmm, thanks. But things must still go wrong somewhere, otherwise
>> > the GFP_DMA32 wouldn't be needed?
>>
>> Indeed, something must go wrong somewhere.  Since Daniel's patch fixed
>> the problem by changing the buffer from a streaming mapping to a
>> coherent mapping, it's logical to assume that bad DMA addresses have
>> something to do with it.  But we don't really know for certain.
>
> Some more ideas to nail this down would be to boot the machine with
> mem=4096M and mem=2048M to see whether this makes any difference. Also,
> I think it would be interesting to know whether the patch below helps.
>
> As the real reason seems entirely obfuscated, there's unfortunately need
> for some trial error approach. Pedro, as you're the only one who can
> actually reproduce the problem, do you see any chance to do that?
>
> Thanks,
> Daniel
>
>
> diff --git a/sound/usb/caiaq/audio.c b/sound/usb/caiaq/audio.c
> index 4328cad..26013be 100644
> --- a/sound/usb/caiaq/audio.c
> +++ b/sound/usb/caiaq/audio.c
> @@ -560,7 +560,7 @@ static struct urb **alloc_urbs(struct snd_usb_caiaqdev *dev, int dir, int *ret)
>                }
>
>                urbs[i]->transfer_buffer =
> -                       kmalloc(FRAMES_PER_URB * BYTES_PER_FRAME, GFP_KERNEL);
> +                       kmalloc(FRAMES_PER_URB * BYTES_PER_FRAME, GFP_KERNEL | GFP_DMA);
>                if (!urbs[i]->transfer_buffer) {
>                        log("unable to kmalloc() transfer buffer, OOM!?\n");
>                        *ret = -ENOMEM;
>
>

Good news, I can't trigger the interference with either:
- mem=2048m
- mem=4096m
- your patch

Any idea why is mem=4096m different than a regular boot since I have 4GB anyway?

Regards,
Pedro

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-13 23:46                               ` Pedro Ribeiro
  0 siblings, 0 replies; 221+ messages in thread
From: Pedro Ribeiro @ 2010-04-13 23:46 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Alan Stern, Andi Kleen, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b, Greg KH,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-usb-u79uwXL29TY76Z2rM5mHXA

On 13 April 2010 19:22, Daniel Mack <daniel-rDUAYElUppE@public.gmane.org> wrote:
> On Mon, Apr 12, 2010 at 12:57:16PM -0400, Alan Stern wrote:
>> On Mon, 12 Apr 2010, Andi Kleen wrote:
>> > On Mon, Apr 12, 2010 at 12:17:22PM -0400, Alan Stern wrote:
>> > > On Mon, 12 Apr 2010, Andi Kleen wrote:
>> > >
>> > > > > Well, the sound driver itself doesn't care for any of those things, just
>> > > > > like any other USB driver doesn't. The USB core itself of the host
>> > > > > controller driver should do, and as far as I can see, it does that, yes.
>> > > >
>> > > > Hmm, still things must go wrong somewhere. Perhaps need some instrumentation
>> > > > to see if all the transfer buffers really hit the PCI mapping functions.
>> > >
>> > > Such a test has already been carried out earlier in this thread:
>> > >
>> > >   http://marc.info/?l=linux-usb&m=127074587029353&w=2
>> > >   http://marc.info/?l=linux-usb&m=127076841801051&w=2
>> > >   http://marc.info/?l=linux-usb&m=127082890510415&w=2
>> >
>> > Hmm, thanks. But things must still go wrong somewhere, otherwise
>> > the GFP_DMA32 wouldn't be needed?
>>
>> Indeed, something must go wrong somewhere.  Since Daniel's patch fixed
>> the problem by changing the buffer from a streaming mapping to a
>> coherent mapping, it's logical to assume that bad DMA addresses have
>> something to do with it.  But we don't really know for certain.
>
> Some more ideas to nail this down would be to boot the machine with
> mem=4096M and mem=2048M to see whether this makes any difference. Also,
> I think it would be interesting to know whether the patch below helps.
>
> As the real reason seems entirely obfuscated, there's unfortunately need
> for some trial error approach. Pedro, as you're the only one who can
> actually reproduce the problem, do you see any chance to do that?
>
> Thanks,
> Daniel
>
>
> diff --git a/sound/usb/caiaq/audio.c b/sound/usb/caiaq/audio.c
> index 4328cad..26013be 100644
> --- a/sound/usb/caiaq/audio.c
> +++ b/sound/usb/caiaq/audio.c
> @@ -560,7 +560,7 @@ static struct urb **alloc_urbs(struct snd_usb_caiaqdev *dev, int dir, int *ret)
>                }
>
>                urbs[i]->transfer_buffer =
> -                       kmalloc(FRAMES_PER_URB * BYTES_PER_FRAME, GFP_KERNEL);
> +                       kmalloc(FRAMES_PER_URB * BYTES_PER_FRAME, GFP_KERNEL | GFP_DMA);
>                if (!urbs[i]->transfer_buffer) {
>                        log("unable to kmalloc() transfer buffer, OOM!?\n");
>                        *ret = -ENOMEM;
>
>

Good news, I can't trigger the interference with either:
- mem=2048m
- mem=4096m
- your patch

Any idea why is mem=4096m different than a regular boot since I have 4GB anyway?

Regards,
Pedro
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-13 23:46                               ` Pedro Ribeiro
@ 2010-04-14 10:09                                 ` Daniel Mack
  -1 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-14 10:09 UTC (permalink / raw)
  To: Pedro Ribeiro
  Cc: Alan Stern, Andi Kleen, linux-kernel, akpm, Greg KH, alsa-devel,
	linux-usb

On Wed, Apr 14, 2010 at 12:46:42AM +0100, Pedro Ribeiro wrote:
> On 13 April 2010 19:22, Daniel Mack <daniel@caiaq.de> wrote:
> > Some more ideas to nail this down would be to boot the machine with
> > mem=4096M and mem=2048M to see whether this makes any difference. Also,
> > I think it would be interesting to know whether the patch below helps.
> >
> > As the real reason seems entirely obfuscated, there's unfortunately need
> > for some trial error approach. Pedro, as you're the only one who can
> > actually reproduce the problem, do you see any chance to do that?
> >
> > Thanks,
> > Daniel
> >
> >
> > diff --git a/sound/usb/caiaq/audio.c b/sound/usb/caiaq/audio.c
> > index 4328cad..26013be 100644
> > --- a/sound/usb/caiaq/audio.c
> > +++ b/sound/usb/caiaq/audio.c
> > @@ -560,7 +560,7 @@ static struct urb **alloc_urbs(struct snd_usb_caiaqdev *dev, int dir, int *ret)
> >                }
> >
> >                urbs[i]->transfer_buffer =
> > -                       kmalloc(FRAMES_PER_URB * BYTES_PER_FRAME, GFP_KERNEL);
> > +                       kmalloc(FRAMES_PER_URB * BYTES_PER_FRAME, GFP_KERNEL | GFP_DMA);
> >                if (!urbs[i]->transfer_buffer) {
> >                        log("unable to kmalloc() transfer buffer, OOM!?\n");
> >                        *ret = -ENOMEM;
> >
> >
> 
> Good news, I can't trigger the interference with either:
> - mem=2048m
> - mem=4096m
> - your patch

Thanks! So the only thing I can do for now is submit exactly this patch.
At least, it helps you and it shouldn't break anything. The question
remains whether this type of memory should be used for all
transfer_buffers.

> Any idea why is mem=4096m different than a regular boot since I have 4GB anyway?

On Fri, Apr 09, 2010 at 04:11:52PM -0600, Robert Hancock wrote:
> If you have 4GB of RAM then almost certainly you have memory located
> at addresses over 4GB. If you look at the e820 memory map printed at
> the start of dmesg on bootup and see entries with addresses of
> 100000000 or higher reported as usable, then this is the case.

Could you post the these e820 line from your dmesg when booted with
mem=4096?

Daniel


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-14 10:09                                 ` Daniel Mack
  0 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-14 10:09 UTC (permalink / raw)
  To: Pedro Ribeiro
  Cc: alsa-devel, linux-usb, Greg KH, linux-kernel, Andi Kleen,
	Alan Stern, akpm

On Wed, Apr 14, 2010 at 12:46:42AM +0100, Pedro Ribeiro wrote:
> On 13 April 2010 19:22, Daniel Mack <daniel@caiaq.de> wrote:
> > Some more ideas to nail this down would be to boot the machine with
> > mem=4096M and mem=2048M to see whether this makes any difference. Also,
> > I think it would be interesting to know whether the patch below helps.
> >
> > As the real reason seems entirely obfuscated, there's unfortunately need
> > for some trial error approach. Pedro, as you're the only one who can
> > actually reproduce the problem, do you see any chance to do that?
> >
> > Thanks,
> > Daniel
> >
> >
> > diff --git a/sound/usb/caiaq/audio.c b/sound/usb/caiaq/audio.c
> > index 4328cad..26013be 100644
> > --- a/sound/usb/caiaq/audio.c
> > +++ b/sound/usb/caiaq/audio.c
> > @@ -560,7 +560,7 @@ static struct urb **alloc_urbs(struct snd_usb_caiaqdev *dev, int dir, int *ret)
> >                }
> >
> >                urbs[i]->transfer_buffer =
> > -                       kmalloc(FRAMES_PER_URB * BYTES_PER_FRAME, GFP_KERNEL);
> > +                       kmalloc(FRAMES_PER_URB * BYTES_PER_FRAME, GFP_KERNEL | GFP_DMA);
> >                if (!urbs[i]->transfer_buffer) {
> >                        log("unable to kmalloc() transfer buffer, OOM!?\n");
> >                        *ret = -ENOMEM;
> >
> >
> 
> Good news, I can't trigger the interference with either:
> - mem=2048m
> - mem=4096m
> - your patch

Thanks! So the only thing I can do for now is submit exactly this patch.
At least, it helps you and it shouldn't break anything. The question
remains whether this type of memory should be used for all
transfer_buffers.

> Any idea why is mem=4096m different than a regular boot since I have 4GB anyway?

On Fri, Apr 09, 2010 at 04:11:52PM -0600, Robert Hancock wrote:
> If you have 4GB of RAM then almost certainly you have memory located
> at addresses over 4GB. If you look at the e820 memory map printed at
> the start of dmesg on bootup and see entries with addresses of
> 100000000 or higher reported as usable, then this is the case.

Could you post the these e820 line from your dmesg when booted with
mem=4096?

Daniel

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-14 10:09                                 ` Daniel Mack
  (?)
@ 2010-04-14 10:47                                 ` Pedro Ribeiro
  2010-04-14 11:02                                   ` Pedro Ribeiro
                                                     ` (2 more replies)
  -1 siblings, 3 replies; 221+ messages in thread
From: Pedro Ribeiro @ 2010-04-14 10:47 UTC (permalink / raw)
  To: linux-usb; +Cc: Alan Stern, Andi Kleen, linux-kernel, akpm, Greg KH, alsa-devel

On 14 April 2010 11:09, Daniel Mack <daniel@caiaq.de> wrote:

> Thanks! So the only thing I can do for now is submit exactly this patch.
> At least, it helps you and it shouldn't break anything. The question
> remains whether this type of memory should be used for all
> transfer_buffers.
>

Is there any chance you could push this to -stable? I don't care
because I always use the latest kernel, but the next Debian stable and
Ubuntu LTS are going to use 2.6.32.

>> Any idea why is mem=4096m different than a regular boot since I have 4GB anyway?
>
> On Fri, Apr 09, 2010 at 04:11:52PM -0600, Robert Hancock wrote:
>> If you have 4GB of RAM then almost certainly you have memory located
>> at addresses over 4GB. If you look at the e820 memory map printed at
>> the start of dmesg on bootup and see entries with addresses of
>> 100000000 or higher reported as usable, then this is the case.
>
> Could you post the these e820 line from your dmesg when booted with
> mem=4096?
>
> Daniel
>
>

This is the e820 WITHOUT mem=4096m:

[    0.000000] BIOS-provided physical RAM map:
[    0.000000]  BIOS-e820: 0000000000000000 - 000000000009ec00 (usable)
[    0.000000]  BIOS-e820: 000000000009ec00 - 00000000000a0000 (reserved)
[    0.000000]  BIOS-e820: 00000000000dc000 - 0000000000100000 (reserved)
[    0.000000]  BIOS-e820: 0000000000100000 - 00000000bd4a1000 (usable)
[    0.000000]  BIOS-e820: 00000000bd4a1000 - 00000000bd4a7000 (reserved)
[    0.000000]  BIOS-e820: 00000000bd4a7000 - 00000000bd5b8000 (usable)
[    0.000000]  BIOS-e820: 00000000bd5b8000 - 00000000bd60f000 (reserved)
[    0.000000]  BIOS-e820: 00000000bd60f000 - 00000000bd6c6000 (usable)
[    0.000000]  BIOS-e820: 00000000bd6c6000 - 00000000bd6d1000 (ACPI NVS)
[    0.000000]  BIOS-e820: 00000000bd6d1000 - 00000000bd6d4000 (ACPI data)
[    0.000000]  BIOS-e820: 00000000bd6d4000 - 00000000bd6d8000 (reserved)
[    0.000000]  BIOS-e820: 00000000bd6d8000 - 00000000bd6dc000 (ACPI NVS)
[    0.000000]  BIOS-e820: 00000000bd6dc000 - 00000000bd6df000 (reserved)
[    0.000000]  BIOS-e820: 00000000bd6df000 - 00000000bd706000 (ACPI NVS)
[    0.000000]  BIOS-e820: 00000000bd706000 - 00000000bd708000 (ACPI data)
[    0.000000]  BIOS-e820: 00000000bd708000 - 00000000bd90f000 (reserved)
[    0.000000]  BIOS-e820: 00000000bd90f000 - 00000000bd99f000 (ACPI NVS)
[    0.000000]  BIOS-e820: 00000000bd99f000 - 00000000bd9ff000 (ACPI data)
[    0.000000]  BIOS-e820: 00000000bd9ff000 - 00000000bda00000 (usable)
[    0.000000]  BIOS-e820: 00000000bdc00000 - 00000000c0000000 (reserved)
[    0.000000]  BIOS-e820: 00000000e0000000 - 00000000f0000000 (reserved)
[    0.000000]  BIOS-e820: 00000000fec00000 - 00000000fec10000 (reserved)
[    0.000000]  BIOS-e820: 00000000fed00000 - 00000000fed00400 (reserved)
[    0.000000]  BIOS-e820: 00000000fed10000 - 00000000fed14000 (reserved)
[    0.000000]  BIOS-e820: 00000000fed18000 - 00000000fed1a000 (reserved)
[    0.000000]  BIOS-e820: 00000000fed1c000 - 00000000fed90000 (reserved)
[    0.000000]  BIOS-e820: 00000000fee00000 - 00000000fee01000 (reserved)
[    0.000000]  BIOS-e820: 00000000ff800000 - 0000000100000000 (reserved)
[    0.000000]  BIOS-e820: 0000000100000000 - 000000013c000000 (usable)



This is the e820 output WITH mem=4096m

[    0.000000] BIOS-provided physical RAM map:
[    0.000000]  BIOS-e820: 0000000000000000 - 000000000009ec00 (usable)
[    0.000000]  BIOS-e820: 000000000009ec00 - 00000000000a0000 (reserved)
[    0.000000]  BIOS-e820: 00000000000dc000 - 0000000000100000 (reserved)
[    0.000000]  BIOS-e820: 0000000000100000 - 00000000bd4a1000 (usable)
[    0.000000]  BIOS-e820: 00000000bd4a1000 - 00000000bd4a7000 (reserved)
[    0.000000]  BIOS-e820: 00000000bd4a7000 - 00000000bd5b8000 (usable)
[    0.000000]  BIOS-e820: 00000000bd5b8000 - 00000000bd60f000 (reserved)
[    0.000000]  BIOS-e820: 00000000bd60f000 - 00000000bd6c6000 (usable)
[    0.000000]  BIOS-e820: 00000000bd6c6000 - 00000000bd6d1000 (ACPI NVS)
[    0.000000]  BIOS-e820: 00000000bd6d1000 - 00000000bd6d4000 (ACPI data)
[    0.000000]  BIOS-e820: 00000000bd6d4000 - 00000000bd6d8000 (reserved)
[    0.000000]  BIOS-e820: 00000000bd6d8000 - 00000000bd6dc000 (ACPI NVS)
[    0.000000]  BIOS-e820: 00000000bd6dc000 - 00000000bd6df000 (reserved)
[    0.000000]  BIOS-e820: 00000000bd6df000 - 00000000bd706000 (ACPI NVS)
[    0.000000]  BIOS-e820: 00000000bd706000 - 00000000bd708000 (ACPI data)
[    0.000000]  BIOS-e820: 00000000bd708000 - 00000000bd90f000 (reserved)
[    0.000000]  BIOS-e820: 00000000bd90f000 - 00000000bd99f000 (ACPI NVS)
[    0.000000]  BIOS-e820: 00000000bd99f000 - 00000000bd9ff000 (ACPI data)
[    0.000000]  BIOS-e820: 00000000bd9ff000 - 00000000bda00000 (usable)
[    0.000000]  BIOS-e820: 00000000bdc00000 - 00000000c0000000 (reserved)
[    0.000000]  BIOS-e820: 00000000e0000000 - 00000000f0000000 (reserved)
[    0.000000]  BIOS-e820: 00000000fec00000 - 00000000fec10000 (reserved)
[    0.000000]  BIOS-e820: 00000000fed00000 - 00000000fed00400 (reserved)
[    0.000000]  BIOS-e820: 00000000fed10000 - 00000000fed14000 (reserved)
[    0.000000]  BIOS-e820: 00000000fed18000 - 00000000fed1a000 (reserved)
[    0.000000]  BIOS-e820: 00000000fed1c000 - 00000000fed90000 (reserved)
[    0.000000]  BIOS-e820: 00000000fee00000 - 00000000fee01000 (reserved)
[    0.000000]  BIOS-e820: 00000000ff800000 - 0000000100000000 (reserved)
[    0.000000]  BIOS-e820: 0000000100000000 - 000000013c000000 (usable)
[    0.000000] NX (Execute Disable) protection: active
[    0.000000] user-defined physical RAM map:
[    0.000000]  user: 0000000000000000 - 000000000009ec00 (usable)
[    0.000000]  user: 000000000009ec00 - 00000000000a0000 (reserved)
[    0.000000]  user: 00000000000dc000 - 0000000000100000 (reserved)
[    0.000000]  user: 0000000000100000 - 00000000bd4a1000 (usable)
[    0.000000]  user: 00000000bd4a1000 - 00000000bd4a7000 (reserved)
[    0.000000]  user: 00000000bd4a7000 - 00000000bd5b8000 (usable)
[    0.000000]  user: 00000000bd5b8000 - 00000000bd60f000 (reserved)
[    0.000000]  user: 00000000bd60f000 - 00000000bd6c6000 (usable)
[    0.000000]  user: 00000000bd6c6000 - 00000000bd6d1000 (ACPI NVS)
[    0.000000]  user: 00000000bd6d1000 - 00000000bd6d4000 (ACPI data)
[    0.000000]  user: 00000000bd6d4000 - 00000000bd6d8000 (reserved)
[    0.000000]  user: 00000000bd6d8000 - 00000000bd6dc000 (ACPI NVS)
[    0.000000]  user: 00000000bd6dc000 - 00000000bd6df000 (reserved)
[    0.000000]  user: 00000000bd6df000 - 00000000bd706000 (ACPI NVS)
[    0.000000]  user: 00000000bd706000 - 00000000bd708000 (ACPI data)
[    0.000000]  user: 00000000bd708000 - 00000000bd90f000 (reserved)
[    0.000000]  user: 00000000bd90f000 - 00000000bd99f000 (ACPI NVS)
[    0.000000]  user: 00000000bd99f000 - 00000000bd9ff000 (ACPI data)
[    0.000000]  user: 00000000bd9ff000 - 00000000bda00000 (usable)
[    0.000000]  user: 00000000bdc00000 - 00000000c0000000 (reserved)
[    0.000000]  user: 00000000e0000000 - 00000000f0000000 (reserved)
[    0.000000]  user: 00000000fec00000 - 00000000fec10000 (reserved)
[    0.000000]  user: 00000000fed00000 - 00000000fed00400 (reserved)
[    0.000000]  user: 00000000fed10000 - 00000000fed14000 (reserved)
[    0.000000]  user: 00000000fed18000 - 00000000fed1a000 (reserved)
[    0.000000]  user: 00000000fed1c000 - 00000000fed90000 (reserved)
[    0.000000]  user: 00000000fee00000 - 00000000fee01000 (reserved)
[    0.000000]  user: 00000000ff800000 - 0000000100000000 (reserved)

So basically the BIOS is incorrectly reporting
BIOS-e820: 0000000100000000 - 000000013c000000 (usable)

right?

Thanks,
Pedro

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-14 10:47                                 ` Pedro Ribeiro
@ 2010-04-14 11:02                                   ` Pedro Ribeiro
  2010-04-14 13:18                                   ` [LKML] " Konrad Rzeszutek Wilk
  2010-04-14 14:08                                     ` Alan Stern
  2 siblings, 0 replies; 221+ messages in thread
From: Pedro Ribeiro @ 2010-04-14 11:02 UTC (permalink / raw)
  To: linux-usb, Daniel Mack
  Cc: Alan Stern, Andi Kleen, linux-kernel, akpm, Greg KH, alsa-devel

On 14 April 2010 11:47, Pedro Ribeiro <pedrib@gmail.com> wrote:
> On 14 April 2010 11:09, Daniel Mack <daniel@caiaq.de> wrote:
>
>> Thanks! So the only thing I can do for now is submit exactly this patch.
>> At least, it helps you and it shouldn't break anything. The question
>> remains whether this type of memory should be used for all
>> transfer_buffers.
>>
>
> Is there any chance you could push this to -stable? I don't care
> because I always use the latest kernel, but the next Debian stable and
> Ubuntu LTS are going to use 2.6.32.
>
>>> Any idea why is mem=4096m different than a regular boot since I have 4GB anyway?
>>
>> On Fri, Apr 09, 2010 at 04:11:52PM -0600, Robert Hancock wrote:
>>> If you have 4GB of RAM then almost certainly you have memory located
>>> at addresses over 4GB. If you look at the e820 memory map printed at
>>> the start of dmesg on bootup and see entries with addresses of
>>> 100000000 or higher reported as usable, then this is the case.
>>
>> Could you post the these e820 line from your dmesg when booted with
>> mem=4096?
>>
>> Daniel
>>
>>
>
> This is the e820 WITHOUT mem=4096m:
>
> [    0.000000] BIOS-provided physical RAM map:
> [    0.000000]  BIOS-e820: 0000000000000000 - 000000000009ec00 (usable)
> [    0.000000]  BIOS-e820: 000000000009ec00 - 00000000000a0000 (reserved)
> [    0.000000]  BIOS-e820: 00000000000dc000 - 0000000000100000 (reserved)
> [    0.000000]  BIOS-e820: 0000000000100000 - 00000000bd4a1000 (usable)
> [    0.000000]  BIOS-e820: 00000000bd4a1000 - 00000000bd4a7000 (reserved)
> [    0.000000]  BIOS-e820: 00000000bd4a7000 - 00000000bd5b8000 (usable)
> [    0.000000]  BIOS-e820: 00000000bd5b8000 - 00000000bd60f000 (reserved)
> [    0.000000]  BIOS-e820: 00000000bd60f000 - 00000000bd6c6000 (usable)
> [    0.000000]  BIOS-e820: 00000000bd6c6000 - 00000000bd6d1000 (ACPI NVS)
> [    0.000000]  BIOS-e820: 00000000bd6d1000 - 00000000bd6d4000 (ACPI data)
> [    0.000000]  BIOS-e820: 00000000bd6d4000 - 00000000bd6d8000 (reserved)
> [    0.000000]  BIOS-e820: 00000000bd6d8000 - 00000000bd6dc000 (ACPI NVS)
> [    0.000000]  BIOS-e820: 00000000bd6dc000 - 00000000bd6df000 (reserved)
> [    0.000000]  BIOS-e820: 00000000bd6df000 - 00000000bd706000 (ACPI NVS)
> [    0.000000]  BIOS-e820: 00000000bd706000 - 00000000bd708000 (ACPI data)
> [    0.000000]  BIOS-e820: 00000000bd708000 - 00000000bd90f000 (reserved)
> [    0.000000]  BIOS-e820: 00000000bd90f000 - 00000000bd99f000 (ACPI NVS)
> [    0.000000]  BIOS-e820: 00000000bd99f000 - 00000000bd9ff000 (ACPI data)
> [    0.000000]  BIOS-e820: 00000000bd9ff000 - 00000000bda00000 (usable)
> [    0.000000]  BIOS-e820: 00000000bdc00000 - 00000000c0000000 (reserved)
> [    0.000000]  BIOS-e820: 00000000e0000000 - 00000000f0000000 (reserved)
> [    0.000000]  BIOS-e820: 00000000fec00000 - 00000000fec10000 (reserved)
> [    0.000000]  BIOS-e820: 00000000fed00000 - 00000000fed00400 (reserved)
> [    0.000000]  BIOS-e820: 00000000fed10000 - 00000000fed14000 (reserved)
> [    0.000000]  BIOS-e820: 00000000fed18000 - 00000000fed1a000 (reserved)
> [    0.000000]  BIOS-e820: 00000000fed1c000 - 00000000fed90000 (reserved)
> [    0.000000]  BIOS-e820: 00000000fee00000 - 00000000fee01000 (reserved)
> [    0.000000]  BIOS-e820: 00000000ff800000 - 0000000100000000 (reserved)
> [    0.000000]  BIOS-e820: 0000000100000000 - 000000013c000000 (usable)
>
>
>
> This is the e820 output WITH mem=4096m
>
> [    0.000000] BIOS-provided physical RAM map:
> [    0.000000]  BIOS-e820: 0000000000000000 - 000000000009ec00 (usable)
> [    0.000000]  BIOS-e820: 000000000009ec00 - 00000000000a0000 (reserved)
> [    0.000000]  BIOS-e820: 00000000000dc000 - 0000000000100000 (reserved)
> [    0.000000]  BIOS-e820: 0000000000100000 - 00000000bd4a1000 (usable)
> [    0.000000]  BIOS-e820: 00000000bd4a1000 - 00000000bd4a7000 (reserved)
> [    0.000000]  BIOS-e820: 00000000bd4a7000 - 00000000bd5b8000 (usable)
> [    0.000000]  BIOS-e820: 00000000bd5b8000 - 00000000bd60f000 (reserved)
> [    0.000000]  BIOS-e820: 00000000bd60f000 - 00000000bd6c6000 (usable)
> [    0.000000]  BIOS-e820: 00000000bd6c6000 - 00000000bd6d1000 (ACPI NVS)
> [    0.000000]  BIOS-e820: 00000000bd6d1000 - 00000000bd6d4000 (ACPI data)
> [    0.000000]  BIOS-e820: 00000000bd6d4000 - 00000000bd6d8000 (reserved)
> [    0.000000]  BIOS-e820: 00000000bd6d8000 - 00000000bd6dc000 (ACPI NVS)
> [    0.000000]  BIOS-e820: 00000000bd6dc000 - 00000000bd6df000 (reserved)
> [    0.000000]  BIOS-e820: 00000000bd6df000 - 00000000bd706000 (ACPI NVS)
> [    0.000000]  BIOS-e820: 00000000bd706000 - 00000000bd708000 (ACPI data)
> [    0.000000]  BIOS-e820: 00000000bd708000 - 00000000bd90f000 (reserved)
> [    0.000000]  BIOS-e820: 00000000bd90f000 - 00000000bd99f000 (ACPI NVS)
> [    0.000000]  BIOS-e820: 00000000bd99f000 - 00000000bd9ff000 (ACPI data)
> [    0.000000]  BIOS-e820: 00000000bd9ff000 - 00000000bda00000 (usable)
> [    0.000000]  BIOS-e820: 00000000bdc00000 - 00000000c0000000 (reserved)
> [    0.000000]  BIOS-e820: 00000000e0000000 - 00000000f0000000 (reserved)
> [    0.000000]  BIOS-e820: 00000000fec00000 - 00000000fec10000 (reserved)
> [    0.000000]  BIOS-e820: 00000000fed00000 - 00000000fed00400 (reserved)
> [    0.000000]  BIOS-e820: 00000000fed10000 - 00000000fed14000 (reserved)
> [    0.000000]  BIOS-e820: 00000000fed18000 - 00000000fed1a000 (reserved)
> [    0.000000]  BIOS-e820: 00000000fed1c000 - 00000000fed90000 (reserved)
> [    0.000000]  BIOS-e820: 00000000fee00000 - 00000000fee01000 (reserved)
> [    0.000000]  BIOS-e820: 00000000ff800000 - 0000000100000000 (reserved)
> [    0.000000]  BIOS-e820: 0000000100000000 - 000000013c000000 (usable)
> [    0.000000] NX (Execute Disable) protection: active
> [    0.000000] user-defined physical RAM map:
> [    0.000000]  user: 0000000000000000 - 000000000009ec00 (usable)
> [    0.000000]  user: 000000000009ec00 - 00000000000a0000 (reserved)
> [    0.000000]  user: 00000000000dc000 - 0000000000100000 (reserved)
> [    0.000000]  user: 0000000000100000 - 00000000bd4a1000 (usable)
> [    0.000000]  user: 00000000bd4a1000 - 00000000bd4a7000 (reserved)
> [    0.000000]  user: 00000000bd4a7000 - 00000000bd5b8000 (usable)
> [    0.000000]  user: 00000000bd5b8000 - 00000000bd60f000 (reserved)
> [    0.000000]  user: 00000000bd60f000 - 00000000bd6c6000 (usable)
> [    0.000000]  user: 00000000bd6c6000 - 00000000bd6d1000 (ACPI NVS)
> [    0.000000]  user: 00000000bd6d1000 - 00000000bd6d4000 (ACPI data)
> [    0.000000]  user: 00000000bd6d4000 - 00000000bd6d8000 (reserved)
> [    0.000000]  user: 00000000bd6d8000 - 00000000bd6dc000 (ACPI NVS)
> [    0.000000]  user: 00000000bd6dc000 - 00000000bd6df000 (reserved)
> [    0.000000]  user: 00000000bd6df000 - 00000000bd706000 (ACPI NVS)
> [    0.000000]  user: 00000000bd706000 - 00000000bd708000 (ACPI data)
> [    0.000000]  user: 00000000bd708000 - 00000000bd90f000 (reserved)
> [    0.000000]  user: 00000000bd90f000 - 00000000bd99f000 (ACPI NVS)
> [    0.000000]  user: 00000000bd99f000 - 00000000bd9ff000 (ACPI data)
> [    0.000000]  user: 00000000bd9ff000 - 00000000bda00000 (usable)
> [    0.000000]  user: 00000000bdc00000 - 00000000c0000000 (reserved)
> [    0.000000]  user: 00000000e0000000 - 00000000f0000000 (reserved)
> [    0.000000]  user: 00000000fec00000 - 00000000fec10000 (reserved)
> [    0.000000]  user: 00000000fed00000 - 00000000fed00400 (reserved)
> [    0.000000]  user: 00000000fed10000 - 00000000fed14000 (reserved)
> [    0.000000]  user: 00000000fed18000 - 00000000fed1a000 (reserved)
> [    0.000000]  user: 00000000fed1c000 - 00000000fed90000 (reserved)
> [    0.000000]  user: 00000000fee00000 - 00000000fee01000 (reserved)
> [    0.000000]  user: 00000000ff800000 - 0000000100000000 (reserved)
>
> So basically the BIOS is incorrectly reporting
> BIOS-e820: 0000000100000000 - 000000013c000000 (usable)
>
> right?
>
> Thanks,
> Pedro
>

(sorry for the spam)

Actually this can't be right, because booting with mem=4096m only
gives me 3047008 kb of usable memory, versus 3949684 kb without
mem=4096m.

Pedro

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [LKML] Re: USB transfer_buffer allocations on 64bit systems
  2010-04-14 10:47                                 ` Pedro Ribeiro
  2010-04-14 11:02                                   ` Pedro Ribeiro
@ 2010-04-14 13:18                                   ` Konrad Rzeszutek Wilk
  2010-04-14 14:08                                     ` Alan Stern
  2 siblings, 0 replies; 221+ messages in thread
From: Konrad Rzeszutek Wilk @ 2010-04-14 13:18 UTC (permalink / raw)
  To: Pedro Ribeiro
  Cc: linux-usb, Alan Stern, Andi Kleen, linux-kernel, akpm, Greg KH,
	alsa-devel

> So basically the BIOS is incorrectly reporting
> BIOS-e820: 0000000100000000 - 000000013c000000 (usable)

No. Count up the the sizes of the (usuable) entries. You will see
that when you provided mem=4GB, the E820 got truncated to stop at 4GB.
Without that it goes past the 4GB mark (which is correct).

Keep in mind, 4GB doesn't mean your usuable memory stops at 4GB. The
BIOS shuffles the memory around to stick in the BIOS, ACPI, PCI hole so
that part of the usable memory is above 4GB.

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-14 14:08                                     ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-14 14:08 UTC (permalink / raw)
  To: Pedro Ribeiro
  Cc: linux-usb, Andi Kleen, linux-kernel, akpm, Greg KH, alsa-devel

On Wed, 14 Apr 2010, Pedro Ribeiro wrote:

> On 14 April 2010 11:09, Daniel Mack <daniel@caiaq.de> wrote:
> 
> > Thanks! So the only thing I can do for now is submit exactly this patch.
> > At least, it helps you and it shouldn't break anything. The question
> > remains whether this type of memory should be used for all
> > transfer_buffers.
> >
> 
> Is there any chance you could push this to -stable? I don't care
> because I always use the latest kernel, but the next Debian stable and
> Ubuntu LTS are going to use 2.6.32.

No!  Please don't do it: Don't submit the patch and _certainly_ don't
submit it to -stable.  It doesn't fix anything; it only works around a
bug, and at the moment we don't even know if the bug is in the kernel
or in Pedro's hardware (and even though it affects two different
systems of his, nobody else has reported a similar problem).  Papering
over it will only remove the incentive to fix it properly.

In addition, you'll most likely find that lots of Linux developers will
object vociferously to any proposed patch that uses GFP_DMA.  That flag
is supposed to be _only_ for ISA devices, which really need it.  By 
limiting the memory allocation to the lowest 16 MB of physical memory, 
it greatly increases the chances that the allocation will fail.

Alan Stern


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-14 14:08                                     ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-14 14:08 UTC (permalink / raw)
  To: Pedro Ribeiro
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA, Andi Kleen,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b, Greg KH,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw

On Wed, 14 Apr 2010, Pedro Ribeiro wrote:

> On 14 April 2010 11:09, Daniel Mack <daniel-rDUAYElUppE@public.gmane.org> wrote:
> 
> > Thanks! So the only thing I can do for now is submit exactly this patch.
> > At least, it helps you and it shouldn't break anything. The question
> > remains whether this type of memory should be used for all
> > transfer_buffers.
> >
> 
> Is there any chance you could push this to -stable? I don't care
> because I always use the latest kernel, but the next Debian stable and
> Ubuntu LTS are going to use 2.6.32.

No!  Please don't do it: Don't submit the patch and _certainly_ don't
submit it to -stable.  It doesn't fix anything; it only works around a
bug, and at the moment we don't even know if the bug is in the kernel
or in Pedro's hardware (and even though it affects two different
systems of his, nobody else has reported a similar problem).  Papering
over it will only remove the incentive to fix it properly.

In addition, you'll most likely find that lots of Linux developers will
object vociferously to any proposed patch that uses GFP_DMA.  That flag
is supposed to be _only_ for ISA devices, which really need it.  By 
limiting the memory allocation to the lowest 16 MB of physical memory, 
it greatly increases the chances that the allocation will fail.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-14 14:08                                     ` Alan Stern
@ 2010-04-14 16:36                                       ` Daniel Mack
  -1 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-14 16:36 UTC (permalink / raw)
  To: Alan Stern
  Cc: Pedro Ribeiro, linux-usb, Andi Kleen, linux-kernel, akpm,
	Greg KH, alsa-devel

On Wed, Apr 14, 2010 at 10:08:47AM -0400, Alan Stern wrote:
> On Wed, 14 Apr 2010, Pedro Ribeiro wrote:
> > On 14 April 2010 11:09, Daniel Mack <daniel@caiaq.de> wrote:
> > > Thanks! So the only thing I can do for now is submit exactly this patch.
> > > At least, it helps you and it shouldn't break anything. The question
> > > remains whether this type of memory should be used for all
> > > transfer_buffers.
> > >
> > 
> > Is there any chance you could push this to -stable? I don't care
> > because I always use the latest kernel, but the next Debian stable and
> > Ubuntu LTS are going to use 2.6.32.
> 
> No!  Please don't do it: Don't submit the patch and _certainly_ don't
> submit it to -stable.  It doesn't fix anything; it only works around a
> bug, and at the moment we don't even know if the bug is in the kernel
> or in Pedro's hardware (and even though it affects two different
> systems of his, nobody else has reported a similar problem).  Papering
> over it will only remove the incentive to fix it properly.

No worries - I agree. But unfortunately, I'm out of ideas now, and my
initial thoughts about what might cause the trouble were abviously not
able to explain the issue. Does anyone see further steps of tracking
this issue down?

Thanks,
Daniel

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-14 16:36                                       ` Daniel Mack
  0 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-14 16:36 UTC (permalink / raw)
  To: Alan Stern
  Cc: alsa-devel, Greg KH, linux-usb, linux-kernel, Andi Kleen,
	Pedro Ribeiro, akpm

On Wed, Apr 14, 2010 at 10:08:47AM -0400, Alan Stern wrote:
> On Wed, 14 Apr 2010, Pedro Ribeiro wrote:
> > On 14 April 2010 11:09, Daniel Mack <daniel@caiaq.de> wrote:
> > > Thanks! So the only thing I can do for now is submit exactly this patch.
> > > At least, it helps you and it shouldn't break anything. The question
> > > remains whether this type of memory should be used for all
> > > transfer_buffers.
> > >
> > 
> > Is there any chance you could push this to -stable? I don't care
> > because I always use the latest kernel, but the next Debian stable and
> > Ubuntu LTS are going to use 2.6.32.
> 
> No!  Please don't do it: Don't submit the patch and _certainly_ don't
> submit it to -stable.  It doesn't fix anything; it only works around a
> bug, and at the moment we don't even know if the bug is in the kernel
> or in Pedro's hardware (and even though it affects two different
> systems of his, nobody else has reported a similar problem).  Papering
> over it will only remove the incentive to fix it properly.

No worries - I agree. But unfortunately, I'm out of ideas now, and my
initial thoughts about what might cause the trouble were abviously not
able to explain the issue. Does anyone see further steps of tracking
this issue down?

Thanks,
Daniel

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-14 17:21                                         ` Pedro Ribeiro
  0 siblings, 0 replies; 221+ messages in thread
From: Pedro Ribeiro @ 2010-04-14 17:21 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Alan Stern, linux-usb, Andi Kleen, linux-kernel, akpm, Greg KH,
	alsa-devel

On 14 April 2010 17:36, Daniel Mack <daniel@caiaq.de> wrote:
> On Wed, Apr 14, 2010 at 10:08:47AM -0400, Alan Stern wrote:
>> On Wed, 14 Apr 2010, Pedro Ribeiro wrote:
>> > On 14 April 2010 11:09, Daniel Mack <daniel@caiaq.de> wrote:
>> > > Thanks! So the only thing I can do for now is submit exactly this patch.
>> > > At least, it helps you and it shouldn't break anything. The question
>> > > remains whether this type of memory should be used for all
>> > > transfer_buffers.
>> > >
>> >
>> > Is there any chance you could push this to -stable? I don't care
>> > because I always use the latest kernel, but the next Debian stable and
>> > Ubuntu LTS are going to use 2.6.32.
>>
>> No!  Please don't do it: Don't submit the patch and _certainly_ don't
>> submit it to -stable.  It doesn't fix anything; it only works around a
>> bug, and at the moment we don't even know if the bug is in the kernel
>> or in Pedro's hardware (and even though it affects two different
>> systems of his, nobody else has reported a similar problem).  Papering
>> over it will only remove the incentive to fix it properly.
>
> No worries - I agree. But unfortunately, I'm out of ideas now, and my
> initial thoughts about what might cause the trouble were abviously not
> able to explain the issue. Does anyone see further steps of tracking
> this issue down?
>
> Thanks,
> Daniel
>

Well if this is a dirty / dangerous hack, what about your first patch?
I've been testing it for days and has given me no problems.

The best way to trigger the issue is to connect a dib0700 based DVB
adapter. All you need is to connect it. Since it polls for the remote
control every 50 msec, it causes a constant interference. Beware that
on 2.6.34 this behaviour has been corrected. Other DVB adapters may
trigger the same issue if they also poll constatly for the rc.

Regards,
Pedro

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-14 17:21                                         ` Pedro Ribeiro
  0 siblings, 0 replies; 221+ messages in thread
From: Pedro Ribeiro @ 2010-04-14 17:21 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Alan Stern, linux-usb-u79uwXL29TY76Z2rM5mHXA, Andi Kleen,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b, Greg KH,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw

On 14 April 2010 17:36, Daniel Mack <daniel-rDUAYElUppE@public.gmane.org> wrote:
> On Wed, Apr 14, 2010 at 10:08:47AM -0400, Alan Stern wrote:
>> On Wed, 14 Apr 2010, Pedro Ribeiro wrote:
>> > On 14 April 2010 11:09, Daniel Mack <daniel-rDUAYElUppE@public.gmane.org> wrote:
>> > > Thanks! So the only thing I can do for now is submit exactly this patch.
>> > > At least, it helps you and it shouldn't break anything. The question
>> > > remains whether this type of memory should be used for all
>> > > transfer_buffers.
>> > >
>> >
>> > Is there any chance you could push this to -stable? I don't care
>> > because I always use the latest kernel, but the next Debian stable and
>> > Ubuntu LTS are going to use 2.6.32.
>>
>> No!  Please don't do it: Don't submit the patch and _certainly_ don't
>> submit it to -stable.  It doesn't fix anything; it only works around a
>> bug, and at the moment we don't even know if the bug is in the kernel
>> or in Pedro's hardware (and even though it affects two different
>> systems of his, nobody else has reported a similar problem).  Papering
>> over it will only remove the incentive to fix it properly.
>
> No worries - I agree. But unfortunately, I'm out of ideas now, and my
> initial thoughts about what might cause the trouble were abviously not
> able to explain the issue. Does anyone see further steps of tracking
> this issue down?
>
> Thanks,
> Daniel
>

Well if this is a dirty / dangerous hack, what about your first patch?
I've been testing it for days and has given me no problems.

The best way to trigger the issue is to connect a dib0700 based DVB
adapter. All you need is to connect it. Since it polls for the remote
control every 50 msec, it causes a constant interference. Beware that
on 2.6.34 this behaviour has been corrected. Other DVB adapters may
trigger the same issue if they also poll constatly for the rc.

Regards,
Pedro
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-14 16:36                                       ` Daniel Mack
  (?)
  (?)
@ 2010-04-14 18:15                                       ` Alan Stern
  2010-04-14 18:36                                         ` David Woodhouse
  2010-04-14 18:38                                         ` Chris Wright
  -1 siblings, 2 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-14 18:15 UTC (permalink / raw)
  To: Daniel Mack, David Woodhouse
  Cc: Pedro Ribeiro, USB list, Andi Kleen, Kernel development list,
	Andrew Morton, Greg KH, iommu

[Removed alsa-devel from the CC: list because this doesn't involve ALSA 
any more]

On Wed, 14 Apr 2010, Daniel Mack wrote:

> No worries - I agree. But unfortunately, I'm out of ideas now, and my
> initial thoughts about what might cause the trouble were abviously not
> able to explain the issue. Does anyone see further steps of tracking
> this issue down?

Since using mem=4096M or GFP_DMA stopped the symptoms, it seems very 
likely that a buffer is getting allocated above the 4 GB line and not 
bounced or IOMMU-mapped correctly.

David, do you have anything to suggest?  Any ways to check for IOMMU or 
related errors?

The problem, in short, is that USB audio doesn't work properly when
Pedro boots a 64-bit kernel on his 4-GB machine.  With a 32-bit kernel
it works okay, and it also works if we use dma_alloc_coherent().  The
host controller is limited to 32-bit DMA, and the DMA addresses
generated by dma_map_single() appear to be normal.

At the moment we don't even know if this is caused by a bug in the 
kernel or a bug in Pedro's hardware.  But he has observed the same 
problem on two different machines, both using the ICH9 chipset.

Alan Stern


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-14 17:21                                         ` Pedro Ribeiro
  (?)
@ 2010-04-14 18:23                                         ` Alan Stern
  2010-04-14 18:27                                           ` Pedro Ribeiro
  -1 siblings, 1 reply; 221+ messages in thread
From: Alan Stern @ 2010-04-14 18:23 UTC (permalink / raw)
  To: Pedro Ribeiro
  Cc: Daniel Mack, USB list, Andi Kleen, Kernel development list,
	Andrew Morton, Greg KH

On Wed, 14 Apr 2010, Pedro Ribeiro wrote:

> The best way to trigger the issue is to connect a dib0700 based DVB
> adapter. All you need is to connect it. Since it polls for the remote
> control every 50 msec, it causes a constant interference. Beware that
> on 2.6.34 this behaviour has been corrected. Other DVB adapters may
> trigger the same issue if they also poll constatly for the rc.

Your computer has two EHCI controllers, doesn't it?  Can you plug the
DVB into a different USB bus from the audio device?  If you do, does
the interference still occur?

Alan Stern


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-14 18:23                                         ` Alan Stern
@ 2010-04-14 18:27                                           ` Pedro Ribeiro
  2010-04-14 18:53                                             ` Alan Stern
  0 siblings, 1 reply; 221+ messages in thread
From: Pedro Ribeiro @ 2010-04-14 18:27 UTC (permalink / raw)
  To: Alan Stern
  Cc: Daniel Mack, USB list, Andi Kleen, Kernel development list,
	Andrew Morton, Greg KH

On 14 April 2010 19:23, Alan Stern <stern@rowland.harvard.edu> wrote:
> On Wed, 14 Apr 2010, Pedro Ribeiro wrote:
>
>> The best way to trigger the issue is to connect a dib0700 based DVB
>> adapter. All you need is to connect it. Since it polls for the remote
>> control every 50 msec, it causes a constant interference. Beware that
>> on 2.6.34 this behaviour has been corrected. Other DVB adapters may
>> trigger the same issue if they also poll constatly for the rc.
>
> Your computer has two EHCI controllers, doesn't it?  Can you plug the
> DVB into a different USB bus from the audio device?  If you do, does
> the interference still occur?
>
> Alan Stern
>
>

It does not matter on which ports I plug into, even if in different
buses not sharing IRQ's.

Pedro

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-14 18:15                                       ` Alan Stern
@ 2010-04-14 18:36                                         ` David Woodhouse
  2010-04-14 21:12                                           ` Pedro Ribeiro
  2010-04-14 18:38                                         ` Chris Wright
  1 sibling, 1 reply; 221+ messages in thread
From: David Woodhouse @ 2010-04-14 18:36 UTC (permalink / raw)
  To: Alan Stern
  Cc: Daniel Mack, Pedro Ribeiro, USB list, Andi Kleen,
	Kernel development list, Andrew Morton, Greg KH, iommu

On Wed, 2010-04-14 at 14:15 -0400, Alan Stern wrote:
> 
> Since using mem=4096M or GFP_DMA stopped the symptoms, it seems very 
> likely that a buffer is getting allocated above the 4 GB line and not 
> bounced or IOMMU-mapped correctly.
> 
> David, do you have anything to suggest?  Any ways to check for IOMMU
> or related errors?
> 
> The problem, in short, is that USB audio doesn't work properly when
> Pedro boots a 64-bit kernel on his 4-GB machine.  With a 32-bit kernel
> it works okay, and it also works if we use dma_alloc_coherent().  The
> host controller is limited to 32-bit DMA, and the DMA addresses
> generated by dma_map_single() appear to be normal.
> 
> At the moment we don't even know if this is caused by a bug in the 
> kernel or a bug in Pedro's hardware.  But he has observed the same 
> problem on two different machines, both using the ICH9 chipset.

Pedro's dmesg suggests that his machine has an IOMMU, but his kernel
isn't built to support it. So he'll be using swiotlb.

Would be interesting to enable CONFIG_DMAR and check whether the problem
goes away. If so, we can start looking harder at the swiotlb code.

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse@intel.com                              Intel Corporation


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-14 18:15                                       ` Alan Stern
  2010-04-14 18:36                                         ` David Woodhouse
@ 2010-04-14 18:38                                         ` Chris Wright
  2010-04-14 20:29                                           ` Alan Stern
  1 sibling, 1 reply; 221+ messages in thread
From: Chris Wright @ 2010-04-14 18:38 UTC (permalink / raw)
  To: Alan Stern
  Cc: Daniel Mack, David Woodhouse, Greg KH, USB list,
	Kernel development list, iommu, Andi Kleen, Pedro Ribeiro,
	Andrew Morton

* Alan Stern (stern@rowland.harvard.edu) wrote:
> Since using mem=4096M or GFP_DMA stopped the symptoms, it seems very 
> likely that a buffer is getting allocated above the 4 GB line and not 
> bounced or IOMMU-mapped correctly.
> 
> David, do you have anything to suggest?  Any ways to check for IOMMU or 
> related errors?

Well if the IOMMU is enabled, dmesg will show you if you're getting DMA
faults due to IOMMU.  Doesn't sound like that's the case.

> The problem, in short, is that USB audio doesn't work properly when
> Pedro boots a 64-bit kernel on his 4-GB machine.  With a 32-bit kernel
> it works okay, and it also works if we use dma_alloc_coherent().  The
> host controller is limited to 32-bit DMA, and the DMA addresses
> generated by dma_map_single() appear to be normal.

So dma_map_single is the case that's failing, but you think the mask is
correct?  What about the direction?

> At the moment we don't even know if this is caused by a bug in the 
> kernel or a bug in Pedro's hardware.  But he has observed the same 
> problem on two different machines, both using the ICH9 chipset.

Is the IOMMU enabled?

$ dmesg | grep -e DMAR -e IOMMU

If it's on, you can boot w/out (intel_iommu=off) or in passthrough mode
(intel_iommu=on iommu=pt) and see if that makes a difference.

If it's not on (but there) you can enable it (intel_iommu=on) and look
for DMA faults (pointing to driver bug).

thanks,
-chris

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-14 18:27                                           ` Pedro Ribeiro
@ 2010-04-14 18:53                                             ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-14 18:53 UTC (permalink / raw)
  To: Pedro Ribeiro
  Cc: Daniel Mack, David Woodhouse, USB list, Andi Kleen,
	Kernel development list, Andrew Morton, Greg KH

On Wed, 14 Apr 2010, Pedro Ribeiro wrote:

> On 14 April 2010 19:23, Alan Stern <stern@rowland.harvard.edu> wrote:
> > On Wed, 14 Apr 2010, Pedro Ribeiro wrote:
> >
> >> The best way to trigger the issue is to connect a dib0700 based DVB
> >> adapter. All you need is to connect it. Since it polls for the remote
> >> control every 50 msec, it causes a constant interference. Beware that
> >> on 2.6.34 this behaviour has been corrected. Other DVB adapters may
> >> trigger the same issue if they also poll constatly for the rc.
> >
> > Your computer has two EHCI controllers, doesn't it?  Can you plug the
> > DVB into a different USB bus from the audio device?  If you do, does
> > the interference still occur?
> >
> > Alan Stern
> >
> >
> 
> It does not matter on which ports I plug into, even if in different
> buses not sharing IRQ's.

Okay, good.  That's important.  If the problem went away when the two
devices were on separate buses then it would have to be a bug in
ehci-hcd.  But since it didn't go away, it must be a bug in the
memory/buffering code or in the hardware.

Alan Stern


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-14 18:38                                         ` Chris Wright
@ 2010-04-14 20:29                                           ` Alan Stern
  2010-04-14 21:01                                             ` Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 221+ messages in thread
From: Alan Stern @ 2010-04-14 20:29 UTC (permalink / raw)
  To: Chris Wright
  Cc: Daniel Mack, David Woodhouse, Greg KH, USB list,
	Kernel development list, iommu, Andi Kleen, Pedro Ribeiro,
	Andrew Morton

On Wed, 14 Apr 2010, Chris Wright wrote:

> So dma_map_single is the case that's failing, but you think the mask is
> correct?  What about the direction?

The mask and direction are unquestionably correct.  The mask is set up 
by pci_setup_device() and not changed thereafter.  Furthermore, the 
audio works okay until another device (a DVB tuner) is plugged in.  

Alan Stern


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-14 20:29                                           ` Alan Stern
@ 2010-04-14 21:01                                             ` Konrad Rzeszutek Wilk
  2010-04-14 21:12                                               ` Pedro Ribeiro
  0 siblings, 1 reply; 221+ messages in thread
From: Konrad Rzeszutek Wilk @ 2010-04-14 21:01 UTC (permalink / raw)
  To: Alan Stern
  Cc: Chris Wright, USB list, Greg KH, Kernel development list, iommu,
	Andi Kleen, Daniel Mack, Pedro Ribeiro, Andrew Morton,
	David Woodhouse

On Wed, Apr 14, 2010 at 04:29:22PM -0400, Alan Stern wrote:
> On Wed, 14 Apr 2010, Chris Wright wrote:
> 
> > So dma_map_single is the case that's failing, but you think the mask is
> > correct?  What about the direction?
> 
> The mask and direction are unquestionably correct.  The mask is set up 
> by pci_setup_device() and not changed thereafter.  Furthermore, the 
> audio works okay until another device (a DVB tuner) is plugged in.  

Could the driver for the DVB tuner change the PCI mask? That is, change
the pci mask way after it has been initialized (don't laugh, this did
happend - as I remember 4 months fix was posted on the DRM mailing list
for this).

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-14 18:36                                         ` David Woodhouse
@ 2010-04-14 21:12                                           ` Pedro Ribeiro
  2010-04-14 22:25                                             ` Chris Wright
  0 siblings, 1 reply; 221+ messages in thread
From: Pedro Ribeiro @ 2010-04-14 21:12 UTC (permalink / raw)
  To: David Woodhouse
  Cc: Alan Stern, Daniel Mack, USB list, Andi Kleen,
	Kernel development list, Andrew Morton, Greg KH, iommu,
	Chris Wright

[-- Attachment #1: Type: text/plain, Size: 1896 bytes --]

On 14 April 2010 19:36, David Woodhouse <dwmw2@infradead.org> wrote:
> On Wed, 2010-04-14 at 14:15 -0400, Alan Stern wrote:
>>
>> Since using mem=4096M or GFP_DMA stopped the symptoms, it seems very
>> likely that a buffer is getting allocated above the 4 GB line and not
>> bounced or IOMMU-mapped correctly.
>>
>> David, do you have anything to suggest?  Any ways to check for IOMMU
>> or related errors?
>>
>> The problem, in short, is that USB audio doesn't work properly when
>> Pedro boots a 64-bit kernel on his 4-GB machine.  With a 32-bit kernel
>> it works okay, and it also works if we use dma_alloc_coherent().  The
>> host controller is limited to 32-bit DMA, and the DMA addresses
>> generated by dma_map_single() appear to be normal.
>>
>> At the moment we don't even know if this is caused by a bug in the
>> kernel or a bug in Pedro's hardware.  But he has observed the same
>> problem on two different machines, both using the ICH9 chipset.
>
> Pedro's dmesg suggests that his machine has an IOMMU, but his kernel
> isn't built to support it. So he'll be using swiotlb.
>
> Would be interesting to enable CONFIG_DMAR and check whether the problem
> goes away. If so, we can start looking harder at the swiotlb code.
>
> --
> David Woodhouse                            Open Source Technology Centre
> David.Woodhouse@intel.com                              Intel Corporation
>
>

Turns out CONFIG_DMAR was disabled because of PREEMPT_RT. I disabled
the later and enabled _DMAR. It took a long time to boot, something
wrong with the usb ports. You can see it in the appended dmesg from
time 11s to 100s.

 Then after it booted, I could barely move my USB mouse and lots of
errors appeared on dmesg. I tried to connect the DVB card but it
wouldn't even initialize.

Enabling it with iommu=pt seemed to make no difference.

Thanks,
Pedro

[-- Attachment #2: dmesg.dmar.tar.bz2 --]
[-- Type: application/x-bzip2, Size: 22398 bytes --]

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-14 21:01                                             ` Konrad Rzeszutek Wilk
@ 2010-04-14 21:12                                               ` Pedro Ribeiro
  2010-04-15  1:50                                                 ` Alan Stern
  0 siblings, 1 reply; 221+ messages in thread
From: Pedro Ribeiro @ 2010-04-14 21:12 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk
  Cc: Alan Stern, Chris Wright, USB list, Greg KH,
	Kernel development list, iommu, Andi Kleen, Daniel Mack,
	Andrew Morton, David Woodhouse

On 14 April 2010 22:01, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> On Wed, Apr 14, 2010 at 04:29:22PM -0400, Alan Stern wrote:
>> On Wed, 14 Apr 2010, Chris Wright wrote:
>>
>> > So dma_map_single is the case that's failing, but you think the mask is
>> > correct?  What about the direction?
>>
>> The mask and direction are unquestionably correct.  The mask is set up
>> by pci_setup_device() and not changed thereafter.  Furthermore, the
>> audio works okay until another device (a DVB tuner) is plugged in.
>
> Could the driver for the DVB tuner change the PCI mask? That is, change
> the pci mask way after it has been initialized (don't laugh, this did
> happend - as I remember 4 months fix was posted on the DRM mailing list
> for this).
>

I can also trigger the bug on mount and unmount of a USB stick, albeit
its not as intensive.

Pedro

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-14 21:12                                           ` Pedro Ribeiro
@ 2010-04-14 22:25                                             ` Chris Wright
  2010-04-14 22:56                                               ` Pedro Ribeiro
  0 siblings, 1 reply; 221+ messages in thread
From: Chris Wright @ 2010-04-14 22:25 UTC (permalink / raw)
  To: Pedro Ribeiro
  Cc: David Woodhouse, Alan Stern, Daniel Mack, USB list, Andi Kleen,
	Kernel development list, Andrew Morton, Greg KH, iommu,
	Chris Wright

* Pedro Ribeiro (pedrib@gmail.com) wrote:
> Turns out CONFIG_DMAR was disabled because of PREEMPT_RT. I disabled
> the later and enabled _DMAR. It took a long time to boot, something
> wrong with the usb ports. You can see it in the appended dmesg from
> time 11s to 100s.
> 
> Then after it booted, I could barely move my USB mouse and lots of
> errors appeared on dmesg. I tried to connect the DVB card but it
> wouldn't even initialize.

[  316.360045] DMAR:[DMA Write] Request device [00:02.0] fault addr 23c00000 
[  316.360046] DMAR:[fault reason 05] PTE Write access is not set

That's your video device.  Do you have CONFIG_DMAR_BROKEN_GFX_WA=y?

> Enabling it with iommu=pt seemed to make no difference.

It should (it should at least eliminate the video device problem).

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-14 22:25                                             ` Chris Wright
@ 2010-04-14 22:56                                               ` Pedro Ribeiro
  2010-04-14 23:37                                                 ` Chris Wright
  0 siblings, 1 reply; 221+ messages in thread
From: Pedro Ribeiro @ 2010-04-14 22:56 UTC (permalink / raw)
  To: Chris Wright
  Cc: David Woodhouse, Alan Stern, Daniel Mack, USB list, Andi Kleen,
	Kernel development list, Andrew Morton, Greg KH, iommu

[-- Attachment #1: Type: text/plain, Size: 1145 bytes --]

On 14 April 2010 23:25, Chris Wright <chrisw@sous-sol.org> wrote:
> * Pedro Ribeiro (pedrib@gmail.com) wrote:
>> Turns out CONFIG_DMAR was disabled because of PREEMPT_RT. I disabled
>> the later and enabled _DMAR. It took a long time to boot, something
>> wrong with the usb ports. You can see it in the appended dmesg from
>> time 11s to 100s.
>>
>> Then after it booted, I could barely move my USB mouse and lots of
>> errors appeared on dmesg. I tried to connect the DVB card but it
>> wouldn't even initialize.
>
> [  316.360045] DMAR:[DMA Write] Request device [00:02.0] fault addr 23c00000
> [  316.360046] DMAR:[fault reason 05] PTE Write access is not set
>
> That's your video device.  Do you have CONFIG_DMAR_BROKEN_GFX_WA=y?
>

Where do I find this option in make menuconfig? Doesn't seem to be available...

>> Enabling it with iommu=pt seemed to make no difference.
>
> It should (it should at least eliminate the video device problem).
>

You are right, it does eliminate that problem. However I can't get any
of the USB devices to work, and the mouse is terribly slow. One more
dmesg attached.

Pedro

[-- Attachment #2: dmesg.dmar2.tar.bz2 --]
[-- Type: application/x-bzip2, Size: 21454 bytes --]

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-14 22:56                                               ` Pedro Ribeiro
@ 2010-04-14 23:37                                                 ` Chris Wright
  2010-04-15  1:20                                                   ` Pedro Ribeiro
  0 siblings, 1 reply; 221+ messages in thread
From: Chris Wright @ 2010-04-14 23:37 UTC (permalink / raw)
  To: Pedro Ribeiro
  Cc: Chris Wright, David Woodhouse, Alan Stern, Daniel Mack, USB list,
	Andi Kleen, Kernel development list, Andrew Morton, Greg KH,
	iommu

* Pedro Ribeiro (pedrib@gmail.com) wrote:
> On 14 April 2010 23:25, Chris Wright <chrisw@sous-sol.org> wrote:
> > * Pedro Ribeiro (pedrib@gmail.com) wrote:
> >> Turns out CONFIG_DMAR was disabled because of PREEMPT_RT. I disabled
> >> the later and enabled _DMAR. It took a long time to boot, something
> >> wrong with the usb ports. You can see it in the appended dmesg from
> >> time 11s to 100s.
> >>
> >> Then after it booted, I could barely move my USB mouse and lots of
> >> errors appeared on dmesg. I tried to connect the DVB card but it
> >> wouldn't even initialize.
> >
> > [  316.360045] DMAR:[DMA Write] Request device [00:02.0] fault addr 23c00000
> > [  316.360046] DMAR:[fault reason 05] PTE Write access is not set
> >
> > That's your video device.  Do you have CONFIG_DMAR_BROKEN_GFX_WA=y?
> 
> Where do I find this option in make menuconfig? Doesn't seem to be available...

It's hidden behind CONFIG_BROKEN.  The iommu=pt test puts all devices in
a 1:1 mapping (the broken graphics workaround does that just for all
graphics devices).

> >> Enabling it with iommu=pt seemed to make no difference.
> >
> > It should (it should at least eliminate the video device problem).
> 
> You are right, it does eliminate that problem. However I can't get any
> of the USB devices to work, and the mouse is terribly slow. One more
> dmesg attached.

Thanks.  It works for me here.  I just booted 2.6.33-rt4 on my T400 w/
iommu on, and an external USB mouse is working fine (I don't have the
same number of devices plugged in as you do).  You are not seeing DMA
faults which suggest that the IOMMU mappings are correct w.r.t. the DMA
transactions that the controller is initiating.

thanks,
-chris

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-14 23:37                                                 ` Chris Wright
@ 2010-04-15  1:20                                                   ` Pedro Ribeiro
  2010-04-15 15:20                                                     ` Alan Stern
  0 siblings, 1 reply; 221+ messages in thread
From: Pedro Ribeiro @ 2010-04-15  1:20 UTC (permalink / raw)
  To: Chris Wright
  Cc: David Woodhouse, Alan Stern, Daniel Mack, USB list, Andi Kleen,
	Kernel development list, Andrew Morton, Greg KH, iommu

[-- Attachment #1: Type: text/plain, Size: 2343 bytes --]

On 15 April 2010 00:37, Chris Wright <chrisw@sous-sol.org> wrote:
> * Pedro Ribeiro (pedrib@gmail.com) wrote:
>> On 14 April 2010 23:25, Chris Wright <chrisw@sous-sol.org> wrote:
>> > * Pedro Ribeiro (pedrib@gmail.com) wrote:
>> >> Turns out CONFIG_DMAR was disabled because of PREEMPT_RT. I disabled
>> >> the later and enabled _DMAR. It took a long time to boot, something
>> >> wrong with the usb ports. You can see it in the appended dmesg from
>> >> time 11s to 100s.
>> >>
>> >> Then after it booted, I could barely move my USB mouse and lots of
>> >> errors appeared on dmesg. I tried to connect the DVB card but it
>> >> wouldn't even initialize.
>> >
>> > [  316.360045] DMAR:[DMA Write] Request device [00:02.0] fault addr 23c00000
>> > [  316.360046] DMAR:[fault reason 05] PTE Write access is not set
>> >
>> > That's your video device.  Do you have CONFIG_DMAR_BROKEN_GFX_WA=y?
>>
>> Where do I find this option in make menuconfig? Doesn't seem to be available...
>
> It's hidden behind CONFIG_BROKEN.  The iommu=pt test puts all devices in
> a 1:1 mapping (the broken graphics workaround does that just for all
> graphics devices).
>
>> >> Enabling it with iommu=pt seemed to make no difference.
>> >
>> > It should (it should at least eliminate the video device problem).
>>
>> You are right, it does eliminate that problem. However I can't get any
>> of the USB devices to work, and the mouse is terribly slow. One more
>> dmesg attached.
>
> Thanks.  It works for me here.  I just booted 2.6.33-rt4 on my T400 w/
> iommu on, and an external USB mouse is working fine (I don't have the
> same number of devices plugged in as you do).  You are not seeing DMA
> faults which suggest that the IOMMU mappings are correct w.r.t. the DMA
> transactions that the controller is initiating.
>
> thanks,
> -chris
>

I enabled  CONFIG_DMAR_BROKEN_GFX_WA=y and the result is the same. A
delay in the boot process and usb devices don't work properly,
including my USB mouse.

Strange, since you have the same platform as me. The extra usb devices
you were seeing are because of my docking station - but it makes no
difference whether I'm docked or not for the purposes of the original
bug or this situation right now. The dmesg I'm attaching is without
the computer being docked.

Pedro

[-- Attachment #2: dmesg.dmar3.tar.bz2 --]
[-- Type: application/x-bzip2, Size: 20183 bytes --]

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-14 21:12                                               ` Pedro Ribeiro
@ 2010-04-15  1:50                                                 ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-04-15  1:50 UTC (permalink / raw)
  To: Pedro Ribeiro
  Cc: Konrad Rzeszutek Wilk, Chris Wright, USB list, Greg KH,
	Kernel development list, iommu, Andi Kleen, Daniel Mack,
	Andrew Morton, David Woodhouse

On Wed, 14 Apr 2010, Pedro Ribeiro wrote:

> On 14 April 2010 22:01, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> > On Wed, Apr 14, 2010 at 04:29:22PM -0400, Alan Stern wrote:
> >> On Wed, 14 Apr 2010, Chris Wright wrote:
> >>
> >> > So dma_map_single is the case that's failing, but you think the mask is
> >> > correct?  What about the direction?
> >>
> >> The mask and direction are unquestionably correct.  The mask is set up
> >> by pci_setup_device() and not changed thereafter.  Furthermore, the
> >> audio works okay until another device (a DVB tuner) is plugged in.
> >
> > Could the driver for the DVB tuner change the PCI mask? That is, change
> > the pci mask way after it has been initialized (don't laugh, this did
> > happend - as I remember 4 months fix was posted on the DRM mailing list
> > for this).
> >
> 
> I can also trigger the bug on mount and unmount of a USB stick, albeit
> its not as intensive.

In addition, it's worth pointing out that the DVB tuner is another USB 
device, not a PCI device.  Hence it doesn't have a PCI driver, and it 
seems most unlikely that its driver would modify the DMA mask of a 
different device.

Alan Stern


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-14 17:21                                         ` Pedro Ribeiro
@ 2010-04-15  7:35                                           ` Daniel Mack
  -1 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-15  7:35 UTC (permalink / raw)
  To: Pedro Ribeiro
  Cc: Alan Stern, linux-usb, Andi Kleen, linux-kernel, akpm, Greg KH,
	alsa-devel

On Wed, Apr 14, 2010 at 06:21:05PM +0100, Pedro Ribeiro wrote:
> On 14 April 2010 17:36, Daniel Mack <daniel@caiaq.de> wrote:
> > No worries - I agree. But unfortunately, I'm out of ideas now, and my
> > initial thoughts about what might cause the trouble were abviously not
> > able to explain the issue. Does anyone see further steps of tracking
> > this issue down?
> >
> > Thanks,
> > Daniel
> >
> 
> Well if this is a dirty / dangerous hack, what about your first patch?
> I've been testing it for days and has given me no problems.

[For those who haven't followed all the discussions - this patch used
 usb_buffer_alloc() instead of kmalloc() in the audio USB driver]

No, Alan is right. As long as we don't know what's going on, it
shouldn't be fixed that way.

There might be an update to all USB drivers to use a special allocation
function in order to avoid DMA bounce buffers for non-64-bit aware host
controllers, but that's certainly a second step. First, the bug that you
see needs attention, and the longer you can reproduce it, the better :)

Daniel

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-04-15  7:35                                           ` Daniel Mack
  0 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-04-15  7:35 UTC (permalink / raw)
  To: Pedro Ribeiro
  Cc: alsa-devel, Greg KH, linux-usb, linux-kernel, Andi Kleen,
	Alan Stern, akpm

On Wed, Apr 14, 2010 at 06:21:05PM +0100, Pedro Ribeiro wrote:
> On 14 April 2010 17:36, Daniel Mack <daniel@caiaq.de> wrote:
> > No worries - I agree. But unfortunately, I'm out of ideas now, and my
> > initial thoughts about what might cause the trouble were abviously not
> > able to explain the issue. Does anyone see further steps of tracking
> > this issue down?
> >
> > Thanks,
> > Daniel
> >
> 
> Well if this is a dirty / dangerous hack, what about your first patch?
> I've been testing it for days and has given me no problems.

[For those who haven't followed all the discussions - this patch used
 usb_buffer_alloc() instead of kmalloc() in the audio USB driver]

No, Alan is right. As long as we don't know what's going on, it
shouldn't be fixed that way.

There might be an update to all USB drivers to use a special allocation
function in order to avoid DMA bounce buffers for non-64-bit aware host
controllers, but that's certainly a second step. First, the bug that you
see needs attention, and the longer you can reproduce it, the better :)

Daniel

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-15  1:20                                                   ` Pedro Ribeiro
@ 2010-04-15 15:20                                                     ` Alan Stern
  2010-04-20  0:16                                                       ` Pedro Ribeiro
  0 siblings, 1 reply; 221+ messages in thread
From: Alan Stern @ 2010-04-15 15:20 UTC (permalink / raw)
  To: Pedro Ribeiro
  Cc: Chris Wright, David Woodhouse, Daniel Mack, USB list, Andi Kleen,
	Kernel development list, Andrew Morton, Greg KH, iommu

On Thu, 15 Apr 2010, Pedro Ribeiro wrote:

> I enabled  CONFIG_DMAR_BROKEN_GFX_WA=y and the result is the same. A
> delay in the boot process and usb devices don't work properly,
> including my USB mouse.
> 
> Strange, since you have the same platform as me. The extra usb devices
> you were seeing are because of my docking station - but it makes no
> difference whether I'm docked or not for the purposes of the original
> bug or this situation right now. The dmesg I'm attaching is without
> the computer being docked.

It's not possible to determine the reason for the timeout errors
between timestamps 16 and 53 from the small amount of debugging 
information in the log.  Clearly something is going wrong with the 
communication between the computer and the EHCI controller.  And 
clearly the kernel config changes are responsible.

But I don't know what to do to track it down any farther.

Alan Stern


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-15 15:20                                                     ` Alan Stern
@ 2010-04-20  0:16                                                       ` Pedro Ribeiro
  2010-05-07  7:48                                                           ` Daniel Mack
  0 siblings, 1 reply; 221+ messages in thread
From: Pedro Ribeiro @ 2010-04-20  0:16 UTC (permalink / raw)
  To: Alan Stern, Daniel Mack
  Cc: Chris Wright, David Woodhouse, USB list, Andi Kleen,
	Kernel development list, Andrew Morton, Greg KH, iommu

On 15 April 2010 16:20, Alan Stern <stern@rowland.harvard.edu> wrote:
> On Thu, 15 Apr 2010, Pedro Ribeiro wrote:
>
>> I enabled  CONFIG_DMAR_BROKEN_GFX_WA=y and the result is the same. A
>> delay in the boot process and usb devices don't work properly,
>> including my USB mouse.
>>
>> Strange, since you have the same platform as me. The extra usb devices
>> you were seeing are because of my docking station - but it makes no
>> difference whether I'm docked or not for the purposes of the original
>> bug or this situation right now. The dmesg I'm attaching is without
>> the computer being docked.
>
> It's not possible to determine the reason for the timeout errors
> between timestamps 16 and 53 from the small amount of debugging
> information in the log.  Clearly something is going wrong with the
> communication between the computer and the EHCI controller.  And
> clearly the kernel config changes are responsible.
>
> But I don't know what to do to track it down any farther.
>
> Alan Stern
>
>

I guess this is pretty much a dead end until anyone else can reproduce it!

I'll continue to use Daniel's patches privately.

Daniel, should I use the big initial patch or the GFP_DMA one? Which
one is better for a system which is only rebooted every week or so (I
usually hibernate)?

Regards,
Pedro

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
  2010-04-20  0:16                                                       ` Pedro Ribeiro
@ 2010-05-07  7:48                                                           ` Daniel Mack
  0 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-05-07  7:48 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: Pedro Ribeiro, Alan Stern, Chris Wright, David Woodhouse,
	USB list, Andi Kleen, Kernel development list, Andrew Morton,
	Greg KH, iommu, Konrad Rzeszutek Wilk, alsa-devel

On Tue, Apr 20, 2010 at 01:16:58AM +0100, Pedro Ribeiro wrote:
> On 15 April 2010 16:20, Alan Stern <stern@rowland.harvard.edu> wrote:
> > On Thu, 15 Apr 2010, Pedro Ribeiro wrote:
> >
> >> I enabled  CONFIG_DMAR_BROKEN_GFX_WA=y and the result is the same. A
> >> delay in the boot process and usb devices don't work properly,
> >> including my USB mouse.
> >>
> >> Strange, since you have the same platform as me. The extra usb devices
> >> you were seeing are because of my docking station - but it makes no
> >> difference whether I'm docked or not for the purposes of the original
> >> bug or this situation right now. The dmesg I'm attaching is without
> >> the computer being docked.
> >
> > It's not possible to determine the reason for the timeout errors
> > between timestamps 16 and 53 from the small amount of debugging
> > information in the log.  Clearly something is going wrong with the
> > communication between the computer and the EHCI controller.  And
> > clearly the kernel config changes are responsible.
> >
> > But I don't know what to do to track it down any farther.
> >
> > Alan Stern
> >
> >
> 
> I guess this is pretty much a dead end until anyone else can reproduce it!

Hmm, I think I finally found the reason for all this confusion. No idea
why I didn't come up with the following explanation any earlier.

The problem is again (summarized):

On 64bit machines, with 4GB or more, the allocated buffers for USB
transfers might be beyond the 32bit boundary. In this case, the IOMMU
should take care and install DMA bounce buffer to copy over the buffer
before the transfer actually happens. The problem is, however, that this
copy mechanism takes place when the URB with its associated buffer is
submitted, not when the EHCI will actually do the transfer.

In the particular case of audio drivers, though, the contents of the
buffers are likely to change after the submission. What we do here
is that we map the audio stream buffers which are used by ALSA to
the output URBs, so they're filled asychronously. Once the buffer is
actually sent out on the bus, it is believed to contain proper audio
date. If it doesn't, that's due to too tight audio timing or other
problems. This breaks once buffers are magically bounced in the
background.

So - long story short: these audio buffers need to be DMA coherent.

The patch below does that, and Pedro excessively tested this patch for
weeks now :) It was just the final explanation _why_ it does the right
thing that was yet missing.

If nobody has objections, can we still squeeze it into .34?

Thanks,
Daniel


>From 5672ca44b9b4617f6c29c88409da13b1bf475547 Mon Sep 17 00:00:00 2001
From: Daniel Mack <daniel@caiaq.de>
Date: Wed, 7 Apr 2010 01:03:09 +0200
Subject: [PATCH] ALSA: usb/caiaq: use usb_buffer_alloc()

Use usb_buffer_alloc() and usb_buffer_free() for transfer buffers.
We need DMA-coherent memory in this case as buffer contents are likely
to be modified after the URB was submitted, because the URB buffers
are mapped to the audio streams.

On x86_64, buffers allocated with kmalloc() may be beyond the boundaries
of 32bit accessible memory, and DMA bounce buffers will live at other
locations, unaccessible by the driver, and hence outside of the audio
buffer mapping.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Tested-by: Pedro Ribeiro <pedrib@gmail.com>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Chris Wright <chrisw@sous-sol.org>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Greg KH <gregkh@suse.de>
Cc: iommu@lists.linux-foundation.org
Cc: Kernel development list <linux-kernel@vger.kernel.org>
Cc: USB list <linux-usb@vger.kernel.org>
Cc: stable@kernel.org
---
 sound/usb/caiaq/audio.c |   57 ++++++++++++++++++++++++++--------------------
 1 files changed, 32 insertions(+), 25 deletions(-)

diff --git a/sound/usb/caiaq/audio.c b/sound/usb/caiaq/audio.c
index 4328cad..adbeefd 100644
--- a/sound/usb/caiaq/audio.c
+++ b/sound/usb/caiaq/audio.c
@@ -552,46 +552,47 @@ static struct urb **alloc_urbs(struct snd_usb_caiaqdev *dev, int dir, int *ret)
 	}
 
 	for (i = 0; i < N_URBS; i++) {
-		urbs[i] = usb_alloc_urb(FRAMES_PER_URB, GFP_KERNEL);
-		if (!urbs[i]) {
+		struct urb *u = usb_alloc_urb(FRAMES_PER_URB, GFP_KERNEL);
+		if (!u) {
 			log("unable to usb_alloc_urb(), OOM!?\n");
 			*ret = -ENOMEM;
 			return urbs;
 		}
 
-		urbs[i]->transfer_buffer =
-			kmalloc(FRAMES_PER_URB * BYTES_PER_FRAME, GFP_KERNEL);
-		if (!urbs[i]->transfer_buffer) {
-			log("unable to kmalloc() transfer buffer, OOM!?\n");
+		urbs[i] = u;
+		u->dev = usb_dev;
+		u->pipe = pipe;
+		u->transfer_buffer_length =
+				FRAMES_PER_URB * BYTES_PER_FRAME;
+		u->context = &dev->data_cb_info[i];
+		u->interval = 1;
+		u->transfer_flags = URB_ISO_ASAP;
+		u->number_of_packets = FRAMES_PER_URB;
+		u->complete = (dir == SNDRV_PCM_STREAM_CAPTURE) ?
+					read_completed : write_completed;
+		u->transfer_buffer = usb_alloc_coherent(usb_dev,
+							u->transfer_buffer_length,
+							GFP_KERNEL, &u->transfer_dma);
+		if (!u->transfer_buffer) {
+			log("usb_alloc_coherent() failed, OOM!?\n");
 			*ret = -ENOMEM;
 			return urbs;
 		}
 
 		for (frame = 0; frame < FRAMES_PER_URB; frame++) {
 			struct usb_iso_packet_descriptor *iso =
-				&urbs[i]->iso_frame_desc[frame];
+					&u->iso_frame_desc[frame];
 
 			iso->offset = BYTES_PER_FRAME * frame;
 			iso->length = BYTES_PER_FRAME;
 		}
-
-		urbs[i]->dev = usb_dev;
-		urbs[i]->pipe = pipe;
-		urbs[i]->transfer_buffer_length = FRAMES_PER_URB
-						* BYTES_PER_FRAME;
-		urbs[i]->context = &dev->data_cb_info[i];
-		urbs[i]->interval = 1;
-		urbs[i]->transfer_flags = URB_ISO_ASAP;
-		urbs[i]->number_of_packets = FRAMES_PER_URB;
-		urbs[i]->complete = (dir == SNDRV_PCM_STREAM_CAPTURE) ?
-					read_completed : write_completed;
 	}
 
 	*ret = 0;
 	return urbs;
 }
 
-static void free_urbs(struct urb **urbs)
+static void free_urbs(struct usb_device *usb_dev, struct urb **urbs)
 {
 	int i;
 
@@ -603,7 +604,10 @@ static void free_urbs(struct urb **urbs)
 			continue;
 
 		usb_kill_urb(urbs[i]);
-		kfree(urbs[i]->transfer_buffer);
+		usb_free_coherent(usb_dev,
+				  urbs[i]->transfer_buffer_length,
+				  urbs[i]->transfer_buffer,
+				  urbs[i]->transfer_dma);
 		usb_free_urb(urbs[i]);
 	}
 
@@ -613,6 +617,7 @@ static void free_urbs(struct urb **urbs)
 int snd_usb_caiaq_audio_init(struct snd_usb_caiaqdev *dev)
 {
 	int i, ret;
+	struct usb_device *usb_dev = dev->chip.dev;
 
 	dev->n_audio_in  = max(dev->spec.num_analog_audio_in,
 			       dev->spec.num_digital_audio_in) /
@@ -689,15 +694,15 @@ int snd_usb_caiaq_audio_init(struct snd_usb_caiaqdev *dev)
 	dev->data_urbs_in = alloc_urbs(dev, SNDRV_PCM_STREAM_CAPTURE, &ret);
 	if (ret < 0) {
 		kfree(dev->data_cb_info);
-		free_urbs(dev->data_urbs_in);
+		free_urbs(usb_dev, dev->data_urbs_in);
 		return ret;
 	}
 
 	dev->data_urbs_out = alloc_urbs(dev, SNDRV_PCM_STREAM_PLAYBACK, &ret);
 	if (ret < 0) {
 		kfree(dev->data_cb_info);
-		free_urbs(dev->data_urbs_in);
-		free_urbs(dev->data_urbs_out);
+		free_urbs(usb_dev, dev->data_urbs_in);
+		free_urbs(usb_dev, dev->data_urbs_out);
 		return ret;
 	}
 
@@ -706,10 +711,12 @@ int snd_usb_caiaq_audio_init(struct snd_usb_caiaqdev *dev)
 
 void snd_usb_caiaq_audio_free(struct snd_usb_caiaqdev *dev)
 {
+	struct usb_device *usb_dev = dev->chip.dev;
+
 	debug("%s(%p)\n", __func__, dev);
 	stream_stop(dev);
-	free_urbs(dev->data_urbs_in);
-	free_urbs(dev->data_urbs_out);
+	free_urbs(usb_dev, dev->data_urbs_in);
+	free_urbs(usb_dev, dev->data_urbs_out);
 	kfree(dev->data_cb_info);
 }
 
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-05-07  7:48                                                           ` Daniel Mack
  0 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-05-07  7:48 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: alsa-devel, Greg KH, Konrad Rzeszutek Wilk, USB list,
	Kernel development list, Chris Wright, iommu, Andi Kleen,
	Alan Stern, Pedro Ribeiro, Andrew Morton, David Woodhouse

On Tue, Apr 20, 2010 at 01:16:58AM +0100, Pedro Ribeiro wrote:
> On 15 April 2010 16:20, Alan Stern <stern@rowland.harvard.edu> wrote:
> > On Thu, 15 Apr 2010, Pedro Ribeiro wrote:
> >
> >> I enabled  CONFIG_DMAR_BROKEN_GFX_WA=y and the result is the same. A
> >> delay in the boot process and usb devices don't work properly,
> >> including my USB mouse.
> >>
> >> Strange, since you have the same platform as me. The extra usb devices
> >> you were seeing are because of my docking station - but it makes no
> >> difference whether I'm docked or not for the purposes of the original
> >> bug or this situation right now. The dmesg I'm attaching is without
> >> the computer being docked.
> >
> > It's not possible to determine the reason for the timeout errors
> > between timestamps 16 and 53 from the small amount of debugging
> > information in the log.  Clearly something is going wrong with the
> > communication between the computer and the EHCI controller.  And
> > clearly the kernel config changes are responsible.
> >
> > But I don't know what to do to track it down any farther.
> >
> > Alan Stern
> >
> >
> 
> I guess this is pretty much a dead end until anyone else can reproduce it!

Hmm, I think I finally found the reason for all this confusion. No idea
why I didn't come up with the following explanation any earlier.

The problem is again (summarized):

On 64bit machines, with 4GB or more, the allocated buffers for USB
transfers might be beyond the 32bit boundary. In this case, the IOMMU
should take care and install DMA bounce buffer to copy over the buffer
before the transfer actually happens. The problem is, however, that this
copy mechanism takes place when the URB with its associated buffer is
submitted, not when the EHCI will actually do the transfer.

In the particular case of audio drivers, though, the contents of the
buffers are likely to change after the submission. What we do here
is that we map the audio stream buffers which are used by ALSA to
the output URBs, so they're filled asychronously. Once the buffer is
actually sent out on the bus, it is believed to contain proper audio
date. If it doesn't, that's due to too tight audio timing or other
problems. This breaks once buffers are magically bounced in the
background.

So - long story short: these audio buffers need to be DMA coherent.

The patch below does that, and Pedro excessively tested this patch for
weeks now :) It was just the final explanation _why_ it does the right
thing that was yet missing.

If nobody has objections, can we still squeeze it into .34?

Thanks,
Daniel


>From 5672ca44b9b4617f6c29c88409da13b1bf475547 Mon Sep 17 00:00:00 2001
From: Daniel Mack <daniel@caiaq.de>
Date: Wed, 7 Apr 2010 01:03:09 +0200
Subject: [PATCH] ALSA: usb/caiaq: use usb_buffer_alloc()

Use usb_buffer_alloc() and usb_buffer_free() for transfer buffers.
We need DMA-coherent memory in this case as buffer contents are likely
to be modified after the URB was submitted, because the URB buffers
are mapped to the audio streams.

On x86_64, buffers allocated with kmalloc() may be beyond the boundaries
of 32bit accessible memory, and DMA bounce buffers will live at other
locations, unaccessible by the driver, and hence outside of the audio
buffer mapping.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Tested-by: Pedro Ribeiro <pedrib@gmail.com>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Chris Wright <chrisw@sous-sol.org>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Greg KH <gregkh@suse.de>
Cc: iommu@lists.linux-foundation.org
Cc: Kernel development list <linux-kernel@vger.kernel.org>
Cc: USB list <linux-usb@vger.kernel.org>
Cc: stable@kernel.org
---
 sound/usb/caiaq/audio.c |   57 ++++++++++++++++++++++++++--------------------
 1 files changed, 32 insertions(+), 25 deletions(-)

diff --git a/sound/usb/caiaq/audio.c b/sound/usb/caiaq/audio.c
index 4328cad..adbeefd 100644
--- a/sound/usb/caiaq/audio.c
+++ b/sound/usb/caiaq/audio.c
@@ -552,46 +552,47 @@ static struct urb **alloc_urbs(struct snd_usb_caiaqdev *dev, int dir, int *ret)
 	}
 
 	for (i = 0; i < N_URBS; i++) {
-		urbs[i] = usb_alloc_urb(FRAMES_PER_URB, GFP_KERNEL);
-		if (!urbs[i]) {
+		struct urb *u = usb_alloc_urb(FRAMES_PER_URB, GFP_KERNEL);
+		if (!u) {
 			log("unable to usb_alloc_urb(), OOM!?\n");
 			*ret = -ENOMEM;
 			return urbs;
 		}
 
-		urbs[i]->transfer_buffer =
-			kmalloc(FRAMES_PER_URB * BYTES_PER_FRAME, GFP_KERNEL);
-		if (!urbs[i]->transfer_buffer) {
-			log("unable to kmalloc() transfer buffer, OOM!?\n");
+		urbs[i] = u;
+		u->dev = usb_dev;
+		u->pipe = pipe;
+		u->transfer_buffer_length =
+				FRAMES_PER_URB * BYTES_PER_FRAME;
+		u->context = &dev->data_cb_info[i];
+		u->interval = 1;
+		u->transfer_flags = URB_ISO_ASAP;
+		u->number_of_packets = FRAMES_PER_URB;
+		u->complete = (dir == SNDRV_PCM_STREAM_CAPTURE) ?
+					read_completed : write_completed;
+		u->transfer_buffer = usb_alloc_coherent(usb_dev,
+							u->transfer_buffer_length,
+							GFP_KERNEL, &u->transfer_dma);
+		if (!u->transfer_buffer) {
+			log("usb_alloc_coherent() failed, OOM!?\n");
 			*ret = -ENOMEM;
 			return urbs;
 		}
 
 		for (frame = 0; frame < FRAMES_PER_URB; frame++) {
 			struct usb_iso_packet_descriptor *iso =
-				&urbs[i]->iso_frame_desc[frame];
+					&u->iso_frame_desc[frame];
 
 			iso->offset = BYTES_PER_FRAME * frame;
 			iso->length = BYTES_PER_FRAME;
 		}
-
-		urbs[i]->dev = usb_dev;
-		urbs[i]->pipe = pipe;
-		urbs[i]->transfer_buffer_length = FRAMES_PER_URB
-						* BYTES_PER_FRAME;
-		urbs[i]->context = &dev->data_cb_info[i];
-		urbs[i]->interval = 1;
-		urbs[i]->transfer_flags = URB_ISO_ASAP;
-		urbs[i]->number_of_packets = FRAMES_PER_URB;
-		urbs[i]->complete = (dir == SNDRV_PCM_STREAM_CAPTURE) ?
-					read_completed : write_completed;
 	}
 
 	*ret = 0;
 	return urbs;
 }
 
-static void free_urbs(struct urb **urbs)
+static void free_urbs(struct usb_device *usb_dev, struct urb **urbs)
 {
 	int i;
 
@@ -603,7 +604,10 @@ static void free_urbs(struct urb **urbs)
 			continue;
 
 		usb_kill_urb(urbs[i]);
-		kfree(urbs[i]->transfer_buffer);
+		usb_free_coherent(usb_dev,
+				  urbs[i]->transfer_buffer_length,
+				  urbs[i]->transfer_buffer,
+				  urbs[i]->transfer_dma);
 		usb_free_urb(urbs[i]);
 	}
 
@@ -613,6 +617,7 @@ static void free_urbs(struct urb **urbs)
 int snd_usb_caiaq_audio_init(struct snd_usb_caiaqdev *dev)
 {
 	int i, ret;
+	struct usb_device *usb_dev = dev->chip.dev;
 
 	dev->n_audio_in  = max(dev->spec.num_analog_audio_in,
 			       dev->spec.num_digital_audio_in) /
@@ -689,15 +694,15 @@ int snd_usb_caiaq_audio_init(struct snd_usb_caiaqdev *dev)
 	dev->data_urbs_in = alloc_urbs(dev, SNDRV_PCM_STREAM_CAPTURE, &ret);
 	if (ret < 0) {
 		kfree(dev->data_cb_info);
-		free_urbs(dev->data_urbs_in);
+		free_urbs(usb_dev, dev->data_urbs_in);
 		return ret;
 	}
 
 	dev->data_urbs_out = alloc_urbs(dev, SNDRV_PCM_STREAM_PLAYBACK, &ret);
 	if (ret < 0) {
 		kfree(dev->data_cb_info);
-		free_urbs(dev->data_urbs_in);
-		free_urbs(dev->data_urbs_out);
+		free_urbs(usb_dev, dev->data_urbs_in);
+		free_urbs(usb_dev, dev->data_urbs_out);
 		return ret;
 	}
 
@@ -706,10 +711,12 @@ int snd_usb_caiaq_audio_init(struct snd_usb_caiaqdev *dev)
 
 void snd_usb_caiaq_audio_free(struct snd_usb_caiaqdev *dev)
 {
+	struct usb_device *usb_dev = dev->chip.dev;
+
 	debug("%s(%p)\n", __func__, dev);
 	stream_stop(dev);
-	free_urbs(dev->data_urbs_in);
-	free_urbs(dev->data_urbs_out);
+	free_urbs(usb_dev, dev->data_urbs_in);
+	free_urbs(usb_dev, dev->data_urbs_out);
 	kfree(dev->data_cb_info);
 }
 
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
  2010-05-07  7:48                                                           ` Daniel Mack
@ 2010-05-07  9:47                                                             ` Clemens Ladisch
  -1 siblings, 0 replies; 221+ messages in thread
From: Clemens Ladisch @ 2010-05-07  9:47 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Takashi Iwai, alsa-devel, Greg KH, Konrad Rzeszutek Wilk,
	USB list, Kernel development list, Chris Wright, iommu,
	Andi Kleen, Alan Stern, Pedro Ribeiro, Andrew Morton,
	David Woodhouse

Daniel Mack wrote:
> The problem is again (summarized):
> 
> On 64bit machines, with 4GB or more, the allocated buffers for USB
> transfers might be beyond the 32bit boundary. In this case, the IOMMU
> should take care and install DMA bounce buffer to copy over the buffer
> before the transfer actually happens. The problem is, however, that this
> copy mechanism takes place when the URB with its associated buffer is
> submitted, not when the EHCI will actually do the transfer.
> 
> In the particular case of audio drivers, though, the contents of the
> buffers are likely to change after the submission. What we do here
> is that we map the audio stream buffers which are used by ALSA to
> the output URBs, so they're filled asychronously. Once the buffer is
> actually sent out on the bus, it is believed to contain proper audio
> date. If it doesn't, that's due to too tight audio timing or other
> problems. This breaks once buffers are magically bounced in the
> background.

At least the audio class and ua101 drivers don't do this and fill the
buffers before they are submitted.

> So - long story short: these audio buffers need to be DMA coherent.

Does the USB API actually guarantee that all controllers use DMA, i.e.,
that the buffers can be filled after submission?


Regards,
Clemens

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-05-07  9:47                                                             ` Clemens Ladisch
  0 siblings, 0 replies; 221+ messages in thread
From: Clemens Ladisch @ 2010-05-07  9:47 UTC (permalink / raw)
  To: Daniel Mack
  Cc: alsa-devel, USB list, Konrad Rzeszutek Wilk, Takashi Iwai,
	Greg KH, Kernel development list, Chris Wright, iommu,
	Andi Kleen, Alan Stern, Pedro Ribeiro, Andrew Morton,
	David Woodhouse

Daniel Mack wrote:
> The problem is again (summarized):
> 
> On 64bit machines, with 4GB or more, the allocated buffers for USB
> transfers might be beyond the 32bit boundary. In this case, the IOMMU
> should take care and install DMA bounce buffer to copy over the buffer
> before the transfer actually happens. The problem is, however, that this
> copy mechanism takes place when the URB with its associated buffer is
> submitted, not when the EHCI will actually do the transfer.
> 
> In the particular case of audio drivers, though, the contents of the
> buffers are likely to change after the submission. What we do here
> is that we map the audio stream buffers which are used by ALSA to
> the output URBs, so they're filled asychronously. Once the buffer is
> actually sent out on the bus, it is believed to contain proper audio
> date. If it doesn't, that's due to too tight audio timing or other
> problems. This breaks once buffers are magically bounced in the
> background.

At least the audio class and ua101 drivers don't do this and fill the
buffers before they are submitted.

> So - long story short: these audio buffers need to be DMA coherent.

Does the USB API actually guarantee that all controllers use DMA, i.e.,
that the buffers can be filled after submission?


Regards,
Clemens

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
  2010-05-07  9:47                                                             ` Clemens Ladisch
@ 2010-05-07 10:24                                                               ` Daniel Mack
  -1 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-05-07 10:24 UTC (permalink / raw)
  To: Clemens Ladisch
  Cc: Takashi Iwai, alsa-devel, Greg KH, Konrad Rzeszutek Wilk,
	USB list, Kernel development list, Chris Wright, iommu,
	Andi Kleen, Alan Stern, Pedro Ribeiro, Andrew Morton,
	David Woodhouse

On Fri, May 07, 2010 at 11:47:37AM +0200, Clemens Ladisch wrote:
> Daniel Mack wrote:
> > The problem is again (summarized):
> > 
> > On 64bit machines, with 4GB or more, the allocated buffers for USB
> > transfers might be beyond the 32bit boundary. In this case, the IOMMU
> > should take care and install DMA bounce buffer to copy over the buffer
> > before the transfer actually happens. The problem is, however, that this
> > copy mechanism takes place when the URB with its associated buffer is
> > submitted, not when the EHCI will actually do the transfer.
> > 
> > In the particular case of audio drivers, though, the contents of the
> > buffers are likely to change after the submission. What we do here
> > is that we map the audio stream buffers which are used by ALSA to
> > the output URBs, so they're filled asychronously. Once the buffer is
> > actually sent out on the bus, it is believed to contain proper audio
> > date. If it doesn't, that's due to too tight audio timing or other
> > problems. This breaks once buffers are magically bounced in the
> > background.
> 
> At least the audio class and ua101 drivers don't do this and fill the
> buffers before they are submitted.

Gnaa, you're right. I _thought_ my code does it the way I described, but
what I wrote is how I _wanted_ to do it, not how it's currently done. I
have a plan to change this in the future.

So unfortunately, that doesn't explain it either. Sorry for the noise.

Daniel

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-05-07 10:24                                                               ` Daniel Mack
  0 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-05-07 10:24 UTC (permalink / raw)
  To: Clemens Ladisch
  Cc: alsa-devel, USB list, Konrad Rzeszutek Wilk, Takashi Iwai,
	Greg KH, Kernel development list, Chris Wright, iommu,
	Andi Kleen, Alan Stern, Pedro Ribeiro, Andrew Morton,
	David Woodhouse

On Fri, May 07, 2010 at 11:47:37AM +0200, Clemens Ladisch wrote:
> Daniel Mack wrote:
> > The problem is again (summarized):
> > 
> > On 64bit machines, with 4GB or more, the allocated buffers for USB
> > transfers might be beyond the 32bit boundary. In this case, the IOMMU
> > should take care and install DMA bounce buffer to copy over the buffer
> > before the transfer actually happens. The problem is, however, that this
> > copy mechanism takes place when the URB with its associated buffer is
> > submitted, not when the EHCI will actually do the transfer.
> > 
> > In the particular case of audio drivers, though, the contents of the
> > buffers are likely to change after the submission. What we do here
> > is that we map the audio stream buffers which are used by ALSA to
> > the output URBs, so they're filled asychronously. Once the buffer is
> > actually sent out on the bus, it is believed to contain proper audio
> > date. If it doesn't, that's due to too tight audio timing or other
> > problems. This breaks once buffers are magically bounced in the
> > background.
> 
> At least the audio class and ua101 drivers don't do this and fill the
> buffers before they are submitted.

Gnaa, you're right. I _thought_ my code does it the way I described, but
what I wrote is how I _wanted_ to do it, not how it's currently done. I
have a plan to change this in the future.

So unfortunately, that doesn't explain it either. Sorry for the noise.

Daniel

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
@ 2010-05-07 11:42                                                               ` Oliver Neukum
  0 siblings, 0 replies; 221+ messages in thread
From: Oliver Neukum @ 2010-05-07 11:42 UTC (permalink / raw)
  To: Clemens Ladisch
  Cc: Daniel Mack, Takashi Iwai, alsa-devel, Greg KH,
	Konrad Rzeszutek Wilk, USB list, Kernel development list,
	Chris Wright, iommu, Andi Kleen, Alan Stern, Pedro Ribeiro,
	Andrew Morton, David Woodhouse

Am Freitag, 7. Mai 2010 11:47:37 schrieb Clemens Ladisch:
> > In the particular case of audio drivers, though, the contents of the
> > buffers are likely to change after the submission. What we do here
> > is that we map the audio stream buffers which are used by ALSA to
> > the output URBs, so they're filled asychronously. Once the buffer is
> > actually sent out on the bus, it is believed to contain proper audio
> > date. If it doesn't, that's due to too tight audio timing or other
> > problems. This breaks once buffers are magically bounced in the
> > background.
> 
> At least the audio class and ua101 drivers don't do this and fill the
> buffers before they are submitted.
> 
> > So - long story short: these audio buffers need to be DMA coherent.
> 
> Does the USB API actually guarantee that all controllers use DMA, i.e.,
> that the buffers can be filled after submission?

No, you must not touch buffers after submission. This does not even
work if we use DMA, because on some architectures this violates
guarantees to the dma primitives. It cannot be done.

	Regards
		Oliver

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
@ 2010-05-07 11:42                                                               ` Oliver Neukum
  0 siblings, 0 replies; 221+ messages in thread
From: Oliver Neukum @ 2010-05-07 11:42 UTC (permalink / raw)
  To: Clemens Ladisch
  Cc: Daniel Mack, Takashi Iwai, alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	Greg KH, Konrad Rzeszutek Wilk, USB list,
	Kernel development list, Chris Wright,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Andi Kleen,
	Alan Stern, Pedro Ribeiro, Andrew Morton, David Woodhouse

Am Freitag, 7. Mai 2010 11:47:37 schrieb Clemens Ladisch:
> > In the particular case of audio drivers, though, the contents of the
> > buffers are likely to change after the submission. What we do here
> > is that we map the audio stream buffers which are used by ALSA to
> > the output URBs, so they're filled asychronously. Once the buffer is
> > actually sent out on the bus, it is believed to contain proper audio
> > date. If it doesn't, that's due to too tight audio timing or other
> > problems. This breaks once buffers are magically bounced in the
> > background.
> 
> At least the audio class and ua101 drivers don't do this and fill the
> buffers before they are submitted.
> 
> > So - long story short: these audio buffers need to be DMA coherent.
> 
> Does the USB API actually guarantee that all controllers use DMA, i.e.,
> that the buffers can be filled after submission?

No, you must not touch buffers after submission. This does not even
work if we use DMA, because on some architectures this violates
guarantees to the dma primitives. It cannot be done.

	Regards
		Oliver
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
@ 2010-05-07 11:47                                                                 ` Oliver Neukum
  0 siblings, 0 replies; 221+ messages in thread
From: Oliver Neukum @ 2010-05-07 11:47 UTC (permalink / raw)
  To: Clemens Ladisch
  Cc: Daniel Mack, Takashi Iwai, alsa-devel, Greg KH,
	Konrad Rzeszutek Wilk, USB list, Kernel development list,
	Chris Wright, iommu, Andi Kleen, Alan Stern, Pedro Ribeiro,
	Andrew Morton, David Woodhouse

Am Freitag, 7. Mai 2010 13:42:34 schrieb Oliver Neukum:
> Am Freitag, 7. Mai 2010 11:47:37 schrieb Clemens Ladisch:
> > > In the particular case of audio drivers, though, the contents of the
> > > buffers are likely to change after the submission. What we do here
> > > is that we map the audio stream buffers which are used by ALSA to
> > > the output URBs, so they're filled asychronously. Once the buffer is
> > > actually sent out on the bus, it is believed to contain proper audio
> > > date. If it doesn't, that's due to too tight audio timing or other
> > > problems. This breaks once buffers are magically bounced in the
> > > background.
> > 
> > At least the audio class and ua101 drivers don't do this and fill the
> > buffers before they are submitted.
> > 
> > > So - long story short: these audio buffers need to be DMA coherent.
> > 
> > Does the USB API actually guarantee that all controllers use DMA, i.e.,
> > that the buffers can be filled after submission?
> 
> No, you must not touch buffers after submission. This does not even
> work if we use DMA, because on some architectures this violates
> guarantees to the dma primitives. It cannot be done.

Or to be precise it could be done with coherent memory, but you'd risk
transfering partially updated buffers, as you cannot know when DMA will
be done and we don't guarantee that DMA will be done right as we transfer.

	Regards
		Oliver

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
@ 2010-05-07 11:47                                                                 ` Oliver Neukum
  0 siblings, 0 replies; 221+ messages in thread
From: Oliver Neukum @ 2010-05-07 11:47 UTC (permalink / raw)
  To: Clemens Ladisch
  Cc: Daniel Mack, Takashi Iwai, alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	Greg KH, Konrad Rzeszutek Wilk, USB list,
	Kernel development list, Chris Wright,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Andi Kleen,
	Alan Stern, Pedro Ribeiro, Andrew Morton, David Woodhouse

Am Freitag, 7. Mai 2010 13:42:34 schrieb Oliver Neukum:
> Am Freitag, 7. Mai 2010 11:47:37 schrieb Clemens Ladisch:
> > > In the particular case of audio drivers, though, the contents of the
> > > buffers are likely to change after the submission. What we do here
> > > is that we map the audio stream buffers which are used by ALSA to
> > > the output URBs, so they're filled asychronously. Once the buffer is
> > > actually sent out on the bus, it is believed to contain proper audio
> > > date. If it doesn't, that's due to too tight audio timing or other
> > > problems. This breaks once buffers are magically bounced in the
> > > background.
> > 
> > At least the audio class and ua101 drivers don't do this and fill the
> > buffers before they are submitted.
> > 
> > > So - long story short: these audio buffers need to be DMA coherent.
> > 
> > Does the USB API actually guarantee that all controllers use DMA, i.e.,
> > that the buffers can be filled after submission?
> 
> No, you must not touch buffers after submission. This does not even
> work if we use DMA, because on some architectures this violates
> guarantees to the dma primitives. It cannot be done.

Or to be precise it could be done with coherent memory, but you'd risk
transfering partially updated buffers, as you cannot know when DMA will
be done and we don't guarantee that DMA will be done right as we transfer.

	Regards
		Oliver
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
  2010-05-07 11:47                                                                 ` Oliver Neukum
@ 2010-05-07 11:58                                                                   ` Daniel Mack
  -1 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-05-07 11:58 UTC (permalink / raw)
  To: Oliver Neukum
  Cc: Clemens Ladisch, Takashi Iwai, alsa-devel, Greg KH,
	Konrad Rzeszutek Wilk, USB list, Kernel development list,
	Chris Wright, iommu, Andi Kleen, Alan Stern, Pedro Ribeiro,
	Andrew Morton, David Woodhouse

On Fri, May 07, 2010 at 01:47:56PM +0200, Oliver Neukum wrote:
> Am Freitag, 7. Mai 2010 13:42:34 schrieb Oliver Neukum:
> > Am Freitag, 7. Mai 2010 11:47:37 schrieb Clemens Ladisch:
> > > > In the particular case of audio drivers, though, the contents of the
> > > > buffers are likely to change after the submission. What we do here
> > > > is that we map the audio stream buffers which are used by ALSA to
> > > > the output URBs, so they're filled asychronously. Once the buffer is
> > > > actually sent out on the bus, it is believed to contain proper audio
> > > > date. If it doesn't, that's due to too tight audio timing or other
> > > > problems. This breaks once buffers are magically bounced in the
> > > > background.
> > > 
> > > At least the audio class and ua101 drivers don't do this and fill the
> > > buffers before they are submitted.
> > > 
> > > > So - long story short: these audio buffers need to be DMA coherent.
> > > 
> > > Does the USB API actually guarantee that all controllers use DMA, i.e.,
> > > that the buffers can be filled after submission?
> > 
> > No, you must not touch buffers after submission. This does not even
> > work if we use DMA, because on some architectures this violates
> > guarantees to the dma primitives. It cannot be done.

We do such tricks on other OS where IRQ latency as high as some tens
of milliseconds. So we queue EHCI transfers well in advance and update
access their contents (for both input and output) from audio context.
I considered implementing this idea to the Linux USB audio driver as
well.

> Or to be precise it could be done with coherent memory, but you'd risk
> transfering partially updated buffers, as you cannot know when DMA will
> be done and we don't guarantee that DMA will be done right as we transfer.

If the memory is coherent, it should be possible. And if buffers are
only partially updated, the audio buffer scheduling is too tight. IOW,
the configured buffer size of audio clients in userspace is too small.

This is OT now I believe, I will start another thread for this topic
once I have something to show.

Thanks,
Daniel

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-05-07 11:58                                                                   ` Daniel Mack
  0 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-05-07 11:58 UTC (permalink / raw)
  To: Oliver Neukum
  Cc: alsa-devel, USB list, Konrad Rzeszutek Wilk, Takashi Iwai,
	Greg KH, Clemens Ladisch, Kernel development list, Chris Wright,
	iommu, Andi Kleen, Alan Stern, Pedro Ribeiro, Andrew Morton,
	David Woodhouse

On Fri, May 07, 2010 at 01:47:56PM +0200, Oliver Neukum wrote:
> Am Freitag, 7. Mai 2010 13:42:34 schrieb Oliver Neukum:
> > Am Freitag, 7. Mai 2010 11:47:37 schrieb Clemens Ladisch:
> > > > In the particular case of audio drivers, though, the contents of the
> > > > buffers are likely to change after the submission. What we do here
> > > > is that we map the audio stream buffers which are used by ALSA to
> > > > the output URBs, so they're filled asychronously. Once the buffer is
> > > > actually sent out on the bus, it is believed to contain proper audio
> > > > date. If it doesn't, that's due to too tight audio timing or other
> > > > problems. This breaks once buffers are magically bounced in the
> > > > background.
> > > 
> > > At least the audio class and ua101 drivers don't do this and fill the
> > > buffers before they are submitted.
> > > 
> > > > So - long story short: these audio buffers need to be DMA coherent.
> > > 
> > > Does the USB API actually guarantee that all controllers use DMA, i.e.,
> > > that the buffers can be filled after submission?
> > 
> > No, you must not touch buffers after submission. This does not even
> > work if we use DMA, because on some architectures this violates
> > guarantees to the dma primitives. It cannot be done.

We do such tricks on other OS where IRQ latency as high as some tens
of milliseconds. So we queue EHCI transfers well in advance and update
access their contents (for both input and output) from audio context.
I considered implementing this idea to the Linux USB audio driver as
well.

> Or to be precise it could be done with coherent memory, but you'd risk
> transfering partially updated buffers, as you cannot know when DMA will
> be done and we don't guarantee that DMA will be done right as we transfer.

If the memory is coherent, it should be possible. And if buffers are
only partially updated, the audio buffer scheduling is too tight. IOW,
the configured buffer size of audio clients in userspace is too small.

This is OT now I believe, I will start another thread for this topic
once I have something to show.

Thanks,
Daniel

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
@ 2010-05-07 14:45                                                                     ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-05-07 14:45 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Oliver Neukum, Clemens Ladisch, Takashi Iwai, alsa-devel,
	Greg KH, Konrad Rzeszutek Wilk, USB list,
	Kernel development list, Chris Wright, iommu, Andi Kleen,
	Pedro Ribeiro, Andrew Morton, David Woodhouse

On Fri, 7 May 2010, Daniel Mack wrote:

> > Or to be precise it could be done with coherent memory, but you'd risk
> > transfering partially updated buffers, as you cannot know when DMA will
> > be done and we don't guarantee that DMA will be done right as we transfer.
> 
> If the memory is coherent, it should be possible. And if buffers are
> only partially updated, the audio buffer scheduling is too tight. IOW,
> the configured buffer size of audio clients in userspace is too small.

Even with coherent memory, this dynamic updating of buffer contents 
isn't a good idea.  There's no guarantee that coherent memory won't be 
implemented using a bounce buffer during URB submission.

Alan Stern


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
@ 2010-05-07 14:45                                                                     ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-05-07 14:45 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Oliver Neukum, Clemens Ladisch, Takashi Iwai,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw, Greg KH,
	Konrad Rzeszutek Wilk, USB list, Kernel development list,
	Chris Wright, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	Andi Kleen, Pedro Ribeiro, Andrew Morton, David Woodhouse

On Fri, 7 May 2010, Daniel Mack wrote:

> > Or to be precise it could be done with coherent memory, but you'd risk
> > transfering partially updated buffers, as you cannot know when DMA will
> > be done and we don't guarantee that DMA will be done right as we transfer.
> 
> If the memory is coherent, it should be possible. And if buffers are
> only partially updated, the audio buffer scheduling is too tight. IOW,
> the configured buffer size of audio clients in userspace is too small.

Even with coherent memory, this dynamic updating of buffer contents 
isn't a good idea.  There's no guarantee that coherent memory won't be 
implemented using a bounce buffer during URB submission.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
  2010-05-07 10:24                                                               ` Daniel Mack
@ 2010-05-07 14:51                                                                 ` Alan Stern
  -1 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-05-07 14:51 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Clemens Ladisch, Takashi Iwai, alsa-devel, Greg KH,
	Konrad Rzeszutek Wilk, USB list, Kernel development list,
	Chris Wright, iommu, Andi Kleen, Pedro Ribeiro, Andrew Morton,
	David Woodhouse

On Fri, 7 May 2010, Daniel Mack wrote:

> > At least the audio class and ua101 drivers don't do this and fill the
> > buffers before they are submitted.
> 
> Gnaa, you're right. I _thought_ my code does it the way I described, but
> what I wrote is how I _wanted_ to do it, not how it's currently done. I
> have a plan to change this in the future.
> 
> So unfortunately, that doesn't explain it either. Sorry for the noise.

At one point we tried an experiment, printing out the buffer and DMA 
addresses.  I don't recall seeing anything obviously wrong, but if an 
IOMMU was in use then that might not mean anything.  Is it possible 
that the IOMMU mappings sometimes get messed up for addresses above 4 
GB?

Alan Stern


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
@ 2010-05-07 14:51                                                                 ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-05-07 14:51 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Clemens Ladisch, Takashi Iwai, alsa-devel, Greg KH,
	Konrad Rzeszutek Wilk, USB list, Kernel development list,
	Chris Wright, iommu, Andi Kleen, Pedro Ribeiro, Andrew Morton,
	David Woodhouse

On Fri, 7 May 2010, Daniel Mack wrote:

> > At least the audio class and ua101 drivers don't do this and fill the
> > buffers before they are submitted.
> 
> Gnaa, you're right. I _thought_ my code does it the way I described, but
> what I wrote is how I _wanted_ to do it, not how it's currently done. I
> have a plan to change this in the future.
> 
> So unfortunately, that doesn't explain it either. Sorry for the noise.

At one point we tried an experiment, printing out the buffer and DMA 
addresses.  I don't recall seeing anything obviously wrong, but if an 
IOMMU was in use then that might not mean anything.  Is it possible 
that the IOMMU mappings sometimes get messed up for addresses above 4 
GB?

Alan Stern

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
  2010-05-07 14:51                                                                 ` Alan Stern
  (?)
@ 2010-05-10  2:50                                                                 ` FUJITA Tomonori
  2010-05-10  9:21                                                                     ` David Woodhouse
  -1 siblings, 1 reply; 221+ messages in thread
From: FUJITA Tomonori @ 2010-05-10  2:50 UTC (permalink / raw)
  To: stern
  Cc: daniel, clemens, tiwai, alsa-devel, gregkh, konrad.wilk,
	linux-usb, linux-kernel, chrisw, iommu, andi, pedrib, akpm,
	dwmw2

On Fri, 7 May 2010 10:51:10 -0400 (EDT)
Alan Stern <stern@rowland.harvard.edu> wrote:

> On Fri, 7 May 2010, Daniel Mack wrote:
> 
> > > At least the audio class and ua101 drivers don't do this and fill the
> > > buffers before they are submitted.
> > 
> > Gnaa, you're right. I _thought_ my code does it the way I described, but
> > what I wrote is how I _wanted_ to do it, not how it's currently done. I
> > have a plan to change this in the future.
> > 
> > So unfortunately, that doesn't explain it either. Sorry for the noise.
> 
> At one point we tried an experiment, printing out the buffer and DMA 
> addresses.  I don't recall seeing anything obviously wrong, but if an 
> IOMMU was in use then that might not mean anything.  Is it possible 
> that the IOMMU mappings sometimes get messed up for addresses above 4 
> GB?

You mean that an IOMMU could allocate an address above 4GB wrongly? If
so, IIRC, all the IOMMU implementations use dev->dma_mask and
dev->coherent_dma_mask properly. And the DMA address space of the
majority of IOMMUs are limited less than 4GB.

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
  2010-05-10  2:50                                                                 ` FUJITA Tomonori
@ 2010-05-10  9:21                                                                     ` David Woodhouse
  0 siblings, 0 replies; 221+ messages in thread
From: David Woodhouse @ 2010-05-10  9:21 UTC (permalink / raw)
  To: FUJITA Tomonori
  Cc: stern, daniel, clemens, tiwai, alsa-devel, gregkh, konrad.wilk,
	linux-usb, linux-kernel, chrisw, iommu, andi, pedrib, akpm

On Mon, 2010-05-10 at 11:50 +0900, FUJITA Tomonori wrote:
> On Fri, 7 May 2010 10:51:10 -0400 (EDT)
> Alan Stern <stern@rowland.harvard.edu> wrote:
> 
> > On Fri, 7 May 2010, Daniel Mack wrote:
> > 
> > > > At least the audio class and ua101 drivers don't do this and fill the
> > > > buffers before they are submitted.
> > > 
> > > Gnaa, you're right. I _thought_ my code does it the way I described, but
> > > what I wrote is how I _wanted_ to do it, not how it's currently done. I
> > > have a plan to change this in the future.
> > > 
> > > So unfortunately, that doesn't explain it either. Sorry for the noise.
> > 
> > At one point we tried an experiment, printing out the buffer and DMA 
> > addresses.  I don't recall seeing anything obviously wrong, but if an 
> > IOMMU was in use then that might not mean anything.  Is it possible 
> > that the IOMMU mappings sometimes get messed up for addresses above 4 
> > GB?
> 
> You mean that an IOMMU could allocate an address above 4GB wrongly? If
> so, IIRC, all the IOMMU implementations use dev->dma_mask and
> dev->coherent_dma_mask properly. And the DMA address space of the
> majority of IOMMUs are limited less than 4GB.

The Intel IOMMU code will use dev->dma_mask and dev->coherent_dma_mask
properly. It is not limited to 4GiB, but it will tend to give virtual
DMA addresses below 4GiB even when a device is capable of more; it'll
only give out higher addresses when the address space below 4GiB is
exhausted.

-- 
dwmw2


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: USB transfer_buffer allocations on 64bit systems
@ 2010-05-10  9:21                                                                     ` David Woodhouse
  0 siblings, 0 replies; 221+ messages in thread
From: David Woodhouse @ 2010-05-10  9:21 UTC (permalink / raw)
  To: FUJITA Tomonori
  Cc: alsa-devel, linux-usb, konrad.wilk, tiwai, gregkh, clemens,
	linux-kernel, chrisw, iommu, andi, stern, pedrib, akpm

On Mon, 2010-05-10 at 11:50 +0900, FUJITA Tomonori wrote:
> On Fri, 7 May 2010 10:51:10 -0400 (EDT)
> Alan Stern <stern@rowland.harvard.edu> wrote:
> 
> > On Fri, 7 May 2010, Daniel Mack wrote:
> > 
> > > > At least the audio class and ua101 drivers don't do this and fill the
> > > > buffers before they are submitted.
> > > 
> > > Gnaa, you're right. I _thought_ my code does it the way I described, but
> > > what I wrote is how I _wanted_ to do it, not how it's currently done. I
> > > have a plan to change this in the future.
> > > 
> > > So unfortunately, that doesn't explain it either. Sorry for the noise.
> > 
> > At one point we tried an experiment, printing out the buffer and DMA 
> > addresses.  I don't recall seeing anything obviously wrong, but if an 
> > IOMMU was in use then that might not mean anything.  Is it possible 
> > that the IOMMU mappings sometimes get messed up for addresses above 4 
> > GB?
> 
> You mean that an IOMMU could allocate an address above 4GB wrongly? If
> so, IIRC, all the IOMMU implementations use dev->dma_mask and
> dev->coherent_dma_mask properly. And the DMA address space of the
> majority of IOMMUs are limited less than 4GB.

The Intel IOMMU code will use dev->dma_mask and dev->coherent_dma_mask
properly. It is not limited to 4GiB, but it will tend to give virtual
DMA addresses below 4GiB even when a device is capable of more; it'll
only give out higher addresses when the address space below 4GiB is
exhausted.

-- 
dwmw2

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
@ 2010-05-10 14:31                                                                 ` Konrad Rzeszutek Wilk
  0 siblings, 0 replies; 221+ messages in thread
From: Konrad Rzeszutek Wilk @ 2010-05-10 14:31 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Clemens Ladisch, alsa-devel, USB list, Takashi Iwai, Greg KH,
	Kernel development list, Chris Wright, iommu, Andi Kleen,
	Alan Stern, Pedro Ribeiro, Andrew Morton, David Woodhouse

On Fri, May 07, 2010 at 12:24:08PM +0200, Daniel Mack wrote:
> On Fri, May 07, 2010 at 11:47:37AM +0200, Clemens Ladisch wrote:
> > Daniel Mack wrote:
> > > The problem is again (summarized):
> > > 
> > > On 64bit machines, with 4GB or more, the allocated buffers for USB
> > > transfers might be beyond the 32bit boundary. In this case, the IOMMU
> > > should take care and install DMA bounce buffer to copy over the buffer
> > > before the transfer actually happens. The problem is, however, that this
> > > copy mechanism takes place when the URB with its associated buffer is
> > > submitted, not when the EHCI will actually do the transfer.
> > > 
> > > In the particular case of audio drivers, though, the contents of the
> > > buffers are likely to change after the submission. What we do here
> > > is that we map the audio stream buffers which are used by ALSA to
> > > the output URBs, so they're filled asychronously. Once the buffer is
> > > actually sent out on the bus, it is believed to contain proper audio
> > > date. If it doesn't, that's due to too tight audio timing or other
> > > problems. This breaks once buffers are magically bounced in the
> > > background.
> > 
> > At least the audio class and ua101 drivers don't do this and fill the
> > buffers before they are submitted.
> 
> Gnaa, you're right. I _thought_ my code does it the way I described, but
> what I wrote is how I _wanted_ to do it, not how it's currently done. I
> have a plan to change this in the future.
> 
> So unfortunately, that doesn't explain it either. Sorry for the noise.

Well, you might be on the right track. You see, when you do any DMA API
operation (say pci_map_page), you might end up with _two_ DMA addresses.
One that you get from doing 'virt_to_phys' for your buffer (which might
be above the 4GB mark), and another from the 'pci_map_page' (which can
be the virt_to_phys of your buffer or it can be the DMA address of the
SWIOTLB). If you don't submit the _right_ DMA address or sync after the
DMA transfer (so the SWIOTLB would do its memcpy to your allocated
buffer DMA address), you could end up having the data it the SWIOTLB buffer,
and check data in your kzalloc buffer and notice that nothing is there
(and if it hadn't called pci_dma_sync.. before the check).

But this obviously would not happen if you buffer is allocated with the
GFP_DMA32.

I am not familiar with the USB stack so it might be doing this correctly
already...

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
@ 2010-05-10 14:31                                                                 ` Konrad Rzeszutek Wilk
  0 siblings, 0 replies; 221+ messages in thread
From: Konrad Rzeszutek Wilk @ 2010-05-10 14:31 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Clemens Ladisch, alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw, USB list,
	Takashi Iwai, Greg KH, Kernel development list, Chris Wright,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Andi Kleen,
	Alan Stern, Pedro Ribeiro, Andrew Morton, David Woodhouse

On Fri, May 07, 2010 at 12:24:08PM +0200, Daniel Mack wrote:
> On Fri, May 07, 2010 at 11:47:37AM +0200, Clemens Ladisch wrote:
> > Daniel Mack wrote:
> > > The problem is again (summarized):
> > > 
> > > On 64bit machines, with 4GB or more, the allocated buffers for USB
> > > transfers might be beyond the 32bit boundary. In this case, the IOMMU
> > > should take care and install DMA bounce buffer to copy over the buffer
> > > before the transfer actually happens. The problem is, however, that this
> > > copy mechanism takes place when the URB with its associated buffer is
> > > submitted, not when the EHCI will actually do the transfer.
> > > 
> > > In the particular case of audio drivers, though, the contents of the
> > > buffers are likely to change after the submission. What we do here
> > > is that we map the audio stream buffers which are used by ALSA to
> > > the output URBs, so they're filled asychronously. Once the buffer is
> > > actually sent out on the bus, it is believed to contain proper audio
> > > date. If it doesn't, that's due to too tight audio timing or other
> > > problems. This breaks once buffers are magically bounced in the
> > > background.
> > 
> > At least the audio class and ua101 drivers don't do this and fill the
> > buffers before they are submitted.
> 
> Gnaa, you're right. I _thought_ my code does it the way I described, but
> what I wrote is how I _wanted_ to do it, not how it's currently done. I
> have a plan to change this in the future.
> 
> So unfortunately, that doesn't explain it either. Sorry for the noise.

Well, you might be on the right track. You see, when you do any DMA API
operation (say pci_map_page), you might end up with _two_ DMA addresses.
One that you get from doing 'virt_to_phys' for your buffer (which might
be above the 4GB mark), and another from the 'pci_map_page' (which can
be the virt_to_phys of your buffer or it can be the DMA address of the
SWIOTLB). If you don't submit the _right_ DMA address or sync after the
DMA transfer (so the SWIOTLB would do its memcpy to your allocated
buffer DMA address), you could end up having the data it the SWIOTLB buffer,
and check data in your kzalloc buffer and notice that nothing is there
(and if it hadn't called pci_dma_sync.. before the check).

But this obviously would not happen if you buffer is allocated with the
GFP_DMA32.

I am not familiar with the USB stack so it might be doing this correctly
already...
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
@ 2010-05-10 14:58                                                                       ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-05-10 14:58 UTC (permalink / raw)
  To: David Woodhouse
  Cc: FUJITA Tomonori, daniel, clemens, tiwai, alsa-devel, gregkh,
	konrad.wilk, linux-usb, linux-kernel, chrisw, iommu, andi,
	pedrib, akpm

On Mon, 10 May 2010, David Woodhouse wrote:

> On Mon, 2010-05-10 at 11:50 +0900, FUJITA Tomonori wrote:
> > On Fri, 7 May 2010 10:51:10 -0400 (EDT)
> > Alan Stern <stern@rowland.harvard.edu> wrote:
> > 
> > > On Fri, 7 May 2010, Daniel Mack wrote:
> > > 
> > > > > At least the audio class and ua101 drivers don't do this and fill the
> > > > > buffers before they are submitted.
> > > > 
> > > > Gnaa, you're right. I _thought_ my code does it the way I described, but
> > > > what I wrote is how I _wanted_ to do it, not how it's currently done. I
> > > > have a plan to change this in the future.
> > > > 
> > > > So unfortunately, that doesn't explain it either. Sorry for the noise.
> > > 
> > > At one point we tried an experiment, printing out the buffer and DMA 
> > > addresses.  I don't recall seeing anything obviously wrong, but if an 
> > > IOMMU was in use then that might not mean anything.  Is it possible 
> > > that the IOMMU mappings sometimes get messed up for addresses above 4 
> > > GB?
> > 
> > You mean that an IOMMU could allocate an address above 4GB wrongly? If
> > so, IIRC, all the IOMMU implementations use dev->dma_mask and
> > dev->coherent_dma_mask properly. And the DMA address space of the
> > majority of IOMMUs are limited less than 4GB.
> 
> The Intel IOMMU code will use dev->dma_mask and dev->coherent_dma_mask
> properly. It is not limited to 4GiB, but it will tend to give virtual
> DMA addresses below 4GiB even when a device is capable of more; it'll
> only give out higher addresses when the address space below 4GiB is
> exhausted.

What I meant was: Is it possible that the IOMMU code will return a
virtual DMA address before 4 GB but will somehow forget to actually map
that address to the data buffer?

The problem goes away when Pedro boots with mem=4G.  And the dma_mask
value is set properly (in fact, the ehci-hcd driver currently doesn't
use 64-bit DMA at all).

If anyone wants to see the debug log entries showing the buffer and DMA
addresses, they are attached to this email message:

	http://marc.info/?l=linux-kernel&m=127076841801054&w=2

Either the data isn't getting written to the buffer correctly or else
the buffer isn't getting sent to the device correctly.  Can anybody
suggest a means of determining which is the case?

Alan Stern


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
@ 2010-05-10 14:58                                                                       ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-05-10 14:58 UTC (permalink / raw)
  To: David Woodhouse
  Cc: FUJITA Tomonori, daniel-rDUAYElUppE,
	clemens-P6GI/4k7KOmELgA04lAiVw, tiwai-l3A5Bk7waGM,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw, gregkh-l3A5Bk7waGM,
	konrad.wilk-QHcLZuEGTsvQT0dZR+AlfA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	chrisw-69jw2NvuJkxg9hUCZPvPmw,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	andi-Vw/NltI1exuRpAAqCnN02g, pedrib-Re5JQEeQqe8AvxtiuMwx3w,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b

On Mon, 10 May 2010, David Woodhouse wrote:

> On Mon, 2010-05-10 at 11:50 +0900, FUJITA Tomonori wrote:
> > On Fri, 7 May 2010 10:51:10 -0400 (EDT)
> > Alan Stern <stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org> wrote:
> > 
> > > On Fri, 7 May 2010, Daniel Mack wrote:
> > > 
> > > > > At least the audio class and ua101 drivers don't do this and fill the
> > > > > buffers before they are submitted.
> > > > 
> > > > Gnaa, you're right. I _thought_ my code does it the way I described, but
> > > > what I wrote is how I _wanted_ to do it, not how it's currently done. I
> > > > have a plan to change this in the future.
> > > > 
> > > > So unfortunately, that doesn't explain it either. Sorry for the noise.
> > > 
> > > At one point we tried an experiment, printing out the buffer and DMA 
> > > addresses.  I don't recall seeing anything obviously wrong, but if an 
> > > IOMMU was in use then that might not mean anything.  Is it possible 
> > > that the IOMMU mappings sometimes get messed up for addresses above 4 
> > > GB?
> > 
> > You mean that an IOMMU could allocate an address above 4GB wrongly? If
> > so, IIRC, all the IOMMU implementations use dev->dma_mask and
> > dev->coherent_dma_mask properly. And the DMA address space of the
> > majority of IOMMUs are limited less than 4GB.
> 
> The Intel IOMMU code will use dev->dma_mask and dev->coherent_dma_mask
> properly. It is not limited to 4GiB, but it will tend to give virtual
> DMA addresses below 4GiB even when a device is capable of more; it'll
> only give out higher addresses when the address space below 4GiB is
> exhausted.

What I meant was: Is it possible that the IOMMU code will return a
virtual DMA address before 4 GB but will somehow forget to actually map
that address to the data buffer?

The problem goes away when Pedro boots with mem=4G.  And the dma_mask
value is set properly (in fact, the ehci-hcd driver currently doesn't
use 64-bit DMA at all).

If anyone wants to see the debug log entries showing the buffer and DMA
addresses, they are attached to this email message:

	http://marc.info/?l=linux-kernel&m=127076841801054&w=2

Either the data isn't getting written to the buffer correctly or else
the buffer isn't getting sent to the device correctly.  Can anybody
suggest a means of determining which is the case?

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
@ 2010-05-11  1:06                                                                         ` FUJITA Tomonori
  0 siblings, 0 replies; 221+ messages in thread
From: FUJITA Tomonori @ 2010-05-11  1:06 UTC (permalink / raw)
  To: stern
  Cc: dwmw2, fujita.tomonori, daniel, clemens, tiwai, alsa-devel,
	gregkh, konrad.wilk, linux-usb, linux-kernel, chrisw, iommu,
	andi, pedrib, akpm

On Mon, 10 May 2010 10:58:37 -0400 (EDT)
Alan Stern <stern@rowland.harvard.edu> wrote:

> On Mon, 10 May 2010, David Woodhouse wrote:
> 
> > On Mon, 2010-05-10 at 11:50 +0900, FUJITA Tomonori wrote:
> > > On Fri, 7 May 2010 10:51:10 -0400 (EDT)
> > > Alan Stern <stern@rowland.harvard.edu> wrote:
> > > 
> > > > On Fri, 7 May 2010, Daniel Mack wrote:
> > > > 
> > > > > > At least the audio class and ua101 drivers don't do this and fill the
> > > > > > buffers before they are submitted.
> > > > > 
> > > > > Gnaa, you're right. I _thought_ my code does it the way I described, but
> > > > > what I wrote is how I _wanted_ to do it, not how it's currently done. I
> > > > > have a plan to change this in the future.
> > > > > 
> > > > > So unfortunately, that doesn't explain it either. Sorry for the noise.
> > > > 
> > > > At one point we tried an experiment, printing out the buffer and DMA 
> > > > addresses.  I don't recall seeing anything obviously wrong, but if an 
> > > > IOMMU was in use then that might not mean anything.  Is it possible 
> > > > that the IOMMU mappings sometimes get messed up for addresses above 4 
> > > > GB?
> > > 
> > > You mean that an IOMMU could allocate an address above 4GB wrongly? If
> > > so, IIRC, all the IOMMU implementations use dev->dma_mask and
> > > dev->coherent_dma_mask properly. And the DMA address space of the
> > > majority of IOMMUs are limited less than 4GB.
> > 
> > The Intel IOMMU code will use dev->dma_mask and dev->coherent_dma_mask
> > properly. It is not limited to 4GiB, but it will tend to give virtual
> > DMA addresses below 4GiB even when a device is capable of more; it'll
> > only give out higher addresses when the address space below 4GiB is
> > exhausted.
> 
> What I meant was: Is it possible that the IOMMU code will return a
> virtual DMA address before 4 GB but will somehow forget to actually map
> that address to the data buffer?

Then, the IOMMU is completely broken. Then, we would get tons of DMA
bugs not only about USB, I guess. So I'm not sure.


> The problem goes away when Pedro boots with mem=4G.  And the dma_mask
> value is set properly (in fact, the ehci-hcd driver currently doesn't
> use 64-bit DMA at all).
> 
> If anyone wants to see the debug log entries showing the buffer and DMA
> addresses, they are attached to this email message:
> 
> 	http://marc.info/?l=linux-kernel&m=127076841801054&w=2
> 
> Either the data isn't getting written to the buffer correctly or else
> the buffer isn't getting sent to the device correctly.  Can anybody
> suggest a means of determining which is the case?

I can't say anything about this log that including only DMA addresses.
I'm not familiar with how the USB core does DMA stuff. And the USB
stack design that the USB core does DMA stuff (allocating, mappings,
etc) makes debugging DMA issues really difficult.

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
@ 2010-05-11  1:06                                                                         ` FUJITA Tomonori
  0 siblings, 0 replies; 221+ messages in thread
From: FUJITA Tomonori @ 2010-05-11  1:06 UTC (permalink / raw)
  To: stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz
  Cc: dwmw2-wEGCiKHe2LqWVfeAwA7xHQ,
	fujita.tomonori-Zyj7fXuS5i5L9jVzuh4AOg, daniel-rDUAYElUppE,
	clemens-P6GI/4k7KOmELgA04lAiVw, tiwai-l3A5Bk7waGM,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw, gregkh-l3A5Bk7waGM,
	konrad.wilk-QHcLZuEGTsvQT0dZR+AlfA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	chrisw-69jw2NvuJkxg9hUCZPvPmw,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	andi-Vw/NltI1exuRpAAqCnN02g, pedrib-Re5JQEeQqe8AvxtiuMwx3w,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b

On Mon, 10 May 2010 10:58:37 -0400 (EDT)
Alan Stern <stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org> wrote:

> On Mon, 10 May 2010, David Woodhouse wrote:
> 
> > On Mon, 2010-05-10 at 11:50 +0900, FUJITA Tomonori wrote:
> > > On Fri, 7 May 2010 10:51:10 -0400 (EDT)
> > > Alan Stern <stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org> wrote:
> > > 
> > > > On Fri, 7 May 2010, Daniel Mack wrote:
> > > > 
> > > > > > At least the audio class and ua101 drivers don't do this and fill the
> > > > > > buffers before they are submitted.
> > > > > 
> > > > > Gnaa, you're right. I _thought_ my code does it the way I described, but
> > > > > what I wrote is how I _wanted_ to do it, not how it's currently done. I
> > > > > have a plan to change this in the future.
> > > > > 
> > > > > So unfortunately, that doesn't explain it either. Sorry for the noise.
> > > > 
> > > > At one point we tried an experiment, printing out the buffer and DMA 
> > > > addresses.  I don't recall seeing anything obviously wrong, but if an 
> > > > IOMMU was in use then that might not mean anything.  Is it possible 
> > > > that the IOMMU mappings sometimes get messed up for addresses above 4 
> > > > GB?
> > > 
> > > You mean that an IOMMU could allocate an address above 4GB wrongly? If
> > > so, IIRC, all the IOMMU implementations use dev->dma_mask and
> > > dev->coherent_dma_mask properly. And the DMA address space of the
> > > majority of IOMMUs are limited less than 4GB.
> > 
> > The Intel IOMMU code will use dev->dma_mask and dev->coherent_dma_mask
> > properly. It is not limited to 4GiB, but it will tend to give virtual
> > DMA addresses below 4GiB even when a device is capable of more; it'll
> > only give out higher addresses when the address space below 4GiB is
> > exhausted.
> 
> What I meant was: Is it possible that the IOMMU code will return a
> virtual DMA address before 4 GB but will somehow forget to actually map
> that address to the data buffer?

Then, the IOMMU is completely broken. Then, we would get tons of DMA
bugs not only about USB, I guess. So I'm not sure.


> The problem goes away when Pedro boots with mem=4G.  And the dma_mask
> value is set properly (in fact, the ehci-hcd driver currently doesn't
> use 64-bit DMA at all).
> 
> If anyone wants to see the debug log entries showing the buffer and DMA
> addresses, they are attached to this email message:
> 
> 	http://marc.info/?l=linux-kernel&m=127076841801054&w=2
> 
> Either the data isn't getting written to the buffer correctly or else
> the buffer isn't getting sent to the device correctly.  Can anybody
> suggest a means of determining which is the case?

I can't say anything about this log that including only DMA addresses.
I'm not familiar with how the USB core does DMA stuff. And the USB
stack design that the USB core does DMA stuff (allocating, mappings,
etc) makes debugging DMA issues really difficult.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
@ 2010-05-11 14:00                                                                           ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-05-11 14:00 UTC (permalink / raw)
  To: FUJITA Tomonori
  Cc: dwmw2, daniel, clemens, tiwai, alsa-devel, gregkh, konrad.wilk,
	linux-usb, linux-kernel, chrisw, iommu, andi, pedrib, akpm

On Tue, 11 May 2010, FUJITA Tomonori wrote:

> > > > > At one point we tried an experiment, printing out the buffer and DMA 
> > > > > addresses.  I don't recall seeing anything obviously wrong, but if an 
> > > > > IOMMU was in use then that might not mean anything.  Is it possible 
> > > > > that the IOMMU mappings sometimes get messed up for addresses above 4 
> > > > > GB?
> > > > 
> > > > You mean that an IOMMU could allocate an address above 4GB wrongly? If
> > > > so, IIRC, all the IOMMU implementations use dev->dma_mask and
> > > > dev->coherent_dma_mask properly. And the DMA address space of the
> > > > majority of IOMMUs are limited less than 4GB.
> > > 
> > > The Intel IOMMU code will use dev->dma_mask and dev->coherent_dma_mask
> > > properly. It is not limited to 4GiB, but it will tend to give virtual
> > > DMA addresses below 4GiB even when a device is capable of more; it'll
> > > only give out higher addresses when the address space below 4GiB is
> > > exhausted.
> > 
> > What I meant was: Is it possible that the IOMMU code will return a
> > virtual DMA address before 4 GB but will somehow forget to actually map
> > that address to the data buffer?
> 
> Then, the IOMMU is completely broken. Then, we would get tons of DMA
> bugs not only about USB, I guess. So I'm not sure.

Yes, you're right about that.

> > The problem goes away when Pedro boots with mem=4G.  And the dma_mask
> > value is set properly (in fact, the ehci-hcd driver currently doesn't
> > use 64-bit DMA at all).
> > 
> > If anyone wants to see the debug log entries showing the buffer and DMA
> > addresses, they are attached to this email message:
> > 
> > 	http://marc.info/?l=linux-kernel&m=127076841801054&w=2
> > 
> > Either the data isn't getting written to the buffer correctly or else
> > the buffer isn't getting sent to the device correctly.  Can anybody
> > suggest a means of determining which is the case?
> 
> I can't say anything about this log that including only DMA addresses.
> I'm not familiar with how the USB core does DMA stuff. And the USB
> stack design that the USB core does DMA stuff (allocating, mappings,
> etc) makes debugging DMA issues really difficult.

The DMA stuff is simple enough in this case.  The urb->transfer_buffer
address is passed to dma_map_single(), and the DMA address it returns
is stored in urb->transfer_dma.  Those are the two values printed out
by the debugging patch.

Alan Stern


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
@ 2010-05-11 14:00                                                                           ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-05-11 14:00 UTC (permalink / raw)
  To: FUJITA Tomonori
  Cc: dwmw2-wEGCiKHe2LqWVfeAwA7xHQ, daniel-rDUAYElUppE,
	clemens-P6GI/4k7KOmELgA04lAiVw, tiwai-l3A5Bk7waGM,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw, gregkh-l3A5Bk7waGM,
	konrad.wilk-QHcLZuEGTsvQT0dZR+AlfA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	chrisw-69jw2NvuJkxg9hUCZPvPmw,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	andi-Vw/NltI1exuRpAAqCnN02g, pedrib-Re5JQEeQqe8AvxtiuMwx3w,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b

On Tue, 11 May 2010, FUJITA Tomonori wrote:

> > > > > At one point we tried an experiment, printing out the buffer and DMA 
> > > > > addresses.  I don't recall seeing anything obviously wrong, but if an 
> > > > > IOMMU was in use then that might not mean anything.  Is it possible 
> > > > > that the IOMMU mappings sometimes get messed up for addresses above 4 
> > > > > GB?
> > > > 
> > > > You mean that an IOMMU could allocate an address above 4GB wrongly? If
> > > > so, IIRC, all the IOMMU implementations use dev->dma_mask and
> > > > dev->coherent_dma_mask properly. And the DMA address space of the
> > > > majority of IOMMUs are limited less than 4GB.
> > > 
> > > The Intel IOMMU code will use dev->dma_mask and dev->coherent_dma_mask
> > > properly. It is not limited to 4GiB, but it will tend to give virtual
> > > DMA addresses below 4GiB even when a device is capable of more; it'll
> > > only give out higher addresses when the address space below 4GiB is
> > > exhausted.
> > 
> > What I meant was: Is it possible that the IOMMU code will return a
> > virtual DMA address before 4 GB but will somehow forget to actually map
> > that address to the data buffer?
> 
> Then, the IOMMU is completely broken. Then, we would get tons of DMA
> bugs not only about USB, I guess. So I'm not sure.

Yes, you're right about that.

> > The problem goes away when Pedro boots with mem=4G.  And the dma_mask
> > value is set properly (in fact, the ehci-hcd driver currently doesn't
> > use 64-bit DMA at all).
> > 
> > If anyone wants to see the debug log entries showing the buffer and DMA
> > addresses, they are attached to this email message:
> > 
> > 	http://marc.info/?l=linux-kernel&m=127076841801054&w=2
> > 
> > Either the data isn't getting written to the buffer correctly or else
> > the buffer isn't getting sent to the device correctly.  Can anybody
> > suggest a means of determining which is the case?
> 
> I can't say anything about this log that including only DMA addresses.
> I'm not familiar with how the USB core does DMA stuff. And the USB
> stack design that the USB core does DMA stuff (allocating, mappings,
> etc) makes debugging DMA issues really difficult.

The DMA stuff is simple enough in this case.  The urb->transfer_buffer
address is passed to dma_map_single(), and the DMA address it returns
is stored in urb->transfer_dma.  Those are the two values printed out
by the debugging patch.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
  2010-05-11 14:00                                                                           ` Alan Stern
  (?)
@ 2010-05-11 14:22                                                                           ` FUJITA Tomonori
  -1 siblings, 0 replies; 221+ messages in thread
From: FUJITA Tomonori @ 2010-05-11 14:22 UTC (permalink / raw)
  To: stern
  Cc: fujita.tomonori, dwmw2, daniel, clemens, tiwai, alsa-devel,
	gregkh, konrad.wilk, linux-usb, linux-kernel, chrisw, iommu,
	andi, pedrib, akpm

On Tue, 11 May 2010 10:00:50 -0400 (EDT)
Alan Stern <stern@rowland.harvard.edu> wrote:

> > > The problem goes away when Pedro boots with mem=4G.  And the dma_mask
> > > value is set properly (in fact, the ehci-hcd driver currently doesn't
> > > use 64-bit DMA at all).
> > > 
> > > If anyone wants to see the debug log entries showing the buffer and DMA
> > > addresses, they are attached to this email message:
> > > 
> > > 	http://marc.info/?l=linux-kernel&m=127076841801054&w=2
> > > 
> > > Either the data isn't getting written to the buffer correctly or else
> > > the buffer isn't getting sent to the device correctly.  Can anybody
> > > suggest a means of determining which is the case?
> > 
> > I can't say anything about this log that including only DMA addresses.
> > I'm not familiar with how the USB core does DMA stuff. And the USB
> > stack design that the USB core does DMA stuff (allocating, mappings,
> > etc) makes debugging DMA issues really difficult.
> 
> The DMA stuff is simple enough in this case.  The urb->transfer_buffer
> address is passed to dma_map_single(), and the DMA address it returns
> is stored in urb->transfer_dma.  Those are the two values printed out
> by the debugging patch.

You've already confirmed that all the returned addresses
(urb->transfer_dma) in the log is less than 4GB, right?

Drivers need to take care of more things (not only about addresses) to
do DMA properly, that is, use the DMA API in the proper way (such as,
once calling dma_map_single, drivers can't touch the buffer until
calling dma_unmap_single)

Using the DMA API and performing DMA transfer in different places just
make things complicated.

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
  2010-05-11 14:00                                                                           ` Alan Stern
  (?)
  (?)
@ 2010-05-11 14:24                                                                           ` Konrad Rzeszutek Wilk
  2010-05-11 14:38                                                                             ` FUJITA Tomonori
  2010-05-11 14:57                                                                             ` Alan Stern
  -1 siblings, 2 replies; 221+ messages in thread
From: Konrad Rzeszutek Wilk @ 2010-05-11 14:24 UTC (permalink / raw)
  To: Alan Stern
  Cc: FUJITA Tomonori, alsa-devel, linux-usb, tiwai, gregkh, clemens,
	linux-kernel, chrisw, iommu, andi, daniel, pedrib, akpm, dwmw2

> > > Either the data isn't getting written to the buffer correctly or else
> > > the buffer isn't getting sent to the device correctly.  Can anybody
> > > suggest a means of determining which is the case?
> > 
> > I can't say anything about this log that including only DMA addresses.
> > I'm not familiar with how the USB core does DMA stuff. And the USB
> > stack design that the USB core does DMA stuff (allocating, mappings,
> > etc) makes debugging DMA issues really difficult.
> 
> The DMA stuff is simple enough in this case.  The urb->transfer_buffer
> address is passed to dma_map_single(), and the DMA address it returns
> is stored in urb->transfer_dma.  Those are the two values printed out
> by the debugging patch.

Is that address (urb->transfer_dma) the same as 'virt_to_phys(urb->transfer_buffer)'
(if not, then SWIOTLB is being utilized) and is the dma_sync_* done on the
urb->transfer_dma (to properly sync the data from the SWIOTLB to the
transfer_buffer) before you start using the urb->transfer_buffer?

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
  2010-05-11 14:24                                                                           ` Konrad Rzeszutek Wilk
@ 2010-05-11 14:38                                                                             ` FUJITA Tomonori
  2010-05-11 15:04                                                                                 ` Alan Stern
  2010-05-11 14:57                                                                             ` Alan Stern
  1 sibling, 1 reply; 221+ messages in thread
From: FUJITA Tomonori @ 2010-05-11 14:38 UTC (permalink / raw)
  To: konrad.wilk
  Cc: stern, fujita.tomonori, alsa-devel, linux-usb, tiwai, gregkh,
	clemens, linux-kernel, chrisw, iommu, andi, daniel, pedrib, akpm,
	dwmw2

On Tue, 11 May 2010 10:24:40 -0400
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:

> > > > Either the data isn't getting written to the buffer correctly or else
> > > > the buffer isn't getting sent to the device correctly.  Can anybody
> > > > suggest a means of determining which is the case?
> > > 
> > > I can't say anything about this log that including only DMA addresses.
> > > I'm not familiar with how the USB core does DMA stuff. And the USB
> > > stack design that the USB core does DMA stuff (allocating, mappings,
> > > etc) makes debugging DMA issues really difficult.
> > 
> > The DMA stuff is simple enough in this case.  The urb->transfer_buffer
> > address is passed to dma_map_single(), and the DMA address it returns
> > is stored in urb->transfer_dma.  Those are the two values printed out
> > by the debugging patch.
> 
> Is that address (urb->transfer_dma) the same as 'virt_to_phys(urb->transfer_buffer)'
> (if not, then SWIOTLB is being utilized) and is the dma_sync_* done on the
> urb->transfer_dma (to properly sync the data from the SWIOTLB to the
> transfer_buffer) before you start using the urb->transfer_buffer?

Or calling dma_unmap_single.

Can you tell me all the exact process of DMA that the usb core and the
driver do?

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
  2010-05-11 14:24                                                                           ` Konrad Rzeszutek Wilk
  2010-05-11 14:38                                                                             ` FUJITA Tomonori
@ 2010-05-11 14:57                                                                             ` Alan Stern
  2010-05-11 15:05                                                                               ` Daniel Mack
  1 sibling, 1 reply; 221+ messages in thread
From: Alan Stern @ 2010-05-11 14:57 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk
  Cc: FUJITA Tomonori, USB list, tiwai, gregkh, clemens,
	Kernel development list, chrisw, iommu, andi, daniel, pedrib,
	Andrew Morton, dwmw2

On Tue, 11 May 2010, Konrad Rzeszutek Wilk wrote:

> > > > Either the data isn't getting written to the buffer correctly or else
> > > > the buffer isn't getting sent to the device correctly.  Can anybody
> > > > suggest a means of determining which is the case?
> > > 
> > > I can't say anything about this log that including only DMA addresses.
> > > I'm not familiar with how the USB core does DMA stuff. And the USB
> > > stack design that the USB core does DMA stuff (allocating, mappings,
> > > etc) makes debugging DMA issues really difficult.
> > 
> > The DMA stuff is simple enough in this case.  The urb->transfer_buffer
> > address is passed to dma_map_single(), and the DMA address it returns
> > is stored in urb->transfer_dma.  Those are the two values printed out
> > by the debugging patch.
> 
> Is that address (urb->transfer_dma) the same as 
'virt_to_phys(urb->transfer_buffer)'

I don't know.  We didn't print out the value of
virt_to_phys(urb->transfer_buffer).  All I can say is that
urb->transfer_dma is the value returned by dma_map_single().

> (if not, then SWIOTLB is being utilized) and is the dma_sync_* done on the
> urb->transfer_dma (to properly sync the data from the SWIOTLB to the
> transfer_buffer) before you start using the urb->transfer_buffer?

There are no calls to any dma_sync_* routines.  Daniel will have to
check me on this, but I believe that urb->transfer_buffer is filled
before dma_map_single() is called and it isn't touched again until
after dma_unmap_single() (which occurs before urb's completion handler
is called).

Alan Stern


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
  2010-05-11 14:38                                                                             ` FUJITA Tomonori
@ 2010-05-11 15:04                                                                                 ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-05-11 15:04 UTC (permalink / raw)
  To: FUJITA Tomonori
  Cc: konrad.wilk, alsa-devel, linux-usb, tiwai, gregkh, clemens,
	linux-kernel, chrisw, iommu, andi, daniel, pedrib, akpm, dwmw2

On Tue, 11 May 2010, FUJITA Tomonori wrote:

> On Tue, 11 May 2010 10:24:40 -0400
> Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> 
> > > > > Either the data isn't getting written to the buffer correctly or else
> > > > > the buffer isn't getting sent to the device correctly.  Can anybody
> > > > > suggest a means of determining which is the case?
> > > > 
> > > > I can't say anything about this log that including only DMA addresses.
> > > > I'm not familiar with how the USB core does DMA stuff. And the USB
> > > > stack design that the USB core does DMA stuff (allocating, mappings,
> > > > etc) makes debugging DMA issues really difficult.
> > > 
> > > The DMA stuff is simple enough in this case.  The urb->transfer_buffer
> > > address is passed to dma_map_single(), and the DMA address it returns
> > > is stored in urb->transfer_dma.  Those are the two values printed out
> > > by the debugging patch.
> > 
> > Is that address (urb->transfer_dma) the same as 'virt_to_phys(urb->transfer_buffer)'
> > (if not, then SWIOTLB is being utilized) and is the dma_sync_* done on the
> > urb->transfer_dma (to properly sync the data from the SWIOTLB to the
> > transfer_buffer) before you start using the urb->transfer_buffer?
> 
> Or calling dma_unmap_single.
> 
> Can you tell me all the exact process of DMA that the usb core and the
> driver do?

1. The audio driver stores data in urb->transfer_buffer.

2. The audio driver calls usb_submit_urb(urb).

3. The USB core does
		urb->transfer_dma = dma_map_single(controller, 
			urb->transfer_buffer,
			urb->transfer_buffer_length,
			DMA_TO_DEVICE);

4. The host controller driver tells the hardware to carry out the data 
   transfer.

5. When the hardware says the transfer is finished, the USB core does
		dma_unmap_single(controller,
			urb->transfer_dma,
			urb->transfer_buffer_length,
			DMA_TO_DEVICE);

6. The audio driver's completion handler is called:
		(urb->complete)(urb);

Alan Stern


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
@ 2010-05-11 15:04                                                                                 ` Alan Stern
  0 siblings, 0 replies; 221+ messages in thread
From: Alan Stern @ 2010-05-11 15:04 UTC (permalink / raw)
  To: FUJITA Tomonori
  Cc: konrad.wilk, alsa-devel, linux-usb, tiwai, gregkh, clemens,
	linux-kernel, chrisw, iommu, andi, daniel, pedrib, akpm, dwmw2

On Tue, 11 May 2010, FUJITA Tomonori wrote:

> On Tue, 11 May 2010 10:24:40 -0400
> Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> 
> > > > > Either the data isn't getting written to the buffer correctly or else
> > > > > the buffer isn't getting sent to the device correctly.  Can anybody
> > > > > suggest a means of determining which is the case?
> > > > 
> > > > I can't say anything about this log that including only DMA addresses.
> > > > I'm not familiar with how the USB core does DMA stuff. And the USB
> > > > stack design that the USB core does DMA stuff (allocating, mappings,
> > > > etc) makes debugging DMA issues really difficult.
> > > 
> > > The DMA stuff is simple enough in this case.  The urb->transfer_buffer
> > > address is passed to dma_map_single(), and the DMA address it returns
> > > is stored in urb->transfer_dma.  Those are the two values printed out
> > > by the debugging patch.
> > 
> > Is that address (urb->transfer_dma) the same as 'virt_to_phys(urb->transfer_buffer)'
> > (if not, then SWIOTLB is being utilized) and is the dma_sync_* done on the
> > urb->transfer_dma (to properly sync the data from the SWIOTLB to the
> > transfer_buffer) before you start using the urb->transfer_buffer?
> 
> Or calling dma_unmap_single.
> 
> Can you tell me all the exact process of DMA that the usb core and the
> driver do?

1. The audio driver stores data in urb->transfer_buffer.

2. The audio driver calls usb_submit_urb(urb).

3. The USB core does
		urb->transfer_dma = dma_map_single(controller, 
			urb->transfer_buffer,
			urb->transfer_buffer_length,
			DMA_TO_DEVICE);

4. The host controller driver tells the hardware to carry out the data 
   transfer.

5. When the hardware says the transfer is finished, the USB core does
		dma_unmap_single(controller,
			urb->transfer_dma,
			urb->transfer_buffer_length,
			DMA_TO_DEVICE);

6. The audio driver's completion handler is called:
		(urb->complete)(urb);

Alan Stern

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
  2010-05-11 14:57                                                                             ` Alan Stern
@ 2010-05-11 15:05                                                                               ` Daniel Mack
  0 siblings, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-05-11 15:05 UTC (permalink / raw)
  To: Alan Stern
  Cc: Konrad Rzeszutek Wilk, FUJITA Tomonori, USB list, tiwai, gregkh,
	clemens, Kernel development list, chrisw, iommu, andi, pedrib,
	Andrew Morton, dwmw2

On Tue, May 11, 2010 at 10:57:07AM -0400, Alan Stern wrote:
> There are no calls to any dma_sync_* routines.  Daniel will have to
> check me on this, but I believe that urb->transfer_buffer is filled
> before dma_map_single() is called and it isn't touched again until
> after dma_unmap_single() (which occurs before urb's completion handler
> is called).

Yes, that's correct. Sorry fot the misleading information I gave. The
code doesn't to any weird tricks as it currently stands. It fills the
buffer, submits the URB and doesn't touch the buffer contents
afterwards.

Daniel


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
  2010-05-11 15:04                                                                                 ` Alan Stern
  (?)
@ 2010-05-11 15:34                                                                                 ` FUJITA Tomonori
  2010-05-11 16:06                                                                                   ` Alan Stern
  -1 siblings, 1 reply; 221+ messages in thread
From: FUJITA Tomonori @ 2010-05-11 15:34 UTC (permalink / raw)
  To: stern
  Cc: fujita.tomonori, alsa-devel, gregkh, konrad.wilk, tiwai,
	linux-usb, clemens, linux-kernel, chrisw, iommu, andi, daniel,
	pedrib, akpm, dwmw2

On Tue, 11 May 2010 11:04:55 -0400 (EDT)
Alan Stern <stern@rowland.harvard.edu> wrote:

> On Tue, 11 May 2010, FUJITA Tomonori wrote:
> 
> > On Tue, 11 May 2010 10:24:40 -0400
> > Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> > 
> > > > > > Either the data isn't getting written to the buffer correctly or else
> > > > > > the buffer isn't getting sent to the device correctly.  Can anybody
> > > > > > suggest a means of determining which is the case?
> > > > > 
> > > > > I can't say anything about this log that including only DMA addresses.
> > > > > I'm not familiar with how the USB core does DMA stuff. And the USB
> > > > > stack design that the USB core does DMA stuff (allocating, mappings,
> > > > > etc) makes debugging DMA issues really difficult.
> > > > 
> > > > The DMA stuff is simple enough in this case.  The urb->transfer_buffer
> > > > address is passed to dma_map_single(), and the DMA address it returns
> > > > is stored in urb->transfer_dma.  Those are the two values printed out
> > > > by the debugging patch.
> > > 
> > > Is that address (urb->transfer_dma) the same as 'virt_to_phys(urb->transfer_buffer)'
> > > (if not, then SWIOTLB is being utilized) and is the dma_sync_* done on the
> > > urb->transfer_dma (to properly sync the data from the SWIOTLB to the
> > > transfer_buffer) before you start using the urb->transfer_buffer?
> > 
> > Or calling dma_unmap_single.
> > 
> > Can you tell me all the exact process of DMA that the usb core and the
> > driver do?
> 
> 1. The audio driver stores data in urb->transfer_buffer.

How urb->transfer_buffer is allocated?


> 2. The audio driver calls usb_submit_urb(urb).
> 
> 3. The USB core does
> 		urb->transfer_dma = dma_map_single(controller, 
> 			urb->transfer_buffer,
> 			urb->transfer_buffer_length,
> 			DMA_TO_DEVICE);

The mapping error is checked via dma_mapping_error? Even if an mapping
error happens, no data corruption happens due to that (needs
something like retrying the request)?


> 4. The host controller driver tells the hardware to carry out the data 
>    transfer.
> 
> 5. When the hardware says the transfer is finished, the USB core does
> 		dma_unmap_single(controller,
> 			urb->transfer_dma,
> 			urb->transfer_buffer_length,
> 			DMA_TO_DEVICE);
> 
> 6. The audio driver's completion handler is called:
> 		(urb->complete)(urb);

The driver does only DMA_TO_DEVICE? Or you see DMA problems only with
DMA_TO_DEVICE?

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
  2010-05-11 15:34                                                                                 ` FUJITA Tomonori
@ 2010-05-11 16:06                                                                                   ` Alan Stern
  2010-05-11 16:09                                                                                     ` Daniel Mack
  2010-05-11 16:48                                                                                     ` Pedro Ribeiro
  0 siblings, 2 replies; 221+ messages in thread
From: Alan Stern @ 2010-05-11 16:06 UTC (permalink / raw)
  To: FUJITA Tomonori
  Cc: gregkh, konrad.wilk, tiwai, USB list, clemens,
	Kernel development list, chrisw, iommu, andi, daniel, pedrib,
	Andrew Morton, dwmw2

On Wed, 12 May 2010, FUJITA Tomonori wrote:

> > > Can you tell me all the exact process of DMA that the usb core and the
> > > driver do?
> > 
> > 1. The audio driver stores data in urb->transfer_buffer.
> 
> How urb->transfer_buffer is allocated?

By kmalloc().  Right, Daniel?

> > 2. The audio driver calls usb_submit_urb(urb).
> > 
> > 3. The USB core does
> > 		urb->transfer_dma = dma_map_single(controller, 
> > 			urb->transfer_buffer,
> > 			urb->transfer_buffer_length,
> > 			DMA_TO_DEVICE);
> 
> The mapping error is checked via dma_mapping_error? Even if an mapping
> error happens, no data corruption happens due to that (needs
> something like retrying the request)?

Yes, we check dma_mapping_error().  If there's an error then the
submission fails, and presumably this failure would be logged by the
audio driver.

> > 4. The host controller driver tells the hardware to carry out the data 
> >    transfer.
> > 
> > 5. When the hardware says the transfer is finished, the USB core does
> > 		dma_unmap_single(controller,
> > 			urb->transfer_dma,
> > 			urb->transfer_buffer_length,
> > 			DMA_TO_DEVICE);
> > 
> > 6. The audio driver's completion handler is called:
> > 		(urb->complete)(urb);
> 
> The driver does only DMA_TO_DEVICE? Or you see DMA problems only with
> DMA_TO_DEVICE?

The particular test that Pedro is running uses audio output only -- 
he's sending sound data to a speaker and it comes out noisy.

But the audio data has to come from somewhere, and I don't remember 
where.  Pedro, does the noise occur only when you're playing sound that 
comes from a different USB device?  What happens if you play sounds 
that are stored on your hard disk, like an MP3 file?

Or what happens if you take the incoming sound data and store it in a 
disk file, and then later play that file out through the speaker?

Alan Stern


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
  2010-05-11 16:06                                                                                   ` Alan Stern
@ 2010-05-11 16:09                                                                                     ` Daniel Mack
  2010-05-11 16:48                                                                                     ` Pedro Ribeiro
  1 sibling, 0 replies; 221+ messages in thread
From: Daniel Mack @ 2010-05-11 16:09 UTC (permalink / raw)
  To: Alan Stern
  Cc: FUJITA Tomonori, gregkh, konrad.wilk, tiwai, USB list, clemens,
	Kernel development list, chrisw, iommu, andi, pedrib,
	Andrew Morton, dwmw2

On Tue, May 11, 2010 at 12:06:09PM -0400, Alan Stern wrote:
> On Wed, 12 May 2010, FUJITA Tomonori wrote:
> 
> > > > Can you tell me all the exact process of DMA that the usb core and the
> > > > driver do?
> > > 
> > > 1. The audio driver stores data in urb->transfer_buffer.
> > 
> > How urb->transfer_buffer is allocated?
> 
> By kmalloc().  Right, Daniel?

Yes, and that's precisely the reason for the whole thread ;)

[...]

> > The driver does only DMA_TO_DEVICE? Or you see DMA problems only with
> > DMA_TO_DEVICE?
> 
> The particular test that Pedro is running uses audio output only -- 
> he's sending sound data to a speaker and it comes out noisy.
> 
> But the audio data has to come from somewhere, and I don't remember 
> where.  Pedro, does the noise occur only when you're playing sound that 
> comes from a different USB device?  What happens if you play sounds 
> that are stored on your hard disk, like an MP3 file?

AFAIK that was playback from a file, yes. It would be interesting to
have some results for the other direction as well, that's true.

Thanks,
Daniel


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
  2010-05-11 16:06                                                                                   ` Alan Stern
  2010-05-11 16:09                                                                                     ` Daniel Mack
@ 2010-05-11 16:48                                                                                     ` Pedro Ribeiro
  2010-05-11 17:10                                                                                       ` Daniel Mack
  1 sibling, 1 reply; 221+ messages in thread
From: Pedro Ribeiro @ 2010-05-11 16:48 UTC (permalink / raw)
  To: Alan Stern
  Cc: FUJITA Tomonori, gregkh, konrad.wilk, tiwai, USB list, clemens,
	Kernel development list, chrisw, iommu, andi, daniel,
	Andrew Morton, dwmw2

On 11 May 2010 17:06, Alan Stern <stern@rowland.harvard.edu> wrote:
>
> The particular test that Pedro is running uses audio output only --
> he's sending sound data to a speaker and it comes out noisy.
>
> But the audio data has to come from somewhere, and I don't remember
> where.  Pedro, does the noise occur only when you're playing sound that
> comes from a different USB device?  What happens if you play sounds
> that are stored on your hard disk, like an MP3 file?

> Or what happens if you take the incoming sound data and store it in a
> disk file, and then later play that file out through the speaker?
>
> Alan Stern
>
>

I'm clueless about the whole underlying process but I don't think it
is related to playing a file from the disk or another USB device.

I don't need to play any file for this interference to be heard - I
just need to "open" the device. By this I mean that if I create a JACK
server or if I open the device using the ALSA backed in a program like
Mixxx I immediately start hearing the cracks and pops in the speaker.
But to answer your question, playing a file from the hard drive using
aplay I can also hear the interference - but only when the sound is
playing. As soon as the sound stops and the audio device is "closed",
no interference occurs.

However, when using the JACK server, which probably opens and polls
the audio card constantly (its a low latency audio server) I don't
even need to be playing any sound for the interference to be constant.

I can also see it since I have 4 output leds in the USB audio card and
even if I'm only using 2 channels, the 4 channel leds light up with
interference as the sound cracks and pops.

Regards,
Pedro

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
  2010-05-11 16:48                                                                                     ` Pedro Ribeiro
@ 2010-05-11 17:10                                                                                       ` Daniel Mack
  2010-05-11 17:32                                                                                         ` Pedro Ribeiro
  0 siblings, 1 reply; 221+ messages in thread
From: Daniel Mack @ 2010-05-11 17:10 UTC (permalink / raw)
  To: Pedro Ribeiro
  Cc: Alan Stern, FUJITA Tomonori, gregkh, konrad.wilk, tiwai,
	USB list, clemens, Kernel development list, chrisw, iommu, andi,
	Andrew Morton, dwmw2

On Tue, May 11, 2010 at 05:48:11PM +0100, Pedro Ribeiro wrote:
> I'm clueless about the whole underlying process but I don't think it
> is related to playing a file from the disk or another USB device.
> 
> I don't need to play any file for this interference to be heard - I
> just need to "open" the device. By this I mean that if I create a JACK

... which will stream zeros. Sure, that should also trigger the bug
then.

> server or if I open the device using the ALSA backed in a program like
> Mixxx I immediately start hearing the cracks and pops in the speaker.
> But to answer your question, playing a file from the hard drive using
> aplay I can also hear the interference - but only when the sound is
> playing. As soon as the sound stops and the audio device is "closed",
> no interference occurs.

Yes, because the stream is stopped, pending URBs are unlinked etc.
That's completely expected.

> However, when using the JACK server, which probably opens and polls
> the audio card constantly (its a low latency audio server) I don't
> even need to be playing any sound for the interference to be constant.

That shouldn't affect the driver itself but just put the ALSA core under
pressure.

> I can also see it since I have 4 output leds in the USB audio card and
> even if I'm only using 2 channels, the 4 channel leds light up with
> interference as the sound cracks and pops.

No surprise here. The 4 channels are mux'ed in an interleaved fashion,
so if the buffers contain rubbish, you will hear artefacts on all
channels.

Daniel


^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
  2010-05-11 17:10                                                                                       ` Daniel Mack
@ 2010-05-11 17:32                                                                                         ` Pedro Ribeiro
  2010-05-11 17:38                                                                                           ` Daniel Mack
  0 siblings, 1 reply; 221+ messages in thread
From: Pedro Ribeiro @ 2010-05-11 17:32 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Alan Stern, FUJITA Tomonori, gregkh, konrad.wilk, tiwai,
	USB list, clemens, Kernel development list, chrisw, iommu, andi,
	Andrew Morton, dwmw2

On 11 May 2010 18:10, Daniel Mack <daniel@caiaq.de> wrote:
> On Tue, May 11, 2010 at 05:48:11PM +0100, Pedro Ribeiro wrote:
>> I'm clueless about the whole underlying process but I don't think it
>> is related to playing a file from the disk or another USB device.
>>
>> I don't need to play any file for this interference to be heard - I
>> just need to "open" the device. By this I mean that if I create a JACK
>
> ... which will stream zeros. Sure, that should also trigger the bug
> then.
>
>> server or if I open the device using the ALSA backed in a program like
>> Mixxx I immediately start hearing the cracks and pops in the speaker.
>> But to answer your question, playing a file from the hard drive using
>> aplay I can also hear the interference - but only when the sound is
>> playing. As soon as the sound stops and the audio device is "closed",
>> no interference occurs.
>
> Yes, because the stream is stopped, pending URBs are unlinked etc.
> That's completely expected.
>
>> However, when using the JACK server, which probably opens and polls
>> the audio card constantly (its a low latency audio server) I don't
>> even need to be playing any sound for the interference to be constant.
>
> That shouldn't affect the driver itself but just put the ALSA core under
> pressure.
>
>> I can also see it since I have 4 output leds in the USB audio card and
>> even if I'm only using 2 channels, the 4 channel leds light up with
>> interference as the sound cracks and pops.
>
> No surprise here. The 4 channels are mux'ed in an interleaved fashion,
> so if the buffers contain rubbish, you will hear artefacts on all
> channels.
>
> Daniel
>
>

So what would be the testcase you would like me to try?

Pedro

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
  2010-05-11 17:32                                                                                         ` Pedro Ribeiro
@ 2010-05-11 17:38                                                                                           ` Daniel Mack
  2010-05-12 23:50                                                                                             ` Pedro Ribeiro
  0 siblings, 1 reply; 221+ messages in thread
From: Daniel Mack @ 2010-05-11 17:38 UTC (permalink / raw)
  To: Pedro Ribeiro
  Cc: Alan Stern, FUJITA Tomonori, gregkh, konrad.wilk, tiwai,
	USB list, clemens, Kernel development list, chrisw, iommu, andi,
	Andrew Morton, dwmw2

On Tue, May 11, 2010 at 06:32:50PM +0100, Pedro Ribeiro wrote:
> On 11 May 2010 18:10, Daniel Mack <daniel@caiaq.de> wrote:
> > No surprise here. The 4 channels are mux'ed in an interleaved fashion,
> > so if the buffers contain rubbish, you will hear artefacts on all
> > channels.
> 
> So what would be the testcase you would like me to try?

Would be good to see what happens if you could record audio (with
arecord would be sufficient), just to see whether the same problem
exists in the other direction.

Either record an externally generated sine tone and open the resulting
wave file in an editor. With the amount of artefacts you describe, they
should easily be visible.

Another option is to play back any kind of recorded audio thru an audio
device that does not show the problem (some internal, onboard device?).


Thanks,
Daniel

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
  2010-05-11 17:38                                                                                           ` Daniel Mack
@ 2010-05-12 23:50                                                                                             ` Pedro Ribeiro
  2010-05-13  9:36                                                                                               ` Daniel Mack
  0 siblings, 1 reply; 221+ messages in thread
From: Pedro Ribeiro @ 2010-05-12 23:50 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Alan Stern, FUJITA Tomonori, gregkh, konrad.wilk, tiwai,
	USB list, clemens, Kernel development list, chrisw, iommu, andi,
	Andrew Morton, dwmw2

On 11 May 2010 18:38, Daniel Mack <daniel@caiaq.de> wrote:
> On Tue, May 11, 2010 at 06:32:50PM +0100, Pedro Ribeiro wrote:
>> On 11 May 2010 18:10, Daniel Mack <daniel@caiaq.de> wrote:
>> > No surprise here. The 4 channels are mux'ed in an interleaved fashion,
>> > so if the buffers contain rubbish, you will hear artefacts on all
>> > channels.
>>
>> So what would be the testcase you would like me to try?
>
> Would be good to see what happens if you could record audio (with
> arecord would be sufficient), just to see whether the same problem
> exists in the other direction.
>
> Either record an externally generated sine tone and open the resulting
> wave file in an editor. With the amount of artefacts you describe, they
> should easily be visible.

Ok let me see if I got this straight:

I should record some sound with the audio card and see if it impacts
the recording? May take me a few days, I need to get a microphone or
something like that borrowed.

> Another option is to play back any kind of recorded audio thru an audio
> device that does not show the problem (some internal, onboard device?).
>

What do you mean by this? I didn't get it. I usually use my onboard
intel HDA for listening to music and have no problems.

> Thanks,
> Daniel
>

Pedro

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
  2010-05-12 23:50                                                                                             ` Pedro Ribeiro
@ 2010-05-13  9:36                                                                                               ` Daniel Mack
  2010-05-14  0:17                                                                                                 ` Pedro Ribeiro
  0 siblings, 1 reply; 221+ messages in thread
From: Daniel Mack @ 2010-05-13  9:36 UTC (permalink / raw)
  To: Pedro Ribeiro
  Cc: Alan Stern, FUJITA Tomonori, gregkh, konrad.wilk, tiwai,
	USB list, clemens, Kernel development list, chrisw, iommu, andi,
	Andrew Morton, dwmw2

On Thu, May 13, 2010 at 12:50:48AM +0100, Pedro Ribeiro wrote:
> On 11 May 2010 18:38, Daniel Mack <daniel@caiaq.de> wrote:
> > On Tue, May 11, 2010 at 06:32:50PM +0100, Pedro Ribeiro wrote:
> >> On 11 May 2010 18:10, Daniel Mack <daniel@caiaq.de> wrote:
> >> > No surprise here. The 4 channels are mux'ed in an interleaved fashion,
> >> > so if the buffers contain rubbish, you will hear artefacts on all
> >> > channels.
> >>
> >> So what would be the testcase you would like me to try?
> >
> > Would be good to see what happens if you could record audio (with
> > arecord would be sufficient), just to see whether the same problem
> > exists in the other direction.
> >
> > Either record an externally generated sine tone and open the resulting
> > wave file in an editor. With the amount of artefacts you describe, they
> > should easily be visible.
> 
> Ok let me see if I got this straight:
> 
> I should record some sound with the audio card and see if it impacts
> the recording? May take me a few days, I need to get a microphone or
> something like that borrowed.

Yes, exactly.

> > Another option is to play back any kind of recorded audio thru an audio
> > device that does not show the problem (some internal, onboard device?).
> >
> 
> What do you mean by this? I didn't get it. I usually use my onboard
> intel HDA for listening to music and have no problems.

I was just thinking of a way to judge whether the recording is affected.
And probably the best way is to listen to it :)

Daniel

^ permalink raw reply	[flat|nested] 221+ messages in thread

* Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems
  2010-05-13  9:36                                                                                               ` Daniel Mack
@ 2010-05-14  0:17                                                                                                 ` Pedro Ribeiro
  0 siblings, 0 replies; 221+ messages in thread
From: Pedro Ribeiro @ 2010-05-14  0:17 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Alan Stern, FUJITA Tomonori, gregkh, konrad.wilk, tiwai,
	USB list, clemens, Kernel development list, chrisw, iommu, andi,
	Andrew Morton, dwmw2

On 13 May 2010 10:36, Daniel Mack <daniel@caiaq.de> wrote:
> On Thu, May 13, 2010 at 12:50:48AM +0100, Pedro Ribeiro wrote:
>> On 11 May 2010 18:38, Daniel Mack <daniel@caiaq.de> wrote:
>> > On Tue, May 11, 2010 at 06:32:50PM +0100, Pedro Ribeiro wrote:
>> >> On 11 May 2010 18:10, Daniel Mack <daniel@caiaq.de> wrote:
>> >> > No surprise here. The 4 channels are mux'ed in an interleaved fashion,
>> >> > so if the buffers contain rubbish, you will hear artefacts on all
>> >> > channels.
>> >>
>> >> So what would be the testcase you would like me to try?
>> >
>> > Would be good to see what happens if you could record audio (with
>> > arecord would be sufficient), just to see whether the same problem
>> > exists in the other direction.
>> >
>> > Either record an externally generated sine tone and open the resulting
>> > wave file in an editor. With the amount of artefacts you describe, they
>> > should easily be visible.
>>
>> Ok let me see if I got this straight:
>>
>> I should record some sound with the audio card and see if it impacts
>> the recording? May take me a few days, I need to get a microphone or
>> something like that borrowed.
>
> Yes, exactly.
>
>> > Another option is to play back any kind of recorded audio thru an audio
>> > device that does not show the problem (some internal, onboard device?).
>> >
>>
>> What do you mean by this? I didn't get it. I usually use my onboard
>> intel HDA for listening to music and have no problems.
>
> I was just thinking of a way to judge whether the recording is affected.
> And probably the best way is to listen to it :)
>
> Daniel
>

Just tested it and nothing is happening on the input channels.
Actually as I said above, I can actually see the interference, and its
all across all 4 output channels (the leds light up) but not across
any input channel. A video speaks more, and I should have done it
before.

http://www.mediafire.com/file/gtqed3zjgd2/audio4dj-bug.ogg
(8 megs, 1 min, ogg theora)

Unfortunately I was too stupid to remember to do a close up, but those
4 leds you see lighting up are output channels 1,2,3,4. Input channels
1,2,3,4 are clean, nothing happens there. The other light that does
not flash is the USB status light.

Hope this helps!

Regards,
Pedro

^ permalink raw reply	[flat|nested] 221+ messages in thread

end of thread, other threads:[~2010-05-14  0:17 UTC | newest]

Thread overview: 221+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-07  9:06 USB transfer_buffer allocations on 64bit systems Daniel Mack
2010-04-07  9:06 ` Daniel Mack
     [not found] ` <p2g581ef6d61004070220z1153d40ez955b356e01220848@mail.gmail.com>
2010-04-07  9:26   ` USB HID gadget driver (was: Re: USB transfer_buffer allocations on 64bit systems) Daniel Mack
2010-04-07  9:26     ` Daniel Mack
2010-04-07 14:59 ` USB transfer_buffer allocations on 64bit systems Alan Stern
2010-04-07 14:59   ` Alan Stern
2010-04-07 15:11   ` Daniel Mack
2010-04-07 15:11     ` Daniel Mack
2010-04-07 15:31     ` Greg KH
2010-04-07 15:31       ` Greg KH
2010-04-07 15:35       ` Daniel Mack
2010-04-07 15:35         ` Daniel Mack
2010-04-07 15:51         ` Greg KH
2010-04-07 15:51           ` Greg KH
2010-04-07 16:04           ` Alan Stern
2010-04-07 16:04             ` Alan Stern
2010-04-08  6:09         ` Oliver Neukum
2010-04-08 11:07           ` Daniel Mack
2010-04-08 11:07             ` Daniel Mack
2010-04-07 15:55       ` Alan Stern
2010-04-07 15:55         ` Alan Stern
2010-04-07 16:16         ` Daniel Mack
2010-04-07 16:16           ` Daniel Mack
2010-04-07 16:47           ` Alan Stern
2010-04-07 16:47             ` Alan Stern
2010-04-07 17:55           ` Takashi Iwai
2010-04-07 17:55             ` Takashi Iwai
2010-04-07 17:59             ` Daniel Mack
2010-04-07 17:59               ` Daniel Mack
2010-04-07 18:06               ` Takashi Iwai
2010-04-07 18:06                 ` Takashi Iwai
2010-04-07 19:13             ` Alan Stern
2010-04-07 19:13               ` Alan Stern
2010-04-07 23:59               ` Robert Hancock
2010-04-07 23:59                 ` Robert Hancock
2010-04-08  0:33               ` Greg KH
2010-04-08  0:33                 ` Greg KH
2010-04-09  0:01                 ` Robert Hancock
2010-04-09 16:50                   ` Sarah Sharp
2010-04-09 16:50                     ` Sarah Sharp
2010-04-09 23:38                     ` Robert Hancock
2010-04-09 23:38                       ` Robert Hancock
2010-04-10  8:34                       ` [alsa-devel] " Daniel Mack
2010-04-10  8:34                         ` Daniel Mack
2010-04-10 17:02                         ` [alsa-devel] " Robert Hancock
2010-04-12 18:56                           ` Sarah Sharp
2010-04-12 20:39                             ` Robert Hancock
2010-04-12 20:39                               ` Robert Hancock
2010-04-12 20:58                               ` Sarah Sharp
2010-04-12 11:17               ` [PATCH] USB: rename usb_buffer_alloc() and usb_buffer_free() Daniel Mack
2010-04-12 11:17                 ` Daniel Mack
2010-04-13 18:16                 ` Daniel Mack
2010-04-13 18:16                   ` Daniel Mack
2010-04-13 19:27                   ` Alan Stern
2010-04-13 19:27                     ` Alan Stern
2010-04-13 20:26                     ` Greg KH
2010-04-13 21:47                       ` Daniel Mack
2010-04-13 21:47                         ` Daniel Mack
2010-04-07 17:52         ` USB transfer_buffer allocations on 64bit systems Takashi Iwai
2010-04-07 17:52           ` Takashi Iwai
2010-04-07 15:46     ` Alan Stern
2010-04-07 15:46       ` Alan Stern
2010-04-08  6:12       ` Oliver Neukum
2010-04-08 16:59         ` Alan Stern
2010-04-08 16:59           ` Alan Stern
2010-04-08 21:24           ` Oliver Neukum
2010-04-08 22:20             ` Alan Stern
2010-04-08 22:20               ` Alan Stern
2010-04-09  6:04               ` Oliver Neukum
2010-04-09 14:41                 ` Alan Stern
2010-04-09 14:41                   ` Alan Stern
2010-04-09 14:50                   ` Oliver Neukum
2010-04-09 14:50                     ` Oliver Neukum
2010-04-09 15:15                     ` Alan Stern
2010-04-09 15:15                       ` Alan Stern
2010-04-09 20:51                       ` Oliver Neukum
2010-04-09 20:51                         ` Oliver Neukum
2010-04-09 21:21                         ` Alan Stern
2010-04-09 21:21                           ` Alan Stern
2010-04-07 16:54   ` Oliver Neukum
2010-04-07 16:54     ` Oliver Neukum
2010-04-07 17:00     ` Daniel Mack
2010-04-07 17:00       ` Daniel Mack
2010-04-07 23:55   ` Robert Hancock
2010-04-07 23:55     ` Robert Hancock
2010-04-08  2:10     ` Alan Stern
2010-04-08  2:10       ` Alan Stern
2010-04-08  7:30       ` Daniel Mack
2010-04-08  7:30         ` Daniel Mack
2010-04-08 16:57         ` Alan Stern
2010-04-08 16:57           ` Alan Stern
2010-04-08 17:17           ` Pedro Ribeiro
2010-04-08 18:17             ` Alan Stern
2010-04-08 23:13           ` Pedro Ribeiro
2010-04-08 23:13             ` Pedro Ribeiro
2010-04-09 16:01             ` Alan Stern
2010-04-09 16:01               ` Alan Stern
2010-04-09 18:09               ` Daniel Mack
2010-04-09 18:19                 ` Pedro Ribeiro
2010-04-09 18:19                   ` Pedro Ribeiro
2010-04-09 19:34                   ` Alan Stern
2010-04-09 19:34                     ` Alan Stern
2010-04-09 20:14                     ` Daniel Mack
2010-04-09 20:14                       ` Daniel Mack
2010-04-09 20:25                     ` [LKML] " Konrad Rzeszutek Wilk
2010-04-09 20:25                       ` Konrad Rzeszutek Wilk
2010-04-09 21:23                       ` Alan Stern
2010-04-09 21:23                         ` Alan Stern
2010-04-09 22:11                         ` Robert Hancock
2010-04-12 10:48                           ` Daniel Mack
2010-04-12 10:48                             ` Daniel Mack
2010-04-12 12:06                             ` Pedro Ribeiro
2010-04-10 12:49                   ` Daniel Mack
2010-04-10 12:49                     ` Daniel Mack
2010-04-10 13:21                     ` Pedro Ribeiro
2010-04-10 13:21                       ` Pedro Ribeiro
2010-04-12  8:59   ` Andi Kleen
2010-04-12  8:59     ` Andi Kleen
2010-04-12 11:14     ` Daniel Mack
2010-04-12 11:14       ` Daniel Mack
2010-04-12 11:53       ` Andi Kleen
2010-04-12 11:53         ` Andi Kleen
2010-04-12 12:11         ` Pedro Ribeiro
2010-04-12 12:12           ` Andi Kleen
2010-04-12 12:12             ` Andi Kleen
2010-04-12 12:32             ` Daniel Mack
2010-04-12 12:47               ` Andi Kleen
2010-04-12 12:54                 ` Daniel Mack
2010-04-12 12:54                   ` Daniel Mack
2010-04-12 15:43                   ` Andi Kleen
2010-04-12 16:17                     ` Alan Stern
2010-04-12 16:17                       ` Alan Stern
2010-04-12 16:29                       ` Andi Kleen
2010-04-12 16:57                         ` Alan Stern
2010-04-12 16:57                           ` Alan Stern
2010-04-12 17:15                           ` Daniel Mack
2010-04-12 17:15                             ` Daniel Mack
2010-04-12 17:22                             ` Andi Kleen
2010-04-12 17:22                               ` Andi Kleen
2010-04-12 17:56                               ` Daniel Mack
2010-04-12 17:56                                 ` Daniel Mack
2010-04-12 17:52                             ` [LKML] " Konrad Rzeszutek Wilk
2010-04-12 17:52                               ` Konrad Rzeszutek Wilk
2010-04-13 18:22                           ` Daniel Mack
2010-04-13 18:22                             ` Daniel Mack
2010-04-13 23:46                             ` Pedro Ribeiro
2010-04-13 23:46                               ` Pedro Ribeiro
2010-04-14 10:09                               ` Daniel Mack
2010-04-14 10:09                                 ` Daniel Mack
2010-04-14 10:47                                 ` Pedro Ribeiro
2010-04-14 11:02                                   ` Pedro Ribeiro
2010-04-14 13:18                                   ` [LKML] " Konrad Rzeszutek Wilk
2010-04-14 14:08                                   ` Alan Stern
2010-04-14 14:08                                     ` Alan Stern
2010-04-14 16:36                                     ` Daniel Mack
2010-04-14 16:36                                       ` Daniel Mack
2010-04-14 17:21                                       ` Pedro Ribeiro
2010-04-14 17:21                                         ` Pedro Ribeiro
2010-04-14 18:23                                         ` Alan Stern
2010-04-14 18:27                                           ` Pedro Ribeiro
2010-04-14 18:53                                             ` Alan Stern
2010-04-15  7:35                                         ` Daniel Mack
2010-04-15  7:35                                           ` Daniel Mack
2010-04-14 18:15                                       ` Alan Stern
2010-04-14 18:36                                         ` David Woodhouse
2010-04-14 21:12                                           ` Pedro Ribeiro
2010-04-14 22:25                                             ` Chris Wright
2010-04-14 22:56                                               ` Pedro Ribeiro
2010-04-14 23:37                                                 ` Chris Wright
2010-04-15  1:20                                                   ` Pedro Ribeiro
2010-04-15 15:20                                                     ` Alan Stern
2010-04-20  0:16                                                       ` Pedro Ribeiro
2010-05-07  7:48                                                         ` Daniel Mack
2010-05-07  7:48                                                           ` Daniel Mack
2010-05-07  9:47                                                           ` [alsa-devel] " Clemens Ladisch
2010-05-07  9:47                                                             ` Clemens Ladisch
2010-05-07 10:24                                                             ` [alsa-devel] " Daniel Mack
2010-05-07 10:24                                                               ` Daniel Mack
2010-05-07 14:51                                                               ` [alsa-devel] " Alan Stern
2010-05-07 14:51                                                                 ` Alan Stern
2010-05-10  2:50                                                                 ` FUJITA Tomonori
2010-05-10  9:21                                                                   ` David Woodhouse
2010-05-10  9:21                                                                     ` David Woodhouse
2010-05-10 14:58                                                                     ` [alsa-devel] " Alan Stern
2010-05-10 14:58                                                                       ` Alan Stern
2010-05-11  1:06                                                                       ` FUJITA Tomonori
2010-05-11  1:06                                                                         ` FUJITA Tomonori
2010-05-11 14:00                                                                         ` Alan Stern
2010-05-11 14:00                                                                           ` Alan Stern
2010-05-11 14:22                                                                           ` FUJITA Tomonori
2010-05-11 14:24                                                                           ` Konrad Rzeszutek Wilk
2010-05-11 14:38                                                                             ` FUJITA Tomonori
2010-05-11 15:04                                                                               ` Alan Stern
2010-05-11 15:04                                                                                 ` Alan Stern
2010-05-11 15:34                                                                                 ` FUJITA Tomonori
2010-05-11 16:06                                                                                   ` Alan Stern
2010-05-11 16:09                                                                                     ` Daniel Mack
2010-05-11 16:48                                                                                     ` Pedro Ribeiro
2010-05-11 17:10                                                                                       ` Daniel Mack
2010-05-11 17:32                                                                                         ` Pedro Ribeiro
2010-05-11 17:38                                                                                           ` Daniel Mack
2010-05-12 23:50                                                                                             ` Pedro Ribeiro
2010-05-13  9:36                                                                                               ` Daniel Mack
2010-05-14  0:17                                                                                                 ` Pedro Ribeiro
2010-05-11 14:57                                                                             ` Alan Stern
2010-05-11 15:05                                                                               ` Daniel Mack
2010-05-10 14:31                                                               ` Konrad Rzeszutek Wilk
2010-05-10 14:31                                                                 ` Konrad Rzeszutek Wilk
2010-05-07 11:42                                                             ` Oliver Neukum
2010-05-07 11:42                                                               ` Oliver Neukum
2010-05-07 11:47                                                               ` Oliver Neukum
2010-05-07 11:47                                                                 ` Oliver Neukum
2010-05-07 11:58                                                                 ` Daniel Mack
2010-05-07 11:58                                                                   ` Daniel Mack
2010-05-07 14:45                                                                   ` [alsa-devel] " Alan Stern
2010-05-07 14:45                                                                     ` Alan Stern
2010-04-14 18:38                                         ` Chris Wright
2010-04-14 20:29                                           ` Alan Stern
2010-04-14 21:01                                             ` Konrad Rzeszutek Wilk
2010-04-14 21:12                                               ` Pedro Ribeiro
2010-04-15  1:50                                                 ` Alan Stern

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.