# Booting hangs at "Freeing unused kernel memory" (ahci) FIXED

## e3k

it does not happen everytime, and if it happens i press ctrl-alt-del and have a 50% chance that it boots successfully.

i think i have this after kernel rebuild with sata ahci driver support.

is this a known issue?

ps: the sata dvdburner for which i need the drivers works fineLast edited by e3k on Sun Dec 30, 2007 8:30 pm; edited 2 times in total

----------

## BradN

Problems like that can be difficult to diagnose, but if you think it might be due to that driver, try removing it from the kernel and see if it helps.  At least once it's narrowed down, you could try making it a module and seeing if it works better that way (provided you don't need it to boot the system).

----------

## e3k

thanks i  try to use the driver as module when i get back home. the system booted fine without the driver, so i assume the module should not be a problem. i think i could also try the other sata driver, the one designed for chipset of my mother board, but i am lazy to experiment when i know that my dvd works fine with the acpi driver.

by the way, there is realy no possibility to to turn on some more verbose output for the memory freeing process?

----------

## BradN

Ahh, I would definitely avoid using the AHCI driver if there's one for your particular chipset available.  Not sure what chipset you use, but the VIA driver works great for me.

----------

## e3k

i am also not quite sure, so its time to figure out...   :Wink: 

i have buildi the kernel with ahci as module and now i have not a hanging on freeing memory issue but a :'scanning for ahci devices...' isue which comes later when loading the modules.

************************updated below

with this kernel i had 0 successful boots out of 8 tries. after unpluging the dvd sata cable (the only sata device in my pc) the system booted fine.

**************************

with this kernel i have allways a delay in booting (1min) and then the system boots fine but w/o dvd rom support.

i will do some research on this and report back.Last edited by e3k on Tue Oct 30, 2007 6:44 pm; edited 1 time in total

----------

## BradN

Again, I'd recommend avoiding AHCI entirely when there's a chipset specific driver available.

----------

## e3k

i have this mobo: MSI K9N Neo-F V3 - nForce560, DualCh DDR2 800, PCIe x16, SATA II RAID, GLAN, 8ch audio, scAM2 (and this dvd: PLEXTOR PX-810SA SATA)

i will first try to rebuild the kernel with the nforce drivers inside kernel.

----------

## e3k

did remove the ahci driver from kernel - replaced by nvidia driver: now i have a successfull boot but the dvd does not work.

i will now try it with ahci driver and diverse grub boot options i have found.

----------

## bunder

 *e3k wrote:*   

> did remove the ahci driver from kernel - replaced by nvidia driver: now i have a successfull boot but the dvd does not work.
> 
> i will now try it with ahci driver and diverse grub boot options i have found.

 

did you accidentally turn off sata or scsi emulation or something?  perhaps a peek at your .config would help.  mind pastebinning it along with a lspci?

----------

## e3k

lspci

http://pastebin.com/m41527b0f

2.6.22-gentoo-r5.config - where the problem initially occured

http://pastebin.com/m36ff5146

2.6.22-gentoo-r8 - i did install a new kernel using a similar but not equal .config 

http://pastebin.com/m4ee2c8a3

now with the r8 kernel  it booted 3 times without hangup with ahci drivers and without the nvidia chipset drivers.

----------

## e3k

i had together 8 boots w/o problems with the R8 kernel and new .config . now i got again a hangup. after pressing ctrl-alt-del he successfully went trough the memory freeing.

----------

## e3k

here some dmesg information. i will keep searching in the meantime  :Wink: 

e

**************************************************

with Nvidia Sata support in kernel (dvd does not work)

**************************************************

dmesg | grep scsi

..nothihg

dmesg | grep SCSI

SCSI subsystem initialized

dmesg | grep ata

..nothing

**************************************************

**************************************************

with ahci as module (booting is delayed, dvd does not work)

**************************************************

dmesg | grep ahci 

ahci 0000:00:0a.0: version 2.2

ahci 0000:00:0a.0: AHCI 0001.0100 32 slots 4 ports 3 Gbps 0xf impl SATA mode

ahci 0000:00:0a.0: flags: 64bit ncq pm led clo pmp pio

scsi0 : ahci

scsi1 : ahci

scsi2 : ahci

scsi3 : ahci

dmesg | grep ata

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

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

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

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

ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)

ata1.00: ATAPI: PLEXTOR DVDR   PX-810SA, 1.00, max UDMA/66

ata1.00: qc timeout (cmd 0xef)

ata1.00: failed to set xfermode (err_mask=0x4)

ata1: failed to recover some devices, retrying in 5 secs

ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)

ata1.00: qc timeout (cmd 0xef)

ata1.00: failed to set xfermode (err_mask=0x4)

ata1.00: limiting speed to UDMA/66:PIO3

ata1: failed to recover some devices, retrying in 5 secs

ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)

ata1.00: qc timeout (cmd 0xef)

ata1.00: failed to set xfermode (err_mask=0x4)

ata1.00: disabled

ata2: SATA link down (SStatus 0 SControl 300)

ata3: SATA link down (SStatus 0 SControl 300)

ata4: SATA link down (SStatus 0 SControl 300)

**************************************************

**************************************************

with ahci in kernel (boot sporadicaly hangs when freeing memory, dvd works)

**************************************************

dmesg | grep scsi

scsi0 : ahci

scsi1 : ahci

scsi2 : ahci

scsi3 : ahci

scsi 0:0:0:0: CD-ROM            PLEXTOR  DVDR   PX-810SA  1.00 PQ: 0 ANSI: 5

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

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

sr 0:0:0:0: Attached scsi generic sg0 type 5

dmesg | grep ata

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

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

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

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

ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)

ata1.00: ATAPI: PLEXTOR DVDR   PX-810SA, 1.00, max UDMA/66

ata1.00: configured for UDMA/66

ata2: SATA link down (SStatus 0 SControl 300)

ata3: SATA link down (SStatus 0 SControl 300)

ata4: SATA link down (SStatus 0 SControl 300)

ata1: soft resetting port

ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)

ata1.00: configured for UDMA/66

ata1: EH complete

**************************************************

----------

## e3k

with google("qc timeout" xfermode "sata dvd") i could find a few hits but no real solutions. i will continue later.

----------

## e3k

noacpi noapic acpi=null did not help in the grub boot line

i did also try to turn off acpi in bios. did not affect the behavior of the system.

----------

## e3k

https://bugs.gentoo.org/show_bug.cgi?id=198041

----------

## e3k

fixed with using 2.6.24-rc6 kernel. thanks for troubleshooting guidance at bugs.gentoo.org

----------

