30 Oct, 2013

1 commit

  • In order to save power consumption as much as possible.

    * Disable sata phy internal pll reference clock when sysetem enter
    into suspend mode, enable it after resume.

    * Setup module parameter used to enable imx ahci test power down
    mode(PDDQ) or not, when there is no device detected on the port

    * minor modifications:
    - The format of the copyright is changed, because that the original
    one can't pass fsl internal patch reivew without the character
    '(c)'.
    - Exports ahci_platform_ops and ahci_error_handler().

    NOTE:
    * The hot-plug can't be supported when PDDQ mode is ever enabled.

    * module parameter usage how-to:
    - default: enable PDDQ mode when no device detected.
    - add "ahci-imx.hotplug=1" into kernel command line if your don't
    want to enable PDDQ mode when no device detected on the port.

    tj: Slightly updated description and comments.

    Signed-off-by: Richard Zhu
    Signed-off-by: Tejun Heo

    Richard Zhu
     

15 May, 2013

1 commit


25 Jan, 2013

1 commit

  • Take advantage of multiple MSIs implementation on x86 - on
    systems with IRQ remapping AHCI ports not only get assigned
    separate MSI vectors - but also separate IRQs. As result,
    interrupts generated by different ports could be serviced on
    different CPUs rather than on a single one.

    In cases when number of allocated MSIs is less than requested
    the Sharing Last MSI mode does not get used, no matter
    implemented in hardware or not. Instead, the driver assumes the
    advantage of multiple MSIs is negated and falls back to the
    single MSI mode as if MRSM bit was set (some Intel chips
    implement this strategy anyway - MRSM bit gets set even if the
    number of allocated MSIs exceeds the number of implemented ports).

    Signed-off-by: Alexander Gordeev
    Acked-by: Jeff Garzik
    Cc: Bjorn Helgaas
    Cc: Suresh Siddha
    Cc: Yinghai Lu
    Cc: Matthew Wilcox
    Cc: Linus Torvalds
    Cc: Andrew Morton
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/15bf7ee314dd55f21ec7d2a01c47613cd8190a7c.1353324359.git.agordeev@redhat.com
    Signed-off-by: Ingo Molnar

    Alexander Gordeev
     

13 Sep, 2012

2 commits

  • On many architectures, drivers are supposed to prepare/unprepare &
    enable/disable functional clock of device. This patch adds clock support for
    ahci_platform.

    Signed-off-by: Viresh Kumar
    Signed-off-by: Jeff Garzik

    Viresh Kumar
     
  • Device Sleep is a feature as described in AHCI 1.3.1 Technical Proposal.
    This feature enables an HBA and SATA storage device to enter the DevSleep
    interface state, enabling lower power SATA-based systems.

    Aggressive Device Sleep enables the HBA to assert the DEVSLP signal as
    soon as there are no commands outstanding to the device and the port
    specific Device Sleep idle timer has expired. This enables autonomous
    entry into the DevSleep interface state without waiting for software
    in power sensitive systems.

    This patch enables Aggressive Device Sleep only if both host controller
    and device support it.

    Tested on AMD reference board together with Device Sleep supported device
    sample.

    Signed-off-by: Shane Huang
    Reviewed-by: Aaron Lu
    Signed-off-by: Jeff Garzik

    Shane Huang
     

18 Aug, 2012

1 commit


14 Mar, 2012

2 commits

  • We will need this macro in both ahci.c and ahci_platform.c, so just move it
    to the header.

    Signed-off-by: Brian Norris
    Signed-off-by: Jeff Garzik
    Cc: stable@kernel.org

    Brian Norris
     
  • The following commit was intended to fix problems with specific AHCI
    controller(s) that would become bricks if the AHCI specification was not
    followed strictly (that is, if ahci_start_engine() was called while the
    controller was in the wrong state):

    commit 7faa33da9b7add01db9f1ad92c6a5d9145e940a7
    ahci: start engine only during soft/hard resets

    However, some devices currently have issues with that fix, so we must
    implement a flag that delays the ahci_start_engine() call only for specific
    controllers.

    This commit simply introduces the flag, without enabling it in any driver.

    Note that even when AHCI_HFLAG_DELAY_ENGINE is not enabled, this patch does
    not constitue a full revert to commit 7faa33da; there is still a change in
    behavior to the ahci_port_suspend() failure path.

    Signed-off-by: Brian Norris
    Signed-off-by: Jeff Garzik
    Cc: stable@kernel.org

    Brian Norris
     

24 Jul, 2011

1 commit


24 Apr, 2011

1 commit


31 Mar, 2011

1 commit


02 Mar, 2011

3 commits

  • Commit 6b7ae9545ad9875a289f4191c0216b473e313cb9 (libata: reimplement link power
    management) removed the check of ATA_FLAG_LPM but neglected to remove the flag
    itself. Do it now...

    Signed-off-by: Sergei Shtylyov
    Signed-off-by: Jeff Garzik

    Sergei Shtylyov
     
  • All checks of ATA_FLAG_NO_LEGACY have been removed by the commits
    c791c30670ea61f19eec390124128bf278e854fe ([libata] minor PCI IDE probe
    fixes and cleanups) and f0d36efdc624beb3d9e29b9ab9e9537bf0f25d5b (libata:
    update libata core layer to use devres), so I think it's time to finally
    get rid of this flag...

    Signed-off-by: Sergei Shtylyov
    Signed-off-by: Jeff Garzik

    Sergei Shtylyov
     
  • Commit 0d5ff566779f894ca9937231a181eb31e4adff0e (libata: convert to iomap)
    removed all checks of ATA_FLAG_MMIO but neglected to remove the flag itself.
    Do it now, at last...

    Signed-off-by: Sergei Shtylyov
    Signed-off-by: Jeff Garzik

    Sergei Shtylyov
     

06 Jan, 2011

1 commit


22 Oct, 2010

3 commits

  • ATA devices don't send D2H Reg FIS after an successful ATA PIO data-in
    command. The host is supposed to take the TF and E_Status of the
    preceding PIO Setup FIS. Update ahci_qc_fill_rtf() such that it takes
    TF + E_Status from PIO Setup FIS after a successful ATA PIO data-in
    command.

    Without this patch, result_tf for such a command is filled with the
    content of the previous D2H Reg FIS which belongs to a previous
    command, which can make the command incorrectly seen as failed.

    * Patch updated to grab the whole TF + E_Status from PIO Setup FIS
    instead of just E_Status as suggested by Robert Hancock.

    Signed-off-by: Tejun Heo
    Reported-by: Mark Lord
    Cc: Robert Hancock
    Cc: stable@kernel.org
    Signed-off-by: Jeff Garzik

    Tejun Heo
     
  • The current LPM implementation has the following issues.

    * Operation order isn't well thought-out. e.g. HIPM should be
    configured after IPM in SControl is properly configured. Not the
    other way around.

    * Suspend/resume paths call ata_lpm_enable/disable() which must only
    be called from EH context directly. Also, ata_lpm_enable/disable()
    were called whether LPM was in use or not.

    * Implementation is per-port when it should be per-link. As a result,
    it can't be used for controllers with slave links or PMP.

    * LPM state isn't managed consistently. After a link reset for
    whatever reason including suspend/resume the actual LPM state would
    be reset leaving ap->lpm_policy inconsistent.

    * Generic/driver-specific logic boundary isn't clear. Currently,
    libahci has to mangle stuff which libata EH proper should be
    handling. This makes the implementation unnecessarily complex and
    fragile.

    * Tied to ALPM. Doesn't consider DIPM only cases and doesn't check
    whether the device allows HIPM.

    * Error handling isn't implemented.

    Given the extent of mismatch with the rest of libata, I don't think
    trying to fix it piecewise makes much sense. This patch reimplements
    LPM support.

    * The new implementation is per-link. The target policy is still
    port-wide (ap->target_lpm_policy) but all the mechanisms and states
    are per-link and integrate well with the rest of link abstraction
    and can work with slave and PMP links.

    * Core EH has proper control of LPM state. LPM state is reconfigured
    when and only when reconfiguration is necessary. It makes sure that
    LPM state is reset when probing for new device on the link.
    Controller agnostic logic is now implemented in libata EH proper and
    driver implementation only has to deal with controller specifics.

    * Proper error handling. LPM config failure is attributed to the
    device on the link and LPM is disabled for the link if it fails
    repeatedly.

    * ops->enable/disable_pm() are replaced with single ops->set_lpm()
    which takes @policy and @hints. This simplifies driver specific
    implementation.

    Signed-off-by: Tejun Heo
    Signed-off-by: Jeff Garzik

    Tejun Heo
     
  • Link power management related symbols are in confusing state w/ mixed
    usages of lpm, ipm and pm. This patch cleans up lpm related symbols
    and sysfs show/store functions as follows.

    * lpm states - NOT_AVAILABLE, MIN_POWER, MAX_PERFORMANCE and
    MEDIUM_POWER are renamed to ATA_LPM_UNKNOWN and
    ATA_LPM_{MIN|MAX|MED}_POWER.

    * Pre/postfixes are unified to lpm.

    * sysfs show/store functions for link_power_management_policy were
    curiously named get/put and unnecessarily complex. Renamed to
    show/store and simplified.

    Signed-off-by: Tejun Heo
    Signed-off-by: Jeff Garzik

    Tejun Heo
     

29 Sep, 2010

1 commit

  • libata depends on scsi_host_template for module reference counting and
    sht's should be owned by each low level driver. During libahci split,
    the sht was left with libahci.ko leaving the actual low level drivers
    not reference counted. This made ahci and ahci_platform always
    unloadable even while they're being actively used.

    Fix it by defining AHCI_SHT() macro in ahci.h and defining a sht for
    each low level ahci driver.

    stable: only applicable to 2.6.35.

    Signed-off-by: Tejun Heo
    Reported-by: Pedro Francisco
    Tested-by: Michael Tokarev
    Cc: stable@kernel.org
    Signed-off-by: Jeff Garzik

    Tejun Heo
     

26 Aug, 2010

1 commit


15 May, 2010

4 commits

  • Add "em_buffer" attribute for SATA AHCI hosts to provide a way for
    userland to access AHCI EM (enclosure management) buffer directly if the
    host supports EM.

    AHCI driver should support SGPIO EM messages. However the SATA/AHCI
    specs did not define the SGPIO message format filled in EM buffer.
    Different HW vendors may have different definitions. The mainly purpose
    of this attribute is to solve this issue by allowing HW vendors to
    provide userland drivers and tools for their SGPIO initiators.

    Signed-off-by: Harry Zhang
    Signed-off-by: Jeff Garzik

    Harry Zhang
     
  • Detect enclosure management message type automatically at driver
    initialization, instead of using module parameter "ahci_em_messages".

    Signed-off-by: Harry Zhang
    Signed-off-by: Jeff Garzik

    Harry Zhang
     
  • It turns out different generations of MCPs have differing quirks.

    * MCP 65-73 : FPDMA AA broken, lies about PMP support, forgets to report NCQ
    * MCP 77-79 : FPDMA AA broken, lies about PMP support
    * MCP 89 : FPDMA AA broken

    Instead of turngin off FPDMA AA on all NVIDIAs, implement
    HFLAG_NO_FPDMA_AA, define additional board IDs and apply necessary
    quirks.

    This fixes bko#15481 and the list of quirks is verified by Peer Chen.

    http://bugzilla.kernel.org/show_bug.cgi?id=15481

    Signed-off-by: Tejun Heo
    Cc: Peer Chen
    Signed-off-by: Jeff Garzik

    Tejun Heo
     
  • This patch should contain no functional changes, just moves code
    around.

    Signed-off-by: Anton Vorontsov
    Signed-off-by: Jeff Garzik

    Anton Vorontsov