From owner-svn-src-user@FreeBSD.ORG Mon Sep 20 19:13:01 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E17BC106566B; Mon, 20 Sep 2010 19:13:00 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D153A8FC15; Mon, 20 Sep 2010 19:13:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8KJD0Iq063992; Mon, 20 Sep 2010 19:13:00 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8KJD0EH063990; Mon, 20 Sep 2010 19:13:00 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <201009201913.o8KJD0EH063990@svn.freebsd.org> From: Weongyo Jeong Date: Mon, 20 Sep 2010 19:13:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212916 - user/weongyo/usb/sys/dev/usb X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Sep 2010 19:13:01 -0000 Author: weongyo Date: Mon Sep 20 19:13:00 2010 New Revision: 212916 URL: http://svn.freebsd.org/changeset/base/212916 Log: Commits a experimental commit to remove a trick that this commit would cause a crash when the recursive holding is happend but I'd like to see where it comes from and solves it with better approach. Modified: user/weongyo/usb/sys/dev/usb/usb_busdma.c Modified: user/weongyo/usb/sys/dev/usb/usb_busdma.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/usb_busdma.c Mon Sep 20 18:58:44 2010 (r212915) +++ user/weongyo/usb/sys/dev/usb/usb_busdma.c Mon Sep 20 19:13:00 2010 (r212916) @@ -418,18 +418,10 @@ usb_pc_common_mem_cb(void *arg, bus_dma_ struct usb_page_cache *pc; struct usb_page *pg; usb_size_t rem; - uint8_t owned; pc = arg; uptag = pc->tag_parent; - /* - * XXX There is sometimes recursive locking here. - * XXX We should try to find a better solution. - * XXX Until further the "owned" variable does - * XXX the trick. - */ - if (error) { goto done; } @@ -457,18 +449,14 @@ usb_pc_common_mem_cb(void *arg, bus_dma_ } done: - owned = mtx_owned(uptag->mtx); - if (!owned) - mtx_lock(uptag->mtx); - + mtx_lock(uptag->mtx); uptag->dma_error = (error ? 1 : 0); if (isload) { (uptag->func) (uptag); } else { cv_broadcast(uptag->cv); } - if (!owned) - mtx_unlock(uptag->mtx); + mtx_unlock(uptag->mtx); } /*------------------------------------------------------------------------*