From owner-freebsd-usb@FreeBSD.ORG Sun Apr 29 16:07:59 2007 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1A8A416A406 for ; Sun, 29 Apr 2007 16:07:59 +0000 (UTC) (envelope-from hselasky@freebsd.org) Received: from swip.net (mailfe08.swip.net [212.247.154.225]) by mx1.freebsd.org (Postfix) with ESMTP id 8596013C458 for ; Sun, 29 Apr 2007 16:07:58 +0000 (UTC) (envelope-from hselasky@freebsd.org) X-Cloudmark-Score: 0.000000 [] Received: from [193.71.38.142] (account mc467741@c2i.net HELO [10.42.11.147]) by mailfe08.swip.net (CommuniGate Pro SMTP 5.1.7) with ESMTPA id 475299985; Sun, 29 Apr 2007 17:07:26 +0200 From: Hans Petter Selasky To: "Valery V.Chikalov" Date: Sun, 29 Apr 2007 17:07:08 +0200 User-Agent: KMail/1.9.5 References: <200704272330.l3RNU94X078095@freefall.freebsd.org> <200704291550.10968.hselasky@c2i.net> <4634AA65.5060101@chikalov.dp.ua> In-Reply-To: <4634AA65.5060101@chikalov.dp.ua> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200704291707.08749.hselasky@freebsd.org> Cc: freebsd-usb@freebsd.org Subject: Re: usb/107642: [patch]Ralink Technology RT2501USB/RT2601USB chipset driver 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, 29 Apr 2007 16:07:59 -0000 On Sunday 29 April 2007 16:23, Valery V.Chikalov wrote: > Hans Petter Selasky wrote: > > On Sunday 29 April 2007 15:02, Valery V.Chikalov wrote: > >> Kevin Lo wrote: > >>> Valery V.Chikalov wrote: > >>>> The following reply was made to PR usb/107642; it has been noted by > >>>> GNATS. > >>>> > >>>> From: "Valery V.Chikalov" > >>>> To: bug-followup@FreeBSD.org, valera@chikalov.dp.ua > >>>> Cc: > >>>> Subject: Re: usb/107642: [patch]Ralink Technology RT2501USB/RT2601USB > >>>> chipset driver > >>>> Date: Sun, 22 Apr 2007 11:32:18 +0300 > >>>> > >>>> This is a multi-part message in MIME format. > >>>> --------------030900090303000507070905 > >>>> Content-Type: text/plain; charset=UTF-8 > >>>> Content-Transfer-Encoding: 7bit > >>>> > >>>> -----BEGIN PGP SIGNED MESSAGE----- > >>>> Hash: SHA1 > >>>> > >>>> if_rum(4) for 7.0-CURRENT > >>>> > >>>> replaced amrr_* functions by "standard" ones already existed in > >>>> net80211/ieee80211_amrr.c > >>>> > >>>> -----BEGIN PGP SIGNATURE----- > >>>> Version: GnuPG v1.4.5 (MingW32) > >>>> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > >>>> > >>>> iD8DBQFGKx14760S3kDvEC4RAn8PAKCn990QJE0wZRKcwdxAZ61MY0JRgACeI2W5 > >>>> ZosSlh6pIqi7JdZ5Wi1BUYc= > >>>> =LvWZ > >>>> -----END PGP SIGNATURE----- > >>> > >>> Hi Valery, > >>> > >>> I guess you wasn't aware that I've already ported rum(4) to FreeBSD. > >>> The patch is available at: http://people.freebsd.org/~kevlo/patch-rum > >>> Maybe you can test my patch? Thanks. > >>> > >>> Kevin > >> > >> Hi, Kevin, > >> > >> Your driver not working for me. Fortunately, the errors that I see > >> exactly the same which i fight when I made my driver. > >> > >> $ uname -a > >> FreeBSD tiger.novakom.dp.ua 7.0-CURRENT FreeBSD 7.0-CURRENT #6: Sun Apr > >> 29 13:58:48 EEST 2007 > >> root@tiger.novakom.dp.ua:/usr/obj/usr/src/sys/TIGER64 amd64 > >> > >> $ sysctl kern.osreldate > >> kern.osreldate: 700037 > >> > >> cvsup'ed 29.04.2007 > >> > >> kernel with: > >> > >> makeoptions DEBUG=-g > >> > >> options KDB > >> > >> options DDB > >> > >> > >> > >> options INVARIANTS > >> > >> options INVARIANT_SUPPORT > >> > >> options WITNESS > >> > >> At first, when I make kldload if_rum, I get kernel panic. > >> But I cant get saved core, as ddb just hangs during "call doadump" > > > > I have a solution for all of this locking stuff! > > > >> So I add > >> > >> #define RUM_LOCK(sc) do { ((sc) = (sc)); mtx_lock(&Giant); } while > >> (0) > >> #define RUM_UNLOCK(sc) mtx_unlock(&Giant) > >> > >> in if_rumvar.h > >> > >> I spend a lot of time in attempts get rid of Giant ant always got only > >> panics. > > > > You _cannot_ do that with the old USB stack, because you must lock Giant > > before calling into the usbxxx functions. Then in the USB callback, Giant > > is locked, and then you cannot lock RUM_LOCK()! That means you will most > > likely end up with a deadlock pretty soon, if you see that. > > Thanks, for explanations. I suspected that thing are like that, and I > have tried make porting by analogue with other drivers which I can find > in dev/usb, but I was not can find the description of doing "right way" > locking before. > > >> After that I get hangs, > >> which i resolved by modifying rum_ioctl: > > > > I'm almost finished converting "if_rum.c()" to the new USB stack. > > > > In some hours I will update it with support for "if_rum". > > > > If you can test that and forget about the old USB stack, I will be very > > happy :-) > > I will do it with pleasure. I was almost ready to do it (converting to > new USB stack) by myself, but I was stopped by the fact that I cant make > it compiled under CURRENT. I have seen your mail that your are working > on this. Is new the USB stack ready for CURRENT now? I updated the code yesterday. It should compile on current now. --HPS