NetBSD Problem Report #47302
From www@NetBSD.org Mon Dec 10 02:33:52 2012
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
by www.NetBSD.org (Postfix) with ESMTP id 4F50763E4E4
for <gnats-bugs@gnats.NetBSD.org>; Mon, 10 Dec 2012 02:33:52 +0000 (UTC)
Message-Id: <20121210023351.50FD263E4E4@www.NetBSD.org>
Date: Mon, 10 Dec 2012 02:33:51 +0000 (UTC)
From: steven@pyro.eu.org
Reply-To: steven@pyro.eu.org
To: gnats-bugs@NetBSD.org
Subject: isp: bad handle on teardown
X-Send-Pr-Version: www-1.0
>Number: 47302
>Category: kern
>Synopsis: isp: bad handle on teardown
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: kern-bug-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Dec 10 02:35:00 +0000 2012
>Closed-Date: Mon Oct 07 22:35:55 +0000 2013
>Last-Modified: Mon Oct 07 22:35:55 +0000 2013
>Originator: Steven Chamberlain
>Release: NetBSD 6.0
>Organization:
>Environment:
NetBSD xenolith.pyro.eu.org 6.0 NetBSD 6.0 (XEN3_DOM0) amd64
>Description:
I cannot properly access FC-AL devices attached to a QLogic ISP2100 PCI-X card. Even `scsictl sd4 identify` only returns blank information, e.g.:
/dev/rsd4d: scsibus1 target 0 lun 0 <, , >
The errors below are logged in dmesg. Crucially, I notice that when I retry the SCSI IDENTIFY command, the value of 'handle' keeps incrementing, wraps around past 0xfffe2000, presumably back to 0x00002000 and then it succeeds exactly once, e.g.:
isp0: isp_handle_index: bad handle 0xfffa2000
/dev/rsd4d: scsibus1 target 0 lun 0 <, , >
sd4(isp0:0:0:0): bad handle on teardown
isp0: isp_handle_index: bad handle 0xfffc2000
/dev/rsd4d: scsibus1 target 0 lun 0 <, , >
sd4(isp0:0:0:0): bad handle on teardown
isp0: isp_handle_index: bad handle 0xfffe2000
/dev/rsd4d: scsibus1 target 0 lun 0 <, , >
sd4(isp0:0:0:0): bad handle on teardown
/dev/rsd4d: scsibus1 target 0 lun 0 <SEAGATE, STT34007 CLAR400, C003>
/dev/rsd4d: scsibus1 target 0 lun 0 <, , >
isp0: isp_handle_index: bad handle 0x22000
sd4(isp0:0:0:0): bad handle on teardown
isp0: isp_handle_index: bad handle 0x42000
/dev/rsd4d: scsibus1 target 0 lun 0 <, , >
sd4(isp0:0:0:0): bad handle on teardown
isp0: isp_handle_index: bad handle 0x62000
/dev/rsd4d: scsibus1 target 0 lun 0 <, , >
sd4(isp0:0:0:0): bad handle on teardown
>How-To-Repeat:
>Fix:
My guess would be that this card doesn't support 32-bit handles. When I can, I should either test the card on NetBSD 5.0, or rebuild the kernel of NetBSD 6.0 with the recent changes reverted, or even try instead with an ISP2312 I have.
>Release-Note:
>Audit-Trail:
From: Steven Chamberlain <steven@pyro.eu.org>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: kern/47302: isp: bad handle on teardown
Date: Mon, 25 Feb 2013 00:37:35 +0000
Hi,
I was able to re-test this with the new sequence numbers turned off,
leaving the high 16 bits all zero. With the same card as before:
006:01:0: QLogic ISP2100 (SCSI mass storage, revision 0x04)
This fixes the issue for me, and my attached FC-AL drives are detected
and working fine so far. Although I can't explain exactly what the
problem was, I just speculated that my card maybe only supports 16-bit
handles. Or it could be that the 32-bit handles are okay but the driver
was not verfying them properly.
diff -u -r1.7 isp_library.c
--- src/sys/dev/ic/isp_library.c 28 Feb 2011 17:17:55 -0000 1.7
+++ src/sys/dev/ic/isp_library.c 25 Feb 2013 00:28:48 -0000
@@ -258,7 +258,8 @@
hdp->cmd = xs;
hdp->handle = (hdp - isp->isp_xflist);
hdp->handle |= (ISP_HANDLE_INITIATOR << ISP_HANDLE_USAGE_SHIFT);
- hdp->handle |= (isp->isp_seqno++ << ISP_HANDLE_SEQ_SHIFT);
+ if (!IS_2100(isp))
+ hdp->handle |= (isp->isp_seqno++ << ISP_HANDLE_SEQ_SHIFT);
*handlep = hdp->handle;
return (0);
}
Thanks,
Regards,
--
Steven Chamberlain
steven@pyro.eu.org
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: mjacob@NetBSD.org, bouyer@NetBSD.org, jdc@NetBSD.org
Subject: Re: kern/47302: isp: bad handle on teardown
Date: Mon, 25 Feb 2013 10:44:59 +0100
This patch looks good, however, I'd like to know wether your card is unique
in this regard or there is a generic property we could query telling us
not to use the upper bits.
I've cc'd a few folks who might know...
Martin
From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/47302 CVS commit: src/sys/dev/ic
Date: Wed, 27 Feb 2013 09:29:22 +0000
Module Name: src
Committed By: martin
Date: Wed Feb 27 09:29:21 UTC 2013
Modified Files:
src/sys/dev/ic: isp.c
Log Message:
Disable ICBOPT_FAST_POST for ISP 2100.
Fixes PR kern/47302. From Matthew Jacob.
To generate a diff of this commit:
cvs rdiff -u -r1.122 -r1.123 src/sys/dev/ic/isp.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: "Jeff Rizzo" <riz@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/47302 CVS commit: [netbsd-6] src/sys/dev/ic
Date: Thu, 14 Mar 2013 21:52:12 +0000
Module Name: src
Committed By: riz
Date: Thu Mar 14 21:52:11 UTC 2013
Modified Files:
src/sys/dev/ic [netbsd-6]: isp.c
Log Message:
Pull up following revision(s) (requested by martin in ticket #838):
sys/dev/ic/isp.c: revision 1.123
Disable ICBOPT_FAST_POST for ISP 2100.
Fixes PR kern/47302. From Matthew Jacob.
To generate a diff of this commit:
cvs rdiff -u -r1.122 -r1.122.10.1 src/sys/dev/ic/isp.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: open->feedback
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Mon, 07 Oct 2013 06:55:56 +0000
State-Changed-Why:
Does this work now?
From: Steven Chamberlain <steven@pyro.eu.org>
To: gnats-bugs@NetBSD.org
Cc: dholland@NetBSD.org, kern-bug-people@netbsd.org,
netbsd-bugs@netbsd.org, gnats-admin@netbsd.org
Subject: Re: kern/47302 (isp: bad handle on teardown)
Date: Mon, 07 Oct 2013 10:42:56 +0100
On 07/10/13 07:55, dholland@NetBSD.org wrote:
> Does this work now?
Yes, thank you. I forgot to copy gnats with this:
On 26/02/13 00:58, Steven Chamberlain wrote:
> I've tried your patch and it is working, with 32-bit handles
> re-enabled. Thank you very much for this.
Regards,
--
Steven Chamberlain
steven@pyro.eu.org
State-Changed-From-To: feedback->closed
State-Changed-By: jnemeth@NetBSD.org
State-Changed-When: Mon, 07 Oct 2013 22:35:55 +0000
State-Changed-Why:
Submitter confirms fixed. Thanks for the PR!
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.