How to put the interface into Partial mode for AHCI via software ?

Posted on 2012-09-03
Last Modified: 2012-09-06
According to AHCI spec, software can initiate interface power management state transitions if the link layer is currently in the L_IDLE state. System Software Initiated
PxCMD.ICC is used by system software to initiate interface power management state transitions. The request to transition to a different interface power management state shall only be acted on by the HBA if the Link layer is currently in the L_IDLE state. If the HBA’s Link layer is not in the L_IDLE state when the PxCMD.ICC field is written, the request shall be ignored. The HBA shall not perform a transition directly from Partial to Slumber or from Slumber to Partial based on a new value being written to PxCMD.ICC. If the link is currently in a Partial or Slumber interface power management state, it is software’s responsibility to bring the link to the active state before requesting a transition to a different interface power management state. The time from the request written to PxCMD.ICC until the link is active is bounded by the maximum recovery times from Partial or Slumber as outlined in the Serial ATA Revision 2.6 specification.

After reading involved document I summarize the steps as below trying to put the interface into the Partial state:

1) issue read/write commands to device first
2) after commands completed while loop to check if PxCMD.ICC = 0 or not
3) (... wait until PxCMD.ICC = 0 and this means the HBA is ready to to accept a new interface command...)
4) set PxCMD.ICC = 2(2 indicates "Partial" state)
5) wait for PxCMD.ICC back to "0" (spec said HBA will update this back to idle finally...)
6) while loop to check if PxSSTS.IPM = 2 (where 2 means: current interface is in Partial state)

The result was: PxSSTS is not equal to "2" for a long time and I guess the interface did not enter the partial state correctly...

@ In this configuration HBA registers CAP.SSC = PSC = 1 and I set PxSCTL.IPM = 0(no interface restrictions)

My questions are:

[1] Do I have to check if device support this transition ?  
[2] How to put into the Slumber state ?

Thanks !
Question by:liaoo
    1 Comment

    Accepted Solution

    I found below descriptions in sata spec (about identify device data ) :

    Word 76: Serial ATA capabilities
    Bit 9 when set to one indicates that the Serial ATA device supports the Partial and Slumber interface power management states when initiated by the host. Devices shall support either host initiated interface power management or device-initiated interface power management. If word 78 bit 3 is cleared to zero, then word 77 bit 9 shall be set to one

    And I found this bit is 0 for the testing drive. After using the other drive with that bit = 1 entering Partial or Slumber state is OK.

    Can I conclude that this bit decides if drive support these state transitions ?

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Upper back Pain: My back hurt for months. Upper back, mostly my neck, spine and across my shoulder blades. I was getting headaches too, that felt like they were caused by tension in my shoulders, but now I feel fine! I'm sharing this hoping someone…
    The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
    The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now