Skip to contentSkip to conversation

aic79xx and aic7xxx driver issues

Bug 8366 James Bottomley 2 participants 10 messages Jul 25, 2007 – Jul 26, 2007 3 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 5 lines · On Tue, 2007-07-24 at 18:05 -0700, [email protected] 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

Quoted 1 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

#3 lore raw
In reply to a message not in the archive
Quoted 8 lines · James D.

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.

Quoted 4 lines

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.

Quoted 84 lines
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:

Quoted 5 lines

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

Quoted 2 lines

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

#4 lore raw

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

#5 lore raw
Quoted 9 lines · James D.

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

Quoted 3 lines

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

#6 lore raw
Quoted 21 lines · James Bottomley
Quoted 9 lines · James D.

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

Quoted 3 lines

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

Quoted 6 lines

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

drivers/scsi/aic7xxx/aic79xx_osm.c +13 -10
index 286ab83..641dc4e 100644
@@ -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,
drivers/scsi/aic7xxx/aic7xxx_osm.c +8 -3
index 1803ab6..2e9c38f 100644
@@ -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);
#8 lore raw
In reply to a message not in the archive
Quoted 3 lines · James D.

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.

Quoted 5 lines

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

#9 lore raw

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);
Quoted 11 lines · James Bottomley
Quoted 3 lines · James D.

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.

Quoted 2 lines

cd /usr/src/linux-2.6.22.1

Quoted 9 lines
Quoted 3 lines

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

#10 lore raw
Quoted 2 lines · James D.

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

drivers/scsi/aic7xxx/aic79xx_osm.c +13 -10
index 286ab83..641dc4e 100644
@@ -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,
drivers/scsi/aic7xxx/aic7xxx_osm.c +8 -3
index 1803ab6..2e9c38f 100644
@@ -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);
#11 lore raw

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 ?

Quoted 28 lines · James Bottomley
Quoted 2 lines · James D.

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).

Quoted 2 lines

James

James D. Freels, Ph.D.
Senior Research Staff, HFIR Cold Source, ORNL
http://sunsite.utk.edu/wuot/mt/podcast/051807HIFER.mp3

#12 lore raw
In reply to James Bottomley

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.

Quoted 28 lines · James Bottomley
Quoted 2 lines · James D.

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).

Quoted 2 lines

James

James D. Freels, Ph.D.
Senior Research Staff, HFIR Cold Source, ORNL
http://sunsite.utk.edu/wuot/mt/podcast/051807HIFER.mp3