Bug 8366 - aic79xx and aic7xxx driver issues
Summary: aic79xx and aic7xxx driver issues
Status: RESOLVED PATCH_ALREADY_AVAILABLE
Alias: None
Product: SCSI Drivers
Classification: Unclassified
Component: Other (show other bugs)
Hardware: i386 Linux
: P2 high
Assignee: scsi_drivers-other
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-23 14:40 UTC by James D Freels
Modified: 2007-07-30 07:57 UTC (History)
3 users (show)

See Also:
Kernel Version: 2.6.22.1 through 2.6.12.6 inclusive
Subsystem:
Regression: ---
Bisected commit-id:


Attachments
failed driver dmesg (30.66 KB, application/octet-stream)
2007-07-24 18:11 UTC, James D Freels
Details
dmesg output of failed driver (23.58 KB, application/octet-stream)
2007-07-24 18:12 UTC, James D Freels
Details

Description James D Freels 2007-04-23 14:40:41 UTC
Most recent kernel where this bug did *NOT* occur: 2.6.18.8
Distribution: Debian/Stable/4.0/Etch
Hardware Environment: dual-processor amd64, aic-7892 scsi adaptor
Software Environment: amanda-2.5.1p1-2.1, tar-1.16-2
Problem Description: scsi tape errors from kernel driver bug are then causing
the hard drives to switch to read only and basically render the system unusable
and cause a reboot to clear the problem

Steps to reproduce:
I have gone back throught the history of the aic7xxx driver used on this system
and have arrived at a "theory" that the problem is caused by the switch of the
SATA drivers out of the scsi interface and into the stand-alone driver section
of the kernel.  I don't think the addition of hte media changer support into the
scsi option has caused this problem (which is the only other major change that
has taken place).  Here is a synopsis of the history:

kernel    status
2.6.12.6  no problems, everything works using the "new" aic7xxx driver
2.6.13.5  added media changer support, enabled for the exabyte 1x10 autoloader
          still using "new" aic7xxx driver without a problem.
2.6.14.7  had to change to the "old" aic7xxx driver in order for the system to
          function
2.6.15.7  still had to use the "old" aic7xxx driver in order to function
2.6.16.30 was able to go back to the "new" aic7xxx driver and the system worked
          fine
2.6.17.14 continued to use the "new" aic7xxx driver without problems
2.6.18.8  continued to use the "new" aic7xxx driver without problems
2.6.19.7  had to go back to the "old" aic7xxx drivers in order to function, also
          the SATA hard disk drivers are now separated out from the scsi 
          interface in the kernel configuration
2.6.20.3  same as before, requires "old" aic7xxx driver to work
2.6.20.7  now cannot get either the "new" or "old" aic7xxx driver to work

I have now gone back to the 2.6.18.8 kernel and am successfully using the "new"
aic7xxx driver without error.  I will continue to do this until these bugs are
corrected.

Note: this bug is related to bug reports 8266, 7616, and 5268.  

I also have another dual-processor Intel Xeon 3Ghz machine that is using the
aic79xx driver on an aic-7902 adaptor.  Several hard drives are connected.  On
the separate scsi bus, a seagate DAT (dds-4) tape drive is connected.  I can no
longer get the tape driver to work on this system since 2.6.12.6 kernel.
Comment 1 James D Freels 2007-06-19 19:39:54 UTC
I have continued to use the 2.6.18.8 kernel all this time.  I have seen no progress or even an acknowledgement of this bug.  I was just wondering if there is
anything I can do to help correct this bug ?
Comment 2 James D Freels 2007-06-19 20:09:00 UTC
i snooped over to the Adaptec site and found this:

http://www.adaptec.com/en-US/speed/scsi/linux/aic7Yxx-2_0_26-6_3_11-linux-2_6_tgz.htm

I noticed the version number was v6.3.11 for the aic-7xxx driver and v2.0.26 for the aic-79xx driver and both released on 4/26/2007.  These versions/dates are far beyond the versions/dates shown for this driver in the 2.6.21.5 kernel (8/4/2005 for aic-7xxx and 12/11/2005 for aic-79xx v2.0.15 11 versions behind).

I tried, but was unable to build this set of drivers into the 2.6.21.5 vanilla kernel source, so was unable to determine if these changes could fix this problem.
Comment 3 James D Freels 2007-07-12 07:21:41 UTC
This bug continues with the 2.6.22.1 kernel.  See bug #8266 which indicates success with the 2.6.22.1 kernel and the OLD aic7xxx driver on this system.  Other drivers do NOT work.
Comment 4 Andrew Morton 2007-07-24 14:17:40 UTC
Could you please attach the full dmesg output, preferably from 2.6.21 and preferably after reprocucing the bug?

Thanks.
Comment 5 James D Freels 2007-07-24 18:11:02 UTC
Created attachment 12126 [details]
failed driver dmesg

This driver fails at time of boot up.  there are many scsi errors shown in the output.  It is the "new" aic7xxx driver.
Comment 6 James D Freels 2007-07-24 18:12:41 UTC
Created attachment 12127 [details]
dmesg output of failed driver

this is the output of the dmesg output after the boot up sequence.  This driver fails later on after the tape drive is used.  This is the "old" aic7xxx driver output.
Comment 7 Anonymous Emailer 2007-07-24 19:20:28 UTC
Reply-To: James.Bottomley@SteelEye.com

On Tue, 2007-07-24 at 18:05 -0700, bugme-daemon@bugzilla.kernel.org
wrote:
>  --> (http://bugzilla.kernel.org/attachment.cgi?id=12126&action=view)
> failed driver dmesg
> 
> This driver fails at time of boot up.  there are many scsi errors shown in
> the
> output.  It is the "new" aic7xxx driver.

This is about the most significant line

> (scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x84)
> SCSIRATE(0x80)

The SCSIRATE indicates wide.  I'd bet this is a narrow device; in which case, does 

echo 0 > /sys/class/spi_transport/target0:0:3/max_wide

and then triggering a revalidate with

echo 1 > /sys/class/spi_transport/target0:0:3/revalidate

produce anything different?

James
Comment 8 James D Freels 2007-07-26 08:02:32 UTC
James, I have been out for a couple of days and could not try this yet.

Presently, the system is booted up under 2.6.18.8 which is not the
troublesome kernel.

However, I tried your suggestion below, using max_width instead of
max_wide.  I get the following while sshed to the system remotely:

fea8:~# echo 0 > /sys/class/spi_transport/target0:0:3/max_width
fea8:~# echo 1 > /sys/class/spi_transport/target0:0:3/revalidate
fea8:~# cat /sys/class/spi_transport/target0:0:3/max_width
0
fea8:~# cat /sys/class/spi_transport/target0:0:3/revalidate
cat: /sys/class/spi_transport/target0:0:3/revalidate: Permission denied

So, instead, I shifted through the dmesg file to find this string:

scsi0 : Adaptec AIC7XXX EISA/VLB/PCI SCSI HBA DRIVER, Rev 7.0
        <Adaptec 29160N Ultra160 SCSI adapter>
        aic7892: Ultra160 Wide Channel A, SCSI Id=7, 32/253 SCBs

Further the output from 

cat /proc/scsi/aic7xxx/0 

gives

Adaptec AIC7xxx driver version: 7.0
Adaptec 29160N Ultra160 SCSI adapter
aic7892: Ultra160 Wide Channel A, SCSI Id=7, 32/253 SCBs
Allocated SCBs: 4, SG List Length: 128

Serial EEPROM:
0x439d 0x439d 0x439d 0x439d 0x439d 0x439d 0x439d 0x439d
0x00d0 0x00d0 0x00d0 0x00d0 0x00d0 0x00d0 0x00d0 0x00d0
0x08f4 0x6c5d 0x2807 0x0010 0x0300 0xffff 0xffff 0xffff
0xffff 0xffff 0xffff 0xffff 0xffff 0xffff 0x0250 0xc617

Target 0 Negotiation Settings
        User: 20.000MB/s transfers (20.000MHz DT, offset 127)
Target 1 Negotiation Settings
        User: 20.000MB/s transfers (20.000MHz DT, offset 127)
Target 2 Negotiation Settings
        User: 20.000MB/s transfers (20.000MHz DT, offset 127)
Target 3 Negotiation Settings
        User: 20.000MB/s transfers (20.000MHz DT, offset 127)
        Goal: 20.000MB/s transfers (20.000MHz, offset 32)
        Curr: 20.000MB/s transfers (20.000MHz, offset 32)
        Channel A Target 3 Lun 0 Settings
                Commands Queued 216
                Commands Active 0
                Command Openings 1
                Max Tagged Openings 0
                Device Queue Frozen Count 0
Target 4 Negotiation Settings
        User: 20.000MB/s transfers (20.000MHz DT, offset 127)
Target 5 Negotiation Settings
        User: 20.000MB/s transfers (20.000MHz DT, offset 127)
Target 6 Negotiation Settings
        User: 20.000MB/s transfers (20.000MHz DT, offset 127)
        Goal: 20.000MB/s transfers (20.000MHz, offset 32)
        Curr: 20.000MB/s transfers (20.000MHz, offset 32)
        Channel A Target 6 Lun 0 Settings
                Commands Queued 1342313
                Commands Active 0
                Command Openings 1
                Max Tagged Openings 0
                Device Queue Frozen Count 0
Target 7 Negotiation Settings
        User: 20.000MB/s transfers (20.000MHz DT, offset 127)
Target 8 Negotiation Settings
        User: 3.300MB/s transfers
Target 9 Negotiation Settings
        User: 3.300MB/s transfers
Target 10 Negotiation Settings
        User: 3.300MB/s transfers
Target 11 Negotiation Settings
        User: 3.300MB/s transfers
Target 12 Negotiation Settings
        User: 3.300MB/s transfers
Target 13 Negotiation Settings
        User: 3.300MB/s transfers
Target 14 Negotiation Settings
        User: 3.300MB/s transfers
Target 15 Negotiation Settings
        User: 3.300MB/s transfers

So, it looks like indeed, I have a narrow device.

Looking through
the /usr/src/linux-2.6.22.1/Documentation/scsi/aic7xxx.txt file for
dependence on aic7892 driver, I find:

  AHA-29160N     aic7892   PCI/32      LVD-HD68F       SE-HD50F
                                         SE-50M

So, it is using the driver, but seems to indicate a wide or narrow
capability.

Is there any way to force narrow bus ?  Perhaps the card is in a 64-bit
slot and needs to be in a 32-bit slot ? 



On Tue, 2007-07-24 at 22:14 -0400, James Bottomley wrote:

> On Tue, 2007-07-24 at 18:05 -0700, bugme-daemon@bugzilla.kernel.org
> wrote:
> >  --> (http://bugzilla.kernel.org/attachment.cgi?id=12126&action=view)
> > failed driver dmesg
> > 
> > This driver fails at time of boot up.  there are many scsi errors shown in
> the
> > output.  It is the "new" aic7xxx driver.
> 
> This is about the most significant line
> 
> > (scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x84)
> SCSIRATE(0x80)
> 
> The SCSIRATE indicates wide.  I'd bet this is a narrow device; in which case,
> does 
> 
> echo 0 > /sys/class/spi_transport/target0:0:3/max_wide
> 
> and then triggering a revalidate with
> 
> echo 1 > /sys/class/spi_transport/target0:0:3/revalidate
> 
> produce anything different?
> 
> James
> 
> 

James D. Freels, Ph.D.
Senior Research Staff, HFIR Cold Source, ORNL
http://sunsite.utk.edu/wuot/mt/podcast/051807HIFER.mp3
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.14.1">
</HEAD>
<BODY>
James, I have been out for a couple of days and could not try this yet.<BR>
<BR>
Presently, the system is booted up under 2.6.18.8 which is not the troublesome kernel.<BR>
<BR>
However, I tried your suggestion below, using max_width instead of max_wide.&nbsp; I get the following while sshed to the system remotely:<BR>
<BR>
fea8:~# echo 0 &gt; /sys/class/spi_transport/target0:0:3/max_width<BR>
fea8:~# echo 1 &gt; /sys/class/spi_transport/target0:0:3/revalidate<BR>
fea8:~# cat /sys/class/spi_transport/target0:0:3/max_width<BR>
0<BR>
fea8:~# cat /sys/class/spi_transport/target0:0:3/revalidate<BR>
cat: /sys/class/spi_transport/target0:0:3/revalidate: Permission denied<BR>
<BR>
So, instead, I shifted through the dmesg file to find this string:<BR>
<BR>
scsi0 : Adaptec AIC7XXX EISA/VLB/PCI SCSI HBA DRIVER, Rev 7.0<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Adaptec 29160N Ultra160 SCSI adapter&gt;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; aic7892: Ultra160 Wide Channel A, SCSI Id=7, 32/253 SCBs<BR>
<BR>
Further the output from <BR>
<BR>
cat /proc/scsi/aic7xxx/0 <BR>
<BR>
gives<BR>
<BR>
Adaptec AIC7xxx driver version: 7.0<BR>
Adaptec 29160N Ultra160 SCSI adapter<BR>
aic7892: Ultra160 Wide Channel A, SCSI Id=7, 32/253 SCBs<BR>
Allocated SCBs: 4, SG List Length: 128<BR>
<BR>
Serial EEPROM:<BR>
0x439d 0x439d 0x439d 0x439d 0x439d 0x439d 0x439d 0x439d<BR>
0x00d0 0x00d0 0x00d0 0x00d0 0x00d0 0x00d0 0x00d0 0x00d0<BR>
0x08f4 0x6c5d 0x2807 0x0010 0x0300 0xffff 0xffff 0xffff<BR>
0xffff 0xffff 0xffff 0xffff 0xffff 0xffff 0x0250 0xc617<BR>
<BR>
Target 0 Negotiation Settings<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; User: 20.000MB/s transfers (20.000MHz DT, offset 127)<BR>
Target 1 Negotiation Settings<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; User: 20.000MB/s transfers (20.000MHz DT, offset 127)<BR>
Target 2 Negotiation Settings<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; User: 20.000MB/s transfers (20.000MHz DT, offset 127)<BR>
Target 3 Negotiation Settings<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; User: 20.000MB/s transfers (20.000MHz DT, offset 127)<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Goal: 20.000MB/s transfers (20.000MHz, offset 32)<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Curr: 20.000MB/s transfers (20.000MHz, offset 32)<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Channel A Target 3 Lun 0 Settings<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Commands Queued 216<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Commands Active 0<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Command Openings 1<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Max Tagged Openings 0<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Device Queue Frozen Count 0<BR>
Target 4 Negotiation Settings<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; User: 20.000MB/s transfers (20.000MHz DT, offset 127)<BR>
Target 5 Negotiation Settings<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; User: 20.000MB/s transfers (20.000MHz DT, offset 127)<BR>
Target 6 Negotiation Settings<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; User: 20.000MB/s transfers (20.000MHz DT, offset 127)<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Goal: 20.000MB/s transfers (20.000MHz, offset 32)<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Curr: 20.000MB/s transfers (20.000MHz, offset 32)<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Channel A Target 6 Lun 0 Settings<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Commands Queued 1342313<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Commands Active 0<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Command Openings 1<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Max Tagged Openings 0<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Device Queue Frozen Count 0<BR>
Target 7 Negotiation Settings<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; User: 20.000MB/s transfers (20.000MHz DT, offset 127)<BR>
Target 8 Negotiation Settings<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; User: 3.300MB/s transfers<BR>
Target 9 Negotiation Settings<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; User: 3.300MB/s transfers<BR>
Target 10 Negotiation Settings<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; User: 3.300MB/s transfers<BR>
Target 11 Negotiation Settings<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; User: 3.300MB/s transfers<BR>
Target 12 Negotiation Settings<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; User: 3.300MB/s transfers<BR>
Target 13 Negotiation Settings<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; User: 3.300MB/s transfers<BR>
Target 14 Negotiation Settings<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; User: 3.300MB/s transfers<BR>
Target 15 Negotiation Settings<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; User: 3.300MB/s transfers<BR>
<BR>
So, it looks like indeed, I have a narrow device.<BR>
<BR>
Looking through the /usr/src/linux-2.6.22.1/Documentation/scsi/aic7xxx.txt file for dependence on aic7892 driver, I find:<BR>
<BR>
&nbsp; AHA-29160N&nbsp;&nbsp;&nbsp;&nbsp; aic7892&nbsp;&nbsp; PCI/32&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LVD-HD68F&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SE-HD50F<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SE-50M<BR>
<BR>
So, it is using the driver, but seems to indicate a wide or narrow capability.<BR>
<BR>
Is there any way to force narrow bus ?&nbsp; Perhaps the card is in a 64-bit slot and needs to be in a 32-bit slot ? <BR>
<BR>
<BR>
<BR>
On Tue, 2007-07-24 at 22:14 -0400, James Bottomley wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">On Tue, 2007-07-24 at 18:05 -0700, <A HREF="mailto:bugme-daemon@bugzilla.kernel.org">bugme-daemon@bugzilla.kernel.org</A></FONT>
<FONT COLOR="#000000">wrote:</FONT>
<FONT COLOR="#000000">&gt;  --&gt; (<A HREF="http://bugzilla.kernel.org/attachment.cgi?id=12126&action=view">http://bugzilla.kernel.org/attachment.cgi?id=12126&amp;action=view</A>)</FONT>
<FONT COLOR="#000000">&gt; failed driver dmesg</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; This driver fails at time of boot up.  there are many scsi errors shown in the</FONT>
<FONT COLOR="#000000">&gt; output.  It is the &quot;new&quot; aic7xxx driver.</FONT>

<FONT COLOR="#000000">This is about the most significant line</FONT>

<FONT COLOR="#000000">&gt; (scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x84) SCSIRATE(0x80)</FONT>

<FONT COLOR="#000000">The SCSIRATE indicates wide.  I'd bet this is a narrow device; in which case, does </FONT>

<FONT COLOR="#000000">echo 0 &gt; /sys/class/spi_transport/target0:0:3/max_wide</FONT>

<FONT COLOR="#000000">and then triggering a revalidate with</FONT>

<FONT COLOR="#000000">echo 1 &gt; /sys/class/spi_transport/target0:0:3/revalidate</FONT>

<FONT COLOR="#000000">produce anything different?</FONT>

<FONT COLOR="#000000">James</FONT>


</PRE>
</BLOCKQUOTE>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
James D. Freels, Ph.D.<BR>
Senior Research Staff, HFIR Cold Source, ORNL<BR>
<A HREF="http://sunsite.utk.edu/wuot/mt/podcast/051807HIFER.mp3">http://sunsite.utk.edu/wuot/mt/podcast/051807HIFER.mp3</A>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
Comment 9 Anonymous Emailer 2007-07-26 08:11:28 UTC
Reply-To: James.Bottomley@SteelEye.com

On Thu, 2007-07-26 at 10:56 -0400, Freels, James D. wrote:
> James, I have been out for a couple of days and could not try this
> yet.
> 
> Presently, the system is booted up under 2.6.18.8 which is not the
> troublesome kernel.
> 
> However, I tried your suggestion below, using max_width instead of
> max_wide.

Yes ... sorry should have looked instead of doing it from memory.

>  I get the following while sshed to the system remotely:
> 
> fea8:~# echo 0 > /sys/class/spi_transport/target0:0:3/max_width
> fea8:~# echo 1 > /sys/class/spi_transport/target0:0:3/revalidate

This should produce output in dmesg to indicate the device speeds were
rescanned.

> fea8:~# cat /sys/class/spi_transport/target0:0:3/max_width
> 0
> fea8:~# cat /sys/class/spi_transport/target0:0:3/revalidate
> cat: /sys/class/spi_transport/target0:0:3/revalidate: Permission
> denied
> 
> So, instead, I shifted through the dmesg file to find this string:
> 
> scsi0 : Adaptec AIC7XXX EISA/VLB/PCI SCSI HBA DRIVER, Rev 7.0
>         <Adaptec 29160N Ultra160 SCSI adapter>
>         aic7892: Ultra160 Wide Channel A, SCSI Id=7, 32/253 SCBs
> 
> Further the output from 
> 
> cat /proc/scsi/aic7xxx/0 
> 
> gives
> 
> Adaptec AIC7xxx driver version: 7.0
> Adaptec 29160N Ultra160 SCSI adapter
> aic7892: Ultra160 Wide Channel A, SCSI Id=7, 32/253 SCBs
> Allocated SCBs: 4, SG List Length: 128
> 
> Serial EEPROM:
> 0x439d 0x439d 0x439d 0x439d 0x439d 0x439d 0x439d 0x439d
> 0x00d0 0x00d0 0x00d0 0x00d0 0x00d0 0x00d0 0x00d0 0x00d0
> 0x08f4 0x6c5d 0x2807 0x0010 0x0300 0xffff 0xffff 0xffff
> 0xffff 0xffff 0xffff 0xffff 0xffff 0xffff 0x0250 0xc617
> 
> Target 0 Negotiation Settings
>         User: 20.000MB/s transfers (20.000MHz DT, offset 127)
> Target 1 Negotiation Settings
>         User: 20.000MB/s transfers (20.000MHz DT, offset 127)
> Target 2 Negotiation Settings
>         User: 20.000MB/s transfers (20.000MHz DT, offset 127)
> Target 3 Negotiation Settings
>         User: 20.000MB/s transfers (20.000MHz DT, offset 127)
>         Goal: 20.000MB/s transfers (20.000MHz, offset 32)
>         Curr: 20.000MB/s transfers (20.000MHz, offset 32)
>         Channel A Target 3 Lun 0 Settings
>                 Commands Queued 216
>                 Commands Active 0
>                 Command Openings 1
>                 Max Tagged Openings 0
>                 Device Queue Frozen Count 0
> Target 4 Negotiation Settings
>         User: 20.000MB/s transfers (20.000MHz DT, offset 127)
> Target 5 Negotiation Settings
>         User: 20.000MB/s transfers (20.000MHz DT, offset 127)
> Target 6 Negotiation Settings
>         User: 20.000MB/s transfers (20.000MHz DT, offset 127)
>         Goal: 20.000MB/s transfers (20.000MHz, offset 32)
>         Curr: 20.000MB/s transfers (20.000MHz, offset 32)
>         Channel A Target 6 Lun 0 Settings
>                 Commands Queued 1342313
>                 Commands Active 0
>                 Command Openings 1
>                 Max Tagged Openings 0
>                 Device Queue Frozen Count 0
> Target 7 Negotiation Settings
>         User: 20.000MB/s transfers (20.000MHz DT, offset 127)
> Target 8 Negotiation Settings
>         User: 3.300MB/s transfers
> Target 9 Negotiation Settings
>         User: 3.300MB/s transfers
> Target 10 Negotiation Settings
>         User: 3.300MB/s transfers
> Target 11 Negotiation Settings
>         User: 3.300MB/s transfers
> Target 12 Negotiation Settings
>         User: 3.300MB/s transfers
> Target 13 Negotiation Settings
>         User: 3.300MB/s transfers
> Target 14 Negotiation Settings
>         User: 3.300MB/s transfers
> Target 15 Negotiation Settings
>         User: 3.300MB/s transfers
> 
> So, it looks like indeed, I have a narrow device.
> 
> Looking through
> the /usr/src/linux-2.6.22.1/Documentation/scsi/aic7xxx.txt file for
> dependence on aic7892 driver, I find:
> 
>   AHA-29160N     aic7892   PCI/32      LVD-HD68F       SE-HD50F
>                                          SE-50M
> 
> So, it is using the driver, but seems to indicate a wide or narrow
> capability.

Yes, all aic7xxx cards are wide capable

> Is there any way to force narrow bus ?  Perhaps the card is in a
> 64-bit slot and needs to be in a 32-bit slot ? 

That's what the two echos do.  The domain validation is supposed to
detect a narrow device on a wide cable, but it looks to be failing
somehow ... although we won't know this for definite until you try it on
the latest kernel.

The way to force narrow it to set it in the aic bios if you can.  The
driver picks up that setting and places it in max_width.

James
Comment 10 James D Freels 2007-07-26 08:21:33 UTC
OK.  Looking at the end of dmesg, this is the response from a couple of
tries + before.

I will reboot and look at the bios settings.

scsi: unknown opcode 0x85
st0: Current: sense key: Medium Error
    Additional sense: Recorded entity not found
Info fld=0x1
 target0:0:3: Beginning Domain Validation
 target0:0:3: asynchronous
 target0:0:3: FAST-20 SCSI 20.0 MB/s ST (50 ns, offset 32)
 target0:0:3: Domain Validation skipping write tests
 target0:0:3: Ending Domain Validation
 target0:0:3: Beginning Domain Validation
 target0:0:3: asynchronous
 target0:0:3: FAST-20 SCSI 20.0 MB/s ST (50 ns, offset 32)
 target0:0:3: Domain Validation skipping write tests
 target0:0:3: Ending Domain Validation

On Thu, 2007-07-26 at 11:05 -0400, James Bottomley wrote:

> On Thu, 2007-07-26 at 10:56 -0400, Freels, James D. wrote:
> > James, I have been out for a couple of days and could not try this
> > yet.
> > 
> > Presently, the system is booted up under 2.6.18.8 which is not the
> > troublesome kernel.
> > 
> > However, I tried your suggestion below, using max_width instead of
> > max_wide.
> 
> Yes ... sorry should have looked instead of doing it from memory.
> 
> >  I get the following while sshed to the system remotely:
> > 
> > fea8:~# echo 0 > /sys/class/spi_transport/target0:0:3/max_width
> > fea8:~# echo 1 > /sys/class/spi_transport/target0:0:3/revalidate
> 
> This should produce output in dmesg to indicate the device speeds were
> rescanned.
> 
> > fea8:~# cat /sys/class/spi_transport/target0:0:3/max_width
> > 0
> > fea8:~# cat /sys/class/spi_transport/target0:0:3/revalidate
> > cat: /sys/class/spi_transport/target0:0:3/revalidate: Permission
> > denied
> > 
> > So, instead, I shifted through the dmesg file to find this string:
> > 
> > scsi0 : Adaptec AIC7XXX EISA/VLB/PCI SCSI HBA DRIVER, Rev 7.0
> >         <Adaptec 29160N Ultra160 SCSI adapter>
> >         aic7892: Ultra160 Wide Channel A, SCSI Id=7, 32/253 SCBs
> > 
> > Further the output from 
> > 
> > cat /proc/scsi/aic7xxx/0 
> > 
> > gives
> > 
> > Adaptec AIC7xxx driver version: 7.0
> > Adaptec 29160N Ultra160 SCSI adapter
> > aic7892: Ultra160 Wide Channel A, SCSI Id=7, 32/253 SCBs
> > Allocated SCBs: 4, SG List Length: 128
> > 
> > Serial EEPROM:
> > 0x439d 0x439d 0x439d 0x439d 0x439d 0x439d 0x439d 0x439d
> > 0x00d0 0x00d0 0x00d0 0x00d0 0x00d0 0x00d0 0x00d0 0x00d0
> > 0x08f4 0x6c5d 0x2807 0x0010 0x0300 0xffff 0xffff 0xffff
> > 0xffff 0xffff 0xffff 0xffff 0xffff 0xffff 0x0250 0xc617
> > 
> > Target 0 Negotiation Settings
> >         User: 20.000MB/s transfers (20.000MHz DT, offset 127)
> > Target 1 Negotiation Settings
> >         User: 20.000MB/s transfers (20.000MHz DT, offset 127)
> > Target 2 Negotiation Settings
> >         User: 20.000MB/s transfers (20.000MHz DT, offset 127)
> > Target 3 Negotiation Settings
> >         User: 20.000MB/s transfers (20.000MHz DT, offset 127)
> >         Goal: 20.000MB/s transfers (20.000MHz, offset 32)
> >         Curr: 20.000MB/s transfers (20.000MHz, offset 32)
> >         Channel A Target 3 Lun 0 Settings
> >                 Commands Queued 216
> >                 Commands Active 0
> >                 Command Openings 1
> >                 Max Tagged Openings 0
> >                 Device Queue Frozen Count 0
> > Target 4 Negotiation Settings
> >         User: 20.000MB/s transfers (20.000MHz DT, offset 127)
> > Target 5 Negotiation Settings
> >         User: 20.000MB/s transfers (20.000MHz DT, offset 127)
> > Target 6 Negotiation Settings
> >         User: 20.000MB/s transfers (20.000MHz DT, offset 127)
> >         Goal: 20.000MB/s transfers (20.000MHz, offset 32)
> >         Curr: 20.000MB/s transfers (20.000MHz, offset 32)
> >         Channel A Target 6 Lun 0 Settings
> >                 Commands Queued 1342313
> >                 Commands Active 0
> >                 Command Openings 1
> >                 Max Tagged Openings 0
> >                 Device Queue Frozen Count 0
> > Target 7 Negotiation Settings
> >         User: 20.000MB/s transfers (20.000MHz DT, offset 127)
> > Target 8 Negotiation Settings
> >         User: 3.300MB/s transfers
> > Target 9 Negotiation Settings
> >         User: 3.300MB/s transfers
> > Target 10 Negotiation Settings
> >         User: 3.300MB/s transfers
> > Target 11 Negotiation Settings
> >         User: 3.300MB/s transfers
> > Target 12 Negotiation Settings
> >         User: 3.300MB/s transfers
> > Target 13 Negotiation Settings
> >         User: 3.300MB/s transfers
> > Target 14 Negotiation Settings
> >         User: 3.300MB/s transfers
> > Target 15 Negotiation Settings
> >         User: 3.300MB/s transfers
> > 
> > So, it looks like indeed, I have a narrow device.
> > 
> > Looking through
> > the /usr/src/linux-2.6.22.1/Documentation/scsi/aic7xxx.txt file for
> > dependence on aic7892 driver, I find:
> > 
> >   AHA-29160N     aic7892   PCI/32      LVD-HD68F       SE-HD50F
> >                                          SE-50M
> > 
> > So, it is using the driver, but seems to indicate a wide or narrow
> > capability.
> 
> Yes, all aic7xxx cards are wide capable
> 
> > Is there any way to force narrow bus ?  Perhaps the card is in a
> > 64-bit slot and needs to be in a 32-bit slot ? 
> 
> That's what the two echos do.  The domain validation is supposed to
> detect a narrow device on a wide cable, but it looks to be failing
> somehow ... although we won't know this for definite until you try it on
> the latest kernel.
> 
> The way to force narrow it to set it in the aic bios if you can.  The
> driver picks up that setting and places it in max_width.
> 
> James
> 
> 

James D. Freels, Ph.D.
Senior Research Staff, HFIR Cold Source, ORNL
http://sunsite.utk.edu/wuot/mt/podcast/051807HIFER.mp3
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.14.1">
</HEAD>
<BODY>
OK.&nbsp; Looking at the end of dmesg, this is the response from a couple of tries + before.<BR>
<BR>
I will reboot and look at the bios settings.<BR>
<BR>
scsi: unknown opcode 0x85<BR>
st0: Current: sense key: Medium Error<BR>
&nbsp;&nbsp;&nbsp; Additional sense: Recorded entity not found<BR>
Info fld=0x1<BR>
 target0:0:3: Beginning Domain Validation<BR>
 target0:0:3: asynchronous<BR>
 target0:0:3: FAST-20 SCSI 20.0 MB/s ST (50 ns, offset 32)<BR>
 target0:0:3: Domain Validation skipping write tests<BR>
 target0:0:3: Ending Domain Validation<BR>
 target0:0:3: Beginning Domain Validation<BR>
 target0:0:3: asynchronous<BR>
 target0:0:3: FAST-20 SCSI 20.0 MB/s ST (50 ns, offset 32)<BR>
 target0:0:3: Domain Validation skipping write tests<BR>
 target0:0:3: Ending Domain Validation<BR>
<BR>
On Thu, 2007-07-26 at 11:05 -0400, James Bottomley wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">On Thu, 2007-07-26 at 10:56 -0400, Freels, James D. wrote:</FONT>
<FONT COLOR="#000000">&gt; James, I have been out for a couple of days and could not try this</FONT>
<FONT COLOR="#000000">&gt; yet.</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; Presently, the system is booted up under 2.6.18.8 which is not the</FONT>
<FONT COLOR="#000000">&gt; troublesome kernel.</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; However, I tried your suggestion below, using max_width instead of</FONT>
<FONT COLOR="#000000">&gt; max_wide.</FONT>

<FONT COLOR="#000000">Yes ... sorry should have looked instead of doing it from memory.</FONT>

<FONT COLOR="#000000">&gt;  I get the following while sshed to the system remotely:</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; fea8:~# echo 0 &gt; /sys/class/spi_transport/target0:0:3/max_width</FONT>
<FONT COLOR="#000000">&gt; fea8:~# echo 1 &gt; /sys/class/spi_transport/target0:0:3/revalidate</FONT>

<FONT COLOR="#000000">This should produce output in dmesg to indicate the device speeds were</FONT>
<FONT COLOR="#000000">rescanned.</FONT>

<FONT COLOR="#000000">&gt; fea8:~# cat /sys/class/spi_transport/target0:0:3/max_width</FONT>
<FONT COLOR="#000000">&gt; 0</FONT>
<FONT COLOR="#000000">&gt; fea8:~# cat /sys/class/spi_transport/target0:0:3/revalidate</FONT>
<FONT COLOR="#000000">&gt; cat: /sys/class/spi_transport/target0:0:3/revalidate: Permission</FONT>
<FONT COLOR="#000000">&gt; denied</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; So, instead, I shifted through the dmesg file to find this string:</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; scsi0 : Adaptec AIC7XXX EISA/VLB/PCI SCSI HBA DRIVER, Rev 7.0</FONT>
<FONT COLOR="#000000">&gt;         &lt;Adaptec 29160N Ultra160 SCSI adapter&gt;</FONT>
<FONT COLOR="#000000">&gt;         aic7892: Ultra160 Wide Channel A, SCSI Id=7, 32/253 SCBs</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; Further the output from </FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; cat /proc/scsi/aic7xxx/0 </FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; gives</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; Adaptec AIC7xxx driver version: 7.0</FONT>
<FONT COLOR="#000000">&gt; Adaptec 29160N Ultra160 SCSI adapter</FONT>
<FONT COLOR="#000000">&gt; aic7892: Ultra160 Wide Channel A, SCSI Id=7, 32/253 SCBs</FONT>
<FONT COLOR="#000000">&gt; Allocated SCBs: 4, SG List Length: 128</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; Serial EEPROM:</FONT>
<FONT COLOR="#000000">&gt; 0x439d 0x439d 0x439d 0x439d 0x439d 0x439d 0x439d 0x439d</FONT>
<FONT COLOR="#000000">&gt; 0x00d0 0x00d0 0x00d0 0x00d0 0x00d0 0x00d0 0x00d0 0x00d0</FONT>
<FONT COLOR="#000000">&gt; 0x08f4 0x6c5d 0x2807 0x0010 0x0300 0xffff 0xffff 0xffff</FONT>
<FONT COLOR="#000000">&gt; 0xffff 0xffff 0xffff 0xffff 0xffff 0xffff 0x0250 0xc617</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; Target 0 Negotiation Settings</FONT>
<FONT COLOR="#000000">&gt;         User: 20.000MB/s transfers (20.000MHz DT, offset 127)</FONT>
<FONT COLOR="#000000">&gt; Target 1 Negotiation Settings</FONT>
<FONT COLOR="#000000">&gt;         User: 20.000MB/s transfers (20.000MHz DT, offset 127)</FONT>
<FONT COLOR="#000000">&gt; Target 2 Negotiation Settings</FONT>
<FONT COLOR="#000000">&gt;         User: 20.000MB/s transfers (20.000MHz DT, offset 127)</FONT>
<FONT COLOR="#000000">&gt; Target 3 Negotiation Settings</FONT>
<FONT COLOR="#000000">&gt;         User: 20.000MB/s transfers (20.000MHz DT, offset 127)</FONT>
<FONT COLOR="#000000">&gt;         Goal: 20.000MB/s transfers (20.000MHz, offset 32)</FONT>
<FONT COLOR="#000000">&gt;         Curr: 20.000MB/s transfers (20.000MHz, offset 32)</FONT>
<FONT COLOR="#000000">&gt;         Channel A Target 3 Lun 0 Settings</FONT>
<FONT COLOR="#000000">&gt;                 Commands Queued 216</FONT>
<FONT COLOR="#000000">&gt;                 Commands Active 0</FONT>
<FONT COLOR="#000000">&gt;                 Command Openings 1</FONT>
<FONT COLOR="#000000">&gt;                 Max Tagged Openings 0</FONT>
<FONT COLOR="#000000">&gt;                 Device Queue Frozen Count 0</FONT>
<FONT COLOR="#000000">&gt; Target 4 Negotiation Settings</FONT>
<FONT COLOR="#000000">&gt;         User: 20.000MB/s transfers (20.000MHz DT, offset 127)</FONT>
<FONT COLOR="#000000">&gt; Target 5 Negotiation Settings</FONT>
<FONT COLOR="#000000">&gt;         User: 20.000MB/s transfers (20.000MHz DT, offset 127)</FONT>
<FONT COLOR="#000000">&gt; Target 6 Negotiation Settings</FONT>
<FONT COLOR="#000000">&gt;         User: 20.000MB/s transfers (20.000MHz DT, offset 127)</FONT>
<FONT COLOR="#000000">&gt;         Goal: 20.000MB/s transfers (20.000MHz, offset 32)</FONT>
<FONT COLOR="#000000">&gt;         Curr: 20.000MB/s transfers (20.000MHz, offset 32)</FONT>
<FONT COLOR="#000000">&gt;         Channel A Target 6 Lun 0 Settings</FONT>
<FONT COLOR="#000000">&gt;                 Commands Queued 1342313</FONT>
<FONT COLOR="#000000">&gt;                 Commands Active 0</FONT>
<FONT COLOR="#000000">&gt;                 Command Openings 1</FONT>
<FONT COLOR="#000000">&gt;                 Max Tagged Openings 0</FONT>
<FONT COLOR="#000000">&gt;                 Device Queue Frozen Count 0</FONT>
<FONT COLOR="#000000">&gt; Target 7 Negotiation Settings</FONT>
<FONT COLOR="#000000">&gt;         User: 20.000MB/s transfers (20.000MHz DT, offset 127)</FONT>
<FONT COLOR="#000000">&gt; Target 8 Negotiation Settings</FONT>
<FONT COLOR="#000000">&gt;         User: 3.300MB/s transfers</FONT>
<FONT COLOR="#000000">&gt; Target 9 Negotiation Settings</FONT>
<FONT COLOR="#000000">&gt;         User: 3.300MB/s transfers</FONT>
<FONT COLOR="#000000">&gt; Target 10 Negotiation Settings</FONT>
<FONT COLOR="#000000">&gt;         User: 3.300MB/s transfers</FONT>
<FONT COLOR="#000000">&gt; Target 11 Negotiation Settings</FONT>
<FONT COLOR="#000000">&gt;         User: 3.300MB/s transfers</FONT>
<FONT COLOR="#000000">&gt; Target 12 Negotiation Settings</FONT>
<FONT COLOR="#000000">&gt;         User: 3.300MB/s transfers</FONT>
<FONT COLOR="#000000">&gt; Target 13 Negotiation Settings</FONT>
<FONT COLOR="#000000">&gt;         User: 3.300MB/s transfers</FONT>
<FONT COLOR="#000000">&gt; Target 14 Negotiation Settings</FONT>
<FONT COLOR="#000000">&gt;         User: 3.300MB/s transfers</FONT>
<FONT COLOR="#000000">&gt; Target 15 Negotiation Settings</FONT>
<FONT COLOR="#000000">&gt;         User: 3.300MB/s transfers</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; So, it looks like indeed, I have a narrow device.</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; Looking through</FONT>
<FONT COLOR="#000000">&gt; the /usr/src/linux-2.6.22.1/Documentation/scsi/aic7xxx.txt file for</FONT>
<FONT COLOR="#000000">&gt; dependence on aic7892 driver, I find:</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt;   AHA-29160N     aic7892   PCI/32      LVD-HD68F       SE-HD50F</FONT>
<FONT COLOR="#000000">&gt;                                          SE-50M</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; So, it is using the driver, but seems to indicate a wide or narrow</FONT>
<FONT COLOR="#000000">&gt; capability.</FONT>

<FONT COLOR="#000000">Yes, all aic7xxx cards are wide capable</FONT>

<FONT COLOR="#000000">&gt; Is there any way to force narrow bus ?  Perhaps the card is in a</FONT>
<FONT COLOR="#000000">&gt; 64-bit slot and needs to be in a 32-bit slot ? </FONT>

<FONT COLOR="#000000">That's what the two echos do.  The domain validation is supposed to</FONT>
<FONT COLOR="#000000">detect a narrow device on a wide cable, but it looks to be failing</FONT>
<FONT COLOR="#000000">somehow ... although we won't know this for definite until you try it on</FONT>
<FONT COLOR="#000000">the latest kernel.</FONT>

<FONT COLOR="#000000">The way to force narrow it to set it in the aic bios if you can.  The</FONT>
<FONT COLOR="#000000">driver picks up that setting and places it in max_width.</FONT>

<FONT COLOR="#000000">James</FONT>


</PRE>
</BLOCKQUOTE>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
James D. Freels, Ph.D.<BR>
Senior Research Staff, HFIR Cold Source, ORNL<BR>
<A HREF="http://sunsite.utk.edu/wuot/mt/podcast/051807HIFER.mp3">http://sunsite.utk.edu/wuot/mt/podcast/051807HIFER.mp3</A>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
Comment 11 James D Freels 2007-07-26 13:06:17 UTC
Sorry for the previous HTML-formatted e-mails.  This is now corrected.

The first thing to realize is that this system only has three devices on
the actual scsi bus to this adapter:

7 - adapter card
3 - Exabyte 1x10 autoloader
6 - Exabyte VXA-2 tape drive

I only need 20 Mbps since the maximum speed of the VXA-2 tape drive is 6
Mbps uncomressed or 12 Mbps compressed (estimated since depends on
compressibility).  Looking at the backup reports I am getting very close
to 6 Mbps performance.

I looked at the bios settings for this device and it appears to be set
as near as possible to a narrow device:

1) The bios is entered by typing ctrl-A during the Adaptec bios output
console while booting.  All 15 scsi IDs show up on the console. Each
device can be set separately.

2) The entries were initially set as follows:

sync transfer 20 Mbps, scsi IDs 0-7
a-sync transfer, scsi IDs 8-15

initiate wide negotiation - NO - 0-15

enable auto-disconnect  - YES 0-15

send start to unit  -  YES 0-7, NO 8-15

enable write back cache - YES 0-7, NO 8-15

bios multiple LUN - NO - 0-15

include in bios scan - YES 0-7, NO 8-15

3) I also tried one change to these same entries (which is where it is
now):

sync transfer 20 Mbps, scsi IDs 0-15

enable auto-disconnect  - NO 0-7, YES 8-15

4) I also tried booting with all devices in async mode, and it also
failed to find the media changer.

5) The narrow bus can be verified by the maximum sync transfer available
is 160 Mbps in wide setting and only 40 Mbps in the narrow setting.

6) A separate screen shows two entries 

LVD/SE connector  automatic
Fast/Ultra-SE connector  automatic

These could be changed to enable or disable, but I left as automatic.

7) The bios version is 3.10.0 which is the latest available from Adaptec
and dated 30-May-2001.

8) I booted up under 2.6.18.8 and the old aic7xxx driver which is
working, and the 2.6.22.1 and the new aic7xxx driver which is not
working.

9) the output from the commands you asked for are shown below for the
2.6.22.1 kernel.  They indicate parity errors on the changer at scsi
id=3.  Also, when booting up under 2.6.18.8, the linux media changer
scsi device works and initializes; when booting up under 2.6.22.1, it
does not; probably because of the same parity errors ?

 target0:0:3: Beginning Domain Validation
 target0:0:3: asynchronous
 target0:0:3: FAST-20 WIDE SCSI 40.0 MB/s ST (50 ns, offset 32)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x1a6)
SCSIRATE(0x95)
(scsi0:A:3:0): parity error detected in Command phase. SEQADDR(0x1a7)
SCSIRATE(0x95)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x1a7)
SCSIRATE(0x95)
(scsi0:A:3:0): parity error detected in Command phase. SEQADDR(0x1a7)
SCSIRATE(0x95)
 target0:0:3: Domain Validation detected failure, dropping back
 target0:0:3: FAST-20 WIDE SCSI 33.4 MB/s ST (60 ns, offset 32)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x1a6)
SCSIRATE(0x96)
(scsi0:A:3:0): parity error detected in Command phase. SEQADDR(0x1a7)
SCSIRATE(0x96)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x1a6)
SCSIRATE(0x96)
(scsi0:A:3:0): parity error detected in Command phase. SEQADDR(0x1a7)
SCSIRATE(0x96)
 target0:0:3: Domain Validation detected failure, dropping back
 target0:0:3: FAST-10 WIDE SCSI 20.0 MB/s ST (100 ns, offset 32)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x1a6)
SCSIRATE(0x98)
(scsi0:A:3:0): parity error detected in Command phase. SEQADDR(0x1a7)
SCSIRATE(0x98)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x1a6)
SCSIRATE(0x98)
(scsi0:A:3:0): parity error detected in Command phase. SEQADDR(0x1a7)
SCSIRATE(0x98)
 target0:0:3: Domain Validation detected failure, dropping back
 target0:0:3: FAST-10 WIDE SCSI 13.6 MB/s ST (148 ns, offset 32)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x1a6)
SCSIRATE(0x9a)
(scsi0:A:3:0): parity error detected in Command phase. SEQADDR(0x1a7)
SCSIRATE(0x9a)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x1a6)
SCSIRATE(0x9a)
(scsi0:A:3:0): parity error detected in Command phase. SEQADDR(0x1a7)
SCSIRATE(0x9a)
 target0:0:3: Domain Validation detected failure, dropping back
 target0:0:3: wide asynchronous
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x69)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x54)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x54)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x54)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x54)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x54)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x54)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x54)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x54)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x54)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x54)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x54)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x54)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x54)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x6b)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x85)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x85)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x85)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x85)
SCSIRATE(0x80)
 target0:0:3: Domain Validation detected failure, dropping back
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x69)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x54)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x54)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x54)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x54)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x54)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x54)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x54)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x54)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x54)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x54)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x54)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x54)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x54)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x54)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x6b)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x1a7)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x1a7)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x54)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x54)
SCSIRATE(0x80)
 target0:0:3: Domain Validation detected failure, dropping back
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x69)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x1a7)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x1a7)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x1a7)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x1a7)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x83)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x83)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x83)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x83)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x83)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x83)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x83)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x83)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x83)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x83)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x6b)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x1a7)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x1a7)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x1a7)
SCSIRATE(0x80)
 target0:0:3: Domain Validation detected failure, dropping back
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x69)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x83)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x83)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x83)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x83)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x83)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x83)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x83)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x83)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x83)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x83)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x83)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x83)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x83)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x83)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x83)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x1a7)
SCSIRATE(0x80)
(scsi0:A:3:0): parity error detected in Command phase. SEQADDR(0x1a7)
SCSIRATE(0x80)
 target0:0:3: Domain Validation Failure, dropping back to Asynchronous
 target0:0:3: Domain Validation skipping write tests
 target0:0:3: Ending Domain Validation
Comment 12 Anonymous Emailer 2007-07-26 13:53:01 UTC
Reply-To: James.Bottomley@SteelEye.com

On Thu, 2007-07-26 at 16:00 -0400, Freels, James D. wrote:
> 9) the output from the commands you asked for are shown below for the
> 2.6.22.1 kernel.  They indicate parity errors on the changer at scsi
> id=3.  Also, when booting up under 2.6.18.8, the linux media changer
> scsi device works and initializes; when booting up under 2.6.22.1, it
> does not; probably because of the same parity errors ?
> 
>  target0:0:3: Beginning Domain Validation
>  target0:0:3: asynchronous
>  target0:0:3: FAST-20 WIDE SCSI 40.0
                        ^^^^
This is the problem.

Something in the transport class is causing WIDE to be set regardless of
the max_width setting ... this looks to be a bug in the aic7xxx
transport class implementation

>  MB/s ST (50 ns, offset 32)
> (scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x1a6)
> SCSIRATE(0x95)

Once it goes wide on a narrow device, you get immediate parity errors
half the time, because you're missing the upper 8 bits for the parity
calculation.

I'll see if I can trace this inside the driver ... naturally, I have no
aic7xxx setup where I only have a narrow device.

James
Comment 13 Anonymous Emailer 2007-07-26 14:18:58 UTC
Reply-To: James.Bottomley@SteelEye.com

On Thu, 2007-07-26 at 16:46 -0400, James Bottomley wrote:
> On Thu, 2007-07-26 at 16:00 -0400, Freels, James D. wrote:
> > 9) the output from the commands you asked for are shown below for the
> > 2.6.22.1 kernel.  They indicate parity errors on the changer at scsi
> > id=3.  Also, when booting up under 2.6.18.8, the linux media changer
> > scsi device works and initializes; when booting up under 2.6.22.1, it
> > does not; probably because of the same parity errors ?
> > 
> >  target0:0:3: Beginning Domain Validation
> >  target0:0:3: asynchronous
> >  target0:0:3: FAST-20 WIDE SCSI 40.0
>                         ^^^^
> This is the problem.
> 
> Something in the transport class is causing WIDE to be set regardless of
> the max_width setting ... this looks to be a bug in the aic7xxx
> transport class implementation
> 
> >  MB/s ST (50 ns, offset 32)
> > (scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x1a6)
> > SCSIRATE(0x95)
> 
> Once it goes wide on a narrow device, you get immediate parity errors
> half the time, because you're missing the upper 8 bits for the parity
> calculation.
> 
> I'll see if I can trace this inside the driver ... naturally, I have no
> aic7xxx setup where I only have a narrow device.

OK, could you try the attached as the fix ... I've verified a similar
problem on the aic79xx which this fixes ... I just don't have access to
an aic7xxx currently to try it out with, but I think it should work.

James

diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c
index 286ab83..641dc4e 100644
--- a/drivers/scsi/aic7xxx/aic79xx_osm.c
+++ b/drivers/scsi/aic7xxx/aic79xx_osm.c
@@ -2284,9 +2284,12 @@ static void ahd_linux_set_period(struct scsi_target *starget, int period)
 	if (period < 8)
 		period = 8;
 	if (period < 10) {
-		ppr_options |= MSG_EXT_PPR_DT_REQ;
-		if (period == 8)
-			ppr_options |= MSG_EXT_PPR_IU_REQ;
+		if (spi_max_width(starget)) {
+			ppr_options |= MSG_EXT_PPR_DT_REQ;
+			if (period == 8)
+				ppr_options |= MSG_EXT_PPR_IU_REQ;
+		} else 
+			period = 10;
 	}
 
 	dt = ppr_options & MSG_EXT_PPR_DT_REQ;
@@ -2365,7 +2368,7 @@ static void ahd_linux_set_dt(struct scsi_target *starget, int dt)
 		printf("%s: %s DT\n", ahd_name(ahd), 
 		       dt ? "enabling" : "disabling");
 #endif
-	if (dt) {
+	if (dt && spi_max_width(starget)) {
 		ppr_options |= MSG_EXT_PPR_DT_REQ;
 		if (!width)
 			ahd_linux_set_width(starget, 1);
@@ -2447,7 +2450,7 @@ static void ahd_linux_set_iu(struct scsi_target *starget, int iu)
 		       iu ? "enabling" : "disabling");
 #endif
 
-	if (iu) {
+	if (iu && spi_max_width(starget)) {
 		ppr_options |= MSG_EXT_PPR_IU_REQ;
 		ppr_options |= MSG_EXT_PPR_DT_REQ; /* IU requires DT */
 	}
@@ -2487,7 +2490,7 @@ static void ahd_linux_set_rd_strm(struct scsi_target *starget, int rdstrm)
 		       rdstrm  ? "enabling" : "disabling");
 #endif
 
-	if (rdstrm)
+	if (rdstrm && spi_max_width(starget))
 		ppr_options |= MSG_EXT_PPR_RD_STRM;
 
 	ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0,
@@ -2523,7 +2526,7 @@ static void ahd_linux_set_wr_flow(struct scsi_target *starget, int wrflow)
 		       wrflow ? "enabling" : "disabling");
 #endif
 
-	if (wrflow)
+	if (wrflow && spi_max_width(starget))
 		ppr_options |= MSG_EXT_PPR_WR_FLOW;
 
 	ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0,
@@ -2567,7 +2570,7 @@ static void ahd_linux_set_rti(struct scsi_target *starget, int rti)
 		       rti ? "enabling" : "disabling");
 #endif
 
-	if (rti)
+	if (rti && spi_max_width(starget))
 		ppr_options |= MSG_EXT_PPR_RTI;
 
 	ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0,
@@ -2603,7 +2606,7 @@ static void ahd_linux_set_pcomp_en(struct scsi_target *starget, int pcomp)
 		       pcomp ? "Enable" : "Disable");
 #endif
 
-	if (pcomp) {
+	if (pcomp && spi_max_width(starget)) {
 		uint8_t precomp;
 
 		if (ahd->unit < ARRAY_SIZE(aic79xx_iocell_info)) {
@@ -2647,7 +2650,7 @@ static void ahd_linux_set_hold_mcs(struct scsi_target *starget, int hold)
 	unsigned int dt = ppr_options & MSG_EXT_PPR_DT_REQ;
 	unsigned long flags;
 
-	if (hold)
+	if (hold && spi_max_width(starget))
 		ppr_options |= MSG_EXT_PPR_HOLD_MCS;
 
 	ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0,
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c
index 1803ab6..2e9c38f 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c
@@ -2317,8 +2317,13 @@ static void ahc_linux_set_period(struct scsi_target *starget, int period)
 
 	if (period < 9)
 		period = 9;	/* 12.5ns is our minimum */
-	if (period == 9)
-		ppr_options |= MSG_EXT_PPR_DT_REQ;
+	if (period == 9) {
+		if (spi_max_width(starget))
+			ppr_options |= MSG_EXT_PPR_DT_REQ;
+		else
+			/* need wide for DT and need DT for 12.5 ns */
+			period = 10;
+	}
 
 	ahc_compile_devinfo(&devinfo, shost->this_id, starget->id, 0,
 			    starget->channel + 'A', ROLE_INITIATOR);
@@ -2381,7 +2386,7 @@ static void ahc_linux_set_dt(struct scsi_target *starget, int dt)
 	unsigned long flags;
 	struct ahc_syncrate *syncrate;
 
-	if (dt) {
+	if (dt && spi_max_width(starget)) {
 		ppr_options |= MSG_EXT_PPR_DT_REQ;
 		if (!width)
 			ahc_linux_set_width(starget, 1);
Comment 14 James D Freels 2007-07-26 14:22:44 UTC
James, I would be glad to try the fix.  I can grab the changes below,
but can you give me the patch command ?  I know how to patch the normal
kernel sources.  Is this a patch for 2.6.22.1 ?

cd /usr/src/linux-2.6.22.1

patch -p1 <../your_new_patch

where your_new_patch is in /usr/src  

?

On Thu, 2007-07-26 at 17:13 -0400, James Bottomley wrote:

> On Thu, 2007-07-26 at 16:46 -0400, James Bottomley wrote:
> > On Thu, 2007-07-26 at 16:00 -0400, Freels, James D. wrote:
> > > 9) the output from the commands you asked for are shown below for the
> > > 2.6.22.1 kernel.  They indicate parity errors on the changer at scsi
> > > id=3.  Also, when booting up under 2.6.18.8, the linux media changer
> > > scsi device works and initializes; when booting up under 2.6.22.1, it
> > > does not; probably because of the same parity errors ?
> > > 
> > >  target0:0:3: Beginning Domain Validation
> > >  target0:0:3: asynchronous
> > >  target0:0:3: FAST-20 WIDE SCSI 40.0
> >                         ^^^^
> > This is the problem.
> > 
> > Something in the transport class is causing WIDE to be set regardless of
> > the max_width setting ... this looks to be a bug in the aic7xxx
> > transport class implementation
> > 
> > >  MB/s ST (50 ns, offset 32)
> > > (scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x1a6)
> > > SCSIRATE(0x95)
> > 
> > Once it goes wide on a narrow device, you get immediate parity errors
> > half the time, because you're missing the upper 8 bits for the parity
> > calculation.
> > 
> > I'll see if I can trace this inside the driver ... naturally, I have no
> > aic7xxx setup where I only have a narrow device.
> 
> OK, could you try the attached as the fix ... I've verified a similar
> problem on the aic79xx which this fixes ... I just don't have access to
> an aic7xxx currently to try it out with, but I think it should work.
> 
> James
> 
> diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c
> b/drivers/scsi/aic7xxx/aic79xx_osm.c
> index 286ab83..641dc4e 100644
> --- a/drivers/scsi/aic7xxx/aic79xx_osm.c
> +++ b/drivers/scsi/aic7xxx/aic79xx_osm.c
> @@ -2284,9 +2284,12 @@ static void ahd_linux_set_period(struct scsi_target
> *starget, int period)
>       if (period < 8)
>               period = 8;
>       if (period < 10) {
> -             ppr_options |= MSG_EXT_PPR_DT_REQ;
> -             if (period == 8)
> -                     ppr_options |= MSG_EXT_PPR_IU_REQ;
> +             if (spi_max_width(starget)) {
> +                     ppr_options |= MSG_EXT_PPR_DT_REQ;
> +                     if (period == 8)
> +                             ppr_options |= MSG_EXT_PPR_IU_REQ;
> +             } else 
> +                     period = 10;
>       }
>  
>       dt = ppr_options & MSG_EXT_PPR_DT_REQ;
> @@ -2365,7 +2368,7 @@ static void ahd_linux_set_dt(struct scsi_target
> *starget, int dt)
>               printf("%s: %s DT\n", ahd_name(ahd), 
>                      dt ? "enabling" : "disabling");
>  #endif
> -     if (dt) {
> +     if (dt && spi_max_width(starget)) {
>               ppr_options |= MSG_EXT_PPR_DT_REQ;
>               if (!width)
>                       ahd_linux_set_width(starget, 1);
> @@ -2447,7 +2450,7 @@ static void ahd_linux_set_iu(struct scsi_target
> *starget, int iu)
>                      iu ? "enabling" : "disabling");
>  #endif
>  
> -     if (iu) {
> +     if (iu && spi_max_width(starget)) {
>               ppr_options |= MSG_EXT_PPR_IU_REQ;
>               ppr_options |= MSG_EXT_PPR_DT_REQ; /* IU requires DT */
>       }
> @@ -2487,7 +2490,7 @@ static void ahd_linux_set_rd_strm(struct scsi_target
> *starget, int rdstrm)
>                      rdstrm  ? "enabling" : "disabling");
>  #endif
>  
> -     if (rdstrm)
> +     if (rdstrm && spi_max_width(starget))
>               ppr_options |= MSG_EXT_PPR_RD_STRM;
>  
>       ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0,
> @@ -2523,7 +2526,7 @@ static void ahd_linux_set_wr_flow(struct scsi_target
> *starget, int wrflow)
>                      wrflow ? "enabling" : "disabling");
>  #endif
>  
> -     if (wrflow)
> +     if (wrflow && spi_max_width(starget))
>               ppr_options |= MSG_EXT_PPR_WR_FLOW;
>  
>       ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0,
> @@ -2567,7 +2570,7 @@ static void ahd_linux_set_rti(struct scsi_target
> *starget, int rti)
>                      rti ? "enabling" : "disabling");
>  #endif
>  
> -     if (rti)
> +     if (rti && spi_max_width(starget))
>               ppr_options |= MSG_EXT_PPR_RTI;
>  
>       ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0,
> @@ -2603,7 +2606,7 @@ static void ahd_linux_set_pcomp_en(struct scsi_target
> *starget, int pcomp)
>                      pcomp ? "Enable" : "Disable");
>  #endif
>  
> -     if (pcomp) {
> +     if (pcomp && spi_max_width(starget)) {
>               uint8_t precomp;
>  
>               if (ahd->unit < ARRAY_SIZE(aic79xx_iocell_info)) {
> @@ -2647,7 +2650,7 @@ static void ahd_linux_set_hold_mcs(struct scsi_target
> *starget, int hold)
>       unsigned int dt = ppr_options & MSG_EXT_PPR_DT_REQ;
>       unsigned long flags;
>  
> -     if (hold)
> +     if (hold && spi_max_width(starget))
>               ppr_options |= MSG_EXT_PPR_HOLD_MCS;
>  
>       ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0,
> diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c
> b/drivers/scsi/aic7xxx/aic7xxx_osm.c
> index 1803ab6..2e9c38f 100644
> --- a/drivers/scsi/aic7xxx/aic7xxx_osm.c
> +++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c
> @@ -2317,8 +2317,13 @@ static void ahc_linux_set_period(struct scsi_target
> *starget, int period)
>  
>       if (period < 9)
>               period = 9;     /* 12.5ns is our minimum */
> -     if (period == 9)
> -             ppr_options |= MSG_EXT_PPR_DT_REQ;
> +     if (period == 9) {
> +             if (spi_max_width(starget))
> +                     ppr_options |= MSG_EXT_PPR_DT_REQ;
> +             else
> +                     /* need wide for DT and need DT for 12.5 ns */
> +                     period = 10;
> +     }
>  
>       ahc_compile_devinfo(&devinfo, shost->this_id, starget->id, 0,
>                           starget->channel + 'A', ROLE_INITIATOR);
> @@ -2381,7 +2386,7 @@ static void ahc_linux_set_dt(struct scsi_target
> *starget, int dt)
>       unsigned long flags;
>       struct ahc_syncrate *syncrate;
>  
> -     if (dt) {
> +     if (dt && spi_max_width(starget)) {
>               ppr_options |= MSG_EXT_PPR_DT_REQ;
>               if (!width)
>                       ahc_linux_set_width(starget, 1);
> 
> 

James D. Freels, Ph.D.
Senior Research Staff, HFIR Cold Source, ORNL
http://sunsite.utk.edu/wuot/mt/podcast/051807HIFER.mp3
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.14.1">
</HEAD>
<BODY>
James, I would be glad to try the fix.&nbsp; I can grab the changes below, but can you give me the patch command ?&nbsp; I know how to patch the normal kernel sources.&nbsp; Is this a patch for 2.6.22.1 ?<BR>
<BR>
cd /usr/src/linux-2.6.22.1<BR>
<BR>
patch -p1 &lt;../your_new_patch<BR>
<BR>
where your_new_patch is in /usr/src&nbsp; <BR>
<BR>
?<BR>
<BR>
On Thu, 2007-07-26 at 17:13 -0400, James Bottomley wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">On Thu, 2007-07-26 at 16:46 -0400, James Bottomley wrote:</FONT>
<FONT COLOR="#000000">&gt; On Thu, 2007-07-26 at 16:00 -0400, Freels, James D. wrote:</FONT>
<FONT COLOR="#000000">&gt; &gt; 9) the output from the commands you asked for are shown below for the</FONT>
<FONT COLOR="#000000">&gt; &gt; 2.6.22.1 kernel.  They indicate parity errors on the changer at scsi</FONT>
<FONT COLOR="#000000">&gt; &gt; id=3.  Also, when booting up under 2.6.18.8, the linux media changer</FONT>
<FONT COLOR="#000000">&gt; &gt; scsi device works and initializes; when booting up under 2.6.22.1, it</FONT>
<FONT COLOR="#000000">&gt; &gt; does not; probably because of the same parity errors ?</FONT>
<FONT COLOR="#000000">&gt; &gt; </FONT>
<FONT COLOR="#000000">&gt; &gt;  target0:0:3: Beginning Domain Validation</FONT>
<FONT COLOR="#000000">&gt; &gt;  target0:0:3: asynchronous</FONT>
<FONT COLOR="#000000">&gt; &gt;  target0:0:3: FAST-20 WIDE SCSI 40.0</FONT>
<FONT COLOR="#000000">&gt;                         ^^^^</FONT>
<FONT COLOR="#000000">&gt; This is the problem.</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; Something in the transport class is causing WIDE to be set regardless of</FONT>
<FONT COLOR="#000000">&gt; the max_width setting ... this looks to be a bug in the aic7xxx</FONT>
<FONT COLOR="#000000">&gt; transport class implementation</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; &gt;  MB/s ST (50 ns, offset 32)</FONT>
<FONT COLOR="#000000">&gt; &gt; (scsi0:A:3:0): parity error detected in Data-in phase. SEQADDR(0x1a6)</FONT>
<FONT COLOR="#000000">&gt; &gt; SCSIRATE(0x95)</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; Once it goes wide on a narrow device, you get immediate parity errors</FONT>
<FONT COLOR="#000000">&gt; half the time, because you're missing the upper 8 bits for the parity</FONT>
<FONT COLOR="#000000">&gt; calculation.</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; I'll see if I can trace this inside the driver ... naturally, I have no</FONT>
<FONT COLOR="#000000">&gt; aic7xxx setup where I only have a narrow device.</FONT>

<FONT COLOR="#000000">OK, could you try the attached as the fix ... I've verified a similar</FONT>
<FONT COLOR="#000000">problem on the aic79xx which this fixes ... I just don't have access to</FONT>
<FONT COLOR="#000000">an aic7xxx currently to try it out with, but I think it should work.</FONT>

<FONT COLOR="#000000">James</FONT>

<FONT COLOR="#000000">diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c</FONT>
<FONT COLOR="#000000">index 286ab83..641dc4e 100644</FONT>
<FONT COLOR="#000000">--- a/drivers/scsi/aic7xxx/aic79xx_osm.c</FONT>
<FONT COLOR="#000000">+++ b/drivers/scsi/aic7xxx/aic79xx_osm.c</FONT>
<FONT COLOR="#000000">@@ -2284,9 +2284,12 @@ static void ahd_linux_set_period(struct scsi_target *starget, int period)</FONT>
<FONT COLOR="#000000"> 	if (period &lt; 8)</FONT>
<FONT COLOR="#000000"> 		period = 8;</FONT>
<FONT COLOR="#000000"> 	if (period &lt; 10) {</FONT>
<FONT COLOR="#000000">-		ppr_options |= MSG_EXT_PPR_DT_REQ;</FONT>
<FONT COLOR="#000000">-		if (period == 8)</FONT>
<FONT COLOR="#000000">-			ppr_options |= MSG_EXT_PPR_IU_REQ;</FONT>
<FONT COLOR="#000000">+		if (spi_max_width(starget)) {</FONT>
<FONT COLOR="#000000">+			ppr_options |= MSG_EXT_PPR_DT_REQ;</FONT>
<FONT COLOR="#000000">+			if (period == 8)</FONT>
<FONT COLOR="#000000">+				ppr_options |= MSG_EXT_PPR_IU_REQ;</FONT>
<FONT COLOR="#000000">+		} else </FONT>
<FONT COLOR="#000000">+			period = 10;</FONT>
<FONT COLOR="#000000"> 	}</FONT>
<FONT COLOR="#000000"> </FONT>
<FONT COLOR="#000000"> 	dt = ppr_options &amp; MSG_EXT_PPR_DT_REQ;</FONT>
<FONT COLOR="#000000">@@ -2365,7 +2368,7 @@ static void ahd_linux_set_dt(struct scsi_target *starget, int dt)</FONT>
<FONT COLOR="#000000"> 		printf(&quot;%s: %s DT\n&quot;, ahd_name(ahd), </FONT>
<FONT COLOR="#000000"> 		       dt ? &quot;enabling&quot; : &quot;disabling&quot;);</FONT>
<FONT COLOR="#000000"> #endif</FONT>
<FONT COLOR="#000000">-	if (dt) {</FONT>
<FONT COLOR="#000000">+	if (dt &amp;&amp; spi_max_width(starget)) {</FONT>
<FONT COLOR="#000000"> 		ppr_options |= MSG_EXT_PPR_DT_REQ;</FONT>
<FONT COLOR="#000000"> 		if (!width)</FONT>
<FONT COLOR="#000000"> 			ahd_linux_set_width(starget, 1);</FONT>
<FONT COLOR="#000000">@@ -2447,7 +2450,7 @@ static void ahd_linux_set_iu(struct scsi_target *starget, int iu)</FONT>
<FONT COLOR="#000000"> 		       iu ? &quot;enabling&quot; : &quot;disabling&quot;);</FONT>
<FONT COLOR="#000000"> #endif</FONT>
<FONT COLOR="#000000"> </FONT>
<FONT COLOR="#000000">-	if (iu) {</FONT>
<FONT COLOR="#000000">+	if (iu &amp;&amp; spi_max_width(starget)) {</FONT>
<FONT COLOR="#000000"> 		ppr_options |= MSG_EXT_PPR_IU_REQ;</FONT>
<FONT COLOR="#000000"> 		ppr_options |= MSG_EXT_PPR_DT_REQ; /* IU requires DT */</FONT>
<FONT COLOR="#000000"> 	}</FONT>
<FONT COLOR="#000000">@@ -2487,7 +2490,7 @@ static void ahd_linux_set_rd_strm(struct scsi_target *starget, int rdstrm)</FONT>
<FONT COLOR="#000000"> 		       rdstrm  ? &quot;enabling&quot; : &quot;disabling&quot;);</FONT>
<FONT COLOR="#000000"> #endif</FONT>
<FONT COLOR="#000000"> </FONT>
<FONT COLOR="#000000">-	if (rdstrm)</FONT>
<FONT COLOR="#000000">+	if (rdstrm &amp;&amp; spi_max_width(starget))</FONT>
<FONT COLOR="#000000"> 		ppr_options |= MSG_EXT_PPR_RD_STRM;</FONT>
<FONT COLOR="#000000"> </FONT>
<FONT COLOR="#000000"> 	ahd_compile_devinfo(&amp;devinfo, shost-&gt;this_id, starget-&gt;id, 0,</FONT>
<FONT COLOR="#000000">@@ -2523,7 +2526,7 @@ static void ahd_linux_set_wr_flow(struct scsi_target *starget, int wrflow)</FONT>
<FONT COLOR="#000000"> 		       wrflow ? &quot;enabling&quot; : &quot;disabling&quot;);</FONT>
<FONT COLOR="#000000"> #endif</FONT>
<FONT COLOR="#000000"> </FONT>
<FONT COLOR="#000000">-	if (wrflow)</FONT>
<FONT COLOR="#000000">+	if (wrflow &amp;&amp; spi_max_width(starget))</FONT>
<FONT COLOR="#000000"> 		ppr_options |= MSG_EXT_PPR_WR_FLOW;</FONT>
<FONT COLOR="#000000"> </FONT>
<FONT COLOR="#000000"> 	ahd_compile_devinfo(&amp;devinfo, shost-&gt;this_id, starget-&gt;id, 0,</FONT>
<FONT COLOR="#000000">@@ -2567,7 +2570,7 @@ static void ahd_linux_set_rti(struct scsi_target *starget, int rti)</FONT>
<FONT COLOR="#000000"> 		       rti ? &quot;enabling&quot; : &quot;disabling&quot;);</FONT>
<FONT COLOR="#000000"> #endif</FONT>
<FONT COLOR="#000000"> </FONT>
<FONT COLOR="#000000">-	if (rti)</FONT>
<FONT COLOR="#000000">+	if (rti &amp;&amp; spi_max_width(starget))</FONT>
<FONT COLOR="#000000"> 		ppr_options |= MSG_EXT_PPR_RTI;</FONT>
<FONT COLOR="#000000"> </FONT>
<FONT COLOR="#000000"> 	ahd_compile_devinfo(&amp;devinfo, shost-&gt;this_id, starget-&gt;id, 0,</FONT>
<FONT COLOR="#000000">@@ -2603,7 +2606,7 @@ static void ahd_linux_set_pcomp_en(struct scsi_target *starget, int pcomp)</FONT>
<FONT COLOR="#000000"> 		       pcomp ? &quot;Enable&quot; : &quot;Disable&quot;);</FONT>
<FONT COLOR="#000000"> #endif</FONT>
<FONT COLOR="#000000"> </FONT>
<FONT COLOR="#000000">-	if (pcomp) {</FONT>
<FONT COLOR="#000000">+	if (pcomp &amp;&amp; spi_max_width(starget)) {</FONT>
<FONT COLOR="#000000"> 		uint8_t precomp;</FONT>
<FONT COLOR="#000000"> </FONT>
<FONT COLOR="#000000"> 		if (ahd-&gt;unit &lt; ARRAY_SIZE(aic79xx_iocell_info)) {</FONT>
<FONT COLOR="#000000">@@ -2647,7 +2650,7 @@ static void ahd_linux_set_hold_mcs(struct scsi_target *starget, int hold)</FONT>
<FONT COLOR="#000000"> 	unsigned int dt = ppr_options &amp; MSG_EXT_PPR_DT_REQ;</FONT>
<FONT COLOR="#000000"> 	unsigned long flags;</FONT>
<FONT COLOR="#000000"> </FONT>
<FONT COLOR="#000000">-	if (hold)</FONT>
<FONT COLOR="#000000">+	if (hold &amp;&amp; spi_max_width(starget))</FONT>
<FONT COLOR="#000000"> 		ppr_options |= MSG_EXT_PPR_HOLD_MCS;</FONT>
<FONT COLOR="#000000"> </FONT>
<FONT COLOR="#000000"> 	ahd_compile_devinfo(&amp;devinfo, shost-&gt;this_id, starget-&gt;id, 0,</FONT>
<FONT COLOR="#000000">diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c</FONT>
<FONT COLOR="#000000">index 1803ab6..2e9c38f 100644</FONT>
<FONT COLOR="#000000">--- a/drivers/scsi/aic7xxx/aic7xxx_osm.c</FONT>
<FONT COLOR="#000000">+++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c</FONT>
<FONT COLOR="#000000">@@ -2317,8 +2317,13 @@ static void ahc_linux_set_period(struct scsi_target *starget, int period)</FONT>
<FONT COLOR="#000000"> </FONT>
<FONT COLOR="#000000"> 	if (period &lt; 9)</FONT>
<FONT COLOR="#000000"> 		period = 9;	/* 12.5ns is our minimum */</FONT>
<FONT COLOR="#000000">-	if (period == 9)</FONT>
<FONT COLOR="#000000">-		ppr_options |= MSG_EXT_PPR_DT_REQ;</FONT>
<FONT COLOR="#000000">+	if (period == 9) {</FONT>
<FONT COLOR="#000000">+		if (spi_max_width(starget))</FONT>
<FONT COLOR="#000000">+			ppr_options |= MSG_EXT_PPR_DT_REQ;</FONT>
<FONT COLOR="#000000">+		else</FONT>
<FONT COLOR="#000000">+			/* need wide for DT and need DT for 12.5 ns */</FONT>
<FONT COLOR="#000000">+			period = 10;</FONT>
<FONT COLOR="#000000">+	}</FONT>
<FONT COLOR="#000000"> </FONT>
<FONT COLOR="#000000"> 	ahc_compile_devinfo(&amp;devinfo, shost-&gt;this_id, starget-&gt;id, 0,</FONT>
<FONT COLOR="#000000"> 			    starget-&gt;channel + 'A', ROLE_INITIATOR);</FONT>
<FONT COLOR="#000000">@@ -2381,7 +2386,7 @@ static void ahc_linux_set_dt(struct scsi_target *starget, int dt)</FONT>
<FONT COLOR="#000000"> 	unsigned long flags;</FONT>
<FONT COLOR="#000000"> 	struct ahc_syncrate *syncrate;</FONT>
<FONT COLOR="#000000"> </FONT>
<FONT COLOR="#000000">-	if (dt) {</FONT>
<FONT COLOR="#000000">+	if (dt &amp;&amp; spi_max_width(starget)) {</FONT>
<FONT COLOR="#000000"> 		ppr_options |= MSG_EXT_PPR_DT_REQ;</FONT>
<FONT COLOR="#000000"> 		if (!width)</FONT>
<FONT COLOR="#000000"> 			ahc_linux_set_width(starget, 1);</FONT>


</PRE>
</BLOCKQUOTE>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
James D. Freels, Ph.D.<BR>
Senior Research Staff, HFIR Cold Source, ORNL<BR>
<A HREF="http://sunsite.utk.edu/wuot/mt/podcast/051807HIFER.mp3">http://sunsite.utk.edu/wuot/mt/podcast/051807HIFER.mp3</A>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
Comment 15 Anonymous Emailer 2007-07-26 14:35:06 UTC
Reply-To: James.Bottomley@SteelEye.com

On Thu, 2007-07-26 at 17:16 -0400, Freels, James D. wrote:
> James, I would be glad to try the fix.  I can grab the changes below,
> but can you give me the patch command ?  I know how to patch the
> normal kernel sources.  Is this a patch for 2.6.22.1 ?

It was created against current git, but there should be little
difference in the aic driver between that and 2.6.22.1, so it should
apply there as well.

> cd /usr/src/linux-2.6.22.1
> 
> patch -p1 <../your_new_patch
> 
> where your_new_patch is in /usr/src  

Yes, that should do it.

James
Comment 16 James D Freels 2007-07-26 14:43:51 UTC
Here is what I get when I apply the patch against the vanilla 2.6.22.1
source:

fea8:/usr/src/linux-2.6.22.1# patch -p1 <../new_aic_patch
patching file drivers/scsi/aic7xxx/aic79xx_osm.c
Hunk #1 FAILED at 2284.
Hunk #2 FAILED at 2368.
Hunk #3 FAILED at 2450.
Hunk #4 FAILED at 2490.
Hunk #5 FAILED at 2526.
Hunk #6 FAILED at 2570.
Hunk #7 FAILED at 2606.
Hunk #8 FAILED at 2650.
8 out of 8 hunks FAILED -- saving rejects to file
drivers/scsi/aic7xxx/aic79xx_osm.c.rej
patching file drivers/scsi/aic7xxx/aic7xxx_osm.c
Hunk #1 FAILED at 2317.
Hunk #2 FAILED at 2386.
2 out of 2 hunks FAILED -- saving rejects to file
drivers/scsi/aic7xxx/aic7xxx_osm.c.rej
fea8:/usr/src/linux-2.6.22.1# 

Here are the contents is the last reject file (probably similar for
all):

drivers/scsi/aic7xxx/aic7xxx_osm.c.rej

*************** static void ahc_linux_set_period(struct scsi_target
*starget, int period)
*** 2317,2324 ****
  
         if (period < 9)
                 period = 9;     /* 12.5ns is our minimum */
-        if (period == 9)
-                ppr_options |= MSG_EXT_PPR_DT_REQ;
  
         ahc_compile_devinfo(&devinfo, shost->this_id, starget->id, 0,
                             starget->channel + 'A', ROLE_INITIATOR);
--- 2317,2329 ----
  
         if (period < 9)
                 period = 9;     /* 12.5ns is our minimum */
+        if (period == 9) {
+                if (spi_max_width(starget))
+                        ppr_options |= MSG_EXT_PPR_DT_REQ;
+                else
+                        /* need wide for DT and need DT for 12.5 ns */
+                        period = 10;
+        }
  
         ahc_compile_devinfo(&devinfo, shost->this_id, starget->id, 0,
                             starget->channel + 'A', ROLE_INITIATOR);
*************** static void ahc_linux_set_dt(struct scsi_target
*starget, int dt)
*** 2381,2387 ****
         unsigned long flags;
         struct ahc_syncrate *syncrate;
  
-        if (dt) {
                 ppr_options |= MSG_EXT_PPR_DT_REQ;
                 if (!width)
                         ahc_linux_set_width(starget, 1);
--- 2386,2392 ----
         unsigned long flags;
         struct ahc_syncrate *syncrate;
  
+        if (dt && spi_max_width(starget)) {
                 ppr_options |= MSG_EXT_PPR_DT_REQ;
                 if (!width)
                         ahc_linux_set_width(starget, 1);



On Thu, 2007-07-26 at 17:29 -0400, James Bottomley wrote:
> On Thu, 2007-07-26 at 17:16 -0400, Freels, James D. wrote:
> > James, I would be glad to try the fix.  I can grab the changes below,
> > but can you give me the patch command ?  I know how to patch the
> > normal kernel sources.  Is this a patch for 2.6.22.1 ?
> 
> It was created against current git, but there should be little
> difference in the aic driver between that and 2.6.22.1, so it should
> apply there as well.
> 
> > cd /usr/src/linux-2.6.22.1
> > 
> > patch -p1 <../your_new_patch
> > 
> > where your_new_patch is in /usr/src  
> 
> Yes, that should do it.
> 
> James
> 
> 
James D. Freels, Ph.D.
Senior Research Staff, HFIR Cold Source, ORNL
http://sunsite.utk.edu/wuot/mt/podcast/051807HIFER.mp3
Comment 17 Anonymous Emailer 2007-07-26 14:50:41 UTC
Reply-To: James.Bottomley@SteelEye.com

On Thu, 2007-07-26 at 17:37 -0400, Freels, James D. wrote:
> Here is what I get when I apply the patch against the vanilla 2.6.22.1
> source:

The reject files all have spaces instead of tabs, so it looks like your
mailer did some nefarious translation.

Try the attachment ... that usually defeats mailer text translations.

the md5sum just for integrity's sake is 9ba6ace80c06d34b5391407ea68c381a

I tested it against 2.6.22.1 and it applies (but with some offsets):

jejb@hobholes> quilt push
Applying patch tmp.diff
patching file drivers/scsi/aic7xxx/aic79xx_osm.c
Hunk #1 succeeded at 2309 (offset 25 lines).
Hunk #2 succeeded at 2393 (offset 25 lines).
Hunk #3 succeeded at 2475 (offset 25 lines).
Hunk #4 succeeded at 2515 (offset 25 lines).
Hunk #5 succeeded at 2551 (offset 25 lines).
Hunk #6 succeeded at 2595 (offset 25 lines).
Hunk #7 succeeded at 2631 (offset 25 lines).
Hunk #8 succeeded at 2675 (offset 25 lines).
patching file drivers/scsi/aic7xxx/aic7xxx_osm.c
Hunk #1 succeeded at 2356 (offset 39 lines).
Hunk #2 succeeded at 2425 (offset 39 lines).

James

diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c
index 286ab83..641dc4e 100644
--- a/drivers/scsi/aic7xxx/aic79xx_osm.c
+++ b/drivers/scsi/aic7xxx/aic79xx_osm.c
@@ -2284,9 +2284,12 @@ static void ahd_linux_set_period(struct scsi_target *starget, int period)
 	if (period < 8)
 		period = 8;
 	if (period < 10) {
-		ppr_options |= MSG_EXT_PPR_DT_REQ;
-		if (period == 8)
-			ppr_options |= MSG_EXT_PPR_IU_REQ;
+		if (spi_max_width(starget)) {
+			ppr_options |= MSG_EXT_PPR_DT_REQ;
+			if (period == 8)
+				ppr_options |= MSG_EXT_PPR_IU_REQ;
+		} else 
+			period = 10;
 	}
 
 	dt = ppr_options & MSG_EXT_PPR_DT_REQ;
@@ -2365,7 +2368,7 @@ static void ahd_linux_set_dt(struct scsi_target *starget, int dt)
 		printf("%s: %s DT\n", ahd_name(ahd), 
 		       dt ? "enabling" : "disabling");
 #endif
-	if (dt) {
+	if (dt && spi_max_width(starget)) {
 		ppr_options |= MSG_EXT_PPR_DT_REQ;
 		if (!width)
 			ahd_linux_set_width(starget, 1);
@@ -2447,7 +2450,7 @@ static void ahd_linux_set_iu(struct scsi_target *starget, int iu)
 		       iu ? "enabling" : "disabling");
 #endif
 
-	if (iu) {
+	if (iu && spi_max_width(starget)) {
 		ppr_options |= MSG_EXT_PPR_IU_REQ;
 		ppr_options |= MSG_EXT_PPR_DT_REQ; /* IU requires DT */
 	}
@@ -2487,7 +2490,7 @@ static void ahd_linux_set_rd_strm(struct scsi_target *starget, int rdstrm)
 		       rdstrm  ? "enabling" : "disabling");
 #endif
 
-	if (rdstrm)
+	if (rdstrm && spi_max_width(starget))
 		ppr_options |= MSG_EXT_PPR_RD_STRM;
 
 	ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0,
@@ -2523,7 +2526,7 @@ static void ahd_linux_set_wr_flow(struct scsi_target *starget, int wrflow)
 		       wrflow ? "enabling" : "disabling");
 #endif
 
-	if (wrflow)
+	if (wrflow && spi_max_width(starget))
 		ppr_options |= MSG_EXT_PPR_WR_FLOW;
 
 	ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0,
@@ -2567,7 +2570,7 @@ static void ahd_linux_set_rti(struct scsi_target *starget, int rti)
 		       rti ? "enabling" : "disabling");
 #endif
 
-	if (rti)
+	if (rti && spi_max_width(starget))
 		ppr_options |= MSG_EXT_PPR_RTI;
 
 	ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0,
@@ -2603,7 +2606,7 @@ static void ahd_linux_set_pcomp_en(struct scsi_target *starget, int pcomp)
 		       pcomp ? "Enable" : "Disable");
 #endif
 
-	if (pcomp) {
+	if (pcomp && spi_max_width(starget)) {
 		uint8_t precomp;
 
 		if (ahd->unit < ARRAY_SIZE(aic79xx_iocell_info)) {
@@ -2647,7 +2650,7 @@ static void ahd_linux_set_hold_mcs(struct scsi_target *starget, int hold)
 	unsigned int dt = ppr_options & MSG_EXT_PPR_DT_REQ;
 	unsigned long flags;
 
-	if (hold)
+	if (hold && spi_max_width(starget))
 		ppr_options |= MSG_EXT_PPR_HOLD_MCS;
 
 	ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0,
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c
index 1803ab6..2e9c38f 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c
@@ -2317,8 +2317,13 @@ static void ahc_linux_set_period(struct scsi_target *starget, int period)
 
 	if (period < 9)
 		period = 9;	/* 12.5ns is our minimum */
-	if (period == 9)
-		ppr_options |= MSG_EXT_PPR_DT_REQ;
+	if (period == 9) {
+		if (spi_max_width(starget))
+			ppr_options |= MSG_EXT_PPR_DT_REQ;
+		else
+			/* need wide for DT and need DT for 12.5 ns */
+			period = 10;
+	}
 
 	ahc_compile_devinfo(&devinfo, shost->this_id, starget->id, 0,
 			    starget->channel + 'A', ROLE_INITIATOR);
@@ -2381,7 +2386,7 @@ static void ahc_linux_set_dt(struct scsi_target *starget, int dt)
 	unsigned long flags;
 	struct ahc_syncrate *syncrate;
 
-	if (dt) {
+	if (dt && spi_max_width(starget)) {
 		ppr_options |= MSG_EXT_PPR_DT_REQ;
 		if (!width)
 			ahc_linux_set_width(starget, 1);
Comment 18 Anonymous Emailer 2007-07-26 14:53:40 UTC
Reply-To: akpm@linux-foundation.org

On Thu, 26 Jul 2007 14:38:06 -0700 (PDT) bugme-daemon@bugzilla.kernel.org wrote:

> Here is what I get when I apply the patch against the vanilla 2.6.22.1
> source:
> 
> fea8:/usr/src/linux-2.6.22.1# patch -p1 <../new_aic_patch

bugilla probably converted tabs to spaces.  Use `patch -p1 -l < ../new_aic_patch'
Comment 19 James D Freels 2007-07-26 14:58:06 UTC
Thanks James.  It patched this time, compiled, and is now rebooting.  I
have a backup running tonight at 1am.  I will report back in.

This would be great if it fixes it.  I also have another similar bug
with the aic79xx driver on another machine (see my other bug reports).
I wonder if this will fix it also ?

On Thu, 2007-07-26 at 17:44 -0400, James Bottomley wrote:
> On Thu, 2007-07-26 at 17:37 -0400, Freels, James D. wrote:
> > Here is what I get when I apply the patch against the vanilla 2.6.22.1
> > source:
> 
> The reject files all have spaces instead of tabs, so it looks like your
> mailer did some nefarious translation.
> 
> Try the attachment ... that usually defeats mailer text translations.
> 
> the md5sum just for integrity's sake is 9ba6ace80c06d34b5391407ea68c381a
> 
> I tested it against 2.6.22.1 and it applies (but with some offsets):
> 
> jejb@hobholes> quilt push
> Applying patch tmp.diff
> patching file drivers/scsi/aic7xxx/aic79xx_osm.c
> Hunk #1 succeeded at 2309 (offset 25 lines).
> Hunk #2 succeeded at 2393 (offset 25 lines).
> Hunk #3 succeeded at 2475 (offset 25 lines).
> Hunk #4 succeeded at 2515 (offset 25 lines).
> Hunk #5 succeeded at 2551 (offset 25 lines).
> Hunk #6 succeeded at 2595 (offset 25 lines).
> Hunk #7 succeeded at 2631 (offset 25 lines).
> Hunk #8 succeeded at 2675 (offset 25 lines).
> patching file drivers/scsi/aic7xxx/aic7xxx_osm.c
> Hunk #1 succeeded at 2356 (offset 39 lines).
> Hunk #2 succeeded at 2425 (offset 39 lines).
> 
> James
> 
James D. Freels, Ph.D.
Senior Research Staff, HFIR Cold Source, ORNL
http://sunsite.utk.edu/wuot/mt/podcast/051807HIFER.mp3
Comment 20 James D Freels 2007-07-26 15:04:07 UTC
OK.  Booted up great.  Found the media changer.  Here is the output from
the check you asked for:

target0:0:3: Beginning Domain Validation
target0:0:3: asynchronous
target0:0:3: FAST-20 SCSI 20.0 MB/s ST (50 ns, offset 32)
target0:0:3: Domain Validation skipping write tests
target0:0:3: Ending Domain Validation

output from amanda checks out OK:

fea8::/home/amanda/: mt status
SCSI 2 tape drive:
File number=0, block number=0, partition=0.
Tape block size 65536 bytes. Density code 0x81 (DLT 15GB compressed).
Soft error count since last status=0
General status bits on (41010000):
 BOT ONLINE IM_REP_EN
fea8::/home/amanda/: amcheck rrd
Amanda Tape Server Host Check
-----------------------------
Holding disk /holding_disk: 61245156 kB disk space available, using
60817408 kB as requested
slot 4: read label `rrd31', date `X'
NOTE: skipping tape-writable test
Tape rrd31 label ok
Server check took 19.264 seconds

Amanda Backup Client Hosts Check
--------------------------------
Client check: 4 hosts checked in 0.237 seconds, 0 problems found

(brought to you by Amanda 2.5.1p3)


It could never do this before.  True test will be tonight when backing
up about 20-60 GB.  Will report back in.

Thanks again.

On Thu, 2007-07-26 at 17:44 -0400, James Bottomley wrote:
> On Thu, 2007-07-26 at 17:37 -0400, Freels, James D. wrote:
> > Here is what I get when I apply the patch against the vanilla 2.6.22.1
> > source:
> 
> The reject files all have spaces instead of tabs, so it looks like your
> mailer did some nefarious translation.
> 
> Try the attachment ... that usually defeats mailer text translations.
> 
> the md5sum just for integrity's sake is 9ba6ace80c06d34b5391407ea68c381a
> 
> I tested it against 2.6.22.1 and it applies (but with some offsets):
> 
> jejb@hobholes> quilt push
> Applying patch tmp.diff
> patching file drivers/scsi/aic7xxx/aic79xx_osm.c
> Hunk #1 succeeded at 2309 (offset 25 lines).
> Hunk #2 succeeded at 2393 (offset 25 lines).
> Hunk #3 succeeded at 2475 (offset 25 lines).
> Hunk #4 succeeded at 2515 (offset 25 lines).
> Hunk #5 succeeded at 2551 (offset 25 lines).
> Hunk #6 succeeded at 2595 (offset 25 lines).
> Hunk #7 succeeded at 2631 (offset 25 lines).
> Hunk #8 succeeded at 2675 (offset 25 lines).
> patching file drivers/scsi/aic7xxx/aic7xxx_osm.c
> Hunk #1 succeeded at 2356 (offset 39 lines).
> Hunk #2 succeeded at 2425 (offset 39 lines).
> 
> James
> 
James D. Freels, Ph.D.
Senior Research Staff, HFIR Cold Source, ORNL
http://sunsite.utk.edu/wuot/mt/podcast/051807HIFER.mp3
Comment 21 James D Freels 2007-07-27 06:07:57 UTC
Worked great.  Backed up 21.2 GB in about 1hr-20min. without error.

when do you think this patch will make it into the main tree ? i.e., how
long should I hold on to this patch ?

On Thu, 2007-07-26 at 17:57 -0400, Freels, James D. wrote:
>  True test will be tonight when backing
> up about 20-60 GB.  Will report back in.
> 
> Thanks again.


James D. Freels, Ph.D.
Senior Research Staff, HFIR Cold Source, ORNL
http://sunsite.utk.edu/wuot/mt/podcast/051807HIFER.mp3
Comment 22 Anonymous Emailer 2007-07-27 06:10:09 UTC
Reply-To: James.Bottomley@SteelEye.com

On Fri, 2007-07-27 at 09:00 -0400, Freels, James D. wrote:
> Worked great.  Backed up 21.2 GB in about 1hr-20min. without error.
> 
> when do you think this patch will make it into the main tree ? i.e., how
> long should I hold on to this patch ?

Should be in 2.6.23-rc2 ... assuming I don't misguess when Linus will
declare that.

James
Comment 23 Joachim Frieben 2007-07-28 01:58:34 UTC
(In reply to comment #2)
> I noticed the version number was v6.3.11 for the aic-7xxx driver and v2.0.26
> for the aic-79xx driver and both released on 4/26/2007. These versions/dates
> are far beyond the versions/dates shown for this driver in the 2.6.21.5
> kernel
> (8/4/2005 for aic-7xxx and 12/11/2005 for aic-79xx v2.0.15 11 versions
> behind).

Your statement is wrong. The current version of the aic7xxx driver is 7.0 as shown in the various logs that you have posted. The relase date of version 6.3.11 was December 23, 2004 according to README.aic7xxx included in Adaptec's tarball. Not really surprising that it doesn't build anymore.

Btw, remember to post long outputs as -attachments- please, because otherwise, bug reports become very messy as you can readily verify by scrolling the present one up and down. Thanks!

Note You need to log in before you can comment on or make changes to this bug.