pata_sis fails to enable udma100, which causes a long (~1min) delay at boot. Patch available!

Bug #155702 reported by Toph
20
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Released
Undecided
Unassigned
Nominated for Gutsy by David Wynn
linux-source-2.6.22 (Ubuntu)
Won't Fix
Low
Unassigned
Nominated for Gutsy by David Wynn

Bug Description

Binary package hint: linux-image-2.6.22-14-generic

When booting up gutsy, kernel linux-image-2.6.22-14-gerenic, on a Clevo2700c laptop (Pentium3, 1GHz, Sis630 chipset, IDE interface is SIS5513), pata_sis does not enable udma100. It does try 3 times, which takes about 1 minute and spits out the errors listed below. Then it falls back to udma66 which does enable the interface successfully. These are the corresponding lines from kern.log:

------------
Oct 22 09:17:57 localhost kernel: [ 30.915512] pata_sis 0000:00:00.1: version 0.5.1
Oct 22 09:17:57 localhost kernel: [ 30.915876] ata1: PATA max UDMA/100 cmd 0x000101f0 ctl 0x000103f6 bmdma 0x00011100 irq 14
Oct 22 09:17:57 localhost kernel: [ 30.915978] ata2: PATA max UDMA/100 cmd 0x00010170 ctl 0x00010376 bmdma 0x00011108 irq 15
Oct 22 09:17:57 localhost kernel: [ 38.024000] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen
Oct 22 09:17:57 localhost kernel: [ 38.024000] ata1.00: cmd c8/00:08:00:00:00/00:00:00:00:00/e0 tag 0 cdb 0x0 data 4096 in
Oct 22 09:17:57 localhost kernel: [ 38.024000] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
Oct 22 09:17:57 localhost kernel: [ 38.024000] ata1: soft resetting port
Oct 22 09:17:57 localhost kernel: [ 38.196000] ata1.00: configured for UDMA/100
Oct 22 09:17:57 localhost kernel: [ 38.196000] ata1: EH complete
Oct 22 09:17:57 localhost kernel: [ 68.196000] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen
Oct 22 09:17:57 localhost kernel: [ 68.196000] ata1.00: cmd c8/00:08:00:00:00/00:00:00:00:00/e0 tag 0 cdb 0x0 data 4096 in
Oct 22 09:17:57 localhost kernel: [ 68.196000] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
Oct 22 09:17:57 localhost kernel: [ 68.196000] ata1: soft resetting port
Oct 22 09:17:57 localhost kernel: [ 68.368000] ata1.00: configured for UDMA/100
Oct 22 09:17:57 localhost kernel: [ 68.368000] ata1: EH complete
Oct 22 09:17:57 localhost kernel: [ 98.368000] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen
Oct 22 09:17:57 localhost kernel: [ 98.368000] ata1.00: cmd c8/00:08:00:00:00/00:00:00:00:00/e0 tag 0 cdb 0x0 data 4096 in
Oct 22 09:17:57 localhost kernel: [ 98.368000] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
Oct 22 09:17:57 localhost kernel: [ 98.368000] ata1: soft resetting port
Oct 22 09:17:57 localhost kernel: [ 98.540000] ata1.00: configured for UDMA/100
Oct 22 09:17:57 localhost kernel: [ 98.540000] ata1: EH complete
Oct 22 09:17:57 localhost kernel: [ 128.540000] ata1.00: limiting speed to UDMA/66:PIO4
Oct 22 09:17:57 localhost kernel: [ 128.540000] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen
Oct 22 09:17:57 localhost kernel: [ 128.540000] ata1.00: cmd c8/00:08:00:00:00/00:00:00:00:00/e0 tag 0 cdb 0x0 data 4096 in
Oct 22 09:17:57 localhost kernel: [ 128.540000] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
Oct 22 09:17:57 localhost kernel: [ 128.540000] ata1: soft resetting port
Oct 22 09:17:57 localhost kernel: [ 128.712000] ata1.00: configured for UDMA/66
Oct 22 09:17:57 localhost kernel: [ 128.712000] ata1: EH complete
Oct 22 09:17:57 localhost kernel: [ 128.716000] sda1 sda2 <<5>sd 0:0:0:0: [sda] 58711968 512-byte hardware sectors (30061 MB)
Oct 22 09:17:57 localhost kernel: [ 128.748000] sd 0:0:0:0: [sda] Write Protect is off
Oct 22 09:17:57 localhost kernel: [ 128.748000] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
Oct 22 09:17:57 localhost kernel: [ 128.748000] sda5<5>sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
---------------

A similar bug has been reported for the red hat and suse distributions and a fix went into linux-2.6.23. From the 2.6.23 Changelog:

---
pata_sis: add missing UDMA5 timing value in sis_66_set_dmamode()

sis_66_set_dmamode() also handles early UDMA100 (SIS630 ET) but is
missing udma timing value for UDMA100. According to sis5513, this
should be 0x8000. This caused UDMA100 device to fail on pata_sis till
it downgrades to UDMA66 while it works fine on sis5513 at UDMA100.

Reported by Adam Blech.

Signed-off-by: Tejun Heo <email address hidden>
Cc: Adam Blech <email address hidden>
Signed-off-by: Jeff Garzik <email address hidden>
---

The corresponding patch is a oneliner, which does apply cleanly to linux-2.6.22.9 from the ubuntu's linux-source-2.6.22.14.21 package. It does fix the issue reported in this bug.

---
drivers/ata/pata_sis.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/ata/pata_sis.c b/drivers/ata/pata_sis.c
index da3f720..3b5be77 100644
--- a/drivers/ata/pata_sis.c
+++ b/drivers/ata/pata_sis.c
@@ -376,8 +376,9 @@ static void sis_66_set_dmamode (struct ata_port *ap, struct
ata_device *adev)
        int drive_pci = sis_old_port_base(adev);
        u16 timing;

+ /* MWDMA 0-2 and UDMA 0-5 */
        const u16 mwdma_bits[] = { 0x008, 0x302, 0x301 };
- const u16 udma_bits[] = { 0xF000, 0xD000, 0xB000, 0xA000, 0x9000};
+ const u16 udma_bits[] = { 0xF000, 0xD000, 0xB000, 0xA000, 0x9000,
0x8000 };

        pci_read_config_word(pdev, drive_pci, &timing);
---

So please do incorporate this patch into gutsy's 2.6.22 kernel. It does reduce boot time on SIS-IDE-chipsets by ~100s. See http://<email address hidden>/msg10565.html for additional information.

Best regards,

   Christoph Richter

Revision history for this message
Toph (prof-toph) wrote :

This is the mentioned patch, this time it does really apply cleanly to gutsy's kernel.

Toph (prof-toph)
Changed in linux-source-2.6.22:
assignee: nobody → ubuntu-kernel-storage
Revision history for this message
David Wynn (wynn-david) wrote :

Worthy of noting. I have no problems with SiS5513 IDE in my Feisty distribution, but cannot get it loaded without some initramfs-tools overrides in my Gutsy distribution. I would guess this is the reason:

From /boot/config-2.6.20-16-generic (feisty)
CONFIG_BLK_DEV_SIS5513=m

From /boot/config-2.6.22-14-generic (gutsy)
# CONFIG_BLK_DEV_SIS5513 is not set

I notice that there are other similar options that were enabled in feisty that, for some reason, have been disabled in gutsy. I would guess this is the reason for the slew of issues with bad boots.

Please allow for this module in the kernel again. Thanks.

Revision history for this message
David Wynn (wynn-david) wrote :

Marked as a duplicate of 150693. Both are dealing with the SiS 5513 driver. My own experience with the SiS 5513 driver showed that enabling the kernel module for SiS 5513 fixed my computer. Module was enabled in Feisty, but disabled in Gutsy for some reason.

Revision history for this message
Toph (prof-toph) wrote :

I don't think this bug is a duplicate of #150693, just because it deals with the same module! And your "fix", David, would better be called a workaround.

Gutsy does use the kernel's new libata consistently for all chipsets. Being relatively new code, it is by far not as mature and stable as the old IDE-BLK_DEV-code. It is considered the future, though, and the old ide-core will some day become deprecated.

That's why we should actually try to fix bugs in libata and make it as stable and reliable as our old trusted ide-modules. The patch I posted went into mainline kernel 2.6.23 and other distributions. It is essentially just a typo that should be fixed. See that thread on linux-ide-ml: http://marc.info/?i=20070921072905.GC10660%20()%20htj%20!%20dyndns%20!%20org

So could somebody responsible for gutsy's kernel please at least acknowledge that bug. Thanks!

Revision history for this message
David Wynn (wynn-david) wrote :

BTW -- I can't vouch for effectiveness of this fix. I recompiled the 2.6.23 (which already has this "fix" coded in) and my computer failed to boot -- got the 1 millimeter of progress hang. But recompiling the 2.6.23 kernel *with* the SIS5513 module fixed my problem. But then 2.6.22 worked fine for me also once the SIS5513 module was included. So, from my experience, SIS5513 issues continue to stem from the absence of the module in the Ubuntu kernel. (If there is supposed to be code the replaces the SIS5513 module, that code has not been installed in the kernel's for 2.6.22 or 2.6.23)

I have, however, removed the duplicate tag from this bug.

Revision history for this message
John Rose (johnaaronrose) wrote :

David, If Gutsy update includes kernel 2.6.23, will it still have this bug (as kernel may not include sis5513.ko)? Pardon me as a recent Newbie. I've seen howto for recompile of kernel (e.g. http://ubuntuforums.org/showthread.php?t=56835). But I haven't seen howto for recompile including sis5513 module (i presume that it's sis5513.ko). Can you give me any guidance? I have sis5513.ko on my desktop in feisty kernel directory. John

Revision history for this message
Toph (prof-toph) wrote :

Nobody does feel responsible at ubuntu-kernel-storage!

Changed in linux-source-2.6.22:
assignee: ubuntu-kernel-storage → ubuntu-kernel-team
Revision history for this message
David Wynn (wynn-david) wrote :

I tried recompiling the latest stable kernel from the official kernel archives -- 2.6.23.8 -- by taking the stock Ubuntu .config file and a make oldconfig. By using Ubuntu's .config file, the SiS 5513 module was *not* included in the kernel. For that test, I had the same results as I have with the provided Gutsy kernel -- my computer would not boot because it could not find the hard drives.

But the simple task of enabling the SiS 5513 module to be built got my computer up and running. So, I currently have a Gutsy computer with a 2.6.23.8 kernel and, with the help of "envy", the latest nvidia drivers.

This is all that needs to change. In the .config file, instead of this:
# CONFIG_BLK_DEV_SIS5513 is not set

Use this:
CONFIG_BLK_DEV_SIS5513=m

I've been hearing that we're somehow trying to move away from whatever the SIS5513 module is trying to accomplish. That may be, but we didn't accomplish it for Gutsy -- and now we've broken everyone that uses this kind of interface (including SiS 5513 and Intel 82801 EB/ER IDE controllers, and any other controllers that use this module).

Evidently the Ubuntu kernel folk canceled this hardware-specific kernel fix, then forgot to actually test it on the related hardware. And now that this is in the "stable" distribution, we're having a hard time convincing them that they've dropped support for these specific IDE controllers.

Cheers!

Revision history for this message
John Rose (johnaaronrose) wrote :

David,

Sorry to pester you. I've amended the /boot/config-2.6.22-14-generic file to show CONFIG_BLK_DEV_SIS5513=m. however, there is no sis5513.ko file in /lib/modules/2.6.22-14-generic/kernel/drivers/ide/pci/ so I copied the one from 2.6.20-16-generic. However, dmesg of sis5513 disagrees ... symbol structure table. I have tried googling etc to find correct version of sis5513.ko. Do you have it or can you point me to it?

Regards,
John

Revision history for this message
Sergey Kiselev (skiselev) wrote :

Same problem here. (Hardware: ASUS TUSI-M, SiS630ET chipset. Running Ubuntu 7.10/i686)
To make the things worse, when using md (software RAID), system won't boot, because /dev/md* won't appear during a default delay of 180 seconds (delay could be extended by passing larger value, using rootdelay=<delay> parameter, but this is an ugly solution...).
Patch above (adding udma value for UDMA100) fixes the problem.
I recompiled pata_sis driver out of kernel tree (so I didn't had to recomplie whole the kernel).

Revision history for this message
Henrik Nilsen Omma (henrik) wrote :

This will be retargeted towards the Hardy kernel once it is released. I've tagged this as "hardy-kernel-candidate" so that we make sure to retarget this report once the new release is out. However against the linux-source-2.6.22 package this is being marked as "Won't Fix" as it does not meet the criteria for a stable release update. To learn more about the stable release update process please refer to https://wiki.ubuntu.com/StableReleaseUpdates . Thanks!

Changed in linux-source-2.6.22:
importance: Undecided → Low
status: New → Won't Fix
Revision history for this message
Toph (prof-toph) wrote :

Dear Henrik,
I have just read the criteria for stable release updates (SRU) - one of them is "Bugs which represent severe regressions from the previous release of Ubuntu".
To use UDMA66 when UDMA100 is available might not be a serious regression. A 300% boot (and _resume_) time increase would be judged a serious regression by any user, tough.

Furthermore the logic behind the SRU-guidelines is to not risk any system instability. "Therefore, when updates are proposed, they must be accompanied by a strong rationale and present a low risk of regressions." The fact that the proposed patch (which does only weigh 6 chars) went into other major distributions as well as into mainline kernel shows quite clearly, that it fullfills both points: A neglectable risk of regressions _and_ a strong enough rational to convince a number of knowledgeable kernel and distribution maintainers.

So please do ignore all that talk about reenabling the old pata-code. That's clearly outside of the scope of a SRU. Fixing libata's pata_sis is (in my opinion) not.

Revision history for this message
David Wynn (wynn-david) wrote :

Just a note of clarification. My particular problem was related to an upgrade from Feisty to Gutsy. See Bug 152820. I had to make some tweaks to /etc/fstab as indicated in the other bug.

Cheers!

Revision history for this message
Leann Ogasawara (leannogasawara) wrote :

Hardy Heron Alpha2 was recently released. It contains an updated version of the kernel. You can download and try the new Hardy Heron Alpha2 release from http://cdimage.ubuntu.com/releases/hardy/alpha-2/ . You should be able to then test the new kernel via the LiveCD. If you can, please verify if this bug still exists or not and report back your results. General information regarding the release can also be found here: http://www.ubuntu.com/testing/hardy/alpha2 . Thanks!

Changed in linux:
status: New → Incomplete
Revision history for this message
yaztromo (tromo) wrote :

I just took our server down at work to try the CD since it was having issues with the gutsy kernel due to this bug. There's still some kind of problem with the livecd kernel and my 5513 chipset. Lots of buffer i/o errors all over the place, even when it is not trying to access any drives. The long bootup delay is gone however. Unfortunately I cannot post the dmesg log since I had no way to get any data off the rig.

The fiesty kernel is still rock solid for me on this machine so I'll be sticking to that for now. Thanks for working on this bug :) Really hope it gets fixed eventually.

Revision history for this message
Leann Ogasawara (leannogasawara) wrote :

Yaztromo, thanks for testing and the update. I'm a little concerned that you may be experiencing a slightly different bug. The reason I say this is that the patch referenced in the bug description which supposedly resolves this issue is included in the newer Hardy kernels. You may want to open a new separate bug report.

Toph, since you are the original bug reporter, can you confirm this issue is resolved for you with the newer Hardy kernel? Thanks.

Revision history for this message
yaztromo (tromo) wrote :

Leann, thank you, I will try Hardy Alpha 3 on my server very soon and report back.

Revision history for this message
Toph (prof-toph) wrote :

I'm not running Ubuntu Hardy on the laptop, where I've been experiencing said bug. But I can confirm that this bug is fixed for me in stock 2.6.23.1-12, which is my current kernel on this SIS630-laptop.
So I guess it's safe, to mark _this_ bug as FIXED for hardy.
Yaztromo's symptoms seem to be a different bug to me, too. BTW: Not only does the pata_sis module decrease performance significantly when compared to the old sis5513 module, it is still marked EXPERIMENTAL in kernel-config (even in 2.6.24). Maybe it would really be a wise idea to stick with the old IDE-module until pata_sis has stabilized. The differering device names (hda vs. sda) could be circumvented by some simple udev-rule. In my oppinion this would be a good idea at least for the server-kernel.
( Although I don't think any clever mind would build an important server on SIS-hardware. ;-)

Revision history for this message
yaztromo (tromo) wrote :

I'm not going to bite :) Although I will say I love SIS chipsets, they are rock solid. At least for me they are.

Anyway. Yes this bug is now fixed for me using Hardy Alpha 3 CD. Didn't have time to test performance since the box has to be available for other things.

Based on what Toph has said regarding reduced performance I will probably not upgrade this server to Hardy when it is released though.

Revision history for this message
Leann Ogasawara (leannogasawara) wrote :

Per the last sets of comments I'm marking this bug as 'Fix Released'. Thanks for all the testing and feedback everyone, it's very much appreciated!

Changed in linux:
status: Incomplete → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote : Kernel team bugs

Per a decision made by the Ubuntu Kernel Team, bugs will longer be assigned to the ubuntu-kernel-team in Launchpad as part of the bug triage process. The ubuntu-kernel-team is being unassigned from this bug report. Refer to https://wiki.ubuntu.com/KernelTeamBugPolicies for more information. Thanks.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.