Talk:Problems with SATA and Linux

From ThinkWiki
Revision as of 10:04, 13 June 2006 by Whoopie (Talk | contribs) (DVD DMA with ide/sata as module)

Jump to: navigation, search

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 2.6.14.2.


I can confirm this with 2.6.14.4, 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)


Z series

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?

-- Michele

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)

updated libata_passthru.patch

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)

Hi

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

Thanks.


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)


Hi

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)


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)

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 2.6.16.5. You'll find my patch at http://www.spinnaker.de/linux/c1320/sata-resume-2.6.16.5.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)