From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 18:59:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 23C1BCFF; Wed, 7 Nov 2012 18:59:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 06C0A8FC08; Wed, 7 Nov 2012 18:59:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA7Ixgvd085222; Wed, 7 Nov 2012 18:59:42 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA7IxgjE085220; Wed, 7 Nov 2012 18:59:42 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201211071859.qA7IxgjE085220@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 7 Nov 2012 18:59:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242703 - head/sys/dev/usb/serial X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 18:59:43 -0000 Author: hselasky Date: Wed Nov 7 18:59:42 2012 New Revision: 242703 URL: http://svnweb.freebsd.org/changeset/base/242703 Log: Add lock asserts instead of "auto-locking". MFC after: 1 weeks Suggested by: ed @ Modified: head/sys/dev/usb/serial/usb_serial.c Modified: head/sys/dev/usb/serial/usb_serial.c ============================================================================== --- head/sys/dev/usb/serial/usb_serial.c Wed Nov 7 18:44:05 2012 (r242702) +++ head/sys/dev/usb/serial/usb_serial.c Wed Nov 7 18:59:42 2012 (r242703) @@ -788,20 +788,16 @@ ucom_inwakeup(struct tty *tp) { struct ucom_softc *sc = tty_softc(tp); uint16_t pos; - int locked; if (sc == NULL) return; - locked = mtx_owned(sc->sc_mtx); + UCOM_MTX_ASSERT(sc, MA_OWNED); - if (locked == 0) - tty_lock(tp); + DPRINTF("tp=%p\n", tp); if (ttydisc_can_bypass(tp) != 0 || (sc->sc_flag & UCOM_FLAG_HL_READY) == 0) { - if (locked == 0) - tty_unlock(tp); return; } @@ -825,9 +821,6 @@ ucom_inwakeup(struct tty *tp) if ((sc->sc_jitterbuf_in == pos) && (sc->sc_flag & UCOM_FLAG_RTS_IFLOW)) ucom_rts(sc, 0); - - if (locked == 0) - tty_unlock(tp); } static int