1. 06 May, 2008 29 commits
    • Alan Cox's avatar
      pata_atiixp: Don't disable · 05177f17
      Alan Cox authored
      A couple of distributions (Fedora, Ubuntu) were having weird problems with the
      ATI IXP series PATA controllers being reported as simplex.  At the heart of
      the problem is that both distros ignored the recommendations to load pata_acpi
      and ata_generic *AFTER* specific host drivers.
      
      The underlying cause however is that if you D3 and then D0 an ATI IXP it
      helpfully throws away some configuration and won't let you rewrite it.
      
      Add checks to ata_generic and pata_acpi to pin ATIIXP devices.  Possibly the
      real answer here is to quirk them and pin them, but right now we can't do that
      before they've been pcim_enable()'d by a driver.
      
      I'm indebted to David Gero for this.  His bug report not only reported the
      problem but identified the cause correctly and he had tested the right values
      to prove what was going on
      
      [If you backport this for 2.6.24 you will need to pull in the 2.6.25
      removal of the bogus WARN_ON() in pcim_enagle]
      Signed-off-by: default avatarAlan Cox <alan@redhat.com>
      Tested-by: default avatarDavid Gero <davidg@havidave.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      05177f17
    • Tejun Heo's avatar
      sata_inic162x: update intro comment, up the version and drop EXPERIMENTAL · 22bfc6d5
      Tejun Heo authored
      sata_inic162x is now ready for production use.  Bump the version,
      explain what's working and what's not and drop EXPERIMENTAL.
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      22bfc6d5
    • Tejun Heo's avatar
      sata_inic162x: add cardbus support · ba66b242
      Tejun Heo authored
      When attached to cardbus, mmio region is at BAR 1.  Other than that,
      everything else is the same.  Add support for it.
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      ba66b242
    • Tejun Heo's avatar
      sata_inic162x: kill now unused SFF related stuff · f8b0685a
      Tejun Heo authored
      sata_inic162x now doesn't use any SFF features.  Remove all SFF
      related stuff.
      
      * Mask unsolicited ATA interrupts.  This removes our primary source of
        spurious interrupts and spurious interrupt handling can be tightened
        up.  There's no need to clear ATA interrupts by reading status
        register either.
      
      * Don't dance with IDMA_CTL_ATA_NIEN and simplify accesses to
        IDMA_CTL.
      
      * Inherit from sata_port_ops instead of ata_sff_port_ops.
      
      * Don't initialize or use ioaddr.  There's no need to map BAR0-4
        anymore.
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      f8b0685a
    • Tejun Heo's avatar
      sata_inic162x: use IDMA for ATAPI commands · b3f677e5
      Tejun Heo authored
      Use IDMA for ATAPI commands.  Write and some misc commands time out
      when executed using ATAPI_PROT_DMA but ATAPI_PROT_PIO works fine.  As
      PIO is driven by DMA too, it doesn't make any noticeable difference
      for native SATA devices.  inic_check_atapi_dma() is implemented to
      force PIO for those ATAPI commands.
      
      After this change, sata_inic162x issues all commands using IDMA.
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      b3f677e5
    • Tejun Heo's avatar
      sata_inic162x: use IDMA for non DMA ATA commands · 049e8e04
      Tejun Heo authored
      Use IDMA for PIO and non-data commands.  This allows sata_inic162x to
      safely drive LBA48 devices.  Kill inic_dev_config() which contains
      code to reject LBA48 devices.
      
      With this change, status checking in inic_qc_issue() to avoid hard
      lock up after hotplug can go away too.
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      049e8e04
    • Tejun Heo's avatar
      sata_inic162x: kill now unused bmdma related stuff · ab5b0235
      Tejun Heo authored
      sata_inic162x doesn't use BMDMA anymore.  Kill bmdma related stuff.
      
      * prdctl manipulation
      
      * port IRQ mask manipulation
      
      * inherit ATA_BASE_SHT instead of ATA_BMDMA_SHT
      
      * BMDMA methods
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      ab5b0235
    • Tejun Heo's avatar
      sata_inic162x: use IDMA for ATA_PROT_DMA · 3ad400a9
      Tejun Heo authored
      The modified driver on initio site has enough clue on how to use IDMA.
      Use IDMA for ATA_PROT_DMA.
      
      * LBA48 now works as long as it uses DMA (LBA48 devices still aren't
        allowed as it can destroy data if PIO is used for any reason).
      
      * No need to mask IRQs for read DMAs as IDMA_DONE is properly raised
        after transfer to memory is actually completed.  There will be some
        spurious interrupts but host_intr will handle it correctly and
        manipulating port IRQ mask interacts badly with the other port for
        some reason, so command type dependent port IRQ masking is not used
        anymore.
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      3ad400a9
    • Tejun Heo's avatar
      sata_inic162x: update TF read handling · 364fac0e
      Tejun Heo authored
      inic162x can't reliably read back TF or at least we don't know how to
      do it yet.  The only values which seem reliable are status and error.
      This patch updates access to TF.
      
      * implement inic_tf_read() which reads the TF area in mmio area
      
      * implement custom inic_qc_fill_rtf() which only returns true if
        status indicates device error.  it'll be returning bogus addresses
        for device errors but it'll be able to report why it failed at
        least.
      
      * implement custom inic_check_ready() and use ata_wait_after_reset()
        instead of the SFF version.
      
      * use inic_tf_read() for classification.
      
      This is not perfect but it fixes hotplug detection failure and at
      least makes the driver report 0's instead of random garbages while
      reporting valid status and error for device errors.
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      364fac0e
    • Tejun Heo's avatar
      sata_inic162x: add / update constants · b0dd9b8e
      Tejun Heo authored
      * add a bunch of constants, most are from the datasheet, a few
        undocumented ones are from initio's modified driver
      
      * HCTL_PWRDWN is bit 12 not 13
      
      This is in preparation of further inic162x updates.
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      b0dd9b8e
    • Tejun Heo's avatar
      sata_inic162x: misc clean ups · 36f674d9
      Tejun Heo authored
      * use larger indents for structure member definitions
      
      * kill unused variable @addr in inic_scr_write()
      
      * kill unnecessary flushes in inic_freeze/thaw()
      
      * kill buggy explicit kfree() on devres managed port private data
      
      This is in preparation of further inic162x updates.
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      36f674d9
    • Mark Lord's avatar
      sata_mv use hweight16() for bit counting (V2) · c46938cc
      Mark Lord authored
      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: default avatarMark Lord <mlord@pobox.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      c46938cc
    • Mark Lord's avatar
      sata_mv NCQ-EH for FIS-based switching · 4c299ca3
      Mark Lord authored
      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: default avatarMark Lord <mlord@pobox.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      4c299ca3
    • Mark Lord's avatar
      sata_mv delayed eh handling · 29d187bb
      Mark Lord authored
      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: default avatarMark Lord <mlord@pobox.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      29d187bb
    • Mark Lord's avatar
      libata: export ata_eh_analyze_ncq_error · 10acf3b0
      Mark Lord authored
      Export ata_eh_analyze_ncq_error() for subsequent use by sata_mv,
      as suggested by Tejun.
      Signed-off-by: default avatarMark Lord <mlord@pobox.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      10acf3b0
    • Mark Lord's avatar
      sata_mv new mv_port_intr function · a9010329
      Mark Lord authored
      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: default avatarMark Lord <mlord@pobox.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      a9010329
    • Mark Lord's avatar
      sata_mv fix mv_host_intr bug for hc_irq_cause · eabd5eb1
      Mark Lord authored
      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: default avatarMark Lord <mlord@pobox.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      eabd5eb1
    • Mark Lord's avatar
      sata_mv NCQ and SError fixes for mv_err_intr · 37b9046a
      Mark Lord authored
      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: default avatarMark Lord <mlord@pobox.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      37b9046a
    • Mark Lord's avatar
      sata_mv rearrange mv_config_fbs · 00f42eab
      Mark Lord authored
      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: default avatarMark Lord <mlord@pobox.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      00f42eab
    • Mark Lord's avatar
      sata_mv errata workaround for sata25 part 1 · dd2890f6
      Mark Lord authored
      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: default avatarMark Lord <mlord@pobox.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      dd2890f6
    • Mark Lord's avatar
      sata_mv new mv_qc_defer method · 3e4a1391
      Mark Lord authored
      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: default avatarMark Lord <mlord@pobox.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      3e4a1391
    • Mark Lord's avatar
      sata_mv wait for empty+idle · 9b2c4e0b
      Mark Lord authored
      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: default avatarMark Lord <mlord@pobox.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      9b2c4e0b
    • Mark Lord's avatar
      sata_mv pci features · 616d4a98
      Mark Lord authored
      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: default avatarMark Lord <mlord@pobox.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      616d4a98
    • Mark Lord's avatar
      sata_mv more cosmetic changes · 8e7decdb
      Mark Lord authored
      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: default avatarMark Lord <mlord@pobox.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      8e7decdb
    • Alek Du's avatar
      libata: Add Intel SCH PATA driver · 07ab85de
      Alek Du authored
      This patch adds Intel SCH chipsets (AF82US15W, AF82US15L, AF82UL11L)
      PATA controller support.
      Signed-off-by: default avatarAlek Du <alek.du@intel.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      07ab85de
    • Tejun Heo's avatar
      ata_piix: verify SIDPR access before enabling it · cb6716c8
      Tejun Heo authored
      On certain configurations (certain macbooks), even though all the
      conditions for SIDPR access described in the datasheet are met,
      actually reading those registers just returns 0 and have no effect on
      write.  Verify SIDPR is actually working before enabling it.
      
      This is reported by Ryan Roth in bz#10512.
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      Cc: Ryan Roth <ryan.roth@ch2m.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      cb6716c8
    • Tejun Heo's avatar
      libata: improve post-reset device ready test · 78ab88f0
      Tejun Heo authored
      Some controllers (jmb and inic162x) use 0x77 and 0x7f to indicate that
      the device isn't ready yet.  It looks like they use 0xff if device
      presence is detected but connection isn't established.  0x77 or 0x7f
      after connection is established and use the value from signature FIS
      after receiving it.
      
      This patch implements ata_check_ready(), which takes TF status value
      and determines whether the port is ready or not considering the above
      and other conditions, and use it in @check_ready() functions.  This is
      safe as both 0x77 and 0x7f aren't valid ready status value even though
      they have BSY bit cleared.
      
      This fixes hot plug detection failures which can be triggered with
      certain drives if they aren't already spun up when the data connector
      is hot plugged.
      
      Tested on sil, sil24, ahci (jmb/ich), piix and inic162x combined with
      eight drives from all major vendors.
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      78ab88f0
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband · a1530636
      Linus Torvalds authored
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
        mlx4_core: Support creation of FMRs with pages smaller than 4K
        IB/ehca: Fix function return types
        RDMA/cxgb3: Bump up the MPA connection setup timeout.
        RDMA/cxgb3: Silently ignore close reply after abort.
        RDMA/cxgb3: QP flush fixes
        IB/ipoib: Fix transmit queue stalling forever
        IB/mlx4: Fix off-by-one errors in calls to mlx4_ib_free_cq_buf()
      a1530636
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of... · bb896afe
      Linus Torvalds authored
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched-fixes
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched-fixes:
        sched: default to n for GROUP_SCHED and FAIR_GROUP_SCHED
        sched: add optional support for CONFIG_HAVE_UNSTABLE_SCHED_CLOCK
        sched, x86: add HAVE_UNSTABLE_SCHED_CLOCK
        sched: fix cpu clock
        sched: fair-group: fix a Div0 error of the fair group scheduler
        sched: fix missing locking in sched_domains code
        sched: make clock sync tunable by architecture code
        sched: fix debugging
        sched: fix sched_info_switch not being called according to documentation
        sched: fix hrtick_start_fair and CPU-Hotplug
        sched: fix SCHED_FAIR wake-idle logic error
        sched: fix RT task-wakeup logic
        sched: add statics, don't return void expressions
        sched: add debug checks to idle functions
        sched: remove old sched doc
        sched: make rt_sched_class, idle_sched_class static
        sched: optimize calc_delta_mine()
        sched: fix normalized sleeper
      bb896afe
  2. 05 May, 2008 11 commits