How to boot with ahci timing problems

Article contributed by Anarchos on Wed, 2014-06-11 14:08

More and more often i can't boot on my laptop, due to timeoout issues in the ahci layer :
when it tries to probe or reinit the DVD drive, some sata_request fails and i ended in KDL with the (in)famous "Panic : did not find any boot partitions" message.
There is even many tickets about that message, and some must addressing the sata_request abort problem.

I just discover that enabling the "Enable on screen debug output" and "Disable on screen paging", the sata_request never fails anymore.
Also if i put the BIOS in IDE mode, i don't get those ahci failures anymore.
I intend to build my own haiku with debug information on the ahci layer to investigate where lies the problem.
Stay tune and don't hesitate to comment !

Comments

Re: How to boot with ahci timing problems

It would be great if this could be fixed. I have had the ahci boot problem since 2012. I have reported one of the bugs concernibg it as well. I always have to go into the BIOS and set sata to ide, then when finished with haiku session, reenable ahci for linux mint. I suppose I could just leave it at ide setting for both OS's but prefer ahci in linux.
You said haiku can boot in debug non paging mode. Is there anyway to turn this on permanently without having to press shift or space key at every boot?

Re: How to boot with ahci timing problems

I tried the failsafe debug option with non paging. It does not work for me.

Re: How to boot with ahci timing problems

As i am pretty sure the problem comes from a hard drive being too slow to answer to the "identify" sata request, using the debug logs printed on screen (without paging) made haiku a bit slower, enough to let the hard drive spin fast enough to reduce its latence before getting the sata request.

But as you can guess, those latencies (of haiku ando f the hard drive) depends on your hardware configuration.
I still have not time to try other timeouts on sata requests, and i can get no information, even in the ahci spec, timeouts are not given values.

Re: How to boot with ahci timing problems

I am not a programmer an any real sense but would it be possible to alter the ahci driver temporarily with a timeout testing and sensing subroutine that would move in steps the allowed timeout, testing the ability to find the drive at each step then reseting if not successful and moving up to the next step x 2 the first. If that was successful, in case the allowed timeout becomes unnecessarily large iterate again by applying the stepping unit last multiplied result with, step-step x 0.5/2. Testing again with that, if it finds the drive it can re iterate again until it won't find it anymore and go to another part of the subroutine after a drive timeout reset. That next part takes the last step result that caused the timeout and does this, step + step x 0.5/1.5. How many times it re iterates with these suroutines is dependent on successfully finding the drive and how much you want to allow the timeout to be larger than necessary.
This would only be a temporary subroutine program applied to the different drive controllers/drives makes and models, to find the best timings. The most satisfactory timing could then be applied to the ahci driver.
I'm putting this in English combo BASIC program. It could be translated to C++.
Just a reasonably simple program to find obscure unavailible information.

Re: How to boot with ahci timing problems

Since you probably will not have access to all the drives that would be necessary, the subroutine testing and sensing program might be made available with the temporarily altered ahci driver to users with the timeout bug. When the program found the best timeout for that users drives. the result would be stored and uploaded to the trac bug report