From owner-freebsd-scsi@FreeBSD.ORG Thu Feb 23 22:10:47 2012 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D92421065672 for ; Thu, 23 Feb 2012 22:10:47 +0000 (UTC) (envelope-from chuck@tuffli.net) Received: from mail-tul01m020-f182.google.com (mail-tul01m020-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id A58E68FC17 for ; Thu, 23 Feb 2012 22:10:47 +0000 (UTC) Received: by obcwo16 with SMTP id wo16so2646014obc.13 for ; Thu, 23 Feb 2012 14:10:47 -0800 (PST) Received-SPF: pass (google.com: domain of chuck@tuffli.net designates 10.60.10.99 as permitted sender) client-ip=10.60.10.99; Authentication-Results: mr.google.com; spf=pass (google.com: domain of chuck@tuffli.net designates 10.60.10.99 as permitted sender) smtp.mail=chuck@tuffli.net Received: from mr.google.com ([10.60.10.99]) by 10.60.10.99 with SMTP id h3mr1425787oeb.63.1330035047078 (num_hops = 1); Thu, 23 Feb 2012 14:10:47 -0800 (PST) MIME-Version: 1.0 Received: by 10.60.10.99 with SMTP id h3mr1175661oeb.63.1330033450605; Thu, 23 Feb 2012 13:44:10 -0800 (PST) Received: by 10.60.67.226 with HTTP; Thu, 23 Feb 2012 13:44:10 -0800 (PST) Date: Thu, 23 Feb 2012 13:44:10 -0800 Message-ID: From: Chuck Tuffli To: freebsd-scsi Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQlvdmFD42EpWJVHTr3I4lcebL6u5cuzSMONtGnWHiDpxBLEhYiEYMu8x0xq386j/u2FAnmv Subject: CTL panic X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Feb 2012 22:10:48 -0000 I just tried using our targ(9) compatible driver with CTL today and get the below panic. Our driver didn't recognize the XPT_IMMEDIATE_NOTIFY and returned CAM_REQ_INVALID which ctlfedone doesn't handle explicitly. The following patch seems to avoid this problem for me, but there might be a better fix. index 1d547d5..704a08c 100644 --- a/sys/cam/ctl/scsi_ctl.c +++ b/sys/cam/ctl/scsi_ctl.c @@ -1456,6 +1456,11 @@ ctlfedone(struct cam_periph *periph, union ccb *done_ccb) */ send_ctl_io = 0; break; + case CAM_REQ_INVALID: + ctl_free_io(io); + ctlfe_free_ccb(periph, done_ccb); + return; + break; default: xpt_print(periph->path, "%s: " "unsupported CAM status 0x%x\n", console: Feb 23 11:32:36 elx0 kernel: ctlfeasync: calling ctl_frontend_register() for ocs0 Feb 23 11:32:36 elx0 kernel: ocs0: XPT_EN_LUN enable -1:-1 Feb 23 11:32:36 elx0 kernel: ocs0: unhandled func_code = 0x336 Feb 23 11:32:36 elx0 kernel: (ctl0:ocs0:0:-1:-1): ctlferegister: could not allocate immediate notify CCBs, status 0x6 Feb 23 11:32:36 elx0 kernel: ctlfedone: got XPT_IMMEDIATE_NOTIFY status 0x6 tag 0x66533f3 seq 0x1b56c0b9 Feb 23 11:32:36 elx0 kernel: (ctl0:nobus:X:X): ctlfedone: unsupported CAM status 0x6 Feb 23 11:32:36 elx0 kernel: Feb 23 11:32:36 elx0 kernel: Feb 23 11:32:36 elx0 kernel: Fatal trap 12: page fault while in kernel mode Feb 23 11:32:36 elx0 kernel: cpuid = 6; apic id = 06 Feb 23 11:32:36 elx0 kernel: fault virtual address = 0x58 Feb 23 11:32:36 elx0 kernel: fault code = supervisor read data, page not present Feb 23 11:32:36 elx0 kernel: instruction pointer = 0x20:0xffffffff802cc386 Feb 23 11:32:36 elx0 kernel: stack pointer = 0x28:0xffffff80002d5a40 Feb 23 11:32:36 elx0 kernel: frame pointer = 0x28:0xffffff80002d5a50 Feb 23 11:32:36 elx0 kernel: code segment = base 0x0, limit 0xfffff, type 0x1b Feb 23 11:32:36 elx0 kernel: = DPL 0, pres 1, long 1, def32 0, gran 1 Feb 23 11:32:36 elx0 kernel: processor eflags = interrupt enabled, resume, IOPL = 0 Feb 23 11:32:36 elx0 kernel: current process = 12 (swi2: cambio) Feb 23 11:32:36 elx0 kernel: trap number = 12 Feb 23 11:32:36 elx0 kernel: panic: page fault Feb 23 11:32:36 elx0 kernel: cpuid = 6 Feb 23 11:32:36 elx0 kernel: KDB: stack backtrace: Feb 23 11:32:36 elx0 kernel: #0 0xffffffff808afb8e at kdb_backtrace+0x5e Feb 23 11:32:36 elx0 kernel: #1 0xffffffff80878617 at panic+0x187 Feb 23 11:32:36 elx0 kernel: #2 0xffffffff80b6b850 at trap_fatal+0x290 Feb 23 11:32:36 elx0 kernel: #3 0xffffffff80b6bbc6 at trap_pfault+0x226 Feb 23 11:32:36 elx0 kernel: #4 0xffffffff80b6c08f at trap+0x39f Feb 23 11:32:36 elx0 kernel: #5 0xffffffff80b56293 at calltrap+0x8 Feb 23 11:32:36 elx0 kernel: #6 0xffffffff80308b17 at ctlfedone+0x407 Feb 23 11:32:36 elx0 kernel: #7 0xffffffff802d1943 at camisr_runqueue+0x63 Feb 23 11:32:36 elx0 kernel: #8 0xffffffff802d1d61 at camisr+0x101 Feb 23 11:32:36 elx0 kernel: #9 0xffffffff8084d054 at intr_event_execute_handlers+0x104 Feb 23 11:32:36 elx0 kernel: #10 0xffffffff8084e814 at ithread_loop+0xa4 Feb 23 11:32:36 elx0 kernel: #11 0xffffffff80849c7f at fork_exit+0x11f Feb 23 11:32:36 elx0 kernel: #12 0xffffffff80b567be at fork_trampoline+0xe