Problems with SATA and Linux

From ThinkWiki
Revision as of 18:00, 26 September 2005 by Thinker (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Some ThinkPad models, use a SATA controller for the system hard disk (the hard disk itself is PATA, but is accessed through a SATA-to-PATA bridge). This causes several complications for Linux installation. The following lists these problems and some workarounds.

Models using a SATA disk interface (partial list)

ThinkPad T43, R52, X41, X41 Tablet.

SATA-related problems under Linux

The following is a list of SATA-related issues one may encounter when runing Linux on these ThinkPad models. Note that the details are often version- and distribution-specific.

Hang on resume from suspend to RAM

Linux kernels (as of 2.6.14-rc2) do not support suspend+resume for SATA devices. As a result, the machine hangs upon first disk access after resume. A kernel patch is available (see How_to_make_ACPI_work under "Suspend to RAM").

Some distributions already include this patch (e.g., Ubuntu), but some don't (e.g., Fedora Core 4).


Failed resume from suspend to disk

Suspend to disk (using swsusp or swsusp2) needs to load the memory image from the SATA disk. You thus need to either have an appropriate initrd or the SATA drivers compiled into the kernel (instead of modules).

DVD drive not recognized

The ata_piix SATA driver grabs ownership over the IDE ports when it is loaded, but (by default) does not support PATA ATAPI devices such as the UltraBay Slim DVD drives. Thus, if IDE support is compiled as a module and loaded after ata_piix, the DVD drive will not be recognized by either driver.

The following configurations do work:

  • Compile IDE into the kernel (non-module)
  • Compile both IDE and SATA as modules and make sure IDE is loaded first
  • Enable PATA ATAPI support in the SATA system (experimental; see below).

Note that the DVD drive must be in the UltraBay during system boot (UltraBay device swapping seems to be completely unsupported on these models).

No DMA on DVD drive

Using the IDE driver, DMA support cannot be enabled on an UltraBay DVD drive:

# hdparm -d1 /dev/hdc

/dev/hdc:
 setting using_dma to 1 (on)
 HDIO_SET_DMA failed: Operation not permitted
 using_dma    =  0 (off)

As a result, the DVD drive is slow, and in particular, too slow to play video DVDs.

One workaround is to use employ the SATA driver (instead of the IDE driver) for the DVD drive. This requires enabling two featues of the SATA driver, namely ATAPI support and PATA support, which are both in active development and far from stable. Using this will probably devour all your data and go on to eat all the food in your fridge. But if you have full backups and an empty fridge, do the following:

  • Grab the latest kernel, since these feature are under active development1.
  • Configure the IDE system as a module, to get it out of the way (maybe it can be completely removed).
  • Configure the SATA system, and in particular the ata_piix driver, as statically compiled into the kernel.
  • In drivers/scsi/libata-core.c, set2
int atapi_enabled = 1
  • In include/linux/libata.h, set
#define ATA_ENABLE_PATA

There are reports that DVD burning doesn't work under this configuration.


FOOTNOTES [Δ]

{{{1}}}