1. 29 9月, 2008 1 次提交
    • T
      libata: make SCR access ops per-link · 82ef04fb
      Tejun Heo 提交于
      Logically, SCR access ops should take @link; however, there was no
      compelling reason to convert all SCR access ops when adding @link
      abstraction as there's one-to-one mapping between a port and a non-PMP
      link.  However, that assumption won't hold anymore with the scheduled
      addition of slave link.
      
      Make SCR access ops per-link.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      82ef04fb
  2. 09 9月, 2008 1 次提交
  3. 22 8月, 2008 2 次提交
  4. 04 7月, 2008 1 次提交
  5. 19 6月, 2008 2 次提交
    • M
      sata_mv: warn on PIO with multiple DRQs · c6112bd8
      Mark Lord 提交于
      Chip errata sometimes prevents reliable use of PIO commands which involve
      more than a single DRQ (data request).  In normal operation, libata should
      not generate such PIO commands (uses DMA instead), but they could be sent
      in via SG_IO from userspace.
      
      A full workaround might be to break up such commands into sequences
      of single DRQ ones, but that's just way too complex for something
      that doesn't normally happen in real life.
      
      So, allow the attempt (it often works, despite the errata),
      but log the event for reference when somebody screams.
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      c6112bd8
    • M
      sata_mv: enable async_notify for 60x1 Rev.C0 and higher · 3bd0a70e
      Mark Lord 提交于
      The early chipsets cannot safely handle Async Notification (AN),
      but 6041/6081 chip revision "C0" (and newer) can handle it.
      
      So allow AN for "C0" and higher.
      
      This enables use of hotplug on PMP ports for the 6041/6081 PCI Rev.9 chips.
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      3bd0a70e
  6. 04 6月, 2008 1 次提交
  7. 31 5月, 2008 5 次提交
  8. 20 5月, 2008 10 次提交
  9. 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
  10. 29 4月, 2008 1 次提交
  11. 25 4月, 2008 4 次提交
    • M
      sata_mv: re-enable hotplug, update TODO list · 85afb934
      Mark Lord 提交于
      Re-enable hotplug, now that the interrupt/error handling are mostly sane.
      Also update the TODO list at the top.
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      85afb934
    • M
      sata_mv: leave SError bits untouched in mv_err_intr · 8d07379d
      Mark Lord 提交于
      Here it is again, minus the checkpatch.pl complaint:
      
      Rework mv_err_intr() to leave the SError bits as-is,
      so that libata-eh has a chance to see/use them.
      
      We originally thought that clearing them here was necessary
      before writing back to edma_err_cause (per the Marvell datasheets),
      but we will end up reseting the chip regardless in those cases.
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      8d07379d
    • M
      sata_mv: more interrupt handling rework · 8f767f8a
      Mark Lord 提交于
      Continue fixing the interrupt handling logic.
      
      Get rid of mv_intr_pio(), by using ata_sff_host_intr() for PIO..
      
      Add a mv_unexpected_intr() catch-all for "impossible" scenarios,
      where we get an interrupt that shouldn't have happened
      (never seen in testing, but just in case..).
      
      Rearrange the logic so that we always process completed
      response queue entries before looking for other events,
      This avoids having to re-issue commands that had already succeeded.
      
      As part of this, we split out some duplicated functionality
      into a new function, mv_get_active_qc().
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      8f767f8a
    • M
      sata_mv: tidy host controller interrupt handling · a3718c1f
      Mark Lord 提交于
      Tidy up host controller interrupt handling, by moving the weirdo
      bit shifting from mv_interrupt() to mv_host_intr().
      
      This lets us take advantage of the MV_PORT_TO_SHIFT_AND_HARDPORT() macro
      from an earlier patch to greatly simplify the port numbering logic.
      
      Also, defer reading the hc_irq_cause (one per hc) until it is
      actually proven to be needed.  This may save a microsecond or
      so per interrupt, on average (a later patchset will further reduce
      unnecessary register reads throughout the driver).
      
      Apart from that, we still leave the actual IRQ handling logic alone.
      Subsequent patches in this series will address that.
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      a3718c1f