Hi Doug,

I could **NOT** find your patch in either 2.2.14 nor 2.2.15-pre15 so I
backported it into 2.2.15-pre15 but it did **NOT** help. Surprisingly the
SCSI_IOCTL_TAGGED_ENABLE ioctl() also did not work, it appeared to me as a
no-op since it succeeded but did not do anything...

-> I did all that with 2.2.15-pre15.

However, here's the /proc/scsi/aic7xxx/0 output:

------ After boot
-[begin]---------------------------------------------------
Adaptec AIC7xxx driver version: 5.1.28/3.2.4
Compile Options:
  TCQ Enabled By Default : Enabled
  AIC7XXX_PROC_STATS     : Disabled
  AIC7XXX_RESET_DELAY    : 5

Adapter Configuration:
           SCSI Adapter: Adaptec AHA-294X SCSI host adapter
                           Narrow Controller at PCI 0/20/0
    PCI MMAPed I/O Base: 0xe2000000
 Adapter SEEPROM Config: SEEPROM found and used.
      Adaptec SCSI BIOS: Enabled
                    IRQ: 16
                   SCBs: Active 0, Max Active 8,
                         Allocated 30, HW 16, Page 255
             Interrupts: 3197
      BIOS Control Word: 0x18b6
   Adapter Control Word: 0x0058
   Extended Translation: Enabled
Disconnect Enable Flags: 0x00ff
 Tag Queue Enable Flags: 0x0003
Ordered Queue Tag Flags: 0x0003
Default Tag Queue Depth: 8
    Tagged Queue By Device array for aic7xxx host instance 0:
      {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
    Actual queue depth per device for aic7xxx host instance 0:
      {8,8,1,1,1,1,1,1,1,1,1,1,1,1,1,1}

Statistics:

(scsi0:0:0:0)
  Device using Narrow/Sync transfers at 10.0 MByte/sec, offset 15
  Transinfo settings: current(25/15/0/0), goal(25/15/0/0), user(25/15/0/0)
  Total transfers 2 (2 reads and 0 writes)


(scsi0:0:1:0)
  Device using Narrow/Sync transfers at 10.0 MByte/sec, offset 15
  Transinfo settings: current(25/15/0/0), goal(25/15/0/0), user(25/15/0/0)
  Total transfers 3106 (2775 reads and 331 writes)


(scsi0:0:2:0)
  Device using Narrow/Sync transfers at 10.0 MByte/sec, offset 15
  Transinfo settings: current(25/15/0/0), goal(25/15/0/0), user(25/15/0/0)
  Total transfers 0 (0 reads and 0 writes)


(scsi0:0:3:0)
  Device using Narrow/Sync transfers at 10.0 MByte/sec, offset 15
  Transinfo settings: current(25/15/0/0), goal(25/15/0/0), user(25/15/0/0)
  Total transfers 0 (0 reads and 0 writes)


(scsi0:0:5:0)
  Device using Narrow/Async transfers.
  Transinfo settings: current(0/0/0/0), goal(0/0/0/0), user(25/15/0/0)
  Total transfers 0 (0 reads and 0 writes)
------ After boot
--[end]---------------------------------------------------

------ After del-single-device
-[begin]-------------------------------------
Adaptec AIC7xxx driver version: 5.1.28/3.2.4
Compile Options:
  TCQ Enabled By Default : Enabled
  AIC7XXX_PROC_STATS     : Disabled
  AIC7XXX_RESET_DELAY    : 5

Adapter Configuration:
           SCSI Adapter: Adaptec AHA-294X SCSI host adapter
                           Narrow Controller at PCI 0/20/0
    PCI MMAPed I/O Base: 0xe2000000
 Adapter SEEPROM Config: SEEPROM found and used.
      Adaptec SCSI BIOS: Enabled
                    IRQ: 16
                   SCBs: Active 0, Max Active 8,
                         Allocated 30, HW 16, Page 255
             Interrupts: 3329
      BIOS Control Word: 0x18b6
   Adapter Control Word: 0x0058
   Extended Translation: Enabled
Disconnect Enable Flags: 0x00ff
 Tag Queue Enable Flags: 0x0003
Ordered Queue Tag Flags: 0x0003
Default Tag Queue Depth: 8
    Tagged Queue By Device array for aic7xxx host instance 0:
      {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
    Actual queue depth per device for aic7xxx host instance 0:
      {8,8,1,1,1,1,1,1,1,1,1,1,1,1,1,1}

Statistics:

(scsi0:0:0:0)
  Device using Narrow/Sync transfers at 10.0 MByte/sec, offset 15
  Transinfo settings: current(25/15/0/0), goal(25/15/0/0), user(25/15/0/0)
  Total transfers 2 (2 reads and 0 writes)


(scsi0:0:1:0)
  Device using Narrow/Sync transfers at 10.0 MByte/sec, offset 15
  Transinfo settings: current(25/15/0/0), goal(25/15/0/0), user(25/15/0/0)
  Total transfers 3238 (2831 reads and 407 writes)


(scsi0:0:2:0)
  Device using Narrow/Sync transfers at 10.0 MByte/sec, offset 15
  Transinfo settings: current(25/15/0/0), goal(25/15/0/0), user(25/15/0/0)
  Total transfers 0 (0 reads and 0 writes)


(scsi0:0:3:0)
  Device using Narrow/Sync transfers at 10.0 MByte/sec, offset 15
  Transinfo settings: current(25/15/0/0), goal(25/15/0/0), user(25/15/0/0)
  Total transfers 0 (0 reads and 0 writes)


(scsi0:0:5:0)
  Device using Narrow/Async transfers.
  Transinfo settings: current(0/0/0/0), goal(0/0/0/0), user(25/15/0/0)
  Total transfers 0 (0 reads and 0 writes)
------ After add-single-device
--[end]--------------------------------------


------ After add-single-device
-[begin]-------------------------------------
Adaptec AIC7xxx driver version: 5.1.28/3.2.4
Compile Options:
  TCQ Enabled By Default : Enabled
  AIC7XXX_PROC_STATS     : Disabled
  AIC7XXX_RESET_DELAY    : 5

Adapter Configuration:
           SCSI Adapter: Adaptec AHA-294X SCSI host adapter
                           Narrow Controller at PCI 0/20/0
    PCI MMAPed I/O Base: 0xe2000000
 Adapter SEEPROM Config: SEEPROM found and used.
      Adaptec SCSI BIOS: Enabled
                    IRQ: 16
                   SCBs: Active 0, Max Active 8,
                         Allocated 30, HW 16, Page 255
             Interrupts: 3358
      BIOS Control Word: 0x18b6
   Adapter Control Word: 0x0058
   Extended Translation: Enabled
Disconnect Enable Flags: 0x00ff
 Tag Queue Enable Flags: 0x0000
Ordered Queue Tag Flags: 0x0003
Default Tag Queue Depth: 8
    Tagged Queue By Device array for aic7xxx host instance 0:
      {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
    Actual queue depth per device for aic7xxx host instance 0:
      {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}

Statistics:

(scsi0:0:0:0)
  Device using Narrow/Sync transfers at 10.0 MByte/sec, offset 15
  Transinfo settings: current(25/15/0/0), goal(25/15/0/0), user(25/15/0/0)
  Total transfers 2 (2 reads and 0 writes)


(scsi0:0:1:0)
  Device using Narrow/Sync transfers at 10.0 MByte/sec, offset 15
  Transinfo settings: current(25/15/0/0), goal(25/15/0/0), user(25/15/0/0)
  Total transfers 3256 (2835 reads and 421 writes)


(scsi0:0:2:0)
  Device using Narrow/Sync transfers at 10.0 MByte/sec, offset 15
  Transinfo settings: current(25/15/0/0), goal(25/15/0/0), user(25/15/0/0)
  Total transfers 0 (0 reads and 0 writes)


(scsi0:0:3:0)
  Device using Narrow/Sync transfers at 10.0 MByte/sec, offset 15
  Transinfo settings: current(25/15/0/0), goal(25/15/0/0), user(25/15/0/0)
  Total transfers 0 (0 reads and 0 writes)


(scsi0:0:5:0)
  Device using Narrow/Async transfers.
  Transinfo settings: current(0/0/0/0), goal(0/0/0/0), user(25/15/0/0)
  Total transfers 0 (0 reads and 0 writes)

------ After add-single-device
--[end]--------------------------------------


I'm pretty sure that I'm losing TCQ depth on the disks (id 0 and 1) because
 the "Tag Queue Enable Flags: " are all zeroed after add-single device. The
 SCSI_IOCTL_TAGGED_ENABLE ioctl() also did **NOT** turn them back on.

Hopefully somebody with enough knowledge of the linux-scsi implementation
can find the reason for that.

Please let me know if you need more information or testing, my pleasure...

Thanks

- Michael






Douglas Gilbert <[EMAIL PROTECTED]> on 24.03.2000 17:03:03

To:   Michael Kwasigroch/INTERCOPE/DE
cc:   Eric Youngdale <[EMAIL PROTECTED]>, [EMAIL PROTECTED]

Subject:  [PATCH] add-single-device [was: inducing SCSI bus scan]


Received: from smtp.interlog.com ([207.34.202.37]) by NS.INTERCOPE.COM
(Lotus SMTP MTA Internal build v4.6.2  (651.2 6-10-1998)) with SMTP id
C12568AC.00581F52; Fri, 24 Mar 2000 17:02:32 +0100
Received: from interlog.com (dial10.torque.net [204.138.244.20])
     by smtp.interlog.com (8.9.3/8.9.1) with ESMTP id LAA21049;
     Fri, 24 Mar 2000 11:02:50 -0500 (EST)
Sender: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
Date: Fri, 24 Mar 2000 11:03:03 -0500
From: Douglas Gilbert <[EMAIL PROTECTED]>
X-Mailer: Mozilla 4.72 [en] (X11; U; Linux 2.3.99-pre3 i586)
X-Accept-Language: en
MIME-Version: 1.0
To: [EMAIL PROTECTED]
CC: Eric Youngdale <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
Subject: [PATCH] add-single-device [was: inducing SCSI bus scan]
References: <[EMAIL PROTECTED]>
Content-Type: multipart/mixed;
 boundary="------------7BC4C181577792A2FA456497"



[EMAIL PROTECTED] wrote:
>
> Hi Eric,
>
> thanks for your quick reply...
>
> You're right: I failed to mention that I use the Adaptec 2940 (aic7xxx)
> driver. Sorry! Probably he's resetting the TCQ queue depth...
>
> Is anybody using a different SCSI-driver (**NOT** aic7xxx) experiencing
> this, too? All machines I have access to have Adaptec (aic7xxx)
> controllers...
>
Michael,
There is a bug in scsi_build_commandblocks() that could be related.
During add-single-device it gets called _before_ the low level driver
has been asked to calculate the queue_depth of the device so it has its
initialization value of 0. In that situation scsi_build_commandblocks()
uses the "cpl" variable (commands per lun) which is often 1 and in one
case that bites me, 0 (advansys). A queue length of 0 is useless
(hangs on any attempt to use the device) and a queue length of 1
doesn't permit any tagged queuing.

Could you try the attached (it is against 2.3.99-pre3 and will
probably work against pre2 even though scsi.c was changed) and
report back if it cures your problem.

Looking at the aic7xxx source it sets cpl to 3. Perhaps you could
also try a little program to call the SCSI_IOCTL_TAGGED_ENABLE
ioctl() supplied by the midlevel. Something like:

    fd = open("/dev/sda", O_RDWR);
    ioctl(fd, SCSI_IOCTL_TAGGED_ENABLE, &any_int);
    close(fd);

and see if that helps.


Doug Gilbert


--- linux/drivers/scsi/scsi.c Fri Mar 24 09:20:43 2000
+++ linux/drivers/scsi/scsi.c_asd  Fri Mar 24 10:17:49 2000
@@ -1413,7 +1413,11 @@
     spin_lock_irqsave(&device_request_lock, flags);

     if (SDpnt->queue_depth == 0)
+    {
          SDpnt->queue_depth = host->cmd_per_lun;
+         if (SDpnt->queue_depth == 0)
+              SDpnt->queue_depth = 1; /* live to fight another day */
+    }
     SDpnt->device_queue = NULL;

     for (j = 0; j < SDpnt->queue_depth; j++) {
@@ -1804,8 +1808,9 @@
          /* FIXME (DB) This assumes that the queue_depth routines can be
used
             in this context as well, while they were all designed to be
             called only once after the detect routine. (DB) */
-         if (HBA_ptr->select_queue_depths != NULL)
-              (HBA_ptr->select_queue_depths) (HBA_ptr,
HBA_ptr->host_queue);
+
+         /* queue_depth routine moved to inside scan_scsis(,1,,,) so
+            it is called before build_commandblocks() */

          err = length;
          goto out;
--- linux/drivers/scsi/scsi_scan.c Fri Mar 24 10:32:30 2000
+++ linux/drivers/scsi/scsi_scan.c_asd   Fri Mar 24 10:10:23 2000
@@ -347,6 +347,12 @@
          if (SDpnt != oldSDpnt) {

               /* it could happen the blockdevice hasn't yet been inited */
+              /* queue_depth() moved from scsi_proc_info() so that
+                 it is called before scsi_build_commandblocks() */
+              if (shpnt->select_queue_depths != NULL)
+                  (shpnt->select_queue_depths)(shpnt,
+                                   shpnt->host_queue);
+
               for (sdtpnt = scsi_devicelist; sdtpnt; sdtpnt =
sdtpnt->next)
                    if (sdtpnt->init && sdtpnt->dev_noticed)
                         (*sdtpnt->init) ();






-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]

Reply via email to