From owner-freebsd-scsi@FreeBSD.ORG Thu Aug 28 21:59:55 2008 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 553331065676 for ; Thu, 28 Aug 2008 21:59:55 +0000 (UTC) (envelope-from pisymbol@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.224]) by mx1.freebsd.org (Postfix) with ESMTP id 16DF58FC1B for ; Thu, 28 Aug 2008 21:59:55 +0000 (UTC) (envelope-from pisymbol@gmail.com) Received: by rv-out-0506.google.com with SMTP id b25so753664rvf.43 for ; Thu, 28 Aug 2008 14:59:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=6TS132Z3agtzwZA29kiwXiLFtNUnndi9hL/bPBdllc0=; b=VRLeN2vbiE1v+xI3lbAs/LXYVwa+v4iBgk9QAVs3jpa3UhWwWO2MHZlrpTd7vZQGR/ ZG6HZO3dxeBFPWewbGALaUpefJ90pedOtk54JzwS8b/ofbcOFTMC5DXlJ+E7zxfAejYK +6uAn2MpN+9H4+GmwbJqFCGiiKZThUlkn/PKU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=gbUu+zZTy0T75k2KVRzX3PX43e/FIZXZBI/dfg0OSl4OyUEG8VF1gNivQrLp2iut/b ntTGA/y2Wm4GkRKULJPoDAENVgS68EKPiO/QUm5PD71bqL0kOULiGuXgi1fjAzaQZFWA 832xNY35tkf8gZgkL3JW3HyQNtmHOrFg1KCkk= Received: by 10.141.168.7 with SMTP id v7mr1068649rvo.95.1219960794649; Thu, 28 Aug 2008 14:59:54 -0700 (PDT) Received: by 10.140.127.19 with HTTP; Thu, 28 Aug 2008 14:59:54 -0700 (PDT) Message-ID: <3c0b01820808281459r4990ec4exdb2b4906b4b711f6@mail.gmail.com> Date: Thu, 28 Aug 2008 17:59:54 -0400 From: "Alexander Sack" To: Ross In-Reply-To: <3c0b01820808271333l34ead8ele99daab695baf667@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <13710393234.20080826164158@connection.ca> <48B46EE1.8060408@samsco.org> <3c0b01820808270743n5fd40995u6e9506b772f2b03c@mail.gmail.com> <86689256.20080827112751@connection.ca> <3c0b01820808271333l34ead8ele99daab695baf667@mail.gmail.com> Cc: freebsd-scsi@freebsd.org Subject: Re: Re[2]: isp(4) - kernel panic on initialization of driver 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, 28 Aug 2008 21:59:55 -0000 On Wed, Aug 27, 2008 at 4:33 PM, Alexander Sack wrote: > On Wed, Aug 27, 2008 at 11:27 AM, Ross wrote: >> Apologies if it didn't come across in my previous message, that's >> basically what I'm saying too. I have about a 50/50 chance of the >> card booting successfully, and when it does, the output from the debug >> lines is different, and it looks like the ASYNC event is executing >> before it's time. (See the end of this message for the full output >> from isp[01]: for a clean boot, since it's a long output.) > > Yea it looks like the loop down timer kthread gets started further > down isp_attach() which I believe maybe the issue. I got to look at > it some more. Ross, can you please try this patch? I don't have access to the external SAN right now so if this blows up, I'm apologize in advance. I'm not 100% sure about what is exactly going on without my hardware in front of me. However, it would seem that the LIP events that are enabled in isp_init() are coming in before the isp_ldt (loop down timer) and other things are initialized. I believe interrupts should be disabled until the intrhook gets called before root is mounted. That's what I *think* the author intended. Can you try the following small patch: --- isp_freebsd.c.0 2008-08-28 13:54:27.000000000 -0400 +++ isp_freebsd.c 2008-08-28 13:48:45.000000000 -0400 @@ -231,7 +231,6 @@ if (isp->isp_role != ISP_ROLE_NONE) { isp->isp_state = ISP_RUNSTATE; - ISP_ENABLE_INTS(isp); } if (isplist == NULL) { isplist = isp; I just don't see why ISP_ENABLE_INTS should be called since isp_intr_enable() has been established as the config_intrhook to be called before root mounts. One of the things I noticed is that the isp driver actually handles LIP events as they come in INSTEAD of first doing all the loop/fabric enumeration up front (during attach time which is what other OSes I believe do). This means when the card finally does come up and we are ready to go, it gets very noisy very fast until the fabric settles down. Hence all those portdb change messages during normal bootup! Give this a shot and let me know (either patch or edit the file, its one line, rebuild, reboot etc.). I tried it on my card with no devices attached so I know it works on my system! j/k Again, I'm stabbing in the dark a little but I'm curious if this prevents the panic. -aps