Re: USB2 patches

2009-02-01 Thread Hans Petter Selasky
Hi Andrew, We need to go through your patches together, to work out some issues. 1) A nit. - if (usb2_proc_setup(ssc-sc_config_td, p_mtx, USB_PRI_MED)) { - usb2_com_units_free(root_unit, sub_units); - return (ENOMEM); - } + + error =

RE: USB2 patches

2009-02-01 Thread Thomas Sparrevohn
Perlstein Sent: 01 February 2009 03:06 To: Andrew Thompson Cc: freebsd-usb@freebsd.org Subject: Re: USB2 patches I'll defer to Hans if he feels confident or not about this. For what it's worth, we're about to switch GENERIC to use usb4bsd. -Alfred * Andrew Thompson thom...@freebsd.org [090131 15:20

Re: USB2 patches

2009-02-01 Thread Hans Petter Selasky
Hi Andrew, First of all thanks for helping out. I will spend some time now to go through your changes. One thing about the taskqueue. How does it work? I mean, if multiple events gets queued on the same handler, how will the events get executed? In parallell, in serial. I never fully

Re: USB2 patches

2009-02-01 Thread M. Warner Losh
In message: 200902011123.47690.hsela...@c2i.net Hans Petter Selasky hsela...@c2i.net writes: : Hi Andrew, : : First of all thanks for helping out. I will spend some time now to go through : your changes. : : One thing about the taskqueue. How does it work? I mean, if multiple events

Re: USB2 patches

2009-02-01 Thread Andrew Thompson
On Sun, Feb 01, 2009 at 12:20:17PM +0100, Hans Petter Selasky wrote: Hi Andrew, We need to go through your patches together, to work out some issues. 1) A nit. - if (usb2_proc_setup(ssc-sc_config_td, p_mtx, USB_PRI_MED)) { - usb2_com_units_free(root_unit, sub_units); -

Re: USB2 patches

2009-02-01 Thread Hans Petter Selasky
Hi Andrew, On Sunday 01 February 2009, Andrew Thompson wrote: 2) Please explain why you think that usb2_proc_is_gone() can be removed. - if (usb2_proc_is_gone(ssc-sc_config_td)) { - DPRINTF(proc is gone\n); - return; /* nothing to do */ - } If

Re: USB2 patches

2009-02-01 Thread Hans Petter Selasky
Hi Warner, On Sunday 01 February 2009, M. Warner Losh wrote: In message: 20090201175021.ga32...@citylink.fud.org.nz Andrew Thompson thom...@freebsd.org writes: The only way that a 'deferred attach' makes sense is if the ifnet and other external resources are setup as part of

Re: USB2 patches

2009-02-01 Thread Hans Petter Selasky
On Sunday 01 February 2009, M. Warner Losh wrote: In message: 200902011922.16810.hsela...@c2i.net Hans Petter Selasky hsela...@c2i.net writes: : In your patch you remove all error checking! If the taskqueue system does : not have an API function that can tell if the taskqueue is

Re: USB2 patches

2009-02-01 Thread M. Warner Losh
In message: 200902011937.32679.hsela...@c2i.net Hans Petter Selasky hsela...@c2i.net writes: : Hi Warner, : : On Sunday 01 February 2009, M. Warner Losh wrote: : In message: 20090201175021.ga32...@citylink.fud.org.nz : : Andrew Thompson thom...@freebsd.org writes: : :

Re: USB2 patches

2009-02-01 Thread Hans Petter Selasky
Hi Andrew, Regarding using taskqueues. Yes - USB2 can use taskqueues, but I would very much like to have the original queueing mechanism intact. How about: struct task * tasqueue_enqueue_pair(struct taskqueue *queue, struct task *t0, struct task *t1); Which does something similar to this:

Re: USB2 patches

2009-02-01 Thread Andrew Thompson
On Sun, Feb 01, 2009 at 07:22:15PM +0100, Hans Petter Selasky wrote: Hi Andrew, 3) In general avoid more than a few synchronous USB transfer inside attach/detach. Always defer! Else there are corner cases where the device can hang waiting for the transfer timeout 1-5 seconds for

Re: USB2 patches

2009-02-01 Thread Hans Petter Selasky
Hi Andrew, On Sunday 01 February 2009, Andrew Thompson wrote: On Sun, Feb 01, 2009 at 07:22:15PM +0100, Hans Petter Selasky wrote: The code should be, That's what I'm doing already ... I pre-copy all channel bssid stuff into a message structure ... xxx_set_channel() {

Re: USB2 patches

2009-02-01 Thread Andrew Thompson
On Sun, Feb 01, 2009 at 08:01:05PM +0100, Hans Petter Selasky wrote: Hi Andrew, Regarding using taskqueues. Yes - USB2 can use taskqueues, but I would very much like to have the original queueing mechanism intact. Can you explain this further? What is t0 vs t1? A taskqueue will

Re: USB2 patches

2009-02-01 Thread Andrew Thompson
On Sun, Feb 01, 2009 at 07:22:15PM +0100, Hans Petter Selasky wrote: If you compare the old USB code with the new USB code for if_zyd for example you see that there are dozens of error checks everywhere: if (error != 0) goto fail; In the new USB code I've factored out all those

Re: USB2 patches

2009-02-01 Thread Hans Petter Selasky
On Sunday 01 February 2009, Andrew Thompson wrote: On Sun, Feb 01, 2009 at 08:01:05PM +0100, Hans Petter Selasky wrote: Hi Andrew, Regarding using taskqueues. Yes - USB2 can use taskqueues, but I would very much like to have the original queueing mechanism intact. Can you explain

Re: USB2 patches

2009-02-01 Thread M. Warner Losh
In message: 20090201191851.ge32...@citylink.fud.org.nz Andrew Thompson thom...@freebsd.org writes: : xxx_set_channel() : { : ieee80211_channel c = wlan-curchan; : : hw_reg = array1[c]; : write USB register; : hw_reg = array2[c]; : write USB register; : } :

Re: USB2 patches

2009-02-01 Thread Andrew Thompson
On Sun, Feb 01, 2009 at 08:31:55PM +0100, Hans Petter Selasky wrote: On Sunday 01 February 2009, Andrew Thompson wrote: On Sun, Feb 01, 2009 at 08:01:05PM +0100, Hans Petter Selasky wrote: Hi Andrew, Regarding using taskqueues. Yes - USB2 can use taskqueues, but I would very much

Re: USB2 patches

2009-02-01 Thread Hans Petter Selasky
Hi Warner, : Hi Andrew, : : I've looked in the taskqueue code: : : if (task-ta_pending) { : task-ta_pending++; : TQ_UNLOCK(queue); : return 0; : } : : Take the following for example. Now you changed it a little bit, but I

Re: USB2 patches

2009-02-01 Thread M. Warner Losh
In message: 200902012031.56899.hsela...@c2i.net Hans Petter Selasky hsela...@c2i.net writes: : On Sunday 01 February 2009, Andrew Thompson wrote: : On Sun, Feb 01, 2009 at 08:01:05PM +0100, Hans Petter Selasky wrote: : Hi Andrew, : : Regarding using taskqueues. : : Yes -

Re: USB2 patches

2009-02-01 Thread Hans Petter Selasky
Hi Andrew, This is not correct. The queuing mechanism in USB2 guarantees that the last queued command is last executed: There are a few options, - coalesce on a single task (on,off,on = on), the off never happened. - drain the task first then resubmit Those cover both scenarios,

Re: USB2 patches

2009-02-01 Thread Alfred Perlstein
Subject: Re: USB2 patches I'll defer to Hans if he feels confident or not about this. For what it's worth, we're about to switch GENERIC to use usb4bsd. -Alfred * Andrew Thompson thom...@freebsd.org [090131 15:20] wrote: Hi, I have several patches in my svn user branch that I

Re: USB2 patches

2009-02-01 Thread Chris Ruiz
2009 03:06 To: Andrew Thompson Cc: freebsd-usb@freebsd.org Subject: Re: USB2 patches I'll defer to Hans if he feels confident or not about this. For what it's worth, we're about to switch GENERIC to use usb4bsd. -Alfred * Andrew Thompson thom...@freebsd.org [090131 15:20] wrote: Hi, I have

Re: USB2 patches

2009-02-01 Thread Andrew Thompson
On Sun, Feb 01, 2009 at 07:38:47PM +0100, Hans Petter Selasky wrote: On Sunday 01 February 2009, M. Warner Losh wrote: In message: 200902011922.16810.hsela...@c2i.net Hans Petter Selasky hsela...@c2i.net writes: : In your patch you remove all error checking! If the taskqueue

USB2 patches

2009-01-31 Thread Andrew Thompson
Hi, I have several patches in my svn user branch that I would like to see committed to HEAD. Some of these change the usb2 core code so I am interested in feedback or shootdowns. I am right behind the change to USB2 and this is an effort to help. The patch can be found here,

Re: USB2 patches

2009-01-31 Thread Alfred Perlstein
I'll defer to Hans if he feels confident or not about this. For what it's worth, we're about to switch GENERIC to use usb4bsd. -Alfred * Andrew Thompson thom...@freebsd.org [090131 15:20] wrote: Hi, I have several patches in my svn user branch that I would like to see committed to HEAD.

Re: USB2 patches

2009-01-31 Thread M. Warner Losh
In message: 20090201030628.ge65...@elvis.mu.org Alfred Perlstein alf...@freebsd.org writes: : I'll defer to Hans if he feels confident or not about this. These changes all look good to me : For what it's worth, we're about to switch GENERIC to use : usb4bsd. Moving files or just

Re: USB2 patches

2009-01-31 Thread M. Warner Losh
In message: 20090201033641.gg65...@elvis.mu.org Alfred Perlstein alf...@freebsd.org writes: : * M. Warner Losh i...@bsdimp.com [090131 19:33] wrote: : In message: 20090201030628.ge65...@elvis.mu.org : Alfred Perlstein alf...@freebsd.org writes: : : I'll defer to Hans if