1. 31 5月, 2008 1 次提交
    • M
      sata_mv: move SOC_FLAG to hpriv · 1f398472
      Mark Lord 提交于
      Convert the System-on-Chip flag from a host flag to an hpriv flag,
      for better consistency with other chip-rev flags, and for easier use
      in errata fixes etc.
      
      Also change the related "HAS_PCI()" into "!IS_SOC()" for better consistency
      of naming/use (everything else SOC-related already uses "SOC").
      
      There are no functionality changes in this patch.
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      1f398472
  2. 20 5月, 2008 10 次提交
  3. 06 5月, 2008 12 次提交
    • M
      sata_mv use hweight16() for bit counting (V2) · c46938cc
      Mark Lord 提交于
      Some tidying as suggested by Grant Grundler.
      
      Nuke local bit-counting function from sata_mv in favour of using hweight16().
      Also add a short explanation for the 15msec timeout used when waiting for empty/idle.
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      c46938cc
    • M
      sata_mv NCQ-EH for FIS-based switching · 4c299ca3
      Mark Lord 提交于
      Convert sata_mv's EH for FIS-based switching (FBS) over to the
      sequence recommended by Marvell.  This enables us to catch/analyze
      multiple failed links on a port-multiplier when using NCQ.
      
      To do this, we clear the ERR_DEV bit in the EDMA Halt-Conditions register,
      so that the EDMA engine doesn't self-disable on the first NCQ error.
      
      Our EH code sets the MV_PP_FLAG_DELAYED_EH flag to prevent new commands
      being queued while we await completion of all outstanding NCQ commands
      on all links of the failed PM.
      
      The SATA Test Control register tells us which links have failed,
      so we must only wait for any other active links to finish up
      before we stop the EDMA and run the .error_handler afterward.
      
      The patch also includes skeleton code for handling of non-NCQ FBS operation.
      This is more for documentation purposes right now, as that mode is not yet
      enabled in sata_mv.
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      4c299ca3
    • M
      sata_mv delayed eh handling · 29d187bb
      Mark Lord 提交于
      Introduce a new "delayed error handling" mechanism in sata_mv,
      to enable us to eventually deal with multiple simultaneous NCQ
      failures on a single host link when a PM is present.
      
      This involves a port flag (MV_PP_FLAG_DELAYED_EH) to prevent new
      commands being queued, and a pmp bitmap to indicate which pmp links
      had NCQ errors.
      
      The new mv_pmp_error_handler() uses those values to invoke
      ata_eh_analyze_ncq_error() on each failed link, prior to freezing
      the port and passing control to sata_pmp_error_handler().
      
      This is based upon a strategy suggested by Tejun.
      
      For now, we just implement the delayed mechanism.
      The next patch in this series will add the multiple-NCQ EH code
      to take advantage of it.
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      29d187bb
    • M
      sata_mv new mv_port_intr function · a9010329
      Mark Lord 提交于
      Separate out the inner loop body of mv_host_intr()
      into it's own function called mv_port_intr().
      
      This should help maintainabilty.
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      a9010329
    • M
      sata_mv fix mv_host_intr bug for hc_irq_cause · eabd5eb1
      Mark Lord 提交于
      Remove the unwanted reads of hc_irq_cause from mv_host_intr(),
      thereby removing a bug whereby we were not always reading it when needed..
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      eabd5eb1
    • M
      sata_mv NCQ and SError fixes for mv_err_intr · 37b9046a
      Mark Lord 提交于
      Sigh.  Undo some earlier changes to mv_port_intr(),
      so that we now read/clear SError again in all cases.
      
      Arrange the top of the function to be as close as possible
      to what we need for a later update (in this series) for ERR_DEV handling.
      
      Fix things so that libata-eh can attempt a READ_LOG_EXT_10H
      in response to a failed NCQ command, by just doing a local
      mv_eh_freeze() rather than ata_port_freeze().
      
      This will now fully handle NCQ errors much of the time,
      but more fixes are needed for FBS/PMP, and for certain chip errata.
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      37b9046a
    • M
      sata_mv rearrange mv_config_fbs · 00f42eab
      Mark Lord 提交于
      Rearrange mv_config_fbs() to more closely follow the (corrected) datasheet
      recommendations for NCQ and FIS-based switching (FBS).
      
      Also, maintain a port flag to let us know when FBS is enabled.
      We will make more use of that flag later in this patch series.
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      00f42eab
    • M
      sata_mv errata workaround for sata25 part 1 · dd2890f6
      Mark Lord 提交于
      Part 1 of workaround for errata "sata#25" for the 60x1 series
      (the second half of this errata workaround is still in development.
      
      Bit22 of the GPIO port has to be set "on" when in NCQ mode.
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      dd2890f6
    • M
      sata_mv new mv_qc_defer method · 3e4a1391
      Mark Lord 提交于
      The EDMA engine cannot tolerate a mix of NCQ/non-NCQ commands,
      and cannot be used for PIO at all.  So we need to prevent libata
      from trying to feed us such mixtures.
      
      Introduce mv_qc_defer() for this purpose, and use it for all chip versions.
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      3e4a1391
    • M
      sata_mv wait for empty+idle · 9b2c4e0b
      Mark Lord 提交于
      When performing EH, it is recommended to wait for the EDMA engine
      to empty out requests-in-progress before disabling EDMA.
      
      Introduce code to poll the EDMA_STATUS register for idle/empty bits
      before disabling EDMA.  For non-EH operation, this will normally exit
      without delay, other than the register read.
      
      A later series of patches may focus on eliminating this and various
      other register reads (when possible) throughout the driver,
      but for now we're focussing on solid reliablity.
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      9b2c4e0b
    • M
      sata_mv pci features · 616d4a98
      Mark Lord 提交于
      Some of the GenIIe EDMA optimizations should not be used
      for non-PCI (SOC) devices, and nor for certain configurations
      of conventional PCI (non PCI-X, PCIe) buses.
      
      Logic taken/simplified from that in the Marvell proprietary driver.
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      616d4a98
    • M
      sata_mv more cosmetic changes · 8e7decdb
      Mark Lord 提交于
      More cosmetic changes; no code changes.
      
       -- try and improve consistency of naming.
       -- add missing _OFS to tails of register offset definitions.
       -- rename mv_setup_ifctl() to mv_setup_ifcfg(), since that's what it really does.
       -- remove/move some dead comments
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      8e7decdb
  4. 29 4月, 2008 1 次提交
  5. 25 4月, 2008 8 次提交
  6. 18 4月, 2008 8 次提交
    • M
      sata_mv add temporary 3 second init delay for SiliconImage PMs · 094e50b2
      Mark Lord 提交于
      sata_mv does not yet fully support hotplug (coming soon, though).
      This means that the driver may not find a Silicon Image port-multiplier
      when first loaded, because those devices take in exceess of 3 seconds
      to sync up the SATA PHY (most devices do this in mere microseconds).
      
      So, as a short-term interim measure, here we insert a 3-second pause
      on initial driver load, once per controller board (not once per port!),
      to allow the Silicon Image port-multipliers to be detected later.
      
      This will be removed again (soon!) once hotplug is fully implemented/working.
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      094e50b2
    • M
      sata_mv remove redundant edma init code · 8a74f1a4
      Mark Lord 提交于
      Remove unnecessary edma init code from port_start.
      This sequence gets done later on the first I/O to the port.
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      8a74f1a4
    • M
      sata_mv add basic port multiplier support · e49856d8
      Mark Lord 提交于
      Add basic port-multiplier support to sata_mv.
      This works in Command-based-switching mode for Gen-II chipsets,
      and in FIS-based-switching mode for Gen-IIe chipsets.
      
      Error handling remains at the primary port level for now
      (works okay, but not great).  This will get fixed in a subsequent
      patch series for IRQ/EH handling fixes.  There are also some
      known NCQ/PMP errata to be dealt with in the near future,
      once we have this basic PMP support in place.
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      e49856d8
    • M
      sata_mv fix SOC flags, enable NCQ on SOC · 02c1f32f
      Mark Lord 提交于
      The System-On-Chip (SOC) core supports all of the same
      features as the other recent Marvell chips,
      including NCQ and IRQ coalescing.
      
      Fix the chip_soc flags to enable these capabilities
      (note that the driver currently does nothing special
      for IRQ coalescing, though).
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      02c1f32f
    • M
      sata_mv disable hotplug for now · 40f0bc2d
      Mark Lord 提交于
      Disable hot plug/unplug detection in sata_mv for now.
      It is currently broken, and also interferes with PMP support.
      
      This will get fixed in a subsequent patch series.
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      40f0bc2d
    • M
      sata_mv cosmetics · 17c5aab5
      Mark Lord 提交于
      More cosmetic cleanups to unclutter the changes needed for PMP support.
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      17c5aab5
    • M
      sata_mv hardreset rework · 0d8be5cb
      Mark Lord 提交于
      Rework and simplify sata_mv's hardreset code to take advantage of
      libata improvements since it was first coded.
      
      Also, get rid of the now unnecessary prereset, postreset, and phy_reset
      functions.
      
      This patch also paves the way for subsequent pmp support patches,
      which will follow once this one passes muster.
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      0d8be5cb
    • T
      libata: rename SFF functions · 9363c382
      Tejun Heo 提交于
      SFF functions have confusing names.  Some have sff prefix, some have
      bmdma, some std, some pci and some none.  Unify the naming by...
      
      * SFF functions which are common to both BMDMA and non-BMDMA are
        prefixed with ata_sff_.
      
      * SFF functions which are specific to BMDMA are prefixed with
        ata_bmdma_.
      
      * SFF functions which are specific to PCI but apply to both BMDMA and
        non-BMDMA are prefixed with ata_pci_sff_.
      
      * SFF functions which are specific to PCI and BMDMA are prefixed with
        ata_pci_bmdma_.
      
      * Drop generic prefixes from LLD specific routines.  For example,
        bfin_std_dev_select -> bfin_dev_select.
      
      The following renames are noteworthy.
      
        ata_qc_issue_prot() -> ata_sff_qc_issue()
        ata_pci_default_filter() -> ata_bmdma_mode_filter()
        ata_dev_try_classify() -> ata_sff_dev_classify()
      
      This rename is in preparation of separating SFF support out of libata
      core layer.  This patch strictly renames functions and doesn't
      introduce any behavior difference.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      9363c382