From owner-cvs-src@FreeBSD.ORG Fri Sep 19 07:40:44 2008 Return-Path: Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 284781065688; Fri, 19 Sep 2008 07:40:44 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 14EE18FC12; Fri, 19 Sep 2008 07:40:44 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id m8J7eh1L004613; Fri, 19 Sep 2008 07:40:43 GMT (envelope-from weongyo@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id m8J7ehPS004611; Fri, 19 Sep 2008 07:40:43 GMT (envelope-from weongyo@repoman.freebsd.org) Message-Id: <200809190740.m8J7ehPS004611@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to weongyo@repoman.freebsd.org using -f From: Weongyo Jeong Date: Fri, 19 Sep 2008 07:40:30 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/dev/usb if_zyd.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Sep 2008 07:40:44 -0000 weongyo 2008-09-19 07:40:30 UTC FreeBSD src repository Modified files: sys/dev/usb if_zyd.c Log: SVN rev 183176 on 2008-09-19 07:40:30Z by weongyo fix a another driver bug related with tsleep() during detaching that this also can be happened if we pull the USN stick out forcibly. Currently the ZyDAS driver uses tsleep() when it try to query a read command to the device and it'd make a timeout if the device doesn't response within about 1 sec. In a case of that the USB stick is gone by hand and the driver's scanning with changing the channel numbers, the thread which is sleeping until a command requested is responded can be waked up after all detaching routines finished that means the zyd softc already freed. Tring to touch the softc freed by the wakeup thread makes a panic. So make sure that all sleeping threads should be waken up before the detach is completed and any other new requests to the device should be prevented. Revision Changes Path 1.22 +18 -6 src/sys/dev/usb/if_zyd.c