1. 22 Oct, 2010 9 commits
    • Tejun Heo's avatar
      libata: implement LPM support for port multipliers · 6c8ea89c
      Tejun Heo authored
      Port multipliers can do DIPM on fan-out links fine.  Implement support
      for it.  Tested w/ SIMG 57xx and marvell PMPs.  Both the host and
      fan-out links enter power save modes nicely.
      
      SIMG 37xx and 47xx report link offline on SStatus causing EH to detach
      the devices.  Blacklisted.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      6c8ea89c
    • Tejun Heo's avatar
      libata: reimplement link power management · 6b7ae954
      Tejun Heo authored
      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: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      6b7ae954
    • Tejun Heo's avatar
      libata: implement sata_link_scr_lpm() and make ata_dev_set_feature() global · 1152b261
      Tejun Heo authored
      Link power management is about to be reimplemented.  Prepare for it.
      
      * Implement sata_link_scr_lpm().
      
      * Drop static from ata_dev_set_feature() and make it available to
        other libata files.
      
      * Trivial whitespace adjustments.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      1152b261
    • Tejun Heo's avatar
      libata: clean up lpm related symbols and sysfs show/store functions · c93b263e
      Tejun Heo authored
      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: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      c93b263e
    • Luck, Tony's avatar
      [libata] Fix section mismatch: ata_sff_exit · c43d559f
      Luck, Tony authored
      This build error showed up in linux-next tag next-20100820 for ia64:
      
      WARNING: vmlinux.o(.init.text+0x4a952): Section mismatch in reference from the function ata_init() to the function .exit.text:ata_sff_exit()
      The function __init ata_init() references
      a function __exit ata_sff_exit().
      This is often seen when error handling in the init function
      uses functionality in the exit path.
      The fix is often to remove the __exit annotation of
      ata_sff_exit() so it may be used outside an exit section.
      
      Sure enough, dropping the __exit fixes the problem.
      Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      c43d559f
    • Jeff Garzik's avatar
      6a2148c6
    • Grant Grundler's avatar
      [libata] support for > 512 byte sectors (e.g. 4K Native) · 295124dc
      Grant Grundler authored
      This change enables my x86 machine to recognize and talk to a
      "Native 4K" SATA device.
      
      When I started working on this, I didn't know Matthew Wilcox had
      posted a similar patch 2 years ago:
        http://git.kernel.org/?p=linux/kernel/git/willy/ata.git;a=shortlog;h=refs/heads/ata-large-sectors
      
      Gwendal Grignou pointed me at the the above code and small portions of
      this patch include Matthew's work. That's why Mathew is first on the
      "Signed-off-by:". I've NOT included his use of a bitmap to determine
      512 vs Native for ATA command block size - just used a simple table.
      And bugs are almost certainly mine.
      
      Lastly, the patch has been tested with a native 4K 'Engineering
      Sample' drive provided by Hitachi GST.
      Signed-off-by: default avatarMatthew Wilcox <matthew.r.wilcox@intel.com>
      Signed-off-by: default avatarGrant Grundler <grundler@google.com>
      Reviewed-by: default avatarGwendal Grignou <gwendal@google.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      295124dc
    • Tejun Heo's avatar
      libata: always use ata_qc_complete_multiple() for NCQ command completions · 1aadf5c3
      Tejun Heo authored
      Currently, sata_fsl, mv and nv call ata_qc_complete() multiple times
      from their interrupt handlers to indicate completion of NCQ commands.
      This limits the visibility the libata core layer has into how commands
      are being executed and completed, which is necessary to support IRQ
      expecting in generic way.  libata already has an interface to complete
      multiple commands at once - ata_qc_complete_multiple() which ahci and
      sata_sil24 already use.
      
      This patch updates the three drivers to use ata_qc_complete_multiple()
      too and updates comments on ata_qc_complete[_multiple]() regarding
      their usages with NCQ completions.  This change not only provides
      better visibility into command execution to the core layer but also
      simplifies low level drivers.
      
      * sata_fsl: It already builds done_mask.  Conversion is straight
        forward.
      
      * sata_mv: mv_process_crpb_response() no longer checks for illegal
        completions, it just returns whether the tag is completed or not.
        mv_process_crpb_entries() builds done_mask from it and passes it to
        ata_qc_complete_multiple() which will check for illegal completions.
      
      * sata_nv adma: Similar to sata_mv.  nv_adma_check_cpb() now just
        returns the tag status and nv_adma_interrupt() builds done_mask from
        it and passes it to ata_qc_complete_multiple().
      
      * sata_nv swncq: It already builds done_mask.  Drop unnecessary
        illegal transition checks and call ata_qc_complete_multiple().
      
      In the long run, it might be a good idea to make ata_qc_complete()
      whine if called when multiple NCQ commands are in flight.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Ashish Kalra <ashish.kalra@freescale.com>
      Cc: Saeed Bishara <saeed@marvell.com>
      Cc: Mark Lord <liml@rtr.ca>
      Cc: Robert Hancock <hancockr@shaw.ca>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      1aadf5c3
    • Gwendal Grignou's avatar
      [libata] Add ATA transport class · d9027470
      Gwendal Grignou authored
      This is a scheleton for libata transport class.
      All information is read only, exporting information from libata:
      - ata_port class: one per ATA port
      - ata_link class: one per ATA port or 15 for SATA Port Multiplier
      - ata_device class: up to 2 for PATA link, usually one for SATA.
      Signed-off-by: default avatarGwendal Grignou <gwendal@google.com>
      Reviewed-by: default avatarGrant Grundler <grundler@google.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      d9027470
  2. 20 Oct, 2010 5 commits
  3. 19 Oct, 2010 7 commits
  4. 18 Oct, 2010 18 commits
  5. 17 Oct, 2010 1 commit