From nobody@FreeBSD.org  Wed Jul 18 16:06:02 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id A125D106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 18 Jul 2012 16:06:02 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 8C3D88FC0A
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 18 Jul 2012 16:06:02 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q6IG62Z3050983
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 18 Jul 2012 16:06:02 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q6IG62hq050977;
	Wed, 18 Jul 2012 16:06:02 GMT
	(envelope-from nobody)
Message-Id: <201207181606.q6IG62hq050977@red.freebsd.org>
Date: Wed, 18 Jul 2012 16:06:02 GMT
From: Steven Hartland <steven.hartland@multiplay.co.uk>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Patch to make scsi_da use sysctl values where appropriate
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         169976
>Category:       kern
>Synopsis:       [cam] [patch] make scsi_da use sysctl values where appropriate
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    smh
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jul 18 16:10:03 UTC 2012
>Closed-Date:    Fri Jun 07 15:00:32 UTC 2013
>Last-Modified:  Fri Jun 07 15:00:32 UTC 2013
>Originator:     Steven Hartland
>Release:        8.3-RELEASE
>Organization:
Multiplay
>Environment:
FreeBSD build 8.3-RELEASE-p3 FreeBSD 8.3-RELEASE-p3 #3: Tue Jul  3 13:16:31 UTC 2012     root@build:/usr/obj/usr/src/sys/MULTIPLAY  amd64
>Description:
Changed scsi_da device requests to use the sysctl tunable value for retry_count and da_default_timeout where their current hardcoded values matched the current default value for said tunables.
>How-To-Repeat:
N/A
>Fix:
Apply the attached patch

Patch attached with submission follows:

Changed scsi_da device requests to use the sysctl tunable value for retry_count
and da_default_timeout where their current hardcoded values matched the current
default value for said tunables.
--- sys/cam/scsi/scsi_da.c.orig2	2012-07-18 15:58:29.821055604 +0000
+++ sys/cam/scsi/scsi_da.c	2012-07-18 16:00:39.591128067 +0000
@@ -1955,7 +1955,7 @@
 		}
 		csio = &start_ccb->csio;
 		scsi_read_capacity(csio,
-				   /*retries*/4,
+				   /*retries*/da_retry_count,
 				   dadone,
 				   MSG_SIMPLE_Q_TAG,
 				   rcap,
@@ -1980,7 +1980,7 @@
 		}
 		csio = &start_ccb->csio;
 		scsi_read_capacity_16(csio,
-				      /*retries*/ 4,
+				      /*retries*/ da_retry_count,
 				      /*cbfcnp*/ dadone,
 				      /*tag_action*/ MSG_SIMPLE_Q_TAG,
 				      /*lba*/ 0,
@@ -1989,7 +1989,7 @@
 				      /*rcap_buf*/ (uint8_t *)rcaplong,
 				      /*rcap_buf_len*/ sizeof(*rcaplong),
 				      /*sense_len*/ SSD_FULL_SIZE,
-				      /*timeout*/ 60000);
+				      /*timeout*/ da_default_timeout * 1000);
 		start_ccb->ccb_h.ccb_bp = NULL;
 		start_ccb->ccb_h.ccb_state = DA_CCB_PROBE2;
 		xpt_action(start_ccb);	


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-scsi 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Wed Jul 18 17:08:01 UTC 2012 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=169976 
Responsible-Changed-From-To: freebsd-scsi->smh 
Responsible-Changed-By: smh 
Responsible-Changed-When: Thu Dec 13 22:22:12 UTC 2012 
Responsible-Changed-Why:  
I'll take it. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/169976: commit references a PR
Date: Thu, 10 Jan 2013 12:25:08 +0000 (UTC)

 Author: smh
 Date: Thu Jan 10 12:25:00 2013
 New Revision: 245253
 URL: http://svnweb.freebsd.org/changeset/base/245253
 
 Log:
   Changed scsi_da device requests to use the sysctl tunable value for retry_count
   and da_default_timeout where their current hardcoded values matched the current
   default value for said tunables.
   
   PR:		kern/169976
   Reviewed by:	pjd (mentor)
   Approved by:	mav
 
 Modified:
   head/sys/cam/scsi/scsi_da.c
 
 Modified: head/sys/cam/scsi/scsi_da.c
 ==============================================================================
 --- head/sys/cam/scsi/scsi_da.c	Thu Jan 10 11:57:46 2013	(r245252)
 +++ head/sys/cam/scsi/scsi_da.c	Thu Jan 10 12:25:00 2013	(r245253)
 @@ -2044,7 +2044,7 @@ out:
  			break;
  		}
  		scsi_read_capacity(&start_ccb->csio,
 -				   /*retries*/4,
 +				   /*retries*/da_retry_count,
  				   dadone,
  				   MSG_SIMPLE_Q_TAG,
  				   rcap,
 @@ -2067,7 +2067,7 @@ out:
  			break;
  		}
  		scsi_read_capacity_16(&start_ccb->csio,
 -				      /*retries*/ 4,
 +				      /*retries*/ da_retry_count,
  				      /*cbfcnp*/ dadone,
  				      /*tag_action*/ MSG_SIMPLE_Q_TAG,
  				      /*lba*/ 0,
 @@ -2076,7 +2076,7 @@ out:
  				      /*rcap_buf*/ (uint8_t *)rcaplong,
  				      /*rcap_buf_len*/ sizeof(*rcaplong),
  				      /*sense_len*/ SSD_FULL_SIZE,
 -				      /*timeout*/ 60000);
 +				      /*timeout*/ da_default_timeout * 1000);
  		start_ccb->ccb_h.ccb_bp = NULL;
  		start_ccb->ccb_h.ccb_state = DA_CCB_PROBE2;
  		xpt_action(start_ccb);	
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->patched 
State-Changed-By: smh 
State-Changed-When: Thu Jan 10 14:40:36 UTC 2013 
State-Changed-Why:  
Awaiting MFC 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/169976: commit references a PR
Date: Fri,  5 Apr 2013 11:50:17 +0000 (UTC)

 Author: mav
 Date: Fri Apr  5 11:50:05 2013
 New Revision: 249156
 URL: http://svnweb.freebsd.org/changeset/base/249156
 
 Log:
   MFC r245253 (by smh):
   Changed scsi_da device requests to use the sysctl tunable value for retry_count
   and da_default_timeout where their current hardcoded values matched the current
   default value for said tunables.
   
   PR:             kern/169976
 
 Modified:
   stable/9/sys/cam/scsi/scsi_da.c
 Directory Properties:
   stable/9/sys/   (props changed)
 
 Modified: stable/9/sys/cam/scsi/scsi_da.c
 ==============================================================================
 --- stable/9/sys/cam/scsi/scsi_da.c	Fri Apr  5 11:48:35 2013	(r249155)
 +++ stable/9/sys/cam/scsi/scsi_da.c	Fri Apr  5 11:50:05 2013	(r249156)
 @@ -2044,7 +2044,7 @@ out:
  			break;
  		}
  		scsi_read_capacity(&start_ccb->csio,
 -				   /*retries*/4,
 +				   /*retries*/da_retry_count,
  				   dadone,
  				   MSG_SIMPLE_Q_TAG,
  				   rcap,
 @@ -2067,7 +2067,7 @@ out:
  			break;
  		}
  		scsi_read_capacity_16(&start_ccb->csio,
 -				      /*retries*/ 4,
 +				      /*retries*/ da_retry_count,
  				      /*cbfcnp*/ dadone,
  				      /*tag_action*/ MSG_SIMPLE_Q_TAG,
  				      /*lba*/ 0,
 @@ -2075,7 +2075,7 @@ out:
  				      /*pmi*/ 0,
  				      rcaplong,
  				      /*sense_len*/ SSD_FULL_SIZE,
 -				      /*timeout*/ 60000);
 +				      /*timeout*/ da_default_timeout * 1000);
  		start_ccb->ccb_h.ccb_bp = NULL;
  		start_ccb->ccb_h.ccb_state = DA_CCB_PROBE2;
  		xpt_action(start_ccb);	
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: smh 
State-Changed-When: Fri Jun 7 15:00:31 UTC 2013 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=169976 
>Unformatted:
