From nobody@FreeBSD.org  Thu Nov 11 20:15:10 2004
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id A027616A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 11 Nov 2004 20:15:10 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 705E043D46
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 11 Nov 2004 20:15:10 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.11/8.12.11) with ESMTP id iABKF91R085848
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 11 Nov 2004 20:15:09 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.11/8.12.11/Submit) id iABKF91r085847;
	Thu, 11 Nov 2004 20:15:09 GMT
	(envelope-from nobody)
Message-Id: <200411112015.iABKF91r085847@www.freebsd.org>
Date: Thu, 11 Nov 2004 20:15:09 GMT
From: Gt Andrs <andrej@antiszoc.hu>
To: freebsd-gnats-submit@FreeBSD.org
Subject: smartctl -a /dev/da0 (any scsi disk fails)
X-Send-Pr-Version: www-2.3

>Number:         73833
>Category:       ports
>Synopsis:       sysutils/smartmontools: smartctl -a /dev/da0 (any scsi disk fails)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Nov 11 20:20:31 GMT 2004
>Closed-Date:    Mon May 30 12:45:07 GMT 2005
>Last-Modified:  Mon May 30 12:45:07 GMT 2005
>Originator:     Gt Andrs
>Release:        5.3 RELEASE
>Organization:
>Environment:
FreeBSD linda.chello.hu 5.3-RELEASE FreeBSD 5.3-RELEASE #0: Fri Nov  5 04:19:18 UTC 2004     root@harlow.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386

>Description:
I installed smartmontools package (ver: 5.32), from ports. It compiled without any errors as is remember. When I try to get smart data from my disk, i get the following:

smartctl -a /dev/da1
smartctl version 5.32 Copyright (C) 2002-4 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

Device: WDIGTL   WD45 ULTRA2      Version: 1.00
(pass1:ahc0:0:1:0): MODE SENSE(06). CDB: 1a 0 1c 0 40 0
(pass1:ahc0:0:1:0): CAM Status: Command timeout
Serial number: WT7150055035
Device type: disk
(pass1:ahc0:0:1:0): MODE SENSE(06). CDB: 1a 0 19 0 40 0
(pass1:ahc0:0:1:0): CAM Status: SCSI Status Error
(pass1:ahc0:0:1:0): SCSI Status: Check Condition
(pass1:ahc0:0:1:0): UNIT ATTENTION csi:ff,ff,ff,ff asc:29,3
(pass1:ahc0:0:1:0): Bus device reset function occurred
Local Time is: Thu Nov 11 21:07:09 2004 CET
Device does not support SMART
(pass1:ahc0:0:1:0): LOG SENSE. CDB: 4d 0 40 0 0 0 0 0 c 0
(pass1:ahc0:0:1:0): CAM Status: Command timeout

Of course this worked before with the same disk, but not with the same scsi card. I used the integrated AHA-7880 UW, now the PCI AHA-2940U2W (7980). The card and disk is working perfectly. I tried both the LVD and SE channel, the result is the same.

I don't really whether it's a kernel driver problem or a sw bug in smartmontool or maybe both.

relevant dmesg:
<<<<<<<<<<<<<<<<< Dump Card State Ends >>>>>>>>>>>>>>>>>>
(pass1:ahc0:0:1:0): SCB 0xa - timed out
sg[0] - Addr 0x133338f5 : Length 64
(pass1:ahc0:0:1:0): Queuing a BDR SCB
(pass1:ahc0:0:1:0): Bus Device Reset Message Sent
ahc0: Timedout SCBs already complete. Interrupts may not be functioning.
(pass1:ahc0:0:1:0): no longer in timeout, status = 24b
ahc0: Bus Device Reset on A:1. 1 SCBs aborted
ahc0: Recovery Initiated
>How-To-Repeat:
      
>Fix:
    
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-ports-bugs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Thu Nov 11 22:33:15 GMT 2004 
Responsible-Changed-Why:  
Seems to be a ports problem. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=73833 

From: Pav Lucistnik <pav@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org, andrej@antiszoc.hu
Cc:  
Subject: Re: ports/73833: sysutils/smartmontools: smartctl -a /dev/da0 (any
	scsi disk fails)
Date: Fri, 12 Nov 2004 19:47:08 +0100

 This PR is really way over a scope of usual ports work. You should
 really take this up to the smartmontools authors. If you can get a
 working patch we'll be happy to add it to the port.
 
 -- 
 Pav Lucistnik <pav@oook.cz>
               <pav@FreeBSD.org>
 
 Geography is only physics slowed down, with a few trees stuck on it...
   -- Terry Pratchett

From: Andras Got <andrej@antiszoc.hu>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: ports/73833: sysutils/smartmontools: smartctl -a /dev/da0 (any
 scsi disk fails)
Date: Sat, 13 Nov 2004 13:07:21 +0100

 Hi
 
 I did some further investigations. I get 5.33 smarttols from sourceforge, but this compiled with 
 these errors. :)
 
 make output:
 
 make: don't know how to make smartd.conf.5. Stop
 *** Error code 1
 
 Stop in /root/smartmontools-5.33.
 *** Error code 1
 
 Stop in /root/smartmontools-5.33.
 
 After this I checked, whether the binaries were made, and they were. I tried the QUERY my drive, and 
 it worked. :)
 
 smartmontools-5.33#]./smartctl -a /dev/da0
 smartctl version 5.33 [i386-unknown-freebsd5.3] Copyright (C) 2002-4 Bruce Allen
 Home page is http://smartmontools.sourceforge.net/
 
 Device: SEAGATE  ST336607LW       Version: 6D03
 Serial number: 3JA9K0T0
 Device type: disk
 Transport protocol: Parallel SCSI (SPI-4)
 Local Time is: Sat Nov 13 13:02:08 2004 CET
 Device supports SMART and is Enabled
 Temperature Warning Disabled or Not Supported
 SMART Health Status: OK
 
 Current Drive Temperature:     29 C
 Drive Trip Temperature:        68 C
 
 and so on...
 
 So it looks like fixed.
State-Changed-From-To: open->feedback 
State-Changed-By: vs 
State-Changed-When: Mon Nov 15 09:14:19 GMT 2004 
State-Changed-Why:  
Waiting for feedback from originator or maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=73833 
State-Changed-From-To: feedback->closed 
State-Changed-By: barner 
State-Changed-When: Mon May 30 12:42:51 GMT 2005 
State-Changed-Why:  
Smartmontools 5.33 is in the tree now. Please try the version from the ports 
collection, and if you still have problems, please open a new PR (and Cc: the 
maintainer). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=73833 
>Unformatted:
 >>>>>>>>>>>>>>>>>> Dump Card State Begins <<<<<<<<<<<<<<<<<
 ahc0: Dumping Card State while idle, at SEQADDR 0x8
 Card was paused
 ACCUM = 0x4, SINDEX = 0x64, DINDEX = 0x65, ARG_2 = 0xe
 HCNT = 0x0 SCBPTR = 0xc
 SCSISIGI[0x0] ERROR[0x0] SCSIBUSL[0x0] LASTPHASE[0x1]:(P_BUSFREE)
 SCSISEQ[0x12]:(ENAUTOATNP|ENRSELI) SBLKCTL[0xa]:(SELWIDE|SELBUSB)
 SCSIRATE[0x0] SEQCTL[0x10]:(FASTMODE) SEQ_FLAGS[0xc0]:(NO_CDB_SENT|NOT_IDENTIFIED)
 SSTAT0[0x0] SSTAT1[0xa]:(PHASECHG|BUSFREE) SSTAT2[0x0]
 SSTAT3[0x0] SIMODE0[0x8]:(ENSWRAP) SIMODE1[0xa4]:(ENSCSIPERR|ENSCSIRST|ENSELTIMO)
 SXFRCTL0[0x80]:(DFON) DFCNTRL[0x0] DFSTATUS[0x89]:(FIFOEMP|HDONE|PRELOAD_AVAIL)
 STACK: 0xe5 0x167 0x17d 0x3
 SCB count = 130
 Kernel NEXTQSCB = 128
 Card NEXTQSCB = 128
 QINFIFO entries:
 Waiting Queue entries:
 Disconnected Queue entries: 12:58
 
 I hoped it helped, of course I can post any further information/data if needed.
 
