Linux Ubuntu freezing at boot, ATA1 hard resetting

Asked by LaunchpadAccount

Update: Clocksource not the problem, forced HPET.

I have a problem with my Linux Ubuntu gaming computer that I've had ever since I switched over from Windows 7 to Ubuntu (clean install) about half a year ago.

It doesn't happen all of the time but it happens quite often when I turn on the computer and/or restart it; before you get the Ubuntu splash screen Linux freezes completely (it does get past Grub), shows me a blue screen where I can see black borders on each side and my GPU fan is spinning at maximum.

At some point, usually a minute or three although occasionally never, Ubuntu kicks in and I get the log-in screen. GPU fan slows down. (Might be unrelated, happened with both Open source and closed source drivers)

The below error message I sometimes see pop up after this problem has occured:

[ 324.800932] ata1.00: status: { DRDY }
[ 324.800935] ata1: hard resetting link

Now when I pull out the entire log the below seems interesting: cat /var/dmesg:

[ 324.800286] Clocksource tsc unstable (delta = 299965995419 ns)
[ 324.800919] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
[ 324.800925] ata1.00: failed command: IDENTIFY PACKET DEVICE
[ 324.800930] ata1.00: cmd a1/00:01:00:00:00/00:00:00:00:00/00 tag 0 pio 512 in
[ 324.800930] res 40/00:03:00:00:00/00:00:00:00:00/a0 Emask 0x4 (timeout)
[ 324.800932] ata1.00: status: { DRDY }
[ 324.800935] ata1: hard resetting link
[ 324.802130] Switching to clocksource hpet
[ 325.289945] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[ 326.091717] ata1.00: configured for UDMA/100
[ 326.892313] ata1: EH complete

Hard drivepasses S.M.A.R.T tests and has no bad sectors. Had no problems under Windows 7 which ran for years. Problem occured right from the get-go installing Ubuntu about 6 months ago. Computer is stable once it has booted.

AMD Phenom(tm) II X4 925 Processor
Gigabyte GA-790XTA-UD4 mainboard
AMD/ATI RadeonHD5770

Does anyone know if the errors I see are related to the freezing? How do I resolve the problem?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
LaunchpadAccount
Solved:
Last query:
Last reply:
Revision history for this message
Thomas Krüger (thkrueger) said :
#1

Edit the file /lib/udev/rules.d/60-persistent-storage.rules as root and comment out (put a # before it) this line:

KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="scsi", ATTRS{type}=="5", ATTRS{scsi_level}=="[6-9]*", IMPORT{program}="ata_id --export $tempnode"

Then reboot!

Revision history for this message
Daniel Letzeisen (dtl131) said :
#2

^If that doesn't work, I would try forcing clocksource hpet and see if that helps: http://ubuntuforums.org/showthread.php?t=1777366&p=11004117#post11004117

Revision history for this message
LaunchpadAccount (unfo) said :
#3

Hello and thanks for the replies!

Unfortunately, the clock source was not the problem. Forcing HPET as a clocksource did remove the unstable clocksource message but commenting out the persistent-storage.rule-line did not have any effect whatsoever:

 306.118864] EXT4-fs (dm-0): mounted filesystem with ordered data mode. Opts: (null)
[ 333.813394] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
[ 333.813398] ata1.00: failed command: IDENTIFY PACKET DEVICE
[ 333.813403] ata1.00: cmd a1/00:01:00:00:00/00:00:00:00:00/00 tag 0 pio 512 in
[ 333.813403] res 40/00:03:00:00:00/00:00:00:00:00/a0 Emask 0x4 (timeout)
[ 333.813405] ata1.00: status: { DRDY }
[ 333.813408] ata1: hard resetting link
[ 334.305278] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[ 335.107842] ata1.00: configured for UDMA/100
[ 335.908464] ata1: EH complete

Any more ideas? Should I uncomment the line again?

Revision history for this message
Thomas Krüger (thkrueger) said :
#4

If it did not change anything, you can reactive it.
Also I'd like to see some data on your drive setup. Can you run

sudo lshw -c disk,storage

and post the output?

Revision history for this message
Daniel Letzeisen (dtl131) said :
#5

In addition, it would be nice to see full:
dmesg | grep ata

..so we know what disk is referred to as "ata1.00"

If it's a CD drive, this may be relevant: https://bbs.archlinux.org/viewtopic.php?id=113569

Revision history for this message
LaunchpadAccount (unfo) said :
#6

 Thanks for taking the time to reply!

Output of sudo lshw -c disk,storage

*-storage
       description: SATA controller
       product: 88SE9128 PCIe SATA 6 Gb/s RAID controller
       vendor: Marvell Technology Group Ltd.
       physical id: 0
       bus info: pci@0000:02:00.0
       version: 11
       width: 32 bits
       clock: 33MHz
       capabilities: storage pm msi pciexpress ahci_1.0 bus_master cap_list rom
       configuration: driver=ahci latency=0
       resources: irq:50 ioport:ef00(size=8) ioport:ee00(size=4) ioport:ed00(size=8) ioport:ec00(size=4) ioport:eb00(size=16) memory:fdeff000-fdeff7ff memory:fdd00000-fdd0ffff
  *-storage
       description: SATA controller
       product: JMB363 SATA/IDE Controller
       vendor: JMicron Technology Corp.
       physical id: 0
       bus info: pci@0000:03:00.0
       version: 03
       width: 32 bits
       clock: 33MHz
       capabilities: storage pm pciexpress ahci_1.0 bus_master cap_list
       configuration: driver=ahci latency=0
       resources: irq:18 memory:fdcfe000-fdcfffff
  *-ide
       description: IDE interface
       product: JMB363 SATA/IDE Controller
       vendor: JMicron Technology Corp.
       physical id: 0.1
       bus info: pci@0000:03:00.1
       version: 03
       width: 32 bits
       clock: 33MHz
       capabilities: ide pm bus_master cap_list
       configuration: driver=pata_jmicron latency=0
       resources: irq:19 ioport:df00(size=8) ioport:de00(size=4) ioport:dd00(size=8) ioport:dc00(size=4) ioport:db00(size=16)
  *-storage
       description: SATA controller
       product: SB7x0/SB8x0/SB9x0 SATA Controller [AHCI mode]
       vendor: Advanced Micro Devices [AMD] nee ATI
       physical id: 11
       bus info: pci@0000:00:11.0
       version: 00
       width: 32 bits
       clock: 66MHz
       capabilities: storage pm ahci_1.0 bus_master cap_list
       configuration: driver=ahci latency=32
       resources: irq:22 ioport:ff00(size=8) ioport:fe00(size=4) ioport:fd00(size=8) ioport:fc00(size=4) ioport:fb00(size=16) memory:fe02f000-fe02f3ff
  *-ide
       description: IDE interface
       product: SB7x0/SB8x0/SB9x0 IDE Controller
       vendor: Advanced Micro Devices [AMD] nee ATI
       physical id: 14.1
       bus info: pci@0000:00:14.1
       version: 00
       width: 32 bits
       clock: 66MHz
       capabilities: ide msi bus_master cap_list
       configuration: driver=pata_atiixp latency=32
       resources: irq:16 ioport:1f0(size=8) ioport:3f6 ioport:170(size=8) ioport:376 ioport:fa00(size=16)
  *-scsi:0
       physical id: 1
       logical name: scsi0
       capabilities: emulated
     *-cdrom
          description: DVD-RAM writer
          product: CDDVDW SH-S223C
          vendor: TSSTcorp
          physical id: 0.0.0
          bus info: scsi@0:0.0.0
          logical name: /dev/cdrom
          logical name: /dev/cdrw
          logical name: /dev/dvd
          logical name: /dev/dvdrw
          logical name: /dev/sr0
          version: SB04
          capabilities: removable audio cd-r cd-rw dvd dvd-r dvd-ram
          configuration: ansiversion=5 status=nodisc
  *-scsi:1
       physical id: 2
       logical name: scsi10
       capabilities: emulated
     *-disk
          description: ATA Disk
          product: WDC WD1002FAEX-0
          vendor: Western Digital
          physical id: 0.0.0
          bus info: scsi@10:0.0.0
          logical name: /dev/sda
          version: 05.0
          serial: WD-WCATR5240093
          size: 931GiB (1TB)
          capabilities: partitioned partitioned:dos
          configuration: ansiversion=5 sectorsize=512 signature=000eaee6
  *-scsi:2
       physical id: 3
       logical name: scsi17
       capabilities: emulated

Output of dmesg | grep ata

[ 0.000000] BIOS-e820: [mem 0x00000000cfde3000-0x00000000cfdeffff] ACPI data
[ 0.000000] Memory: 8089724k/9175040k available (7014k kernel code, 789468k absent, 295848k reserved, 6229k data, 996k init)
[ 0.281291] libata version 3.00 loaded.
[ 1.317082] acpi-cpufreq: overriding BIOS provided _PSD data
[ 1.318644] Write protecting the kernel read-only data: 12288k
[ 1.354121] ata1: SATA max UDMA/133 abar m1024@0xfe02f000 port 0xfe02f100 irq 22
[ 1.354124] ata2: SATA max UDMA/133 abar m1024@0xfe02f000 port 0xfe02f180 irq 22
[ 1.354126] ata3: SATA max UDMA/133 abar m1024@0xfe02f000 port 0xfe02f200 irq 22
[ 1.354129] ata4: SATA max UDMA/133 abar m1024@0xfe02f000 port 0xfe02f280 irq 22
[ 1.354131] ata5: SATA max UDMA/133 abar m1024@0xfe02f000 port 0xfe02f300 irq 22
[ 1.354133] ata6: SATA max UDMA/133 abar m1024@0xfe02f000 port 0xfe02f380 irq 22
[ 1.356043] pata_jmicron 0000:03:00.1: enabling device (0000 -> 0001)
[ 1.356072] pata_jmicron 0000:03:00.1: setting latency timer to 64
[ 1.356805] scsi6 : pata_jmicron
[ 1.356889] scsi7 : pata_jmicron
[ 1.356919] ata7: PATA max UDMA/100 cmd 0xdf00 ctl 0xde00 bmdma 0xdb00 irq 19
[ 1.356921] ata8: PATA max UDMA/100 cmd 0xdd00 ctl 0xdc00 bmdma 0xdb08 irq 19
[ 1.366108] scsi8 : pata_atiixp
[ 1.366404] scsi9 : pata_atiixp
[ 1.366595] ata9: PATA max UDMA/100 cmd 0x1f0 ctl 0x3f6 bmdma 0xfa00 irq 14
[ 1.366597] ata10: PATA max UDMA/100 cmd 0x170 ctl 0x376 bmdma 0xfa08 irq 15
[ 1.378591] ata11: SATA max UDMA/133 abar m2048@0xfdeff000 port 0xfdeff100 irq 50
[ 1.378594] ata12: SATA max UDMA/133 abar m2048@0xfdeff000 port 0xfdeff180 irq 50
[ 1.378597] ata13: SATA max UDMA/133 abar m2048@0xfdeff000 port 0xfdeff200 irq 50
[ 1.378600] ata14: SATA max UDMA/133 abar m2048@0xfdeff000 port 0xfdeff280 irq 50
[ 1.378602] ata15: SATA max UDMA/133 abar m2048@0xfdeff000 port 0xfdeff300 irq 50
[ 1.378605] ata16: SATA max UDMA/133 abar m2048@0xfdeff000 port 0xfdeff380 irq 50
[ 1.378607] ata17: SATA max UDMA/133 abar m2048@0xfdeff000 port 0xfdeff400 irq 50
[ 1.378610] ata18: SATA max UDMA/133 abar m2048@0xfdeff000 port 0xfdeff480 irq 50
[ 1.392227] ata19: SATA max UDMA/133 abar m8192@0xfdcfe000 port 0xfdcfe100 irq 18
[ 1.392231] ata20: SATA max UDMA/133 abar m8192@0xfdcfe000 port 0xfdcfe180 irq 18
[ 1.671779] ata2: SATA link down (SStatus 0 SControl 300)
[ 1.671818] ata4: SATA link down (SStatus 0 SControl 300)
[ 1.671852] ata3: SATA link down (SStatus 0 SControl 300)
[ 1.671902] ata5: SATA link down (SStatus 0 SControl 300)
[ 1.671937] ata6: SATA link down (SStatus 0 SControl 300)
[ 1.703744] ata14: SATA link down (SStatus 0 SControl 300)
[ 1.703770] ata15: SATA link down (SStatus 0 SControl 300)
[ 1.703798] ata11: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
[ 1.703822] ata12: SATA link down (SStatus 0 SControl 300)
[ 1.703847] ata13: SATA link down (SStatus 0 SControl 300)
[ 1.703878] ata16: SATA link down (SStatus 0 SControl 300)
[ 1.703906] ata17: SATA link down (SStatus 0 SControl 300)
[ 1.703935] ata18: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[ 1.704143] ata18.00: ATAPI: MARVELL VIRTUALL, 1.09, max UDMA/66
[ 1.704531] ata18.00: configured for UDMA/66
[ 1.706096] ata11.00: ATA-8: WDC WD1002FAEX-00Z3A0, 05.01D05, max UDMA/133
[ 1.706098] ata11.00: 1953525168 sectors, multi 8: LBA48 NCQ (depth 31/32), AA
[ 1.708329] ata11.00: configured for UDMA/133
[ 1.711660] ata20: SATA link down (SStatus 0 SControl 300)
[ 1.711694] ata19: SATA link down (SStatus 0 SControl 300)
[ 1.843702] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[ 1.845137] ata1.00: ATAPI: TSSTcorp CDDVDW SH-S223C, SB04, max UDMA/100
[ 2.645816] ata1.00: configured for UDMA/100
[ 5.663260] EXT4-fs (dm-0): mounted filesystem with ordered data mode. Opts: (null)
[ 21.642459] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
[ 21.642466] ata1.00: failed command: IDENTIFY PACKET DEVICE
[ 21.642472] ata1.00: cmd a1/00:01:00:00:00/00:00:00:00:00/00 tag 0 pio 512 in
[ 21.642476] ata1.00: status: { DRDY }
[ 21.642480] ata1: hard resetting link
[ 22.134310] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[ 22.936865] ata1.00: configured for UDMA/100
[ 23.749815] ata1: EH complete

Revision history for this message
LaunchpadAccount (unfo) said :
#7

Much to my shame I noticed that I seem to have commented out the wrong line in the 60-persistent-storage.rules file! I commented out the one above it, which I believe Nano pointed out as being the correct line when I used the search function.

I Have now commented out the correct line and will see what happens next time I reboot!

Revision history for this message
Daniel Letzeisen (dtl131) said :
#8

Well, if that doesn't work , you should note that It is your CD drive throwing those errors (and you have the same model as that person in the ArchLinux forum post I linked to).

Also, it looks you have the CD drive plugged into one of the two white SATA headers (which belong to the Marvell SATA 6Gb/s controller). Some mobo manuals go as far as to tell you not to use optical drives with the Marvell controller and I see various complaints about that controller (even from users of that "other" OS). You should definitely not have the CD drive plugged into a white SATA header.

Your hard disk is 6Gbps, so it could theoretically benefit from being attached to the Marvell, but I (and others) aren't sold on the actual benefit of SATA 6Gb/s for mechanical storage. If it was me, I would just plug both devices into the "regular" blue SATA ports and completely disable the Marvell controller in the BIOS.

Revision history for this message
LaunchpadAccount (unfo) said :
#9

Hello Daniel,

The DVD drive is connected to a blue header it would seem! The hard drive is indeed connected to the white header.

Although the problem has not gone away entirely, it seems to go boot faster with the modifications that were recommended so far. Could be random, though. It had good and bad days before as well.

I noticed that I have to give my computer case a good dusting and I'll move the hard drive to one of the other headers if it's safe to do so. Windows usually goes haywire when you move stuff around, requiring re-activation and whatnot .. Linux has no such problems?

Revision history for this message
Daniel Letzeisen (dtl131) said :
#10

Tim, Linux is pretty good about swapping hardware to the point where you can transplant a disk from one system to another without fuss as long as the new hardware is supported by the kernel you have on the existing install. Obviously, there's no Windows Genuine (Dis)Advantage (or whatever it's called nowadays) reactivation to worry about.

When you said you made the modifications, did that include adding "libata atapi_passthru16=0"? If you're confused, use these commands:

sudo bash -c "echo \"options libata atapi_passthru16=0\" > /etc/modprobe.d/libata.conf"
sudo depmod -a

Revision history for this message
LaunchpadAccount (unfo) said :
#11

Hello Daniel,

I've given it a few days and thus a few boots to check the difference. The error message is still there but it seems to snap out of the freezing much faster, which is definitely an improvement.

This includes "libata atapi_passthru16=0"

Should I turn this into a bug report?

Revision history for this message
Daniel Letzeisen (dtl131) said :
#12

I'm personally unsure of which direction to go here, so if you want to create a bug report, feel free.
I wonder if you're getting stuck at the "Press 's' to skip mounting" screen and just can't see it because you're running fglrx/Catalyst (are you?).
Have you made any modifications to /etc/fstab file?

Revision history for this message
LaunchpadAccount (unfo) said :
#13

I have not made any modifications to /etc/fstab by hand as far as I can remember.

This problem also occured with open source Radeon drivers!
Wouldn't I be able to see skip-mounting message in the log if it was there?

I am not entirely sure how I'd go about creating a bug report, it seems very complicated when it is not done automatically. I filed a bug report for something else a few days ago and it was rejected because I was running outdated software. Even though dist-upgrade and upgrade say everything is in order so it is likely to be rejected once more. On top of that, I wonder why none of the people in that thread have bothering doing so ... Perhaps it's because the fault seems to lie in the hardware?

Revision history for this message
Daniel Letzeisen (dtl131) said :
#14

The next thing I would do is unplug the CD/DVD drive temporarily. If the problem stops, you've found your culprit. Note that the drive has a firmware update: http://www.tsstodd.com/eng/Firmware/FWDownload/?functionvalue=view&no=733&parent_idx=&level_idx=&model=SH-S223C&product=HDW&productName=DVD-Writer%20Half%20Height

Revision history for this message
LaunchpadAccount (unfo) said :
#15

Hi Daniel,

Disconnecting the DVD player has caused the problem to immediately return but no error message related to timing out in DMESG can be found now. In fact, it froze so bad I had to reset the computer through the reset button.

After implementing the libata atapi_passthru16=0" fix, it had worked fine for many days!

I did not disconnect the cable from the motherboard, only the dvd player. I'll try removing it entirely next time, perhaps the cable is at fault?

Revision history for this message
LaunchpadAccount (unfo) said :
#16

Removing the libata atapi_passthru16=0 on top of disconnecting the optical drive from the motherboard doesn't stop the freezing either.

I'm going to plug everything back in to see if it makes the freezing go away again.

Revision history for this message
LaunchpadAccount (unfo) said :
#17

Daniel,

It seems like the problem is largely resolved. I'm going to mark this as solved and will look into it again when I have learnt more about Linux, right now it seems out of my league to come up with any meaningful information. Thanks for your time!