Bug 9505

Summary: [sata_sil][sata->ide-bridg] failed to set xfermode
Product: IO/Storage Reporter: Oleksij Rempel (fishor) (bug-track)
Component: Serial ATAAssignee: Tejun Heo (htejun)
Status: RESOLVED CODE_FIX    
Severity: normal CC: bug-track, mark.paulus, sveint
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.22, 2.6.24-rc3 Subsystem:
Regression: --- Bisected commit-id:
Attachments: 2.6.24-rc3-dmesg
2.6.22-dmesg
debug.patch
debug.patch
2.6.24-rc3-dmesg
Log file with debug patch enabled.
sata_sil-irq-fix.patch
dmesg output of problem from 2.6.22 kernel
Reject from trying to apply sata_sil-irq-fix patch to 2.6.22 source
Reject from trying to apply sata_sil-irq-fix patch to 2.6.22 source
sata_sil-irq-fix patch from my 2.6.22 build environment.

Description Oleksij Rempel (fishor) 2007-12-05 08:06:55 UTC
Distribution: Ubuntu Gutsy

WDC WD1200JB(pata) connected with sata->ide adapter to sata_sil.
With kernel 2.6.22 it get error "failed to set xfermode"
and with 2.6.24-rc3(ubuntu package):
[   37.665881] ata2.00: failed to IDENTIFY (I/O error, err_mask=0x40)
[   37.665884] ata2.00: revalidation failed (errno=-5)
Comment 1 Oleksij Rempel (fishor) 2007-12-05 08:07:40 UTC
Created attachment 13866 [details]
2.6.24-rc3-dmesg
Comment 2 Oleksij Rempel (fishor) 2007-12-05 08:09:48 UTC
Created attachment 13867 [details]
2.6.22-dmesg
Comment 3 Oleksij Rempel (fishor) 2007-12-05 08:11:38 UTC
Firs this bug was reported to ubuntu backtrack, see:
https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.22/+bug/153096
Comment 4 Oleksij Rempel (fishor) 2007-12-05 08:14:11 UTC
Created attachment 13868 [details]
debug.patch
Comment 5 Oleksij Rempel (fishor) 2007-12-05 08:15:16 UTC
Created attachment 13869 [details]
debug.patch
Comment 6 Oleksij Rempel (fishor) 2007-12-05 08:15:46 UTC
Created attachment 13870 [details]
2.6.24-rc3-dmesg
Comment 7 Svein Tore Seljebotn 2007-12-05 15:48:22 UTC
Created attachment 13879 [details]
Log file with debug patch enabled.

This is a log file of booting the 2.6.24-1 kernel on my PC with the debug patch mentioned above in kernel. I am now using 2.6.20(-16, Ubuntu feisty) and the harddrives both work great. Only one works in newer kernels.

SATA controller is Sil 3112 SATA Controller onboard on a Abit NF7-S v2.0 motherboard. Chipset is NVIDIA nForce2 SPP.
Comment 8 Tejun Heo 2007-12-05 18:08:56 UTC
Created attachment 13881 [details]
sata_sil-irq-fix.patch

Please test whether the attached patch fixes the problem.
Comment 9 Mark Paulus 2007-12-06 06:04:52 UTC
Created attachment 13888 [details]
dmesg output of problem from 2.6.22 kernel

This is the dmesg from 2.6.22 bootup using a generic SIL3112 card and a HD attached with a SATA->PATA bridge, a SD-ADSAIDE-S1, with a sil3611ct80 chip on board.
Comment 10 Dušan Dragić 2007-12-06 07:01:15 UTC
The patch works for me.
- kernel 2.6.24-rc4
- Abit NF7-S mobo with onboard sil3112, hard drive attached with a Abit Serillel pata-to-sata bridge (I think it uses the sil3611 chip).

Now I can finally upgrade the kernel... I've been stuck with 2.6.21 for ages :)
Comment 11 Mark Paulus 2007-12-06 07:07:38 UTC
Created attachment 13890 [details]
Reject from trying to apply sata_sil-irq-fix patch to 2.6.22 source
Comment 12 Mark Paulus 2007-12-06 07:08:11 UTC
Created attachment 13891 [details]
Reject from trying to apply sata_sil-irq-fix patch to 2.6.22 source
Comment 13 Mark Paulus 2007-12-06 07:11:27 UTC
The patch didn't apply cleanly, and when I tried to apply the patch by hand and compile, I get the following error:

drivers/ata/libata-core.c: In function 'ata_std_postreset':
drivers/ata/libata-core.c:3583: error: 'link' undeclared (first use in this function)
drivers/ata/libata-core.c:3583: error: (Each undeclared identifier is reported only once
drivers/ata/libata-core.c:3583: error: for each function it appears in.)
Comment 14 Oleksij Rempel (fishor) 2007-12-06 07:31:54 UTC
@Mark This patch is against 2.6.24-rc4
Comment 15 Tejun Heo 2007-12-06 17:23:22 UTC
Alexey, can you confirm the fix too?
Comment 16 Svein Tore Seljebotn 2007-12-07 00:01:25 UTC
Alexey filed it here on our behalf as the bug originally was in Ubuntu's launchpad. He doesn't have this problem himself. I tried to build and install a kernel, but I got trouble when installing it (not related to your code). I will try to build it again in some hours.
Comment 17 Oleksij Rempel (fishor) 2007-12-07 02:07:42 UTC
Here is my kernel i use on my system for debug purpose, there is no sound and should be no network for you. sata_sil is enabled and patched, at leas this should work.
http://rapidshare.com/files/74878489/linux-image-2.6.24-rc4-patched_2.6.24-rc4-patched-10.00.Custom_i386.deb

check if it complete:
md5sum linux-image-2.6.24-rc4-patched_2.6.24-rc4-patched-10.00.Custom_i386.deb
should be: 8c6198b90c2cf050023d9e4529aab838

to install use:
sudo dpkg -i linux-image-2.6.24-rc4-patched_2.6.24-rc4-patched-10.00.Custom_i386.deb

to remove:
sudo dpkg -r linux-image-2.6.24-rc4-patched
Comment 18 Svein Tore Seljebotn 2007-12-07 04:06:56 UTC
Patch works! :)

Thanks a lot Tejun for the fix and Alexey for all the help debugging and making it work!
Comment 19 Mark Paulus 2007-12-07 05:38:40 UTC
Created attachment 13903 [details]
sata_sil-irq-fix patch from my  2.6.22 build environment.

This is the sata_sil-irq-fix patch file, but name and location adjusted for the 2.6.22 kernel.  It works fine there after changing the name in libaba-core.c.

My 2.6.22 kernel is now booting correctly.
Comment 20 Tejun Heo 2007-12-07 15:22:02 UTC
Yeah, this one is for -stable too.  I'll forward the patch upstream and -stable.  Resolving as CODE_FIX.  Thanks.