Re: USB contigmalloc()

2011-12-02 Thread Christoph Egger

On 12/02/11 10:20, matthew green wrote:

On Fri, Dec 02, 2011 at 01:51:42AM +0900, Izumi Tsutsui wrote:

Anyway, currently our udl(4) doesn't require such allocation,


It's also a problem for radeondrm (no USB involved).


freebsd implemented a different fix for this, which i think involved
using the VM system directly and supporting SG properly, but i never
got around to looking at the code directly.

i keep considering adding a hack to radeondrm to not free the dma
ram on last close() so that restarts work (but starting for the
first time later may fail) but if someone wants to fix it properly
befire i do that, i'd not complain.


jmorse@ wrote a patch which implements support for multiple segments:
http://www.netbsd.org/~cegger/usb.diff

Christoph


re: USB contigmalloc()

2011-12-02 Thread matthew green

> On Fri, Dec 02, 2011 at 01:51:42AM +0900, Izumi Tsutsui wrote:
> > Anyway, currently our udl(4) doesn't require such allocation,
> 
> It's also a problem for radeondrm (no USB involved).

freebsd implemented a different fix for this, which i think involved
using the VM system directly and supporting SG properly, but i never
got around to looking at the code directly.

i keep considering adding a hack to radeondrm to not free the dma
ram on last close() so that restarts work (but starting for the
first time later may fail) but if someone wants to fix it properly
befire i do that, i'd not complain.



.mrg.


Re: USB contigmalloc()

2011-12-01 Thread Thomas Klausner
On Fri, Dec 02, 2011 at 01:51:42AM +0900, Izumi Tsutsui wrote:
> Anyway, currently our udl(4) doesn't require such allocation,

It's also a problem for radeondrm (no USB involved).
 Thomas


Re: USB contigmalloc()

2011-12-01 Thread Francois Tigeot
On Thu, Dec 01, 2011 at 05:11:36PM +, Jonathan A. Kollasch wrote:
> On Thu, Dec 01, 2011 at 05:33:27PM +0100, Thomas Klausner wrote:
> > Matthew Dillon implemented a solution for USB/graphics cards problem
> > stemming from the fact that some time after the boot, they can't
> > acquire enough contiguous memory.
> 
> It's really Not Good Enough.  These drivers really need to grow proper
> scatter/gather support.

Iirc, contigmalloc was implemented mainly for the radeon drm driver

-- 
Francois Tigeot


Re: USB contigmalloc()

2011-12-01 Thread Jonathan A. Kollasch
On Thu, Dec 01, 2011 at 05:33:27PM +0100, Thomas Klausner wrote:
> Matthew Dillon implemented a solution for USB/graphics cards problem
> stemming from the fact that some time after the boot, they can't
> acquire enough contiguous memory.
> 
> http://thread.gmane.org/gmane.os.dragonfly-bsd.kernel/14431
> 
> Anyone interested in porting it or implementing something similar? :)
>  Thomas

We have it in the USB stack already.  Though some cardbus and pci drivers
still could use something similar.

It's really Not Good Enough.  These drivers really need to grow proper
scatter/gather support.

Jonathan Kollasch


Re: USB contigmalloc()

2011-12-01 Thread Izumi Tsutsui
wiz@ wrote:

> Matthew Dillon implemented a solution for USB/graphics cards problem
> stemming from the fact that some time after the boot, they can't
> acquire enough contiguous memory.
> 
> http://thread.gmane.org/gmane.os.dragonfly-bsd.kernel/14431
> 
> Anyone interested in porting it or implementing something similar? :)

I think allocating physically contiguous large memory is a bad design
and I doubt reserving 16MB physical memory at boot time is acceptable
for all machines with USB.

Anyway, currently our udl(4) doesn't require such allocation,
but has more other problems:
http://cvsweb.NetBSD.org/bsdweb.cgi/src/sys/dev/usb/udl.c#rev1.1

---
Izumi Tsutsui


Re: USB contigmalloc()

2011-12-01 Thread Adam Hoka
On 12/1/2011 5:33 PM, Thomas Klausner wrote:
> Matthew Dillon implemented a solution for USB/graphics cards problem
> stemming from the fact that some time after the boot, they can't
> acquire enough contiguous memory.
> 
> http://thread.gmane.org/gmane.os.dragonfly-bsd.kernel/14431
> 
> Anyone interested in porting it or implementing something similar? :)
>  Thomas

Do we have the problem?



USB contigmalloc()

2011-12-01 Thread Thomas Klausner
Matthew Dillon implemented a solution for USB/graphics cards problem
stemming from the fact that some time after the boot, they can't
acquire enough contiguous memory.

http://thread.gmane.org/gmane.os.dragonfly-bsd.kernel/14431

Anyone interested in porting it or implementing something similar? :)
 Thomas