Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Feb 2003 20:43:24 +0200 (IST)
From:      Roman Shterenzon <roman@xpert.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   kern/48715: atacontrol detach panics system when ATAPICAM is used.
Message-ID:  <200302231843.h1NIhO5k007007@alchemy.oven.org>

next in thread | raw e-mail | index | archive | help

>Number:         48715
>Category:       kern
>Synopsis:       atacontrol detach panics system when ATAPICAM is used.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Feb 26 12:10:12 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Roman Shterenzon
>Release:        FreeBSD 4.7-STABLE i386
>Organization:
>Environment:
System: FreeBSD alchemy.oven.org 4.7-STABLE FreeBSD 4.7-STABLE #0: Fri Feb 14 20:22:34 IST 2003 root@alchemy.oven.org:/local/src/sys/compile/ALCHEMY i386


>Description:

When the kernel is configured with ATAPICAM (and without acd, I don't know if
it matters), then running atacontrol reinit [channel] will make the system
panic.

The primal reason for me trying to do that, is that cdda2wav sometimes
(usually the second time run) will hang the cd device, making it unaccessible.
The system has to be restarted, camcontrol reset or atacontrol reinit don't
help.

The cdda2wav hangs in cbwait.

The following was sent to me by Thomas Quinot to address the cdda2wav and cd
hang problem (however, it doesn't solve the problem):

Le 2002-12-25, Roman Shterenzon écrivait :

>  1001 15780 15044   0  -6  0  1528  872 cbwait DL+   p6    0:00.00 cdda2wav -x

Hum that looks awfully like a race condition between the CAM layer and
the ATAPI code. As a work-around you can try to reinitialize both
using 'atacontrol reinit'.

If you have no other SCSI devices, it would also be interesting if you
could try whether the enclosed patch works around this problem.

Thomas.

Index: cam_periph.c
===================================================================
RCS file: /home/ncvs/src/sys/cam/cam_periph.c,v
retrieving revision 1.24.2.2
diff -u -r1.24.2.2 cam_periph.c
--- cam_periph.c	22 Sep 2002 07:15:32 -0000	1.24.2.2
+++ cam_periph.c	29 Dec 2002 11:36:36 -0000
@@ -717,7 +717,7 @@
 {
 	int s;
 
-	s = splsoftcam();
+	s = splbio();
 	if ((ccb->ccb_h.pinfo.index != CAM_UNQUEUED_INDEX)
 	 || ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_INPROG))
 		tsleep(&ccb->ccb_h.cbfcnp, PRIBIO, "cbwait", 0);

-- 
    Thomas.Quinot@Cuivre.FR.EU.ORG

-------
I'll be glad to assist, i.e. build kernel with kernel debugger, etc.

>How-To-Repeat:
Build a kernel with ATAPICAM and without acd, run atacontrol reinit on the
ATAPI cdrom channel. It will produce a crash.

>Fix:

The panic should be a simple thing to solve, I guess.
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200302231843.h1NIhO5k007007>