Skip to contentSkip to conversation

linux-2.6.10-pa1 panic on C360 in SCSI driver

parisc-linux Mike Frysinger 6 participants 22 messages Dec 26, 2004 – Jan 4, 2005 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

seems to be a new bug because building a 2.6.8.1-pa7 kernel with same .config works fine while a 2.6.10-pa1 panics ;(

find attached:
2.6.10-pa1-scsi-panic - dmesg output from scsi driver up through panic 2.6.8.1-pa11-dmesg - scsi dmesg output from a good kernel config.bz2 - my .config from 2.6.10-pa1

build system:
gcc-3.3.5 + binutils-2.15.92.0.2
-mike

sym0: <875> rev 0x4 at pci 0000:00:13.0 irq 99
sym0: No NVRAM, ID 7, Fast-20, SE, parity checking
sym0: SCSI BUS has been reset.
scsi0 : sym-2.1.18m
elevator: using anticipatory as default io scheduler
Vendor: IBM Model: DDRS-34560WS Rev: HP01
Type: Direct-Access ANSI SCSI revision: 02
sym0:6:0: tagged command queuing enabled, command queue depth 16.
target0:0:6: Beginning Domain Validation
sym0:6: wide asynchronous.
sym0:6: FAST-20 WIDE SCSI 40.0 MB/s ST (50.0 ns, offset 15)
target0:0:6: Domain Validation skipping write tests target0:0:6: Ending Domain Validation
sym0:9: FAST-20 WIDE SCSI 40.0 MB/s ST (50.0 ns, offset 16)
Vendor: WDIGTL Model: WDE9150 ULTRA3 Rev: 1.30
Type: Direct-Access ANSI SCSI revision: 03
sym0:9:0: tagged command queuing enabled, command queue depth 16.
target0:0:9: Beginning Domain Validation
sym0:9: asynchronous.
sym0:9: wide asynchronous.

Backtrace:
 [<102a51a8>] sym_ppr_nego+0x44/0xe0
 [<1029d6ec>] sym53c8xx_intr+0x30/0x80
 [<10106ca8>] do_irq+0x158/0x160
 [<102424d4>] dino_isr+0xf0/0x100
 [<10106ca8>] do_irq+0x158/0x160
 [<10106dac>] do_cpu_irq_mask+0xfc/0x10c
 [<1010c068>] intr_return+0x0/0x14
 [<1022ab20>] idr_get_new_above_int+0x98/0x15c
 [<1017442c>] generic_permission+0xa8/0x1a0
 [<10162ca0>] shmem_symlink+0x1d8/0x244
 [<1017758c>] vfs_rmdir+0x12c/0x254
 [<10112744>] cpu_idle+0x38/0x3c
 [<10440804>] start_kernel+0x1b8/0x1e4

Kernel Fault: Code=13 regs=10434640 (Addr=00000000)

YZrvWESTHLNXBCVMcbcbcbcbOGFRQPDI
PSW: 00000000000001001111111100001110 Not tainted

r00-03  00000000 ffffffff 104345c8 00000000
r04-07  10fbd000 00000000 00000010 00000001
r08-11  0000000a 10fbd310 00000009 00000000
r12-15  103ff810 00000000 000000fd f0100000
r16-19  10434140 f0000154 f000014c 02625a00
r20-23  fffffffc 00000000 ffffffff 104345c9
r24-27  0000000a 00000000 01312cff 103d3010
r28-31  000000fa 10400188 10434640 102a0810
sr0-3   00000000 00000000 00000000 00000000
sr4-7   00000000 00000000 00000000 00000000

IASQ: 00000000 00000000 IAOQ: 1023112c 10231130
IIR: b3202000 ISR: 10240001 IOR: 0d034630
CPU: 0 CR30: 10434000 CR31: 10438000
ORIG_R28: 00000000
IAOQ[0]: $$divU+0xc/0x210
IAOQ[1]: $$divU+0x10/0x210
RP(r2): 0x104345c8

Kernel panic - not syncing: Kernel Fault
 <0>Rebooting in 3 seconds..

sym0: <875> rev 0x4 at pci 0000:00:13.0 irq 99
sym0: No NVRAM, ID 7, Fast-20, SE, parity checking
sym0: SCSI BUS has been reset.
scsi0 : sym-2.1.18j
Using anticipatory io scheduler
Vendor: IBM Model: DDRS-34560WS Rev: HP01
Type: Direct-Access ANSI SCSI revision: 02
sym0:6:0: tagged command queuing enabled, command queue depth 16. scsi(0:0:6:0): Beginning Domain Validation
sym0:6: wide asynchronous.
sym0:6: FAST-20 WIDE SCSI 40.0 MB/s ST (50.0 ns, offset 15) scsi(0:0:6:0): Domain Validation skipping write tests scsi(0:0:6:0): Ending Domain Validation
sym0:9: FAST-20 WIDE SCSI 40.0 MB/s ST (50.0 ns, offset 16)
Vendor: WDIGTL Model: WDE9150 ULTRA3 Rev: 1.30
Type: Direct-Access ANSI SCSI revision: 03
sym0:9:0: tagged command queuing enabled, command queue depth 16. scsi(0:0:9:0): Beginning Domain Validation
sym0:9: FAST-20 SCSI 20.0 MB/s ST (50.0 ns, offset 16) sym0:9: FAST-20 WIDE SCSI 40.0 MB/s ST (50.0 ns, offset 16) scsi(0:0:9:0): Write Buffer failure 8000002
scsi(0:0:9:0): Domain Validation detected failure, dropping back sym0:9: FAST-10 WIDE SCSI 20.0 MB/s ST (100.0 ns, offset 16) scsi(0:0:9:0): Write Buffer failure 8000002
scsi(0:0:9:0): Domain Validation detected failure, dropping back sym0:9: FAST-10 WIDE SCSI 13.5 MB/s ST (148.0 ns, offset 16) scsi(0:0:9:0): Write Buffer failure 8000002
scsi(0:0:9:0): Domain Validation detected failure, dropping back sym0:9: FAST-5 WIDE SCSI 8.9 MB/s ST (224.0 ns, offset 16) scsi(0:0:9:0): Write Buffer failure 8000002
scsi(0:0:9:0): Domain Validation detected failure, dropping back sym0:9: wide asynchronous.
sym0:9:0:M_REJECT to send for : 1-3-1-57-10.
sym0:9: FAST-20 WIDE SCSI 40.0 MB/s ST (50.0 ns, offset 16) scsi(0:0:9:0): Write Buffer failure 8000002
scsi(0:0:9:0): Domain Validation detected failure, dropping back sym0:9: wide asynchronous.
sym0:9: FAST-20 WIDE SCSI 40.0 MB/s ST (50.0 ns, offset 16) scsi(0:0:9:0): Write Buffer failure 8000002
scsi(0:0:9:0): Domain Validation detected failure, dropping back sym0:9: wide asynchronous.
sym0:9: FAST-20 WIDE SCSI 40.0 MB/s ST (50.0 ns, offset 16) scsi(0:0:9:0): Write Buffer failure 8000002
scsi(0:0:9:0): Domain Validation Failure, dropping back to Asynchronous scsi(0:0:9:0): Ending Domain Validation
sym0:9: wide asynchronous.
53c700: Version 2.8 By [email protected]
scsi1: 53c710 rev 2
scsi1 : LASI SCSI 53c700
Vendor: TOSHIBA Model: CD-ROM XM-5301TA Rev: 1895
Type: CD-ROM ANSI SCSI revision: 02
scsi(1:0:2:0): Beginning Domain Validation
scsi1: (2:0) Asynchronous
scsi1: (2:0) Synchronous at offset 8, period 236ns scsi(1:0:2:0): Domain Validation skipping write tests scsi(1:0:2:0): Ending Domain Validation
SCSI device sda: 8388314 512-byte hdwr sectors (4295 MB) SCSI device sda: drive cache: write back
sda: sda1 sda2 sda3 sda4
Attached scsi disk sda at scsi0, channel 0, id 6, lun 0
SCSI device sdb: 17873040 512-byte hdwr sectors (9151 MB) SCSI device sdb: drive cache: write back
sdb: unknown partition table
Attached scsi disk sdb at scsi0, channel 0, id 9, lun 0
sr0: scsi-1 drive
Uniform CD-ROM driver Revision: 3.20
Attached scsi CD-ROM sr0 at scsi1, channel 0, id 2, lun 0

Attached scsi generic sg0 at scsi0, channel 0, id 6, lun 0,  type 0
Attached scsi generic sg1 at scsi0, channel 0, id 9, lun 0,  type 0
Attached scsi generic sg2 at scsi1, channel 0, id 2, lun 0,  type 5

STI GSC/PCI core graphics driver Version 0.9a
STI PCI graphic ROM found at f1ff0000 (64 kB), fb at f6000000 (32 MB)
id 2d08c0a7-9a02587, conforms to spec rev. 8.0a graphics card name: PCI_GRAFFITIX1280

_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

#1 lore raw
Quoted 2 lines · Mike Frysinger

seems to be a new bug because building a 2.6.8.1-pa7 kernel with same .config works fine while a 2.6.10-pa1 panics ;(

I suspect any 2.6.9 kernel will work fine and some of the earlier 2.6.10-rc too. At some stage, I may invite you to do a binary search to figure out what patch caused this problem ... but see below first.

Quoted 2 lines

2.6.10-pa1-scsi-panic - dmesg output from scsi driver up through panic 2.6.8.1-pa11-dmesg - scsi dmesg output from a good kernel

This is good -- very helpful.

Quoted 2 lines

sym0: <875> rev 0x4 at pci 0000:00:13.0 irq 99
sym0: No NVRAM, ID 7, Fast-20, SE, parity checking

The 875 only supports wide ultra scsi (ie, FAST-20, 40MB/s).

Quoted 5 lines

target0:0:6: Beginning Domain Validation
sym0:6: wide asynchronous.
sym0:6: FAST-20 WIDE SCSI 40.0 MB/s ST (50.0 ns, offset 15)
target0:0:6: Domain Validation skipping write tests target0:0:6: Ending Domain Validation

... successful negotiation with the IBM drive

Quoted 11 lines

sym0:9: FAST-20 WIDE SCSI 40.0 MB/s ST (50.0 ns, offset 16)
Vendor: WDIGTL Model: WDE9150 ULTRA3 Rev: 1.30
Type: Direct-Access ANSI SCSI revision: 03
sym0:9:0: tagged command queuing enabled, command queue depth 16.
target0:0:9: Beginning Domain Validation
sym0:9: asynchronous.
sym0:9: wide asynchronous.

Backtrace:
 [<102a51a8>] sym_ppr_nego+0x44/0xe0
 [<1029d6ec>] sym53c8xx_intr+0x30/0x80
 [<10106ca8>] do_irq+0x158/0x160

... we got an interrupt and died processing it.

Quoted 1 line

Kernel Fault: Code=13 regs=10434640 (Addr=00000000)

13 Conditional trap

Quoted 2 lines

IAOQ[0]: $$divU+0xc/0x210
IAOQ[1]: $$divU+0x10/0x210

I guess we tried to divide by zero.

Looking at the stack dump (a couple of layers are missing, is this because of tail-call optimisations?), we received a PPR message from the device. Now, devices aren't supposed to send unsolicited PPR messages, so either we're mistakenly asking it to do PPR or the device is breaking the spec.

Let's find out which; can you enable negotiation debugging by passing:

sym53c8xx.debug=0x200

on the kernel command line? If it's a module, then do:

modprobe sym53c8xx debug=0x200

[2.6.8.1-pa9 boot log]:

Quoted 12 lines

sym0: <875> rev 0x4 at pci 0000:00:13.0 irq 99
sym0: No NVRAM, ID 7, Fast-20, SE, parity checking

sym0:9: FAST-20 WIDE SCSI 40.0 MB/s ST (50.0 ns, offset 16)
Vendor: WDIGTL Model: WDE9150 ULTRA3 Rev: 1.30
Type: Direct-Access ANSI SCSI revision: 03
sym0:9:0: tagged command queuing enabled, command queue depth 16. scsi(0:0:9:0): Beginning Domain Validation
sym0:9: FAST-20 SCSI 20.0 MB/s ST (50.0 ns, offset 16) sym0:9: FAST-20 WIDE SCSI 40.0 MB/s ST (50.0 ns, offset 16) scsi(0:0:9:0): Write Buffer failure 8000002 scsi(0:0:9:0): Domain Validation detected failure, dropping back

Fascinating. Need to debug why this is going wrong ... but that's for a later time.

Signature · 10 lines
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain
_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
#2 lore raw
Quoted 9 lines · Matthew Wilcox
Quoted 1 line

Kernel Fault: Code=13 regs=10434640 (Addr=00000000)

13 Conditional trap

Quoted 2 lines

IAOQ[0]: $$divU+0xc/0x210
IAOQ[1]: $$divU+0x10/0x210

I guess we tried to divide by zero.

Interesting!

I've been seeing these while doing harmony work... That's pretty confusing. Hmm.

Cheers,
Kyle
_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

#3 lore raw
In reply to Matthew Wilcox

Hello all,

Quoted 14 lines · Matthew Wilcox
Quoted 1 line · Mike Frysinger

seems to be a new bug because building a 2.6.8.1-pa7 kernel with same .config works fine while a 2.6.10-pa1 panics ;(

I suspect any 2.6.9 kernel will work fine and some of the earlier 2.6.10-rc too. At some stage, I may invite you to do a binary search to figure out what patch caused this problem ... but see below first.

Quoted 2 lines

2.6.10-pa1-scsi-panic - dmesg output from scsi driver up through panic 2.6.8.1-pa11-dmesg - scsi dmesg output from a good kernel

Quoted 9 lines

This is good -- very helpful.

Quoted 2 lines

sym0: <875> rev 0x4 at pci 0000:00:13.0 irq 99
sym0: No NVRAM, ID 7, Fast-20, SE, parity checking

The 875 only supports wide ultra scsi (ie, FAST-20, 40MB/s).

I just tested new 2.6.10 on my i386 box with same scsi interface (hp supply):
[...]
PCI: Found IRQ 11 for device 0000:00:09.0
sym0: <875> rev 0x14 at pci 0000:00:09.0 irq 11
sym0: Symbios NVRAM, ID 7, Fast-20, HVD, parity checking
sym0: open drain IRQ line driver, using on-chip SRAM
sym0: using LOAD/STORE-based firmware.
sym0: SCSI BUS has been reset.
scsi0 : sym-2.1.18m
Vendor: SEAGATE Model: ST336605LSUN36G Rev: 0238
Type: Direct-Access ANSI SCSI revision: 03
sym0:6:0: tagged command queuing enabled, command queue depth 16.
target0:0:6: Beginning Domain Validation
sym0:6: wide asynchronous.
sym0:6: FAST-20 WIDE SCSI 40.0 MB/s ST (50.0 ns, offset 16)
target0:0:6: Ending Domain Validation
PCI: Found IRQ 5 for device 0000:00:09.1
PCI: Sharing IRQ 5 with 0000:00:0a.0
sym1: <875> rev 0x14 at pci 0000:00:09.1 irq 5
sym1: Symbios NVRAM, ID 7, Fast-20, HVD, parity checking
sym1: open drain IRQ line driver, using on-chip SRAM
sym1: using LOAD/STORE-based firmware.
sym1: SCSI BUS has been reset.
scsi1 : sym-2.1.18m
PCI: Found IRQ 5 for device 0000:00:0a.0
PCI: Sharing IRQ 5 with 0000:00:09.1
sym2: <875> rev 0x26 at pci 0000:00:0a.0 irq 5
sym2: Symbios NVRAM, ID 7, Fast-20, SE, parity checking
sym2: open drain IRQ line driver, using on-chip SRAM
sym2: using LOAD/STORE-based firmware.
sym2: SCAN FOR LUNS disabled for targets 0 1 2 3 4 5 6 8 9 10 11 12 13 14 15.
sym2: SCSI BUS has been reset.
scsi2 : sym-2.1.18m
Vendor: QUANTUM Model: ATLAS_V_18_WLS Rev: 0230
Type: Direct-Access ANSI SCSI revision: 03
sym2:0:0: tagged command queuing enabled, command queue depth 16.
target2:0:0: Beginning Domain Validation
sym2:0: wide asynchronous.
sym2:0: FAST-20 WIDE SCSI 40.0 MB/s ST (50.0 ns, offset 16)
target2:0:0: Ending Domain Validation
st: Version 20041025, fixed bufsize 32768, s/g segs 256
SCSI device sda: 71132959 512-byte hdwr sectors (36420 MB)
SCSI device sda: drive cache: write through
SCSI device sda: 71132959 512-byte hdwr sectors (36420 MB)
SCSI device sda: drive cache: write through
sda: sda1 sda2 sda3 sda4 < sda5 sda6 sda7 sda8 sda9 >
Attached scsi disk sda at scsi0, channel 0, id 6, lun 0
SCSI device sdb: 35861388 512-byte hdwr sectors (18361 MB)
SCSI device sdb: drive cache: write back
SCSI device sdb: 35861388 512-byte hdwr sectors (18361 MB)
SCSI device sdb: drive cache: write back
sdb: sdb1 sdb2 sdb3 sdb4 < sdb5 sdb6 sdb7 sdb8 sdb9 sdb10 >
Attached scsi disk sdb at scsi2, channel 0, id 0, lun 0
Attached scsi generic sg0 at scsi0, channel 0, id 6, lun 0, type 0 Attached scsi generic sg1 at scsi2, channel 0, id 0, lun 0, type 0 [...]

and all seems to works fine.

Is there difference between upstream kernel and pa cvs from sym2 driver point of view?

hth,
Joel
_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

#4 lore raw
Quoted 2 lines · Joel Soete

Is there difference between upstream kernel and pa cvs from sym2 driver point of view?

Yes, but the problem is with the Western Digital drive, so you can't provoke the problem.

Signature · 10 lines
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain
_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
#5 lore raw
Quoted 2 lines · Matthew Wilcox

Yes, but the problem is with the Western Digital drive, so you can't provoke the problem.

tried jejb's patch on irc:

sym_hipd.c 2004-12-27 16:33:50 -06:00 renamed from drivers/scsi/sym53c8xx_2/sym_hipd.c 2004-10-24 11:08:18 -05:00 +1 -1
@@ -4176,7 +4176,7 @@
 
        if (ofs) {
                unsigned char minsync = dt ? np->minsync_dt : np->minsync;
-               if (per < np->minsync_dt) {
+               if (per < minsync) {
                        chg = 1;
                        per = minsync;
                }

it didnt panic, but it looks like the kernel went into an infinite loop ...

find attached new dmesg
-mike

sym0: <875> rev 0x4 at pci 0000:00:13.0 irq 99
sym0: No NVRAM, ID 7, Fast-20, SE, parity checking
sym0: SCSI BUS has been reset.
scsi0 : sym-2.1.18m
elevator: using anticipatory as default io scheduler
Vendor: IBM Model: DDRS-34560WS Rev: HP01
Type: Direct-Access ANSI SCSI revision: 02
sym0:6:0: tagged command queuing enabled, command queue depth 16.
target0:0:6: Beginning Domain Validation
sym0:6:wide msgout: 1-2-3-1.
sym0:6:wide msgin: 1-2-3-1.
sym0:6:wdtr: wide=1 chg=0.
sym0:6:sync msgout: 1-3-1-c-0.
sym0:6:sync msgin: 1-3-1-c-0.
sym0:6:sdtr: ofs=0 per=12 div=0 fak=0 chg=0.
sym0:6: wide asynchronous.
sym0:6:sync msgout: 1-3-1-c-10.
sym0:6:sync msgin: 1-3-1-c-f.
sym0:6:sdtr: ofs=15 per=12 div=0 fak=0 chg=0.
sym0:6: FAST-20 WIDE SCSI 40.0 MB/s ST (50.0 ns, offset 15)
target0:0:6: Domain Validation skipping write tests target0:0:6: Ending Domain Validation
sym0:9:ppr msgin: 1-6-4-c-0-3f-1-2.
sym0:9: FAST-20 WIDE SCSI 40.0 MB/s ST (50.0 ns, offset 16) sym0:9:ppr msgout: 1-6-4-c-0-10-1-0.
Vendor: WDIGTL Model: WDE9150 ULTRA3 Rev: 1.30
Type: Direct-Access ANSI SCSI revision: 03
sym0:9:0: tagged command queuing enabled, command queue depth 16.
target0:0:9: Beginning Domain Validation
sym0:9:ppr msgout: 1-6-4-c-0-0-0-0.
sym0:9:ppr msgin: 1-6-4-a-0-0-0-0.
sym0:9: asynchronous.
sym0:9:ppr msgout: 1-6-4-c-0-0-1-0.
sym0:9:ppr msgin: 1-6-4-a-0-0-1-0.
sym0:9: wide asynchronous.
sym0:9:ppr msgout: 1-6-4-c-0-10-1-0.
sym0:9:ppr msgin: 1-6-4-a-0-10-1-0.
sym0:9: asynchronous.
sym0:9:0:M_REJECT to send for : 1-6-4-a-0-10-1-0. sym0:9:0: ABORT operation started.
sym0:9:0: ABORT operation timed-out.
sym0:9:0: DEVICE RESET operation started.
sym0:9:0: DEVICE RESET operation timed-out.
sym0:9:0: BUS RESET operation started.
sym0: SCSI BUS reset detected.
sym0: SCSI BUS has been reset.
sym0:9:0: BUS RESET operation complete.
sym0:9:ppr msgout: 1-6-4-c-0-10-1-0.
sym0:9:ppr msgin: 1-6-4-a-0-10-1-0.
sym0:9:0:M_REJECT to send for : 1-6-4-a-0-10-1-0. sym0:9:0: ABORT operation started.
sym0:9:0: ABORT operation timed-out.
sym0:9:0: HOST RESET operation started.
sym0: SCSI BUS has been reset.

_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

#6 lore raw
Quoted 1 line · Mike Frysinger

it didnt panic, but it looks like the kernel went into an infinite loop ...

Well, I think that's the fault of your drive:

Quoted 1 line

sym0:9:ppr msgout: 1-6-4-c-0-10-1-0.

This is where the 875 offers an offset of 16 at FAST-20 which is the best it can do.

Quoted 1 line

sym0:9:ppr msgin: 1-6-4-a-0-10-1-0.

This is where your WD says I accept your offer at offset 16 and FAST-40 (which is beyond the 875's capabilities).

This is illegal under the SCSI spec (you can only accept at a period of greater than the offer, not less than). The patch I gave you spots the problem and rejects the bogus offer. Unfortunately, apparently now the drive throws a wobbly and refuses to talk any more.

The question is how we coax it to negotiate within the rules...It's possible it would work correctly if the negotiation used WDTR and SDTR instead of PPR, so could you try the attached hack.

James

===== sym_hipd.c 1.22 vs edited =====

sym_hipd.c renamed from drivers/scsi/sym53c8xx_2/sym_hipd.c +1 -1
@@ -1538,7 +1538,7 @@
 	/*
 	 *  negotiate using PPR ?
 	 */
-	if (scsi_device_dt(sdev)) {
+	if (0 && scsi_device_dt(sdev)) {
 		nego = NS_PPR;
 	} else {
 		/*

_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

#7 lore raw
Quoted 1 line · James Bottomley

Well, I think that's the fault of your drive:

i make no claims that it's perfect :)

Quoted 5 lines

The question is how we coax it to negotiate within the rules...It's possible it would work correctly if the negotiation used WDTR and SDTR instead of PPR, so could you try the attached hack.
- if (scsi_device_dt(sdev)) {
+ if (0 && scsi_device_dt(sdev)) {

revereted the minsync patch (not sure if you guys wanted me to, but i did anyways) and applied this one ... worked much nicer from my perspective ;)

system booted and i can read the drive just fine ... find attached updated dmesg
-mike

sym0: <875> rev 0x4 at pci 0000:00:13.0 irq 99
sym0: No NVRAM, ID 7, Fast-20, SE, parity checking
sym0: SCSI BUS has been reset.
scsi0 : sym-2.1.18m
elevator: using anticipatory as default io scheduler
Vendor: IBM Model: DDRS-34560WS Rev: HP01
Type: Direct-Access ANSI SCSI revision: 02
sym0:6:0: tagged command queuing enabled, command queue depth 16.
target0:0:6: Beginning Domain Validation
sym0:6:wide msgout: 1-2-3-1.
sym0:6:wide msgin: 1-2-3-1.
sym0:6:wdtr: wide=1 chg=0.
sym0:6:sync msgout: 1-3-1-c-0.
sym0:6:sync msgin: 1-3-1-c-0.
sym0:6:sdtr: ofs=0 per=12 div=0 fak=0 chg=0.
sym0:6: wide asynchronous.
sym0:6:sync msgout: 1-3-1-c-10.
sym0:6:sync msgin: 1-3-1-c-f.
sym0:6:sdtr: ofs=15 per=12 div=0 fak=0 chg=0.
sym0:6: FAST-20 WIDE SCSI 40.0 MB/s ST (50.0 ns, offset 15)
target0:0:6: Domain Validation skipping write tests target0:0:6: Ending Domain Validation
sym0:9:ppr msgin: 1-6-4-c-0-3f-1-2.
sym0:9: FAST-20 WIDE SCSI 40.0 MB/s ST (50.0 ns, offset 16) sym0:9:ppr msgout: 1-6-4-c-0-10-1-0.
Vendor: WDIGTL Model: WDE9150 ULTRA3 Rev: 1.30
Type: Direct-Access ANSI SCSI revision: 03
sym0:9:0: tagged command queuing enabled, command queue depth 16.
target0:0:9: Beginning Domain Validation
sym0:9:wide msgout: 1-2-3-0.
sym0:9:wide msgin: 1-2-3-0.
sym0:9:wdtr: wide=0 chg=0.
sym0:9:sync msgin: 1-3-1-c-1f.
sym0:9:sdtr: ofs=16 per=12 div=0 fak=0 chg=1.
sym0:9: FAST-20 SCSI 20.0 MB/s ST (50.0 ns, offset 16) sym0:9:sync msgout: 1-3-1-c-10.
sym0:9:wide msgout: 1-2-3-1.
sym0:9:wide msgin: 1-2-3-1.
sym0:9:wdtr: wide=1 chg=0.
sym0:9:sync msgout: 1-3-1-c-10.
sym0:9:sync msgin: 1-3-1-c-10.
sym0:9:sdtr: ofs=16 per=12 div=0 fak=0 chg=0.
sym0:9: FAST-20 WIDE SCSI 40.0 MB/s ST (50.0 ns, offset 16) sym0:9:wide msgout: 1-2-3-1.
sym0:9:wide msgin: 1-2-3-1.
sym0:9:wdtr: wide=1 chg=0.
sym0:9:sync msgout: 1-3-1-c-10.
sym0:9:sync msgin: 1-3-1-c-10.
sym0:9:sdtr: ofs=16 per=12 div=0 fak=0 chg=0.
sym0:9:wide msgout: 1-2-3-1.
sym0:9:wide msgin: 1-2-3-1.
sym0:9:wdtr: wide=1 chg=0.
sym0:9:sync msgout: 1-3-1-c-10.
sym0:9:sync msgin: 1-3-1-c-10.
sym0:9:sdtr: ofs=16 per=12 div=0 fak=0 chg=0.
target0:0:9: Write Buffer failure 8000002
target0:0:9: Domain Validation detected failure, dropping back
sym0:9:sync msgout: 1-3-1-d-10.
sym0:9:sync msgin: 1-3-1-19-10.
sym0:9:sdtr: ofs=16 per=25 div=2 fak=0 chg=0.
sym0:9: FAST-10 WIDE SCSI 20.0 MB/s ST (100.0 ns, offset 16) sym0:9:wide msgout: 1-2-3-1.
sym0:9:wide msgin: 1-2-3-1.
sym0:9:wdtr: wide=1 chg=0.
sym0:9:sync msgout: 1-3-1-19-10.
sym0:9:sync msgin: 1-3-1-19-10.
sym0:9:sdtr: ofs=16 per=25 div=2 fak=0 chg=0.
target0:0:9: Write Buffer failure 8000002
target0:0:9: Domain Validation detected failure, dropping back
sym0:9:sync msgout: 1-3-1-25-10.
sym0:9:sync msgin: 1-3-1-25-10.
sym0:9:sdtr: ofs=16 per=37 div=2 fak=2 chg=0.
sym0:9: FAST-10 WIDE SCSI 13.5 MB/s ST (148.0 ns, offset 16) sym0:9:wide msgout: 1-2-3-1.
sym0:9:wide msgin: 1-2-3-1.
sym0:9:wdtr: wide=1 chg=0.
sym0:9:sync msgout: 1-3-1-25-10.
sym0:9:sync msgin: 1-3-1-25-10.
sym0:9:sdtr: ofs=16 per=37 div=2 fak=2 chg=0.
target0:0:9: Write Buffer failure 8000002
target0:0:9: Domain Validation detected failure, dropping back
sym0:9:sync msgout: 1-3-1-37-10.
sym0:9:sync msgin: 1-3-1-38-10.
sym0:9:sdtr: ofs=16 per=56 div=4 fak=1 chg=0.
sym0:9: FAST-5 WIDE SCSI 8.9 MB/s ST (224.0 ns, offset 16) sym0:9:wide msgout: 1-2-3-1.
sym0:9:wide msgin: 1-2-3-1.
sym0:9:wdtr: wide=1 chg=0.
sym0:9:sync msgout: 1-3-1-38-10.
sym0:9:sync msgin: 1-3-1-38-10.
sym0:9:sdtr: ofs=16 per=56 div=4 fak=1 chg=0.
target0:0:9: Write Buffer failure 8000002
target0:0:9: Domain Validation detected failure, dropping back
sym0:9:sync msgout: 1-3-1-54-10.
sym0:9:sync msgin: 1-3-1-57-10.
sym0:9: wide asynchronous.
sym0:9:0:M_REJECT to send for : 1-3-1-57-10.
sym0:9:sync msgout: 1-3-1-c-0.
sym0:9:sync msgin: 1-3-1-c-0.
sym0:9:sdtr: ofs=0 per=12 div=0 fak=0 chg=0.
target0:0:9: Write Buffer failure 8000002
target0:0:9: Domain Validation detected failure, dropping back
sym0:9:sync msgout: 1-3-1-7e-0.
sym0:9:sync msgin: 1-3-1-7e-0.
sym0:9:sdtr: ofs=0 per=126 div=0 fak=0 chg=0.
sym0:9:wide msgout: 1-2-3-1.
sym0:9:wide msgin: 1-2-3-1.
sym0:9:wdtr: wide=1 chg=0.
sym0:9:sync msgin: 1-3-1-c-1f.
sym0:9:sdtr: ofs=16 per=12 div=0 fak=0 chg=1.
sym0:9: FAST-20 WIDE SCSI 40.0 MB/s ST (50.0 ns, offset 16) sym0:9:sync msgout: 1-3-1-c-10.
target0:0:9: Write Buffer failure 8000002
target0:0:9: Domain Validation detected failure, dropping back
sym0:9:sync msgout: 1-3-1-89-10.
sym0:9:sync msgin: 1-3-1-89-0.
sym0:9:sdtr: ofs=0 per=137 div=0 fak=0 chg=0.
sym0:9: wide asynchronous.
sym0:9:wide msgout: 1-2-3-1.
sym0:9:wide msgin: 1-2-3-1.
sym0:9:wdtr: wide=1 chg=0.
sym0:9:sync msgin: 1-3-1-c-1f.
sym0:9:sdtr: ofs=16 per=12 div=0 fak=0 chg=1.
sym0:9: FAST-20 WIDE SCSI 40.0 MB/s ST (50.0 ns, offset 16) sym0:9:sync msgout: 1-3-1-c-10.
target0:0:9: Write Buffer failure 8000002
target0:0:9: Domain Validation Failure, dropping back to Asynchronous target0:0:9: Ending Domain Validation
sym0:9:sync msgout: 1-3-1-c-0.
sym0:9:sync msgin: 1-3-1-c-0.
sym0:9:sdtr: ofs=0 per=12 div=0 fak=0 chg=0.
sym0:9: wide asynchronous.
53c700: Version 2.8 By [email protected]
scsi1: 53c710 rev 2
scsi1 : LASI SCSI 53c700
Vendor: TOSHIBA Model: CD-ROM XM-5301TA Rev: 1895
Type: CD-ROM ANSI SCSI revision: 02
target1:0:2: Beginning Domain Validation
scsi1: (2:0) Asynchronous
scsi1: (2:0) Synchronous at offset 8, period 236ns
target1:0:2: Domain Validation skipping write tests target1:0:2: Ending Domain Validation
sym0:6:wide msgout: 1-2-3-1.
sym0:6:wide msgin: 1-2-3-1.
sym0:6:wdtr: wide=1 chg=0.
sym0:6:sync msgout: 1-3-1-c-f.
sym0:6:sync msgin: 1-3-1-c-f.
sym0:6:sdtr: ofs=15 per=12 div=0 fak=0 chg=0.
SCSI device sda: 8388314 512-byte hdwr sectors (4295 MB) SCSI device sda: drive cache: write back
SCSI device sda: 8388314 512-byte hdwr sectors (4295 MB) SCSI device sda: drive cache: write back
sda: sda1 sda2 sda3 sda4
Attached scsi disk sda at scsi0, channel 0, id 6, lun 0 SCSI device sdb: 17873040 512-byte hdwr sectors (9151 MB) SCSI device sdb: drive cache: write back
SCSI device sdb: 17873040 512-byte hdwr sectors (9151 MB) SCSI device sdb: drive cache: write back
sdb: unknown partition table
Attached scsi disk sdb at scsi0, channel 0, id 9, lun 0
sr0: scsi-1 drive
Uniform CD-ROM driver Revision: 3.20

Attached scsi generic sg0 at scsi0, channel 0, id 6, lun 0,  type 0
Attached scsi generic sg1 at scsi0, channel 0, id 9, lun 0,  type 0
Attached scsi generic sg2 at scsi1, channel 0, id 2, lun 0,  type 5

_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

#8 lore raw
In reply to Mike Frysinger
Quoted 1 line · Mike Frysinger

it didnt panic, but it looks like the kernel went into an infinite loop ...

Yeah, now it looks like a problem a bunch of other people have been having ;-(

Quoted 9 lines

sym0:9:ppr msgin: 1-6-4-c-0-3f-1-2.
sym0:9: FAST-20 WIDE SCSI 40.0 MB/s ST (50.0 ns, offset 16) sym0:9:ppr msgout: 1-6-4-c-0-10-1-0.
Vendor: WDIGTL Model: WDE9150 ULTRA3 Rev: 1.30
Type: Direct-Access ANSI SCSI revision: 03
sym0:9:0: tagged command queuing enabled, command queue depth 16.
target0:0:9: Beginning Domain Validation
sym0:9:ppr msgout: 1-6-4-c-0-0-0-0.
sym0:9:ppr msgin: 1-6-4-a-0-0-0-0.

The SPI spec prohobits the device from going faster than we say. The 'c' in the msgout is us saying "we can only do FAST-20" (as the 875 is only capable of FAST-20). The 'a' in the msgin is the device saying "OK, let's do FAST-40".

Can you try the following patch? We're not actually disabling ppr atm, depite what the comment says.

Index: drivers/scsi/sym53c8xx_2/sym_hipd.c
===================================================================
RCS file: /var/cvs/linux-2.6/drivers/scsi/sym53c8xx_2/sym_hipd.c,v retrieving revision 1.43

scsi/sym53c8xx_2/sym_hipd.c 28 Dec 2004 03:27:10 -0000 renamed from scsi/sym53c8xx_2/sym_hipd.c 2 Dec 2004 19:51:11 -0000 1.43 +5 -1
diff -u -p -r1.43 sym_hipd.c
@@ -1444,7 +1444,11 @@ static void sym_check_goals(struct scsi_
                st->offset = 0;
                return;
        }
-               
+
+       /* Some targets fail to properly negotiate using PPR in SE mode */
+       if (!((np->scsi_mode == SMODE_LVD) && (np->features & FE_ULTRA3)))
+               sdev->ppr = 0;
+
        if (scsi_device_dt(sdev)) {
                if (scsi_device_dt_only(sdev))
                        st->options |= PPR_OPT_DT;
@@ -1454,10 +1458,6 @@ static void sym_check_goals(struct scsi_
        } else {
                st->options &= ~PPR_OPT_DT;
        }
#9 lore raw
Quoted 2 lines · Matthew Wilcox

Can you try the following patch? We're not actually disabling ppr atm, depite what the comment says.

kernel panic :(

find attach dmesg
-mike

sym0: <875> rev 0x4 at pci 0000:00:13.0 irq 99
sym0: No NVRAM, ID 7, Fast-20, SE, parity checking
sym0: SCSI BUS has been reset.
scsi0 : sym-2.1.18m
elevator: using anticipatory as default io scheduler
Vendor: IBM Model: DDRS-34560WS Rev: HP01
Type: Direct-Access ANSI SCSI revision: 02
sym0:6:0: tagged command queuing enabled, command queue depth 16.
target0:0:6: Beginning Domain Validation
sym0:6:wide msgout: 1-2-3-1.
sym0:6:wide msgin: 1-2-3-1.
sym0:6:wdtr: wide=1 chg=0.
sym0:6:sync msgout: 1-3-1-c-0.
sym0:6:sync msgin: 1-3-1-c-0.
sym0:6:sdtr: ofs=0 per=12 div=0 fak=0 chg=0.
sym0:6: wide asynchronous.
sym0:6:sync msgout: 1-3-1-c-10.
sym0:6:sync msgin: 1-3-1-c-f.
sym0:6:sdtr: ofs=15 per=12 div=0 fak=0 chg=0.
sym0:6: FAST-20 WIDE SCSI 40.0 MB/s ST (50.0 ns, offset 15)
target0:0:6: Domain Validation skipping write tests target0:0:6: Ending Domain Validation
sym0:9:ppr msgin: 1-6-4-c-0-3f-1-2.
sym0:9: FAST-20 WIDE SCSI 40.0 MB/s ST (50.0 ns, offset 16) sym0:9:ppr msgout: 1-6-4-c-0-10-1-0.
Vendor: WDIGTL Model: WDE9150 ULTRA3 Rev: 1.30
Type: Direct-Access ANSI SCSI revision: 03
sym0:9:0: tagged command queuing enabled, command queue depth 16.
target0:0:9: Beginning Domain Validation
sym0:9:ppr msgout: 1-6-4-c-0-0-0-0.
sym0:9:ppr msgin: 1-6-4-a-0-0-0-0.
sym0:9: asynchronous.
sym0:9:ppr msgout: 1-6-4-c-0-0-1-0.
sym0:9:ppr msgin: 1-6-4-a-0-0-1-0.
sym0:9: wide asynchronous.
sym0:9:ppr msgout: 1-6-4-c-0-10-1-0.
sym0:9:ppr msgin: 1-6-4-a-0-10-1-0.

Backtrace:
 [<1029cf04>] sym53c8xx_intr+0x30/0x88
 [<1010708c>] do_irq+0x84/0x158
 [<1024234c>] dino_isr+0xa4/0x110
 [<1010708c>] do_irq+0x84/0x158
 [<10107214>] do_cpu_irq_mask+0xb4/0x124
 [<1010c068>] intr_return+0x0/0x14
 [<10112674>] cpu_idle+0x20/0x30
 [<101776a4>] may_open+0x58/0x20c
 [<10165b04>] dentry_open+0xd8/0x258
 [<1017a854>] dupfd+0x1e4/0x234
 [<10434610>] start_kernel+0x4/0x1e0
 [<10434610>] start_kernel+0x4/0x1e0
 [<10434610>] start_kernel+0x4/0x1e0
 [<10434610>] start_kernel+0x4/0x1e0
 [<10434610>] start_kernel+0x4/0x1e0
 [<10434610>] start_kernel+0x4/0x1e0

Kernel Fault: Code=13 regs=10428600 (Addr=00000000)

YZrvWESTHLNXBCVMcbcbcbcbOGFRQPDI
PSW: 00000000000001000000000000001110 Not tainted

r00-03  00000000 ffffffff 1042858a 00000000
r04-07  00000010 00000000 10fc4000 10fc4c00
r08-11  103f6810 00000000 00000009 10fc4310
r12-15  0000000a 00000001 000000fd f0100000
r16-19  10428140 f0000154 f000014c 103f7168
r20-23  00000000 103f7168 ffffffff 1042858b
r24-27  0000000a 00000000 01312cff 103ca010
r28-31  000000fa 00000005 10428600 1029f8d8
sr0-3   00000000 00000000 00000000 00000000
sr4-7   00000000 00000000 00000000 00000000

IASQ: 00000000 00000000 IAOQ: 1023122c 10231230
IIR: b3202000 ISR: 10240001 IOR: 0a0285f0
CPU: 0 CR30: 10428000 CR31: 1042c000
ORIG_R28: 00000000
IAOQ[0]: $$divU+0xc/0x210
IAOQ[1]: $$divU+0x10/0x210
RP(r2): 0x1042858a

Kernel panic - not syncing: Kernel Fault
 <0>Rebooting in 3 seconds..

_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

#10 lore raw
Quoted 5 lines · Mike Frysinger
Quoted 2 lines · Matthew Wilcox

Can you try the following patch? We're not actually disabling ppr atm, depite what the comment says.

kernel panic :(

Okey dokey. Here's a new one. Now we only use PPR if we have a good reason (eg we want to negotiate FAST-80 or DT clocking). I'm sick of devices that implement SDTR perfectly and have buggy PPR ;-(

Index: drivers/scsi/sym53c8xx_2/sym_hipd.c
===================================================================
RCS file: /var/cvs/linux-2.6/drivers/scsi/sym53c8xx_2/sym_hipd.c,v retrieving revision 1.43

scsi/sym53c8xx_2/sym_hipd.c +28 -46
diff -u -p -r1.43 sym_hipd.c
@@ -1428,13 +1428,12 @@ static void sym_update_dmap_regs(struct 
 }
 #endif
 
+/* Enforce all the fiddly SPI rules and the chip limitations */
 static void sym_check_goals(struct scsi_device *sdev)
 {
 	struct sym_hcb *np = ((struct host_data *)sdev->host->hostdata)->ncb;
 	struct sym_trans *st = &np->target[sdev->id].tinfo.goal;
 
-	/* here we enforce all the fiddly SPI rules */
-
 	if (!scsi_device_wide(sdev))
 		st->width = 0;
 
@@ -1444,7 +1443,7 @@ static void sym_check_goals(struct scsi_
 		st->offset = 0;
 		return;
 	}
-		
+
 	if (scsi_device_dt(sdev)) {
 		if (scsi_device_dt_only(sdev))
 			st->options |= PPR_OPT_DT;
@@ -1455,8 +1454,8 @@ static void sym_check_goals(struct scsi_
 		st->options &= ~PPR_OPT_DT;
 	}
 
-	/* Some targets fail to properly negotiate using PPR in SE mode */
-	if (!((np->scsi_mode == SMODE_LVD) && (np->features & FE_ULTRA3)))
+	/* Some targets fail to properly negotiate DT in SE mode */
+	if ((np->scsi_mode != SMODE_LVD) || !(np->features & FE_U3EN))
 		st->options &= ~PPR_OPT_DT;
 
 	if (st->options & PPR_OPT_DT) {
@@ -1486,38 +1485,31 @@ static void sym_check_goals(struct scsi_
  *  negotiation and the nego_status field of the CCB.
  *  Returns the size of the message in bytes.
  */
-static int sym_prepare_nego(struct sym_hcb *np, ccb_p cp, int nego, u_char *msgptr)
+static int sym_prepare_nego(struct sym_hcb *np, ccb_p cp, u_char *msgptr)
 {
 	tcb_p tp = &np->target[cp->target];
-	int msglen = 0;
 	struct scsi_device *sdev = tp->sdev;
+	struct sym_trans *goal = &tp->tinfo.goal;
+	struct sym_trans *curr = &tp->tinfo.curr;
+	int msglen = 0;
+	int nego;
 
 	if (likely(sdev))
 		sym_check_goals(sdev);
 
 	/*
-	 *  Early C1010 chips need a work-around for DT 
-	 *  data transfer to work.
-	 */
-	if (!(np->features & FE_U3EN))
-		tp->tinfo.goal.options = 0;
-	/*
-	 *  negotiate using PPR ?
+	 * Many devices implement PPR in a buggy way, so only use it if we
+	 * really want to.
 	 */
-	if (scsi_device_dt(sdev)) {
+	if ((goal->options & PPR_OPT_MASK) || (goal->period < 0xa)) {
 		nego = NS_PPR;
+	} else if (curr->width != goal->width) {
+		nego = NS_WIDE;
+	} else if (curr->period != goal->period ||
+		   curr->offset != goal->offset) {
+		nego = NS_SYNC;
 	} else {
-		/*
-		 *  negotiate wide transfers ?
-		 */
-		if (tp->tinfo.curr.width != tp->tinfo.goal.width)
-			nego = NS_WIDE;
-		/*
-		 *  negotiate synchronous transfers?
-		 */
-		else if (tp->tinfo.curr.period != tp->tinfo.goal.period ||
-			 tp->tinfo.curr.offset != tp->tinfo.goal.offset)
-			nego = NS_SYNC;
+		nego = 0;
 	}
 
 	switch (nego) {
@@ -1525,24 +1517,24 @@ static int sym_prepare_nego(struct sym_h
 		msgptr[msglen++] = M_EXTENDED;
 		msgptr[msglen++] = 3;
 		msgptr[msglen++] = M_X_SYNC_REQ;
-		msgptr[msglen++] = tp->tinfo.goal.period;
-		msgptr[msglen++] = tp->tinfo.goal.offset;
+		msgptr[msglen++] = goal->period;
+		msgptr[msglen++] = goal->offset;
 		break;
 	case NS_WIDE:
 		msgptr[msglen++] = M_EXTENDED;
 		msgptr[msglen++] = 2;
 		msgptr[msglen++] = M_X_WIDE_REQ;
-		msgptr[msglen++] = tp->tinfo.goal.width;
+		msgptr[msglen++] = goal->width;
 		break;
 	case NS_PPR:
 		msgptr[msglen++] = M_EXTENDED;
 		msgptr[msglen++] = 6;
 		msgptr[msglen++] = M_X_PPR_REQ;
-		msgptr[msglen++] = tp->tinfo.goal.period;
+		msgptr[msglen++] = goal->period;
 		msgptr[msglen++] = 0;
-		msgptr[msglen++] = tp->tinfo.goal.offset;
-		msgptr[msglen++] = tp->tinfo.goal.width;
-		msgptr[msglen++] = tp->tinfo.goal.options & PPR_OPT_MASK;
+		msgptr[msglen++] = goal->offset;
+		msgptr[msglen++] = goal->width;
+		msgptr[msglen++] = goal->options & PPR_OPT_MASK;
 		break;
 	};
 
@@ -3062,7 +3054,6 @@ static void sym_sir_bad_scsi_status(stru
 	u_char		s_status = cp->ssss_status;
 	u_char		h_flags  = cp->host_flags;
 	int		msglen;
-	int		nego;
 	int		i;
 
 	/*
@@ -3137,16 +3128,7 @@ static void sym_sir_bad_scsi_status(stru
 		 *  cp->nego_status is filled by sym_prepare_nego().
 		 */
 		cp->nego_status = 0;
-		nego = 0;
-		if	(tp->tinfo.curr.options & PPR_OPT_MASK)
-			nego = NS_PPR;
-		else if	(tp->tinfo.curr.width != BUS_8_BIT)
-			nego = NS_WIDE;
-		else if (tp->tinfo.curr.offset != 0)
-			nego = NS_SYNC;
-		if (nego)
-			msglen +=
-			sym_prepare_nego (np,cp, nego, &cp->scsi_smsg2[msglen]);
+		msglen += sym_prepare_nego(np, cp, &cp->scsi_smsg2[msglen]);
 		/*
 		 *  Message table indirect structure.
 		 */
@@ -4135,7 +4117,7 @@ sym_ppr_nego_check(struct sym_hcb *np, i
 
 	if (ofs) {
 		unsigned char minsync = dt ? np->minsync_dt : np->minsync;
-		if (per < np->minsync_dt) {
+		if (per < minsync) {
 			chg = 1;
 			per = minsync;
 		}
@@ -5300,7 +5282,7 @@ int sym_queue_scsiio(struct sym_hcb *np,
 	    tp->tinfo.curr.offset  != tp->tinfo.goal.offset ||
 	    tp->tinfo.curr.options != tp->tinfo.goal.options) {
 		if (!tp->nego_cp && lp)
-			msglen += sym_prepare_nego(np, cp, 0, msgptr + msglen);
+			msglen += sym_prepare_nego(np, cp, msgptr + msglen);
 	}
 
 	/*
Signature · 10 lines
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain
_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
#11 lore raw
Quoted 3 lines · Matthew Wilcox

Okey dokey. Here's a new one. Now we only use PPR if we have a good reason (eg we want to negotiate FAST-80 or DT clocking). I'm sick of devices that implement SDTR perfectly and have buggy PPR ;-(

system booted nicely :)

new dmesg attached !
-mike

eth0: Digital DS21143 Tulip rev 65 at 80000080, 00:10:83:35:8C:80, IRQ 96.
sym0: <875> rev 0x4 at pci 0000:00:13.0 irq 99
sym0: No NVRAM, ID 7, Fast-20, SE, parity checking
sym0: SCSI BUS has been reset.
scsi0 : sym-2.1.18m
elevator: using anticipatory as default io scheduler
Vendor: IBM Model: DDRS-34560WS Rev: HP01
Type: Direct-Access ANSI SCSI revision: 02
sym0:6:0: tagged command queuing enabled, command queue depth 16.
target0:0:6: Beginning Domain Validation
sym0:6:wide msgout: 1-2-3-1.
sym0:6:wide msgin: 1-2-3-1.
sym0:6:wdtr: wide=1 chg=0.
sym0:6:sync msgout: 1-3-1-c-0.
sym0:6:sync msgin: 1-3-1-c-0.
sym0:6:sdtr: ofs=0 per=12 div=0 fak=0 chg=0.
sym0:6: wide asynchronous.
sym0:6:sync msgout: 1-3-1-c-10.
sym0:6:sync msgin: 1-3-1-c-f.
sym0:6:sdtr: ofs=15 per=12 div=0 fak=0 chg=0.
sym0:6: FAST-20 WIDE SCSI 40.0 MB/s ST (50.0 ns, offset 15)
target0:0:6: Domain Validation skipping write tests target0:0:6: Ending Domain Validation
sym0:9:ppr msgin: 1-6-4-c-0-3f-1-2.
sym0:9: FAST-20 WIDE SCSI 40.0 MB/s ST (50.0 ns, offset 16) sym0:9:ppr msgout: 1-6-4-c-0-10-1-0.
Vendor: WDIGTL Model: WDE9150 ULTRA3 Rev: 1.30
Type: Direct-Access ANSI SCSI revision: 03
sym0:9:0: tagged command queuing enabled, command queue depth 16.
target0:0:9: Beginning Domain Validation
sym0:9:wide msgout: 1-2-3-0.
sym0:9:wide msgin: 1-2-3-0.
sym0:9:wdtr: wide=0 chg=0.
sym0:9:sync msgin: 1-3-1-c-1f.
sym0:9:sdtr: ofs=16 per=12 div=0 fak=0 chg=1.
sym0:9: FAST-20 SCSI 20.0 MB/s ST (50.0 ns, offset 16) sym0:9:sync msgout: 1-3-1-c-10.
sym0:9:wide msgout: 1-2-3-1.
sym0:9:wide msgin: 1-2-3-1.
sym0:9:wdtr: wide=1 chg=0.
sym0:9:sync msgout: 1-3-1-c-10.
sym0:9:sync msgin: 1-3-1-c-10.
sym0:9:sdtr: ofs=16 per=12 div=0 fak=0 chg=0.
sym0:9: FAST-20 WIDE SCSI 40.0 MB/s ST (50.0 ns, offset 16)
target0:0:9: Write Buffer failure 8000002
target0:0:9: Domain Validation detected failure, dropping back
sym0:9:sync msgout: 1-3-1-d-10.
sym0:9:sync msgin: 1-3-1-19-10.
sym0:9:sdtr: ofs=16 per=25 div=2 fak=0 chg=0.
sym0:9: FAST-10 WIDE SCSI 20.0 MB/s ST (100.0 ns, offset 16)
target0:0:9: Write Buffer failure 8000002
target0:0:9: Domain Validation detected failure, dropping back
sym0:9:sync msgout: 1-3-1-25-10.
sym0:9:sync msgin: 1-3-1-25-10.
sym0:9:sdtr: ofs=16 per=37 div=2 fak=2 chg=0.
sym0:9: FAST-10 WIDE SCSI 13.5 MB/s ST (148.0 ns, offset 16)
target0:0:9: Write Buffer failure 8000002
target0:0:9: Domain Validation detected failure, dropping back
sym0:9:sync msgout: 1-3-1-37-10.
sym0:9:sync msgin: 1-3-1-38-10.
sym0:9:sdtr: ofs=16 per=56 div=4 fak=1 chg=0.
sym0:9: FAST-5 WIDE SCSI 8.9 MB/s ST (224.0 ns, offset 16)
target0:0:9: Write Buffer failure 8000002
target0:0:9: Domain Validation detected failure, dropping back
sym0:9:sync msgout: 1-3-1-54-10.
sym0:9:sync msgin: 1-3-1-57-10.
sym0:9: wide asynchronous.
sym0:9:0:M_REJECT to send for : 1-3-1-57-10.
sym0:9:sync msgout: 1-3-1-c-0.
sym0:9:sync msgin: 1-3-1-c-0.
sym0:9:sdtr: ofs=0 per=12 div=0 fak=0 chg=0.
target0:0:9: Write Buffer failure 8000002
target0:0:9: Domain Validation detected failure, dropping back
sym0:9:sync msgout: 1-3-1-7e-0.
sym0:9:sync msgin: 1-3-1-7e-0.
sym0:9:sdtr: ofs=0 per=126 div=0 fak=0 chg=0.
target0:0:9: Write Buffer failure 8000002
target0:0:9: Domain Validation detected failure, dropping back
sym0:9:sync msgout: 1-3-1-89-0.
sym0:9:sync msgin: 1-3-1-89-0.
sym0:9:sdtr: ofs=0 per=137 div=0 fak=0 chg=0.
target0:0:9: Write Buffer failure 8000002
target0:0:9: Domain Validation Failure, dropping back to Asynchronous target0:0:9: Ending Domain Validation
53c700: Version 2.8 By [email protected]
scsi1: 53c710 rev 2
scsi1 : LASI SCSI 53c700
Vendor: TOSHIBA Model: CD-ROM XM-5301TA Rev: 1895
Type: CD-ROM ANSI SCSI revision: 02
target1:0:2: Beginning Domain Validation
scsi1: (2:0) Asynchronous
scsi1: (2:0) Synchronous at offset 8, period 236ns
target1:0:2: Domain Validation skipping write tests target1:0:2: Ending Domain Validation
SCSI device sda: 8388314 512-byte hdwr sectors (4295 MB)
SCSI device sda: drive cache: write back
SCSI device sda: 8388314 512-byte hdwr sectors (4295 MB)
SCSI device sda: drive cache: write back
sda: sda1 sda2 sda3 sda4
Attached scsi disk sda at scsi0, channel 0, id 6, lun 0
SCSI device sdb: 17873040 512-byte hdwr sectors (9151 MB)
SCSI device sdb: drive cache: write back
SCSI device sdb: 17873040 512-byte hdwr sectors (9151 MB)
SCSI device sdb: drive cache: write back
sdb: unknown partition table
Attached scsi disk sdb at scsi0, channel 0, id 9, lun 0
sr0: scsi-1 drive
Uniform CD-ROM driver Revision: 3.20
Attached scsi CD-ROM sr0 at scsi1, channel 0, id 2, lun 0

Attached scsi generic sg0 at scsi0, channel 0, id 6, lun 0,  type 0
Attached scsi generic sg1 at scsi0, channel 0, id 9, lun 0,  type 0
Attached scsi generic sg2 at scsi1, channel 0, id 2, lun 0,  type 5

_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

#12 lore raw
Quoted 2 lines · Mike Frysinger

target0:0:9: Write Buffer failure 8000002 target0:0:9: Domain Validation detected failure, dropping back

So now I'd like to see what this is ... it causes your nice ultra3 drive only to work at async speeds (about 4MB/s). Can you apply the patch and send back the output?

Thanks,

James

===== drivers/scsi/scsi_transport_spi.c 1.21 vs edited =====

drivers/scsi/scsi_transport_spi.c +3 -0
@@ -33,6 +33,7 @@
 #include <scsi/scsi_request.h>
 #include <scsi/scsi_transport.h>
 #include <scsi/scsi_transport_spi.h>
+#include <scsi/scsi_dbg.h>
 
 #define SPI_PRINTK(x, l, f, a...)	dev_printk(l, &(x)->dev, f , ##a)
 
@@ -440,6 +441,7 @@
 		if(sreq->sr_result || !scsi_device_online(sdev)) {
 			scsi_device_set_state(sdev, SDEV_QUIESCE);
 			SPI_PRINTK(sdev->sdev_target, KERN_ERR, "Write Buffer failure %x\n", sreq->sr_result);
+			scsi_print_req_sense("DV", sreq);
 			return 0;
 		}
 
@@ -642,6 +644,7 @@
 		SPI_PRINTK(sdev->sdev_target, KERN_INFO, "Domain Validation skipping write tests\n");
 		return;
 	}
+	SPI_PRINTK(sdev->sdev_target, KERN_INFO, "Domain Validation write buffer length %d\n", len);
 	if (len > SPI_MAX_ECHO_BUFFER_SIZE) {
 		SPI_PRINTK(sdev->sdev_target, KERN_WARNING, "Echo buffer size %d is too big, trimming to %d\n", len, SPI_MAX_ECHO_BUFFER_SIZE);
 		len = SPI_MAX_ECHO_BUFFER_SIZE;

_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

#13 lore raw
Quoted 2 lines · James Bottomley

So now I'd like to see what this is ... it causes your nice ultra3 drive only to work at async speeds (about 4MB/s).

i'll be the first to admit that i dont know much about scsi ... but even though my drive is an ultra3, i thought my built in C360 controller didnt support that ?
from lspci:
SCSI storage controller: LSI Logic / Symbios Logic 53c875 (rev 04)

Quoted 1 line

Can you apply the patch and send back the output?

attached
-mike

sym0: <875> rev 0x4 at pci 0000:00:13.0 irq 99
sym0: No NVRAM, ID 7, Fast-20, SE, parity checking
sym0: SCSI BUS has been reset.
scsi0 : sym-2.1.18m
elevator: using anticipatory as default io scheduler
Vendor: IBM Model: DDRS-34560WS Rev: HP01
Type: Direct-Access ANSI SCSI revision: 02
sym0:6:0: tagged command queuing enabled, command queue depth 16.
target0:0:6: Beginning Domain Validation
sym0:6:wide msgout: 1-2-3-1.
sym0:6:wide msgin: 1-2-3-1.
sym0:6:wdtr: wide=1 chg=0.
sym0:6:sync msgout: 1-3-1-c-0.
sym0:6:sync msgin: 1-3-1-c-0.
sym0:6:sdtr: ofs=0 per=12 div=0 fak=0 chg=0.
sym0:6: wide asynchronous.
sym0:6:sync msgout: 1-3-1-c-10.
sym0:6:sync msgin: 1-3-1-c-f.
sym0:6:sdtr: ofs=15 per=12 div=0 fak=0 chg=0.
sym0:6: FAST-20 WIDE SCSI 40.0 MB/s ST (50.0 ns, offset 15)
target0:0:6: Domain Validation skipping write tests
target0:0:6: Ending Domain Validation
sym0:9:ppr msgin: 1-6-4-c-0-3f-1-2.
sym0:9: FAST-20 WIDE SCSI 40.0 MB/s ST (50.0 ns, offset 16)
sym0:9:ppr msgout: 1-6-4-c-0-10-1-0.
Vendor: WDIGTL Model: WDE9150 ULTRA3 Rev: 1.30
Type: Direct-Access ANSI SCSI revision: 03
sym0:9:0: tagged command queuing enabled, command queue depth 16.
target0:0:9: Beginning Domain Validation
sym0:9:wide msgout: 1-2-3-0.
sym0:9:wide msgin: 1-2-3-0.
sym0:9:wdtr: wide=0 chg=0.
sym0:9:sync msgin: 1-3-1-c-1f.
sym0:9:sdtr: ofs=16 per=12 div=0 fak=0 chg=1.
sym0:9: FAST-20 SCSI 20.0 MB/s ST (50.0 ns, offset 16)
sym0:9:sync msgout: 1-3-1-c-10.
sym0:9:wide msgout: 1-2-3-1.
sym0:9:wide msgin: 1-2-3-1.
sym0:9:wdtr: wide=1 chg=0.
sym0:9:sync msgout: 1-3-1-c-10.
sym0:9:sync msgin: 1-3-1-c-10.
sym0:9:sdtr: ofs=16 per=12 div=0 fak=0 chg=0.
sym0:9: FAST-20 WIDE SCSI 40.0 MB/s ST (50.0 ns, offset 16)
target0:0:9: Domain Validation write buffer length 255
target0:0:9: Write Buffer failure 8000002
Current DV: sense = 70 5
ASC=24 ASCQ= 0
Raw sense data:0x70 0x00 0x05 0x00 0x00 0x00 0x00 0x18 0xff 0xff 0xff 0xff 0x24 0x00 0x00 0xc0 0x00 0x08 0x00 0xff 0xff 0xff 0xff 0xff 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
target0:0:9: Domain Validation detected failure, dropping back
sym0:9:sync msgout: 1-3-1-d-10.
sym0:9:sync msgin: 1-3-1-19-10.
sym0:9:sdtr: ofs=16 per=25 div=2 fak=0 chg=0.
sym0:9: FAST-10 WIDE SCSI 20.0 MB/s ST (100.0 ns, offset 16)
target0:0:9: Write Buffer failure 8000002
Current DV: sense = 70 5
ASC=24 ASCQ= 0
Raw sense data:0x70 0x00 0x05 0x00 0x00 0x00 0x00 0x18 0xff 0xff 0xff 0xff 0x24 0x00 0x00 0xc0 0x00 0x08 0x00 0xff 0xff 0xff 0xff 0xff 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
target0:0:9: Domain Validation detected failure, dropping back
sym0:9:sync msgout: 1-3-1-25-10.
sym0:9:sync msgin: 1-3-1-25-10.
sym0:9:sdtr: ofs=16 per=37 div=2 fak=2 chg=0.
sym0:9: FAST-10 WIDE SCSI 13.5 MB/s ST (148.0 ns, offset 16)
target0:0:9: Write Buffer failure 8000002
Current DV: sense = 70 5
ASC=24 ASCQ= 0
Raw sense data:0x70 0x00 0x05 0x00 0x00 0x00 0x00 0x18 0xff 0xff 0xff 0xff 0x24 0x00 0x00 0xc0 0x00 0x08 0x00 0xff 0xff 0xff 0xff 0xff 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
target0:0:9: Domain Validation detected failure, dropping back
sym0:9:sync msgout: 1-3-1-37-10.
sym0:9:sync msgin: 1-3-1-38-10.
sym0:9:sdtr: ofs=16 per=56 div=4 fak=1 chg=0.
sym0:9: FAST-5 WIDE SCSI 8.9 MB/s ST (224.0 ns, offset 16)
target0:0:9: Write Buffer failure 8000002
Current DV: sense = 70 5
ASC=24 ASCQ= 0
Raw sense data:0x70 0x00 0x05 0x00 0x00 0x00 0x00 0x18 0xff 0xff 0xff 0xff 0x24 0x00 0x00 0xc0 0x00 0x08 0x00 0xff 0xff 0xff 0xff 0xff 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
target0:0:9: Domain Validation detected failure, dropping back
sym0:9:sync msgout: 1-3-1-54-10.
sym0:9:sync msgin: 1-3-1-57-10.
sym0:9: wide asynchronous.
sym0:9:0:M_REJECT to send for : 1-3-1-57-10.
sym0:9:sync msgout: 1-3-1-c-0.
sym0:9:sync msgin: 1-3-1-c-0.
sym0:9:sdtr: ofs=0 per=12 div=0 fak=0 chg=0.
target0:0:9: Write Buffer failure 8000002
Current DV: sense = 70 5
ASC=24 ASCQ= 0
Raw sense data:0x70 0x00 0x05 0x00 0x00 0x00 0x00 0x18 0xff 0xff 0xff 0xff 0x24 0x00 0x00 0xc0 0x00 0x08 0x00 0xff 0xff 0xff 0xff 0xff 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
target0:0:9: Domain Validation detected failure, dropping back
sym0:9:sync msgout: 1-3-1-7e-0.
sym0:9:sync msgin: 1-3-1-7e-0.
sym0:9:sdtr: ofs=0 per=126 div=0 fak=0 chg=0.
target0:0:9: Write Buffer failure 8000002
Current DV: sense = 70 5
ASC=24 ASCQ= 0
Raw sense data:0x70 0x00 0x05 0x00 0x00 0x00 0x00 0x18 0xff 0xff 0xff 0xff 0x24 0x00 0x00 0xc0 0x00 0x08 0x00 0xff 0xff 0xff 0xff 0xff 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
target0:0:9: Domain Validation detected failure, dropping back
sym0:9:sync msgout: 1-3-1-89-0.
sym0:9:sync msgin: 1-3-1-89-0.
sym0:9:sdtr: ofs=0 per=137 div=0 fak=0 chg=0.
target0:0:9: Write Buffer failure 8000002
Current DV: sense = 70 5
ASC=24 ASCQ= 0
Raw sense data:0x70 0x00 0x05 0x00 0x00 0x00 0x00 0x18 0xff 0xff 0xff 0xff 0x24 0x00 0x00 0xc0 0x00 0x08 0x00 0xff 0xff 0xff 0xff 0xff 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
target0:0:9: Domain Validation Failure, dropping back to Asynchronous
target0:0:9: Ending Domain Validation
53c700: Version 2.8 By [email protected]
scsi1: 53c710 rev 2
scsi1 : LASI SCSI 53c700
Vendor: TOSHIBA Model: CD-ROM XM-5301TA Rev: 1895
Type: CD-ROM ANSI SCSI revision: 02
target1:0:2: Beginning Domain Validation
scsi1: (2:0) Asynchronous
scsi1: (2:0) Synchronous at offset 8, period 236ns
target1:0:2: Domain Validation skipping write tests
target1:0:2: Ending Domain Validation
SCSI device sda: 8388314 512-byte hdwr sectors (4295 MB)
SCSI device sda: drive cache: write back
SCSI device sda: 8388314 512-byte hdwr sectors (4295 MB)
SCSI device sda: drive cache: write back
sda: sda1 sda2 sda3 sda4
Attached scsi disk sda at scsi0, channel 0, id 6, lun 0
SCSI device sdb: 17873040 512-byte hdwr sectors (9151 MB)
SCSI device sdb: drive cache: write back
SCSI device sdb: 17873040 512-byte hdwr sectors (9151 MB)
SCSI device sdb: drive cache: write back
sdb: unknown partition table
Attached scsi disk sdb at scsi0, channel 0, id 9, lun 0
sr0: scsi-1 drive
Uniform CD-ROM driver Revision: 3.20
Attached scsi CD-ROM sr0 at scsi1, channel 0, id 2, lun 0

Attached scsi generic sg0 at scsi0, channel 0, id 6, lun 0,  type 0
Attached scsi generic sg1 at scsi0, channel 0, id 9, lun 0,  type 0
Attached scsi generic sg2 at scsi1, channel 0, id 2, lun 0,  type 5

_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

#15 lore raw
In reply to Mike Frysinger
Quoted 7 lines · Mike Frysinger
Quoted 2 lines · James Bottomley

So now I'd like to see what this is ... it causes your nice ultra3 drive only to work at async speeds (about 4MB/s).

i'll be the first to admit that i dont know much about scsi ... but even though my drive is an ultra3, i thought my built in C360 controller didnt support that ?

That's right, but your drive is capable of FAST-40 and the controller is capable of FAST-20. They should negotiate a FAST-20 (40MB/s) transfer contract, but because the drive is doing weird stuff, it keeps falling back ... until it
reaches async, which is just about the slowest contract defined.

Signature · 10 lines
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain
_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
#16 lore raw
In reply to Mike Frysinger
Quoted 5 lines · Mike Frysinger

Current DV: sense = 70 5
ASC=24 ASCQ= 0
Raw sense data:0x70 0x00 0x05 0x00 0x00 0x00 0x00 0x18 0xff 0xff 0xff 0xff 0x24 0x00 0x00 0xc0 0x00 0x08 0x00 0xff 0xff 0xff 0xff 0xff 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00

This means invalid request, illegal field in cdb and identifies the 8th field as the illegal one (that's the length of the write buffer request). So the thing told us that it supports a write buffer of length 255 and then tells us our request is too long when we try to write 255 bytes ... that seems about par for the course for this drive.

Could you try this patch, it halves the write buffer length. That should tell us if this drive actually has one and just lies about the length, or lies about having one altogether.

James

===== drivers/scsi/scsi_transport_spi.c 1.21 vs edited =====

drivers/scsi/scsi_transport_spi.c +2 -0
@@ -637,6 +639,8 @@
 	len = 0;
 	if (sdev->ppr)
 		len = spi_dv_device_get_echo_buffer(sreq, buffer);
+
+	len = len/2;
 
 	if (len == 0) {
 		SPI_PRINTK(sdev->sdev_target, KERN_INFO, "Domain Validation skipping write tests\n");

_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

#17 lore raw
Quoted 3 lines · James Bottomley

Could you try this patch, it halves the write buffer length. That should tell us if this drive actually has one and just lies about the length, or lies about having one altogether.

added verbose scsi debugging and the patch
-mike

sym0: <875> rev 0x4 at pci 0000:00:13.0 irq 99
sym0: No NVRAM, ID 7, Fast-20, SE, parity checking
sym0: SCSI BUS has been reset.
scsi0 : sym-2.1.18m
elevator: using anticipatory as default io scheduler
Vendor: IBM Model: DDRS-34560WS Rev: HP01
Type: Direct-Access ANSI SCSI revision: 02
sym0:6:0: tagged command queuing enabled, command queue depth 16.
target0:0:6: Beginning Domain Validation
sym0:6:wide msgout: 1-2-3-1.
sym0:6:wide msgin: 1-2-3-1.
sym0:6:wdtr: wide=1 chg=0.
sym0:6:sync msgout: 1-3-1-c-0.
sym0:6:sync msgin: 1-3-1-c-0.
sym0:6:sdtr: ofs=0 per=12 div=0 fak=0 chg=0.
sym0:6: wide asynchronous.
sym0:6:sync msgout: 1-3-1-c-10.
sym0:6:sync msgin: 1-3-1-c-f.
sym0:6:sdtr: ofs=15 per=12 div=0 fak=0 chg=0.
sym0:6: FAST-20 WIDE SCSI 40.0 MB/s ST (50.0 ns, offset 15)
target0:0:6: Domain Validation skipping write tests target0:0:6: Ending Domain Validation
sym0:9:ppr msgin: 1-6-4-c-0-3f-1-2.
sym0:9: FAST-20 WIDE SCSI 40.0 MB/s ST (50.0 ns, offset 16) sym0:9:ppr msgout: 1-6-4-c-0-10-1-0.
Vendor: WDIGTL Model: WDE9150 ULTRA3 Rev: 1.30
Type: Direct-Access ANSI SCSI revision: 03
sym0:9:0: tagged command queuing enabled, command queue depth 16.
target0:0:9: Beginning Domain Validation
sym0:9:wide msgout: 1-2-3-0.
sym0:9:wide msgin: 1-2-3-0.
sym0:9:wdtr: wide=0 chg=0.
sym0:9:sync msgin: 1-3-1-c-1f.
sym0:9:sdtr: ofs=16 per=12 div=0 fak=0 chg=1.
sym0:9: FAST-20 SCSI 20.0 MB/s ST (50.0 ns, offset 16) sym0:9:sync msgout: 1-3-1-c-10.
sym0:9:wide msgout: 1-2-3-1.
sym0:9:wide msgin: 1-2-3-1.
sym0:9:wdtr: wide=1 chg=0.
sym0:9:sync msgout: 1-3-1-c-10.
sym0:9:sync msgin: 1-3-1-c-10.
sym0:9:sdtr: ofs=16 per=12 div=0 fak=0 chg=0.
sym0:9: FAST-20 WIDE SCSI 40.0 MB/s ST (50.0 ns, offset 16)
target0:0:9: Domain Validation write buffer length 127 target0:0:9: Write Buffer failure 8000002
Current DV: sense key Illegal Request
Additional sense: Invalid field in cdb
target0:0:9: Domain Validation detected failure, dropping back
sym0:9:sync msgout: 1-3-1-d-10.
sym0:9:sync msgin: 1-3-1-19-10.
sym0:9:sdtr: ofs=16 per=25 div=2 fak=0 chg=0.
sym0:9: FAST-10 WIDE SCSI 20.0 MB/s ST (100.0 ns, offset 16)
target0:0:9: Write Buffer failure 8000002
Current DV: sense key Illegal Request
Additional sense: Invalid field in cdb
target0:0:9: Domain Validation detected failure, dropping back
sym0:9:sync msgout: 1-3-1-25-10.
sym0:9:sync msgin: 1-3-1-25-10.
sym0:9:sdtr: ofs=16 per=37 div=2 fak=2 chg=0.
sym0:9: FAST-10 WIDE SCSI 13.5 MB/s ST (148.0 ns, offset 16)
target0:0:9: Write Buffer failure 8000002
Current DV: sense key Illegal Request
Additional sense: Invalid field in cdb
target0:0:9: Domain Validation detected failure, dropping back
sym0:9:sync msgout: 1-3-1-37-10.
sym0:9:sync msgin: 1-3-1-38-10.
sym0:9:sdtr: ofs=16 per=56 div=4 fak=1 chg=0.
sym0:9: FAST-5 WIDE SCSI 8.9 MB/s ST (224.0 ns, offset 16)
target0:0:9: Write Buffer failure 8000002
Current DV: sense key Illegal Request
Additional sense: Invalid field in cdb
target0:0:9: Domain Validation detected failure, dropping back
sym0:9:sync msgout: 1-3-1-54-10.
sym0:9:sync msgin: 1-3-1-57-10.
sym0:9: wide asynchronous.
sym0:9:0:M_REJECT to send for : 1-3-1-57-10.
sym0:9:sync msgout: 1-3-1-c-0.
sym0:9:sync msgin: 1-3-1-c-0.
sym0:9:sdtr: ofs=0 per=12 div=0 fak=0 chg=0.
target0:0:9: Write Buffer failure 8000002
Current DV: sense key Illegal Request
Additional sense: Invalid field in cdb
target0:0:9: Domain Validation detected failure, dropping back
sym0:9:sync msgout: 1-3-1-7e-0.
sym0:9:sync msgin: 1-3-1-7e-0.
sym0:9:sdtr: ofs=0 per=126 div=0 fak=0 chg=0.
target0:0:9: Write Buffer failure 8000002
Current DV: sense key Illegal Request
Additional sense: Invalid field in cdb
target0:0:9: Domain Validation detected failure, dropping back
sym0:9:sync msgout: 1-3-1-89-0.
sym0:9:sync msgin: 1-3-1-89-0.
sym0:9:sdtr: ofs=0 per=137 div=0 fak=0 chg=0.
target0:0:9: Write Buffer failure 8000002
Current DV: sense key Illegal Request
Additional sense: Invalid field in cdb
target0:0:9: Domain Validation Failure, dropping back to Asynchronous target0:0:9: Ending Domain Validation
53c700: Version 2.8 By [email protected]
scsi1: 53c710 rev 2
scsi1 : LASI SCSI 53c700
Vendor: TOSHIBA Model: CD-ROM XM-5301TA Rev: 1895
Type: CD-ROM ANSI SCSI revision: 02
target1:0:2: Beginning Domain Validation
scsi1: (2:0) Asynchronous
scsi1: (2:0) Synchronous at offset 8, period 236ns
target1:0:2: Domain Validation skipping write tests target1:0:2: Ending Domain Validation
SCSI device sda: 8388314 512-byte hdwr sectors (4295 MB) SCSI device sda: drive cache: write back
SCSI device sda: 8388314 512-byte hdwr sectors (4295 MB) SCSI device sda: drive cache: write back
sda: sda1 sda2 sda3 sda4
Attached scsi disk sda at scsi0, channel 0, id 6, lun 0 SCSI device sdb: 17873040 512-byte hdwr sectors (9151 MB) SCSI device sdb: drive cache: write back
SCSI device sdb: 17873040 512-byte hdwr sectors (9151 MB) SCSI device sdb: drive cache: write back
sdb: unknown partition table
Attached scsi disk sdb at scsi0, channel 0, id 9, lun 0
sr0: scsi-1 drive
Uniform CD-ROM driver Revision: 3.20
Attached scsi CD-ROM sr0 at scsi1, channel 0, id 2, lun 0

Attached scsi generic sg0 at scsi0, channel 0, id 6, lun 0,  type 0
Attached scsi generic sg1 at scsi0, channel 0, id 9, lun 0,  type 0
Attached scsi generic sg2 at scsi1, channel 0, id 2, lun 0,  type 5

_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

#18 lore raw
Quoted 1 line · Mike Frysinger

added verbose scsi debugging and the patch

OK, this definitely shows that the WD drive is lying about having a writable echo buffer.

Could you reverse all the previous patches in scsi_transport_spi.c and apply the attached. I hope it will detect the write buffer problem and fall back to doing DV configuration using the read only tests, so your drive should configure at the maximum rate for the 875.

Thanks,

James

===== drivers/scsi/scsi_transport_spi.c 1.21 vs edited =====

drivers/scsi/scsi_transport_spi.c +61 -26
@@ -31,6 +31,7 @@
 #include <scsi/scsi_device.h>
 #include <scsi/scsi_host.h>
 #include <scsi/scsi_request.h>
+#include <scsi/scsi_eh.h>
 #include <scsi/scsi_transport.h>
 #include <scsi/scsi_transport_spi.h>
 
@@ -378,10 +379,16 @@
 #define DV_RETRIES	3	/* should only need at most 
 				 * two cc/ua clears */
 
+enum spi_compare_returns {
+	SPI_COMPARE_SUCCESS,
+	SPI_COMPARE_FAILURE,
+	SPI_COMPARE_SKIP_TEST,
+};
+
 
 /* This is for read/write Domain Validation:  If the device supports
  * an echo buffer, we do read/write tests to it */
-static int
+static enum spi_compare_returns
 spi_dv_device_echo_buffer(struct scsi_request *sreq, u8 *buffer,
 			  u8 *ptr, const int retries)
 {
@@ -438,9 +445,23 @@
 		scsi_wait_req(sreq, spi_write_buffer, buffer, len,
 			      DV_TIMEOUT, DV_RETRIES);
 		if(sreq->sr_result || !scsi_device_online(sdev)) {
+			struct scsi_sense_hdr sshdr;
+
 			scsi_device_set_state(sdev, SDEV_QUIESCE);
+			if (scsi_request_normalize_sense(sreq, &sshdr)
+			    && sshdr.sense_key == ILLEGAL_REQUEST
+			    /* INVALID FIELD IN CDB */
+			    && sshdr.asc == 0x24 && sshdr.ascq == 0x00)
+				/* This would mean that the drive lied
+				 * to us about supporting an echo
+				 * buffer (unfortunately some Western
+				 * Digital drives do precisely this)
+				 */
+				return SPI_COMPARE_SKIP_TEST;
+
+
 			SPI_PRINTK(sdev->sdev_target, KERN_ERR, "Write Buffer failure %x\n", sreq->sr_result);
-			return 0;
+			return SPI_COMPARE_FAILURE;
 		}
 
 		memset(ptr, 0, len);
@@ -453,12 +474,12 @@
 		if (memcmp(buffer, ptr, len) != 0)
 			return 0;
 	}
-	return 1;
+	return SPI_COMPARE_SUCCESS;
 }
 
 /* This is for the simplest form of Domain Validation: a read test
  * on the inquiry data from the device */
-static int
+static enum spi_compare_returns
 spi_dv_device_compare_inquiry(struct scsi_request *sreq, u8 *buffer,
 			      u8 *ptr, const int retries)
 {
@@ -493,24 +514,28 @@
 
 		if (memcmp(buffer, ptr, len) != 0)
 			/* failure */
-			return 0;
+			return SPI_COMPARE_FAILURE;
 	}
-	return 1;
+	return SPI_COMPARE_SUCCESS;
 }
 
-static int
+static enum spi_compare_returns
 spi_dv_retrain(struct scsi_request *sreq, u8 *buffer, u8 *ptr,
-	       int (*compare_fn)(struct scsi_request *, u8 *, u8 *, int))
+	       enum spi_compare_returns 
+	       (*compare_fn)(struct scsi_request *, u8 *, u8 *, int))
 {
 	struct spi_internal *i = to_spi_internal(sreq->sr_host->transportt);
 	struct scsi_device *sdev = sreq->sr_device;
 	int period = 0, prevperiod = 0; 
+	enum spi_compare_returns retval;
 
 
 	for (;;) {
 		int newperiod;
-		if (compare_fn(sreq, buffer, ptr, DV_LOOPS))
-			/* Successful DV */
+		retval = compare_fn(sreq, buffer, ptr, DV_LOOPS);
+
+		if (retval == SPI_COMPARE_SUCCESS
+		    || retval == SPI_COMPARE_SKIP_TEST)
 			break;
 
 		/* OK, retrain, fallback */
@@ -527,13 +552,13 @@
 			/* Total failure; set to async and return */
 			SPI_PRINTK(sdev->sdev_target, KERN_ERR, "Domain Validation Failure, dropping back to Asynchronous\n");
 			DV_SET(offset, 0);
-			return 0;
+			return SPI_COMPARE_FAILURE;
 		}
 		SPI_PRINTK(sdev->sdev_target, KERN_ERR, "Domain Validation detected failure, dropping back\n");
 		DV_SET(period, period);
 		prevperiod = period;
 	}
-	return 1;
+	return retval;
 }
 
 static int
@@ -599,7 +624,8 @@
 	DV_SET(offset, 0);
 	DV_SET(width, 0);
 	
-	if (!spi_dv_device_compare_inquiry(sreq, buffer, buffer, DV_LOOPS)) {
+	if (spi_dv_device_compare_inquiry(sreq, buffer, buffer, DV_LOOPS)
+	    != SPI_COMPARE_SUCCESS) {
 		SPI_PRINTK(sdev->sdev_target, KERN_ERR, "Domain Validation Initial Inquiry Failed\n");
 		/* FIXME: should probably offline the device here? */
 		return;
@@ -609,9 +635,10 @@
 	if (i->f->set_width && sdev->wdtr) {
 		i->f->set_width(sdev->sdev_target, 1);
 
-		if (!spi_dv_device_compare_inquiry(sreq, buffer,
+		if (spi_dv_device_compare_inquiry(sreq, buffer,
 						   buffer + len,
-						   DV_LOOPS)) {
+						   DV_LOOPS)
+		    != SPI_COMPARE_SUCCESS) {
 			SPI_PRINTK(sdev->sdev_target, KERN_ERR, "Wide Transfers Fail\n");
 			i->f->set_width(sdev->sdev_target, 0);
 		}
@@ -624,31 +651,39 @@
 	if(!sdev->ppr && !sdev->sdtr)
 		return;
 
-	/* now set up to the maximum */
-	DV_SET(offset, 255);
-	DV_SET(period, 1);
-	if (!spi_dv_retrain(sreq, buffer, buffer + len,
-			    spi_dv_device_compare_inquiry))
-		return;
-
-	/* OK, now we have our initial speed set by the read only inquiry
-	 * test, now try an echo buffer test (if the device allows it) */
+	/* see if the device has an echo buffer.  If it does we can
+	 * do the SPI pattern write tests */
 
 	len = 0;
 	if (sdev->ppr)
 		len = spi_dv_device_get_echo_buffer(sreq, buffer);
 
+ retry:
+
+	/* now set up to the maximum */
+	DV_SET(offset, 255);
+	DV_SET(period, 1);
+
 	if (len == 0) {
 		SPI_PRINTK(sdev->sdev_target, KERN_INFO, "Domain Validation skipping write tests\n");
+		spi_dv_retrain(sreq, buffer, buffer + len,
+			       spi_dv_device_compare_inquiry);
 		return;
 	}
+
 	if (len > SPI_MAX_ECHO_BUFFER_SIZE) {
 		SPI_PRINTK(sdev->sdev_target, KERN_WARNING, "Echo buffer size %d is too big, trimming to %d\n", len, SPI_MAX_ECHO_BUFFER_SIZE);
 		len = SPI_MAX_ECHO_BUFFER_SIZE;
 	}
 
-	spi_dv_retrain(sreq, buffer, buffer + len,
-		       spi_dv_device_echo_buffer);
+	if (spi_dv_retrain(sreq, buffer, buffer + len,
+			   spi_dv_device_echo_buffer)
+	    == SPI_COMPARE_SKIP_TEST) {
+		/* OK, the stupid drive can't do a write echo buffer
+		 * test after all, fall back to the read tests */
+		len = 0;
+		goto retry;
+	}
 }
 
 

_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

#19 lore raw
Quoted 4 lines · James Bottomley

Could you reverse all the previous patches in scsi_transport_spi.c and apply the attached. I hope it will detect the write buffer problem and fall back to doing DV configuration using the read only tests, so your drive should configure at the maximum rate for the 875.

done deal ... i noticed when patching there were a few returns in the updated functions that still returned '0' or '1' instead the new enum's ...

new dmesg attached
-mike

sym0: <875> rev 0x4 at pci 0000:00:13.0 irq 99
sym0: No NVRAM, ID 7, Fast-20, SE, parity checking
sym0: SCSI BUS has been reset.
scsi0 : sym-2.1.18m
elevator: using anticipatory as default io scheduler
Vendor: IBM Model: DDRS-34560WS Rev: HP01
Type: Direct-Access ANSI SCSI revision: 02
sym0:6:0: tagged command queuing enabled, command queue depth 16.
target0:0:6: Beginning Domain Validation
sym0:6:wide msgout: 1-2-3-1.
sym0:6:wide msgin: 1-2-3-1.
sym0:6:wdtr: wide=1 chg=0.
sym0:6:sync msgout: 1-3-1-c-0.
sym0:6:sync msgin: 1-3-1-c-0.
sym0:6:sdtr: ofs=0 per=12 div=0 fak=0 chg=0.
sym0:6: wide asynchronous.
target0:0:6: Domain Validation skipping write tests
sym0:6:sync msgout: 1-3-1-c-10.
sym0:6:sync msgin: 1-3-1-c-f.
sym0:6:sdtr: ofs=15 per=12 div=0 fak=0 chg=0.
sym0:6: FAST-20 WIDE SCSI 40.0 MB/s ST (50.0 ns, offset 15)
target0:0:6: Ending Domain Validation
sym0:9:ppr msgin: 1-6-4-c-0-3f-1-2.
sym0:9: FAST-20 WIDE SCSI 40.0 MB/s ST (50.0 ns, offset 16) sym0:9:ppr msgout: 1-6-4-c-0-10-1-0.
Vendor: WDIGTL Model: WDE9150 ULTRA3 Rev: 1.30
Type: Direct-Access ANSI SCSI revision: 03
sym0:9:0: tagged command queuing enabled, command queue depth 16.
target0:0:9: Beginning Domain Validation
sym0:9:wide msgout: 1-2-3-0.
sym0:9:wide msgin: 1-2-3-0.
sym0:9:wdtr: wide=0 chg=0.
sym0:9:sync msgin: 1-3-1-c-1f.
sym0:9:sdtr: ofs=16 per=12 div=0 fak=0 chg=1.
sym0:9: FAST-20 SCSI 20.0 MB/s ST (50.0 ns, offset 16) sym0:9:sync msgout: 1-3-1-c-10.
sym0:9:wide msgout: 1-2-3-1.
sym0:9:wide msgin: 1-2-3-1.
sym0:9:wdtr: wide=1 chg=0.
sym0:9:sync msgout: 1-3-1-c-10.
sym0:9:sync msgin: 1-3-1-c-10.
sym0:9:sdtr: ofs=16 per=12 div=0 fak=0 chg=0.
sym0:9: FAST-20 WIDE SCSI 40.0 MB/s ST (50.0 ns, offset 16)
target0:0:9: Domain Validation skipping write tests target0:0:9: Ending Domain Validation
53c700: Version 2.8 By [email protected]
scsi1: 53c710 rev 2
scsi1 : LASI SCSI 53c700
Vendor: TOSHIBA Model: CD-ROM XM-5301TA Rev: 1895
Type: CD-ROM ANSI SCSI revision: 02
target1:0:2: Beginning Domain Validation
scsi1: (2:0) Asynchronous
target1:0:2: Domain Validation skipping write tests
scsi1: (2:0) Synchronous at offset 8, period 236ns
target1:0:2: Ending Domain Validation
SCSI device sda: 8388314 512-byte hdwr sectors (4295 MB) SCSI device sda: drive cache: write back
SCSI device sda: 8388314 512-byte hdwr sectors (4295 MB) SCSI device sda: drive cache: write back
sda: sda1 sda2 sda3 sda4
Attached scsi disk sda at scsi0, channel 0, id 6, lun 0 SCSI device sdb: 17873040 512-byte hdwr sectors (9151 MB) SCSI device sdb: drive cache: write back
SCSI device sdb: 17873040 512-byte hdwr sectors (9151 MB) SCSI device sdb: drive cache: write back
sdb: unknown partition table
Attached scsi disk sdb at scsi0, channel 0, id 9, lun 0
sr0: scsi-1 drive
Uniform CD-ROM driver Revision: 3.20
Attached scsi CD-ROM sr0 at scsi1, channel 0, id 2, lun 0

Attached scsi generic sg0 at scsi0, channel 0, id 6, lun 0,  type 0
Attached scsi generic sg1 at scsi0, channel 0, id 9, lun 0,  type 0
Attached scsi generic sg2 at scsi1, channel 0, id 2, lun 0,  type 5

_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

A message that is not in the archive (sent off-list or not yet received): [email protected]

#21 lore raw
Quoted 10 lines · Mike Frysinger
Quoted 1 line · Mike Frysinger

system booted nicely :)

fyi, i have two of these drives ... the other i use in an alpha of mine ...

on the alpha, 2.6.10 mainline just hangs at boot during SCSI negotiation ... i ripped out the hunks that apply to the files in drivers/scsi/sym53c8xx_2/ from patch-2.6.10-pa2 and applied it to 2.6.10 mainline and the resulting kernel booted nicely ... again, the system fell back to async transfer mode, but that's better than nothing at all

I build i386 and ia64 kernels from the parisc CVS tree ... alpha should work as well in the pa tree as it does in mainline. If something *doesn't* work, let me know.

Signature · 10 lines
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain
_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
#22 lore raw
In reply to Matthew Wilcox
Quoted 2 lines

Looking at the stack dump (a couple of layers are missing, is this because of tail-call optimisations?)

probably because we hit an asm function and can't unwind reliably through it. it's on my list of things to fix.

randolph

Signature · 7 lines
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/
_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux