From owner-freebsd-usb@FreeBSD.ORG Sun Feb 1 03:22:28 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2528106578B for ; Sun, 1 Feb 2009 03:22:28 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id A0FD98FC17 for ; Sun, 1 Feb 2009 03:22:28 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id 5C50F1A3C39; Sat, 31 Jan 2009 19:06:28 -0800 (PST) Date: Sat, 31 Jan 2009 19:06:28 -0800 From: Alfred Perlstein To: Andrew Thompson Message-ID: <20090201030628.GE65558@elvis.mu.org> References: <20090131231957.GB31825@citylink.fud.org.nz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090131231957.GB31825@citylink.fud.org.nz> User-Agent: Mutt/1.4.2.3i Cc: freebsd-usb@freebsd.org Subject: Re: USB2 patches X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2009 03:22:28 -0000 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 [090131 15:20] wrote: > 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, > http://people.freebsd.org/~thompsa/usb_head1.diff > 73 files changed, 9229 insertions(+), 13261 deletions(-) > > but its rather large so it may be easier to look at the various changes > via the svn web interface. > > http://svn.freebsd.org/viewvc/base/user/thompsa/usb/ > > > r187750 > http://svn.freebsd.org/viewvc/base?view=revision&revision=187750 > > Change over to using taskqueue(9) instead of hand rolled threads and > the config_td system. This removes the config_td code and makes the > API much simpler to use. > > r187751, r187752, r187753, r187754, r187755, r187756 > http://svn.freebsd.org/viewvc/base?view=revision&revision=187751 > > Change over to usb2_proc w/ taskqueues for the usb2/ethernet, > usb2/serial and usb2/wlan code. > > r187965 > http://svn.freebsd.org/viewvc/base?view=revision&revision=187965 > > Move most of the ifnet logic into the usb2_ethernet module, this includes, > - make all usb ethernet interfaces named ue%d > - handle all threading in usb2_ethernet > - provide default ioctl handler > - handle mbuf rx > - provide locked callbacks for init,start,stop,etc > > The drivers are not much more than data pushers now. > > > regards, > Andrew -- - Alfred Perlstein From owner-freebsd-usb@FreeBSD.ORG Sun Feb 1 03:33:04 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2CE81065680; Sun, 1 Feb 2009 03:33:03 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 9591B8FC1B; Sun, 1 Feb 2009 03:33:03 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n113UxJe078433; Sat, 31 Jan 2009 20:30:59 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sat, 31 Jan 2009 20:31:27 -0700 (MST) Message-Id: <20090131.203127.-697376386.imp@bsdimp.com> To: alfred@freebsd.org From: "M. Warner Losh" In-Reply-To: <20090201030628.GE65558@elvis.mu.org> References: <20090131231957.GB31825@citylink.fud.org.nz> <20090201030628.GE65558@elvis.mu.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-usb@freebsd.org, thompsa@freebsd.org Subject: Re: USB2 patches X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2009 03:33:04 -0000 In message: <20090201030628.GE65558@elvis.mu.org> Alfred Perlstein 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 changing names... Warner : -Alfred : : * Andrew Thompson [090131 15:20] wrote: : > 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, : > http://people.freebsd.org/~thompsa/usb_head1.diff : > 73 files changed, 9229 insertions(+), 13261 deletions(-) : > : > but its rather large so it may be easier to look at the various changes : > via the svn web interface. : > : > http://svn.freebsd.org/viewvc/base/user/thompsa/usb/ : > : > : > r187750 : > http://svn.freebsd.org/viewvc/base?view=revision&revision=187750 : > : > Change over to using taskqueue(9) instead of hand rolled threads and : > the config_td system. This removes the config_td code and makes the : > API much simpler to use. : > : > r187751, r187752, r187753, r187754, r187755, r187756 : > http://svn.freebsd.org/viewvc/base?view=revision&revision=187751 : > : > Change over to usb2_proc w/ taskqueues for the usb2/ethernet, : > usb2/serial and usb2/wlan code. : > : > r187965 : > http://svn.freebsd.org/viewvc/base?view=revision&revision=187965 : > : > Move most of the ifnet logic into the usb2_ethernet module, this includes, : > - make all usb ethernet interfaces named ue%d : > - handle all threading in usb2_ethernet : > - provide default ioctl handler : > - handle mbuf rx : > - provide locked callbacks for init,start,stop,etc : > : > The drivers are not much more than data pushers now. : > : > : > regards, : > Andrew : : -- : - Alfred Perlstein : _______________________________________________ : freebsd-usb@freebsd.org mailing list : http://lists.freebsd.org/mailman/listinfo/freebsd-usb : To unsubscribe, send any mail to "freebsd-usb-unsubscribe@freebsd.org" : : From owner-freebsd-usb@FreeBSD.ORG Sun Feb 1 03:36:41 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F03D810656E4; Sun, 1 Feb 2009 03:36:41 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id DD1B78FC13; Sun, 1 Feb 2009 03:36:41 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id A2C8C1A3C39; Sat, 31 Jan 2009 19:36:41 -0800 (PST) Date: Sat, 31 Jan 2009 19:36:41 -0800 From: Alfred Perlstein To: "M. Warner Losh" Message-ID: <20090201033641.GG65558@elvis.mu.org> References: <20090131231957.GB31825@citylink.fud.org.nz> <20090201030628.GE65558@elvis.mu.org> <20090131.203127.-697376386.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090131.203127.-697376386.imp@bsdimp.com> User-Agent: Mutt/1.4.2.3i Cc: freebsd-usb@freebsd.org, thompsa@freebsd.org Subject: Re: USB2 patches X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2009 03:36:42 -0000 * M. Warner Losh [090131 19:33] wrote: > In message: <20090201030628.GE65558@elvis.mu.org> > Alfred Perlstein 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 changing names... Changing the default kernel configs only. A few/several weeks later we will rename over the old if all goes well. -Alfred > > Warner > > : -Alfred > : > : * Andrew Thompson [090131 15:20] wrote: > : > 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, > : > http://people.freebsd.org/~thompsa/usb_head1.diff > : > 73 files changed, 9229 insertions(+), 13261 deletions(-) > : > > : > but its rather large so it may be easier to look at the various changes > : > via the svn web interface. > : > > : > http://svn.freebsd.org/viewvc/base/user/thompsa/usb/ > : > > : > > : > r187750 > : > http://svn.freebsd.org/viewvc/base?view=revision&revision=187750 > : > > : > Change over to using taskqueue(9) instead of hand rolled threads and > : > the config_td system. This removes the config_td code and makes the > : > API much simpler to use. > : > > : > r187751, r187752, r187753, r187754, r187755, r187756 > : > http://svn.freebsd.org/viewvc/base?view=revision&revision=187751 > : > > : > Change over to usb2_proc w/ taskqueues for the usb2/ethernet, > : > usb2/serial and usb2/wlan code. > : > > : > r187965 > : > http://svn.freebsd.org/viewvc/base?view=revision&revision=187965 > : > > : > Move most of the ifnet logic into the usb2_ethernet module, this includes, > : > - make all usb ethernet interfaces named ue%d > : > - handle all threading in usb2_ethernet > : > - provide default ioctl handler > : > - handle mbuf rx > : > - provide locked callbacks for init,start,stop,etc > : > > : > The drivers are not much more than data pushers now. > : > > : > > : > regards, > : > Andrew > : > : -- > : - Alfred Perlstein > : _______________________________________________ > : freebsd-usb@freebsd.org mailing list > : http://lists.freebsd.org/mailman/listinfo/freebsd-usb > : To unsubscribe, send any mail to "freebsd-usb-unsubscribe@freebsd.org" > : > : -- - Alfred Perlstein From owner-freebsd-usb@FreeBSD.ORG Sun Feb 1 04:15:11 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EE6310656C6; Sun, 1 Feb 2009 04:15:11 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 4E0908FC0A; Sun, 1 Feb 2009 04:15:11 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n114Dgpt078760; Sat, 31 Jan 2009 21:13:42 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sat, 31 Jan 2009 21:14:10 -0700 (MST) Message-Id: <20090131.211410.2138992963.imp@bsdimp.com> To: alfred@freebsd.org From: "M. Warner Losh" In-Reply-To: <20090201033641.GG65558@elvis.mu.org> References: <20090201030628.GE65558@elvis.mu.org> <20090131.203127.-697376386.imp@bsdimp.com> <20090201033641.GG65558@elvis.mu.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-usb@freebsd.org, thompsa@freebsd.org Subject: Re: USB2 patches X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2009 04:15:11 -0000 In message: <20090201033641.GG65558@elvis.mu.org> Alfred Perlstein writes: : * M. Warner Losh [090131 19:33] wrote: : > In message: <20090201030628.GE65558@elvis.mu.org> : > Alfred Perlstein 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 changing names... : : Changing the default kernel configs only. : : A few/several weeks later we will rename over the old if all : goes well. Sounds good. I assume you'll be coordinating with Andrew to make sure that he doesn't have any changes in flight, or can cope with the ones he does? Warner : > Warner : > : > : -Alfred : > : : > : * Andrew Thompson [090131 15:20] wrote: : > : > 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, : > : > http://people.freebsd.org/~thompsa/usb_head1.diff : > : > 73 files changed, 9229 insertions(+), 13261 deletions(-) : > : > : > : > but its rather large so it may be easier to look at the various changes : > : > via the svn web interface. : > : > : > : > http://svn.freebsd.org/viewvc/base/user/thompsa/usb/ : > : > : > : > : > : > r187750 : > : > http://svn.freebsd.org/viewvc/base?view=revision&revision=187750 : > : > : > : > Change over to using taskqueue(9) instead of hand rolled threads and : > : > the config_td system. This removes the config_td code and makes the : > : > API much simpler to use. : > : > : > : > r187751, r187752, r187753, r187754, r187755, r187756 : > : > http://svn.freebsd.org/viewvc/base?view=revision&revision=187751 : > : > : > : > Change over to usb2_proc w/ taskqueues for the usb2/ethernet, : > : > usb2/serial and usb2/wlan code. : > : > : > : > r187965 : > : > http://svn.freebsd.org/viewvc/base?view=revision&revision=187965 : > : > : > : > Move most of the ifnet logic into the usb2_ethernet module, this includes, : > : > - make all usb ethernet interfaces named ue%d : > : > - handle all threading in usb2_ethernet : > : > - provide default ioctl handler : > : > - handle mbuf rx : > : > - provide locked callbacks for init,start,stop,etc : > : > : > : > The drivers are not much more than data pushers now. : > : > : > : > : > : > regards, : > : > Andrew : > : : > : -- : > : - Alfred Perlstein : > : _______________________________________________ : > : freebsd-usb@freebsd.org mailing list : > : http://lists.freebsd.org/mailman/listinfo/freebsd-usb : > : To unsubscribe, send any mail to "freebsd-usb-unsubscribe@freebsd.org" : > : : > : : : -- : - Alfred Perlstein : : From owner-freebsd-usb@FreeBSD.ORG Sun Feb 1 10:21:23 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D5C2106564A; Sun, 1 Feb 2009 10:21:23 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe06.swip.net [212.247.154.161]) by mx1.freebsd.org (Postfix) with ESMTP id 950C88FC1D; Sun, 1 Feb 2009 10:21:22 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=6I5d2MoRAAAA:8 a=AAb-Tk7DzNtI7UY2Z7gA:9 a=O6p158yIKaIBwoa3wYMA:7 a=OOt9T3acqCyszXsQwi0banB0NEgA:4 a=50e4U0PicR4A:10 Received: from [85.19.218.115] (account mc467741@c2i.net HELO [10.37.1.92]) by mailfe06.swip.net (CommuniGate Pro SMTP 5.2.6) with ESMTPA id 1189899298; Sun, 01 Feb 2009 11:21:20 +0100 From: Hans Petter Selasky To: Andrew Thompson Date: Sun, 1 Feb 2009 11:23:46 +0100 User-Agent: KMail/1.9.7 References: <20090131231957.GB31825@citylink.fud.org.nz> In-Reply-To: <20090131231957.GB31825@citylink.fud.org.nz> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902011123.47690.hselasky@c2i.net> Cc: freebsd-usb@freebsd.org Subject: Re: USB2 patches X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2009 10:21:23 -0000 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 understood that. --HPS On Sunday 01 February 2009, Andrew Thompson wrote: > 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, > http://people.freebsd.org/~thompsa/usb_head1.diff > 73 files changed, 9229 insertions(+), 13261 deletions(-) > > but its rather large so it may be easier to look at the various changes > via the svn web interface. > > http://svn.freebsd.org/viewvc/base/user/thompsa/usb/ > > > r187750 > http://svn.freebsd.org/viewvc/base?view=revision&revision=187750 > > Change over to using taskqueue(9) instead of hand rolled threads and > the config_td system. This removes the config_td code and makes the > API much simpler to use. > > r187751, r187752, r187753, r187754, r187755, r187756 > http://svn.freebsd.org/viewvc/base?view=revision&revision=187751 > > Change over to usb2_proc w/ taskqueues for the usb2/ethernet, > usb2/serial and usb2/wlan code. > > r187965 > http://svn.freebsd.org/viewvc/base?view=revision&revision=187965 > > Move most of the ifnet logic into the usb2_ethernet module, this > includes, - make all usb ethernet interfaces named ue%d > - handle all threading in usb2_ethernet > - provide default ioctl handler > - handle mbuf rx > - provide locked callbacks for init,start,stop,etc > > The drivers are not much more than data pushers now. > > > regards, > Andrew From owner-freebsd-usb@FreeBSD.ORG Sun Feb 1 11:17:55 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4721F106564A; Sun, 1 Feb 2009 11:17:55 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe12.swipnet.se [212.247.155.97]) by mx1.freebsd.org (Postfix) with ESMTP id 1DBFE8FC17; Sun, 1 Feb 2009 11:17:53 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=6I5d2MoRAAAA:8 a=8zwBnypGUq7eIxYhUKYA:9 a=H-_pe-H3QAaFORQowpcA:7 a=1MrTk2Bnu5JpuKBbu8pVafZ9AesA:4 a=SV7veod9ZcQA:10 a=50e4U0PicR4A:10 Received: from [85.19.218.115] (account mc467741@c2i.net HELO [10.37.1.92]) by mailfe12.swip.net (CommuniGate Pro SMTP 5.2.6) with ESMTPA id 1016752721; Sun, 01 Feb 2009 12:17:52 +0100 From: Hans Petter Selasky To: Alfred Perlstein Date: Sun, 1 Feb 2009 12:20:17 +0100 User-Agent: KMail/1.9.7 References: <20090131231957.GB31825@citylink.fud.org.nz> <20090201030628.GE65558@elvis.mu.org> In-Reply-To: <20090201030628.GE65558@elvis.mu.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902011220.18745.hselasky@c2i.net> Cc: freebsd-usb@freebsd.org, Andrew Thompson Subject: Re: USB2 patches X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2009 11:17:55 -0000 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 = usb2_proc_create(&ssc->sc_tq, USB_PRI_MED, "ucom"); + if (error) < missing "usb2_com_units_free()" > + return (error); + 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 the taskqueue system does not provide a teardown mechanism so that we inside the callback can know if the taskqueue is being drained, then the taskqueue cannot replace the original "usb2_proc_xxx()" ! Maybe this means we need to extend the taskqueue system? 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 every USB transfer, and that is unacceptable. With regard to the ethernet/wlan drivers, it is Ok to create the "if" instance in attach, but not to start programming the chip. This needs to be synchronised otherwise. I suggets you make a task called: zyd_first_time_configure() and kick this task before allocating ifnet instances. Then when everything is ready you queue another task to set the LINK flag, so that we don't start transmitting data during early chip configuration! In case of failure you just drain the taskqueue. 4) int onoff = USB_TASK_ARG(task); This won't work! You need to be able to handle N-phase here, where N goes to +infinity! If the DTR pin was toggled we should also see a toggle in the programming of the DTR pin, not just re-program the last state! If there is a USB_TASK_ARG() it must be constant and that is where I start seeing problems, or features missing in the taskqueue system. It is also very important that you somehow freeze the configuration at the moment a command is issued. For example in the WLAN drivers. If the command is queued when the channel is 5 then we should program channel 5 and not fetch the latest channel value from the softc! IMPORTANT! I'm not saying USB cannot use the taskqueue, but we have special requirements which I cannot see that the taskqueue is a full drop in replacement for! 5) Many of your other changes are good! --HPS On Sunday 01 February 2009, Alfred Perlstein wrote: > 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 [090131 15:20] wrote: > > 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, > > http://people.freebsd.org/~thompsa/usb_head1.diff > > 73 files changed, 9229 insertions(+), 13261 deletions(-) > > > > but its rather large so it may be easier to look at the various changes > > via the svn web interface. > > > > http://svn.freebsd.org/viewvc/base/user/thompsa/usb/ > > > > > > r187750 > > http://svn.freebsd.org/viewvc/base?view=revision&revision=187750 > > > > Change over to using taskqueue(9) instead of hand rolled threads and > > the config_td system. This removes the config_td code and makes the > > API much simpler to use. > > > > r187751, r187752, r187753, r187754, r187755, r187756 > > http://svn.freebsd.org/viewvc/base?view=revision&revision=187751 > > > > Change over to usb2_proc w/ taskqueues for the usb2/ethernet, > > usb2/serial and usb2/wlan code. > > > > r187965 > > http://svn.freebsd.org/viewvc/base?view=revision&revision=187965 > > > > Move most of the ifnet logic into the usb2_ethernet module, this > > includes, - make all usb ethernet interfaces named ue%d > > - handle all threading in usb2_ethernet > > - provide default ioctl handler > > - handle mbuf rx > > - provide locked callbacks for init,start,stop,etc > > > > The drivers are not much more than data pushers now. > > > > > > regards, > > Andrew From owner-freebsd-usb@FreeBSD.ORG Sun Feb 1 14:43:55 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D09D6106566C for ; Sun, 1 Feb 2009 14:43:55 +0000 (UTC) (envelope-from Thomas.Sparrevohn@btinternet.com) Received: from smtp817.mail.ird.yahoo.com (smtp817.mail.ird.yahoo.com [77.238.189.17]) by mx1.freebsd.org (Postfix) with SMTP id 55F9E8FC14 for ; Sun, 1 Feb 2009 14:43:55 +0000 (UTC) (envelope-from Thomas.Sparrevohn@btinternet.com) Received: (qmail 42603 invoked from network); 1 Feb 2009 14:43:54 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=btinternet.com; h=Received:X-YMail-OSG:X-Yahoo-Newman-Property:From:To:Cc:References:In-Reply-To:Subject:Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:X-Mailer:Thread-Index:Content-Language; b=r6KdI8Usmd+YVY4RL7jsk0vwFZ7ig+EJwc8f3w3nVzYq7FgwCcqB9pCHLQ9Ea3oEq4CMvbTBhyKpwaaN4RxNG/HbiRLZNWDcgYz9CeqgC+t3sAAZ5oURgvAgD4EoIWb37o/ZIy0VWkFhOuUFKpJdwtbBqG64F/KNfRyWdLtiC28= ; Received: from unknown (HELO W2FZZ0VC03) (Thomas.Sparrevohn@86.133.246.172 with login) by smtp817.mail.ird.yahoo.com with SMTP; 1 Feb 2009 14:43:54 -0000 X-YMail-OSG: suLB.ZMVM1mOJIxuSqMfA8b3b67eyyRCz9N_nH17SQGWvmPZjvhpofIxJn2pCU9EqjO.Nj6.cdXcuMKryd2RnOeQf0xpcSjBVPvNon3T6UYcNYY7.drcr6CvAxNush19ugQPfA_96WiDijzBLfds6F.4IPnnCXVRNX5W63l4PkrWbWhoEC9ARefH7_MfxytVdls.ZweE3_96hyHYiBUiuloWMw9bk5jW X-Yahoo-Newman-Property: ymail-3 From: "Thomas Sparrevohn" To: "'Alfred Perlstein'" , "'Andrew Thompson'" References: <20090131231957.GB31825@citylink.fud.org.nz> <20090201030628.GE65558@elvis.mu.org> In-Reply-To: <20090201030628.GE65558@elvis.mu.org> Date: Sun, 1 Feb 2009 14:43:54 -0000 Message-ID: <009401c9847b$81b38700$851a9500$@Sparrevohn@btinternet.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcmEHFsmcFEPjl8vTtqJIia3cFsvuAAXu9DQ Content-Language: en-gb Cc: freebsd-usb@freebsd.org Subject: RE: USB2 patches X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2009 14:43:56 -0000 Before we switch GENERIC - would it be possibly to have the bus dma issue committed as well? Without the patch manually added none of my umass devices work under amd64 -----Original Message----- From: owner-freebsd-usb@freebsd.org [mailto:owner-freebsd-usb@freebsd.org] On Behalf Of Alfred 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 [090131 15:20] wrote: > 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, > http://people.freebsd.org/~thompsa/usb_head1.diff > 73 files changed, 9229 insertions(+), 13261 deletions(-) > > but its rather large so it may be easier to look at the various changes > via the svn web interface. > > http://svn.freebsd.org/viewvc/base/user/thompsa/usb/ > > > r187750 > http://svn.freebsd.org/viewvc/base?view=revision&revision=187750 > > Change over to using taskqueue(9) instead of hand rolled threads and > the config_td system. This removes the config_td code and makes the > API much simpler to use. > > r187751, r187752, r187753, r187754, r187755, r187756 > http://svn.freebsd.org/viewvc/base?view=revision&revision=187751 > > Change over to usb2_proc w/ taskqueues for the usb2/ethernet, > usb2/serial and usb2/wlan code. > > r187965 > http://svn.freebsd.org/viewvc/base?view=revision&revision=187965 > > Move most of the ifnet logic into the usb2_ethernet module, this includes, > - make all usb ethernet interfaces named ue%d > - handle all threading in usb2_ethernet > - provide default ioctl handler > - handle mbuf rx > - provide locked callbacks for init,start,stop,etc > > The drivers are not much more than data pushers now. > > > regards, > Andrew -- - Alfred Perlstein _______________________________________________ freebsd-usb@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-usb To unsubscribe, send any mail to "freebsd-usb-unsubscribe@freebsd.org" From owner-freebsd-usb@FreeBSD.ORG Sun Feb 1 17:09:08 2009 Return-Path: Delivered-To: freebsd-usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D88531065679; Sun, 1 Feb 2009 17:09:08 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 7B4628FC14; Sun, 1 Feb 2009 17:09:08 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n11H78hl092705; Sun, 1 Feb 2009 10:07:08 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sun, 01 Feb 2009 10:07:36 -0700 (MST) Message-Id: <20090201.100736.-403077701.imp@bsdimp.com> To: hselasky@c2i.net From: "M. Warner Losh" In-Reply-To: <200902011123.47690.hselasky@c2i.net> References: <20090131231957.GB31825@citylink.fud.org.nz> <200902011123.47690.hselasky@c2i.net> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-usb@FreeBSD.org, thompsa@FreeBSD.org Subject: Re: USB2 patches X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2009 17:09:09 -0000 In message: <200902011123.47690.hselasky@c2i.net> Hans Petter Selasky 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 : gets queued on the same handler, how will the events get executed? In : parallell, in serial. I never fully understood that. Serially. If they are the same task that's queued multiple times, you get a count of how many times it was queued to do something useful with. Warner : --HPS : : On Sunday 01 February 2009, Andrew Thompson wrote: : > 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, : > http://people.freebsd.org/~thompsa/usb_head1.diff : > 73 files changed, 9229 insertions(+), 13261 deletions(-) : > : > but its rather large so it may be easier to look at the various changes : > via the svn web interface. : > : > http://svn.freebsd.org/viewvc/base/user/thompsa/usb/ : > : > : > r187750 : > http://svn.freebsd.org/viewvc/base?view=revision&revision=187750 : > : > Change over to using taskqueue(9) instead of hand rolled threads and : > the config_td system. This removes the config_td code and makes the : > API much simpler to use. : > : > r187751, r187752, r187753, r187754, r187755, r187756 : > http://svn.freebsd.org/viewvc/base?view=revision&revision=187751 : > : > Change over to usb2_proc w/ taskqueues for the usb2/ethernet, : > usb2/serial and usb2/wlan code. : > : > r187965 : > http://svn.freebsd.org/viewvc/base?view=revision&revision=187965 : > : > Move most of the ifnet logic into the usb2_ethernet module, this : > includes, - make all usb ethernet interfaces named ue%d : > - handle all threading in usb2_ethernet : > - provide default ioctl handler : > - handle mbuf rx : > - provide locked callbacks for init,start,stop,etc : > : > The drivers are not much more than data pushers now. : > : > : > regards, : > Andrew : : : _______________________________________________ : freebsd-usb@freebsd.org mailing list : http://lists.freebsd.org/mailman/listinfo/freebsd-usb : To unsubscribe, send any mail to "freebsd-usb-unsubscribe@freebsd.org" : : From owner-freebsd-usb@FreeBSD.ORG Sun Feb 1 17:50:26 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7347810656BC; Sun, 1 Feb 2009 17:50:26 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from pele.citylink.co.nz (pele.citylink.co.nz [202.8.44.226]) by mx1.freebsd.org (Postfix) with ESMTP id 112978FC20; Sun, 1 Feb 2009 17:50:26 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) by pele.citylink.co.nz (Postfix) with ESMTP id 7714BFF79; Mon, 2 Feb 2009 06:50:25 +1300 (NZDT) X-Virus-Scanned: Debian amavisd-new at citylink.co.nz Received: from pele.citylink.co.nz ([127.0.0.1]) by localhost (pele.citylink.co.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id B4BgOahUCSJk; Mon, 2 Feb 2009 06:50:21 +1300 (NZDT) Received: from citylink.fud.org.nz (unknown [202.8.44.45]) by pele.citylink.co.nz (Postfix) with ESMTP; Mon, 2 Feb 2009 06:50:21 +1300 (NZDT) Received: by citylink.fud.org.nz (Postfix, from userid 1001) id 7213A1142C; Mon, 2 Feb 2009 06:50:21 +1300 (NZDT) Date: Sun, 1 Feb 2009 09:50:21 -0800 From: Andrew Thompson To: Hans Petter Selasky Message-ID: <20090201175021.GA32503@citylink.fud.org.nz> References: <20090131231957.GB31825@citylink.fud.org.nz> <20090201030628.GE65558@elvis.mu.org> <200902011220.18745.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200902011220.18745.hselasky@c2i.net> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: freebsd-usb@freebsd.org Subject: Re: USB2 patches X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2009 17:50:27 -0000 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); > - return (ENOMEM); > - } > + > + error = usb2_proc_create(&ssc->sc_tq, USB_PRI_MED, "ucom"); > + if (error) > > < missing "usb2_com_units_free()" > thanks. > + return (error); > + > > 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 the taskqueue system does not provide a teardown mechanism so that we > inside the callback can know if the taskqueue is being drained, then the > taskqueue cannot replace the original "usb2_proc_xxx()" ! Maybe this means we > need to extend the taskqueue system? Possibly. Taskqueues will always complete the function callbacks before freeing so you dont need to worry about resources disappearing under you. The one reason would be to bail out of a long running task but, - Are there any tasks that actually run a long time? - If not, its easier just to wait on the drain > 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 every USB transfer, and > that is unacceptable. I disagree. It hugely simplifies drivers to know all the resources are allocated after attach, you dont need to check for null pointers throughout the code. If programming commands fail/timeout in the attach routine then the driver needs to check this and abort the attach. You will wait one or two timeouts max. > > 4) > > int onoff = USB_TASK_ARG(task); > > This won't work! You need to be able to handle N-phase here, where N goes to > +infinity! If the DTR pin was toggled we should also see a toggle in the > programming of the DTR pin, not just re-program the last state! If there is a > USB_TASK_ARG() it must be constant and that is where I start seeing problems, > or features missing in the taskqueue system. > > It is also very important that you somehow freeze the configuration at the > moment a command is issued. For example in the WLAN drivers. If the command > is queued when the channel is 5 then we should program channel 5 and not > fetch the latest channel value from the softc! IMPORTANT! This isnt correct. Take your example of WLAN drivers, the net80211 layer will use ic_curchan for its logic so the driver needs to program the chip to this value at all times. You can _not_ queue channel changes as these will be out of sync. Tasks are very short lived and program the chipset to the current state where it otherwise could not have been done due to thread sleeping. Also, net80211 will soon have its own thread so you can do things like state/channel changes directly but in a sleepable context. > 5) Many of your other changes are good! Thanks! Andrew From owner-freebsd-usb@FreeBSD.ORG Sun Feb 1 18:19:53 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FE63106566B; Sun, 1 Feb 2009 18:19:53 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe11.swipnet.se [212.247.155.65]) by mx1.freebsd.org (Postfix) with ESMTP id A66038FC17; Sun, 1 Feb 2009 18:19:52 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=C0OiClrY6LCW-QDsMSwA:9 a=T2mWgkxjGxjrV8QhuV4A:7 a=67MXz_M0PORQrWSf6QbvmRMjXZ4A:4 a=50e4U0PicR4A:10 Received: from [85.19.218.115] (account mc467741@c2i.net HELO [10.37.1.92]) by mailfe11.swip.net (CommuniGate Pro SMTP 5.2.6) with ESMTPA id 1016991234; Sun, 01 Feb 2009 19:19:51 +0100 From: Hans Petter Selasky To: Andrew Thompson Date: Sun, 1 Feb 2009 19:22:15 +0100 User-Agent: KMail/1.9.7 References: <20090131231957.GB31825@citylink.fud.org.nz> <200902011220.18745.hselasky@c2i.net> <20090201175021.GA32503@citylink.fud.org.nz> In-Reply-To: <20090201175021.GA32503@citylink.fud.org.nz> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902011922.16810.hselasky@c2i.net> Cc: freebsd-usb@freebsd.org Subject: Re: USB2 patches X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2009 18:19:53 -0000 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 the taskqueue system does not provide a teardown mechanism so that we > > inside the callback can know if the taskqueue is being drained, then the > > taskqueue cannot replace the original "usb2_proc_xxx()" ! Maybe this > > means we need to extend the taskqueue system? > > Possibly. Taskqueues will always complete the function callbacks before > freeing so you dont need to worry about resources disappearing under you. > The one reason would be to bail out of a long running task but, > - Are there any tasks that actually run a long time? Yes, some of the wireless USB drivers can program hundreds of registers during startup. > - If not, its easier just to wait on the drain > > > 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 every USB > > transfer, and that is unacceptable. > > I disagree. It hugely simplifies drivers to know all the resources are > allocated after attach, you dont need to check for null pointers > throughout the code. I think you misunderstand. The attach code that loads firmware, reads eeprom and performs other configuration must be handed off to another thread, or in your case a taskqueue, so that the USB attach thread can go on and do other things. In the [was configure-] thread you can attach things synchronously. In the case of network adapters you should not rely on the device_attach() event from devd to do something, but rather the event from if_attach(), if such exits. > If programming commands fail/timeout in the attach > routine then the driver needs to check this and abort the attach. You will > wait one or two timeouts max. 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 checks into 3 lines of code in every driver: if (usb2_config_td_is_gone(&sc->sc_config_td)) { goto error; } 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 being drained from inside the taskqueue callback, the taskqueue system has to be modified! It cannot replace the existing system like it is now! > > 4) > > > > int onoff = USB_TASK_ARG(task); > > > > This won't work! You need to be able to handle N-phase here, where N goes > > to +infinity! If the DTR pin was toggled we should also see a toggle in > > the programming of the DTR pin, not just re-program the last state! If > > there is a USB_TASK_ARG() it must be constant and that is where I start > > seeing problems, or features missing in the taskqueue system. > > > > It is also very important that you somehow freeze the configuration at > > the moment a command is issued. For example in the WLAN drivers. If the > > command is queued when the channel is 5 then we should program channel 5 > > and not fetch the latest channel value from the softc! IMPORTANT! > > This isnt correct. Take your example of WLAN drivers, the net80211 layer > will use ic_curchan for its logic so the driver needs to program the > chip to this value at all times. You can _not_ queue channel changes as > these will be out of sync. Being a little off-sync is not the big problem. The big problem is if the channel value is changing during execution of the code. For example, in the beginning of the code the channel value is 5, then suddenly it becomes 6, and the programming just ends up crazy! xxx_set_channel() { hw_reg = array1[wlan->curchan]; write USB register; hw_reg = array2[wlan->curchan]; write USB register; } > Tasks are very short lived and program the > chipset to the current state where it otherwise could not have been done > due to thread sleeping. > > Also, net80211 will soon have its own thread so you can do things like > state/channel changes directly but in a sleepable context. Good! But until then I strongly suggest you keep things like is. > > > 5) Many of your other changes are good! > > Thanks! Can you explain one thing: How many threads are created to handle taskqueue events? As many as required? If three different taskqueues have three different events, then three threads are used to execute these events? --HPS From owner-freebsd-usb@FreeBSD.ORG Sun Feb 1 18:27:21 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63838106566C; Sun, 1 Feb 2009 18:27:21 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 2384E8FC08; Sun, 1 Feb 2009 18:27:21 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n11IOUIa093351; Sun, 1 Feb 2009 11:24:30 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sun, 01 Feb 2009 11:24:59 -0700 (MST) Message-Id: <20090201.112459.717301987.imp@bsdimp.com> To: thompsa@freebsd.org From: "M. Warner Losh" In-Reply-To: <20090201175021.GA32503@citylink.fud.org.nz> References: <20090201030628.GE65558@elvis.mu.org> <200902011220.18745.hselasky@c2i.net> <20090201175021.GA32503@citylink.fud.org.nz> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-usb@freebsd.org Subject: Re: USB2 patches X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2009 18:27:21 -0000 In message: <20090201175021.GA32503@citylink.fud.org.nz> Andrew Thompson writes: : > 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 every USB transfer, and : > that is unacceptable. : : I disagree. It hugely simplifies drivers to know all the resources are : allocated after attach, you dont need to check for null pointers : throughout the code. If programming commands fail/timeout in the attach routine : then the driver needs to check this and abort the attach. You will wait : one or two timeouts max. The only way that a 'deferred attach' makes sense is if the ifnet and other external resources are setup as part of that deferred attach. That way, you don't have the NULL pointer issue. However, doing that introduces races with devd, which are a pita to cope with... Even without deferring the setting up if ifnet, you have races with devd if you defer things in attach that can be hard to cope with in the code. Warner From owner-freebsd-usb@FreeBSD.ORG Sun Feb 1 18:30:17 2009 Return-Path: Delivered-To: freebsd-usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EEC42106564A; Sun, 1 Feb 2009 18:30:17 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 96B7B8FC0C; Sun, 1 Feb 2009 18:30:17 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n11IRRAS093378; Sun, 1 Feb 2009 11:27:27 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sun, 01 Feb 2009 11:27:56 -0700 (MST) Message-Id: <20090201.112756.1320088159.imp@bsdimp.com> To: hselasky@c2i.net From: "M. Warner Losh" In-Reply-To: <200902011922.16810.hselasky@c2i.net> References: <200902011220.18745.hselasky@c2i.net> <20090201175021.GA32503@citylink.fud.org.nz> <200902011922.16810.hselasky@c2i.net> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-usb@FreeBSD.org, thompsa@FreeBSD.org Subject: Re: USB2 patches X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2009 18:30:18 -0000 In message: <200902011922.16810.hselasky@c2i.net> Hans Petter Selasky 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 being drained from : inside the taskqueue callback, the taskqueue system has to be modified! It : cannot replace the existing system like it is now! Why does the taskqueue system need to provide that? Why can't the driver set a dying flag in the softc to communicate this fact to the taskqueue tasks? Warner From owner-freebsd-usb@FreeBSD.ORG Sun Feb 1 18:30:19 2009 Return-Path: Delivered-To: freebsd-usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA3D91065672; Sun, 1 Feb 2009 18:30:19 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 8831B8FC14; Sun, 1 Feb 2009 18:30:19 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n11ITiiI093384; Sun, 1 Feb 2009 11:29:44 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sun, 01 Feb 2009 11:30:13 -0700 (MST) Message-Id: <20090201.113013.267651064.imp@bsdimp.com> To: hselasky@c2i.net From: "M. Warner Losh" In-Reply-To: <200902011922.16810.hselasky@c2i.net> References: <200902011220.18745.hselasky@c2i.net> <20090201175021.GA32503@citylink.fud.org.nz> <200902011922.16810.hselasky@c2i.net> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-usb@FreeBSD.org, thompsa@FreeBSD.org Subject: Re: USB2 patches X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2009 18:30:20 -0000 In message: <200902011922.16810.hselasky@c2i.net> Hans Petter Selasky writes: : In the [was configure-] thread you can attach things synchronously. In the : case of network adapters you should not rely on the device_attach() event : from devd to do something, but rather the event from if_attach(), if such : exits. # # Configure the interface on attach. Due to a historical accident, this # script is called pccard_ether. # notify 0 { match "system" "IFNET"; match "type" "ATTACH"; action "/etc/pccard_ether $subsystem start"; }; notify 0 { match "system" "IFNET"; match "type" "DETACH"; action "/etc/pccard_ether $subsystem stop"; }; Warner From owner-freebsd-usb@FreeBSD.ORG Sun Feb 1 18:33:29 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8450B1065676; Sun, 1 Feb 2009 18:33:29 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 430988FC1B; Sun, 1 Feb 2009 18:33:29 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n11IW0Wv093405; Sun, 1 Feb 2009 11:32:00 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sun, 01 Feb 2009 11:32:29 -0700 (MST) Message-Id: <20090201.113229.-1891351758.imp@bsdimp.com> To: thompsa@freebsd.org From: "M. Warner Losh" In-Reply-To: <20090201.112459.717301987.imp@bsdimp.com> References: <200902011220.18745.hselasky@c2i.net> <20090201175021.GA32503@citylink.fud.org.nz> <20090201.112459.717301987.imp@bsdimp.com> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-usb@freebsd.org Subject: Re: USB2 patches X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2009 18:33:30 -0000 In message: <20090201.112459.717301987.imp@bsdimp.com> "M. Warner Losh" writes: : In message: <20090201175021.GA32503@citylink.fud.org.nz> : Andrew Thompson writes: : : > 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 every USB transfer, and : : > that is unacceptable. : : : : I disagree. It hugely simplifies drivers to know all the resources are : : allocated after attach, you dont need to check for null pointers : : throughout the code. If programming commands fail/timeout in the attach routine : : then the driver needs to check this and abort the attach. You will wait : : one or two timeouts max. : : The only way that a 'deferred attach' makes sense is if the ifnet and : other external resources are setup as part of that deferred attach. : That way, you don't have the NULL pointer issue. : : However, doing that introduces races with devd, which are a pita to : cope with... Even without deferring the setting up if ifnet, you have : races with devd if you defer things in attach that can be hard to cope : with in the code. Scratch that. The race with devd is already closed since we use ifnet events and not newbus events to configure dynamic devices. There's still a small race on boot with deferring registration of ifnet if you want to synchronously boot.... But I think the default route script closes this race... Warner From owner-freebsd-usb@FreeBSD.ORG Sun Feb 1 18:35:08 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBDD21065676; Sun, 1 Feb 2009 18:35:08 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe16.swipnet.se [212.247.155.225]) by mx1.freebsd.org (Postfix) with ESMTP id 36BB28FC1F; Sun, 1 Feb 2009 18:35:07 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=7FnJfBjBj6YBYHsS3dAA:9 a=Ja3thZtoQAx_2BLkpXT17nHeXc0A:4 a=SV7veod9ZcQA:10 a=50e4U0PicR4A:10 Received: from [85.19.218.115] (account mc467741@c2i.net HELO [10.37.1.92]) by mailfe16.swip.net (CommuniGate Pro SMTP 5.2.6) with ESMTPA id 446142089; Sun, 01 Feb 2009 19:35:06 +0100 From: Hans Petter Selasky To: "M. Warner Losh" Date: Sun, 1 Feb 2009 19:37:31 +0100 User-Agent: KMail/1.9.7 References: <20090201030628.GE65558@elvis.mu.org> <20090201175021.GA32503@citylink.fud.org.nz> <20090201.112459.717301987.imp@bsdimp.com> In-Reply-To: <20090201.112459.717301987.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902011937.32679.hselasky@c2i.net> Cc: freebsd-usb@freebsd.org, thompsa@freebsd.org Subject: Re: USB2 patches X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2009 18:35:09 -0000 Hi Warner, On Sunday 01 February 2009, M. Warner Losh wrote: > In message: <20090201175021.GA32503@citylink.fud.org.nz> > > Andrew Thompson writes: > The only way that a 'deferred attach' makes sense is > if the ifnet and other external resources are setup as part of > that deferred attach. That way, you don't have the NULL pointer issue. That was what the initial code did. > > However, doing that introduces races with devd, which are a pita to > cope with... Even without deferring the setting up if ifnet, you have > races with devd if you defer things in attach that can be hard to cope > with in the code. No, not if the ifnet attach is deferred too. My conclusion is: Do not make match rules for "rumX/uralX/zydX", instead match for the IFNET event in devd.conf. devctl_notify("IFNET", ifp->if_xname, "ATTACH", NULL); --HPS From owner-freebsd-usb@FreeBSD.ORG Sun Feb 1 18:36:24 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AA981065670; Sun, 1 Feb 2009 18:36:24 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe13.swipnet.se [212.247.155.129]) by mx1.freebsd.org (Postfix) with ESMTP id 993E48FC21; Sun, 1 Feb 2009 18:36:23 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=ACjjPeCvvAMhK6rthv0A:9 a=86F4ak1v-r6RfpvaW6IA:7 a=8wFUjE_z0-u8Gx49E20BxLkqJrwA:4 a=9aOQ2cSd83gA:10 a=LY0hPdMaydYA:10 Received: from [85.19.218.115] (account mc467741@c2i.net HELO [10.37.1.92]) by mailfe13.swip.net (CommuniGate Pro SMTP 5.2.6) with ESMTPA id 799659041; Sun, 01 Feb 2009 19:36:22 +0100 From: Hans Petter Selasky To: "M. Warner Losh" Date: Sun, 1 Feb 2009 19:38:47 +0100 User-Agent: KMail/1.9.7 References: <200902011220.18745.hselasky@c2i.net> <200902011922.16810.hselasky@c2i.net> <20090201.112756.1320088159.imp@bsdimp.com> In-Reply-To: <20090201.112756.1320088159.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902011938.48670.hselasky@c2i.net> Cc: freebsd-usb@freebsd.org, thompsa@freebsd.org Subject: Re: USB2 patches X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2009 18:36:24 -0000 On Sunday 01 February 2009, M. Warner Losh wrote: > In message: <200902011922.16810.hselasky@c2i.net> > > Hans Petter Selasky 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 being drained > : from inside the taskqueue callback, the taskqueue system has to be > : modified! It cannot replace the existing system like it is now! > > Why does the taskqueue system need to provide that? Why can't the > driver set a dying flag in the softc to communicate this fact to the > taskqueue tasks? That's also possible. Thomas already made a "struct usb2_task" I think, where this flag could be added. --HPS From owner-freebsd-usb@FreeBSD.ORG Sun Feb 1 18:39:17 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE7B2106566C; Sun, 1 Feb 2009 18:39:17 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id AF0308FC18; Sun, 1 Feb 2009 18:39:17 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n11Iaj3g093459; Sun, 1 Feb 2009 11:36:45 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sun, 01 Feb 2009 11:37:14 -0700 (MST) Message-Id: <20090201.113714.-887896087.imp@bsdimp.com> To: hselasky@c2i.net From: "M. Warner Losh" In-Reply-To: <200902011937.32679.hselasky@c2i.net> References: <20090201175021.GA32503@citylink.fud.org.nz> <20090201.112459.717301987.imp@bsdimp.com> <200902011937.32679.hselasky@c2i.net> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-usb@freebsd.org, thompsa@freebsd.org Subject: Re: USB2 patches X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2009 18:39:18 -0000 In message: <200902011937.32679.hselasky@c2i.net> Hans Petter Selasky writes: : Hi Warner, : : On Sunday 01 February 2009, M. Warner Losh wrote: : > In message: <20090201175021.GA32503@citylink.fud.org.nz> : > : > Andrew Thompson writes: : : > The only way that a 'deferred attach' makes sense is : : > if the ifnet and other external resources are setup as part of : > that deferred attach. That way, you don't have the NULL pointer issue. : : That was what the initial code did. : : > : > However, doing that introduces races with devd, which are a pita to : > cope with... Even without deferring the setting up if ifnet, you have : > races with devd if you defer things in attach that can be hard to cope : > with in the code. : : No, not if the ifnet attach is deferred too. : : My conclusion is: Do not make match rules for "rumX/uralX/zydX", instead match : for the IFNET event in devd.conf. : : devctl_notify("IFNET", ifp->if_xname, "ATTACH", NULL); Yes. We already do that. I was thinking of the geom/device race that we haven't closed rather than this race which we have. Warner From owner-freebsd-usb@FreeBSD.ORG Sun Feb 1 18:58:43 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88C44106566C; Sun, 1 Feb 2009 18:58:43 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe12.tele2.se [212.247.155.97]) by mx1.freebsd.org (Postfix) with ESMTP id BB0688FC25; Sun, 1 Feb 2009 18:58:42 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=udjUD6xBrwDHYV7nuwMA:9 a=OGzQZI-EeMsMZk_S9PgA:7 a=ci9iTQ_1ku-QdqMyLcObrxoMfO0A:4 a=50e4U0PicR4A:10 Received: from [85.19.218.115] (account mc467741@c2i.net HELO [10.37.1.92]) by mailfe12.swip.net (CommuniGate Pro SMTP 5.2.6) with ESMTPA id 1016887440; Sun, 01 Feb 2009 19:58:40 +0100 From: Hans Petter Selasky To: freebsd-usb@freebsd.org Date: Sun, 1 Feb 2009 20:01:05 +0100 User-Agent: KMail/1.9.7 References: <200902011220.18745.hselasky@c2i.net> <20090201.112756.1320088159.imp@bsdimp.com> <200902011938.48670.hselasky@c2i.net> In-Reply-To: <200902011938.48670.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902012001.06914.hselasky@c2i.net> Cc: thompsa@freebsd.org Subject: Re: USB2 patches X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2009 18:58:43 -0000 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: void * usb2_proc_msignal(struct usb2_process *up, void *_pm0, void *_pm1) { struct usb2_proc_msg *pm0 = _pm0; struct usb2_proc_msg *pm1 = _pm1; struct usb2_proc_msg *pm2; uint32_t d; uint8_t t; mtx_assert(up->up_mtx, MA_OWNED); t = 0; if (pm0->pm_qentry.tqe_prev) { t |= 1; } if (pm1->pm_qentry.tqe_prev) { t |= 2; } if (t == 0) { /* * No entries are queued. Queue "pm0" and use the existing * message number. */ pm2 = pm0; } else if (t == 1) { /* Check if we need to increment the message number. */ if (pm0->pm_num == up->up_msg_num) { up->up_msg_num++; } pm2 = pm1; } else if (t == 2) { /* Check if we need to increment the message number. */ if (pm1->pm_num == up->up_msg_num) { up->up_msg_num++; } pm2 = pm0; } else if (t == 3) { /* * Both entries are queued. Re-queue the entry closest to * the end. */ d = (pm1->pm_num - pm0->pm_num); /* Check sign after subtraction */ if (d & 0x80000000) { pm2 = pm0; } else { pm2 = pm1; } TAILQ_REMOVE(&up->up_qhead, pm2, pm_qentry); } else { pm2 = NULL; /* panic - should not happen */ } DPRINTF(" t=%u, num=%u\n", t, up->up_msg_num); /* Put message last on queue */ pm2->pm_num = up->up_msg_num; TAILQ_INSERT_TAIL(&up->up_qhead, pm2, pm_qentry); /* Check if we need to wakeup the USB process. */ if (up->up_msleep) { up->up_msleep = 0; /* save "cv_signal()" calls */ usb2_cv_signal(&up->up_cv); } return (pm2); } --HPS From owner-freebsd-usb@FreeBSD.ORG Sun Feb 1 19:08:27 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A259106566C; Sun, 1 Feb 2009 19:08:27 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from pele.citylink.co.nz (pele.citylink.co.nz [202.8.44.226]) by mx1.freebsd.org (Postfix) with ESMTP id B19FF8FC19; Sun, 1 Feb 2009 19:08:26 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) by pele.citylink.co.nz (Postfix) with ESMTP id 220FBFF7A; Mon, 2 Feb 2009 08:08:26 +1300 (NZDT) X-Virus-Scanned: Debian amavisd-new at citylink.co.nz Received: from pele.citylink.co.nz ([127.0.0.1]) by localhost (pele.citylink.co.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id R6gSocjPwblJ; Mon, 2 Feb 2009 08:08:21 +1300 (NZDT) Received: from citylink.fud.org.nz (unknown [202.8.44.45]) by pele.citylink.co.nz (Postfix) with ESMTP; Mon, 2 Feb 2009 08:08:21 +1300 (NZDT) Received: by citylink.fud.org.nz (Postfix, from userid 1001) id 2ED0B1142D; Mon, 2 Feb 2009 08:08:21 +1300 (NZDT) Date: Sun, 1 Feb 2009 11:08:20 -0800 From: Andrew Thompson To: Hans Petter Selasky Message-ID: <20090201190820.GB32503@citylink.fud.org.nz> References: <20090131231957.GB31825@citylink.fud.org.nz> <200902011220.18745.hselasky@c2i.net> <20090201175021.GA32503@citylink.fud.org.nz> <200902011922.16810.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200902011922.16810.hselasky@c2i.net> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: freebsd-usb@freebsd.org Subject: Re: USB2 patches X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2009 19:08:27 -0000 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 every USB > > > transfer, and that is unacceptable. > > > > I disagree. It hugely simplifies drivers to know all the resources are > > allocated after attach, you dont need to check for null pointers > > throughout the code. > > I think you misunderstand. The attach code that loads firmware, reads eeprom > and performs other configuration must be handed off to another thread, or in > your case a taskqueue, so that the USB attach thread can go on and do other > things. The attach routine allocates resources and attaches the hardware. Things like loading firmware and other configuration are done in the ifnet init routine. > > > It is also very important that you somehow freeze the configuration at > > > the moment a command is issued. For example in the WLAN drivers. If the > > > command is queued when the channel is 5 then we should program channel 5 > > > and not fetch the latest channel value from the softc! IMPORTANT! > > > > This isnt correct. Take your example of WLAN drivers, the net80211 layer > > will use ic_curchan for its logic so the driver needs to program the > > chip to this value at all times. You can _not_ queue channel changes as > > these will be out of sync. > > Being a little off-sync is not the big problem. The big problem is if the > channel value is changing during execution of the code. For example, in the > beginning of the code the channel value is 5, then suddenly it becomes 6, and > the programming just ends up crazy! > > xxx_set_channel() > { > hw_reg = array1[wlan->curchan]; > > write USB register; > > hw_reg = array2[wlan->curchan]; > > write USB register; > } The code should be, xxx_set_channel() { ieee80211_channel c = wlan->curchan; hw_reg = array1[c]; write USB register; hw_reg = array2[c]; write USB register; } cheers, Andrew From owner-freebsd-usb@FreeBSD.ORG Sun Feb 1 19:12:11 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 044A810656D2; Sun, 1 Feb 2009 19:12:11 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe16.swip.net [212.247.155.225]) by mx1.freebsd.org (Postfix) with ESMTP id 645BB8FC1E; Sun, 1 Feb 2009 19:12:09 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=HnWwmabpZgrjc_24w5IA:9 a=AwdpbGDWJQTKGqeq8NbcrtLDWfkA:4 a=50e4U0PicR4A:10 Received: from [85.19.218.115] (account mc467741@c2i.net HELO [10.37.1.92]) by mailfe16.swip.net (CommuniGate Pro SMTP 5.2.6) with ESMTPA id 446152277; Sun, 01 Feb 2009 20:12:08 +0100 From: Hans Petter Selasky To: Andrew Thompson Date: Sun, 1 Feb 2009 20:14:29 +0100 User-Agent: KMail/1.9.7 References: <20090131231957.GB31825@citylink.fud.org.nz> <200902011922.16810.hselasky@c2i.net> <20090201190820.GB32503@citylink.fud.org.nz> In-Reply-To: <20090201190820.GB32503@citylink.fud.org.nz> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902012014.32190.hselasky@c2i.net> Cc: freebsd-usb@freebsd.org Subject: Re: USB2 patches X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2009 19:12:11 -0000 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() > { > ieee80211_channel c = wlan->curchan; > > hw_reg = array1[c]; > write USB register; > hw_reg = array2[c]; > write USB register; > } And don't forget "volatile" ... --HPS From owner-freebsd-usb@FreeBSD.ORG Sun Feb 1 19:14:37 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7142B1065670 for ; Sun, 1 Feb 2009 19:14:37 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from pele.citylink.co.nz (pele.citylink.co.nz [202.8.44.226]) by mx1.freebsd.org (Postfix) with ESMTP id 121D08FC20 for ; Sun, 1 Feb 2009 19:14:37 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) by pele.citylink.co.nz (Postfix) with ESMTP id 6B0EBFF79; Mon, 2 Feb 2009 08:14:36 +1300 (NZDT) X-Virus-Scanned: Debian amavisd-new at citylink.co.nz Received: from pele.citylink.co.nz ([127.0.0.1]) by localhost (pele.citylink.co.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id I4xbChJa7g7F; Mon, 2 Feb 2009 08:14:33 +1300 (NZDT) Received: from citylink.fud.org.nz (unknown [202.8.44.45]) by pele.citylink.co.nz (Postfix) with ESMTP; Mon, 2 Feb 2009 08:14:33 +1300 (NZDT) Received: by citylink.fud.org.nz (Postfix, from userid 1001) id 089421142C; Mon, 2 Feb 2009 08:14:32 +1300 (NZDT) Date: Sun, 1 Feb 2009 11:14:32 -0800 From: Andrew Thompson To: Hans Petter Selasky Message-ID: <20090201191432.GD32503@citylink.fud.org.nz> References: <200902011220.18745.hselasky@c2i.net> <20090201.112756.1320088159.imp@bsdimp.com> <200902011938.48670.hselasky@c2i.net> <200902012001.06914.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200902012001.06914.hselasky@c2i.net> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: freebsd-usb@freebsd.org Subject: Re: USB2 patches X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2009 19:14:37 -0000 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 execute tasks sequentially, why do you need to pass two tasks in at a time? > How about: > > struct task * > tasqueue_enqueue_pair(struct taskqueue *queue, struct task *t0, struct task > *t1); > > Which does something similar to this: > > void * > usb2_proc_msignal(struct usb2_process *up, void *_pm0, void *_pm1) > { > struct usb2_proc_msg *pm0 = _pm0; > struct usb2_proc_msg *pm1 = _pm1; > struct usb2_proc_msg *pm2; > uint32_t d; > uint8_t t; > > mtx_assert(up->up_mtx, MA_OWNED); > > t = 0; > > if (pm0->pm_qentry.tqe_prev) { > t |= 1; > } > if (pm1->pm_qentry.tqe_prev) { > t |= 2; > } > if (t == 0) { > /* > * No entries are queued. Queue "pm0" and use the existing > * message number. > */ > pm2 = pm0; > } else if (t == 1) { > /* Check if we need to increment the message number. */ > if (pm0->pm_num == up->up_msg_num) { > up->up_msg_num++; > } > pm2 = pm1; > } else if (t == 2) { > /* Check if we need to increment the message number. */ > if (pm1->pm_num == up->up_msg_num) { > up->up_msg_num++; > } > pm2 = pm0; > } else if (t == 3) { > /* > * Both entries are queued. Re-queue the entry closest to > * the end. > */ > d = (pm1->pm_num - pm0->pm_num); > > /* Check sign after subtraction */ > if (d & 0x80000000) { > pm2 = pm0; > } else { > pm2 = pm1; > } > > TAILQ_REMOVE(&up->up_qhead, pm2, pm_qentry); > } else { > pm2 = NULL; /* panic - should not happen */ > } > > DPRINTF(" t=%u, num=%u\n", t, up->up_msg_num); > > /* Put message last on queue */ > > pm2->pm_num = up->up_msg_num; > TAILQ_INSERT_TAIL(&up->up_qhead, pm2, pm_qentry); > > /* Check if we need to wakeup the USB process. */ > > if (up->up_msleep) { > up->up_msleep = 0; /* save "cv_signal()" calls */ > usb2_cv_signal(&up->up_cv); > } > return (pm2); > } > > --HPS > _______________________________________________ > freebsd-usb@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-usb > To unsubscribe, send any mail to "freebsd-usb-unsubscribe@freebsd.org" From owner-freebsd-usb@FreeBSD.ORG Sun Feb 1 19:18:56 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C5191065670 for ; Sun, 1 Feb 2009 19:18:56 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from pele.citylink.co.nz (pele.citylink.co.nz [202.8.44.226]) by mx1.freebsd.org (Postfix) with ESMTP id 0FE028FC1D for ; Sun, 1 Feb 2009 19:18:55 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) by pele.citylink.co.nz (Postfix) with ESMTP id 58075FF79; Mon, 2 Feb 2009 08:18:55 +1300 (NZDT) X-Virus-Scanned: Debian amavisd-new at citylink.co.nz Received: from pele.citylink.co.nz ([127.0.0.1]) by localhost (pele.citylink.co.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DuTktSbC+ST2; Mon, 2 Feb 2009 08:18:51 +1300 (NZDT) Received: from citylink.fud.org.nz (unknown [202.8.44.45]) by pele.citylink.co.nz (Postfix) with ESMTP; Mon, 2 Feb 2009 08:18:51 +1300 (NZDT) Received: by citylink.fud.org.nz (Postfix, from userid 1001) id 53A431142C; Mon, 2 Feb 2009 08:18:51 +1300 (NZDT) Date: Sun, 1 Feb 2009 11:18:51 -0800 From: Andrew Thompson To: Hans Petter Selasky Message-ID: <20090201191851.GE32503@citylink.fud.org.nz> References: <20090131231957.GB31825@citylink.fud.org.nz> <200902011922.16810.hselasky@c2i.net> <20090201190820.GB32503@citylink.fud.org.nz> <200902012014.32190.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200902012014.32190.hselasky@c2i.net> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: freebsd-usb@freebsd.org Subject: Re: USB2 patches X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2009 19:18:56 -0000 On Sun, Feb 01, 2009 at 08:14:29PM +0100, Hans Petter Selasky wrote: > 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 ... Im saying you dont need to. When you get a channel change request, you fire off the channel task and the program the hardware with the current value from the ieee80211com channel pointer. > > xxx_set_channel() > > { > > ieee80211_channel c = wlan->curchan; > > > > hw_reg = array1[c]; > > write USB register; > > hw_reg = array2[c]; > > write USB register; > > } > > And don't forget "volatile" ... I dont understand this. c is a pointer to a valid net80211 channel which will never disappear. Andrew From owner-freebsd-usb@FreeBSD.ORG Sun Feb 1 19:26:41 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF346106564A; Sun, 1 Feb 2009 19:26:41 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from pele.citylink.co.nz (pele.citylink.co.nz [202.8.44.226]) by mx1.freebsd.org (Postfix) with ESMTP id 9523F8FC0A; Sun, 1 Feb 2009 19:26:41 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) by pele.citylink.co.nz (Postfix) with ESMTP id 06CD1FF79; Mon, 2 Feb 2009 08:26:41 +1300 (NZDT) X-Virus-Scanned: Debian amavisd-new at citylink.co.nz Received: from pele.citylink.co.nz ([127.0.0.1]) by localhost (pele.citylink.co.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sjd+N1wb295M; Mon, 2 Feb 2009 08:26:37 +1300 (NZDT) Received: from citylink.fud.org.nz (unknown [202.8.44.45]) by pele.citylink.co.nz (Postfix) with ESMTP; Mon, 2 Feb 2009 08:26:37 +1300 (NZDT) Received: by citylink.fud.org.nz (Postfix, from userid 1001) id 2F6011142C; Mon, 2 Feb 2009 08:26:37 +1300 (NZDT) Date: Sun, 1 Feb 2009 11:26:37 -0800 From: Andrew Thompson To: Hans Petter Selasky Message-ID: <20090201192637.GG32503@citylink.fud.org.nz> References: <20090131231957.GB31825@citylink.fud.org.nz> <200902011220.18745.hselasky@c2i.net> <20090201175021.GA32503@citylink.fud.org.nz> <200902011922.16810.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200902011922.16810.hselasky@c2i.net> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: freebsd-usb@freebsd.org Subject: Re: USB2 patches X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2009 19:26:42 -0000 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 checks into 3 lines of code in > every driver: > > if (usb2_config_td_is_gone(&sc->sc_config_td)) { > goto error; > } > > 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 being drained from > inside the taskqueue callback, the taskqueue system has to be modified! It > cannot replace the existing system like it is now! Things are still a work in progress, if I have missed some error checking then it can be fixed up. Andrew From owner-freebsd-usb@FreeBSD.ORG Sun Feb 1 19:29:33 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B924106566C; Sun, 1 Feb 2009 19:29:33 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe12.swipnet.se [212.247.155.97]) by mx1.freebsd.org (Postfix) with ESMTP id BBE3A8FC13; Sun, 1 Feb 2009 19:29:32 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=BejvGItzEIjqI3BsrNYA:9 a=Tttp81IOuuAXfQCtO2cA:7 a=9FKHxbkb01OtJpkWhrOyn3OtrCcA:4 a=LY0hPdMaydYA:10 Received: from [85.19.218.115] (account mc467741@c2i.net HELO [10.37.1.92]) by mailfe12.swip.net (CommuniGate Pro SMTP 5.2.6) with ESMTPA id 1016895934; Sun, 01 Feb 2009 20:29:31 +0100 From: Hans Petter Selasky To: Andrew Thompson Date: Sun, 1 Feb 2009 20:31:55 +0100 User-Agent: KMail/1.9.7 References: <200902011220.18745.hselasky@c2i.net> <200902012001.06914.hselasky@c2i.net> <20090201191432.GD32503@citylink.fud.org.nz> In-Reply-To: <20090201191432.GD32503@citylink.fud.org.nz> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902012031.56899.hselasky@c2i.net> Cc: freebsd-usb@freebsd.org Subject: Re: USB2 patches X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2009 19:29:33 -0000 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 this further? What is t0 vs t1? > > A taskqueue will execute tasks sequentially, 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 see similar issues where other commands are involved: 1) queue DTR on cmd 2) queue DTR off cmd 3) queue DTR on cmd Using the taskqueue there is no guarantee that the last command queued is the last command executed! That is dangerous! Because the existing taskqueue enqueue will only increment the pending count and return, if the command/task is already queued. In the example above you can end up like this: DTR on (pending = 2) DTR off (pending = 1) This is not correct. The queuing mechanism in USB2 guarantees that the last queued command is last executed: DTR on (first callback) DTR off (first callback) DTR on (second callback) Queuing: 1) queue DTR on cmd 2) queue DTR off cmd 3) queue DTR on cmd ... N) queue DTR XXX cmd Results in: 1) DTR on (first callback) 2) DTR off (first callback ... M) DTR XXX (second callback) If the user application is faster than USB "M" count is not the same like "N" count, of course. --HPS From owner-freebsd-usb@FreeBSD.ORG Sun Feb 1 19:57:36 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21DE5106566C; Sun, 1 Feb 2009 19:57:36 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id D64978FC23; Sun, 1 Feb 2009 19:57:35 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n11Juh7j094289; Sun, 1 Feb 2009 12:56:43 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sun, 01 Feb 2009 12:57:12 -0700 (MST) Message-Id: <20090201.125712.-1002120178.imp@bsdimp.com> To: thompsa@freebsd.org From: "M. Warner Losh" In-Reply-To: <20090201191851.GE32503@citylink.fud.org.nz> References: <20090201190820.GB32503@citylink.fud.org.nz> <200902012014.32190.hselasky@c2i.net> <20090201191851.GE32503@citylink.fud.org.nz> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-usb@freebsd.org Subject: Re: USB2 patches X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2009 19:57:36 -0000 In message: <20090201191851.GE32503@citylink.fud.org.nz> Andrew Thompson writes: : > > xxx_set_channel() : > > { : > > ieee80211_channel c = wlan->curchan; : > > : > > hw_reg = array1[c]; : > > write USB register; : > > hw_reg = array2[c]; : > > write USB register; : > > } : > : > And don't forget "volatile" ... : : I dont understand this. c is a pointer to a valid net80211 channel which : will never disappear. "volatile" would be a bug here. There's no reason to use it at all, since wlan->curchan doesn't match what ANSI-C says a volatile is for. In addition, since it is only loaded once, there wouldn't be a need for it even if it did meet the definition. You *CANNOT* rely on 'volatile' fixing locking issues. Warner From owner-freebsd-usb@FreeBSD.ORG Sun Feb 1 19:59:04 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C71391065670 for ; Sun, 1 Feb 2009 19:59:04 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from pele.citylink.co.nz (pele.citylink.co.nz [202.8.44.226]) by mx1.freebsd.org (Postfix) with ESMTP id 67D0E8FC18 for ; Sun, 1 Feb 2009 19:59:04 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) by pele.citylink.co.nz (Postfix) with ESMTP id BCCFFFF7A; Mon, 2 Feb 2009 08:59:03 +1300 (NZDT) X-Virus-Scanned: Debian amavisd-new at citylink.co.nz Received: from pele.citylink.co.nz ([127.0.0.1]) by localhost (pele.citylink.co.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id I1cAhhy+pcAp; Mon, 2 Feb 2009 08:59:00 +1300 (NZDT) Received: from citylink.fud.org.nz (unknown [202.8.44.45]) by pele.citylink.co.nz (Postfix) with ESMTP; Mon, 2 Feb 2009 08:59:00 +1300 (NZDT) Received: by citylink.fud.org.nz (Postfix, from userid 1001) id B17CD1142C; Mon, 2 Feb 2009 08:58:59 +1300 (NZDT) Date: Sun, 1 Feb 2009 11:58:59 -0800 From: Andrew Thompson To: Hans Petter Selasky Message-ID: <20090201195859.GH32503@citylink.fud.org.nz> References: <200902011220.18745.hselasky@c2i.net> <200902012001.06914.hselasky@c2i.net> <20090201191432.GD32503@citylink.fud.org.nz> <200902012031.56899.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200902012031.56899.hselasky@c2i.net> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: freebsd-usb@freebsd.org Subject: Re: USB2 patches X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2009 19:59:05 -0000 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 like to have the > > > original queueing mechanism intact. > > > > Can you explain this further? What is t0 vs t1? > > > > A taskqueue will execute tasks sequentially, > > 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 see > similar issues where other commands are involved: > > 1) queue DTR on cmd > 2) queue DTR off cmd > 3) queue DTR on cmd > > Using the taskqueue there is no guarantee that the last command queued is the > last command executed! That is dangerous! Because the existing taskqueue > enqueue will only increment the pending count and return, if the command/task > is already queued. > > In the example above you can end up like this: > > DTR on (pending = 2) > DTR off (pending = 1) > > 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, (1) you dont care about previous state or (2) you do care so ensure the previous state has executed. If for some reason those are not sufficient then the driver is free to implement its own queue. The current implementation in usb is quite clever but its important not to complicate the internals for situations that dont happen in real life. Andrew From owner-freebsd-usb@FreeBSD.ORG Sun Feb 1 20:03:16 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C9E5106566C; Sun, 1 Feb 2009 20:03:16 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id BF7BF8FC1B; Sun, 1 Feb 2009 20:03:15 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n11K0MMh094357; Sun, 1 Feb 2009 13:00:22 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sun, 01 Feb 2009 13:00:51 -0700 (MST) Message-Id: <20090201.130051.-2130550806.imp@bsdimp.com> To: hselasky@c2i.net From: "M. Warner Losh" In-Reply-To: <200902012031.56899.hselasky@c2i.net> References: <200902012001.06914.hselasky@c2i.net> <20090201191432.GD32503@citylink.fud.org.nz> <200902012031.56899.hselasky@c2i.net> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-usb@freebsd.org, thompsa@freebsd.org Subject: Re: USB2 patches X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2009 20:03:16 -0000 In message: <200902012031.56899.hselasky@c2i.net> Hans Petter Selasky 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 - 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 execute tasks sequentially, : : 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 see : similar issues where other commands are involved: : : 1) queue DTR on cmd : 2) queue DTR off cmd : 3) queue DTR on cmd This is a bad example. In this case, clearly you'd want to turn it on, wait for it to go on, wait a while, turn it off, wait for it to go off, wait a while, then repeat the on part. If you are trying to get a notch signal in DTR, you have to cope this way. If you are implementing an ioctl from userland to do this (as exposed by the tty system), then you'd need to wait for the DTR command to finish anyway before returning to userland, no? There's likely other reasons for wanting to do this, but DTR changes should be synchronous to the caller. Warner From owner-freebsd-usb@FreeBSD.ORG Sun Feb 1 20:37:42 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 239A4106566C; Sun, 1 Feb 2009 20:37:42 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe10.swipnet.se [212.247.155.33]) by mx1.freebsd.org (Postfix) with ESMTP id 58A1D8FC29; Sun, 1 Feb 2009 20:37:41 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=rmrU8kTBWN7SvPJ5QBgA:9 a=zTEVK1LEtGmBGfXtk00erOG5m9gA:4 a=50e4U0PicR4A:10 Received: from [85.19.218.115] (account mc467741@c2i.net HELO [10.37.1.92]) by mailfe10.swip.net (CommuniGate Pro SMTP 5.2.6) with ESMTPA id 1020179517; Sun, 01 Feb 2009 21:37:39 +0100 From: Hans Petter Selasky To: "M. Warner Losh" Date: Sun, 1 Feb 2009 21:40:01 +0100 User-Agent: KMail/1.9.7 References: <200902012001.06914.hselasky@c2i.net> <200902012031.56899.hselasky@c2i.net> <20090201.130051.-2130550806.imp@bsdimp.com> In-Reply-To: <20090201.130051.-2130550806.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902012140.04180.hselasky@c2i.net> Cc: freebsd-usb@freebsd.org, thompsa@freebsd.org Subject: Re: USB2 patches X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2009 20:37:43 -0000 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 > : see similar issues where other commands are involved: > : > : 1) queue DTR on cmd > : 2) queue DTR off cmd > : 3) queue DTR on cmd > > This is a bad example. The example is not the best. Let's pick another example: Assume you have a 3g modem and we are doing software flow control. Regularly modem status bits are transferred between host and device. Now, lets assume that the modem application has only got one thread. What will happen if transferring the RTS/CTS status bits to the modem is synchronous? Immediate data-loss! Especially at higher data rates. Let me elaborate: Assume it takes 3ms to handle a control request to program the DTR/RTS/CTS, because the device is slow. Then you have a 1024 byte buffer on a BULK endpoint which needs to be handled every 1ms. If DTR/RTS and CTS are not done async, you severely degrade the overall performance of the system, don't you agree about that, if every time you update the modem status have to wait 3ms, having to skip Rx'ed data? > In this case, clearly you'd want to turn it > on, wait for it to go on, wait a while, turn it off, wait for it to go > off, wait a while, then repeat the on part. If you are trying to get > a notch signal in DTR, you have to cope this way. According to your approach we will end up not knowing what state is programmed! It all depends on the sampling point of the softc's value, if I can express it like that. I think it is important to preserve the initial signal. If there was a level, we need to produce a level. It tells the peer something. > If you are > implementing an ioctl from userland to do this (as exposed by the tty > system), then you'd need to wait for the DTR command to finish anyway > before returning to userland, no? The MPSAFETTY API doesn't allow sleeping from what I know. All signalling via MPSAFETTY is made asynchronous. > > There's likely other reasons for wanting to do this, but DTR changes > should be synchronous to the caller. Yes and no. If the TTY device is setup for non-blocking operation, then setting the DTR should return as quick as possible. If the TTY/Modem device is setup for blocking operation, then the IOCTL should return once the DTR [for example] has been set ??? --HPS From owner-freebsd-usb@FreeBSD.ORG Sun Feb 1 20:57:47 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA019106566C; Sun, 1 Feb 2009 20:57:47 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe16.swipnet.se [212.247.155.225]) by mx1.freebsd.org (Postfix) with ESMTP id 0F0938FC0C; Sun, 1 Feb 2009 20:57:46 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=DnD7uB8Qd4W-3mlJOqsA:9 a=auK1lcAOoKIF5W0oCTEA:7 a=akk9JPSbfJFmxdYgaFHfGFSJglUA:4 a=50e4U0PicR4A:10 Received: from [85.19.218.115] (account mc467741@c2i.net HELO [10.37.1.92]) by mailfe16.swip.net (CommuniGate Pro SMTP 5.2.6) with ESMTPA id 446179965; Sun, 01 Feb 2009 21:57:45 +0100 From: Hans Petter Selasky To: Andrew Thompson Date: Sun, 1 Feb 2009 22:00:10 +0100 User-Agent: KMail/1.9.7 References: <200902011220.18745.hselasky@c2i.net> <200902012031.56899.hselasky@c2i.net> <20090201195859.GH32503@citylink.fud.org.nz> In-Reply-To: <20090201195859.GH32503@citylink.fud.org.nz> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902012200.11499.hselasky@c2i.net> Cc: freebsd-usb@freebsd.org Subject: Re: USB2 patches X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2009 20:57:48 -0000 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, (1) you dont care about previous state or > (2) you do care so ensure the previous state has executed. > "2" is not an option. MPSAFETTY cannot sleep! And there is no IOCTL to drain the DTR command, if I'm not mistaken. > If for some reason those are not sufficient then the driver is free to > implement its own queue. We don't want per-driver queues. We want one queue mechanism for USB. Like I've pointed out, last queued is last executed is a good requirement. For simple things like DTR, sure you could coalesque state changes, but again, that is not optimal, because it is unpredictable. Also see my other e-mail with same subject to Warner. It's like with queues. There is SLIST, LIST, TAILQ, STAILQ. Different need needs different macro. The same should be the case with taskqueues. I have looked at the internals of the taskqueue and the only reordering mechanism is a priority mechanism. To some extent my implementation is about dynamic and efficient priority re-ordering of messages. The taskqueue_enqueue() can have a complexity of X squared, X*X, given the iteration accross the messages already queued, in some cases. Mine has a complexity of 1. What do you think? Is it impossible to add another queue function to the taskqueue system? > The current implementation in usb is quite > clever but its important not to complicate the internals for situations > that dont happen in real life. I would argue that the taskqueue approach is too simple for USB. --HPS From owner-freebsd-usb@FreeBSD.ORG Sun Feb 1 21:09:19 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 002B310658A0; Sun, 1 Feb 2009 21:09:18 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id AF5BE8FC0C; Sun, 1 Feb 2009 21:09:18 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n11L7kdx094895; Sun, 1 Feb 2009 14:07:46 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sun, 01 Feb 2009 14:08:15 -0700 (MST) Message-Id: <20090201.140815.-1322632562.imp@bsdimp.com> To: hselasky@c2i.net From: "M. Warner Losh" In-Reply-To: <200902012200.11499.hselasky@c2i.net> References: <200902012031.56899.hselasky@c2i.net> <20090201195859.GH32503@citylink.fud.org.nz> <200902012200.11499.hselasky@c2i.net> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-usb@freebsd.org, thompsa@freebsd.org Subject: Re: USB2 patches X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2009 21:09:22 -0000 In message: <200902012200.11499.hselasky@c2i.net> Hans Petter Selasky writes: : "2" is not an option. MPSAFETTY cannot sleep! And there is no IOCTL to drain : the DTR command, if I'm not mistaken. MPSAFETTY can sleep in the ioctl() context. It does hold the tty lock, so when it wakes up it will know that the tty hasn't gone away... The policy is please don't sleep, but it isn't totally forbidden. It would certainly be an option to queue the first one, note it is pending in the softc and return, then block on subsequent ones until the first one finishes achieving a delayed synchronous behavior and avoiding the problems that you talked about. In this case, you avoid the sleep when you can, and sleep when you can't. But wouldn't the taskqueue run before the process that queued the task? Shouldn't it have a higher priority? And can't you arrange the taskqueue such that it processes 'modem state change queue' requests and have the counter be the number of requests on the queue? then it could do one at a time and you wouldn't have to worry about all this... Warner From owner-freebsd-usb@FreeBSD.ORG Sun Feb 1 21:36:51 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC6A4106567D; Sun, 1 Feb 2009 21:36:51 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 93BC38FC1A; Sun, 1 Feb 2009 21:36:51 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id 73B9E1A3C39; Sun, 1 Feb 2009 13:36:51 -0800 (PST) Date: Sun, 1 Feb 2009 13:36:51 -0800 From: Alfred Perlstein To: Thomas Sparrevohn Message-ID: <20090201213651.GK65558@elvis.mu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i Cc: scottl@freebsd.org, freebsd-usb@freebsd.org, 'Andrew Thompson' Subject: Re: USB2 patches X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2009 21:36:52 -0000 I'm still waiting for Scott Long to give me his decision about the direction to go on that one. Scott, can you comment? -Alfred * Thomas Sparrevohn [090201 06:43] wrote: > Before we switch GENERIC - would it be possibly to have the bus dma issue > committed as well? Without the patch manually added none of my umass devices > work under amd64 > > -----Original Message----- > From: owner-freebsd-usb@freebsd.org [mailto:owner-freebsd-usb@freebsd.org] > On Behalf Of Alfred 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 [090131 15:20] wrote: > > 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, > > http://people.freebsd.org/~thompsa/usb_head1.diff > > 73 files changed, 9229 insertions(+), 13261 deletions(-) > > > > but its rather large so it may be easier to look at the various changes > > via the svn web interface. > > > > http://svn.freebsd.org/viewvc/base/user/thompsa/usb/ > > > > > > r187750 > > http://svn.freebsd.org/viewvc/base?view=revision&revision=187750 > > > > Change over to using taskqueue(9) instead of hand rolled threads and > > the config_td system. This removes the config_td code and makes the > > API much simpler to use. > > > > r187751, r187752, r187753, r187754, r187755, r187756 > > http://svn.freebsd.org/viewvc/base?view=revision&revision=187751 > > > > Change over to usb2_proc w/ taskqueues for the usb2/ethernet, > > usb2/serial and usb2/wlan code. > > > > r187965 > > http://svn.freebsd.org/viewvc/base?view=revision&revision=187965 > > > > Move most of the ifnet logic into the usb2_ethernet module, this > includes, > > - make all usb ethernet interfaces named ue%d > > - handle all threading in usb2_ethernet > > - provide default ioctl handler > > - handle mbuf rx > > - provide locked callbacks for init,start,stop,etc > > > > The drivers are not much more than data pushers now. > > > > > > regards, > > Andrew > > -- > - Alfred Perlstein > _______________________________________________ > freebsd-usb@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-usb > To unsubscribe, send any mail to "freebsd-usb-unsubscribe@freebsd.org" > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- - Alfred Perlstein From owner-freebsd-usb@FreeBSD.ORG Sun Feb 1 22:38:39 2009 Return-Path: Delivered-To: usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40E70106566C for ; Sun, 1 Feb 2009 22:38:39 +0000 (UTC) (envelope-from chris@young-alumni.com) Received: from mail.oldschoolpunx.net (cpe-72-177-10-243.austin.res.rr.com [72.177.10.243]) by mx1.freebsd.org (Postfix) with ESMTP id C77F98FC21 for ; Sun, 1 Feb 2009 22:38:38 +0000 (UTC) (envelope-from chris@young-alumni.com) Received: by mail.oldschoolpunx.net (Postfix, from userid 58) id 634A689025; Sun, 1 Feb 2009 16:21:46 -0600 (CST) Received: from [192.168.8.199] (unknown [192.168.8.199]) by mail.oldschoolpunx.net (Postfix) with ESMTPSA id 6FA6A89017 for ; Sun, 1 Feb 2009 16:17:18 -0600 (CST) Resent-To: usb@freebsd.org From: Chris Ruiz To: Thomas Sparrevohn In-Reply-To: <009401c9847b$81b38700$851a9500$@Sparrevohn@btinternet.com> Resent-From: Chris Ruiz References: <20090131231957.GB31825@citylink.fud.org.nz> <20090201030628.GE65558@elvis.mu.org> <009401c9847b$81b38700$851a9500$@Sparrevohn@btinternet.com> Message-Id: Resent-Date: Sun, 1 Feb 2009 16:17:18 -0600 Mime-Version: 1.0 (Apple Message framework v930.3) Date: Sun, 1 Feb 2009 16:08:18 -0600 X-Mailer: Apple Mail (2.930.3) Resent-Message-Id: <20090201221718.6FA6A89017@mail.oldschoolpunx.net> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: Re: USB2 patches X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2009 22:38:39 -0000 On Feb 1, 2009, at 8:43 AM, Thomas Sparrevohn wrote: > Before we switch GENERIC - would it be possibly to have the bus dma > issue > committed as well? Without the patch manually added none of my umass > devices > work under amd64 I just wanted to chime in with a "me too" here. I applied a patch from the wiki and it has fixed my umass problems on amd64. This needs to be committed before switching usb2 to be default. Thanks, Chris > > > -----Original Message----- > From: owner-freebsd-usb@freebsd.org [mailto:owner-freebsd-usb@freebsd.org > ] > On Behalf Of Alfred 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 [090131 15:20] wrote: >> 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, >> http://people.freebsd.org/~thompsa/usb_head1.diff >> 73 files changed, 9229 insertions(+), 13261 deletions(-) >> >> but its rather large so it may be easier to look at the various >> changes >> via the svn web interface. >> >> http://svn.freebsd.org/viewvc/base/user/thompsa/usb/ >> >> >> r187750 >> http://svn.freebsd.org/viewvc/base?view=revision&revision=187750 >> >> Change over to using taskqueue(9) instead of hand rolled threads and >> the config_td system. This removes the config_td code and makes the >> API much simpler to use. >> >> r187751, r187752, r187753, r187754, r187755, r187756 >> http://svn.freebsd.org/viewvc/base?view=revision&revision=187751 >> >> Change over to usb2_proc w/ taskqueues for the usb2/ethernet, >> usb2/serial and usb2/wlan code. >> >> r187965 >> http://svn.freebsd.org/viewvc/base?view=revision&revision=187965 >> >> Move most of the ifnet logic into the usb2_ethernet module, this > includes, >> - make all usb ethernet interfaces named ue%d >> - handle all threading in usb2_ethernet >> - provide default ioctl handler >> - handle mbuf rx >> - provide locked callbacks for init,start,stop,etc >> >> The drivers are not much more than data pushers now. >> >> >> regards, >> Andrew > > -- > - Alfred Perlstein > _______________________________________________ > freebsd-usb@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-usb > To unsubscribe, send any mail to "freebsd-usb-unsubscribe@freebsd.org" > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > freebsd-usb@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-usb > To unsubscribe, send any mail to "freebsd-usb-unsubscribe@freebsd.org" From owner-freebsd-usb@FreeBSD.ORG Mon Feb 2 04:24:55 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 321451065674 for ; Mon, 2 Feb 2009 04:24:55 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from pele.citylink.co.nz (pele.citylink.co.nz [202.8.44.226]) by mx1.freebsd.org (Postfix) with ESMTP id E94CD8FC23 for ; Mon, 2 Feb 2009 04:24:54 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) by pele.citylink.co.nz (Postfix) with ESMTP id 49529FF42; Mon, 2 Feb 2009 17:24:54 +1300 (NZDT) X-Virus-Scanned: Debian amavisd-new at citylink.co.nz Received: from pele.citylink.co.nz ([127.0.0.1]) by localhost (pele.citylink.co.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8aJlB3BFLjPq; Mon, 2 Feb 2009 17:24:50 +1300 (NZDT) Received: from citylink.fud.org.nz (unknown [202.8.44.45]) by pele.citylink.co.nz (Postfix) with ESMTP; Mon, 2 Feb 2009 17:24:50 +1300 (NZDT) Received: by citylink.fud.org.nz (Postfix, from userid 1001) id 47D4411428; Mon, 2 Feb 2009 17:24:50 +1300 (NZDT) Date: Sun, 1 Feb 2009 20:24:50 -0800 From: Andrew Thompson To: Hans Petter Selasky Message-ID: <20090202042450.GA45701@citylink.fud.org.nz> References: <200902011220.18745.hselasky@c2i.net> <200902011922.16810.hselasky@c2i.net> <20090201.112756.1320088159.imp@bsdimp.com> <200902011938.48670.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200902011938.48670.hselasky@c2i.net> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: freebsd-usb@freebsd.org Subject: Re: USB2 patches X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Feb 2009 04:24:55 -0000 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.hselasky@c2i.net> > > > > Hans Petter Selasky 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 being drained > > : from inside the taskqueue callback, the taskqueue system has to be > > : modified! It cannot replace the existing system like it is now! > > > > Why does the taskqueue system need to provide that? Why can't the > > driver set a dying flag in the softc to communicate this fact to the > > taskqueue tasks? > > That's also possible. Thomas already made a "struct usb2_task" I think, where > this flag could be added. I have been thinking about this more. The main issue is usb requests timing out when the device is yanked, the udev structure should keep state on this and set it as detached before calling the device detach routine. This will allow usb requests that may be running in the taskqueue to abort gracefully and taskqueue should drain quite easily. If the device hasnt been yanked then it will have no issues draining as the queued tasks will happily run to completion. Andrew From owner-freebsd-usb@FreeBSD.ORG Mon Feb 2 11:07:03 2009 Return-Path: Delivered-To: freebsd-usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBE2E10656FB for ; Mon, 2 Feb 2009 11:07:03 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id D56828FC26 for ; Mon, 2 Feb 2009 11:07:03 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n12B73sK094605 for ; Mon, 2 Feb 2009 11:07:03 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n12B737p094601 for freebsd-usb@FreeBSD.org; Mon, 2 Feb 2009 11:07:03 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 2 Feb 2009 11:07:03 GMT Message-Id: <200902021107.n12B737p094601@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-usb@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-usb@FreeBSD.org X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Feb 2009 11:07:05 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- f usb/131123 usb [patch] re-add UQ_ASSUME_CM_OVER_DATA USB quirk o usb/131074 usb no run-time detection of usb devices plugged into exte o usb/130736 usb Page fault unplugging USB stick o usb/130325 usb [usb] [patch] fix tools/tools/usb/print-usb-if-vids.sh o usb/130230 usb Samsung Electronics YP-U3 does not attach in 7.1-RELEA o usb/130208 usb Boot process severely hampered by umass0 error o usb/130122 usb [newusb] DVD drive detects as 'da' device o usb/130066 usb [newusb] Serial adaptor use fail with 'unsupported spe o usb/129964 usb [newusb] disconnection of ugen devices isn't logged o bin/129963 usb [newusb] usbconfig(8) fails with misleading error when o docs/129962 usb [newusb] usbconfig(8) refers to non-existant usb2_core o usb/129945 usb [usbdevs] [patch] add u3g support for Longcheer WM66 U o usb/129766 usb [usb] plugging in usb modem HUAWEI E226 panics system o usb/129758 usb [uftdi] [patch] add Pyramid LCD usb support o usb/129673 usb [uhci] uhci (uhub) confused on replugging USB 1.1 scan o usb/129522 usb [ubsa] [patch] add support for ZTE AC8700 modem o usb/129500 usb [umass] [panic] FreeBSD Crashes when connecting SanDis o usb/129311 usb [usb] [panic] Instant crash with an USB card reader o usb/129251 usb [usbdevs] [patch] Liebert UPS being assigned uhid and o usb/129173 usb [uplcom] [patch] Add support for Corega CG-USBRS232R a s usb/128990 usb [usb] u3g does not handle RTS/CTS available on for exa o usb/128977 usb [usb] [patch] uaudio is not full duplex o usb/128803 usb [usbdevs] [patch] Quirk for I-Tuner Networks USBLCD4X2 o usb/128590 usb [patch] [newusb] Updates to NOTES for new USB stack o usb/128485 usb [umodem] [patch] Nokia N80 modem support o usb/128425 usb [umass] Cannot Connect Maxtor Onetouch 4 USB drive f usb/128418 usb [panic] [rum] loading if_rum causes panic, looks like o usb/128324 usb [uplcom] [patch] remove baud rate restriction for PL23 o usb/127980 usb [umass] [patch] Fix Samsung YP U2 MP3 player on 7.x an o usb/127926 usb [boot] USB Timeout during bootup o usb/127549 usb [umass] [patch] Meizu MiniPlayer M6 (SL) requires some s usb/127453 usb [request] ubsa, uark, ubser, uftdi, and friends should o usb/127423 usb [boot] BTX halted on Gigabyte GA-MA69VM-S2 / AMD Sempr o usb/127342 usb [boot] cannot enable usb keyboard and mouse support in o kern/127222 usb [ohci]: Regression in 7.0 usb storage generic driver o usb/126884 usb [ugen] [patch] Bug in buffer handling in ugen.c f usb/126848 usb [usb]: USB Keyboard hangs during Installation o usb/126740 usb [ulpt] doesn't work on 7.0-RELEASE, 10 second stall be o usb/126519 usb [usb] [panic] panic when plugging in an iphone o kern/126396 usb [panic] kernel panic after unplug USB Bluetooth device o usb/125736 usb [ukbd] [hang] system hangs after AT keyboard detect if o usb/125631 usb [ums] [panic] kernel panic during bootup while 'Logite o usb/125510 usb [panic] repeated plug and unplug of USB mass storage d o usb/125450 usb [panic] Removing USB flash card while being accessed c o usb/125264 usb [patch] sysctl for set usb mouse rate (very useful for o usb/125238 usb [ums] Habu Mouse turns off in X o usb/125088 usb [keyboard] Touchpad not detected on Adesso AKB-430UG U o usb/125072 usb [uplcom] [patch] add Mobile Action MA-620 Infrared Ada o usb/124980 usb [panic] kernel panic on detaching unmounted umass devi o kern/124777 usb [ucom] USB cua devices don't revert to tty devices whe o usb/124758 usb [rum] [panic] rum panics SMP kernel o usb/124708 usb [panic] Kernel panic on USB KVM reattach o usb/124604 usb [ums] Microsoft combo wireless mouse doesn't work o usb/123969 usb [usb] Supermicro H8SMi-2 usb problem: port reset faile o usb/123714 usb [usb] [panic] Panic when hald-storage-probe runs with o usb/123691 usb usbd(8): usbd hangs o usb/123690 usb [usb] [panic] Panic on USB device insertion when usb l o usb/123611 usb [usb] BBB reset failed, STALLED from Imation/Mitsumi U o usb/123509 usb [umass] continuous reset Samsung SGH-G600 phone o usb/123352 usb [usbdevs] [patch] Add Option GTMAX3.6/7.2 and Quallcom o usb/123351 usb [usbdevs] [patch] Add Reiner SCT cyberJack, Omnikey [2 o usb/122992 usb [umass] [patch] MotoROKR Z6 Phone not recognised by um o usb/122956 usb [ubsa] [patch] add support for Novatel Wireless XU870 o usb/122936 usb [ucom] [ubsa] Device does not receive interrupt o usb/122905 usb [ubsa] [patch] add Huawei E220 to ubsa o usb/122819 usb [usb] [patch] Patch to provide dynamic additions to th o usb/122813 usb [udbp] [request] udbp driver should be removed in favo o usb/122621 usb [patch] [request] New driver for Sierra Wireless 3G US o usb/122547 usb [ehci] USB Printer not being recognized after reboot o usb/122539 usb [ohci] [panic] AnyDATA ADU-E1000D - kernel panic: ohci o usb/122483 usb [panic] [ulpt] Repeatable panic in 7.0-STABLE o usb/122119 usb [umass] umass device causes creation of daX but not da o usb/122025 usb [uscanner] [patch] uscanner does not attach to Epson R o usb/121755 usb [ohci] [patch] Fix panic after ohci/uhub cardbus devic o usb/121734 usb [ugen] ugen HP1022 printer device not working since up o usb/121708 usb [keyboard] nforce 650i mobo w/ usb keyboard infinite k o usb/121474 usb [cam] [patch] QUIRK: SAMSUNG HM250JI in LaCie usb hard o usb/121426 usb [patch] [uscanner] add HP ScanJet 3570C o usb/121275 usb [boot] FreeBSD fails to boot with usb legacy support e o usb/121232 usb [usb] [panic] USB CardBus card removal causes reboot s p usb/121184 usb [uipaq] [patch] add ids from linux ipaq driver (plus a o usb/121169 usb [umass] Issues with usb mp3 player o usb/121045 usb [uftdi] [patch] Add support for PC-OP-RS1 and KURO-RS o usb/120786 usb [usb] [panic] Kernel panic when forced umount of a det o usb/120729 usb [panic] fault while in kernel mode with connecting USB o usb/120572 usb [umass] [patch] quirk to support ASUS P535 as umass (a o usb/120321 usb [hang] System hangs when transferring data to WD MyBoo o usb/120283 usb [panic] Automation reboot with wireless keyboard & mou o usb/120034 usb [hang] 6.2 & 6.3 hangs on boot at usb0: OHCI with 1.5 o usb/120017 usb [ehci] [patch] CS5536 (AMD Geode) USB 2.0 quirk o usb/119981 usb [axe] [patch] add support for LOGITEC LAN-GTJ/U2 gigab o usb/119977 usb [ums] Mouse does not work in a Cherry-USB keyboard/mou o usb/119653 usb [cam] [patch] iriver s7 player sync cache error patch o usb/119633 usb [umass] umass0: BBB reset failed, IOERROR [regression] o usb/119513 usb [irq] inserting dlink dwl-g630 wireless card results i o usb/119509 usb [usb] USB flaky on Dell Optiplex 755 o usb/119481 usb [hang] FreeBSD not responding after connecting USB-Mas o usb/119389 usb [umass] Sony DSC-W1 CBI reset failed, STALLED [regress o usb/119227 usb [ubsa] [patch] ubsa buffer is too small; should be tun o usb/119201 usb [cam] [patch] Quirks for Olympus FE-210 camera, LG and o usb/118686 usb [usbdevs] [patch] teach usbdevs / ubsa(4) about Huawei o usb/118485 usb [usbdevs] [patch] Logitech Headset Workaround o usb/118480 usb [umass] Timeout in USB mass storage freezes vfs layer o usb/118353 usb [panic] [ppp] repeatable kernel panic during ppp(4) se o usb/118141 usb [ucom] usb serial and nokia phones ucomreadcb ucomread o usb/118140 usb [ucom] [patch] quick hack for ucom to get it behave wi o usb/118098 usb [umass] 6th gen iPod causes problems when disconnectin o usb/117955 usb [umass] [panic] inserting minolta dimage a2 crashes OS o usb/117946 usb [panic] D-Link DUB-E100 rev. B1 crashes FreeBSD 7.0-BE o usb/117938 usb [ums] [patch] Adding support for MS WL Natural and MS o usb/117911 usb [ums] [request] Mouse Gembird MUSWC not work o usb/117893 usb [umass] Lacie USB DVD writing failing o usb/117613 usb [uhci] [irq] uhci interrupt storm & USB leaked memory o usb/117598 usb [uaudio] [patch] Not possible to record with Plantroni o usb/117313 usb [umass] [panic] panic on usb camera insertion o usb/117200 usb [ugen] ugen0 prints strange string on attach if detach o usb/117185 usb [umodem] [patch] Add support for UNION interface descr o usb/117183 usb [panic] USB/fusefs -- panic while transferring large a o usb/116947 usb [ukbd] [patch] [regression] enable boot protocol on th o usb/116699 usb [usbhid] USB HID devices do not initialize at system b o usb/116561 usb [umodem] [panic] RELENG_6 umodem panic "trying to slee o usb/116282 usb [ulpt] Cannot print on USB HP LJ1018 or LJ1300 o usb/115935 usb [usbdevs] [patch] kernel counterproductively attaches o usb/115933 usb [uftdi] [patch] RATOC REX-USB60F (usb serial converter o usb/115400 usb [ehci] Problem with EHCI on ASUS M2N4-SLI o usb/115298 usb [ulpt] [panic] Turning off USB printer panics kernel o usb/114916 usb [umass] [patch] USB Maxtor drive (L300RO) requires qui o kern/114780 usb [uplcom] [panic] Panics while stress testing the uplco o usb/114682 usb [umass] generic USB media-card reader unusable o usb/114310 usb [libusb] [patch] [panic] USB hub attachment panics ker o usb/114068 usb [umass] [patch] Problems with connection of the umass o conf/114013 usb [patch] WITHOUT_USB allow to compil a lot of USB stuff s usb/113977 usb [request] Need a way to set mode of USB disk's write c o usb/113672 usb [ehci] [panic] Kernel panic with AEWIN CB6971 s usb/113629 usb [ukbd] Dropped USB keyboard events on Dell Latitude D6 o usb/113432 usb [ucom] WARNING: attempt to net_add_domain(netgraph) af a usb/113060 usb [usbdevs] [patch] Samsung printer not working in bidir o usb/112944 usb [ulpt] [patch] Bi-directional access to HP LaserJet 10 o usb/112640 usb [usb] [hang] Kernel freezes when writing a file to an o usb/112631 usb [panic] Problem with SONY DSC-S80 camera on umount s usb/112568 usb [umass] [request] USB mode may wrong when mounting Pla o usb/112463 usb [umass] problem with Samsung USB DVD writer, libscg an o usb/112461 usb [ehci] [request] ehci USB 2.0 doesn't work on nforce4 o usb/111753 usb [uhid] [panic] Replicable system panic involving UHID s usb/110991 usb [usbdevs] [patch] QUIRK: Super Top IDE DEVICE (depends o usb/110988 usb [umass] [patch] Handling of quirk IGNORE_RESIDUE is um o usb/110856 usb [ugen] [patch] interrupt in msgs are truncated when bu o usb/110197 usb [umass] Sony PSP umass device does not detach from EHC o usb/109397 usb [panic] on boot from USB flash o usb/109274 usb [usb] MCP55 USB Controller fails to attach in AMD64 Cu o usb/108513 usb [umass] Creative MuVo TX FM fails in 6.2-RELEASE [regr s usb/108344 usb [panic] kernel with atausb panics when unplugging USB o usb/108056 usb [ohci] Mouse gets powered off during device probe when o usb/107935 usb [uplcom] [panic] panic while accessing /dev/cuaU0 o usb/107924 usb [patch] usbd(8) does not call detach o usb/107848 usb [umass] [request] cannot access Samsung flash disk o usb/107827 usb [ohci] [panic] ohci_add_done addr not found o usb/107496 usb [uhub] USB device problem on RELENG_6_2 (SHORT_XFER) [ o usb/107446 usb [umass] umass problems (usb and fw disks) o usb/107388 usb [patch] [request] new driver: add utoppy device from N o usb/107248 usb [umass] [patch] scsi_da.c quirk for Cowon iAUDIO X5 MP o usb/107243 usb [cam] [patch] Apacer USB Flash Drive quirk o usb/106861 usb [usbdevs] [patch]: usbdevs update: Add product ACER Ze s usb/106832 usb [usb] USB HP printer is not detected by kernel when AC o usb/106648 usb [umass] [hang] USB Floppy on D1950 10 min Hang on Inse o usb/106621 usb [axe] [patch] DLINK DUB-E100 support broken o usb/106615 usb [uftdi] uftdi module does not automatically load with o usb/106041 usb [usb] [request] FreeBSD does not recognise Mustek Bear o usb/105361 usb [panic] Kernel panic during unmounting mass storage (C o usb/105186 usb [ehci] [panic] USB 2.0/ehci on FreeBSD 6.2-PRE/AMD64 c o usb/105065 usb [ata] [usb] SATA - USB Bridge o usb/104830 usb [umass] system crashes when copying data to umass devi o usb/104645 usb [umass] [request] Rave C-201 MP3 player does not commu o usb/104352 usb [ural] [patch] ural driver doesnt work o usb/104292 usb [umass] [hang] system lockup on forced umount of usb-s o usb/104290 usb [umass] [patch] quirk: TOSHIBA DVD-RAM drive (libretto o usb/103917 usb [uhub] USB driver reports "Addr 0 should never happen" o usb/103418 usb usbhidctl(1): [patch] [request] usbhidctl: add ability o usb/103289 usb [request] USB 2.0 problems on AMD LX-800 CPU and CS-55 o usb/103046 usb [ulpt] [patch] ulpt event driven I/O with select(2) an o usb/103025 usb [uhub] [panic] wrong detection of USB device for FreeB o usb/102976 usb [panic] Casio Exilim Digital Camera causes panic on in o usb/102678 usb [keyboard] Dell PowerEdge DRAC5 USB Keyboard does not o usb/102066 usb [ukbd] usb keyboard and multimedia keys don't work o usb/101775 usb [libusbhid] [patch] possible error in report descripto o usb/101761 usb [usb] [patch] [request] usb.h: increase maximal size o o usb/101752 usb [umass] [panic] 6.1-RELEASE kernel panic on usb device o usb/101448 usb [ohci] FBSD 6.1-STABLE/AMD64 crashes under heavy USB/O o usb/101096 usb [ural] [panic] USB WLAN occasionally causes kernel-pan o usb/100746 usb [keyboard] system does not boot due to USB keyboard pr o usb/99538 usb [keyboard] while using USB keyboard default params of o usb/99431 usb [keyboard] FreeBSD on MSI 6566E (Intel 845E motherboar o usb/98343 usb [boot] BBB reset failed errors with Creative Muvo MP3 o usb/97472 usb [cam] [patch] add support for Olympus C150,D390 s usb/97286 usb [mouse] [request] MS Wireless Intellimouse Explorer 2. o usb/97175 usb [umass] [hang] USB cardreader hangs system o usb/96457 usb [umass] [panic] fatback on umass = reboot o usb/96381 usb [cam] [patch] add a quirk table entry for a flash ram o usb/96224 usb [usb] [msdosfs] mount_msdosfs cause page fault in sync s usb/96120 usb [ums] [request] USB mouse not always detected s usb/95636 usb [umass] [boot] 5 minute delay at boot when using VT620 o usb/95562 usb [umass] Write Stress in USB Mass drive causes "vinvalb s usb/95348 usb [keyboard] USB keyboard unplug causes noise on screen o usb/95037 usb [umass] USB disk not recognized on hot-plug. o usb/94897 usb [panic] Kernel Panic when cleanly unmounting USB disk o usb/94717 usb [ulpt] Reading from /dev/ulpt can break work of a UHCI o usb/94384 usb [panic] kernel panic with usb2 hardware o usb/93872 usb [cam] [patch] SCSI quirk required for ELTA 8061 OL USB o usb/93828 usb [ohci] [panic] ohci causes panic on boot (HP Pavillion o usb/93408 usb [mouse] hw.acpi.cpu.cx_lowest=C3 on AMD Turion causes o usb/93389 usb [umass] [patch] Digital Camera Pentax S60 don't work o usb/93155 usb [ulpt] /dev/ulpt0: device busy, USB printer does not w o usb/92852 usb [ums] [patch] Vertical scroll not working properly on o usb/92171 usb [panic] panic unplugging Vodafone Mobile Connect (UMTS o usb/92142 usb [uhub] SET_ADDR_FAILED and SHORT_XFER errors from usb o usb/92083 usb [ural] [panic] panic using WPA on ural NIC in 6.0-RELE o usb/92052 usb [ulpt] usbd causes defunct process with busy file-hand o usb/91906 usb [ehci] [hang] FreeBSD hangs while booting with USB leg o usb/91896 usb camcontrol(8): Serial Number of USB Memory Sticks is n o usb/91811 usb [umass] Compact Flash in HP Photosmart 2610 return " o usb/91629 usb [usb] usbd_abort_pipe() may result in infinite loop o usb/91546 usb [umodem] [patch] Nokia 6630 mobile phone does not work o usb/91538 usb [ulpt] [patch] Unable to print to EPSON CX3500 o usb/91283 usb [boot] [regression] booting very slow with usb devices o usb/91238 usb [umass] USB tape unit fails to write a second tape fil o usb/90700 usb [umass] [panic] Kernel panic on connect/mount/use umas o usb/89954 usb [umass] [panic] USB Disk driver race condition? s usb/89003 usb [request] LaCie Firewire drive not properly supported o usb/88743 usb [hang] [regression] USB makes kernel hang at boot (reg o usb/88408 usb [axe] axe0 read PHY failed o usb/87648 usb [mouse] Logitech USB-optical mouse problem. o usb/87224 usb [usb] Cannot mount USB Zip750 o usb/86767 usb [umass] [patch] bogus "slice starts beyond end of the o usb/86298 usb [mouse] Known good USB mouse won't work with correct s s usb/85067 usb [uscanner] Cannot attach ScanJet 4300C to usb device f usb/84750 usb [hang] 6-BETA2 reboot/shutdown with root_fs on externa s usb/84336 usb [usb] [reboot] instant system reboot when unmounting a o usb/84326 usb [umass] Panic trying to connect SCSI tape drive via US o usb/83977 usb [ucom] [panic] ucom1: open bulk out error (addr 2): IN o usb/83863 usb [ugen] Communication problem between opensc/openct via o usb/83756 usb [ums] [patch] Microsoft Intellimouse Explorer 4.0A doe f usb/83677 usb [usb] [request] usb controller often not detected (Sun o usb/83563 usb [umass] [panic] Page Fault while detaching Mpman Usb d o usb/83504 usb [kernel] [patch] SpeedTouch USB stop working on recent o usb/82660 usb [ehci] [panic] EHCI: I/O stuck in state 'physrd'/panic s usb/82569 usb [umass] [panic] USB mass storage plug/unplug causes sy o usb/82520 usb [udbp] [reboot] Reboot when USL101 connected o usb/82350 usb [ucom] [panic] null pointer dereference in USB stack o usb/81621 usb [ehci] [hang] external hd hangs under load on ehci o usb/80935 usb [uvisor] [patch] uvisor.c is not work with CLIE TH55. o usb/80862 usb [patch] USB locking issues: missing some Giant calls o usb/80854 usb [patch] [request] suggestion for new iface-no-probe me o usb/80829 usb [modules] [panic] possible panic when loading USB-modu s usb/80777 usb [request] usb_rem_task() should wait for callback to c s usb/80776 usb [udav] [request] UDAV device driver shouldn't use usb_ o usb/80774 usb [patch] have "usbd_find_desc" in line with the other " o usb/80361 usb [umass] [patch] mounting of Dell usb-stick fails o usb/80040 usb [hang] Use of sound mixer causes system freeze with ua o usb/79723 usb [usb] [request] prepare for high speed isochronous tra o usb/79722 usb [ehci] wrong alignments in ehci.h a usb/79656 usb [ehci] RHSC interrupts lost o usb/79524 usb [ulpt] printing to Minolta PagePro 1[23]xxW via USB fa o usb/79287 usb [uhci] [hang] UHCI hang after interrupt transfer o usb/79269 usb [ohci] USB ohci da0 plug/unplug causes crashes and loc o usb/78984 usb [umass] [patch] Creative MUVO umass failure o usb/77294 usb [ucom] [panic] ucom + ulpcom panic o usb/77184 usb [umass] [panic] kernel panic on USB device disconnect, o usb/76732 usb [ums] Mouse problems with USB KVM Switch o usb/76653 usb [umass] [patch] Problem with Asahi Optical usb device o usb/76461 usb [umass] disklabel of umass(4)-CAM(4)-da(4) not used by o usb/76395 usb [uhci] USB printer does not work, usbdevs says "addr 0 s usb/75928 usb [umass] [request] Cytronix SmartMedia card (SMC) reade o usb/75800 usb [ucom] ucom1: init failed STALLED error in time of syn o usb/75797 usb [sound] 5.3-STABLE(2005 1/4) detect USB headset, But c o usb/75764 usb [umass] [patch] "umass0: Phase Error" - no device for o usb/75705 usb [umass] [panic] da0 attach / Optio S4 (with backtrace) o usb/74771 usb [umass] [hang] mounting write-protected umass device a s usb/74453 usb [umass] [patch] Q-lity CD-RW USB ECW-043 (ScanLogic SL o usb/74211 usb [umass] USB flash drive causes CAM status 0x4 on 4.10R o usb/73307 usb [panic] Kernel panics on USB disconnect s usb/72733 usb [ucom] [request] Kyocera 7135 Palm OS connection probl o usb/71455 usb [umass] Slow USB umass performance of 5.3 o usb/71417 usb [ugen] Cryptoflex e-gate USB token (ugen0) communicati o usb/71416 usb [ugen] Cryptoflex e-gate USB token (ugen0) detach is n o usb/71280 usb [aue] aue0 device (linksys usb100tx) doesn't work in 1 o usb/71155 usb [ulpt] misbehaving usb-printer hangs processes, causes o usb/70523 usb [umct] [patch] umct sending/receiving wrong characters o usb/69006 usb [usbdevs] [patch] Apple Cinema Display hangs USB ports o usb/68232 usb [ugen] [patch] ugen(4) isochronous handling correction o usb/67301 usb [uftdi] [panic] RTS and system panic o usb/66547 usb [ucom] Palm Tungsten T USB does not initialize correct o usb/63621 usb [umass] [panic] USB MemoryStick Reader stalls/crashes s usb/62257 usb [umass] [request] card reader UCR-61S2B is only half-s o usb/59698 usb [keyboard] [patch] Rework of ukbd HID to AT code trans s bin/57255 usb [patch] usbd(8) and multi-function devices s usb/52026 usb [usb] [request] umass driver support for InSystem ISD2 s usb/51958 usb [urio] [patch] update for urio driver o i386/46371 usb USB controller cannot be initialized on IBM Netfinity o usb/40948 usb [umass] [request] USB HP CDW8200 does not work o usb/30929 usb [usb] [patch] use usbd to initialize USB ADSL modem 300 problems total. From owner-freebsd-usb@FreeBSD.ORG Mon Feb 2 19:36:28 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 744AD106566B; Mon, 2 Feb 2009 19:36:28 +0000 (UTC) (envelope-from stevecalfee@gmail.com) Received: from mail-ew0-f21.google.com (mail-ew0-f21.google.com [209.85.219.21]) by mx1.freebsd.org (Postfix) with ESMTP id D0ACA8FC12; Mon, 2 Feb 2009 19:36:27 +0000 (UTC) (envelope-from stevecalfee@gmail.com) Received: by ewy14 with SMTP id 14so2605339ewy.19 for ; Mon, 02 Feb 2009 11:36:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=iFSX8xk+/7iqLaQdrWH8EUWJASU2I4bJLaTqtzcUgzY=; b=YSoqzYUGF6rPAQE6WlQGTW2mF8rTte0EdyUbHuA62oOkVbuem8mngEqIVmtIPdfqd7 qincKbRZXgZjKuyZ9ES0tkY/o25feqDNjX98Y7OvTM7momguR1CEcfeIe8polwFc32kP qvcWhomTO64Rj6X8sCDeyW5Yw44Kzz2sLr2ZM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=EOauHJw7GQ3dPvlxIDXjVX0foH93Zcx1pncFRdf2pclmQbmbGHjMTwhl6mj52/WLIL 9NVHm7t1sUrA/GKnRs4BiQ0VK9pkJ0pMAz/3TzoqQWI/7+qI2G87sPE+bRuHUquNo3GK ni531IGXNHdr8uFlPL4ezaHHfjf65j9dsb6HM= MIME-Version: 1.0 Received: by 10.210.58.13 with SMTP id g13mr123078eba.144.1233603385370; Mon, 02 Feb 2009 11:36:25 -0800 (PST) In-Reply-To: <200901311014.01419.hselasky@freebsd.org> References: <4a5ff6bc0901301732t7233335ch1077a74605fffb81@mail.gmail.com> <200901311014.01419.hselasky@freebsd.org> Date: Mon, 2 Feb 2009 11:36:25 -0800 Message-ID: <4a5ff6bc0902021136w193c048am1f32c377de25d70e@mail.gmail.com> From: Steve Calfee To: Hans Petter Selasky Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: freebsd-usb@freebsd.org Subject: Re: newusb/usb2 build breakage in tinybsd X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Feb 2009 19:36:29 -0000 Hi Hans, On Sat, Jan 31, 2009 at 1:13 AM, Hans Petter Selasky wrote: > Hi Steve, > > On Saturday 31 January 2009, Steve Calfee wrote: >> Hi, >> >> I am trying to backport usb2 to freebsd7.0. I have followed the >> instructions at http://www.selasky.org/hans_petter/usb4bsd/index.html >> and things work ok on the install until I get to the recommended make >> step for me to manually handle (printed out by your make file). >> Incidentally, your web site should say to build in the FreeBSD.usb2 >> directory, I think. >> >> One complication is that I am crosscompiling with the tinybsd script - >> at least the target is an x86. >> >> I was held up for awhile because I missed the instruction echo'ed from >> the ..../FreeBSD.usb2/Makefile telling me to patch/change kmod.mk. >> Missing that causes the make to stop because usb2_if.h is missing. > > Are you building the kernel or Modules? > I tried both. But then I did a little RTFM of your website and the install makefile. When I used the make install, and changed kmod.mk the make succeeded except for a few USB2 routines (serial*, wlan*, bluetooth* and storage_rio) that must be using new kernel APIs because their build is broken in my FreeBSD7.0. I removed those broken module builds from the Makefile at ...modules/usb2/Makefile. For now I will ignore them and work on verifying the backport works. Thanks for your opinion on removing td_fpop. I'll let you know if removing that breaks things. Regards, Steve From owner-freebsd-usb@FreeBSD.ORG Mon Feb 2 20:51:28 2009 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A65891065967; Mon, 2 Feb 2009 20:51:28 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 926E08FC0A; Mon, 2 Feb 2009 20:51:28 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from freefall.freebsd.org (gavin@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n12KpSA9045102; Mon, 2 Feb 2009 20:51:28 GMT (envelope-from gavin@freefall.freebsd.org) Received: (from gavin@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n12KpShb045098; Mon, 2 Feb 2009 20:51:28 GMT (envelope-from gavin) Date: Mon, 2 Feb 2009 20:51:28 GMT Message-Id: <200902022051.n12KpShb045098@freefall.freebsd.org> To: hsu@bbnetworks.net, gavin@FreeBSD.org, freebsd-usb@FreeBSD.org, gavin@FreeBSD.org From: gavin@FreeBSD.org Cc: Subject: Re: kern/107446: problems with usb and fw disks X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Feb 2009 20:51:32 -0000 Old Synopsis: [umass] umass problems (usb and fw disks) New Synopsis: problems with usb and fw disks State-Changed-From-To: open->feedback State-Changed-By: gavin State-Changed-When: Mon Feb 2 20:46:56 UTC 2009 State-Changed-Why: To submitter: Sorry this PR has sat so long without a response. I wonder, are you able to provide two full copies of any output from the kernel (/var/log/messages), one while using these disks as firewire disks, and the other while using it as a USB disk? Also, if the machine panics, are you able to get a backtrace in both cases ? (you may need to recompile your kernel with the Kernel Debugger, see http://www.freebsd.org/doc/en/books/developers-handbook/kerneldebug.html for details). Thanks! Responsible-Changed-From-To: freebsd-usb->gavin Responsible-Changed-By: gavin Responsible-Changed-When: Mon Feb 2 20:46:56 UTC 2009 Responsible-Changed-Why: Not USB specific. Track. http://www.freebsd.org/cgi/query-pr.cgi?pr=107446 From owner-freebsd-usb@FreeBSD.ORG Tue Feb 3 18:40:16 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A7311065676 for ; Tue, 3 Feb 2009 18:40:16 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from pele.citylink.co.nz (pele.citylink.co.nz [202.8.44.226]) by mx1.freebsd.org (Postfix) with ESMTP id 38E988FC17 for ; Tue, 3 Feb 2009 18:40:16 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) by pele.citylink.co.nz (Postfix) with ESMTP id 62B7FFF9B; Wed, 4 Feb 2009 07:40:15 +1300 (NZDT) X-Virus-Scanned: Debian amavisd-new at citylink.co.nz Received: from pele.citylink.co.nz ([127.0.0.1]) by localhost (pele.citylink.co.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eZ2wOwkTnkbD; Wed, 4 Feb 2009 07:40:11 +1300 (NZDT) Received: from citylink.fud.org.nz (unknown [202.8.44.45]) by pele.citylink.co.nz (Postfix) with ESMTP; Wed, 4 Feb 2009 07:40:11 +1300 (NZDT) Received: by citylink.fud.org.nz (Postfix, from userid 1001) id 583801142E; Wed, 4 Feb 2009 07:40:11 +1300 (NZDT) Date: Tue, 3 Feb 2009 10:40:11 -0800 From: Andrew Thompson To: Hans Petter Selasky Message-ID: <20090203184011.GA64941@citylink.fud.org.nz> References: <200902012001.06914.hselasky@c2i.net> <200902012031.56899.hselasky@c2i.net> <20090201.130051.-2130550806.imp@bsdimp.com> <200902012140.04180.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200902012140.04180.hselasky@c2i.net> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: freebsd-usb@freebsd.org Subject: Re: USB2 patches X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Feb 2009 18:40:17 -0000 On Sun, Feb 01, 2009 at 09:40:01PM +0100, Hans Petter Selasky wrote: > Hi Warner, > The example is not the best. Let's pick another example: > > Assume you have a 3g modem and we are doing software flow control. Regularly > modem status bits are transferred between host and device. Now, lets assume > that the modem application has only got one thread. What will happen if > transferring the RTS/CTS status bits to the modem is synchronous? Immediate > data-loss! Especially at higher data rates. > > Let me elaborate: Assume it takes 3ms to handle a control request to program > the DTR/RTS/CTS, because the device is slow. Then you have a 1024 byte buffer > on a BULK endpoint which needs to be handled every 1ms. If DTR/RTS and CTS > are not done async, you severely degrade the overall performance of the > system, don't you agree about that, if every time you update the modem status > have to wait 3ms, having to skip Rx'ed data? As Warner suggested, you would only drain if the previous DTR/RTS/etc command is still in flight so there is actually no delay. Say DTR is queued to turn on, its correct to drain this before allowing a subsequent command to turn it off. To queue this and have a thread execute a series of on/off/on/off in one go later isnt right IMHO. Andrew From owner-freebsd-usb@FreeBSD.ORG Tue Feb 3 19:41:21 2009 Return-Path: Delivered-To: freebsd-usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 592D41065674; Tue, 3 Feb 2009 19:41:21 +0000 (UTC) (envelope-from devet@devet.org) Received: from a507ea5a8.xs4all.nl (a507ea5a8.xs4all.nl [80.126.165.168]) by mx1.freebsd.org (Postfix) with ESMTP id 0B6F38FC24; Tue, 3 Feb 2009 19:41:20 +0000 (UTC) (envelope-from devet@devet.org) Received: from adv.devet.org (adv.devet.org [192.168.1.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a507ea5a8.xs4all.nl (Postfix) with ESMTP id A61911143C; Tue, 3 Feb 2009 19:59:47 +0100 (CET) Received: by adv.devet.org (Postfix, from userid 100) id B40356FFE9; Tue, 3 Feb 2009 19:59:46 +0100 (CET) Date: Tue, 3 Feb 2009 19:59:46 +0100 From: Arjan de Vet To: cperciva@FreeBSD.org Message-ID: <20090203185946.GA3498@adv.devet.org> References: <200811121333.mACDXYOZ095222@freefall.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="DocE+STaALJfprDB" Content-Disposition: inline In-Reply-To: <200811121333.mACDXYOZ095222@freefall.freebsd.org> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: bug-followup@freebsd.org, freebsd-usb@FreeBSD.org Subject: Re: usb/128760: [ums] patch for Microsoft Comfort Optical Mouse 3000 (model 1043) X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Feb 2009 19:41:22 -0000 --DocE+STaALJfprDB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline >Responsible-Changed-From-To: freebsd-usb->cperciva >Responsible-Changed-By: cperciva >Responsible-Changed-When: Wed Nov 12 13:32:58 UTC 2008 >Responsible-Changed-Why: >Fixed in HEAD > >http://www.freebsd.org/cgi/query-pr.cgi?pr=128760 I've found some time to do more testing/debugging and it seems my previous patch is wrong. This mouse needs an sc->sc_isize = 6 instead of the usual 5. Therefore the quirk entry in my original patch should be removed and the attached patch (relative to RELENG_7_1) makes all buttons/wheel/etc. work. I'm not sure whether this is the best way to do this, please let me know if there's a more structural way to deal with the specific characteristics of this mouse. Arjan --DocE+STaALJfprDB Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="patch.txt" Index: ums.c =================================================================== RCS file: /home/freebsd/CVS/src/sys/dev/usb/ums.c,v retrieving revision 1.96.2.5.2.1 diff -u -r1.96.2.5.2.1 ums.c --- ums.c 25 Nov 2008 02:59:29 -0000 1.96.2.5.2.1 +++ ums.c 25 Nov 2008 18:53:29 -0000 @@ -404,6 +404,29 @@ sc->sc_loc_btn[2].pos = 2; } + /* + * The Microsoft Comfort Optical Mouse 3000 Model 1043 has a 4-way + * tilt wheel and 4 buttons. It reports size=2 and id=19 which seem + * bogus. + */ + if (uaa->vendor == USB_VENDOR_MICROSOFT && + uaa->product == USB_PRODUCT_MICROSOFT_COMFORT3000) { + sc->flags = UMS_T | UMS_Z; + sc->nbuttons = 4; + sc->sc_isize = 6; + sc->sc_iid = 0; + sc->sc_loc_x.pos = 16; + sc->sc_loc_y.pos = 24; + sc->sc_loc_z.pos = 32; + sc->sc_loc_t.pos = 40; + sc->sc_loc_t.size = 8; + sc->sc_loc_btn[0].pos = 8; + sc->sc_loc_btn[1].pos = 9; + sc->sc_loc_btn[2].pos = 10; + sc->sc_loc_btn[3].pos = 12; + sc->sc_loc_btn[3].size = 1; + } + sc->sc_ibuf = malloc(sc->sc_isize, M_USB, M_NOWAIT); if (!sc->sc_ibuf) { printf("%s: no memory\n", device_get_nameunit(sc->sc_dev)); Index: usbdevs =================================================================== RCS file: /home/freebsd/CVS/src/sys/dev/usb/usbdevs,v retrieving revision 1.328.2.21.2.1 diff -u -r1.328.2.21.2.1 usbdevs --- usbdevs 25 Nov 2008 02:59:29 -0000 1.328.2.21.2.1 +++ usbdevs 25 Nov 2008 18:53:29 -0000 @@ -1664,6 +1664,7 @@ product MICROSOFT MN110 0x007a 10/100 USB NIC product MICROSOFT WLINTELLIMOUSE 0x008c Wireless Optical IntelliMouse product MICROSOFT WLNOTEBOOK 0x00b9 Wireless Optical Mouse (Model 1023) +product MICROSOFT COMFORT3000 0x00d1 Comfort Optical Mouse 3000 (Model 1043) product MICROSOFT WLNOTEBOOK2 0x00e1 Wireless Optical Mouse 3000 (Model 1056) product MICROSOFT WLNOTEBOOK3 0x00d2 Wireless Optical Mouse 3000 (Model 1049) product MICROSOFT WLUSBMOUSE 0x00b9 Wireless USB Mouse --DocE+STaALJfprDB-- From owner-freebsd-usb@FreeBSD.ORG Wed Feb 4 08:36:30 2009 Return-Path: Delivered-To: usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B66BE1065673 for ; Wed, 4 Feb 2009 08:36:30 +0000 (UTC) (envelope-from vova@sw.ru) Received: from relay.sw.ru (mailhub.sw.ru [195.214.232.25]) by mx1.freebsd.org (Postfix) with ESMTP id 2AF6A8FC1A for ; Wed, 4 Feb 2009 08:36:29 +0000 (UTC) (envelope-from vova@sw.ru) Received: from vbook.fbsd.ru ([10.30.1.111]) (authenticated bits=0) by relay.sw.ru (8.13.4/8.13.4) with ESMTP id n147xCbL010499 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 4 Feb 2009 10:59:13 +0300 (MSK) Received: from vova by vbook.fbsd.ru with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1LUcfA-0001nP-Ew; Wed, 04 Feb 2009 10:59:12 +0300 From: Vladimir Grebenschikov To: current Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: SWsoft Date: Wed, 04 Feb 2009 10:59:12 +0300 Message-Id: <1233734352.1767.55.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.24.3 FreeBSD GNOME Team Port Sender: Vladimir Grebenschikov Cc: usb@freebsd.org Subject: USB2 - umass problem X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: vova@fbsd.ru List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Feb 2009 08:36:31 -0000 Hi USB2 team, thank you for really big effort on improving FreeBSD usb stack. I've tried it and found that ums, ubt, ukbd just work. u3g card was detected ohci0: mem 0x88000000-0x88000fff irq 16 at device 0.0 on cardbus0 ohci0: [ITHREAD] usbus5: on ohci0 usbus5: 12Mbps Full Speed USB v1.0 ohci1: mem 0x88001000-0x88001fff irq 16 at device 0.1 on cardbus0 ohci1: [ITHREAD] ugen5.1: at usbus5 ushub6: on usbus5 usbus6: on ohci1 usbus6: 12Mbps Full Speed USB v1.0 ugen6.1: at usbus6 ushub7: on usbus6 ushub6: 1 port with 1 removable, self powered ushub7: 1 port with 1 removable, self powered ugen5.2: at usbus5 u3g0: on usbus5 u3g1: on usbus5 u3g2: on usbus5 By some reason devfs semantic was changed: Instead of /dev/cuaU0.[0-2] and /dev/ttyU0.[0-2], I've get /dev/cuaU[0-2] /dev/ttyU[0-2] and! /dev/cuau1 /dev/ttyu1 What is reason for such change (additional port with lowercase 'u' and U[0-2] instead of more logical U0.[0-2]) ? Excellent news is that I've successfully removed PCMCI card with u3g USB controller from notebook and have no panic as it was with old USB stack. By some reason connection was failed but chat with modem was ok. Will try again. Simple umass device (WD external disk) works fine, but integrated to doc-station card-reader failed: First time card insertion, two umass devices appeared, both just do not work: ugen4.4: at usbus4 umass0: on usbus4 umass0: SCSI over Bulk-Only; quirks = 0x0000 umass0:5:0:-1: Attached to scbus5 (probe0:umass-sim0:0:0:0): TEST UNIT READY. CDB: 0 0 0 0 0 0 (probe0:umass-sim0:0:0:0): CAM Status: SCSI Status Error (probe0:umass-sim0:0:0:0): SCSI Status: Check Condition (probe0:umass-sim0:0:0:0): NOT READY asc:3a,0 (probe0:umass-sim0:0:0:0): Medium not present (probe0:umass-sim0:0:0:0): Unretryable error da0 at umass-sim0 bus 0 target 0 lun 0 da0: Removable Direct Access SCSI-0 device da0: 40.000MB/s transfers da0: Attempt to query device size failed: NOT READY, Medium not present (probe0:umass-sim0:0:0:1): TEST UNIT READY. CDB: 0 20 0 0 0 0 (probe0:umass-sim0:0:0:1): CAM Status: SCSI Status Error (probe0:umass-sim0:0:0:1): SCSI Status: Check Condition (probe0:umass-sim0:0:0:1): NOT READY asc:3a,0 (probe0:umass-sim0:0:0:1): Medium not present (probe0:umass-sim0:0:0:1): Unretryable error da1 at umass-sim0 bus 0 target 0 lun 1 da1: Removable Direct Access SCSI-0 device da1: 40.000MB/s transfers da1: Attempt to query device size failed: NOT READY, Medium not present Second time - a bit better, second device read correct card label, but still failed on mount: ugen4.4: at usbus4 umass0: on usbus4 umass0: SCSI over Bulk-Only; quirks = 0x0000 umass0:5:0:-1: Attached to scbus5 (probe0:umass-sim0:0:0:0): TEST UNIT READY. CDB: 0 0 0 0 0 0 (probe0:umass-sim0:0:0:0): CAM Status: SCSI Status Error (probe0:umass-sim0:0:0:0): SCSI Status: Check Condition (probe0:umass-sim0:0:0:0): UNIT ATTENTION asc:28,0 (probe0:umass-sim0:0:0:0): Not ready to ready change, medium may have changed (probe0:umass-sim0:0:0:0): Retrying Command (per Sense Data) da0 at umass-sim0 bus 0 target 0 lun 0 da0: Removable Direct Access SCSI-0 device da0: 40.000MB/s transfers da0: 980MB (2007040 512 byte sectors: 64H 32S/T 980C) (probe0:umass-sim0:0:0:1): TEST UNIT READY. CDB: 0 20 0 0 0 0 (probe0:umass-sim0:0:0:1): CAM Status: SCSI Status Error (probe0:umass-sim0:0:0:1): SCSI Status: Check Condition (probe0:umass-sim0:0:0:1): NOT READY asc:3a,0 (probe0:umass-sim0:0:0:1): Medium not present (probe0:umass-sim0:0:0:1): Unretryable error da1 at umass-sim0 bus 0 target 0 lun 1 da1: Removable Direct Access SCSI-0 device da1: 40.000MB/s transfers da1: Attempt to query device size failed: NOT READY, Medium not present GEOM_LABEL: Label for provider da0s1 is label/e60mmc. # /sbin/mount -t msdosfs /dev/da0s1 /mnt mount_msdosfs: /dev/da0s1: Input/output error # and dmesg has lots of: (da0:umass-sim0:0:0:0): MEDIUM ERROR asc:11,0 (da0:umass-sim0:0:0:0): Unrecovered read error (da0:umass-sim0:0:0:0): Retrying Command (per Sense Data) (da0:umass-sim0:0:0:0): READ(10). CDB: 28 0 0 0 8 80 0 0 10 0 (da0:umass-sim0:0:0:0): CAM Status: SCSI Status Error (da0:umass-sim0:0:0:0): SCSI Status: Check Condition (da0:umass-sim0:0:0:0): MEDIUM ERROR asc:11,0 (da0:umass-sim0:0:0:0): Unrecovered read error (da0:umass-sim0:0:0:0): Retrying Command (per Sense Data) (da0:umass-sim0:0:0:0): READ(10). CDB: 28 0 0 0 8 80 0 0 10 0 (da0:umass-sim0:0:0:0): CAM Status: SCSI Status Error (da0:umass-sim0:0:0:0): SCSI Status: Check Condition (da0:umass-sim0:0:0:0): MEDIUM ERROR asc:11,0 (da0:umass-sim0:0:0:0): Unrecovered read error (da0:umass-sim0:0:0:0): Retrying Command (per Sense Data) (da0:umass-sim0:0:0:0): READ(10). CDB: 28 0 0 0 8 80 0 0 10 0 (da0:umass-sim0:0:0:0): CAM Status: SCSI Status Error (da0:umass-sim0:0:0:0): SCSI Status: Check Condition # usbconfig ugen0.1: at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON ugen1.1: at usbus1, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON ugen2.1: at usbus2, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON ugen3.1: at usbus3, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON ugen4.1: at usbus4, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON ugen4.2: at usbus4, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE ugen4.3: at usbus4, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON ugen3.2: at usbus3, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON ugen3.3: at usbus3, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON ugen4.4: <2228 SMSC> at usbus4, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON # With u3gcard: ... ugen5.1: at usbus5, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON ugen6.1: at usbus6, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON ugen5.2: at usbus5, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON Any hints regarding issues above ? Side question, is there any way to ask usbconfig driver that attached to every device (as it was with usbdevs -d) ? # uname -a FreeBSD vbook.fbsd.ru 8.0-CURRENT FreeBSD 8.0-CURRENT #2: Mon Feb 2 16:46:22 MSK 2009 root@vbook.fbsd.ru:/usr/obj/usr/src/sys/VBOOK i386 -- Vladimir B. Grebenschikov vova@fbsd.ru From owner-freebsd-usb@FreeBSD.ORG Wed Feb 4 09:42:08 2009 Return-Path: Delivered-To: usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EECED106564A; Wed, 4 Feb 2009 09:42:08 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe04.swip.net [212.247.154.97]) by mx1.freebsd.org (Postfix) with ESMTP id 318208FC1A; Wed, 4 Feb 2009 09:42:07 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=6I5d2MoRAAAA:8 a=6vKQvfzm4CT-oQKQhbsA:9 a=vSCs3hrj37iq592yjgcA:7 a=SdSZzkw8vcR7DPN-Xpxw1ZmdxiwA:4 a=50e4U0PicR4A:10 Received: from [85.19.218.115] (account mc467741@c2i.net HELO [10.37.1.92]) by mailfe04.swip.net (CommuniGate Pro SMTP 5.2.6) with ESMTPA id 1190336426; Wed, 04 Feb 2009 10:42:06 +0100 From: Hans Petter Selasky To: freebsd-current@freebsd.org, vova@fbsd.ru Date: Wed, 4 Feb 2009 10:44:26 +0100 User-Agent: KMail/1.9.7 References: <1233734352.1767.55.camel@localhost> In-Reply-To: <1233734352.1767.55.camel@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902041044.27663.hselasky@c2i.net> Cc: usb@freebsd.org Subject: Re: USB2 - umass problem X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Feb 2009 09:42:09 -0000 Hi, On Wednesday 04 February 2009, Vladimir Grebenschikov wrote: > Hi > > > By some reason devfs semantic was changed: > Instead of /dev/cuaU0.[0-2] and /dev/ttyU0.[0-2], I've get > /dev/cuaU[0-2] /dev/ttyU[0-2] and! /dev/cuau1 /dev/ttyu1 > What is reason for such change (additional port with lowercase 'u' and > U[0-2] instead of more logical U0.[0-2]) ? It is because we are attaching drivers per interface instead of per device. A new modem unit is allocated every time we find a modem, simply put. If the modem has multiple instances in an interface, /dev/cuaU0.[0...] will be created. Else /dev/cuaU... . > > Excellent news is that I've successfully removed PCMCI card with u3g USB > controller from notebook and have no panic as it was with old USB > stack. Great! > > By some reason connection was failed but chat with modem was ok. Will > try again. > > Simple umass device (WD external disk) works fine, but > integrated to doc-station card-reader failed: > > First time card insertion, two umass devices appeared, both just do not > work: > > ugen4.4: at usbus4 > umass0: on usbus4 > umass0: SCSI over Bulk-Only; quirks = 0x0000 > umass0:5:0:-1: Attached to scbus5 > (probe0:umass-sim0:0:0:0): TEST UNIT READY. CDB: 0 0 0 0 0 0 > (probe0:umass-sim0:0:0:0): CAM Status: SCSI Status Error > (probe0:umass-sim0:0:0:0): SCSI Status: Check Condition > (probe0:umass-sim0:0:0:0): NOT READY asc:3a,0 > (probe0:umass-sim0:0:0:0): Medium not present > (probe0:umass-sim0:0:0:0): Unretryable error > da0 at umass-sim0 bus 0 target 0 lun 0 > da0: Removable Direct Access SCSI-0 device > da0: 40.000MB/s transfers > da0: Attempt to query device size failed: NOT READY, Medium not present Have you tried "cat /dev/null > /dev/da0", to refresh the label on the disk? NOTE: /dev/null is not /dev/zero > da1 at umass-sim0 bus 0 target 0 lun 1 > da1: Removable Direct Access SCSI-0 device > da1: 40.000MB/s transfers > da1: Attempt to query device size failed: NOT READY, Medium not present Same with "da1" > > Second time - a bit better, second device read correct card label, but > still failed on mount: Maybe your device needs a quirk, because it hangs on one of the issues SCSI commands. Have you looked at: http://wiki.freebsd.org/USB > > # usbconfig > ugen0.1: at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) > pwr=ON ugen1.1: at usbus1, cfg=0 md=HOST spd=FULL > (12Mbps) pwr=ON ugen2.1: at usbus2, cfg=0 md=HOST > spd=FULL (12Mbps) pwr=ON ugen3.1: at usbus3, cfg=0 > md=HOST spd=FULL (12Mbps) pwr=ON ugen4.1: at usbus4, > cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON ugen4.2: at > usbus4, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE ugen4.3: 5-Button Mouse with IntelliEye(TM) Microsoft> at usbus4, cfg=0 md=HOST > spd=LOW (1.5Mbps) pwr=ON ugen3.2: at usbus3, cfg=0 > md=HOST spd=FULL (12Mbps) pwr=ON ugen3.3: STMicroelectronics> at usbus3, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON > ugen4.4: <2228 SMSC> at usbus4, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON # > > With u3gcard: > ... > ugen5.1: at usbus5, cfg=0 md=HOST spd=FULL (12Mbps) > pwr=ON ugen6.1: at usbus6, cfg=0 md=HOST spd=FULL > (12Mbps) pwr=ON ugen5.2: at usbus5, > cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON > > > Any hints regarding issues above ? > > Side question, is there any way to ask usbconfig driver that attached to > every device (as it was with usbdevs -d) ? No, but you can try the following command which gives a nice overview: devinfo > > # uname -a > FreeBSD vbook.fbsd.ru 8.0-CURRENT FreeBSD 8.0-CURRENT #2: Mon Feb 2 > 16:46:22 MSK 2009 root@vbook.fbsd.ru:/usr/obj/usr/src/sys/VBOOK i386 --HPS From owner-freebsd-usb@FreeBSD.ORG Wed Feb 4 09:58:08 2009 Return-Path: Delivered-To: usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B912106566B; Wed, 4 Feb 2009 09:58:08 +0000 (UTC) (envelope-from vova@sw.ru) Received: from relay.sw.ru (mailhub.sw.ru [195.214.232.25]) by mx1.freebsd.org (Postfix) with ESMTP id 089A18FC18; Wed, 4 Feb 2009 09:58:07 +0000 (UTC) (envelope-from vova@sw.ru) Received: from vbook.fbsd.ru ([10.30.1.111]) (authenticated bits=0) by relay.sw.ru (8.13.4/8.13.4) with ESMTP id n149w3j4010531 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 4 Feb 2009 12:58:04 +0300 (MSK) Received: from vova by vbook.fbsd.ru with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1LUeWB-00028P-38; Wed, 04 Feb 2009 12:58:03 +0300 From: Vladimir Grebenschikov To: Hans Petter Selasky In-Reply-To: <200902041044.27663.hselasky@c2i.net> References: <1233734352.1767.55.camel@localhost> <200902041044.27663.hselasky@c2i.net> Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: SWsoft Date: Wed, 04 Feb 2009 12:58:02 +0300 Message-Id: <1233741482.1767.120.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.24.3 FreeBSD GNOME Team Port Sender: Vladimir Grebenschikov Cc: usb@freebsd.org, freebsd-current@freebsd.org Subject: Re: USB2 - umass problem X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: vova@fbsd.ru List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Feb 2009 09:58:09 -0000 On Wed, 2009-02-04 at 10:44 +0100, Hans Petter Selasky wrote: > > By some reason devfs semantic was changed: > > Instead of /dev/cuaU0.[0-2] and /dev/ttyU0.[0-2], I've get > > /dev/cuaU[0-2] /dev/ttyU[0-2] and! /dev/cuau1 /dev/ttyu1 > > What is reason for such change (additional port with lowercase 'u' and > > U[0-2] instead of more logical U0.[0-2]) ? > > It is because we are attaching drivers per interface instead of per device. A > new modem unit is allocated every time we find a modem, simply put. If the > modem has multiple instances in an interface, /dev/cuaU0.[0...] will be > created. Else /dev/cuaU... . What about /dev/cuau1 /dev/ttyu1 ? -- Vladimir B. Grebenschikov vova@fbsd.ru From owner-freebsd-usb@FreeBSD.ORG Wed Feb 4 10:11:30 2009 Return-Path: Delivered-To: usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91FC2106564A; Wed, 4 Feb 2009 10:11:30 +0000 (UTC) (envelope-from vova@sw.ru) Received: from relay.sw.ru (mailhub.sw.ru [195.214.232.25]) by mx1.freebsd.org (Postfix) with ESMTP id E19D78FC19; Wed, 4 Feb 2009 10:11:29 +0000 (UTC) (envelope-from vova@sw.ru) Received: from vbook.fbsd.ru ([10.30.1.111]) (authenticated bits=0) by relay.sw.ru (8.13.4/8.13.4) with ESMTP id n14ABQ3q001430 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 4 Feb 2009 13:11:27 +0300 (MSK) Received: from vova by vbook.fbsd.ru with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1LUej7-0002Aa-W6; Wed, 04 Feb 2009 13:11:26 +0300 From: Vladimir Grebenschikov To: Hans Petter Selasky In-Reply-To: <200902041044.27663.hselasky@c2i.net> References: <1233734352.1767.55.camel@localhost> <200902041044.27663.hselasky@c2i.net> Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: SWsoft Date: Wed, 04 Feb 2009 13:11:25 +0300 Message-Id: <1233742285.1767.142.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.24.3 FreeBSD GNOME Team Port Sender: Vladimir Grebenschikov Cc: usb@freebsd.org, freebsd-current@freebsd.org Subject: Re: USB2 - umass problem X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: vova@fbsd.ru List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Feb 2009 10:11:31 -0000 On Wed, 2009-02-04 at 10:44 +0100, Hans Petter Selasky wrote: > > Simple umass device (WD external disk) works fine, but > > integrated to doc-station card-reader failed: > > > > First time card insertion, two umass devices appeared, both just do not > > work: > > > > ugen4.4: at usbus4 > > umass0: on usbus4 > > umass0: SCSI over Bulk-Only; quirks = 0x0000 > > umass0:5:0:-1: Attached to scbus5 > > (probe0:umass-sim0:0:0:0): TEST UNIT READY. CDB: 0 0 0 0 0 0 > > (probe0:umass-sim0:0:0:0): CAM Status: SCSI Status Error > > (probe0:umass-sim0:0:0:0): SCSI Status: Check Condition > > (probe0:umass-sim0:0:0:0): NOT READY asc:3a,0 > > (probe0:umass-sim0:0:0:0): Medium not present > > (probe0:umass-sim0:0:0:0): Unretryable error > > da0 at umass-sim0 bus 0 target 0 lun 0 > > da0: Removable Direct Access SCSI-0 device > > da0: 40.000MB/s transfers > > da0: Attempt to query device size failed: NOT READY, Medium not present > > Have you tried "cat /dev/null > /dev/da0", to refresh the label on the disk? > NOTE: /dev/null is not /dev/zero > > > da1 at umass-sim0 bus 0 target 0 lun 1 > > da1: Removable Direct Access SCSI-0 device > > da1: 40.000MB/s transfers > > da1: Attempt to query device size failed: NOT READY, Medium not present > > Same with "da1" > > > > > Second time - a bit better, second device read correct card label, but > > still failed on mount: > > Maybe your device needs a quirk, because it hangs on one of the issues SCSI > commands. Have you looked at: > > http://wiki.freebsd.org/USB Probably, did not tried yet, but old usb stack works as expected, did all usb1 quircks imported to usb2 ? -- Vladimir B. Grebenschikov vova@fbsd.ru From owner-freebsd-usb@FreeBSD.ORG Wed Feb 4 10:18:17 2009 Return-Path: Delivered-To: usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03456106564A; Wed, 4 Feb 2009 10:18:17 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe04.swip.net [212.247.154.97]) by mx1.freebsd.org (Postfix) with ESMTP id 5FD788FC1B; Wed, 4 Feb 2009 10:18:16 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=tfb0dwXNrS19c3XT73wA:9 a=2vPME6ZFKeNGMz1X4JfvvTWzDY8A:4 a=LY0hPdMaydYA:10 Received: from [85.19.218.115] (account mc467741@c2i.net HELO [10.37.1.92]) by mailfe04.swip.net (CommuniGate Pro SMTP 5.2.6) with ESMTPA id 1190357865; Wed, 04 Feb 2009 11:18:15 +0100 From: Hans Petter Selasky To: vova@fbsd.ru Date: Wed, 4 Feb 2009 11:20:40 +0100 User-Agent: KMail/1.9.7 References: <1233734352.1767.55.camel@localhost> <200902041044.27663.hselasky@c2i.net> <1233742285.1767.142.camel@localhost> In-Reply-To: <1233742285.1767.142.camel@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902041120.40833.hselasky@c2i.net> Cc: usb@freebsd.org, freebsd-current@freebsd.org Subject: Re: USB2 - umass problem X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Feb 2009 10:18:17 -0000 On Wednesday 04 February 2009, Vladimir Grebenschikov wrote: > > Probably, did not tried yet, > but old usb stack works as expected, did all usb1 quircks imported to > usb2 ? Yes, all UMASS quirks should have been imported. --HPS From owner-freebsd-usb@FreeBSD.ORG Wed Feb 4 10:24:55 2009 Return-Path: Delivered-To: usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C46371065677; Wed, 4 Feb 2009 10:24:55 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe06.swip.net [212.247.154.161]) by mx1.freebsd.org (Postfix) with ESMTP id 2C1F38FC25; Wed, 4 Feb 2009 10:24:54 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=yeonV4BSZWp0Uy9YbVcA:9 a=ZAKByqpdGbYrO5BrN7gncJwTxGYA:4 a=LY0hPdMaydYA:10 Received: from [85.19.218.115] (account mc467741@c2i.net HELO [10.37.1.92]) by mailfe06.swip.net (CommuniGate Pro SMTP 5.2.6) with ESMTPA id 1191396970; Wed, 04 Feb 2009 11:24:53 +0100 From: Hans Petter Selasky To: freebsd-current@freebsd.org, vova@fbsd.ru Date: Wed, 4 Feb 2009 11:27:19 +0100 User-Agent: KMail/1.9.7 References: <1233734352.1767.55.camel@localhost> <200902041044.27663.hselasky@c2i.net> <1233741482.1767.120.camel@localhost> In-Reply-To: <1233741482.1767.120.camel@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902041127.20424.hselasky@c2i.net> Cc: usb@freebsd.org Subject: Re: USB2 - umass problem X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Feb 2009 10:24:56 -0000 On Wednesday 04 February 2009, Vladimir Grebenschikov wrote: > On Wed, 2009-02-04 at 10:44 +0100, Hans Petter Selasky wrote: > > > By some reason devfs semantic was changed: > > > Instead of /dev/cuaU0.[0-2] and /dev/ttyU0.[0-2], I've get > > > /dev/cuaU[0-2] /dev/ttyU[0-2] and! /dev/cuau1 /dev/ttyu1 > > > What is reason for such change (additional port with lowercase 'u' and > > > U[0-2] instead of more logical U0.[0-2]) ? > > > > It is because we are attaching drivers per interface instead of per > > device. A new modem unit is allocated every time we find a modem, simply > > put. If the modem has multiple instances in an interface, > > /dev/cuaU0.[0...] will be created. Else /dev/cuaU... . > > What about /dev/cuau1 /dev/ttyu1 ? TTYs follow the same naming convention like the cuaUxx . If the modem has got one modem in each interface and three interfaces: /dev/cuaU0 /dev/ttyU0 /dev/cuaU1 /dev/ttyU1 /dev/cuaU2 /dev/ttyU2 If the modem has got three modems in one interface: /dev/cuaU0.0 /dev/ttyU0.0 /dev/cuaU0.1 /dev/ttyU0.1 /dev/cuaU0.2 /dev/ttyU0.2 How this is configured is decided by the USB device manufacturer. --HPS From owner-freebsd-usb@FreeBSD.ORG Wed Feb 4 12:21:47 2009 Return-Path: Delivered-To: freebsd-usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 320D4106564A; Wed, 4 Feb 2009 12:21:47 +0000 (UTC) (envelope-from bst2006@dva.dyndns.org) Received: from dva.homeunix.org (dva.homeunix.org [89.247.128.204]) by mx1.freebsd.org (Postfix) with ESMTP id E42998FC19; Wed, 4 Feb 2009 12:21:46 +0000 (UTC) (envelope-from bst2006@dva.dyndns.org) Received: from [127.0.0.1] (dva [10.0.0.10]) by dva.homeunix.org (Postfix) with ESMTP id B07A54F627; Wed, 4 Feb 2009 13:04:18 +0100 (CET) Message-ID: <49898442.7070904@dva.dyndns.org> Date: Wed, 04 Feb 2009 13:04:18 +0100 From: "Boris S." User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) MIME-Version: 1.0 To: FreeBSD-gnats-submit@FreeBSD.org, freebsd-usb@FreeBSD.org References: <200807151030.m6FAU0KL074679@freefall.freebsd.org> In-Reply-To: <200807151030.m6FAU0KL074679@freefall.freebsd.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Cc: "Boris S." Subject: Re: usb/125631: [usb][ums] kernel panic during bootup while 'Logitech USB receiver' (Logitech RX650 wireless mouse) is connected X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Feb 2009 12:21:47 -0000 This bug has been fixed with the new USB2 stack. Tested under FreeBSD-8 (current). PR can be closed. From owner-freebsd-usb@FreeBSD.ORG Wed Feb 4 12:30:03 2009 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84B6A1065670 for ; Wed, 4 Feb 2009 12:30:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 56D0A8FC12 for ; Wed, 4 Feb 2009 12:30:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n14CU3Fk037474 for ; Wed, 4 Feb 2009 12:30:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n14CU3TR037465; Wed, 4 Feb 2009 12:30:03 GMT (envelope-from gnats) Date: Wed, 4 Feb 2009 12:30:03 GMT Message-Id: <200902041230.n14CU3TR037465@freefall.freebsd.org> To: freebsd-usb@FreeBSD.org From: "Boris S." Cc: Subject: Re: usb/125631: [usb][ums] kernel panic during bootup while 'Logitech USB receiver' (Logitech RX650 wireless mouse) is connected X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: "Boris S." List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Feb 2009 12:30:03 -0000 The following reply was made to PR usb/125631; it has been noted by GNATS. From: "Boris S." To: FreeBSD-gnats-submit@FreeBSD.org, freebsd-usb@FreeBSD.org Cc: "Boris S." Subject: Re: usb/125631: [usb][ums] kernel panic during bootup while 'Logitech USB receiver' (Logitech RX650 wireless mouse) is connected Date: Wed, 04 Feb 2009 13:04:18 +0100 This bug has been fixed with the new USB2 stack. Tested under FreeBSD-8 (current). PR can be closed. From owner-freebsd-usb@FreeBSD.ORG Wed Feb 4 14:26:47 2009 Return-Path: Delivered-To: usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8D2910656C9; Wed, 4 Feb 2009 14:26:47 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 9968D8FC17; Wed, 4 Feb 2009 14:26:47 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net [98.109.39.197]) by cyrus.watson.org (Postfix) with ESMTPSA id 4C7B646B39; Wed, 4 Feb 2009 09:26:47 -0500 (EST) Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n14EQG8B059441; Wed, 4 Feb 2009 09:26:40 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-current@freebsd.org, vova@fbsd.ru Date: Wed, 4 Feb 2009 09:22:16 -0500 User-Agent: KMail/1.9.7 References: <1233734352.1767.55.camel@localhost> <200902041044.27663.hselasky@c2i.net> <1233741482.1767.120.camel@localhost> In-Reply-To: <1233741482.1767.120.camel@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902040922.16882.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Wed, 04 Feb 2009 09:26:41 -0500 (EST) X-Virus-Scanned: ClamAV 0.94.2/8950/Wed Feb 4 06:19:05 2009 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: usb@freebsd.org Subject: Re: USB2 - umass problem X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Feb 2009 14:26:48 -0000 On Wednesday 04 February 2009 4:58:02 am Vladimir Grebenschikov wrote: > On Wed, 2009-02-04 at 10:44 +0100, Hans Petter Selasky wrote: > > > > By some reason devfs semantic was changed: > > > Instead of /dev/cuaU0.[0-2] and /dev/ttyU0.[0-2], I've get > > > /dev/cuaU[0-2] /dev/ttyU[0-2] and! /dev/cuau1 /dev/ttyu1 > > > What is reason for such change (additional port with lowercase 'u' and > > > U[0-2] instead of more logical U0.[0-2]) ? > > > > It is because we are attaching drivers per interface instead of per device. A > > new modem unit is allocated every time we find a modem, simply put. If the > > modem has multiple instances in an interface, /dev/cuaU0.[0...] will be > > created. Else /dev/cuaU... . > > What about /dev/cuau1 /dev/ttyu1 ? You have a uart1 device. -- John Baldwin From owner-freebsd-usb@FreeBSD.ORG Wed Feb 4 14:45:27 2009 Return-Path: Delivered-To: usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08D1D106566C; Wed, 4 Feb 2009 14:45:27 +0000 (UTC) (envelope-from vova@sw.ru) Received: from relay.sw.ru (mailhub.sw.ru [195.214.232.25]) by mx1.freebsd.org (Postfix) with ESMTP id 7903A8FC18; Wed, 4 Feb 2009 14:45:25 +0000 (UTC) (envelope-from vova@sw.ru) Received: from vbook.fbsd.ru ([10.30.1.111]) (authenticated bits=0) by relay.sw.ru (8.13.4/8.13.4) with ESMTP id n14EjL59015334 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 4 Feb 2009 17:45:22 +0300 (MSK) Received: from vova by vbook.fbsd.ru with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1LUj0D-000122-OP; Wed, 04 Feb 2009 17:45:21 +0300 From: Vladimir Grebenschikov To: John Baldwin In-Reply-To: <200902040922.16882.jhb@freebsd.org> References: <1233734352.1767.55.camel@localhost> <200902041044.27663.hselasky@c2i.net> <1233741482.1767.120.camel@localhost> <200902040922.16882.jhb@freebsd.org> Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: SWsoft Date: Wed, 04 Feb 2009 17:45:21 +0300 Message-Id: <1233758721.1811.148.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.24.3 FreeBSD GNOME Team Port Sender: Vladimir Grebenschikov Cc: usb@freebsd.org, freebsd-current@freebsd.org Subject: Re: USB2 - umass problem X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: vova@fbsd.ru List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Feb 2009 14:45:27 -0000 On Wed, 2009-02-04 at 09:22 -0500, John Baldwin wrote: > On Wednesday 04 February 2009 4:58:02 am Vladimir Grebenschikov wrote: > > On Wed, 2009-02-04 at 10:44 +0100, Hans Petter Selasky wrote: > > > > > > By some reason devfs semantic was changed: > > > > Instead of /dev/cuaU0.[0-2] and /dev/ttyU0.[0-2], I've get > > > > /dev/cuaU[0-2] /dev/ttyU[0-2] and! /dev/cuau1 /dev/ttyu1 > > > > What is reason for such change (additional port with lowercase 'u' and > > > > U[0-2] instead of more logical U0.[0-2]) ? > > > > > > It is because we are attaching drivers per interface instead of per > device. A > > > new modem unit is allocated every time we find a modem, simply put. If the > > > modem has multiple instances in an interface, /dev/cuaU0.[0...] will be > > > created. Else /dev/cuaU... . > > > > What about /dev/cuau1 /dev/ttyu1 ? > > You have a uart1 device. Ahh, ok, now I understand, thanks. -- Vladimir B. Grebenschikov vova@fbsd.ru From owner-freebsd-usb@FreeBSD.ORG Wed Feb 4 15:59:51 2009 Return-Path: Delivered-To: usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBE371065672; Wed, 4 Feb 2009 15:59:51 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 7DD9E8FC0C; Wed, 4 Feb 2009 15:59:51 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n14FtcXK000794; Wed, 4 Feb 2009 08:55:39 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Wed, 04 Feb 2009 08:56:06 -0700 (MST) Message-Id: <20090204.085606.1630229139.imp@bsdimp.com> To: hselasky@c2i.net From: "M. Warner Losh" In-Reply-To: <200902041044.27663.hselasky@c2i.net> References: <1233734352.1767.55.camel@localhost> <200902041044.27663.hselasky@c2i.net> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: vova@fbsd.ru, usb@freebsd.org, freebsd-current@freebsd.org Subject: Re: USB2 - umass problem X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Feb 2009 15:59:52 -0000 In message: <200902041044.27663.hselasky@c2i.net> Hans Petter Selasky writes: : Hi, : : On Wednesday 04 February 2009, Vladimir Grebenschikov wrote: : > Hi : > : > : > By some reason devfs semantic was changed: : > Instead of /dev/cuaU0.[0-2] and /dev/ttyU0.[0-2], I've get : > /dev/cuaU[0-2] /dev/ttyU[0-2] and! /dev/cuau1 /dev/ttyu1 : > What is reason for such change (additional port with lowercase 'u' and : > U[0-2] instead of more logical U0.[0-2]) ? : : It is because we are attaching drivers per interface instead of per device. A : new modem unit is allocated every time we find a modem, simply put. If the : modem has multiple instances in an interface, /dev/cuaU0.[0...] will be : created. Else /dev/cuaU... . Generally, we try not to change the details of how a device attaches /dev entries from release to release. Why the change? Also to Vladimir, Are you sure that the 'u' devices are created with the USB modem? They should only be created for uart devices... Warner From owner-freebsd-usb@FreeBSD.ORG Wed Feb 4 16:31:00 2009 Return-Path: Delivered-To: usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 637E01065672; Wed, 4 Feb 2009 16:31:00 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe08.swip.net [212.247.154.225]) by mx1.freebsd.org (Postfix) with ESMTP id C3DB58FC12; Wed, 4 Feb 2009 16:30:59 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=eQgmVNAsqagA:10 a=gkBtyVXq2fsA:10 a=_GpmdnD9TGfYaHV3wcMA:9 a=fb1yOvZzWwtjYqavfUboWBoF3YEA:4 a=50e4U0PicR4A:10 Received: from [85.19.218.115] (account mc467741@c2i.net HELO [10.37.1.92]) by mailfe08.swip.net (CommuniGate Pro SMTP 5.2.6) with ESMTPA id 1189347199; Wed, 04 Feb 2009 17:30:58 +0100 From: Hans Petter Selasky To: freebsd-current@freebsd.org Date: Wed, 4 Feb 2009 17:33:22 +0100 User-Agent: KMail/1.9.7 References: <1233734352.1767.55.camel@localhost> <200902041044.27663.hselasky@c2i.net> <20090204.085606.1630229139.imp@bsdimp.com> In-Reply-To: <20090204.085606.1630229139.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902041733.23389.hselasky@c2i.net> Cc: vova@fbsd.ru, usb@freebsd.org Subject: Re: [was: USB2 - umass problem] U3G modem unit number changes X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Feb 2009 16:31:01 -0000 Hi, On Wednesday 04 February 2009, M. Warner Losh wrote: > Why the change? Because u3g2.c is attaching to an USB interface and not the whole USB device. This is to allow other drivers to hook on the other interfaces. If you want to have exactly the same numbering like before, then the U3G interface driver instances on the same USB device need to peek at eachother to figure out the correct unit and sub-unit number. > > Also to Vladimir, Are you sure that the 'u' devices are created with > the USB modem? They should only be created for uart devices... --HPS From owner-freebsd-usb@FreeBSD.ORG Wed Feb 4 17:06:29 2009 Return-Path: Delivered-To: usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C90391065673 for ; Wed, 4 Feb 2009 17:06:29 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from pele.citylink.co.nz (pele.citylink.co.nz [202.8.44.226]) by mx1.freebsd.org (Postfix) with ESMTP id 8C9728FC0C for ; Wed, 4 Feb 2009 17:06:29 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) by pele.citylink.co.nz (Postfix) with ESMTP id 8C304FFAC; Thu, 5 Feb 2009 05:43:10 +1300 (NZDT) X-Virus-Scanned: Debian amavisd-new at citylink.co.nz Received: from pele.citylink.co.nz ([127.0.0.1]) by localhost (pele.citylink.co.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dhlb7jKPSq3G; Thu, 5 Feb 2009 05:43:06 +1300 (NZDT) Received: from citylink.fud.org.nz (unknown [202.8.44.45]) by pele.citylink.co.nz (Postfix) with ESMTP; Thu, 5 Feb 2009 05:43:06 +1300 (NZDT) Received: by citylink.fud.org.nz (Postfix, from userid 1001) id 8EAC21142B; Thu, 5 Feb 2009 05:43:05 +1300 (NZDT) Date: Wed, 4 Feb 2009 08:43:05 -0800 From: Andrew Thompson To: Hans Petter Selasky Message-ID: <20090204164305.GA77912@citylink.fud.org.nz> References: <1233734352.1767.55.camel@localhost> <200902041044.27663.hselasky@c2i.net> <20090204.085606.1630229139.imp@bsdimp.com> <200902041733.23389.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200902041733.23389.hselasky@c2i.net> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: vova@fbsd.ru, usb@freebsd.org, freebsd-current@freebsd.org Subject: Re: [was: USB2 - umass problem] U3G modem unit number changes X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Feb 2009 17:06:30 -0000 On Wed, Feb 04, 2009 at 05:33:22PM +0100, Hans Petter Selasky wrote: > Hi, > > On Wednesday 04 February 2009, M. Warner Losh wrote: > > > Why the change? > > Because u3g2.c is attaching to an USB interface and not the whole USB device. > This is to allow other drivers to hook on the other interfaces. u3g2 should claim the other interfaces in the one attachment and use the same tty semantics as oldusb u3g. Andrew From owner-freebsd-usb@FreeBSD.ORG Wed Feb 4 17:26:30 2009 Return-Path: Delivered-To: freebsd-usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65E231065670; Wed, 4 Feb 2009 17:26:30 +0000 (UTC) (envelope-from hsu@bbnetworks.net) Received: from mail.bbnetworks.net (mail.bbnetworks.net [212.16.96.5]) by mx1.freebsd.org (Postfix) with ESMTP id C53E38FC0A; Wed, 4 Feb 2009 17:26:29 +0000 (UTC) (envelope-from hsu@bbnetworks.net) Received: from hsu.bbnetworks.net (hsu.bbnetworks.net [212.16.96.38]) by mail.bbnetworks.net (8.13.4/8.13.4) with ESMTP id n14GtstA093328; Wed, 4 Feb 2009 18:55:54 +0200 (EET) (envelope-from hsu@bbnetworks.net) Message-ID: <4989C952.6080701@bbnetworks.net> Date: Wed, 04 Feb 2009 18:58:58 +0200 From: Heikki Suonsivu Organization: Backbone Networks Europe Inc User-Agent: Thunderbird 2.0.0.14 (X11/20081204) MIME-Version: 1.0 To: gavin@FreeBSD.org References: <200902022051.n12KpShb045098@freefall.freebsd.org> In-Reply-To: <200902022051.n12KpShb045098@freefall.freebsd.org> Content-Type: multipart/mixed; boundary="------------080108020902020300000002" X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.2 (mail.bbnetworks.net [212.16.96.5]); Wed, 04 Feb 2009 18:55:54 +0200 (EET) X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-usb@FreeBSD.org Subject: Re: kern/107446: problems with usb and fw disks X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Feb 2009 17:26:31 -0000 This is a multi-part message in MIME format. --------------080108020902020300000002 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit I have not seen the same errors lately, though I have dropped using USB disks to just random occasional use, so I do not know if this is still a problem or not. gavin@FreeBSD.org wrote: > Old Synopsis: [umass] umass problems (usb and fw disks) > New Synopsis: problems with usb and fw disks > > State-Changed-From-To: open->feedback > State-Changed-By: gavin > State-Changed-When: Mon Feb 2 20:46:56 UTC 2009 > State-Changed-Why: > To submitter: Sorry this PR has sat so long without a response. > I wonder, are you able to provide two full copies of any output > from the kernel (/var/log/messages), one while using these disks > as firewire disks, and the other while using it as a USB disk? > Also, if the machine panics, are you able to get a backtrace in > both cases ? (you may need to recompile your kernel with the > Kernel Debugger, see > http://www.freebsd.org/doc/en/books/developers-handbook/kerneldebug.html > for details). > > Thanks! > > > Responsible-Changed-From-To: freebsd-usb->gavin > Responsible-Changed-By: gavin > Responsible-Changed-When: Mon Feb 2 20:46:56 UTC 2009 > Responsible-Changed-Why: > Not USB specific. Track. > > http://www.freebsd.org/cgi/query-pr.cgi?pr=107446 --------------080108020902020300000002-- From owner-freebsd-usb@FreeBSD.ORG Wed Feb 4 17:30:13 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 302A61065672; Wed, 4 Feb 2009 17:30:13 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe01.swip.net [212.247.154.1]) by mx1.freebsd.org (Postfix) with ESMTP id 8AE7D8FC1E; Wed, 4 Feb 2009 17:30:12 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=w5CQLSjO4joA:10 a=T1bnw8qjY7gA:10 a=6I5d2MoRAAAA:8 a=mI7YBl7DIliEoSTzFYAA:9 a=nzm_t_tu8TeQnuDZgp2NQljMVHsA:4 a=50e4U0PicR4A:10 Received: from [85.19.218.115] (account mc467741@c2i.net HELO [10.37.1.92]) by mailfe01.swip.net (CommuniGate Pro SMTP 5.2.6) with ESMTPA id 140085974; Wed, 04 Feb 2009 18:30:10 +0100 From: Hans Petter Selasky To: freebsd-usb@freebsd.org Date: Wed, 4 Feb 2009 18:32:35 +0100 User-Agent: KMail/1.9.7 References: <1233734352.1767.55.camel@localhost> <20090204.085606.1630229139.imp@bsdimp.com> <200902041733.23389.hselasky@c2i.net> In-Reply-To: <200902041733.23389.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902041832.36833.hselasky@c2i.net> Cc: vova@fbsd.ru, freebsd-current@freebsd.org Subject: Re: [was: USB2 - umass problem] U3G modem unit number changes X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Feb 2009 17:30:14 -0000 Hi Vladimir, You can try the following patch if you want: http://perforce.freebsd.org/chv.cgi?CH=157145 You probably need to apply by hand, but if you can wait a couple of days, this will be in -current . --HPS From owner-freebsd-usb@FreeBSD.ORG Wed Feb 4 22:32:09 2009 Return-Path: Delivered-To: usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C7F71065676; Wed, 4 Feb 2009 22:32:09 +0000 (UTC) (envelope-from vova@sw.ru) Received: from relay.sw.ru (mailhub.sw.ru [195.214.232.25]) by mx1.freebsd.org (Postfix) with ESMTP id E3D7D8FC13; Wed, 4 Feb 2009 22:32:08 +0000 (UTC) (envelope-from vova@sw.ru) Received: from vbook.fbsd.ru ([77.232.23.6]) (authenticated bits=0) by relay.sw.ru (8.13.4/8.13.4) with ESMTP id n14MV2Vk026320 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 5 Feb 2009 01:31:03 +0300 (MSK) Received: from vova by vbook.fbsd.ru with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1LUqGr-0000mg-Pg; Thu, 05 Feb 2009 01:31:01 +0300 From: Vladimir Grebenschikov To: "M. Warner Losh" In-Reply-To: <20090204.085606.1630229139.imp@bsdimp.com> References: <1233734352.1767.55.camel@localhost> <200902041044.27663.hselasky@c2i.net> <20090204.085606.1630229139.imp@bsdimp.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: SWsoft Date: Thu, 05 Feb 2009 01:31:01 +0300 Message-Id: <1233786661.2821.5.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.24.3 FreeBSD GNOME Team Port Sender: Vladimir Grebenschikov Cc: usb@freebsd.org, freebsd-current@freebsd.org Subject: Re: USB2 - umass problem X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: vova@fbsd.ru List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Feb 2009 22:32:10 -0000 On Wed, 2009-02-04 at 08:56 -0700, M. Warner Losh wrote: > In message: <200902041044.27663.hselasky@c2i.net> > Hans Petter Selasky writes: > : Hi, > : > : On Wednesday 04 February 2009, Vladimir Grebenschikov wrote: > : > Hi > : > > : > > : > By some reason devfs semantic was changed: > : > Instead of /dev/cuaU0.[0-2] and /dev/ttyU0.[0-2], I've get > : > /dev/cuaU[0-2] /dev/ttyU[0-2] and! /dev/cuau1 /dev/ttyu1 > : > What is reason for such change (additional port with lowercase 'u' and > : > U[0-2] instead of more logical U0.[0-2]) ? > : > : It is because we are attaching drivers per interface instead of per device. A > : new modem unit is allocated every time we find a modem, simply put. If the > : modem has multiple instances in an interface, /dev/cuaU0.[0...] will be > : created. Else /dev/cuaU... . > > Generally, we try not to change the details of how a device attaches > /dev entries from release to release. Why the change? > > Also to Vladimir, Are you sure that the 'u' devices are created with > the USB modem? They should only be created for uart devices... Yes, it is uart. > Warner -- Vladimir B. Grebenschikov vova@fbsd.ru From owner-freebsd-usb@FreeBSD.ORG Fri Feb 6 05:12:30 2009 Return-Path: Delivered-To: usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B7CE106564A for ; Fri, 6 Feb 2009 05:12:30 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id F1E258FC13 for ; Fri, 6 Feb 2009 05:12:29 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id CB9811A3C3D; Thu, 5 Feb 2009 20:53:49 -0800 (PST) Date: Thu, 5 Feb 2009 20:53:49 -0800 From: Alfred Perlstein To: current@freebsd.org, usb@freebsd.org Message-ID: <20090206045349.GQ78804@elvis.mu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i Cc: Subject: HEADSUP usb2/usb4bsd to become default in GENERIC X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Feb 2009 05:12:30 -0000 Hello -current and -usb. We are in the final stages of bringing in the new usb stack. Features include: SMP, better device support, speed increases. We hope to make it in for 8.0. It will really take a unified effort to make this all work and I look forward to all contributors input. We have a few large steps ahead of us and I wanted to lay out the schedule so that people understand what is coming and what to expect. At this point we expect there to be no style or changes in usb2 that are not bugfixes until Phase 3 "Hand off". The reason for this is to prevent bugs from creeping in and allow the maintainer to focus 100% on bugs and feature parity with the oldusb stack. Here is the plan and timeline: Phase 1) Make usb2 the default, by enabling it in GENERIC. * Sunday 8 Feb 2009 -- Toggle the usb2 knob in GENERIC - Add all the usb2 options to NOTES, including commented documentation about recommended usb2 'sets' of options, and the usual NOTES-based hints about the options. - Update GENERIC to use usb2 device names. - Bump __FreeBSD_version and edit UPDATING to note usb2 is now the default. - Verify that it still possible to use the old usb code as a fallback, until we are ready to detach and remove it from /head * Sunday 22 Feb 2009 -- Go through quirks in old-usb code and port over any remaining bits to usb2 - Lock the oldusb code for 2 weeks, until the next usb2 checkpoint, to verify usb2 is a viable replacement without having to keep chasing a moving oldusb target. Phase 2) Removing the oldusb code. * Sunday 15 Mar 2009 -- usb2 bug busting weekend - Go through the open usb2 problem reports, and see if there are any usb2 blocker bugs that need fixing. - If the bug hunt shows we are ready to do away with oldusb, unlink the old usb code from the build, but leave it in for a few more days. * Sunday 22 Mar 2009 -- remove oldusb code. - old usb code will be removed. Phase 3) Hand-off. * Sunday 29 Mar 2009 -- usb2 hand over to src-committers - The switch from a private Hans-only repository to the main subversion tree. - At this point, the usb2 is handed over to the src-committers and Hans has to go through a mentor/committer before committing changes. Thank you! -- - Alfred Perlstein From owner-freebsd-usb@FreeBSD.ORG Fri Feb 6 09:50:24 2009 Return-Path: Delivered-To: usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D014106564A for ; Fri, 6 Feb 2009 09:50:24 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from sippysoft.com (gk1.360sip.com [72.236.70.240]) by mx1.freebsd.org (Postfix) with ESMTP id 2308A8FC16 for ; Fri, 6 Feb 2009 09:50:23 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from [192.168.1.38] (S0106001372fd1e07.vs.shawcable.net [70.71.171.106]) (authenticated bits=0) by sippysoft.com (8.13.8/8.13.8) with ESMTP id n169M2PD015290 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 6 Feb 2009 01:22:03 -0800 (PST) (envelope-from sobomax@FreeBSD.org) Message-ID: <498C013B.4000405@FreeBSD.org> Date: Fri, 06 Feb 2009 01:22:03 -0800 From: Maxim Sobolev Organization: Sippy Software, Inc. User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) MIME-Version: 1.0 To: Alfred Perlstein References: <20090206045349.GQ78804@elvis.mu.org> In-Reply-To: <20090206045349.GQ78804@elvis.mu.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: usb@FreeBSD.org, current@FreeBSD.org Subject: Re: HEADSUP usb2/usb4bsd to become default in GENERIC X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Feb 2009 09:50:24 -0000 Alfred Perlstein wrote: > - Update GENERIC to use usb2 device names. Wasn't there a plan to rename usb2 devices to match oldusb names (where applicable) once oldusb had been killed? I don't see it in the list. -Maxim From owner-freebsd-usb@FreeBSD.ORG Fri Feb 6 15:21:45 2009 Return-Path: Delivered-To: usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B34511065672; Fri, 6 Feb 2009 15:21:45 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 36D1D8FC14; Fri, 6 Feb 2009 15:21:45 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n16FIVoh060166; Fri, 6 Feb 2009 08:18:31 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Fri, 06 Feb 2009 08:19:01 -0700 (MST) Message-Id: <20090206.081901.1923806177.imp@bsdimp.com> To: alfred@freebsd.org From: "M. Warner Losh" In-Reply-To: <20090206045349.GQ78804@elvis.mu.org> References: <20090206045349.GQ78804@elvis.mu.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: usb@freebsd.org, current@freebsd.org Subject: Re: HEADSUP usb2/usb4bsd to become default in GENERIC X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Feb 2009 15:21:46 -0000 Doesn't the busdma issue need to be solved before we do this? usb2 currently doesn't work if you have memory above 4GB due to this issue. I thought we tagged it as a show stopper for making it the default. Warner In message: <20090206045349.GQ78804@elvis.mu.org> Alfred Perlstein writes: : Hello -current and -usb. : : We are in the final stages of bringing in the new usb : stack. : : Features include: SMP, better device support, speed increases. : : We hope to make it in for 8.0. It will really take a unified effort : to make this all work and I look forward to all contributors input. : : We have a few large steps ahead of us and I wanted to lay out the : schedule so that people understand what is coming and what to expect. : : At this point we expect there to be no style or changes in usb2 : that are not bugfixes until Phase 3 "Hand off". The reason for : this is to prevent bugs from creeping in and allow the maintainer : to focus 100% on bugs and feature parity with the oldusb stack. : : Here is the plan and timeline: : : Phase 1) Make usb2 the default, by enabling it in GENERIC. : : * Sunday 8 Feb 2009 -- Toggle the usb2 knob in GENERIC : : - Add all the usb2 options to NOTES, including commented : documentation about recommended usb2 'sets' of options, : and the usual NOTES-based hints about the options. : : - Update GENERIC to use usb2 device names. : : - Bump __FreeBSD_version and edit UPDATING to note usb2 is now the : default. : : - Verify that it still possible to use the old usb code as a : fallback, until we are ready to detach and remove it from /head : : * Sunday 22 Feb 2009 -- Go through quirks in old-usb code and port : over any remaining bits to usb2 : : - Lock the oldusb code for 2 weeks, until the next usb2 : checkpoint, to verify usb2 is a viable replacement without : having to keep chasing a moving oldusb target. : : Phase 2) Removing the oldusb code. : : * Sunday 15 Mar 2009 -- usb2 bug busting weekend : : - Go through the open usb2 problem reports, and see if there are : any usb2 blocker bugs that need fixing. : : - If the bug hunt shows we are ready to do away with oldusb, : unlink the old usb code from the build, but leave it in for : a few more days. : : * Sunday 22 Mar 2009 -- remove oldusb code. : : - old usb code will be removed. : : Phase 3) Hand-off. : : * Sunday 29 Mar 2009 -- usb2 hand over to src-committers : : - The switch from a private Hans-only repository to the main : subversion tree. : : - At this point, the usb2 is handed over to the src-committers : and Hans has to go through a mentor/committer before committing : changes. : : Thank you! : : -- : - Alfred Perlstein : _______________________________________________ : freebsd-current@freebsd.org mailing list : http://lists.freebsd.org/mailman/listinfo/freebsd-current : To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" : From owner-freebsd-usb@FreeBSD.ORG Fri Feb 6 21:59:27 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7764D1065670 for ; Fri, 6 Feb 2009 21:59:27 +0000 (UTC) (envelope-from mike@sentex.net) Received: from smarthost1.sentex.ca (smarthost1.sentex.ca [64.7.153.18]) by mx1.freebsd.org (Postfix) with ESMTP id 3FE658FC12 for ; Fri, 6 Feb 2009 21:59:26 +0000 (UTC) (envelope-from mike@sentex.net) Received: from lava.sentex.ca (pyroxene.sentex.ca [199.212.134.18]) by smarthost1.sentex.ca (8.14.3/8.14.3) with ESMTP id n16LQ0jb058140 for ; Fri, 6 Feb 2009 16:26:00 -0500 (EST) (envelope-from mike@sentex.net) Received: from mdt-xp.sentex.net (simeon.sentex.ca [192.168.43.27]) by lava.sentex.ca (8.13.8/8.13.3) with ESMTP id n16LQ0Gc013030 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 6 Feb 2009 16:26:00 -0500 (EST) (envelope-from mike@sentex.net) Message-Id: <200902062126.n16LQ0Gc013030@lava.sentex.ca> X-Mailer: QUALCOMM Windows Eudora Version 7.1.0.9 Date: Fri, 06 Feb 2009 16:26:02 -0500 To: freebsd-usb@freebsd.org From: Mike Tancsa Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Scanned-By: MIMEDefang 2.64 on 64.7.153.18 Subject: eToken and USB2 (ugen issue?) X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Feb 2009 21:59:29 -0000 I was going to try out some of our apps on HEAD with USB2 kernel. dmesg shows ugen0.3: at usbus0 however, there is no ugen device ? 0[freebsd-current2]# ls -l /dev/u* lrwxr-xr-x 1 root wheel 6 Feb 6 15:34 /dev/urandom -> random crwxrwxrwx 1 root operator 0, 81 Feb 6 15:34 /dev/usb 0[freebsd-current2]# where as on RELENG_7, it comes up as ugen0: on uhub5 0[nanobsd2]# ls -l /dev/ugen0 crw-r--r-- 1 root operator - 0, 100 Feb 2 09:13 /dev/ugen0 0[nanobsd2]# which openct/opensc use to talk to the token. Is there something I need to add to the kernel ? I am using the USB2 kernel definition on AMD64 ---Mike -------------------------------------------------------------------- Mike Tancsa, tel +1 519 651 3400 Sentex Communications, mike@sentex.net Providing Internet since 1994 www.sentex.net Cambridge, Ontario Canada www.sentex.net/mike From owner-freebsd-usb@FreeBSD.ORG Fri Feb 6 22:08:36 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1519106566C for ; Fri, 6 Feb 2009 22:08:36 +0000 (UTC) (envelope-from mike@sentex.net) Received: from smarthost1.sentex.ca (smarthost1.sentex.ca [64.7.153.18]) by mx1.freebsd.org (Postfix) with ESMTP id 5104B8FC13 for ; Fri, 6 Feb 2009 22:08:36 +0000 (UTC) (envelope-from mike@sentex.net) Received: from lava.sentex.ca (pyroxene.sentex.ca [199.212.134.18]) by smarthost1.sentex.ca (8.14.3/8.14.3) with ESMTP id n16M8XGR063035 for ; Fri, 6 Feb 2009 17:08:33 -0500 (EST) (envelope-from mike@sentex.net) Received: from mdt-xp.sentex.net (simeon.sentex.ca [192.168.43.27]) by lava.sentex.ca (8.13.8/8.13.3) with ESMTP id n16M8Xkr013205 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 6 Feb 2009 17:08:33 -0500 (EST) (envelope-from mike@sentex.net) Message-Id: <200902062208.n16M8Xkr013205@lava.sentex.ca> X-Mailer: QUALCOMM Windows Eudora Version 7.1.0.9 Date: Fri, 06 Feb 2009 17:08:36 -0500 To: freebsd-usb@freebsd.org From: Mike Tancsa In-Reply-To: <200902062126.n16LQ0Gc013030@lava.sentex.ca> References: <200902062126.n16LQ0Gc013030@lava.sentex.ca> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Scanned-By: MIMEDefang 2.64 on 64.7.153.18 Subject: Re: eToken and USB2 (ugen issue?) X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Feb 2009 22:08:37 -0000 At 04:26 PM 2/6/2009, Mike Tancsa wrote: >I was going to try out some of our apps on HEAD with USB2 kernel. > >dmesg shows > >ugen0.3: at usbus0 > >however, there is no ugen device ? > >0[freebsd-current2]# ls -l /dev/u* >lrwxr-xr-x 1 root wheel 6 Feb 6 15:34 /dev/urandom -> random >crwxrwxrwx 1 root operator 0, 81 Feb 6 15:34 /dev/usb >0[freebsd-current2]# > > >where as on RELENG_7, it comes up as > >ugen0: 2.7.195, class 0/0, rev 1.10/1.00, addr 4> on uhub5 >0[nanobsd2]# ls -l /dev/ugen0 >crw-r--r-- 1 root operator - 0, 100 Feb 2 09:13 /dev/ugen0 >0[nanobsd2]# > >which openct/opensc use to talk to the token. > >Is there something I need to add to the kernel ? I am using the >USB2 kernel definition on AMD64 I turned up the debugging and dumped out the following info usbconfig -u 0 -a 2 dump_curr_config_desc ugen0.2: at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON Configuration index 0 bLength = 0x0009 bDescriptorType = 0x0002 wTotalLength = 0x0014 bNumInterfaces = 0x0001 bConfigurationValue = 0x0001 iConfiguration = 0x0000 bmAttributes = 0x0080 bMaxPower = 0x0032 Interface 0 bLength = 0x0009 bDescriptorType = 0x0004 bInterfaceNumber = 0x0000 bAlternateSetting = 0x0000 bNumEndpoints = 0x0000 bInterfaceClass = 0x00ff bInterfaceSubClass = 0x0000 bInterfaceProtocol = 0x0000 iInterface = 0x0000 0[freebsd-current2]# usbconfig -u 0 -a 2 dump_access Global Access: root:operator 0660 ugen0.2: at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON Device Access: Interface 0 Access: 0[freebsd-current2]# ugen0.2: at usbus0 (disconnected) ugen0.2: at usbus0 ushub2: on usbus0 ushub2: 4 ports with 4 removable, self powered ugen0.3: at usbus0 ushub2: at ushub0, port 1, addr 2 (disconnected) ugen0.3: at usbus0 (disconnected) ugen0.2: at usbus0 (disconnected) ugen0.2: at usbus0 ugen_open:157: flag=0x1 ugen_open:157: flag=0x2 ugen_ioctl:1396: cmd=0x4004557e ugen_ioctl:1579: error=-3 ugen_ioctl_post:1977: cmd=0x4004557e ugen_ioctl_post:2178: error=0 ugen_ioctl:1396: cmd=0x40125569 ugen_ioctl:1579: error=-3 ugen_ioctl_post:1977: cmd=0x40125569 ugen_ioctl_post:2178: error=0 ugen_ioctl:1396: cmd=0x41705570 ugen_ioctl:1579: error=-3 ugen_ioctl_post:1977: cmd=0x41705570 ugen_ioctl_post:2178: error=0 ugen_close:187: flag=0x1 ugen_close:201: no FIFOs ugen_close:187: flag=0x2 ugen_close:201: no FIFOs ugen_open:157: flag=0x1 ugen_open:157: flag=0x2 ugen_ioctl:1396: cmd=0x4004557e ugen_ioctl:1579: error=-3 ugen_ioctl_post:1977: cmd=0x4004557e ugen_ioctl_post:2178: error=0 ugen_ioctl:1396: cmd=0x40125569 ugen_ioctl:1579: error=-3 ugen_ioctl_post:1977: cmd=0x40125569 ugen_ioctl_post:2178: error=0 ugen_ioctl:1396: cmd=0x41705570 ugen_ioctl:1579: error=-3 ugen_ioctl_post:1977: cmd=0x41705570 ugen_ioctl_post:2178: error=0 ugen_close:187: flag=0x1 ugen_close:201: no FIFOs ugen_close:187: flag=0x2 ugen_close:201: no FIFOs ugen_open:157: flag=0x1 ugen_open:157: flag=0x2 ugen_ioctl:1396: cmd=0x4004557e ugen_ioctl:1579: error=-3 ugen_ioctl_post:1977: cmd=0x4004557e ugen_ioctl_post:2178: error=0 ugen_ioctl:1396: cmd=0x40125569 ugen_ioctl:1579: error=-3 ugen_ioctl_post:1977: cmd=0x40125569 ugen_ioctl_post:2178: error=0 ugen_ioctl:1396: cmd=0x41705570 ugen_ioctl:1579: error=-3 ugen_ioctl_post:1977: cmd=0x41705570 ugen_ioctl_post:2178: error=0 ugen_close:187: flag=0x1 ugen_close:201: no FIFOs ugen_close:187: flag=0x2 ugen_close:201: no FIFOs ugen_open:157: flag=0x1 ugen_open:157: flag=0x2 ugen_ioctl:1396: cmd=0x4004557e ugen_ioctl:1579: error=-3 ugen_ioctl_post:1977: cmd=0x4004557e ugen_ioctl_post:2178: error=0 ugen_ioctl:1396: cmd=0x40125569 ugen_ioctl:1579: error=-3 ugen_ioctl_post:1977: cmd=0x40125569 ugen_ioctl_post:2178: error=0 ugen_ioctl:1396: cmd=0x41705570 ugen_ioctl:1579: error=-3 ugen_ioctl_post:1977: cmd=0x41705570 ugen_ioctl_post:2178: error=0 ugen_close:187: flag=0x1 ugen_close:201: no FIFOs ugen_close:187: flag=0x2 ugen_close:201: no FIFOs ugen_open:157: flag=0x1 ugen_open:157: flag=0x2 ugen_ioctl:1396: cmd=0x4004557e ugen_ioctl:1579: error=-3 ugen_ioctl_post:1977: cmd=0x4004557e ugen_ioctl_post:2178: error=0 ugen_ioctl:1396: cmd=0x40125569 ugen_ioctl:1579: error=-3 ugen_ioctl_post:1977: cmd=0x40125569 ugen_ioctl_post:2178: error=0 ugen_ioctl:1396: cmd=0x41705570 ugen_ioctl:1579: error=-3 ugen_ioctl_post:1977: cmd=0x41705570 ugen_ioctl_post:2178: error=0 ugen_close:187: flag=0x1 ugen_close:201: no FIFOs ugen_close:187: flag=0x2 ugen_close:201: no FIFOs ugen_open:157: flag=0x1 ugen_open:157: flag=0x2 ugen_ioctl:1396: cmd=0x4004557e ugen_ioctl:1579: error=-3 ugen_ioctl_post:1977: cmd=0x4004557e ugen_ioctl_post:2178: error=0 ugen_ioctl:1396: cmd=0x40125569 ugen_ioctl:1579: error=-3 ugen_ioctl_post:1977: cmd=0x40125569 ugen_ioctl_post:2178: error=0 ugen_ioctl:1396: cmd=0x41705570 ugen_ioctl:1579: error=-3 ugen_ioctl_post:1977: cmd=0x41705570 ugen_ioctl_post:2178: error=0 ugen_close:187: flag=0x1 ugen_close:201: no FIFOs ugen_close:187: flag=0x2 ugen_close:201: no FIFOs ugen_open:157: flag=0x1 ugen_open:157: flag=0x2 ugen_open:157: flag=0x1 ugen_open:157: flag=0x2 ugen_ioctl:1396: cmd=0x4004557e ugen_ioctl:1579: error=-3 ugen_ioctl_post:1977: cmd=0x4004557e ugen_ioctl_post:2178: error=0 ugen_ioctl:1396: cmd=0x40045592 ugen_ioctl:1579: error=-3 ugen_ioctl_post:1977: cmd=0x40045592 ugen_ioctl_post:2178: error=0 ugen_ioctl:1396: cmd=0x40045564 ugen_ioctl:1579: error=-3 ugen_ioctl_post:1977: cmd=0x40045564 ugen_ioctl_post:2178: error=0 ugen_ioctl:1396: cmd=0x40045564 ugen_ioctl:1579: error=-3 ugen_ioctl_post:1977: cmd=0x40045564 ugen_ioctl_post:2178: error=0 ugen_ioctl:1396: cmd=0xc020556d ugen_ioctl:1579: error=-3 ugen_ioctl_post:1977: cmd=0xc020556d ugen_get_cdesc:650: ugen_get_cdesc:677: len=9 ugen_ioctl_post:2178: error=0 ugen_ioctl:1396: cmd=0xc020556d ugen_ioctl:1579: error=-3 ugen_ioctl_post:1977: cmd=0xc020556d ugen_get_cdesc:650: ugen_get_cdesc:677: len=20 ugen_ioctl_post:2178: error=0 ugen_close:187: flag=0x1 ugen_close:201: no FIFOs ugen_close:187: flag=0x2 ugen_close:201: no FIFOs ugen_close:187: flag=0x1 ugen_close:201: no FIFOs ugen_close:187: flag=0x2 ugen_close:201: no FIFOs ugen_open:157: flag=0x1 ugen_open:157: flag=0x2 ugen_ioctl:1396: cmd=0x4004557e ugen_ioctl:1579: error=-3 ugen_ioctl_post:1977: cmd=0x4004557e ugen_ioctl_post:2178: error=0 ugen_ioctl:1396: cmd=0x40125569 ugen_ioctl:1579: error=-3 ugen_ioctl_post:1977: cmd=0x40125569 ugen_ioctl_post:2178: error=0 ugen_ioctl:1396: cmd=0x41705570 ugen_ioctl:1579: error=-3 ugen_ioctl_post:1977: cmd=0x41705570 ugen_ioctl_post:2178: error=0 ugen_close:187: flag=0x1 ugen_close:201: no FIFOs ugen_close:187: flag=0x2 ugen_close:201: no FIFOs ugen_open:157: flag=0x1 ugen_open:157: flag=0x2 ugen_ioctl:1396: cmd=0x4004557e ugen_ioctl:1579: error=-3 ugen_ioctl_post:1977: cmd=0x4004557e ugen_ioctl_post:2178: error=0 ugen_ioctl:1396: cmd=0x40125569 ugen_ioctl:1579: error=-3 ugen_ioctl_post:1977: cmd=0x40125569 ugen_ioctl_post:2178: error=0 ugen_ioctl:1396: cmd=0x41705570 ugen_ioctl:1579: error=-3 ugen_ioctl_post:1977: cmd=0x41705570 ugen_ioctl_post:2178: error=0 ugen_close:187: flag=0x1 ugen_close:201: no FIFOs ugen_close:187: flag=0x2 ugen_close:201: no FIFOs ugen_open:157: flag=0x1 ugen_open:157: flag=0x2 ugen_ioctl:1396: cmd=0x4004557e ugen_ioctl:1579: error=-3 ugen_ioctl_post:1977: cmd=0x4004557e ugen_ioctl_post:2178: error=0 ugen_ioctl:1396: cmd=0x40125569 ugen_ioctl:1579: error=-3 ugen_ioctl_post:1977: cmd=0x40125569 ugen_ioctl_post:2178: error=0 ugen_ioctl:1396: cmd=0x41705570 ugen_ioctl:1579: error=-3 ugen_ioctl_post:1977: cmd=0x41705570 ugen_ioctl_post:2178: error=0 ugen_close:187: flag=0x1 ugen_close:201: no FIFOs ugen_close:187: flag=0x2 ugen_close:201: no FIFOs ugen_open:157: flag=0x1 ugen_open:157: flag=0x2 ugen_open:157: flag=0x1 ugen_open:157: flag=0x2 ugen_ioctl:1396: cmd=0x4004557e ugen_ioctl:1579: error=-3 ugen_ioctl_post:1977: cmd=0x4004557e ugen_ioctl_post:2178: error=0 ugen_ioctl:1396: cmd=0x40045592 ugen_ioctl:1579: error=-3 ugen_ioctl_post:1977: cmd=0x40045592 ugen_ioctl_post:2178: error=0 ugen_ioctl:1396: cmd=0x40045564 ugen_ioctl:1579: error=-3 ugen_ioctl_post:1977: cmd=0x40045564 ugen_ioctl_post:2178: error=0 ugen_ioctl:1396: cmd=0x40045564 ugen_ioctl:1579: error=-3 ugen_ioctl_post:1977: cmd=0x40045564 ugen_ioctl_post:2178: error=0 ugen_ioctl:1396: cmd=0xc020556d ugen_ioctl:1579: error=-3 ugen_ioctl_post:1977: cmd=0xc020556d ugen_get_cdesc:650: ugen_get_cdesc:677: len=9 ugen_ioctl_post:2178: error=0 ugen_ioctl:1396: cmd=0xc020556d ugen_ioctl:1579: error=-3 ugen_ioctl_post:1977: cmd=0xc020556d ugen_get_cdesc:650: ugen_get_cdesc:677: len=20 ugen_ioctl_post:2178: error=0 ugen_close:187: flag=0x1 ugen_close:201: no FIFOs ugen_close:187: flag=0x2 ugen_close:201: no FIFOs ugen_close:187: flag=0x1 ugen_close:201: no FIFOs ugen_close:187: flag=0x2 ugen_close:201: no FIFOs From owner-freebsd-usb@FreeBSD.ORG Sat Feb 7 00:32:21 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A49011065674 for ; Sat, 7 Feb 2009 00:32:21 +0000 (UTC) (envelope-from Thomas.Sparrevohn@btinternet.com) Received: from smtp808.mail.ird.yahoo.com (smtp808.mail.ird.yahoo.com [217.146.188.68]) by mx1.freebsd.org (Postfix) with SMTP id 106DB8FC18 for ; Sat, 7 Feb 2009 00:32:20 +0000 (UTC) (envelope-from Thomas.Sparrevohn@btinternet.com) Received: (qmail 70647 invoked from network); 7 Feb 2009 00:32:19 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=btinternet.com; h=Received:X-YMail-OSG:X-Yahoo-Newman-Property:From:To:Subject:Date:User-Agent:References:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-Disposition:Message-Id; b=YtVa6KUttZ70/oyYT/PBRfhZKxUj5ha1YYKWIXg3dZNH0Zi+FOpuev8njeLt9/AU23hjGo8wUZzL/nX/UNXWx+SoSzzYmU42xors6nD1WhvIOfGxVYpsn2ADAyAtnlSEQ+C/MoCUEsBIogK3bhN3aZQ+mren5MrzbcI/RlHMu28= ; Received: from unknown (HELO w2fzz0vc03.aah-go-on.com) (Thomas.Sparrevohn@86.133.246.172 with login) by smtp808.mail.ird.yahoo.com with SMTP; 7 Feb 2009 00:32:19 -0000 X-YMail-OSG: XhJnZQkVM1m5Wa6Lt48VsdURcFzOCx1y_mARvARaTqihGhkWy7DwP_UcvdBg.cCNl4X8c_F7A2iJZ.Ka1qoI5lB4NHyRMhppcgOhnAMHzuS1DVLnyWqlE.sEqiBSIsGZxefDyGOej12B9_1SmXXDl_2f.NmbxqJ2rmeUk7s5Cg_Ca3e55xu7.SxNXiGW X-Yahoo-Newman-Property: ymail-3 From: Thomas Sparrevohn To: freebsd-usb@freebsd.org Date: Sat, 7 Feb 2009 00:32:18 +0000 User-Agent: KMail/1.9.10 References: <20090206045349.GQ78804@elvis.mu.org> <20090206.081901.1923806177.imp@bsdimp.com> In-Reply-To: <20090206.081901.1923806177.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902070032.18792.Thomas.Sparrevohn@btinternet.com> Subject: Re: HEADSUP usb2/usb4bsd to become default in GENERIC X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Feb 2009 00:32:21 -0000 On Friday 06 February 2009 15:19:01 M. Warner Losh wrote: > Doesn't the busdma issue need to be solved before we do this? usb2 > currently doesn't work if you have memory above 4GB due to this > issue. I thought we tagged it as a show stopper for making it the > default. > > Warner To be honst - I stongly recommend that it's fixed before. I know the problem is not related to the USB2 stack as such - However the way the problem occurs e.g. a corruption in the ATA dma load make it far from clear that it's a USB bounce buffer problem and my error reports was generally ignored with the - there nothing wrong with the ATA code - quite correctly as it turned out but - it kept me using an old kernel before the old brain got around to thinking about USB So I would love to see it fixed and I am not quite sure what the hold up is? Last time I heard - we seemed to be caugth in between - a double "there nothing wrong with the dma code" and "that is the way USB works" ;-) I am sure there is more to it however ;-0) Regards T. From owner-freebsd-usb@FreeBSD.ORG Sat Feb 7 09:34:09 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D18A71065670 for ; Sat, 7 Feb 2009 09:34:09 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe06.swip.net [212.247.154.161]) by mx1.freebsd.org (Postfix) with ESMTP id 2713A8FC12 for ; Sat, 7 Feb 2009 09:34:08 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=ar-1rcyr13IA:10 a=6I5d2MoRAAAA:8 a=D4eJRXS2YzKuyFK5coYA:9 a=v4GY_7dLmWCybU3TlD4A:7 a=pkKWyS5_i70K0fExg3mJzNVKQ0MA:4 a=SV7veod9ZcQA:10 a=50e4U0PicR4A:10 Received: from [193.217.167.198] (account mc467741@c2i.net HELO [10.0.0.186]) by mailfe06.swip.net (CommuniGate Pro SMTP 5.2.6) with ESMTPA id 1193043084; Sat, 07 Feb 2009 10:34:06 +0100 From: Hans Petter Selasky To: freebsd-usb@freebsd.org Date: Sat, 7 Feb 2009 10:36:32 +0100 User-Agent: KMail/1.9.7 References: <200902062126.n16LQ0Gc013030@lava.sentex.ca> <200902062208.n16M8Xkr013205@lava.sentex.ca> In-Reply-To: <200902062208.n16M8Xkr013205@lava.sentex.ca> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902071036.32995.hselasky@c2i.net> Cc: Subject: Re: eToken and USB2 (ugen issue?) X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Feb 2009 09:34:10 -0000 Hi Mike, The ugen devices are invisible and dynamically created. Try open /dev/ugen0.2.0.0 (control endpoint) Also you need to re-link your application with "dev/usb2/include/usb2_ioctl.h" Format is /dev/ugen... I recommend using libusb20 to access your USB device. See "man libusb20". --HPS On Friday 06 February 2009, Mike Tancsa wrote: > At 04:26 PM 2/6/2009, Mike Tancsa wrote: > >I was going to try out some of our apps on HEAD with USB2 kernel. > > > >dmesg shows > > > >ugen0.3: at usbus0 > > > > usbconfig -u 0 -a 2 dump_curr_config_desc > ugen0.2: Ltd.> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON > > > Configuration index 0 > > bLength = 0x0009 > bDescriptorType = 0x0002 > wTotalLength = 0x0014 > bNumInterfaces = 0x0001 > bConfigurationValue = 0x0001 > iConfiguration = 0x0000 > bmAttributes = 0x0080 > bMaxPower = 0x0032 > > Interface 0 > bLength = 0x0009 > bDescriptorType = 0x0004 > bInterfaceNumber = 0x0000 > bAlternateSetting = 0x0000 > bNumEndpoints = 0x0000 > bInterfaceClass = 0x00ff > bInterfaceSubClass = 0x0000 > bInterfaceProtocol = 0x0000 > iInterface = 0x0000 > > > > 0[freebsd-current2]# usbconfig -u 0 -a 2 dump_access > Global Access: root:operator 0660 > ugen0.2: Ltd.> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON > > Device Access: > Interface 0 Access: > > 0[freebsd-current2]# > > ugen0.2: at usbus0 (disconnected) > ugen0.2: at usbus0 > ushub2: on usbus0 > ushub2: 4 ports with 4 removable, self powered > ugen0.3: at usbus0 > ushub2: at ushub0, port 1, addr 2 (disconnected) > ugen0.3: at usbus0 (disconnected) > ugen0.2: at usbus0 (disconnected) > ugen0.2: at usbus0 > ugen_open:157: flag=0x1 > ugen_open:157: flag=0x2 > ugen_ioctl:1396: cmd=0x4004557e > uge > n_ioctl:1579: error=-3 > ugen_ioctl_post:1977: cmd=0x4004557e > ugen_ioctl_post:2178: error=0 > ugen_ioctl:1396: cmd=0x40125569 > ugen_ioctl:1579: error=-3 > ugen_ioctl_post:1977: cmd=0x40125569 > ugen_ioctl_post:2178: error=0 > ugen_ioctl:1396: cmd=0x41705570 > ugen_ioctl:1579: error=-3 > ugen_ioctl_post:1977: cmd=0x41705570 > ugen_ioctl_post:2178: error=0 > ugen_close:187: flag=0x1 > ugen_close:201: no FIFOs > ugen_close:187: flag=0x2 > ugen_close:201: no FIFOs > ugen_open:157: flag=0x1 > ugen_open:157: flag=0x2 > ugen_ioctl:1396: cmd=0x4004557e > ugen_ioctl:1579: error=-3 > ugen_ioctl_post:1977: cmd=0x4004557e > ugen_ioctl_post:2178: error=0 > ugen_ioctl:1396: cmd=0x40125569 > ugen_ioctl:1579: error=-3 > ugen_ioctl_post:1977: cmd=0x40125569 > ugen_ioctl_post:2178: error=0 > ugen_ioctl:1396: cmd=0x41705570 > ugen_ioctl:1579: error=-3 > ugen_ioctl_post:1977: cmd=0x41705570 > ugen_ioctl_post:2178: error=0 > ugen_close:187: flag=0x1 > ugen_close:201: no FIFOs > ugen_close:187: flag=0x2 > ugen_close:201: no FIFOs > ugen_open:157: flag=0x1 > ugen_open:157: flag=0x2 > ugen_ioctl:1396: cmd=0x4004557e > ugen_ioctl:1579: error=-3 > ugen_ioctl_post:1977: cmd=0x4004557e > ugen_ioctl_post:2178: error=0 > ugen_ioctl:1396: cmd=0x40125569 > ugen_ioctl:1579: error=-3 > ugen_ioctl_post:1977: cmd=0x40125569 > ugen_ioctl_post:2178: error=0 > ugen_ioctl:1396: cmd=0x41705570 > ugen_ioctl:1579: error=-3 > ugen_ioctl_post:1977: cmd=0x41705570 > ugen_ioctl_post:2178: error=0 > ugen_close:187: flag=0x1 > ugen_close:201: no FIFOs > ugen_close:187: flag=0x2 > ugen_close:201: no FIFOs > ugen_open:157: flag=0x1 > ugen_open:157: flag=0x2 > ugen_ioctl:1396: cmd=0x4004557e > ugen_ioctl:1579: error=-3 > ugen_ioctl_post:1977: cmd=0x4004557e > ugen_ioctl_post:2178: error=0 > ugen_ioctl:1396: cmd=0x40125569 > ugen_ioctl:1579: error=-3 > ugen_ioctl_post:1977: cmd=0x40125569 > ugen_ioctl_post:2178: error=0 > ugen_ioctl:1396: cmd=0x41705570 > ugen_ioctl:1579: error=-3 > ugen_ioctl_post:1977: cmd=0x41705570 > ugen_ioctl_post:2178: error=0 > ugen_close:187: flag=0x1 > ugen_close:201: no FIFOs > ugen_close:187: flag=0x2 > ugen_close:201: no FIFOs > ugen_open:157: flag=0x1 > ugen_open:157: flag=0x2 > ugen_ioctl:1396: cmd=0x4004557e > ugen_ioctl:1579: error=-3 > ugen_ioctl_post:1977: cmd=0x4004557e > ugen_ioctl_post:2178: error=0 > ugen_ioctl:1396: cmd=0x40125569 > ugen_ioctl:1579: error=-3 > ugen_ioctl_post:1977: cmd=0x40125569 > ugen_ioctl_post:2178: error=0 > ugen_ioctl:1396: cmd=0x41705570 > ugen_ioctl:1579: error=-3 > ugen_ioctl_post:1977: cmd=0x41705570 > ugen_ioctl_post:2178: error=0 > ugen_close:187: flag=0x1 > ugen_close:201: no FIFOs > ugen_close:187: flag=0x2 > ugen_close:201: no FIFOs > ugen_open:157: flag=0x1 > ugen_open:157: flag=0x2 > ugen_ioctl:1396: cmd=0x4004557e > ugen_ioctl:1579: error=-3 > ugen_ioctl_post:1977: cmd=0x4004557e > ugen_ioctl_post:2178: error=0 > ugen_ioctl:1396: cmd=0x40125569 > ugen_ioctl:1579: error=-3 > ugen_ioctl_post:1977: cmd=0x40125569 > ugen_ioctl_post:2178: error=0 > ugen_ioctl:1396: cmd=0x41705570 > ugen_ioctl:1579: error=-3 > ugen_ioctl_post:1977: cmd=0x41705570 > ugen_ioctl_post:2178: error=0 > ugen_close:187: flag=0x1 > ugen_close:201: no FIFOs > ugen_close:187: flag=0x2 > ugen_close:201: no FIFOs > ugen_open:157: flag=0x1 > ugen_open:157: flag=0x2 > ugen_open:157: flag=0x1 > ugen_open:157: flag=0x2 > ugen_ioctl:1396: cmd=0x4004557e > ugen_ioctl:1579: error=-3 > ugen_ioctl_post:1977: cmd=0x4004557e > ugen_ioctl_post:2178: error=0 > ugen_ioctl:1396: cmd=0x40045592 > ugen_ioctl:1579: error=-3 > ugen_ioctl_post:1977: cmd=0x40045592 > ugen_ioctl_post:2178: error=0 > ugen_ioctl:1396: cmd=0x40045564 > ugen_ioctl:1579: error=-3 > ugen_ioctl_post:1977: cmd=0x40045564 > ugen_ioctl_post:2178: error=0 > ugen_ioctl:1396: cmd=0x40045564 > ugen_ioctl:1579: error=-3 > ugen_ioctl_post:1977: cmd=0x40045564 > ugen_ioctl_post:2178: error=0 > ugen_ioctl:1396: cmd=0xc020556d > ugen_ioctl:1579: error=-3 > ugen_ioctl_post:1977: cmd=0xc020556d > ugen_get_cdesc:650: > ugen_get_cdesc:677: len=9 > ugen_ioctl_post:2178: error=0 > ugen_ioctl:1396: cmd=0xc020556d > ugen_ioctl:1579: error=-3 > ugen_ioctl_post:1977: cmd=0xc020556d > ugen_get_cdesc:650: > ugen_get_cdesc:677: len=20 > ugen_ioctl_post:2178: error=0 > ugen_close:187: flag=0x1 > ugen_close:201: no FIFOs > ugen_close:187: flag=0x2 > ugen_close:201: no FIFOs > ugen_close:187: flag=0x1 > ugen_close:201: no FIFOs > ugen_close:187: flag=0x2 > ugen_close:201: no FIFOs > ugen_open:157: flag=0x1 > ugen_open:157: flag=0x2 > ugen_ioctl:1396: cmd=0x4004557e > ugen_ioctl:1579: error=-3 > ugen_ioctl_post:1977: cmd=0x4004557e > ugen_ioctl_post:2178: error=0 > ugen_ioctl:1396: cmd=0x40125569 > ugen_ioctl:1579: error=-3 > ugen_ioctl_post:1977: cmd=0x40125569 > ugen_ioctl_post:2178: error=0 > ugen_ioctl:1396: cmd=0x41705570 > ugen_ioctl:1579: error=-3 > ugen_ioctl_post:1977: cmd=0x41705570 > ugen_ioctl_post:2178: error=0 > ugen_close:187: flag=0x1 > ugen_close:201: no FIFOs > ugen_close:187: flag=0x2 > ugen_close:201: no FIFOs > ugen_open:157: flag=0x1 > ugen_open:157: flag=0x2 > ugen_ioctl:1396: cmd=0x4004557e > ugen_ioctl:1579: error=-3 > ugen_ioctl_post:1977: cmd=0x4004557e > ugen_ioctl_post:2178: error=0 > ugen_ioctl:1396: cmd=0x40125569 > ugen_ioctl:1579: error=-3 > ugen_ioctl_post:1977: cmd=0x40125569 > ugen_ioctl_post:2178: error=0 > ugen_ioctl:1396: cmd=0x41705570 > ugen_ioctl:1579: error=-3 > ugen_ioctl_post:1977: cmd=0x41705570 > ugen_ioctl_post:2178: error=0 > ugen_close:187: flag=0x1 > ugen_close:201: no FIFOs > ugen_close:187: flag=0x2 > ugen_close:201: no FIFOs > ugen_open:157: flag=0x1 > ugen_open:157: flag=0x2 > ugen_ioctl:1396: cmd=0x4004557e > ugen_ioctl:1579: error=-3 > ugen_ioctl_post:1977: cmd=0x4004557e > ugen_ioctl_post:2178: error=0 > ugen_ioctl:1396: cmd=0x40125569 > ugen_ioctl:1579: error=-3 > ugen_ioctl_post:1977: cmd=0x40125569 > ugen_ioctl_post:2178: error=0 > ugen_ioctl:1396: cmd=0x41705570 > ugen_ioctl:1579: error=-3 > ugen_ioctl_post:1977: cmd=0x41705570 > ugen_ioctl_post:2178: error=0 > ugen_close:187: flag=0x1 > ugen_close:201: no FIFOs > ugen_close:187: flag=0x2 > ugen_close:201: no FIFOs > ugen_open:157: flag=0x1 > ugen_open:157: flag=0x2 > ugen_open:157: flag=0x1 > ugen_open:157: flag=0x2 > ugen_ioctl:1396: cmd=0x4004557e > ugen_ioctl:1579: error=-3 > ugen_ioctl_post:1977: cmd=0x4004557e > ugen_ioctl_post:2178: error=0 > ugen_ioctl:1396: cmd=0x40045592 > ugen_ioctl:1579: error=-3 > ugen_ioctl_post:1977: cmd=0x40045592 > ugen_ioctl_post:2178: error=0 > ugen_ioctl:1396: cmd=0x40045564 > ugen_ioctl:1579: error=-3 > ugen_ioctl_post:1977: cmd=0x40045564 > ugen_ioctl_post:2178: error=0 > ugen_ioctl:1396: cmd=0x40045564 > ugen_ioctl:1579: error=-3 > ugen_ioctl_post:1977: cmd=0x40045564 > ugen_ioctl_post:2178: error=0 > ugen_ioctl:1396: cmd=0xc020556d > ugen_ioctl:1579: error=-3 > ugen_ioctl_post:1977: cmd=0xc020556d > ugen_get_cdesc:650: > ugen_get_cdesc:677: len=9 > ugen_ioctl_post:2178: error=0 > ugen_ioctl:1396: cmd=0xc020556d > ugen_ioctl:1579: error=-3 > ugen_ioctl_post:1977: cmd=0xc020556d > ugen_get_cdesc:650: > ugen_get_cdesc:677: len=20 > ugen_ioctl_post:2178: error=0 > ugen_close:187: flag=0x1 > ugen_close:201: no FIFOs > ugen_close:187: flag=0x2 > ugen_close:201: no FIFOs > ugen_close:187: flag=0x1 > ugen_close:201: no FIFOs > ugen_close:187: flag=0x2 > ugen_close:201: no FIFOs > > > _______________________________________________ > freebsd-usb@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-usb > To unsubscribe, send any mail to "freebsd-usb-unsubscribe@freebsd.org" From owner-freebsd-usb@FreeBSD.ORG Sat Feb 7 11:54:19 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A1A7106566B for ; Sat, 7 Feb 2009 11:54:19 +0000 (UTC) (envelope-from mike@sentex.net) Received: from smarthost1.sentex.ca (smarthost1.sentex.ca [64.7.153.18]) by mx1.freebsd.org (Postfix) with ESMTP id 00AB28FC08 for ; Sat, 7 Feb 2009 11:54:18 +0000 (UTC) (envelope-from mike@sentex.net) Received: from lava.sentex.ca (pyroxene.sentex.ca [199.212.134.18]) by smarthost1.sentex.ca (8.14.3/8.14.3) with ESMTP id n17BsFYK031645; Sat, 7 Feb 2009 06:54:15 -0500 (EST) (envelope-from mike@sentex.net) Received: from mdt-xp.sentex.net (simeon.sentex.ca [192.168.43.27]) by lava.sentex.ca (8.13.8/8.13.3) with ESMTP id n17BsE2h016610 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 7 Feb 2009 06:54:15 -0500 (EST) (envelope-from mike@sentex.net) Message-Id: <200902071154.n17BsE2h016610@lava.sentex.ca> X-Mailer: QUALCOMM Windows Eudora Version 7.1.0.9 Date: Sat, 07 Feb 2009 06:54:19 -0500 To: Hans Petter Selasky , freebsd-usb@freebsd.org From: Mike Tancsa In-Reply-To: <200902071036.32995.hselasky@c2i.net> References: <200902062126.n16LQ0Gc013030@lava.sentex.ca> <200902062208.n16M8Xkr013205@lava.sentex.ca> <200902071036.32995.hselasky@c2i.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Scanned-By: MIMEDefang 2.64 on 64.7.153.18 Cc: Subject: Re: eToken and USB2 (ugen issue?) X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Feb 2009 11:54:19 -0000 At 04:36 AM 2/7/2009, Hans Petter Selasky wrote: >Hi Mike, > >The ugen devices are invisible and dynamically created. > >Try open /dev/ugen0.2.0.0 (control endpoint) > >Also you need to re-link your application with "dev/usb2/include/usb2_ioctl.h" > >Format is /dev/ugen... > >I recommend using libusb20 to access your USB device. > >See "man libusb20". Hi, Thanks for the response. These are all out of the ports (openct,opensc). Are there any pointers somewhere on how to best teach old apps about the new USB2 world on FreeBSD ? ---Mike From owner-freebsd-usb@FreeBSD.ORG Sat Feb 7 12:01:30 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 940D11065673 for ; Sat, 7 Feb 2009 12:01:30 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe03.swip.net [212.247.154.65]) by mx1.freebsd.org (Postfix) with ESMTP id 2AE718FC1E for ; Sat, 7 Feb 2009 12:01:29 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=ar-1rcyr13IA:10 a=6I5d2MoRAAAA:8 a=aUtpYyahD_PAP6mHxZAA:9 a=0L6m7RkhB7rizsn521kA:7 a=5zuL62ZlsPmfYckiZ8VY2nKHeOcA:4 a=LY0hPdMaydYA:10 Received: from [193.217.167.198] (account mc467741@c2i.net HELO [10.0.0.186]) by mailfe03.swip.net (CommuniGate Pro SMTP 5.2.6) with ESMTPA id 1196805159; Sat, 07 Feb 2009 13:01:28 +0100 From: Hans Petter Selasky To: Mike Tancsa Date: Sat, 7 Feb 2009 13:03:52 +0100 User-Agent: KMail/1.9.7 References: <200902062126.n16LQ0Gc013030@lava.sentex.ca> <200902071036.32995.hselasky@c2i.net> <200902071154.n17BsE2h016610@lava.sentex.ca> In-Reply-To: <200902071154.n17BsE2h016610@lava.sentex.ca> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902071303.53394.hselasky@c2i.net> Cc: freebsd-usb@freebsd.org Subject: Re: eToken and USB2 (ugen issue?) X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Feb 2009 12:01:31 -0000 On Saturday 07 February 2009, Mike Tancsa wrote: > At 04:36 AM 2/7/2009, Hans Petter Selasky wrote: > >Hi Mike, > > > >The ugen devices are invisible and dynamically created. > > > >Try open /dev/ugen0.2.0.0 (control endpoint) > > > >Also you need to re-link your application with > > "dev/usb2/include/usb2_ioctl.h" > > > >Format is /dev/ugen... > > > >I recommend using libusb20 to access your USB device. > > > >See "man libusb20". > > Hi, > Thanks for the response. These are all out of the ports > (openct,opensc). Are there any pointers somewhere on how to best > teach old apps about the new USB2 world on FreeBSD ? > Hi Mike, Most commonly the following advice helps: Add to /etc/libmap.conf: libusb-0.1.so libusb20.so libusb-0.1.so.8 libusb20.so.1 Also see: http://wiki.freebsd.org/USB --HPS From owner-freebsd-usb@FreeBSD.ORG Sat Feb 7 12:52:08 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 725EF1065731; Sat, 7 Feb 2009 12:52:08 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe12.tele2.se [212.247.155.97]) by mx1.freebsd.org (Postfix) with ESMTP id CC97F8FC12; Sat, 7 Feb 2009 12:52:07 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=ndaoGXS1AAAA:8 a=bwuu3fJdPR3okzItQjkA:9 a=NKC1R799LppyD3GPy2G48vDZ44gA:4 a=50e4U0PicR4A:10 Received: from [193.217.167.198] (account mc467741@c2i.net HELO [10.0.0.186]) by mailfe12.swip.net (CommuniGate Pro SMTP 5.2.6) with ESMTPA id 1019922931; Sat, 07 Feb 2009 13:52:06 +0100 From: Hans Petter Selasky To: freebsd-usb@freebsd.org, freebsd-current@freebsd.org Date: Sat, 7 Feb 2009 13:54:26 +0100 User-Agent: KMail/1.9.7 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902071354.28941.hselasky@c2i.net> Cc: Subject: USB2/USB4BSD - code reference available X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Feb 2009 12:52:10 -0000 Hi, I've taken the time to generate a doxygen code reference for the new USB stack. Result is available here: http://www.selasky.org/hans_petter/usb4bsd/ http://www.selasky.org/hans_petter/usb4bsd/html/index.html --HPS From owner-freebsd-usb@FreeBSD.ORG Sat Feb 7 14:02:42 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D697106564A for ; Sat, 7 Feb 2009 14:02:42 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (brucec-1-pt.tunnel.tserv4.nyc4.ipv6.he.net [IPv6:2001:470:1f06:c09::2]) by mx1.freebsd.org (Postfix) with ESMTP id D22398FC17 for ; Sat, 7 Feb 2009 14:02:41 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (localhost [127.0.0.1]) by muon.cran.org.uk (Postfix) with ESMTP id A972719014 for ; Sat, 7 Feb 2009 09:02:40 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on muon X-Spam-Level: X-Spam-Status: No, score=-2.5 required=8.0 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.2.5 Received: from gluon (unknown [IPv6:2a01:348:10f:0:240:f4ff:fe57:9871]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA for ; Sat, 7 Feb 2009 09:02:40 -0500 (EST) Date: Sat, 7 Feb 2009 14:02:28 +0000 From: Bruce Cran To: freebsd-usb@freebsd.org Message-ID: <20090207140228.7d549c53@gluon> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.14.4; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: usb_reset, libusb20_compat01 and USB2 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Feb 2009 14:02:42 -0000 I've been working to port dfu-util, OpenMoko's USB DFU application, to FreeBSD to work under USB2. One problem I've found is that the device starts out in Runtime Mode so dfu-util calls usb_reset to put it into DFU mode; it seems to expect usb_reset to cause the system to detach and reattach the device, but this doesn't happen. As a result usb_find_devices always returns 0 which triggers a warning; also, since usb_reset causes the device to disappear on Linux dfu-util doesn't call usb_close after resetting since the handle has become invalid. A side-effect of this is that on FreeBSD a duplicate device appears when doing a second enumeration pass. Since dfu-util only expects to see a single DFU-capable device it bails out, and it becomes necessary to run it again for it to download the firmware (since the phone is now already in DFU mode). Is this a problem with the expectations of dfu-util, or should calling usb_reset invalidate the device handle and cause the device to re-attach? -- Bruce Cran From owner-freebsd-usb@FreeBSD.ORG Sat Feb 7 14:17:59 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3155A106566B for ; Sat, 7 Feb 2009 14:17:59 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe13.tele2.se [212.247.155.129]) by mx1.freebsd.org (Postfix) with ESMTP id BC0DE8FC14 for ; Sat, 7 Feb 2009 14:17:58 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=iotDxErFoDcA:10 a=1QJIJ6t-U0AA:10 a=6I5d2MoRAAAA:8 a=i8fattbKvEfVOJR_sXAA:9 a=U_4jPhi60ODn0es_tZgA:7 a=OJ-qcQfw4gioMScq8qX5NyV1DDYA:4 a=LY0hPdMaydYA:10 Received: from [193.217.167.198] (account mc467741@c2i.net HELO [10.0.0.186]) by mailfe13.swip.net (CommuniGate Pro SMTP 5.2.6) with ESMTPA id 802750058; Sat, 07 Feb 2009 15:17:57 +0100 From: Hans Petter Selasky To: freebsd-usb@freebsd.org Date: Sat, 7 Feb 2009 15:20:24 +0100 User-Agent: KMail/1.9.7 References: <20090207140228.7d549c53@gluon> In-Reply-To: <20090207140228.7d549c53@gluon> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902071520.24660.hselasky@c2i.net> Cc: Subject: Re: usb_reset, libusb20_compat01 and USB2 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Feb 2009 14:17:59 -0000 On Saturday 07 February 2009, Bruce Cran wrote: > usb_close Hi, Try this patch to libusb20: http://perforce.freebsd.org/chv.cgi?CH=157335 Seems like there is different behaviour between libusb20 and libusb0.1.xx --HPS From owner-freebsd-usb@FreeBSD.ORG Sat Feb 7 14:39:56 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DFFF106566C for ; Sat, 7 Feb 2009 14:39:56 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (brucec-1-pt.tunnel.tserv4.nyc4.ipv6.he.net [IPv6:2001:470:1f06:c09::2]) by mx1.freebsd.org (Postfix) with ESMTP id 1C88A8FC0A for ; Sat, 7 Feb 2009 14:39:56 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (localhost [127.0.0.1]) by muon.cran.org.uk (Postfix) with ESMTP id 9788319014; Sat, 7 Feb 2009 09:39:54 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on muon X-Spam-Level: X-Spam-Status: No, score=-2.6 required=8.0 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.2.5 Received: from gluon (unknown [IPv6:2a01:348:10f:0:240:f4ff:fe57:9871]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA; Sat, 7 Feb 2009 09:39:54 -0500 (EST) Date: Sat, 7 Feb 2009 14:39:50 +0000 From: Bruce Cran To: Hans Petter Selasky Message-ID: <20090207143950.737c8171@gluon> In-Reply-To: <200902071520.24660.hselasky@c2i.net> References: <20090207140228.7d549c53@gluon> <200902071520.24660.hselasky@c2i.net> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.14.4; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-usb@freebsd.org Subject: Re: usb_reset, libusb20_compat01 and USB2 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Feb 2009 14:39:56 -0000 On Sat, 7 Feb 2009 15:20:24 +0100 Hans Petter Selasky wrote: > Try this patch to libusb20: > > http://perforce.freebsd.org/chv.cgi?CH=157335 > > Seems like there is different behaviour between libusb20 and > libusb0.1.xx That works - thanks! -- Bruce Cran From owner-freebsd-usb@FreeBSD.ORG Sat Feb 7 17:00:40 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BACDB106564A for ; Sat, 7 Feb 2009 17:00:40 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 7409B8FC0C for ; Sat, 7 Feb 2009 17:00:40 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n17GviXY082072; Sat, 7 Feb 2009 09:57:44 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sat, 07 Feb 2009 09:57:45 -0700 (MST) Message-Id: <20090207.095745.-1987210212.imp@bsdimp.com> To: hselasky@c2i.net From: "M. Warner Losh" In-Reply-To: <200902071303.53394.hselasky@c2i.net> References: <200902071036.32995.hselasky@c2i.net> <200902071154.n17BsE2h016610@lava.sentex.ca> <200902071303.53394.hselasky@c2i.net> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-usb@freebsd.org Subject: Re: eToken and USB2 (ugen issue?) X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Feb 2009 17:00:41 -0000 In message: <200902071303.53394.hselasky@c2i.net> Hans Petter Selasky writes: : On Saturday 07 February 2009, Mike Tancsa wrote: : > At 04:36 AM 2/7/2009, Hans Petter Selasky wrote: : > >Hi Mike, : > > : > >The ugen devices are invisible and dynamically created. : > > : > >Try open /dev/ugen0.2.0.0 (control endpoint) : > > : > >Also you need to re-link your application with : > > "dev/usb2/include/usb2_ioctl.h" : > > : > >Format is /dev/ugen... : > > : > >I recommend using libusb20 to access your USB device. : > > : > >See "man libusb20". : > : > Hi, : > Thanks for the response. These are all out of the ports : > (openct,opensc). Are there any pointers somewhere on how to best : > teach old apps about the new USB2 world on FreeBSD ? : > : : Hi Mike, : : Most commonly the following advice helps: : : Add to /etc/libmap.conf: : libusb-0.1.so libusb20.so : libusb-0.1.so.8 libusb20.so.1 : : Also see: : http://wiki.freebsd.org/USB What about for apps that don't use libusb? Warner From owner-freebsd-usb@FreeBSD.ORG Sat Feb 7 17:06:24 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95A70106564A for ; Sat, 7 Feb 2009 17:06:24 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe02.swip.net [212.247.154.33]) by mx1.freebsd.org (Postfix) with ESMTP id 2B02E8FC08 for ; Sat, 7 Feb 2009 17:06:23 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=ar-1rcyr13IA:10 a=6I5d2MoRAAAA:8 a=GwWb7bmAaJpPI8aI5SsA:9 a=Z9ECX2SFs-KmiREKuFQA:7 a=gNHzAWi7R1dYza3WDRfmKHxndFQA:4 a=9aOQ2cSd83gA:10 a=LY0hPdMaydYA:10 Received: from [193.217.167.198] (account mc467741@c2i.net HELO [10.0.0.186]) by mailfe02.swip.net (CommuniGate Pro SMTP 5.2.6) with ESMTPA id 1195647775; Sat, 07 Feb 2009 18:06:22 +0100 From: Hans Petter Selasky To: "M. Warner Losh" Date: Sat, 7 Feb 2009 18:08:47 +0100 User-Agent: KMail/1.9.7 References: <200902071036.32995.hselasky@c2i.net> <200902071303.53394.hselasky@c2i.net> <20090207.095745.-1987210212.imp@bsdimp.com> In-Reply-To: <20090207.095745.-1987210212.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902071808.48709.hselasky@c2i.net> Cc: freebsd-usb@freebsd.org Subject: Re: eToken and USB2 (ugen issue?) X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Feb 2009 17:06:25 -0000 On Saturday 07 February 2009, M. Warner Losh wrote: > In message: <200902071303.53394.hselasky@c2i.net> > > Hans Petter Selasky writes: > : On Saturday 07 February 2009, Mike Tancsa wrote: > : > At 04:36 AM 2/7/2009, Hans Petter Selasky wrote: > : > >Hi Mike, > : > > > : > >The ugen devices are invisible and dynamically created. > : > > > : > >Try open /dev/ugen0.2.0.0 (control endpoint) > : > > > : > >Also you need to re-link your application with > : > > "dev/usb2/include/usb2_ioctl.h" > : > > > : > >Format is /dev/ugen... > : > > > : > >I recommend using libusb20 to access your USB device. > : > > > : > >See "man libusb20". > : > > : > Hi, > : > Thanks for the response. These are all out of the ports > : > (openct,opensc). Are there any pointers somewhere on how to best > : > teach old apps about the new USB2 world on FreeBSD ? > : > : Hi Mike, > : > : Most commonly the following advice helps: > : > : Add to /etc/libmap.conf: > : libusb-0.1.so libusb20.so > : libusb-0.1.so.8 libusb20.so.1 > : > : Also see: > : http://wiki.freebsd.org/USB > > What about for apps that don't use libusb? > Hi Warner, Applications that use /dev/ugen, needs to be recompiled at least and modified to open /dev/ugenX.Y.A.B instead of /dev/ugenY.B . I recommend people using the libusb or libusb20 API. Using a library makes porting much easier! --HPS From owner-freebsd-usb@FreeBSD.ORG Sat Feb 7 18:40:17 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1EA3710656F7 for ; Sat, 7 Feb 2009 18:40:17 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id CB9898FC18 for ; Sat, 7 Feb 2009 18:40:16 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n17IcnRe083010; Sat, 7 Feb 2009 11:38:49 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sat, 07 Feb 2009 11:38:50 -0700 (MST) Message-Id: <20090207.113850.454687644.imp@bsdimp.com> To: hselasky@c2i.net From: "M. Warner Losh" In-Reply-To: <200902071808.48709.hselasky@c2i.net> References: <200902071303.53394.hselasky@c2i.net> <20090207.095745.-1987210212.imp@bsdimp.com> <200902071808.48709.hselasky@c2i.net> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-usb@freebsd.org Subject: Re: eToken and USB2 (ugen issue?) X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Feb 2009 18:40:18 -0000 In message: <200902071808.48709.hselasky@c2i.net> Hans Petter Selasky writes: : On Saturday 07 February 2009, M. Warner Losh wrote: : > In message: <200902071303.53394.hselasky@c2i.net> : > : > Hans Petter Selasky writes: : > : On Saturday 07 February 2009, Mike Tancsa wrote: : > : > At 04:36 AM 2/7/2009, Hans Petter Selasky wrote: : > : > >Hi Mike, : > : > > : > : > >The ugen devices are invisible and dynamically created. : > : > > : > : > >Try open /dev/ugen0.2.0.0 (control endpoint) : > : > > : > : > >Also you need to re-link your application with : > : > > "dev/usb2/include/usb2_ioctl.h" : > : > > : > : > >Format is /dev/ugen... : > : > > : > : > >I recommend using libusb20 to access your USB device. : > : > > : > : > >See "man libusb20". : > : > : > : > Hi, : > : > Thanks for the response. These are all out of the ports : > : > (openct,opensc). Are there any pointers somewhere on how to best : > : > teach old apps about the new USB2 world on FreeBSD ? : > : : > : Hi Mike, : > : : > : Most commonly the following advice helps: : > : : > : Add to /etc/libmap.conf: : > : libusb-0.1.so libusb20.so : > : libusb-0.1.so.8 libusb20.so.1 : > : : > : Also see: : > : http://wiki.freebsd.org/USB : > : > What about for apps that don't use libusb? : > : : Hi Warner, : : Applications that use /dev/ugen, needs to be recompiled at least and modified : to open /dev/ugenX.Y.A.B instead of /dev/ugenY.B . Any reason not to provide the old name as an alias to the new? : I recommend people using the libusb or libusb20 API. Using a library makes : porting much easier! That's true. And very cool that it helps enable more technology... Warner From owner-freebsd-usb@FreeBSD.ORG Sat Feb 7 19:42:29 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96BAF1065679 for ; Sat, 7 Feb 2009 19:42:29 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe14.swipnet.se [212.247.155.161]) by mx1.freebsd.org (Postfix) with ESMTP id 2C8D98FC19 for ; Sat, 7 Feb 2009 19:42:28 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=ar-1rcyr13IA:10 a=IuMy2udGao7JwHTUT9UA:9 a=MK9Omb-VYbpxf_r1nV9anEi1GHwA:4 a=LY0hPdMaydYA:10 Received: from [193.217.167.198] (account mc467741@c2i.net HELO [10.0.0.186]) by mailfe14.swip.net (CommuniGate Pro SMTP 5.2.6) with ESMTPA id 449867920; Sat, 07 Feb 2009 20:42:27 +0100 From: Hans Petter Selasky To: "M. Warner Losh" Date: Sat, 7 Feb 2009 20:44:52 +0100 User-Agent: KMail/1.9.7 References: <200902071303.53394.hselasky@c2i.net> <200902071808.48709.hselasky@c2i.net> <20090207.113850.454687644.imp@bsdimp.com> In-Reply-To: <20090207.113850.454687644.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902072044.53830.hselasky@c2i.net> Cc: freebsd-usb@freebsd.org Subject: Re: eToken and USB2 (ugen issue?) X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Feb 2009 19:42:30 -0000 On Saturday 07 February 2009, M. Warner Losh wrote: Hi, > : > : Applications that use /dev/ugen, needs to be recompiled at least and > : modified to open /dev/ugenX.Y.A.B instead of /dev/ugenY.B . > > Any reason not to provide the old name as an alias to the new? Technically it will complicate the ugen kernel code. > > : I recommend people using the libusb or libusb20 API. Using a library > : makes porting much easier! > > That's true. And very cool that it helps enable more technology... --HPS From owner-freebsd-usb@FreeBSD.ORG Sat Feb 7 21:21:16 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E7A410656CE for ; Sat, 7 Feb 2009 21:21:16 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 3ECFB8FC16 for ; Sat, 7 Feb 2009 21:21:16 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n17LJMjm084389; Sat, 7 Feb 2009 14:19:23 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sat, 07 Feb 2009 14:19:24 -0700 (MST) Message-Id: <20090207.141924.1835128044.imp@bsdimp.com> To: hselasky@c2i.net From: "M. Warner Losh" In-Reply-To: <200902072044.53830.hselasky@c2i.net> References: <200902071808.48709.hselasky@c2i.net> <20090207.113850.454687644.imp@bsdimp.com> <200902072044.53830.hselasky@c2i.net> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-usb@freebsd.org Subject: Re: eToken and USB2 (ugen issue?) X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Feb 2009 21:21:18 -0000 In message: <200902072044.53830.hselasky@c2i.net> Hans Petter Selasky writes: : On Saturday 07 February 2009, M. Warner Losh wrote: : : Hi, : : > : : > : Applications that use /dev/ugen, needs to be recompiled at least and : > : modified to open /dev/ugenX.Y.A.B instead of /dev/ugenY.B . : > : > Any reason not to provide the old name as an alias to the new? : : Technically it will complicate the ugen kernel code. That's a very vague answer.. Warner