Bug 80246 - [patch] Wrong mtx_unlock in IPS morpheus-specific code causing panic
Summary: [patch] Wrong mtx_unlock in IPS morpheus-specific code causing panic
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 5.4-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-22 14:10 UTC by Dean Strik
Modified: 2005-06-06 17:16 UTC (History)
1 user (show)

See Also:


Attachments
ips-mtxunlock.patch (360 bytes, patch)
2005-04-22 14:10 UTC, Dean Strik
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dean Strik 2005-04-22 14:10:10 UTC
	(description is for 5.4-STABLE, applies to -current as well)

	In ips/ips.c, the Morpheus-specific function ips_morpheus_intr():
		mtx_lock(&sc->queue_mtx);
		ips_morpheus_check_intr(sc);
		mtx_unlock(&sc->queue_mtx);
	Yet ips_morpheus_check_intr() does the same mtx_unlock():
		if(!(oisr & MORPHEUS_BIT_CMD_IRQ)){
			DEVICE_PRINTF(2,sc->dev, "got a non-command irq\n");
			mtx_unlock(&sc->queue_mtx);
			return (0);
		}
	causing a panic.

Fix: The attached patch to src/sys/dev/ips/ips.c removes the mtx_unlock in
ips.c::ips_morpheus_check_intr(). However, looking at the diff between revision
1.15 and 1.16 of ips.c in ips_morpheus_intr(), other changes may be 
necesary..
How-To-Repeat: 	Inititialize the ips driver when using a Morpheus card.
Comment 1 Tilman Keskinoz freebsd_committer freebsd_triage 2005-06-06 17:15:45 UTC
State Changed
From-To: open->closed

Fixed by scottl on May 6, Thanks for reporting!