Date: Mon, 20 Sep 2010 19:13:00 +0000 (UTC) From: Weongyo Jeong <weongyo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r212916 - user/weongyo/usb/sys/dev/usb Message-ID: <201009201913.o8KJD0EH063990@svn.freebsd.org>
index | next in thread | raw e-mail
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); } /*------------------------------------------------------------------------*help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201009201913.o8KJD0EH063990>
