From nobody  Sat Jan 16 21:22:45 1999
Received: (from nobody@localhost)
          by hub.freebsd.org (8.8.8/8.8.8) id VAA05051;
          Sat, 16 Jan 1999 21:22:45 -0800 (PST)
          (envelope-from nobody)
Message-Id: <199901170522.VAA05051@hub.freebsd.org>
Date: Sat, 16 Jan 1999 21:22:45 -0800 (PST)
From: nakaji@zeisei.dpri.kyoto-u.ac.jp
To: freebsd-gnats-submit@freebsd.org
Subject: Don't use tagged queuing on SAMSUNG HDD
X-Send-Pr-Version: www-1.0

>Number:         9535
>Category:       kern
>Synopsis:       Don't use tagged queuing on SAMSUNG HDD
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    ken
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jan 16 21:30:01 PST 1999
>Closed-Date:    Tue Jan 19 09:00:16 PST 1999
>Last-Modified:  Tue Jan 19 18:20:01 PST 1999
>Originator:     NAKAJI Hiroyuki
>Release:        3.0-CURRENT
>Organization:
DPRI, Kyoto Univ.
>Environment:
FreeBSD nakaji.home.jp 3.0-CURRENT FreeBSD 3.0-CURRENT #0: Sun Jan 17 13:26:35 JST 1999     root@nakaji.home.jp:/export/src/sys/compile/NAKAJI  i386

>Description:
If tagged queueing is enabled(*), my <SAMSUNG WN34324U (gm030) 0105> hangs up
when many files are written on the disk.

(*) from dmesg
da0 at ncr0 bus 0 target 0 lun 0
da0: <SAMSUNG WN34324U (gm030) 0105> Fixed Direct Access SCSI-2 device 
da0: Serial Number         
da0: 20.0MB/s transfers (20.0MHz, offset 15), Tagged Queueing Enabled
da0: 4120MB (8438976 512 byte sectors: 8H 32S/T 32963C)

>How-To-Repeat:

>Fix:
A patch is in 
http://zeisei5.dpri.kyoto-u.ac.jp/~nakaji/install/FreeBSD/ref/cam_xpt.c.diff

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: ken 
State-Changed-When: Sun Jan 17 15:40:13 PST 1999 
State-Changed-Why:  
This certainly sounds like a bug.  Thank you for your report. 
I'll try to check in the patch in the next couple of days. 


Responsible-Changed-From-To: freebsd-bugs->ken 
Responsible-Changed-By: ken 
Responsible-Changed-When: Sun Jan 17 15:40:13 PST 1999 
Responsible-Changed-Why:  
To remind me to check in the patch. 

From: "Kenneth D. Merry" <ken@plutotech.com>
To: nakaji@zeisei.dpri.kyoto-u.ac.jp
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: kern/9535: Don't use tagged queuing on SAMSUNG HDD
Date: Mon, 18 Jan 1999 17:21:54 -0700 (MST)

 nakaji@zeisei.dpri.kyoto-u.ac.jp wrote...
 > 
 > >Number:         9535
 > >Category:       kern
 > >Synopsis:       Don't use tagged queuing on SAMSUNG HDD
 > >Confidential:   no
 > >Severity:       serious
 > >Priority:       medium
 > >Responsible:    freebsd-bugs
 > >State:          open
 > >Quarter:        
 > >Keywords:       
 > >Date-Required:
 > >Class:          change-request
 > >Submitter-Id:   current-users
 > >Arrival-Date:   Sat Jan 16 21:30:01 PST 1999
 > >Closed-Date:
 > >Last-Modified:
 > >Originator:     NAKAJI Hiroyuki
 > >Release:        3.0-CURRENT
 > >Organization:
 > DPRI, Kyoto Univ.
 > >Environment:
 > FreeBSD nakaji.home.jp 3.0-CURRENT FreeBSD 3.0-CURRENT #0: Sun Jan 17 13:26:35 JST 1999     root@nakaji.home.jp:/export/src/sys/compile/NAKAJI  i386
 > 
 > >Description:
 > If tagged queueing is enabled(*), my <SAMSUNG WN34324U (gm030) 0105> hangs up
 > when many files are written on the disk.
 > 
 > (*) from dmesg
 > da0 at ncr0 bus 0 target 0 lun 0
 > da0: <SAMSUNG WN34324U (gm030) 0105> Fixed Direct Access SCSI-2 device 
 > da0: Serial Number         
 > da0: 20.0MB/s transfers (20.0MHz, offset 15), Tagged Queueing Enabled
 > da0: 4120MB (8438976 512 byte sectors: 8H 32S/T 32963C)
 
 Just out of curiosity, did you try adjusting the maximum number of tags to
 see if you could avoid the hang?  Some drives will only hang if they run
 into a queue full condition.
 
 I'd like to find out whether the drive can be made to work with fewer tags
 before I disable tagged queueing for it altogether.
 
 A good number of tagged openings to try would be the number that gets
 printed out with the first "tagged openings reduced to.." message.
 
 
 Ken
 -- 
 Kenneth Merry
 ken@plutotech.com

From: =?iso-2022-jp?B?GyRCJEokKyQ4GyhC?= <nakaji@zeisei.dpri.kyoto-u.ac.jp>
To: ken@plutotech.com
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: kern/9535: Don't use tagged queuing on SAMSUNG HDD
Date: Tue, 19 Jan 1999 11:25:30 +0900

 >>>>> "Ken" == Kenneth D Merry <ken@plutotech.com> writes:
 
 Ken> Just out of curiosity, did you try adjusting the maximum number
 Ken> of tags to see if you could avoid the hang?  Some drives will
 Ken> only hang if they run into a queue full condition.
 
 No. I found the information about to avoid hangup from mailing list
 search at http://www.freebsd.org/ with keywords "tagged queu".
 
 Date:      Fri, 13 Nov 1998 23:10:48 -0500 (EST)
 From:      Simon Karpen <slk@acm.rpi.edu>
 To:        freebsd-questions@FreeBSD.ORG
 Subject:   How do I disable Tagged Command Queue on a particular device?
 Message-ID: <Pine.LNX.3.96.981113230609.297A-100000@grace.acm.rpi.edu>
 
 and the answer for this
 
 Date:      Mon, 16 Nov 1998 15:59:25 -0800 (PST)
 From:      Doug White <dwhite@resnet.uoregon.edu>
 To:        Simon Karpen <slk@acm.rpi.edu>
 Cc:        freebsd-questions@FreeBSD.ORG
 Subject:   Re: How do I disable Tagged Command Queue on a particular device?
 Message-ID:  <Pine.BSF.4.03.9811161555530.17775-100000@resnet.uoregon.edu>
 In-Reply-To: <Pine.LNX.3.96.981113230609.297A-100000@grace.acm.rpi.edu>
 
 Doug says,
 
 modify the SCSI system quirks table in the kernel source at
 /usr/src/sys/cam/cam_xpt.c and set the mintags and maxtags to 0.  
 
 I have just done it.
 
 Ken> I'd like to find out whether the drive can be made to work with
 Ken> fewer tags before I disable tagged queueing for it altogether.
 
 I think so too. Ok, I also will try to find the better parameters.
 
 Ken> A good number of tagged openings to try would be the number that
 Ken> gets printed out with the first "tagged openings reduced to.." 
 Ken> message.
 
 Another SAMSUNG disk is listed in the quirks in cam_xpt.c with
 the revision $Id: cam_xpt.c,v 1.35 1999/01/07 01:11:24 ken Exp $,
 
         {
                 /*
                  * Doesn't handle queue full condition correctly,
                  * so we need to limit maxtags to what the device
                  * can handle instead of determining this automatically.
                  */
                 { T_DIRECT, SIP_MEDIA_FIXED, "SAMSUNG", "WN321010S*", "*" },
                 /*quirks*/0, /*mintags*/2, /*maxtags*/32
         },
 
 These mintags and maxtags caused hangup.
 
 Thanks.
 ----====----====----====----
 NAKAJI Hiroyuki ($BCf<#(B $B909T(B)

From: "Kenneth D. Merry" <ken@plutotech.com>
To: nakaji@zeisei.dpri.kyoto-u.ac.jp (=?iso-2022-jp?B?GyRCJEokKyQ4GyhC?=)
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: kern/9535: Don't use tagged queuing on SAMSUNG HDD
Date: Mon, 18 Jan 1999 20:03:42 -0700 (MST)

 [$B$J$+$8(B] wrote...
 > >>>>> "Ken" == Kenneth D Merry <ken@plutotech.com> writes:
 > Ken> I'd like to find out whether the drive can be made to work with
 > Ken> fewer tags before I disable tagged queueing for it altogether.
 > 
 > I think so too. Ok, I also will try to find the better parameters.
 > 
 > Ken> A good number of tagged openings to try would be the number that
 > Ken> gets printed out with the first "tagged openings reduced to.." 
 > Ken> message.
 > 
 > Another SAMSUNG disk is listed in the quirks in cam_xpt.c with
 > the revision $Id: cam_xpt.c,v 1.35 1999/01/07 01:11:24 ken Exp $,
 > 
 >         {
 >                 /*
 >                  * Doesn't handle queue full condition correctly,
 >                  * so we need to limit maxtags to what the device
 >                  * can handle instead of determining this automatically.
 >                  */
 >                 { T_DIRECT, SIP_MEDIA_FIXED, "SAMSUNG", "WN321010S*", "*" },
 >                 /*quirks*/0, /*mintags*/2, /*maxtags*/32
 >         },
 > 
 > These mintags and maxtags caused hangup.
 
 Do you get any "tagged openings reduced.." messages at all?
 
 Ken
 -- 
 Kenneth Merry
 ken@plutotech.com

From: =?iso-2022-jp?B?GyRCJEokKyQ4GyhC?= <nakaji@zeisei.dpri.kyoto-u.ac.jp>
To: ken@plutotech.com
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: kern/9535: Don't use tagged queuing on SAMSUNG HDD
Date: Tue, 19 Jan 1999 15:30:56 +0900

 >>>>> "Ken" == Kenneth D Merry <ken@plutotech.com> writes:
 
 Ken> Do you get any "tagged openings reduced.." messages at all?
 
 No. In the case of my disk
 
 >                 { T_DIRECT, SIP_MEDIA_FIXED, "SAMSUNG", "WN321010S*", "*" },
 >                 /*quirks*/0, /*mintags*/2, /*maxtags*/32
 
 WN321010S* is to be WN34324U* as following
 
 { T_DIRECT, SIP_MEDIA_FIXED, "SAMSUNG", "WN34324U*", "*" },
 /*quirks*/0, /*mintags*/2, /*maxtags*/32
 
 Then about the case of mintags==2 and maxtags==32, I'm sorry I did not 
 check... I just checked, I was wrong, "WN34324U" case(*). (^^;
 ## Of cource, it was not the answer for me...
 
 	(*) I checked only two cases
 	{ T_DIRECT, SIP_MEDIA_FIXED, "SAMSUNG", "WN34324U", "*" },
 	/*quirks*/0, /*mintags*/2, /*maxtags*/32
 	and
 	{ T_DIRECT, SIP_MEDIA_FIXED, "SAMSUNG", "WN34324U*", "*" },
 	/*quirks*/0, /*mintags*/0, /*maxtags*/0
 	the former is NG and the latter is OK.
 
 I'll check the case tonight.
 { T_DIRECT, SIP_MEDIA_FIXED, "SAMSUNG", "WN34324U*", "*" },
 /*quirks*/0, /*mintags*/2, /*maxtags*/32
 
 I wish I will get the "tagged openings reduced.." messages and no
 hangup.
 
 Thanks.
 ----====----====----====----
 NAKAJI Hiroyuki ($BCf<#(B $B909T(B)

From: =?iso-2022-jp?B?GyRCJEokKyQ4GyhC?= <nakaji@zeisei.dpri.kyoto-u.ac.jp>
To: ken@plutotech.com
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: kern/9535: Don't use tagged queuing on SAMSUNG HDD
Date: Wed, 20 Jan 1999 00:54:24 +0900

 I don't know about these parameters, i.e. what maxtags is or so on.
 
 >>>>> "N" == I wrote:
 
 N> I'll check the case tonight.  
 N> { T_DIRECT, SIP_MEDIA_FIXED, "SAMSUNG", "WN34324U*", "*" }, 
 N> /*quirks*/0, /*mintags*/2, /*maxtags*/32
 
 I have just checked some cases.
 
 1. mintags==2 and maxtags==32
 2. mintags==2 and maxtags==32
 3. mintags==1 and maxtags==16
 4. mintags==0 and maxtags=0,16,32
 
 In the case of 1, 2 and 3 my disk is always set to be 'Tagged Queueing 
 Enabled' and the disk hangs up.
 
 Only in the case 4, i.e. mintags==0, there is no 'Tagged Queueing
 Enabled' message. It works fine.
 
 da0 at ncr0 bus 0 target 0 lun 0
 da0: <SAMSUNG WN34324U (gm030) 0105> Fixed Direct Access SCSI-2 device 
 da0: 20.0MB/s transfers (20.0MHz, offset 15)
 da0: 4120MB (8438976 512 byte sectors: 8H 32S/T 32963C)
 
 N> I wish I will get the "tagged openings reduced.." messages and no
 N> hangup.
 
 I can't see the message like this.
 
 ---
 NAKAJI Hiroyuki

From: "Kenneth D. Merry" <ken@plutotech.com>
To: nakaji@zeisei.dpri.kyoto-u.ac.jp (=?iso-2022-jp?B?GyRCJEokKyQ4GyhC?=)
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: kern/9535: Don't use tagged queuing on SAMSUNG HDD
Date: Tue, 19 Jan 1999 09:02:57 -0700 (MST)

 [$B$J$+$8(B] wrote...
 > I don't know about these parameters, i.e. what maxtags is or so on.
 > 
 > >>>>> "N" == I wrote:
 > 
 > N> I'll check the case tonight.  
 > N> { T_DIRECT, SIP_MEDIA_FIXED, "SAMSUNG", "WN34324U*", "*" }, 
 > N> /*quirks*/0, /*mintags*/2, /*maxtags*/32
 > 
 > I have just checked some cases.
 > 
 > 1. mintags==2 and maxtags==32
 > 2. mintags==2 and maxtags==32
 > 3. mintags==1 and maxtags==16
 > 4. mintags==0 and maxtags=0,16,32
 > 
 > In the case of 1, 2 and 3 my disk is always set to be 'Tagged Queueing 
 > Enabled' and the disk hangs up.
 > 
 > Only in the case 4, i.e. mintags==0, there is no 'Tagged Queueing
 > Enabled' message. It works fine.
 > 
 > da0 at ncr0 bus 0 target 0 lun 0
 > da0: <SAMSUNG WN34324U (gm030) 0105> Fixed Direct Access SCSI-2 device 
 > da0: 20.0MB/s transfers (20.0MHz, offset 15)
 > da0: 4120MB (8438976 512 byte sectors: 8H 32S/T 32963C)
 > 
 > N> I wish I will get the "tagged openings reduced.." messages and no
 > N> hangup.
 > 
 > I can't see the message like this.
 
 Okay, it looks like your drive is really broken.  Thank you for checking on
 it.
 
 I'll check in the patch to disable tagged queueing for it.
 
 Ken
 -- 
 Kenneth Merry
 ken@plutotech.com
State-Changed-From-To: analyzed->closed 
State-Changed-By: ken 
State-Changed-When: Tue Jan 19 09:00:16 PST 1999 
State-Changed-Why:  
The referenced patch was checked in in revision 1.39 of cam_xpt.c.  Thanks 
for submitting it. 

From: =?iso-2022-jp?B?GyRCJEokKyQ4GyhC?= <nakaji@zeisei.dpri.kyoto-u.ac.jp>
To: ken@plutotech.com
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: kern/9535: Don't use tagged queuing on SAMSUNG HDD
Date: Wed, 20 Jan 1999 11:16:32 +0900

 >>>>> "Ken" == Kenneth D Merry <ken@plutotech.com> writes:
 
 Ken> Okay, it looks like your drive is really broken.  Thank you for
 Ken> checking on it.
 
 Ken> I'll check in the patch to disable tagged queueing for it.
 
 Thank you. It is happy to be free from patching cam_xpt.c :-)
 
 ----====----====----====----
 NAKAJI Hiroyuki ($BCf<#(B $B909T(B)
>Unformatted:
