v0.10 works, v0.20 doesn't
I gave a try to the new sata_sil24.ko module that recently appeared in the libata development tree. I tested 3 branches which include 2 ver- sions of this driver: sil24 as well as ALL (new 0.20 driver from Tejun Heo) and sil24-original (old 0.10 driver from Silicon Image). I pulled libata-dev.git on September 2nd.
The result is that only the v0.10 driver from Silicon Image is able to identify disks plugged on a SiI3124 adapter while the new v0.20 driver fails to do so. See below for details.
Tejun, or Jeff: do you think the issue in the v0.20 driver is related to these changes about making ata_bus_probe() an ops or not ?
--oOo-- branch sil24:
I plugged a disk on the 2nd port of the adapter (ata10):
sata_sil24 version 0.20
ACPI: PCI Interrupt 0000:01:06.0[A] -> GSI 29 (level, low) -> IRQ 185
ata9: SATA max UDMA/100 cmd 0xFFFFC20000030000 ctl 0x0 bmdma 0x0 irq 185
ata10: SATA max UDMA/100 cmd 0xFFFFC20000032000 ctl 0x0 bmdma 0x0 irq 185
ata11: SATA max UDMA/100 cmd 0xFFFFC20000034000 ctl 0x0 bmdma 0x0 irq 185
ata12: SATA max UDMA/100 cmd 0xFFFFC20000036000 ctl 0x0 bmdma 0x0 irq 185
ata9: no device found (phy stat 00000000)
scsi8 : sata_sil24
ata10: dev 0 cfg 49:0000 82:0000 83:0000 84:0000 85:0000 86:0000 87:0000 88:0000
ata10: no dma/lba
ata10: dev 0 not supported, ignoring
scsi9 : sata_sil24
ata11: no device found (phy stat 00000000)
scsi10 : sata_sil24
ata12: no device found (phy stat 00000000)
scsi11 : sata_sil24
There is apparently an issue when trying to identify the device because all words of the IDENTIFY reply contain NUL bytes (especially word 49, which leads to "no dma/lba" and then "dev 0 not supported, ignoring").
--oOo-- branch ALL:
Exactly the same result than branch sil24:
sata_sil24 version 0.20
ACPI: PCI Interrupt 0000:01:06.0[A] -> GSI 29 (level, low) -> IRQ 185
ata9: SATA max UDMA/100 cmd 0xFFFFC20000030000 ctl 0x0 bmdma 0x0 irq 185
ata10: SATA max UDMA/100 cmd 0xFFFFC20000032000 ctl 0x0 bmdma 0x0 irq 185
ata11: SATA max UDMA/100 cmd 0xFFFFC20000034000 ctl 0x0 bmdma 0x0 irq 185
ata12: SATA max UDMA/100 cmd 0xFFFFC20000036000 ctl 0x0 bmdma 0x0 irq 185
ata9: no device found (phy stat 00000000)
scsi8 : sata_sil24
ata10: dev 0 cfg 49:0000 82:0000 83:0000 84:0000 85:0000 86:0000 87:0000 88:0000
ata10: no dma
ata10: dev 0 not supported, ignoring
scsi9 : sata_sil24
ata11: no device found (phy stat 00000000)
scsi10 : sata_sil24
ata12: no device found (phy stat 00000000)
scsi11 : sata_sil24
--oOo-- branch sil24-original:
This branch crashed my kernel. I understand that the driver contributed by Silicon Image makes ata_bus_probe an ops, but it seems that not all SATA drivers have been converted to use it. More particularly it happens that I have to load sata_sil because I have other disks on another SATA chip, and when loading it the kernel crashes in libata-core.c, function ata_device_add(), on this line of code:
rc = host_set->ops->bus_probe(ap);
When loading sata_sil, bus_probe is a NULL pointer. So I have had to change this line to something like:
if (host_set->ops->bus_probe)
rc = host_set->ops->bus_probe(ap);
else
rc = ata_bus_probe(ap);This way I was able to load both sata_sil and sata_sil24. The good news is that the sil24-original driver is able to correctly identify my disk (still ata10):
sata_sil24 version 0.10
ACPI: PCI Interrupt 0000:01:06.0[A] -> GSI 29 (level, low) -> IRQ 201sata_sil24: mmio_base0=ffffc200000e6c00 base_len (hex)=80sata_sil24: mmio_base=ffffc20000490000 base_len (hex)=8000sata_sil24: Found Port Readysata_sil24: sil_port_start allocating Scatter Table, PRBs hex=840sata_sil24: sil_port_start virtual=ffff8100343fd000 physical=343fd000
ata9: SATA max UDMA/100 cmd 0xFFFFC20000490000 ctl 0xFFFFC2000049000A bmdma 0xFFFFC20000490000 irq 201sata_sil24: sil_port_start allocating Scatter Table, PRBs hex=840sata_sil24: sil_port_start virtual=ffff810033c05000 physical=33c05000
ata10: SATA max UDMA/100 cmd 0xFFFFC20000492000 ctl 0xFFFFC2000049200A bmdma 0xFFFFC20000490000 irq 201sata_sil24: sil_port_start allocating Scatter Table, PRBs hex=840sata_sil24: sil_port_start virtual=ffff81003397f000 physical=3397f000
ata11: SATA max UDMA/100 cmd 0xFFFFC20000494000 ctl 0xFFFFC2000049400A bmdma 0xFFFFC20000490000 irq 201sata_sil24: sil_port_start allocating Scatter Table, PRBs hex=840sata_sil24: sil_port_start virtual=ffff81003a6df000 physical=3a6df000
ata12: SATA max UDMA/100 cmd 0xFFFFC20000496000 ctl 0xFFFFC2000049600A bmdma 0xFFFFC20000490000 irq 201
ata9: no device found (phy stat 00000000)
scsi8 : sata_sil24sata_sil24: bus_probe ap=ffff810035c81360 trying to identify dev=0sata_sil24: sil_dev_identify speed=1
ata10: dev 0 cfg 49:2f00 82:346b 83:7d01 84:4003 85:3469 86:3c01 87:4003 88:007f
ata10: dev 0 ATA, max UDMA/133, 312581808 sectors: lba48sata_sil24: bus_probe FOUND DEVICE
ata10: dev 0 configured for UDMA/100
scsi9 : sata_sil24
ata11: no device found (phy stat 00000000)
scsi10 : sata_sil24
ata12: no device found (phy stat 00000000)
scsi11 : sata_sil24
Vendor: ATA Model: ST3160023AS Rev: 3.18
Type: Direct-Access ANSI SCSI revision: 05
SCSI device sdc: 312581808 512-byte hdwr sectors (160042 MB)
SCSI device sdc: drive cache: write back
SCSI device sdc: 312581808 512-byte hdwr sectors (160042 MB)
SCSI device sdc: drive cache: write back
sdc: unknown partition table
Attached scsi disk sdc at scsi9, channel 0, id 0, lun 0
Attached scsi generic sg2 at scsi9, channel 0, id 0, lun 0, type 0sata_sil24: found 4 Ports
Signature · 1 line
Marc Bevand
[CC'ing Jeff]
Hello, Marc.
Weird, I can tell you that 0.2 driver works for at least two sil24
controllers - mine and Edward Falk's. Can you please apply the following patch to the current ALL head and post dmesg?
drivers/scsi/sata_sil24.c +10 -0
@@ -512,6 +512,16 @@ static inline void sil24_host_intr(struc slot_stat =readl (port +PORT_SLOT_STAT );if (!(slot_stat &HOST_SSTAT_ATTN )) { +u32 irq_stat, cmd_err, sstatus, serror; + + irq_stat =readl (port +PORT_IRQ_STAT ); + cmd_err =readl (port +PORT_CMD_ERR ); + sstatus =readl (port +PORT_SSTATUS ); + serror =readl (port +PORT_SERROR ); +DPRINTK (DRV_NAME " ata%u: normal interrupt on port%d\n" +" stat=0x%x irq=0x%x cmd_err=%d sstatus=0x%x serror=0x%x\n" , + ap->id, ap->port_no, slot_stat, irq_stat, cmd_err, sstatus, serror); +if (qc)ata_qc_complete (qc,0 ); }else
include/linux/libata.h +2 -2
@@ -36,8 +36,8 @@/* * compile-time options */ -#undef ATA_DEBUG/* debugging output */ -#undef ATA_VERBOSE_DEBUG/* yet more debugging output */ +#define ATA_DEBUG /* debugging output */ +#define ATA_VERBOSE_DEBUG /* yet more debugging output */ #undef ATA_IRQ_TRAP/* define to ack screaming irqs */ #undef ATA_NDEBUG/* define to disable quick runtime checks */ #undef ATA_ENABLE_ATAPI/* define to enable ATAPI support */
Quoted 4 lines · Tejun Heo
Weird, I can tell you that 0.2 driver works for at least two sil24
controllers - mine and Edward Falk's. Can you please apply the following patch to the current ALL head and post dmesg?
Done. But dmesg is quite large (240 kB), so here it is:
http://epita.fr/~bevand_m/pub/sata_sil24.dmesg
Notes:
o This time 2 disks were plugged (ata19 and ata20, on ports 2 and 3).
o I had to #undef ATA_VERBOSE_DEBUG in your patch else the kernel freezes when init(8) starts running all the initscripts, probably because too many messages are printk()ed on the console. Let me know if you _really_ need ATA_VERBOSE_DEBUG, I can try with a serial console.
Here is the relevant part of dmesg, for ata19:
ata_device_add: ata19: probe begin
ata_dev_identify: ENTER, host 19, dev 0
ata_dev_identify: do ATA identify
ata_sg_setup_one: mapped buffer of 512 bytes for read
sil24_host_intr: sata_sil24 ata19: normal interrupt on port2
stat=0x0 irq=0xb00000 cmd_err=0 sstatus=0x113 serror=0x4050000
ata_sg_clean: unmapping 1 sg elements
ata19: dev 0 cfg 49:0000 82:0000 83:0000 84:0000 85:0000 86:0000 87:0000 88:0000
ata19: no dma
ata19: dev 0 not supported, ignoring
ata_dev_identify: EXIT, err
ata_dev_identify: ENTER/EXIT (host 19, dev 1) -- nodev
ata_device_add: ata19: probe end
There is definitely a problem when issuing the IDENTIFY DEVICE command. However I don't have any hardware doc so I can't interpert the "normal interrupt" log line.
More information about my context:
o My arch is x86_64, what is yours ?
o The controller is using a SiI3124-2 chip (SATA 3.0 Gbps) not a SiI 3124-1 one (1.5 Gbps); does it matter ?
o I am using the controller in a 64-bit 133 MHz PCI-X bus.
o lspci output:
$ lspci -vvs 1:6
0000:01:06.0 RAID bus controller: Silicon Image, Inc. (formerly CMD Technology
Inc) SiI 3124 PCI-X Serial ATA Controller (rev 01)
Subsystem: Silicon Image, Inc. (formerly CMD Technology Inc): Unknown
device 6124
Control: I/O+ Mem+ BusMaster+ SpecCycle+ MemWINV- VGASnoop- ParErr-
Stepping+ SERR+ FastB2B-
Status: Cap+ 66Mhz+ UDF- FastB2B- ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
Latency: 64
Interrupt: pin A routed to IRQ 193
Region 0: Memory at fc5ffc00 (64-bit, non-prefetchable) [size=128]
Region 2: Memory at fc5f0000 (64-bit, non-prefetchable) [size=32K]
Region 4: I/O ports at 8c00 [size=16]
Expansion ROM at fc500000 [disabled] [size=512K]
Capabilities: [64] Power Management version 2
Flags: PMEClk- DSI+ D1+ D2+ AuxCurrent=0mA
PME(D0-,D1-,D2-,D3hot-,D3cold-)
Status: D0 PME-Enable- DSel=0 DScale=1 PME-
Capabilities: [40] PCI-X non-bridge device.
Command: DPERE- ERO+ RBC=0 OST=5
Status: Bus=0 Dev=0 Func=0 64bit- 133MHz- SCD- USC-, DC=simple,
DMMRBC=0, DMOST=0, DMCRS=0, RSCEM- Capabilities: [54] Message Signalled
Interrupts: 64bit+ Queue=0/0 Enable-
Address: 0000000000000000 Data: 0000--
Marc Bevand
Hello, Marc.
Quoted 10 lines · Marc Bevand
Quoted 3 lines · Tejun Heo
Weird, I can tell you that 0.2 driver works for at least two sil24 controllers - mine and Edward Falk's. Can you please apply the following patch to the current ALL head and post dmesg?
Done. But dmesg is quite large (240 kB), so here it is:
http://epita.fr/~bevand_m/pub/sata_sil24.dmesg
Quoted 6 lines
Notes:
o This time 2 disks were plugged (ata19 and ata20, on ports 2 and 3).
o I had to #undefATA_VERBOSE_DEBUGin your patch else the kernel freezes when init(8) starts running all the initscripts, probably because too many messages are printk()ed on the console. Let me know if you _really_ needATA_VERBOSE_DEBUG, I can try with a serial console.
Nope, ATA_DEBUG is enough.
Quoted 16 lines
Here is the relevant part of dmesg, for ata19:
ata_device_add: ata19: probe begin
ata_dev_identify: ENTER, host 19, dev 0
ata_dev_identify: do ATA identify
ata_sg_setup_one: mapped buffer of 512 bytes for read
sil24_host_intr:sata_sil24ata19: normal interrupt on port2stat=0x0 irq=0xb00000 cmd_err=0 sstatus=0x113 serror=0x4050000
ata_sg_clean: unmapping 1 sg elements
ata19: dev 0 cfg 49:0000 82:0000 83:0000 84:0000 85:0000 86:0000 87:0000 88:0000
ata19: no dma
ata19: dev 0 not supported, ignoring
ata_dev_identify: EXIT, err
ata_dev_identify: ENTER/EXIT (host 19, dev 1) -- nodev
ata_device_add: ata19: probe end
Quoted 3 lines
There is definitely a problem when issuing the IDENTIFY DEVICE command. However I don't have any hardware doc so I can't interpert the "normal interrupt" log line.
I don't have hw doc either but the line looks fine compared to my
working output.
Quoted 2 lines
More information about my context:
o My arch isx86_64, what is yours ?
Tested both on x86 and EM64T.
Quoted 2 lines
o The controller is using a SiI3124-2 chip (SATA 3.0 Gbps) not a SiI 3124-1 one (1.5 Gbps); does it matter ?
Mine is a 3.0G chip, too.
Quoted 1 line
o I am using the controller in a 64-bit 133 MHz PCI-X bus.
Mine is hanging off regular PCI slot.
Quoted 18 lines
o lspci output:
$ lspci -vvs 1:6 0000:01:06.0 RAID bus controller: Silicon Image, Inc. (formerly CMD Technology Inc) SiI 3124 PCI-X Serial ATA Controller (rev 01) Subsystem: Silicon Image, Inc. (formerly CMD Technology Inc): Unknown device 6124 Control: I/O+ Mem+ BusMaster+ SpecCycle+ MemWINV- VGASnoop- ParErr- Stepping+ SERR+ FastB2B- Status: Cap+ 66Mhz+ UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- Latency: 64 Interrupt: pin A routed to IRQ 193 Region 0: Memory at fc5ffc00 (64-bit, non-prefetchable) [size=128] Region 2: Memory at fc5f0000 (64-bit, non-prefetchable) [size=32K] Region 4: I/O ports at 8c00 [size=16] Expansion ROM at fc500000 [disabled] [size=512K] Capabilities: [64] Power Management version 2 Flags: PMEClk- DSI+ D1+ D2+ AuxCurrent=0mA
Quoted 9 lines
PME(D0-,D1-,D2-,D3hot-,D3cold-)
Status: D0 PME-Enable- DSel=0 DScale=1 PME-
Capabilities: [40] PCI-X non-bridge device.
Command: DPERE- ERO+ RBC=0 OST=5
Status: Bus=0 Dev=0 Func=0 64bit- 133MHz- SCD- USC-, DC=simple,
DMMRBC=0, DMOST=0, DMCRS=0, RSCEM- Capabilities: [54] Message Signalled
Interrupts: 64bit+ Queue=0/0 Enable-
Address: 0000000000000000 Data: 0000 Okay, it seems that command is normally issued and completed. My
primary suspicion now is regarding memory IO mapping.
- How much memory do you have on the system?
- Can you try to boot with iommu=off kernel parameter?
- Can you try to boot with x86 kernel?
Thanks.
Signature · 1 line
tejun
Quoted 5 lines · Tejun Heo
Okay, it seems that command is normally issued and completed. My
primary suspicion now is regarding memory IO mapping.- How much memory do you have on the system?
- Can you try to boot with iommu=off kernel parameter?
Please try iommu=soft instead of off. Sorry.
Quoted 4 lines
- Can you try to boot with x86 kernel?
Thanks.
Signature · 1 line
tejun
Tejun Heo wrote:
| | >o I am using the controller in a 64-bit 133 MHz PCI-X bus. | | Mine is hanging off regular PCI slot.
I just tried to use a PCI slot instead of a PCI-X one. It does not change anything.
| Okay, it seems that command is normally issued and completed. My | primary suspicion now is regarding memory IO mapping. | | - How much memory do you have on the system?
My system is a dual-Opteron, with 1 GB (attached to the first CPU, no RAM on the 2nd CPU). I tried to boot with numa=off, nothing changes.
| - Can you try to boot with iommu=off kernel parameter?
I tried iommu=soft (what you told me in your 2nd reply). Nothing changes.
| - Can you try to boot with x86 kernel?
I will try it ASAP (right now I only have a pure 64-bit system).
Since the current sil24-original head, which is the only kernel detecting my disks, is really close to a vanilla 2.6.12-rc5 kernel, I have back- ported the first version of your rewritten sata_sil24 driver to 2.6.12-rc5, and I am currently testing/examining each patch separating sil24-original current from 2.6.12-rc5, hoping to find the one that breaks my system.
Another thing: just to be sure, did you notice that the driver from the
sil24 head prints:
ata9: SATA max UDMA/100 cmd 0xFFFFC20000030000 ctl 0x0 bmdma 0x0 irq 185
while the driver from the sil24-original head prints:
ata9: SATA max UDMA/100 cmd 0xFFFFC20000490000 ctl 0xFFFFC2000049000A bmdma 0xFFFFC20000490000 irq 201
'ctl' and 'bmdma' are 0x0 in the first case, is it normal ?
Signature · 2 lines
Marc Bevand http://epita.fr/~bevand_m Computer Science School EPITA - System, Network and Security Dept.
Hi, Marc.
Quoted 14 lines · Marc Bevand
Tejun Heo wrote:
| | >o I am using the controller in a 64-bit 133 MHz PCI-X bus. | | Mine is hanging off regular PCI slot.I just tried to use a PCI slot instead of a PCI-X one. It does not change anything.
| Okay, it seems that command is normally issued and completed. My | primary suspicion now is regarding memory IO mapping. | | - How much memory do you have on the system?
Quoted 7 lines
My system is a dual-Opteron, with 1 GB (attached to the first CPU, no RAM on the 2nd CPU). I tried to boot with numa=off, nothing changes.
| - Can you try to boot with iommu=off kernel parameter?
I tried iommu=soft (what you told me in your 2nd reply). Nothing changes.
My incorrect guess was that your system has > 4GB memory and iommu
was screwed up somehow because new sil24 driver currently sets DMA memory mask to 32bit while original one sets it to 64bit making new sil24 use iommu for memories > 4GB unlike the original one.
Quoted 3 lines
| - Can you try to boot with x86 kernel?
I will try it ASAP (right now I only have a pure 64-bit system).
I was suggesting this for about the same reason, so this won't make
much difference either, I think. Trying this would be nice anyway to eliminate a possibility. You don't have to install 32bit userland. Just cross-compile 32bit kernel and boot it. System will fail to enter userland but all we need to see is libata probing outputs.
I use the following scripts for cross compiling for x86 from x86-64.
x86-64 compiler and binutils support x86 binaries out of the box and only some flags are needed.
$ cat i386-make #!/bin/bash
exec make ARCH=i386 CROSS_COMPILE=i386-linux- "$@"
$ cat i386-linux-ar #!/bin/bash
exec ar "$@"
[tj@htj:~/bin]$ cat i386-linux-as #!/bin/bash
exec as --32 "$@"
[tj@htj:~/bin]$ cat i386-linux-gcc #!/bin/bash
exec gcc -m32 "$@"
[tj@htj:~/bin]$ cat i386-linux-ld #!/bin/bash
exec ld -melf_i386 "$@"
[tj@htj:~/bin]$ cat i386-linux-nm #!/bin/bash
exec nm "$@"
[tj@htj:~/bin]$ cat i386-linux-objcopy #!/bin/bash
exec objcopy "$@"
[tj@htj:~/bin]$ cat i386-linux-ar #!/bin/bash
exec ar "$@"
[tj@htj:~/bin]$ cat i386-linux-objdump #!/bin/bash
exec objdump "$@"
[tj@htj:~/bin]$ cat i386-linux-strip #!/bin/bash
exec strip "$@"
Quoted 6 lines
Since the current sil24-original head, which is the only kernel detecting my disks, is really close to a vanilla 2.6.12-rc5 kernel, I have back- ported the first version of your rewritten
sata_sil24driver to 2.6.12-rc5, and I am currently testing/examining each patch separating sil24-original current from 2.6.12-rc5, hoping to find the one that breaks my system.
Quoted 6 lines
Another thing: just to be sure, did you notice that the driver from the
sil24 head prints:
ata9: SATA max UDMA/100 cmd0xFFFFC20000030000ctl0x0bmdma0x0irq 185
while the driver from the sil24-original head prints:
ata9: SATA max UDMA/100 cmd0xFFFFC20000490000ctl0xFFFFC2000049000Abmdma0xFFFFC20000490000irq 201
'ctl' and 'bmdma' are0x0in the first case, is it normal ?
Yes, those are normal. Those registers are never used / properly
supported by sil24 and the original driver just initialized them with meaningless values.
Thanks.
Signature · 1 line
tejun
Hello, Marc.
To eliminate one more possibility, can you please try the following
patch?
drivers/scsi/sata_sil24.c +2 -0
@@ -720,6 +720,8 @@ static int sil24_init_one(struct pci_dev pci_name(pdev)); } +writel (0x0300 , port +PORT_SCONTROL ); +/* Zero error counters. */ writel (0x8000 , port +PORT_DECODE_ERR_THRESH );writel (0x8000 , port +PORT_CRC_ERR_THRESH );
include/linux/libata.h +0 -0
Tejun Heo wrote:
| Hello, Marc. | | To eliminate one more possibility, can you please try the following | patch? | | diff --git a/drivers/scsi/sata_sil24.c b/drivers/scsi/sata_sil24.c | --- a/drivers/scsi/sata_sil24.c | +++ b/drivers/scsi/sata_sil24.c | @@ -720,6 +720,8 @@ static int sil24_init_one(struct pci_dev | pci_name(pdev)); | } | | + writel(0x0300, port + PORT_SCONTROL); | + | /* Zero error counters. */ | writel(0x8000, port + PORT_DECODE_ERR_THRESH); | writel(0x8000, port + PORT_CRC_ERR_THRESH);
I tried that. No changes.
| diff --git a/include/linux/libata.h b/include/linux/libata.h
It looks like your patch has been truncated: what did you want to modify in libata.h ?
PS: I am going to test a 32-bit kernel later in the day.
Signature · 2 lines
Marc Bevand http://epita.fr/~bevand_m Computer Science School EPITA - System, Network and Security Dept.
Quoted 19 lines · Marc Bevand
Tejun Heo wrote:
| Hello, Marc. | | To eliminate one more possibility, can you please try the following | patch? | | diff --git a/drivers/scsi/sata_sil24.c b/drivers/scsi/sata_sil24.c | --- a/drivers/scsi/sata_sil24.c | +++ b/drivers/scsi/sata_sil24.c | @@ -720,6 +720,8 @@ static int sil24_init_one(struct pci_dev | pci_name(pdev)); | } | | + writel(0x0300, port + PORT_SCONTROL); | + | /* Zero error counters. */ | writel(0x8000, port + PORT_DECODE_ERR_THRESH); | writel(0x8000, port + PORT_CRC_ERR_THRESH);
Quoted 6 lines
I tried that. No changes.
| diff --git
a/include/linux/libata.hb/include/linux/libata.hIt looks like your patch has been truncated: what did you want to modify in
libata.h?
Nothing. Only timestamp has changed and 'git diff' still ran diff on
it, so the empty diff for libata.h.
Quoted 1 line
PS: I am going to test a 32-bit kernel later in the day.
I'll backport new sil24 to sil24-original tree so that we can
eliminate all other factors and compare two drivers again to find the offending difference. I'm currently in the middle of something so it may take me a day or so.
Thanks.
Signature · 1 line
tejun
Hello Tejun,
Tejun Heo wrote:
| I'll backport new sil24 to sil24-original tree so that we can | eliminate all other factors and compare two drivers again to find the | offending difference. I'm currently in the middle of something so it | may take me a day or so.
Ok.
By the way, I tried a 32-bit kernel (libata-dev.git current, ALL branch). Here is what it gives (dmesg hand-recopied [2]):
ata1: SATA max UDMA/100 cmd 0xF8820000 ctl 0x0 bmdma 0x0 irq 169
ata2: SATA max UDMA/100 cmd 0xF8822000 ctl 0x0 bmdma 0x0 irq 169
ata3: SATA max UDMA/100 cmd 0xF8824000 ctl 0x0 bmdma 0x0 irq 169
ata4: SATA max UDMA/100 cmd 0xF8826000 ctl 0x0 bmdma 0x0 irq 169
ata1: no device found (phy stat 00000000)
scsi0 : sata_sil24
ata2: no device found (phy stat 00000000)
scsi1 : sata_sil24
ata3: dev 0 not supported, ignoring
scsi2 : sata_sil24
ata4: dev 0 not supported, ignoring
scsi3 : sata_sil24
The disks are still not recognized. But the line [1] that usually displays the most important words of the IDENTIFY DEVICE reply is not present. This is interesting because it is probably a clue that an early error is occuring somewhere before the IDENTIFY DEVICE reply is received. I immediately did another test with ATA_DEBUG enabled (dmesg still hand-recopied [2]):
ata_device_add: ata1: probe begin
ata1: no device found (phy stat 00000000)
ata_device_add: ata1: probe end
scsi0 : sata_sil24
ata_device_add: ata2: probe begin
ata2: no device found (phy stat 00000000)
ata_device_add: ata2: probe end
scsi1 : sata_sil24
ata_device_add: ata3: probe begin
ata_dev_identify: ENTER, host 3, dev 0
ata_dev_identify: do ATA identify
ata_sg_setup_one: mapped buffer of 512 bytes for read
ata_sg_clean: unmapping 1 sg elements
ata3: dev 0 not supported, ignoring
ata_dev_identify: EXIT, err
ata_dev_identify: ENTER/EXIT (host 3, dev 1) -- nodev
ata_device_add: ata3: probe end
scsi2 : sata_sil24
[...
skipped the part for ata4 (similar to ata3)
...]
ata_device_add: probe begin
ata_scsi_dump_cdb: CDB (1:0,0,0) 12 00 00 00 24 00 00 00 00
ata_scsi_dump_cdb: CDB (1:0,1,0) 12 00 00 00 24 00 00 00 00
ata_scsi_dump_cdb: CDB (1:0,2,0) 12 00 00 00 24 00 00 00 00
ata_scsi_dump_cdb: CDB (1:0,3,0) 12 00 00 00 24 00 00 00 00
ata_scsi_dump_cdb: CDB (1:0,4,0) 12 00 00 00 24 00 00 00 00
ata_scsi_dump_cdb: CDB (1:0,5,0) 12 00 00 00 24 00 00 00 00
ata_scsi_dump_cdb: CDB (1:0,6,0) 12 00 00 00 24 00 00 00 00
ata_scsi_dump_cdb: CDB (1:0,7,0) 12 00 00 00 24 00 00 00 00
ata_scsi_dump_cdb: CDB (1:0,8,0) 12 00 00 00 24 00 00 00 00
ata_scsi_dump_cdb: CDB (1:0,9,0) 12 00 00 00 24 00 00 00 00
ata_scsi_dump_cdb: CDB (1:0,10,0) 12 00 00 00 24 00 00 00 00
ata_scsi_dump_cdb: CDB (1:0,11,0) 12 00 00 00 24 00 00 00 00
ata_scsi_dump_cdb: CDB (1:0,12,0) 12 00 00 00 24 00 00 00 00
ata_scsi_dump_cdb: CDB (1:0,13,0) 12 00 00 00 24 00 00 00 00
ata_scsi_dump_cdb: CDB (1:0,14,0) 12 00 00 00 24 00 00 00 00
ata_scsi_dump_cdb: CDB (1:0,15,0) 12 00 00 00 24 00 00 00 00
ata_scsi_dump_cdb: CDB (1:1,0,0) 12 00 00 00 24 00 00 00 00
ata_scsi_dump_cdb: CDB (1:1,1,0) 12 00 00 00 24 00 00 00 00
ata_scsi_dump_cdb: CDB (1:1,2,0) 12 00 00 00 24 00 00 00 00
ata_scsi_dump_cdb: CDB (1:1,3,0) 12 00 00 00 24 00 00 00 00
ata_scsi_dump_cdb: CDB (1:1,4,0) 12 00 00 00 24 00 00 00 00
ata_scsi_dump_cdb: CDB (1:1,5,0) 12 00 00 00 24 00 00 00 00
ata_scsi_dump_cdb: CDB (1:1,6,0) 12 00 00 00 24 00 00 00 00
ata_scsi_dump_cdb: CDB (1:1,7,0) 12 00 00 00 24 00 00 00 00
ata_scsi_dump_cdb: CDB (1:1,8,0) 12 00 00 00 24 00 00 00 00
ata_scsi_dump_cdb: CDB (1:1,9,0) 12 00 00 00 24 00 00 00 00
ata_scsi_dump_cdb: CDB (1:1,10,0) 12 00 00 00 24 00 00 00 00
ata_scsi_dump_cdb: CDB (1:1,11,0) 12 00 00 00 24 00 00 00 00
ata_scsi_dump_cdb: CDB (1:1,12,0) 12 00 00 00 24 00 00 00 00
ata_scsi_dump_cdb: CDB (1:1,13,0) 12 00 00 00 24 00 00 00 00
ata_scsi_dump_cdb: CDB (1:1,14,0) 12 00 00 00 24 00 00 00 00
ata_scsi_dump_cdb: CDB (1:1,15,0) 12 00 00 00 24 00 00 00 00 [...
then the above block composed of 32 "CDB" lines was basically
replicated 3 more times like:
ata_scsi_dump_cdb: CDB (2:x,y,z) 12 00 00 00 24 00 00 00 00
...
ata_scsi_dump_cdb: CDB (3:x,y,z) 12 00 00 00 24 00 00 00 00
...
ata_scsi_dump_cdb: CDB (4:x,y,z) 12 00 00 00 24 00 00 00 00
...
I paid attention to the "12 00 00 00 24 00 00 00 00" bytes,
they never change...]
I lack the knowledge to fully interpret this dmesg correctly, but at least I know I need to direct my investigations toward ata_dev_identify(). That is what is on my TODO list for tomorrow...
[1] ataX: dev Y cfg 49:0000 82:0000 83:0000 84:0000 85:0000 86:0000 [...]
[2] Yes I know, next time I will use a serial console
Signature · 2 lines
Marc Bevand http://epita.fr/~bevand_m Computer Science School EPITA - System, Network and Security Dept.
Hello, Marc.
Quoted 26 lines · Marc Bevand
Hello Tejun,
Tejun Heo wrote:
| I'll backport new sil24 to sil24-original tree so that we can | eliminate all other factors and compare two drivers again to find the | offending difference. I'm currently in the middle of something so it | may take me a day or so.Ok.
By the way, I tried a 32-bit kernel (libata-dev.git current, ALL branch). Here is what it gives (dmesg hand-recopied [2]):
ata1: SATA max UDMA/100 cmd
0xF8820000ctl0x0bmdma0x0irq 169
ata2: SATA max UDMA/100 cmd0xF8822000ctl0x0bmdma0x0irq 169
ata3: SATA max UDMA/100 cmd0xF8824000ctl0x0bmdma0x0irq 169
ata4: SATA max UDMA/100 cmd0xF8826000ctl0x0bmdma0x0irq 169
ata1: no device found (phy stat 00000000)
scsi0 :sata_sil24
ata2: no device found (phy stat 00000000)
scsi1 :sata_sil24
ata3: dev 0 not supported, ignoring
scsi2 :sata_sil24
ata4: dev 0 not supported, ignoring
scsi3 :sata_sil24
Quoted 5 lines
The disks are still not recognized. But the line [1] that usually displays the most important words of the IDENTIFY DEVICE reply is not present. This is interesting because it is probably a clue that an early error is occuring somewhere before the IDENTIFY DEVICE reply is received. I immediately did another test with
ATA_DEBUGenabled (dmesg still hand-recopied [2]):
That's because you set console level not to print DEBUG messages.
There's no path which skips message [1] but prints 'not supported' message.
Quoted 4 lines
I lack the knowledge to fully interpret this dmesg correctly, but at least I know I need to direct my investigations toward
ata_dev_identify(). That is what is on my TODO list for tomorrow...
I believe the problem is that although the controller issues commands
to the device and raises interrupt on completion, it doesn't fill in any data in the buffer we passed to it. I don't know the reason but that's the symptom. Probably I screwed up during controller initialization or something.
Quoted 2 lines
[1] ataX: dev Y cfg 49:0000 82:0000 83:0000 84:0000 85:0000 86:0000 [...]
[2] Yes I know, next time I will use a serial console
I really admire your patience for being able to report like you do
with hand copying.
Here's a big patch against sil24-original branch. It contains the
followings.
a. build fix & oops fix for sil24-original branch
b. backported sata_sil24_new driver
c. debug messages (you don't need to turn on ATA_DEBUG)
d. 50ms sleep after completion of IDENTIFY before actually reading data
Building both sata_sil24 and sata_sil24_new as modules and
loading/unloading them work on my machine. Can you please try this and let me know how it goes?
Thanks.
drivers/scsi/Kconfig +8 -0
@@ -489,6 +489,14 @@ config SCSI_SATA_SIL24 If unsure, say N. +config SCSI_SATA_SIL24_NEW + tristate "Silicon Image 3124 SATA support [new driver]" + depends on SCSI_SATA && PCI && EXPERIMENTAL + help + This option enables support for Silicon Image 3124 Serial ATA. + + If unsure, say N. + config SCSI_SATA_SIS tristate "SiS 964/180 SATA support" depends on SCSI_SATA && PCI && EXPERIMENTAL
drivers/scsi/Makefile +1 -0
@@ -129,6 +129,7 @@ obj-$(CONFIG_SCSI_SATA_PROMISE) += libat obj-$(CONFIG_SCSI_SATA_QSTOR) += libata.o sata_qstor.o obj-$(CONFIG_SCSI_SATA_SIL) += libata.o sata_sil.o obj-$(CONFIG_SCSI_SATA_SIL24) += libata.o sata_sil24.o +obj-$(CONFIG_SCSI_SATA_SIL24_NEW) += libata.o sata_sil24_new.o obj-$(CONFIG_SCSI_SATA_VIA) += libata.o sata_via.o obj-$(CONFIG_SCSI_SATA_VITESSE) += libata.o sata_vsc.o obj-$(CONFIG_SCSI_SATA_SIS) += libata.o sata_sis.o
drivers/scsi/libata-core.c +18 -2
@@ -49,6 +49,8 @@#include "libata.h" +#define pd(fmt, args...) printk(KERN_ERR "[%-21s]: " fmt, __FUNCTION__ , ##args) +static unsigned int ata_busy_sleep (struct ata_port *ap,unsigned long tmout_pat,unsigned long tmout);
@@ -1181,6 +1183,7 @@ retry: qc->waiting = &wait; qc->complete_fn = ata_qc_complete_noop; +pd ("issuing 0x%x, dev->id is at %p\n" , qc->tf.command, dev->id);spin_lock_irqsave (&ap->host_set->lock, flags); rc =ata_qc_issue (qc);spin_unlock_irqrestore (&ap->host_set->lock, flags);
@@ -1219,6 +1222,16 @@ retry:swap_buf_le16 (dev->id,ATA_ID_WORDS ); +pd ("Command successfully completed, sleeping 50ms\n" ); +msleep (50 ); + +pd ("Dumping ID\n" ); +for (i =0 ; i <32 ; i++) { +u16 *p = dev->id +8 * i; +pd ("[%03d] %04x %04x %04x %04x %04x %04x %04x %04x\n" , +8 * i, p[0 ], p[1 ], p[2 ], p[3 ], p[4 ], p[5 ], p[6 ], p[7 ]); + } +/* print device capabilities */ printk(KERN_DEBUG "ata%u: dev %u cfg " "49:%04x 82:%04x 83:%04x 84:%04x 85:%04x 86:%04x 87:%04x 88:%04x\n",
@@ -1576,7 +1589,7 @@ static void ata_host_set_dma(struct ata_* PCI/etc. bus probe sem. * */ -static void ata_set_mode (struct ata_port *ap) +void ata_set_mode (struct ata_port *ap) {unsigned int i, xfer_shift;u8 xfer_mode;
@@ -3912,7 +3925,10 @@ int ata_device_add(struct ata_probe_entDPRINTK ("ata%u: probe begin\n" , ap->id);/* @@ Silicon Image */ /* old rc = ata_bus_probe(ap); */ - rc = host_set->ops->bus_probe (ap); +if (host_set->ops->bus_probe) + rc = host_set->ops->bus_probe (ap); +else + rc =ata_bus_probe (ap);DPRINTK ("ata%u: probe end\n" , ap->id);if (rc) {
drivers/scsi/sata_sil24.c +1 -1
@@ -383,7 +383,7 @@ inline void sil_dump_memory(int *p, int#endif /* SIL_DEBUG */ -void swap_buf_le16 (u16 *buf,unsigned int buf_words) +static void swap_buf_le16 (u16 *buf,unsigned int buf_words) {#ifdef __BIG_ENDIANunsigned int i;
drivers/scsi/sata_sil24_new.c new file +790 -0
790 lines not on this page · raw message
Hi Tejun.
Tejun Heo wrote:
| | Here's a big patch against sil24-original branch. It contains the | followings. | | a. build fix & oops fix for sil24-original branch | b. backported sata_sil24_new driver | c. debug messages (you don't need to turn on ATA_DEBUG) | d. 50ms sleep after completion of IDENTIFY before actually reading data | | Building both sata_sil24 and sata_sil24_new as modules and | loading/unloading them work on my machine. Can you please try this | and let me know how it goes?
Real quick update on this (it's 2:40 am here): sata_sil24_new still does not detects my disks while sata_sil24 works perfectly. I will post the full dmesg's + the various things I tried tomorrow.
Signature · 2 lines
Marc Bevand http://epita.fr/~bevand_m Computer Science School EPITA - System, Network and Security Dept.
Hi again, Marc.
Quoted 16 lines · Marc Bevand
Hi Tejun.
Tejun Heo wrote:
| | Here's a big patch against sil24-original branch. It contains the | followings. | | a. build fix & oops fix for sil24-original branch | b. backported sata_sil24_new driver | c. debug messages (you don't need to turn on ATA_DEBUG) | d. 50ms sleep after completion of IDENTIFY before actually reading data | | Building both sata_sil24 and sata_sil24_new as modules and | loading/unloading them work on my machine. Can you please try this | and let me know how it goes?
Quoted 4 lines
Real quick update on this (it's 2:40 am here):
sata_sil24_newstill does not detects my disks whilesata_sil24works perfectly. I will post the full dmesg's + the various things I tried tomorrow.
I compared original and new sil24 and here are things that are done
differently upto the point where identify command is issued.
a. Stuff done inside sil_init_pm() in the original driver is not done
in the new driver. This includes clearing PM_EN and RESUME bits in the ctrl/stat register and DVR_RST'ing the port.
b. Original driver performs both SATA phy reset and soft reset. New
driver performs only SATA phy reset.
c. New driver uses different order when initializing irq mask and
doesn't turn on phy status change interrupt.
d. New driver doesn't turn off SATA link power management.
We've already tried #d, and I don't think #c has anything to do with
it as inserting 50ms sleep before reading data doesn't make any difference. So, it leaves us with #a and #b. Here's a patch for #a. If this doesn't work, I'll make a patch for #b.
This patch is on top of previous test patch which backportedsil24_new. Please try this one out and let me know the result.
Thanks.
drivers/scsi/sata_sil24_new.c +20 -5
@@ -431,15 +431,11 @@ static void sil24_irq_clear(struct ata_p/* unused */ } -static void sil24_reset_controller (struct ata_port *ap) +static int __sil24_reset_controller (void *port) { -void *port = (void *)ap->ioaddr.cmd_addr;int cnt;u32 tmp; - printk(KERN_NOTICE DRV_NAME - " ata%u: resetting controller...\n", ap->id); -/* Reset controller state. Is this correct? */ writel (PORT_CS_DEV_RST , port +PORT_CTRL_STAT );readl (port +PORT_CTRL_STAT );/* sync */
@@ -451,7 +447,17 @@ static void sil24_reset_controller(strucif (!(tmp &PORT_CS_DEV_RST ))break ; } +if (tmp &PORT_CS_DEV_RST ) +return -1 ; +return 0 ; +} + +static void sil24_reset_controller (struct ata_port *ap) +{ + printk(KERN_NOTICE DRV_NAME + " ata%u: resetting controller...\n", ap->id); +if (__sil24_reset_controller ((void *)ap->ioaddr.cmd_addr)) printk(KERN_ERR DRV_NAME" ata%u: failed to reset controller\n" , ap->id); }
@@ -745,6 +751,15 @@ static int sil24_init_one(struct pci_dev/* Clear interrupts */ writel (0x0fff0fff , port +PORT_IRQ_STAT );writel (PORT_CS_IRQ_WOC , port +PORT_CTRL_CLR ); + +/* Clear port enable and resume bits */ +writel (PORT_CS_PM_EN |PORT_CS_RESUME , port +PORT_CTRL_CLR ); + +/* Reset itself */ +if (__sil24_reset_controller (port)) + printk(KERN_ERR DRV_NAME +"(%s): failed to reset controller\n" , +pci_name (pdev)); }/* Turn on interrupts */
Hello Tejun.
Tejun Heo wrote:
| | I compared original and new sil24 and here are things that are done | differently upto the point where identify command is issued. | | a. Stuff done inside sil_init_pm() in the original driver is not done | in the new driver. This includes clearing PM_EN and RESUME bits | in the ctrl/stat register and DVR_RST'ing the port. | [...] | Here's a patch for #a. | This patch is on top of previous test patch which backported | sil24_new. Please try this one out and let me know the result.
Yes ! With this patch, my disk is recognized. Congratulations :-) See below for the dmesg. Let me know if you want me to try anything else. I would be happy to help you.
sata_sil24 version 0.20
ACPI: PCI Interrupt 0000:01:06.0[A] -> GSI 29 (level, low) -> IRQ 193
ata5: SATA max UDMA/100 cmd 0xFFFFC20000490000 ctl 0x0 bmdma 0x0 irq 193
ata6: SATA max UDMA/100 cmd 0xFFFFC20000492000 ctl 0x0 bmdma 0x0 irq 193
ata7: SATA max UDMA/100 cmd 0xFFFFC20000494000 ctl 0x0 bmdma 0x0 irq 193
ata8: SATA max UDMA/100 cmd 0xFFFFC20000496000 ctl 0x0 bmdma 0x0 irq 193
[ata_dev_identify ]: issuing 0xec, dev->id is at ffff810037183510 [sil24_fill_sg ]: filling 1 elements [sil24_fill_sg ]: 0000000037183510 512 80000000 [sil24_qc_issue ]: issuing command 0xec [ata_dev_identify ]: Command successfully completed, sleeping 50ms [ata_dev_identify ]: Dumping ID [ata_dev_identify ]: [000] 0c5a 3fff c837 0010 0000 0000 003f 0000 [ata_dev_identify ]: [008] 0000 0000 334a 5333 3030 5345 2020 2020 [ata_dev_identify ]: [016] 2020 2020 2020 2020 0000 4000 0004 332e [ata_dev_identify ]: [024] 3138 2020 2020 5354 3331 3630 3032 3341 [ata_dev_identify ]: [032] 5320 2020 2020 2020 2020 2020 2020 2020 [ata_dev_identify ]: [040] 2020 2020 2020 2020 2020 2020 2020 8010 [ata_dev_identify ]: [048] 0000 2f00 0000 0200 0200 0007 3fff 0010 [ata_dev_identify ]: [056] 003f fc10 00fb 0110 ffff 0fff 0000 0407 [ata_dev_identify ]: [064] 0003 0078 0078 00f0 0078 0000 0000 0000 [ata_dev_identify ]: [072] 0000 0000 0000 0000 0002 0000 0000 0000 [ata_dev_identify ]: [080] 007e 001b 346b 7d01 4003 3469 3c01 4003 [ata_dev_identify ]: [088] 007f 0000 0000 fefe 0000 0000 fe00 0000 [ata_dev_identify ]: [096] 0000 0000 0000 0000 9eb0 12a1 0000 0000 [ata_dev_identify ]: [104] 0000 0000 0000 0000 0000 0000 0000 0000 [ata_dev_identify ]: [112] 0000 0000 0000 0000 0000 0000 0000 0000 [ata_dev_identify ]: [120] 0000 0000 0000 0000 0000 0000 0000 0000 [ata_dev_identify ]: [128] 0001 9eb0 12a1 9eb0 12a1 2020 0002 42b6 [ata_dev_identify ]: [136] 8000 008a 3c06 3c0a ffff 07c6 0100 0800 [ata_dev_identify ]: [144] 0ff0 1000 0002 0030 0000 0000 0000 fe06 [ata_dev_identify ]: [152] 0000 0002 0050 008a 954f 0000 0023 000b [ata_dev_identify ]: [160] 0000 0000 0000 0000 0000 0000 0000 0000 [ata_dev_identify ]: [168] 0000 0000 0000 0000 0000 0000 0000 0000 [ata_dev_identify ]: [176] 0000 0000 0000 0000 0000 0000 0000 0000 [ata_dev_identify ]: [184] 0000 0000 0000 0000 0000 0000 0000 0000 [ata_dev_identify ]: [192] 0000 0000 0000 0000 0000 0000 0000 0000 [ata_dev_identify ]: [200] 0000 0000 0000 0000 0000 0000 0000 0000 [ata_dev_identify ]: [208] 0000 0000 0000 0000 0000 0000 0000 0000 [ata_dev_identify ]: [216] 0000 0000 0000 0000 0000 0000 0000 0000 [ata_dev_identify ]: [224] 0000 0000 0000 0000 0000 0000 0000 0000 [ata_dev_identify ]: [232] 0000 0000 0000 0000 0000 0000 0000 0000 [ata_dev_identify ]: [240] 0000 0000 0000 0000 0000 0000 0000 0000 [ata_dev_identify ]: [248] 0000 0000 0000 0000 0000 0000 0000 dda5
ata5: dev 0 cfg 49:2f00 82:346b 83:7d01 84:4003 85:3469 86:3c01 87:4003 88:007f
ata5: dev 0 ATA, max UDMA/133, 312581808 sectors: lba48
[sil24_qc_issue ]: issuing command 0xef
ata5: dev 0 configured for UDMA/100
scsi4 : sata_sil24
ata6: no device found (phy stat 00000000)
scsi5 : sata_sil24
ata7: no device found (phy stat 00000000)
scsi6 : sata_sil24
ata8: no device found (phy stat 00000000)
scsi7 : sata_sil24
Vendor: ATA Model: ST3160023AS Rev: 3.18
Type: Direct-Access ANSI SCSI revision: 05
SCSI device sdc: 312581808 512-byte hdwr sectors (160042 MB)
SCSI device sdc: drive cache: write back
SCSI device sdc: 312581808 512-byte hdwr sectors (160042 MB)
SCSI device sdc: drive cache: write back
sdc:<3>[sil24_fill_sg ]: filling 1 elements
[sil24_fill_sg ]: 0000000034fd0000 4096 80000000
[sil24_qc_issue ]: issuing command 0x25
sdc1
Attached scsi disk sdc at scsi4, channel 0, id 0, lun 0
Attached scsi generic sg2 at scsi4, channel 0, id 0, lun 0, type 0
[sil24_fill_sg ]: filling 1 elements [sil24_fill_sg ]: 0000000034fd1000 4096 80000000 [sil24_qc_issue ]: issuing command 0x25 [sil24_fill_sg ]: filling 1 elements [sil24_fill_sg ]: 0000000036c78000 4096 80000000 [sil24_qc_issue ]: issuing command 0x25 [sil24_fill_sg ]: filling 1 elements [sil24_fill_sg ]: 0000000036c79000 4096 80000000 [sil24_qc_issue ]: issuing command 0x25 [sil24_fill_sg ]: filling 1 elements [sil24_fill_sg ]: 000000003d3b4000 4096 80000000 [sil24_qc_issue ]: issuing command 0x25 [sil24_fill_sg ]: filling 1 elements [sil24_fill_sg ]: 00000000334d8000 4096 80000000 [sil24_qc_issue ]: issuing command 0x25 [sil24_fill_sg ]: filling 5 elements [sil24_fill_sg ]: 0000000038fee000 4096 0 [sil24_fill_sg ]: 000000003718e000 4096 0 [sil24_fill_sg ]: 000000003305f000 4096 0 [sil24_fill_sg ]: 000000003c80e000 4096 0 [sil24_fill_sg ]: 000000003b189000 4096 80000000 [sil24_qc_issue ]: issuing command 0x25 [sil24_fill_sg ]: filling 1 elements [sil24_fill_sg ]: 000000003a52c000 4096 80000000 [sil24_qc_issue ]: issuing command 0x25 [sil24_fill_sg ]: filling 1 elements [sil24_fill_sg ]: 00000000335ab000 4096 80000000 [sil24_qc_issue ]: issuing command 0x25 [sil24_fill_sg ]: filling 4 elements [sil24_fill_sg ]: 0000000037775000 1024 0 [sil24_fill_sg ]: 0000000037775400 1024 0 [sil24_fill_sg ]: 0000000037775800 1024 0 [sil24_fill_sg ]: 0000000037775c00 1024 80000000 [sil24_qc_issue ]: issuing command 0x25 [sil24_fill_sg ]: filling 4 elements [sil24_fill_sg ]: 000000003f42e000 1024 0 [sil24_fill_sg ]: 000000003f42e400 1024 0 [sil24_fill_sg ]: 000000003f42e800 1024 0 [sil24_fill_sg ]: 000000003f42ec00 1024 80000000 [sil24_qc_issue ]: issuing command 0x25 [sil24_fill_sg ]: filling 32 elements [sil24_fill_sg ]: 0000000039f89000 1024 0 [sil24_fill_sg ]: 0000000039f89400 1024 0 [sil24_fill_sg ]: 0000000039f89800 1024 0 [sil24_fill_sg ]: 0000000039f89c00 1024 0 [sil24_fill_sg ]: 0000000033a20000 1024 0 [sil24_fill_sg ]: 0000000033a20400 1024 0 [sil24_fill_sg ]: 0000000033a20800 1024 0 [sil24_fill_sg ]: 0000000033a20c00 1024 0 [sil24_fill_sg ]: 0000000033952000 1024 0 [sil24_fill_sg ]: 0000000033952400 1024 0 [sil24_fill_sg ]: 0000000033952800 1024 0 [sil24_fill_sg ]: 0000000033952c00 1024 0 [sil24_fill_sg ]: 000000003937f000 1024 0 [sil24_fill_sg ]: 000000003937f400 1024 0 [sil24_fill_sg ]: 000000003937f800 1024 0 [sil24_fill_sg ]: 000000003937fc00 1024 0 [sil24_fill_sg ]: 000000003301b000 1024 0 [sil24_fill_sg ]: 000000003301b400 1024 0 [sil24_fill_sg ]: 000000003301b800 1024 0 [sil24_fill_sg ]: 000000003301bc00 1024 0 [sil24_fill_sg ]: 000000003c17d000 1024 0 [sil24_fill_sg ]: 000000003c17d400 1024 0 [sil24_fill_sg ]: 000000003c17d800 1024 0 [sil24_fill_sg ]: 000000003c17dc00 1024 0 [sil24_fill_sg ]: 00000000373d5000 1024 0 [sil24_fill_sg ]: 00000000373d5400 1024 0 [sil24_fill_sg ]: 00000000373d5800 1024 0 [sil24_fill_sg ]: 00000000373d5c00 1024 0 [sil24_fill_sg ]: 0000000033b1e000 1024 0 [sil24_fill_sg ]: 0000000033b1e400 1024 0 [sil24_fill_sg ]: 0000000033b1e800 1024 0 [sil24_fill_sg ]: 0000000033b1ec00 1024 80000000 [sil24_qc_issue ]: issuing command 0x25 [sil24_fill_sg ]: filling 4 elements [sil24_fill_sg ]: 00000000388b2000 1024 0 [sil24_fill_sg ]: 00000000388b2400 1024 0 [sil24_fill_sg ]: 00000000388b2800 1024 0 [sil24_fill_sg ]: 00000000388b2c00 1024 80000000 [sil24_qc_issue ]: issuing command 0x25 [sil24_fill_sg ]: filling 4 elements [sil24_fill_sg ]: 0000000033b0d000 1024 0 [sil24_fill_sg ]: 0000000033b0d400 1024 0 [sil24_fill_sg ]: 0000000033b0d800 1024 0 [sil24_fill_sg ]: 0000000033b0dc00 1024 80000000 [sil24_qc_issue ]: issuing command 0x25 [sil24_fill_sg ]: filling 32 elements [sil24_fill_sg ]: 000000003e0b8000 1024 0 [sil24_fill_sg ]: 000000003e0b8400 1024 0 [sil24_fill_sg ]: 000000003e0b8800 1024 0 [sil24_fill_sg ]: 000000003e0b8c00 1024 0 [sil24_fill_sg ]: 000000003d4d1000 1024 0 [sil24_fill_sg ]: 000000003d4d1400 1024 0 [sil24_fill_sg ]: 000000003d4d1800 1024 0 [sil24_fill_sg ]: 000000003d4d1c00 1024 0 [sil24_fill_sg ]: 0000000034fce000 1024 0 [sil24_fill_sg ]: 0000000034fce400 1024 0 [sil24_fill_sg ]: 0000000034fce800 1024 0 [sil24_fill_sg ]: 0000000034fcec00 1024 0 [sil24_fill_sg ]: 000000003caeb000 1024 0 [sil24_fill_sg ]: 000000003caeb400 1024 0 [sil24_fill_sg ]: 000000003caeb800 1024 0 [sil24_fill_sg ]: 000000003caebc00 1024 0 [sil24_fill_sg ]: 0000000038132000 1024 0 [sil24_fill_sg ]: 0000000038132400 1024 0 [sil24_fill_sg ]: 0000000038132800 1024 0 [sil24_fill_sg ]: 0000000038132c00 1024 0 [sil24_fill_sg ]: 0000000039b41000 1024 0 [sil24_fill_sg ]: 0000000039b41400 1024 0 [sil24_fill_sg ]: 0000000039b41800 1024 0 [sil24_fill_sg ]: 0000000039b41c00 1024 0 [sil24_fill_sg ]: 00000000371be000 1024 0 [sil24_fill_sg ]: 00000000371be400 1024 0 [sil24_fill_sg ]: 00000000371be800 1024 0 [sil24_fill_sg ]: 00000000371bec00 1024 0 [sil24_fill_sg ]: 0000000037623000 1024 0 [sil24_fill_sg ]: 0000000037623400 1024 0 [sil24_fill_sg ]: 0000000037623800 1024 0 [sil24_fill_sg ]: 0000000037623c00 1024 80000000 [sil24_qc_issue ]: issuing command 0x25 [sil24_fill_sg ]: filling 32 elements [sil24_fill_sg ]: 000000003a7d7000 1024 0 [sil24_fill_sg ]: 000000003a7d7400 1024 0 [sil24_fill_sg ]: 000000003a7d7800 1024 0 [sil24_fill_sg ]: 000000003a7d7c00 1024 0 [sil24_fill_sg ]: 0000000038964000 1024 0 [sil24_fill_sg ]: 0000000038964400 1024 0 [sil24_fill_sg ]: 0000000038964800 1024 0 [sil24_fill_sg ]: 0000000038964c00 1024 0 [sil24_fill_sg ]: 0000000038914000 1024 0 [sil24_fill_sg ]: 0000000038914400 1024 0 [sil24_fill_sg ]: 0000000038914800 1024 0 [sil24_fill_sg ]: 0000000038914c00 1024 0 [sil24_fill_sg ]: 00000000334fe000 1024 0 [sil24_fill_sg ]: 00000000334fe400 1024 0 [sil24_fill_sg ]: 00000000334fe800 1024 0 [sil24_fill_sg ]: 00000000334fec00 1024 0 [sil24_fill_sg ]: 00000000334ff000 1024 0 [sil24_fill_sg ]: 00000000334ff400 1024 0 [sil24_fill_sg ]: 00000000334ff800 1024 0 [sil24_fill_sg ]: 00000000334ffc00 1024 0 [sil24_fill_sg ]: 00000000368c0000 1024 0 [sil24_fill_sg ]: 00000000368c0400 1024 0 [sil24_fill_sg ]: 00000000368c0800 1024 0 [sil24_fill_sg ]: 00000000368c0c00 1024 0 [sil24_fill_sg ]: 00000000368c1000 1024 0 [sil24_fill_sg ]: 00000000368c1400 1024 0 [sil24_fill_sg ]: 00000000368c1800 1024 0 [sil24_fill_sg ]: 00000000368c1c00 1024 0 [sil24_fill_sg ]: 0000000034f54000 1024 0 [sil24_fill_sg ]: 0000000034f54400 1024 0 [sil24_fill_sg ]: 0000000034f54800 1024 0 [sil24_fill_sg ]: 0000000034f54c00 1024 80000000 [sil24_qc_issue ]: issuing command 0x25 [sil24_fill_sg ]: filling 8 elements [sil24_fill_sg ]: 000000003b274000 4096 0 [sil24_fill_sg ]: 000000003989e000 4096 0 [sil24_fill_sg ]: 00000000382a8000 4096 0 [sil24_fill_sg ]: 0000000039a5a000 4096 0 [sil24_fill_sg ]: 000000003a7bc000 4096 0 [sil24_fill_sg ]: 000000003a797000 4096 0 [sil24_fill_sg ]: 000000003b236000 4096 0 [sil24_fill_sg ]: 000000003a159000 4096 80000000 [sil24_qc_issue ]: issuing command 0x25 [sil24_fill_sg ]: filling 8 elements [sil24_fill_sg ]: 000000003b236000 4096 0 [sil24_fill_sg ]: 0000000033878000 4096 0 [sil24_fill_sg ]: 000000003859f000 4096 0 [sil24_fill_sg ]: 00000000330e4000 4096 0 [sil24_fill_sg ]: 000000003f1ce000 4096 0 [sil24_fill_sg ]: 000000003579e000 4096 0 [sil24_fill_sg ]: 0000000039ccc000 4096 0 [sil24_fill_sg ]: 0000000034fdb000 4096 80000000 [sil24_qc_issue ]: issuing command 0x25 [sil24_fill_sg ]: filling 4 elements [sil24_fill_sg ]: 0000000034f55000 1024 0 [sil24_fill_sg ]: 0000000034f55400 1024 0 [sil24_fill_sg ]: 0000000034f55800 1024 0 [sil24_fill_sg ]: 0000000034f55c00 1024 80000000 [sil24_qc_issue ]: issuing command 0x25 [sil24_fill_sg ]: filling 4 elements [sil24_fill_sg ]: 000000003354a000 1024 0 [sil24_fill_sg ]: 000000003354a400 1024 0 [sil24_fill_sg ]: 000000003354a800 1024 0 [sil24_fill_sg ]: 000000003354ac00 1024 80000000 [sil24_qc_issue ]: issuing command 0x25 [sil24_fill_sg ]: filling 32 elements [sil24_fill_sg ]: 000000003eacb000 1024 0 [sil24_fill_sg ]: 000000003eacb400 1024 0 [sil24_fill_sg ]: 000000003eacb800 1024 0 [sil24_fill_sg ]: 000000003eacbc00 1024 0 [sil24_fill_sg ]: 000000003c230000 1024 0 [sil24_fill_sg ]: 000000003c230400 1024 0 [sil24_fill_sg ]: 000000003c230800 1024 0 [sil24_fill_sg ]: 000000003c230c00 1024 0 [sil24_fill_sg ]: 00000000338fb000 1024 0 [sil24_fill_sg ]: 00000000338fb400 1024 0 [sil24_fill_sg ]: 00000000338fb800 1024 0 [sil24_fill_sg ]: 00000000338fbc00 1024 0 [sil24_fill_sg ]: 000000003688f000 1024 0 [sil24_fill_sg ]: 000000003688f400 1024 0 [sil24_fill_sg ]: 000000003688f800 1024 0 [sil24_fill_sg ]: 000000003688fc00 1024 0 [sil24_fill_sg ]: 00000000330e1000 1024 0 [sil24_fill_sg ]: 00000000330e1400 1024 0 [sil24_fill_sg ]: 00000000330e1800 1024 0 [sil24_fill_sg ]: 00000000330e1c00 1024 0 [sil24_fill_sg ]: 000000003b5d2000 1024 0 [sil24_fill_sg ]: 000000003b5d2400 1024 0 [sil24_fill_sg ]: 000000003b5d2800 1024 0 [sil24_fill_sg ]: 000000003b5d2c00 1024 0 [sil24_fill_sg ]: 00000000382a8000 1024 0 [sil24_fill_sg ]: 00000000382a8400 1024 0 [sil24_fill_sg ]: 00000000382a8800 1024 0 [sil24_fill_sg ]: 00000000382a8c00 1024 0 [sil24_fill_sg ]: 0000000039a5a000 1024 0 [sil24_fill_sg ]: 0000000039a5a400 1024 0 [sil24_fill_sg ]: 0000000039a5a800 1024 0 [sil24_fill_sg ]: 0000000039a5ac00 1024 80000000 [sil24_qc_issue ]: issuing command 0x25 [sil24_fill_sg ]: filling 8 elements [sil24_fill_sg ]: 000000003b274000 4096 0 [sil24_fill_sg ]: 000000003968c000 4096 0 [sil24_fill_sg ]: 0000000038ea9000 4096 0 [sil24_fill_sg ]: 000000003a7bc000 4096 0 [sil24_fill_sg ]: 0000000038611000 4096 0 [sil24_fill_sg ]: 00000000371d1000 4096 0 [sil24_fill_sg ]: 0000000034fd2000 4096 0 [sil24_fill_sg ]: 0000000038bb0000 4096 80000000 [sil24_qc_issue ]: issuing command 0x25
Signature · 2 lines
Marc Bevand http://epita.fr/~bevand_m Computer Science School EPITA - System, Network and Security Dept.
Hello, Marc.
Quoted 15 lines · Marc Bevand
Hello Tejun.
Tejun Heo wrote:
| | I compared original and new sil24 and here are things that are done | differently upto the point where identify command is issued. | | a. Stuff done inside sil_init_pm() in the original driver is not done | in the new driver. This includes clearing PM_EN and RESUME bits | in the ctrl/stat register and DVR_RST'ing the port. | [...] | Here's a patch for #a. | This patch is on top of previous test patch which backported | sil24_new. Please try this one out and let me know the result.
Quoted 1 line
Yes ! With this patch, my disk is recognized. Congratulations :-)
Great. :-)
Quoted 2 lines
See below for the dmesg. Let me know if you want me to try anything else. I would be happy to help you.
Everything looks dandy. Here's a patch against the current sil24
head of libata-dev tree. It should also apply cleanly to ALL head. Please try this one and let me know how it works; then, the patch will go to Jeff & upstream.
drivers/scsi/sata_sil24.c +22 -7
@@ -426,15 +426,11 @@ static void sil24_irq_clear(struct ata_p/* unused */ } -static void sil24_reset_controller (struct ata_port *ap) +static int __sil24_reset_controller (void *port) { -void *port = (void *)ap->ioaddr.cmd_addr;int cnt;u32 tmp; - printk(KERN_NOTICE DRV_NAME - " ata%u: resetting controller...\n", ap->id); -/* Reset controller state. Is this correct? */ writel (PORT_CS_DEV_RST , port +PORT_CTRL_STAT );readl (port +PORT_CTRL_STAT );/* sync */
@@ -446,9 +442,19 @@ static void sil24_reset_controller(strucif (!(tmp &PORT_CS_DEV_RST ))break ; } +if (tmp &PORT_CS_DEV_RST ) - printk(KERN_ERR DRV_NAME -" ata%u: failed to reset controller\n" , ap->id); +return -1 ; +return 0 ; +} + +static void sil24_reset_controller (struct ata_port *ap) +{ + printk(KERN_NOTICE DRV_NAME + " ata%u: resetting controller...\n", ap->id); +if (__sil24_reset_controller ((void *)ap->ioaddr.cmd_addr)) + printk(KERN_ERR DRV_NAME +" ata%u: failed to reset controller\n" , ap->id); }static void sil24_eng_timeout (struct ata_port *ap)
@@ -740,6 +746,15 @@ static int sil24_init_one(struct pci_dev/* Clear interrupts */ writel (0x0fff0fff , port +PORT_IRQ_STAT );writel (PORT_CS_IRQ_WOC , port +PORT_CTRL_CLR ); + +/* Clear port multiplier enable and resume bits */ +writel (PORT_CS_PM_EN |PORT_CS_RESUME , port +PORT_CTRL_CLR ); + +/* Reset itself */ +if (__sil24_reset_controller (port)) + printk(KERN_ERR DRV_NAME +"(%s): failed to reset controller\n" , +pci_name (pdev)); }/* Turn on interrupts */
Tejun Heo wrote:
| | Everything looks dandy. Here's a patch against the current sil24 | head of libata-dev tree. It should also apply cleanly to ALL head. | Please try this one and let me know how it works; then, the patch will | go to Jeff & upstream.
I confirm that my disk is recognized when using this patch with libata-dev.git current, ALL head.
Thank you for your hard work.
Signature · 2 lines
Marc Bevand http://epita.fr/~bevand_m Computer Science School EPITA - System, Network and Security Dept.