# [SOLVED] Slow boot while initializing DVD/CDROM drive

## jenzuslongus

Hello folks,

whenever I boot my computer it takes a very long time (~30 sec.) until the CDROM drive is recognised. Here comes a snippet of dmesg:

```
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing disabled

Floppy drive(s): fd0 is 1.44M

FDC 0 is a post-1991 82077

RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize

loop: module loaded

Intel(R) PRO/1000 Network Driver - version 7.3.20-k2

Copyright (c) 1999-2006 Intel Corporation.

tun: Universal TUN/TAP device driver, 1.6

tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>

r8169 Gigabit Ethernet driver 2.2LK loaded

ACPI: PCI Interrupt 0000:04:00.0[A] -> GSI 17 (level, low) -> IRQ 17

PCI: Setting latency timer of device 0000:04:00.0 to 64

eth0: RTL8168b/8111b at 0xffffc20001438000, 00:19:db:f6:61:53, XID 38000000 IRQ

17

netconsole: not configured, aborting

ahci 0000:00:1f.2: version 2.3

ACPI: PCI Interrupt 0000:00:1f.2[B] -> GSI 19 (level, low) -> IRQ 19

ahci 0000:00:1f.2: AHCI 0001.0200 32 slots 6 ports 3 Gbps 0x3f impl RAID mode

ahci 0000:00:1f.2: flags: 64bit ncq sntf stag pm led clo pio slum part

PCI: Setting latency timer of device 0000:00:1f.2 to 64

scsi0 : ahci

scsi1 : ahci

scsi2 : ahci

scsi3 : ahci

scsi4 : ahci

scsi5 : ahci

ata1: SATA max UDMA/133 cmd 0xffffc2000143a100 ctl 0x0000000000000000 bmdma 0x0000000000000000 irq 1275

ata2: SATA max UDMA/133 cmd 0xffffc2000143a180 ctl 0x0000000000000000 bmdma 0x0000000000000000 irq 1275

ata3: SATA max UDMA/133 cmd 0xffffc2000143a200 ctl 0x0000000000000000 bmdma 0x0000000000000000 irq 1275

ata4: SATA max UDMA/133 cmd 0xffffc2000143a280 ctl 0x0000000000000000 bmdma 0x0000000000000000 irq 1275

ata5: SATA max UDMA/133 cmd 0xffffc2000143a300 ctl 0x0000000000000000 bmdma 0x0000000000000000 irq 1275

ata6: SATA max UDMA/133 cmd 0xffffc2000143a380 ctl 0x0000000000000000 bmdma 0x0000000000000000 irq 1275

ata1: SATA link down (SStatus 0 SControl 300)

ata2: SATA link down (SStatus 0 SControl 300)

ata3: SATA link up 3.0 Gbps (SStatus 123 SControl 300)

ata3.00: ATA-8: SAMSUNG HD501LJ, CR100-12, max UDMA7

ata3.00: 976773168 sectors, multi 0: LBA48 NCQ (depth 31/32)

ata3.00: configured for UDMA/133

ata4: SATA link up 3.0 Gbps (SStatus 123 SControl 300)

ata4.00: ATA-8: SAMSUNG HD501LJ, CR100-12, max UDMA7

ata4.00: 976773168 sectors, multi 0: LBA48 NCQ (depth 31/32)

ata4.00: configured for UDMA/133

ata5: SATA link down (SStatus 0 SControl 300)

ata6: SATA link down (SStatus 0 SControl 300)

scsi 2:0:0:0: Direct-Access     ATA      SAMSUNG HD501LJ  CR10 PQ: 0 ANSI: 5

sd 2:0:0:0: [sda] 976773168 512-byte hardware sectors (500108 MB)

sd 2:0:0:0: [sda] Write Protect is off

sd 2:0:0:0: [sda] Mode Sense: 00 3a 00 00

sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA

sd 2:0:0:0: [sda] 976773168 512-byte hardware sectors (500108 MB)

sd 2:0:0:0: [sda] Write Protect is off

sd 2:0:0:0: [sda] Mode Sense: 00 3a 00 00

sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA

 sda: sda1 sda2 sda3

sd 2:0:0:0: [sda] Attached SCSI disk

sd 2:0:0:0: Attached scsi generic sg0 type 0

scsi 3:0:0:0: Direct-Access     ATA      SAMSUNG HD501LJ  CR10 PQ: 0 ANSI: 5

sd 3:0:0:0: [sdb] 976773168 512-byte hardware sectors (500108 MB)

sd 3:0:0:0: [sdb] Write Protect is off

sd 3:0:0:0: [sdb] Mode Sense: 00 3a 00 00

sd 3:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA

sd 3:0:0:0: [sdb] 976773168 512-byte hardware sectors (500108 MB)

sd 3:0:0:0: [sdb] Write Protect is off

sd 3:0:0:0: [sdb] Mode Sense: 00 3a 00 00

sd 3:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA

 sdb: sdb1 sdb2 sdb3

sd 3:0:0:0: [sdb] Attached SCSI disk

sd 3:0:0:0: Attached scsi generic sg1 type 0

ACPI: PCI Interrupt 0000:03:00.0[A] -> GSI 16 (level, low) -> IRQ 16

PCI: Setting latency timer of device 0000:03:00.0 to 64

scsi6 : pata_marvell

scsi7 : pata_marvell

ata7: PATA max UDMA/100 cmd 0x000000000001cc00 ctl 0x000000000001c882 bmdma 0x000000000001c400 irq 16
```

This is the part that takes very long:

```
ata8: PATA max UDMA/133 cmd 0x000000000001c800 ctl 0x000000000001c482 bmdma 0x000000000001c408 irq 16

BAR5:00:02 01:7F 02:22 03:CA 04:00 05:00 06:00 07:00 08:00 09:00 0A:00 0B:00 0C:07 0D:00 0E:00 0F:00

BAR5:00:02 01:7F 02:22 03:CA 04:00 05:00 06:00 07:00 08:00 09:00 0A:00 0B:00 0C:07 0D:00 0E:00 0F:00

ata8.00: qc timeout (cmd 0xa1)

ata8.00: failed to IDENTIFY (I/O error, err_mask=0x4)

BAR5:00:02 01:7F 02:22 03:CA 04:00 05:00 06:00 07:00 08:00 09:00 0A:00 0B:00 0C:07 0D:00 0E:00 0F:00

ata8: port is slow to respond, please be patient (Status 0xd0)

ata8: device not ready (errno=-16), forcing hardreset

ata8: port is slow to respond, please be patient (Status 0xd0)

ata8: SRST failed (errno=-16)

ata8: port is slow to respond, please be patient (Status 0xd0)

ata8: SRST failed (errno=-16)

ata8.00: ATAPI: TSSTcorp CDDVDW SH-S203D, SB00, max UDMA/100

ata8.00: configured for UDMA/100

ata8: EH pending after completion, repeating EH (cnt=4)

scsi 7:0:0:0: CD-ROM            TSSTcorp CDDVDW SH-S203D  SB00 PQ: 0 ANSI: 5

sr0: scsi3-mmc drive: 48x/48x writer dvd-ram cd/rw xa/form2 cdda tray

Uniform CD-ROM driver Revision: 3.20

sr 7:0:0:0: Attached scsi CD-ROM sr0

sr 7:0:0:0: Attached scsi generic sg2 type 5
```

From this line on the boot continues normally.

```
ACPI: PCI Interrupt 0000:05:02.0[A] -> GSI 18 (level, low) -> IRQ 18

ohci1394: fw-host0: OHCI-1394 1.1 (PCI): IRQ=[18]  MMIO=[febff800-febfffff]  Max Packet=[2048]  IR/IT contexts=[4/8]

ieee1394: raw1394: /dev/raw1394 device initialized

ACPI: PCI Interrupt 0000:00:1a.7[C] -> GSI 18 (level, low) -> IRQ 18

PCI: Setting latency timer of device 0000:00:1a.7 to 64

```

lspci shows:

```
00:00.0 Host bridge: Intel Corporation DRAM Controller (rev 02)

00:01.0 PCI bridge: Intel Corporation PCI Express Root Port (rev 02)

00:1a.0 USB Controller: Intel Corporation USB UHCI Controller #4 (rev 02)

00:1a.1 USB Controller: Intel Corporation USB UHCI Controller #5 (rev 02)

00:1a.7 USB Controller: Intel Corporation USB2 EHCI Controller #2 (rev 02)

00:1b.0 Audio device: Intel Corporation HD Audio Controller (rev 02)

00:1c.0 PCI bridge: Intel Corporation PCI Express Port 1 (rev 02)

00:1c.4 PCI bridge: Intel Corporation PCI Express Port 5 (rev 02)

00:1c.5 PCI bridge: Intel Corporation PCI Express Port 6 (rev 02)

00:1d.0 USB Controller: Intel Corporation USB UHCI Controller #1 (rev 02)

00:1d.1 USB Controller: Intel Corporation USB UHCI Controller #2 (rev 02)

00:1d.2 USB Controller: Intel Corporation USB UHCI Controller #3 (rev 02)

00:1d.3 USB Controller: Intel Corporation USB UHCI Controller #6 (rev 02)

00:1d.7 USB Controller: Intel Corporation USB2 EHCI Controller #1 (rev 02)

00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev 92)

00:1f.0 ISA bridge: Intel Corporation LPC Interface Controller (rev 02)

00:1f.2 RAID bus controller: Intel Corporation 82801 SATA RAID Controller (rev 02)

00:1f.3 SMBus: Intel Corporation SMBus Controller (rev 02)

01:00.0 VGA compatible controller: nVidia Corporation Unknown device 0402 (rev a1)

03:00.0 IDE interface: Marvell Technology Group Ltd. Unknown device 6121 (rev b1)

04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 01)

05:02.0 FireWire (IEEE 1394): VIA Technologies, Inc. IEEE 1394 Host Controller (rev c0)

```

The output of uname -a is:

```
Linux jensen 2.6.23-gentoo-r9 #4 SMP Wed Mar 5 17:17:38 CET 2008 x86_64 Intel(R) Core(TM)2 Duo CPU E6850 @ 3.00GHz GenuineIntel GNU/Linux
```

My mainboard is a MSI P35 Neo2 with BIOS Version 1.40. The drive is connected to the so-called SATA7-plug which is conntrolled by the Marvell 88SE6121-controller. I completely deactivated IDE-support in my kernel configuration. The parts concerning (S|P)ATA (only the ones that I activated) are follwing:

```
CONFIG_ATA=y

CONFIG_ATA_ACPI=y

CONFIG_SATA_AHCI=y

CONFIG_ATA_PIIX=y

CONFIG_SATA_MV=y

CONFIG_SATA_NV=y

CONFIG_PATA_MARVELL=y

```

The computer hangs when the lines with 

```
BAR5:00:02 01:7F 02:22 03:CA 04:00 05:00 06:00 07:00 08:00 09:00 0A:00 0B:00 0C:07 0D:00 0E:00 0F:00
```

 come up.

Then  it takes some time and after the third and last of these BAR-lines the boot continues normally. The drive then works fine, I have no problems with it, but the errors seem strange to me. Is there a way to get rid of these messages? It also seems strange to me that the drive seems to be connected to an IDE-Controller.

Thanks for your help

JensLast edited by jenzuslongus on Fri Mar 07, 2008 7:34 am; edited 1 time in total

----------

## OmSai

Try disabling the boot-from-CD option in your BIOS and see if that makes a difference.

Your dmesg shows your system is using the older pata_marvell driver.

Try disabling sata_mv in your kernel in case it is conflicting.

Otherwise try the opposite: disable pata_marvell it in your kernel to force it to use the newer sata_mv instead

After compiling, in case it the kernel panics, copy the kernel under a new name in /boot and load and specify a separate line in grub for it.

If that doesn't work out, could you tell us the name/model of your CD/DVD drive?

----------

## jenzuslongus

Thanks for the quick answer.

 *om wrote:*   

> Try disabling the boot-from-CD option in your BIOS and see if that makes a difference.

 

That did the trick. By the way, do you or somebody else know why? It could be a little annoying to enable and disable it in the bios if you want to boot from a cd. (I surely admit that this won't be an everyday task.)

 *om wrote:*   

> Your dmesg shows your system is using the older pata_marvell driver.
> 
> Try disabling sata_mv in your kernel in case it is conflicting.
> 
> Otherwise try the opposite: disable pata_marvell it in your kernel to force it to use the newer sata_mv instead

 

I have tried either of your suggestions but only activating pata_marvell makes the kernel recognise the drive. I changed the kernel config to:

```
CONFIG_ATA=y

CONFIG_ATA_ACPI=y

CONFIG_SATA_AHCI=y

# CONFIG_ATA_PIIX is not set

# CONFIG_SATA_MV is not set

# CONFIG_SATA_NV is not set

CONFIG_PATA_MARVELL=y
```

By the way, do I have to mark this thread as solved/closed?

Thank you, Jens

----------

## OmSai

 *jenzuslongus wrote:*   

> That did the trick. By the way, do you or somebody else know why? It could be a little annoying to enable and disable it in the bios if you want to boot from a cd. (I surely admit that this won't be an everyday task.)

 

My theory is that setting your BIOS `CD boot' option opens more bus addresses on your motherboard (SATA, IDE, PATA).

You kernel, probing these extra ports, therefore takes the extra pre-init time.

Ive read that IDE causes the most slow down, and that the kernel probes regardless if you have IDE support enabled or not (sorry I can't seem to find that link where I read that)

To test the theory perhaps disabling IDE from the BIOS, as this ML suggests, would help.

 *jenzuslongus wrote:*   

> By the way, do I have to mark this thread as solved/closed?

 It's a courtesy to the other users.

If you really want some direction as to what is slowing down the kernel (and my explanation work out to be incorrect) then:

Upgrade to the latest unstable version of gentoo-sources and see if the problem persists.

If so, you can maybe file your concern as a trivial bug under the Gentoo Linux > Core System at bugs.gentoo.org

Then a kernel developer might grace with some ideas.

----------

## jenzuslongus

Thanks for your explanations. I will try to disable IDE in the BIOS (I thought I did that already) and then re-enable booting from CD.

If I have some time I will try the unstable kernel.

----------

