# Solution for sata freezes with SAMSUNG HD642JJ

## LeavingSuSE

Maybe this should become sticky.

Solution for sata freezes with SAMSUNG HD642JJ

I found a fix for a problem which made me almost insane.

Problem:

The SAMSUNG HD642JJ sata harddisk caused regularly (soft) freezes of my system

which lasted for 30 to 45 seconds.

dmesg shows something like after the pc came back to life:

ata2.00: exception Emask 0x0 SAct 0x3 SErr 0x0 action 0x6 frozen

Sep 15 06:04:35 xxxx  ata2.00: cmd 60/00:00:b2:fd:25/01:00:03:00:00/40 tag 0 ncq 131072 in

Sep 15 06:04:35 xxxx res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)

Sep 15 06:04:35 xxxx ata2.00: status: { DRDY }

Sep 15 06:04:35 xxxx ata2.00: cmd 60/00:08:b2:fe:25/01:00:03:00:00/40 tag 1 ncq 131072 in

Sep 15 06:04:36 xxxx res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)

Sep 15 06:04:36 xxxx ata2.00: status: { DRDY }

Sep 15 06:04:36 xxxx ata2: hard resetting link

Sep 15 06:04:36 xxxx ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 300)        <- the Sata link was never 3.0 Gbps before the update

Sep 15 06:04:36 xxxx ata2.00: configured for UDMA/133

Sep 15 06:04:36 xxxx ata2: EH complete

Sep 15 06:04:36 xxxx sd 1:0:0:0: [sda] 1250263728 512-byte hardware sectors (640135 MB)

Sep 15 06:04:36 xxxx sd 1:0:0:0: [sda] Write Protect is off

Sep 15 06:04:36 xxxx sd 1:0:0:0: [sda] Mode Sense: 00 3a 00 00

Sep 15 06:04:36 xxxx sd 1:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA

But smartctl showed me that this absolutely new harddisk was ok.

My hardware:

CPU AMD X2 6000+

MSI K9N Neo V2 with 00:0a.0 SATA controller: nVidia Corporation MCP65 AHCI Controller (rev a3)

SAMSUNG HD642JJ

MAXTOR 6Y120P0, ATA DISK drive

What i tried:

Lots of kernel compilations, kernel parameters pci=nomsi, Bios settings like ide/ahci etc. Nothing helped.

Condition when the problem occurs:

Heavy disk I/O, sometimes just forwarding with mplayer in a movie file.

Solution (at least for me):

"Yes, there are two paths you can go by

But in the long run

There's still time to change the road youre on."

With this Led Zeppelin classic i give you two paths (solutions).

Software solution (dirty hack):

-------------------------------

Disabling ncq by putting the following in /etc/conf.d/local.start.

echo 1 /sys/block/sdX/device/queque_depth

This helped me because nothing else helped to disable ncq. The kernel ignored the bios setting where i disabled AHCI and so ncq.

The drive performance didn't degrade as far as i can tell. But i wasn't happy with this solution.

Hardware solution (for the brave ones):

---------------------------------------

I looked with hdparm -I /dev/sda for the Firmware of my harddisk.

ATA device, with non-removable media

    Model Number:       SAMSUNG HD642JJ

    Serial Number:      S1AFJDWQ600880

Firmware Revision:  1AA01112             <--- This was the old one

With the help of Google i found out that Dell has a new firmware for ALMOST THE SAME drive.

http://support.dell.com/support/downloads/download.aspx?c=us&l=en&s=gen&releaseid=R220045&SystemID=XPS_710&servicetag=&os=WW1&osl=en&deviceid=17790&devlib=0&typecnt=0&vercnt=1&catid=-1&impid=-1&formatcnt=1&libid=41&fileid=313665

Interesting is the "Description" of the firmware update:

'This firmware includes a fix for potential "hang" condition.

Samsung HD642JJ 640GB - DP/N D097D'

Okay it says its for a Samsung HD642JJ 640GB S2 HDD but i tried the firmware and i didn't get any

sata exceptions with system freezes.

! Warning: Don't make me responsable for killing your harddrive. I TAKE NO RESPONSABILITY FOR USING THIS FIRMWARE ON YOUR HARDDRIVE.

I POST THIS HERE TO GIVE THE LOST SOULS LIKE I WAS SOMETHING TO POSSIBLY LIVE IN PEACE AGAIN WITH THEIR PC.

TRY IT ON YOUR OWN RISK ! BACKUP YOUR IMPORTANT DATA BEFORE YOU UPDATE THE FIRMWARE !

! ATTENTION: After using the firmware you have to switch off your pc. If you don't and just reset your pc your harddrive won't be available and you

might get shocked (like i was). After you turn it on again, it was there and booted normally.

Now hdparm shows this:

ATA device, with non-removable media

    Model Number:       SAMSUNG HD642JJ

    Serial Number:      S1AFJDWQ600880

Firmware Revision:  1AA01117        <--- It worked!

And syslog-ng:

ata2: SATA link up 3.0 Gbps (SStatus 123 SControl 300)     <--- yeahhh!

ata2.00: ATA-7: SAMSUNG HD642JJ, 1AA01117, max UDMA7

ata2.00: 1250263728 sectors, multi 16: LBA48 NCQ (depth 31/32)

ata2.00: configured for UDMA/133

Now hate became love lately. The HD642JJ is quiet, fast and cool.

BTW: I now can use a lot of SATA features of the kernel that i first suspected to be the cause of my problem.

If anyone wants my kernel config file, i can post it here.

I hope it helped anyone who almost wanted to throw out this harddisk out of his window.

----------

