From owner-freebsd-hackers@FreeBSD.ORG Sat Aug 5 09:58:34 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B61B116A4DE for ; Sat, 5 Aug 2006 09:58:34 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe07.swip.net [212.247.154.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2002343D53 for ; Sat, 5 Aug 2006 09:58:33 +0000 (GMT) (envelope-from hselasky@c2i.net) X-T2-Posting-ID: gvlK0tOCzrqh9CPROFOFPw== X-Cloudmark-Score: 0.000000 [] Received: from [193.216.120.137] (HELO [10.0.0.249]) by mailfe07.swip.net (CommuniGate Pro SMTP 5.0.8) with ESMTP id 249508784; Sat, 05 Aug 2006 11:58:32 +0200 From: Hans Petter Selasky To: pyunyh@gmail.com Date: Sat, 5 Aug 2006 11:58:39 +0200 User-Agent: KMail/1.7 References: <200608021437.55500.hselasky@c2i.net> <200608031444.47566.hselasky@c2i.net> <20060804000939.GA53215@cdnetworks.co.kr> In-Reply-To: <20060804000939.GA53215@cdnetworks.co.kr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200608051158.39850.hselasky@c2i.net> Cc: freebsd-hackers@freebsd.org Subject: Re: miibus + USB = problem ? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Aug 2006 09:58:34 -0000 On Friday 04 August 2006 02:09, Pyun YongHyeon wrote: > On Thu, Aug 03, 2006 at 02:44:46PM +0200, Hans Petter Selasky wrote: > > On Thursday 03 August 2006 04:25, Pyun YongHyeon wrote: > > > On Wed, Aug 02, 2006 at 02:37:55PM +0200, Hans Petter Selasky wrote: > > I can't sure why you need to invoke kthread_exit(9) in aue_miibus_xxx. > If you want to kill the kernel thread in aue_miibus_xxx you can simply > send a termination message to kernel thread. Your kernel thread can > decide when it should terminate if it recevied a termination message. > Invoking mii_mediachg/mii_tick will end up with calling miibus_xxx to > to read/write PHY registers from MII layer. So I think you still need > to handle PHY read/write operations in aue_miibus_xxx. If the PHY > operation was failed due to removal of hardware it could simply return > fake value and send a message to terminate the kernel thread. Yes, I was thinking about the same. I changed the behaviour to return zero if the thread is gone, and delays are just short-circuited. That way the code will return to the main thread in a short time, hopefully, where I do a kthread_exit(0). --HPS