Talk:Problems with SATA and Linux
- 1 I did everything and system drive still does not respond to hdparm -i or hdparm -d1
- 2 updated libata_passthru.patch
- 3 ATA_ENABLE_PATA PCI IDs
- 4 DVD DMA with ide/sata as module
- 5 occasional hang upon resume with various kernels
- 6 Suspend to RAM on X41 not working with Debian-packaged 2.6.16
- 7 Problem with 2.6.16
- 8 Patch against SATA-resume problem with T60
- 9 removal of cd/dvd problems rambling?
- 10 libata.atapi_enabled didn't work, #define ATA_ENABLE_PATA worked!
I'm running gentoo on my T43; I had problems with X11 (opensource radeon driver) and a SATA-patched kernel (I tried both 2.6.14 and 2.6.15-gentoo). Suspend to RAM worked nicely, but starting X freezed the machine after a short time. I tried removing radeonfb from the kernel; with vesafb, everything seems to work.
-- Stefan, 10 Jan 2006
That's strange - with the libata passthrough (IDE driver not in kernel) as set up in the text, my t43p DVD drive also will not record as hinted in the wikipage... DMA works fine, so DVD playing / ripping is smooth and quick. CD record functions also are absent. I have PATA enabled, and the suspend + SMART patches applied over 126.96.36.199.
I can confirm this with 188.8.131.52, however with 2.6.15/15.1 with sata_pm patch it works.
-- Rasto, 24 Jan 2006
regarding the "BIOS error 2010 on user-installed hard disk": the text says that corruption occurs if you use a harddisk without the specific ibm bios. would be interesting if it is possible to fix this problem in the kernel so that you can use any disk and the kernel doesn't use specific ATA commands which are known to cause problems.
in the tabook i didn't find any specification of the SATA bridge. it would be interesting: 1) what type it is 2) if it is fixed on the mainboard or if it is possible to solder in a new one
Another interesting question is whether these ThinkPads can be hacked to accept a real SATA system disk, by bypassing the SATA-to-PATA bridge (this would probably involve some soldering and cutting). If the BIOS can also handle that then it may come in handy, since some new high-capacity 2.5" disks have only SATA versions. --Thinker 02:56, 8 Oct 2005 (CEST)
Since the Z series uses a SATA controller and disk, without the bridge, would it be possible to make SATA ATAPI support as a module that you could load only when using the optical drive? Then, for everyday use, the experimental options of PATA and ATAPI with ata_piix would not be needed, moving you one step further in the direction of stability.
I have an R52 with Ubuntu Breezy and no problems with SATA (I personally asked the developers to include the needed patches).
However, I'd like to know wheter there are any advantages with this configuration. Future proof? Power saving? Speed?
Anybody cares to comment?
Straight SATA, like in the Z60m/t, will provide better upgrade options in the long run (the hard disk industry is slowly but surely moving to SATA), and maybe a small performance increase if your drive, controller and OS support command queueing (they probably don't). However, with the hybrid ThinkPad models that use a SATA-to-PATA bridge, like your R52, you get all the drawbacks and none of the benefits; plus there's the horrible issue with drive compatibility. My impression is that Lenovo did this just as a convenient (for them!) transition path, in order to use new chipsets without comitting to (temporarily) scarcer and more expensive drives. In any case, they didn't even have the decency to make the UltraBay Slim accept SATA drives.
--Thinker 18:10, 3 Nov 2005 (CET)
There is a UltraBay Slim SATA HDD Adapter, but only compatible with the Z series (at least for the moment).
--Tonko 03:12, 4 Nov 2005 (CET)
Is it possible to enable AHCI on the Z60m? There doesn't seem to be an option for it in the BIOS, even after updating to the latest BIOS version (1.19). I don't think it's enabled by default since the "ata_piix" driver finds my controller and the "ahci" driver doesn't.
--Wyzard 06:06, 12 August 2006 (CEST)
Ok, I got it working with compatibility instead of AHCI (X60s) but I would like to know whats the difference between those two? Anybody with a quick explanation?
@Wyzard: AFAIK you have to switch it within BIOS and if you can't then you can't use ata_piix.
--elm 16:46, 12 August 2006 (CEST)
I did everything and system drive still does not respond to hdparm -i or hdparm -d1
T43 with debian edge and 2.6.18 kernel and ata_piix module loaded (just tried KNOPPIX5.1 with 2.6.19 kernel with ata_piix builtin, same result). BIOS version 1.29 (1YET65WW). Symptoms:
# cat /proc/version Linux version 2.6.18-6-686 (Debian 2.6.18.dfsg.1-23) (email@example.com) (gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)) #1 SMP Mon Oct 13 16:13:09 UTC 2008 # dmesg | grep sda Kernel command line: root=/dev/sda1 ro SCSI device sda: 78140160 512-byte hdwr sectors (40008 MB) sda: Write Protect is off sda: Mode Sense: 00 3a 00 00 SCSI device sda: drive cache: write back SCSI device sda: 78140160 512-byte hdwr sectors (40008 MB) sda: Write Protect is off sda: Mode Sense: 00 3a 00 00 SCSI device sda: drive cache: write back sda: sda1 sda2 sda3 sd 0:0:0:0: Attached scsi disk sda EXT3 FS on sda1, internal journal # hdparm -i /dev/sda /dev/sda: HDIO_GET_IDENTITY failed: Inappropriate ioctl for device # hdparm -d1 /dev/sda /dev/sda: setting using_dma to 1 (on) HDIO_SET_DMA failed: Inappropriate ioctl for device #
any ideas? does that happen to anybody else? thanks! --Mf77f1 13:22, 25 October 2008 (CEST)
FYI: when using the Suspend-to-RAM patch from http://lkml.org/lkml/2005/9/23/97 against 2.6.14 the libata_passthru.patch from the article doesn't apply any more, so I've put up an updated version at http://linux.spiney.org/system/files?file=02_libata_passthru.fixed.patch
I give no warranties whatsoever whether it works or kills your hardware, but since I just removed duplicate parts already in the Suspend-to-RAM patch it should be ok.
--spiney 19:04, 4 Nov 2005 (CET)
Running 2.6.16-rc4 and I'm running into scsci errors and Input/output errrors when resuming from suspend to ram. The suspend patch is supposed to be in 2.6.16-rc1 and I'm booting with
title= 2.6.16-rc4 root (hd0,0) kernel /boot/kernel-2.6.16-rc4 root=/dev/sda3 ro combined_mode=libata libata.atapi_enabled=1 acpi_sleep=s3_bios processor.max_cstate=2 elevator=cfq ide1=noprobe
Don't know about -rc4, but -rc3 worked without problems, could you try that one instead? Maybe there was some bug introduced between these two versions. What's combined_mode=libata BTW?
--spiney 08:28, 23 February 2006 (CET)
ATA_ENABLE_PATA PCI IDs
Spiney, could you extend the article to explain what and why are the PCI IDs in the footnote about ATA_ENABLE_PATA?
--Thinker 21:59, 4 Nov 2005 (CET)
Ok, done, feel free to fix the table because I'm a bit struggling with Wiki-style editing. ;) As for the why, those PCI IDs are the only ones affected by the ATA_ENABLE_PATA, as seen in drivers/scsi/ata_piix.c in the kernel source.
--spiney 11:19, 5 Nov 2005 (CET)
Will other cards work without ATA_ENABLE_PATA, or just fail? In the former case your instructions are right, but in the latter case we should tell the user to check the list of IDs in his current kernel and, if there's no match, to give up in the first place instead of following the rest of the instructions.
--Thinker 12:48, 5 Nov 2005 (CET)
AFAICT if the chipset is supported by libata it will work, regardless of what low-level driver is used. Of course if there is no low-level driver for the chipset then even using the harddisk via libata will fail, but that's a different story. At least ATA_ENABLE_PATA will then make no difference since it's Intel PIIX (and compatible) only.
--spiney 13:24, 5 Nov 2005 (CET)
Not sure I got you. Is there any case where the instructions will work without ATA_ENABLE_PATA, given that all ThinkPad optical drives are PATA?
--Thinker 13:41, 5 Nov 2005 (CET)
The instructions will work without ATA_ENABLE_PATA unless the Thinkpad uses one of the three chipsets listed in the article, as long as libata works at all, i.e. the system drive shows up as /dev/sda. The #define doesn't change the behaviour of libata for any other chipset, it's ata_piix only.
Since I don't have a machine with one of the three chipsets (anyone?), I can't tell whether those work at all with libata, but I guess there's a reason why they're not enabled by default. It's just that defining ATA_ENABLE_PATA is only making sense for these three chipsets.
Any clearer now? If not, just run
grep -r ATA_ENABLE_PATA /path/to/kernelsource and see how seldom and where the #define is used.
--spiney 14:55, 5 Nov 2005 (CET)
All clear now. I thought it will work only if you have these chipsets and ATA_ENABLE_PATA=1. Thanks for the explanation!
--Thinker 15:12, 5 Nov 2005 (CET)
Does any of the relevant ThinkPad models (listed in the article) use these chips? They look too old to be found on the SATA models.
--Thinker 23:35, 9 Nov 2005 (CET)
I don't think so, I was about to add "in the unlikely event that you own one of these chipsets" or something.
--spiney 07:56, 10 Nov 2005 (CET)
DVD DMA with ide/sata as module
Did anyone get DVD DMA to work with either the IDE or SATA drivers compiled as modules? If so, please fill in the missing details in that section. I have it working only with both IDE and SATA built-in.
--Thinker 17:58, 16 Nov 2005 (CET)
Basically using a Live-CD with a recent kernel (is there one with 2.6.14 already?) would be sufficient, since they usually use an initrd or something similar, don't they? I'll give the Debian distribution kernel a try when I get around to it (bit busy atm), after all there's 2.6.14 in sid.
But for people using their own kernel compiled from source I see no point in doing the module+initrd thing anyway, unless you want LVM for the root filesystem or other funky stuff.
--spiney 19:22, 16 Nov 2005 (CET)
Can anyone tell me how those modules are called?
Thomas --thomas 19:48, 23 Jan 2006 (CET)
Where the hell do I find the libata module?
--squashball 09:09, 11 June 2006 (CET)
The relevant driver is called ata_piix. The ata_piix driver uses a chunk of shared kernel code called libata.
--Thinker 09:33, 11 June 2006 (CEST)
Ok, Thanks. Nevertheless I am not able to get my drive working. It's a T60...
--squashball 12:29, 12 June 2006 (CET)
Your T60 uses AHCI by default. You have to change the BIOS settings to "compatibility mode" to use the HDD and DVD drive with ata_piix. Then, you're also able to hotswap your ultrabay. But for this, a patch for ibm_acpi is needed.
--Whoopie 14:57, 12 June 2006 (CEST)
Yeah, thanks, it's working now! Where was I supposed to find this info? EDIT: But DMA is still off and can't be enabled.
--squashball 07:58, 13 June 2006 (CET)
DMA is enabled by default with libata. Do a "dmesg |grep DMA" and you'll see. You can't use hdparm to see the settings for your hdd. BTW, if you have more questions, you could join IRC ##ibmthinkpad.
--Whoopie 11:04, 13 June 2006 (CEST)
This does work with *dual layer dvd*! Just install libdvdcss. Thinkpad T43, 1871-F1G, Fedora 5:
$ sudo dd if=/dev/scd0 of=/dev/null bs=2048 Password: 23929+0 records in 23928+0 records out 49004544 bytes (49 MB) copied, 24.3696 seconds, 2.0 MB/s
it works faster with standard (4.7GB) dvd:
# sudo dd if=/dev/scd0 of=/dev/null bs=2048 15929+0 records in 15928+0 records out 32620544 bytes (33 MB) copied, 7.02276 seconds, 4.6 MB/s ctrl^c
--Vlad s. 01:54, 26 December 2006 (CET)
occasional hang upon resume with various kernels
I keep having trouble with resume after suspend to ram. Occasionally, it takes longer to wake up and then is in a semi-hanged state, i.e. nothing having to do with actual reading from the disk works. (what was running, as aterm is still running, ls works, when the listing is buffered, but hangs if it is not). Kernel is 2.6.15 with sata-pm patch. Later 2.6.15 kernels hang always and it's the same with 2.6.16. Could perhaps somebody, for whom it works without problems post his .config somewhere? I'm out of ideas.
--Rasto 14:46, 20 March 2006 (CET)
I have the same problem with my x41 and 2.6.16 or 2.6.16-r1 running on Gentoo. Sometimes resume is ok and sometimes the disk doesn't resume. I can't see any log because the disk is unwritable after resume. The logs on F12 is full of io error. I tested many different kernel configs, unloading modules before suspend, stopping services... Like Rasto, I'm out of ideas...
--Pplr 19:21, 8 April 2006 (CEST)
You could try http://rtr.ca/dell_i9300/kernel/kernel-2.6.16/02_libata_resume_fix.patch This patch worked for me.
--Whoopie 21:21, 8 April 2006 (CEST)
Hello, according to the first lines of the article, resume does not work prior to kernel 2.6.16, i.e. the computer hangs up just a second after it comes back. I just switched from 2.6.15 to 2.6.16 but the problem still remains. I have a Z60M thinkpad. So this has obviously the same problem as the T60.
-- BjÃ¶rn 14:37, 10 April 2006 (CEST)
Increasing the timeouts seems to do the trick. I applied it about two weeks ago, and it works since.
-- Rasto 09:59, 11 April 2006 (CEST)
Ubuntu Dapper with 2.6.15-23 is also exhibiting this problem even though the sata_pm patch is applied. Bjorn, which timeout are you referring to?
-- nmuntz 09:08, 13 June 2006 (MDT)
The link above seems dead. I think the patch may be something along the lines of this one mentioned in the main article: http://lkml.org/lkml/2005/11/15/385 . I had the problem on my T43 with Debian Etch-n-half (Linux 2.6.24) of the system occasionally failing to restart after suspend-to-RAM. The screen would flash a few times, then remain black, and after a couple of seconds I could hear the hard drive unload. It seemed to occur more readily if the computer had been active (e.g. playing a video clip or whatever) prior to suspending. The patch I just mentioned worked for me; however, I changed it as per Andrew Morton's suggestion in the link so that the timeout in include/linux/libata.h:ata_wait_idle() was changed from 100 to 10000 as it seemed to make more sense. (Never tried the original patch). I can also confirm that the patch has not been included in 2.6.24 (although I can't be sure if there has been any other attempt to deal with the underlying problem.
-- rw 11:47, 19 January 2010 (CET)
Suspend to RAM on X41 not working with Debian-packaged 2.6.16
I just tried the Debian package of the Linux 2.6.16 kernel on my X41 to see if suspend-to-RAM would work. Unfortunately, it didn't. The laptop suspends just fine, but when it's turned back on, the backlight remains off, there is a lot of disk activity for a while, and then the computer just shuts off. When turned on again, it boots normally. Suspend-to-disk works fine, just like before.
On a different note, CPU throttling broke on my system with the new kernel. I can no longer modprobe acpi-cpufreq. Ehn 04:28, 22 March 2006 (CET)
- The latter issue was solved by using speedstep-centrino instead of acpi-cpufreq. Ehn 23:25, 9 April 2006 (CEST)
Neither problem is related to this article, so it's unlikely to be answered here.
--Thinker 17:37, 22 March 2006 (CET)
Hm. It seems to be a problem with sata power management for me, so I guess this could be one of the places.
Rasto 17:45, 22 March 2006 (CET) ---
Ehn, by "disk activity" do you mean a constantly on HDD LED and no disk movement noises, or real disk activity with the LED flashing and disk noise? The former is likely to be the SATA problem, the latter rules out the SATA problem.
--Thinker 18:44, 22 March 2006 (CET)
- The latter. There is real disk activity, indicated by LED flashing and disk movement noise, for about 30 seconds, before the machine gives up and shuts down. If this is not SATA-related, what might it be? Ehn 23:23, 9 April 2006 (CEST)
Sorry, I didn't realize Ehn has two problems, and I considered your post as aimed at my and Ehn's. Never mind then.
Rasto 10:47, 23 March 2006 (CET)
Problem with 2.6.16
ok, seems like we have a new problem: After upgrading from 2.6.15 to 2.6.16 my DVD device is not recognised anymore by libsata. The only way to get working is by using the ide layer - without DMA of course. Can anyone confirm this?
--Erik 17:49, 23 Mar 2006 (CET)
Try the kernel parameter combined_mode=libata, does this help? Also, have you enabled libata's ATAPI support as described in the article?
--Thinker 20:31, 23 March 2006 (CET)
Yes, I'm using the command line parameter libata.atapi_enable=1 - up to 2.6.15 it works fine. About the combined_mode parameter: Also tried it, though the Author of this patch mentioned that the default behavior did not changed. I will continue hungting this problem when I find some time.
--Erik 7:12, 24 Mar 2006 (CET)
I can confirm Eriks problem. After updating to 2.6.16 I have it, too. libata.atapi_enable=1 is still on kernel command line. With some help of Michael Ott I figured out that this only happens if you have the current suspend2 patches applied. Using a vanilla 2.6.16 works as expected.
--mobst 14:30, 24 Mar 2006 (CET)
Ahh thanks. Finding the problem in the suspend2 patch should be an easy task. I just hope for some free time this weekend!
--Erik 18:31, 24 Mar 2006 (CET)
Uhm, looks like ZolnOtt was faster, he added the note to http://thinkwiki.org/wiki/Problems_with_SATA_and_Linux#No_DMA_on_DVD_drive
--Erik 20:02, 24 Mar 2006 (CET)
Patch against SATA-resume problem with T60
I only have a Fujitsu-Siemens C1320, but I had the same problem with resuming from suspend with a SATA disk and kernel 2.6.16 as mentioned for the T60. I solved the problem for me by merging several patches (patches.fixes/libata-increase-timeout-for-resume, patches.fixes/ahci-suspend, patches.fixes/ahci-atapi-sense-request, patches.drivers/libata-acpi-suspend, patches.fixes/libata-resume-drive_port-mode, patches.fixes/ahci-init-on-resume, patches.drivers/libata-device-spindown) from the OpenSuSE kernel 2.6.16-12 to vanilla 184.108.40.206. You'll find my patch at http://www.spinnaker.de/linux/c1320/sata-resume-220.127.116.11.patch. I expect this to solve the T60 problem, so I provide the patch here, as this wiki helped me so much with my laptop.
--Rrosenfeld 23:12, 16 April 2006 (CEST)
I just want to let you know that I managed to get Suspend-to-RAM working on the T60. I'm using Gentoo's suspend2-sources-2.6.16-r2 as base and applied the above patches from Rrosenfeld (thanks!) and additionally this one (here the corresponding bug).
--sts 22:52, 17 April 2006 (CEST)
same here. applied both patches to gentoo suspend-sources-2.6.16-r5 --- working. sweet.
--dr who 21:51, 3 May 2006 (CEST)
however: powersave (powersaved) is a spoiler: it will cause the resume operation to get stuck at "reading back caches" and eventually result in a kernel panic. stopping powersaved before hibernating does not prevent it: it seems that running powersaved just once will screw things up. interesting and nasty. but not a show stopper (IMHO).
--dr who 17:14, 10 May 2006 (CEST)
that's not powersaved's fault. kernel panics are always kernel (or hardware) bugs. i experienced this kind of lockups when using different cpufreq governors at once (that's probaly something one shoudln't do?). i'm now using only cpufreq_userspace and don't have any problems.
--sts 15:11, 11 May 2006 (CEST)
Having exactly the same SATA wakeup problem on my Z60t, using FC5. Can the patch from rosenfeld be applied also to the FC5 kernelsource?
--szenti 21:29, 11 May 2006 (CEST)
Latest fedora (FC5) 2.6.17-1.2139_FC5smp kernel solved the problem on my T60p. I have successfully resumed a number of times now.
--Guil 20:38, 27 June 2006 (CEST)
Vanilla 18.104.22.168 lets me suspend and resume on a T60p. But I had to set the SATA mode to Compatibility (ata-piix) in the BIOS. The other catch is that if you suspend from a console rather than X, you get a black screen. Fn-F7 back to X gets your display back. Of course, if you don't have X up, you're kind of stuck and the safest thing to do is to tell the machine to reboot. The keyboard still works, so you have to type blind.
--jlquinn 17 Aug 2006 (signature button didn't work properly)
jlquinn: see How to recover from corrupted textmode.
--Thinker 17:20, 17 August 2006 (CEST)
By giving the kernel the option acpi_sleep=s3_bios I've managed to get suspend to work from the console mode - though I still have the SATA-problem. I'm running the gentoo kernel 2.6.17-r8, and will now try the tips from jlquinn...
--Tobixen 14:15, 10 October 2006 (CEST)
removal of cd/dvd problems rambling?
Should we remove the ramblings that are now the last section of the page? That's just generic information on how to properly use cdrecord (and it is incomplete and incorrect to add insult to injury...). If you use libata with ATAPI enabled and a new kernel, it *just works*, as the drive will look like a 100% SCSI device to cdrecord...
--hmh 06:12, 4 October 2006 (CEST)
Agreed. --Thinker 14:01, 4 October 2006 (CEST)
libata.atapi_enabled didn't work, #define ATA_ENABLE_PATA worked!
Hi there, I own a Thinkpad Z61m (fairly new), using a kernel which doesnt include IDE support (22.214.171.124). The libata.atapi_enabled=1 option didn't work, which means only the Hard Disk, and not the DVD-drive got recognized. However, adding ATA_ENABLE_PATA did work, now I don't need any option at all to modprobe.conf/bootloader config! lspci says: "IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller (rev 02)" PCIID: 8086:27df
May be useful for somebody :) Bye! --Theclaw 18:42, 11 November 2006 (CET)