From itojun@tanmen.digipri.co.jp  Sat Aug  9 21:02:04 1997
Received: from tanmen.digipri.co.jp (tanmen.digipri.co.jp [210.128.213.73])
          by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id VAA00783
          for <FreeBSD-gnats-submit@freebsd.org>; Sat, 9 Aug 1997 21:02:02 -0700 (PDT)
Received: (from itojun@localhost)
	by tanmen.digipri.co.jp (8.8.5/8.8.5) id NAA02638;
	Sun, 10 Aug 1997 13:03:37 +0900 (JST)
Message-Id: <199708100403.NAA02638@tanmen.digipri.co.jp>
Date: Sun, 10 Aug 1997 13:03:37 +0900 (JST)
From: itojun@itojun.org
Reply-To: itojun@itojun.org
To: FreeBSD-gnats-submit@freebsd.org
Subject: scsi RESERVATION CONFLICT support needed (with proposed change to ahc driver)
X-Send-Pr-Version: 3.2

>Number:         4257
>Category:       kern
>Synopsis:       scsi RESERVATION CONFLICT support needed (with proposed change to ahc driver)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    itojun
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Aug  9 21:10:01 PDT 1997
>Closed-Date:    Sat Jan 9 07:10:32 PST 1999
>Last-Modified:  Sat Jan  9 07:10:59 PST 1999
>Originator:     Jun-ichiro Itoh
>Release:        FreeBSD 2.2.2-RELEASE i386
>Organization:
itojun.org
>Environment:

FreeBSD tanmen.digipri.co.jp 2.2.2-RELEASE FreeBSD 2.2.2-RELEASE #1: Sun Aug 10 12:08:59 JST 1997     itojun@tanmen.digipri.co.jp:/usr/src/sys/compile/TANMEN  i386

>Description:

	Some scsi device supports scsi RESERVE/RESERVE UNIT commands.
	In this case, scsi status byte may contain 0x18 (RESERVATION CONFLICT)
	which is currently unsupported by FreeBSD.
	In result, we'll see this kind of messages to be issued every time
	we see RESERVATION CONFLICT.
Aug  9 19:00:07 tanmen /kernel: uk0(ahc0:1:0): unexpected targ_status: 18
Aug  9 19:00:07 tanmen /kernel: uk0(ahc0:1:0): unexpected targ_status: 18
Aug  9 19:00:07 tanmen /kernel: uk0(ahc0:1:0): host adapter code inconsistency
	
>How-To-Repeat:

	connect device with RESERVE/RESERVE UNIT support.

>Fix:
	
	Here's a proposed change to ahc driver.  Other drivers should be
	updated accordingly.
	I'm novice to scsi controls, so could somebody please comment?

diff -cr sys.222R/i386/scsi/aic7xxx.c sys/i386/scsi/aic7xxx.c
*** sys.222R/i386/scsi/aic7xxx.c	Sat Apr 26 14:04:10 1997
--- sys/i386/scsi/aic7xxx.c	Sun Aug 10 12:08:15 1997
***************
*** 1359,1364 ****
--- 1359,1369 ----
  			sc_print_addr(xs->sc_link);
  			printf("Target Busy\n");
  			break;
+ 		case SCSI_RSVD:
+ 			xs->error = XS_BUSY;	/*XXX*/
+ 			sc_print_addr(xs->sc_link);
+ 			printf("Target Reserved\n");
+ 			break;
  		default:
  			sc_print_addr(xs->sc_link);
  			printf("unexpected targ_status: %x\n", hscb->status);
diff -cr sys.222R/scsi/scsi_all.h sys/scsi/scsi_all.h
*** sys.222R/scsi/scsi_all.h	Tue May 30 17:13:25 1995
--- sys/scsi/scsi_all.h	Sun Aug 10 12:08:40 1997
***************
*** 346,350 ****
--- 346,351 ----
  #define	SCSI_CHECK		0x02
  #define	SCSI_BUSY		0x08
  #define SCSI_INTERM		0x10
+ #define SCSI_RSVD		0x18
  #define SCSI_QUEUE_FULL		0x28
  #endif /*_SCSI_SCSI_ALL_H*/
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: itojun 
State-Changed-When: Sun Aug 17 07:11:20 PDT 1997 
State-Changed-Why:  

updated ahc drivers in -current tree. 
more investigation needed for other drivers. (could someone help? I don't have 
other scsi cards...) 
Responsible-Changed-From-To: freebsd-bugs->itojun 
Responsible-Changed-By: steve 
Responsible-Changed-When: Sun Aug 17 07:19:29 PDT 1997 
Responsible-Changed-Why:  
NOw that Jun-ichiro Itoh is a committer we'll let him 
handle his on PR. :) 

From: Jun-ichiro Itoh <itojun@itojun.org>
To: freebsd-gnats-submit@freebsd.org, itojun@itojun.org
Cc:  Subject: Re: kern/4257: scsi RESERVATION CONFLICT support needed (with proposed change to ahc driver)
Date: Fri, 13 Mar 1998 02:34:06 +0900

 current status on FreeBSD-current:
   "ncr/amd" okay
   "aha/ahc/aic/nca/sea/uha/wds" ????
State-Changed-From-To: analyzed->closed 
State-Changed-By: itojun 
State-Changed-When: Sat Jan 9 07:10:32 PST 1999 
State-Changed-Why:  
i have no environment to test this so I would like to close this once. 
I'll re-submit it if I see any problem with it again. 
>Unformatted:
