1. 04 6月, 2008 2 次提交
  2. 31 5月, 2008 11 次提交
  3. 20 5月, 2008 27 次提交
    • J
      drivers/ata: trim trailing whitespace · c85665ff
      Jeff Garzik 提交于
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      c85665ff
    • M
      Fixups to ATA ACPI hotplug · ae6c23c4
      Matthew Garrett 提交于
      The libata-acpi.c code currently accepts hotplug messages from both the
      port and the device. This does not match the behaviour of the bay
      driver, and may result in confusion when two hotplug requests are
      received for the same device. This patch limits the hotplug notification
      to removable ACPI devices, which in turn allows it to use the _STA
      method to determine whether the device has been removed or inserted.
      On removal, devices are marked as detached. On insertion, a hotplug scan
      is started. This should avoid lockups caused by the ata layer attempting
      to scan devices which have been removed. The uevent sending is moved
      outside the spinlock in order to avoid a warning generated by it firing
      when interrupts are disabled.
      Signed-off-by: NMatthew Garrett <mjg@redhat.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      ae6c23c4
    • T
      libata: ignore SIMG4726 config pseudo device · 50af2fa1
      Tejun Heo 提交于
      I was hoping ATA_HORKAGE_NODMA | ATA_HORKAGE_SKIP_PM could keep it
      happy but no even this doesn't work under certain configurations and
      it's not like we can do anything useful with the cofig device anyway.
      Replace ATA_HORKAGE_SKIP_PM with ATA_HORKAGE_DISABLE and use it for
      the config device.  This makes the device completely ignored by
      libata.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      50af2fa1
    • T
      sata_sil24: don't use NCQ if marvell 4140 PMP is attached · 906c1ff4
      Tejun Heo 提交于
      When 4140 PMP is attached to sil24, NCQ commands to fan out port 1 and
      2 (0 based) often stall if commands are in progress to other ports.
      I've tried a number of things but can't tell what's going on.  It
      never happens w/ ahci and reportedly sata_mv which can issue NCQ
      commands to multiple devices simultaneously like sil24 does.
      
      Disable NCQ for devices behind 4140 PMP for the time being.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Cc: Mark Lord <liml@rtr.ca>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      906c1ff4
    • T
      libata: don't schedule LPM action seperately during probing · 391191c1
      Tejun Heo 提交于
      There's no reason to schedule LPM action after probing is complete
      causing another EH iteration.  Just schedule it together with probing
      itself.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      391191c1
    • T
      libata: make sure PMP notification is turned off during recovery · f1bbfb90
      Tejun Heo 提交于
      PMP notification during reset can make some controllers fail reset
      processing and needs to be turned off during resets.  PMP attach and
      full-revalidation path did this via sata_pmp_configure() but the quick
      revalidation wasn't.  Move the notification disable code right above
      fan-out port recovery so that it's always turned off.
      
      This fixes obscure reset failures.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      f1bbfb90
    • T
      libata: increase PMP register access timeout to 3s · bf1bff6f
      Tejun Heo 提交于
      This timeout was set low because previously PMP register access was
      done via polling and register access timeouts could stack up.  This is
      no longer the case.  One timeout will make all following accesses fail
      immediately.
      
      In rare cases both marvell and SIMG PMPs need almost a second.  Bump
      it to 3s.
      
      While at it, rename it to SATA_PMP_RW_TIMEOUT.  It's not specific to
      SCR access.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      bf1bff6f
    • T
      libata: ignore recovered PHY errors · e0614db2
      Tejun Heo 提交于
      No reason to get overzealous about recovered comm and data errors.
      Some PHYs habitually sets them w/o no good reason and being draconian
      about these soft error conditions doesn't seem to help anybody.
      
      If need ever rises, we might need to add soft PHY error condition, say
      AC_ERR_MAYBE_ATA_BUS and use it only to determine whether speed down
      is necessary but I don't think that's very likely to happen.  It's far
      more likely we'll get timeouts or fatal transmission errors if
      recovered errors are so prominent that they hamper operation.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      e0614db2
    • T
      libata: kill hotplug related race condition · f046519f
      Tejun Heo 提交于
      Originally, whole reset processing was done while the port is frozen
      and SError was cleared during @postreset().  This had two race
      conditions.  1: hotplug could occur after reset but before SError is
      cleared and libata won't know about it.  2: hotplug could occur after
      all the reset is complete but before the port is thawed.  As all
      events are cleared on thaw, the hotplug event would be lost.
      
      Commit ac371987 kills the first race
      by clearing SError during link resume but before link onlineness test.
      However, this doesn't fix race #2 and in some cases clearing SError
      after SRST is a good idea.
      
      This patch solves this problem by cross checking link onlineness with
      classification result after SError is cleared and port is thawed.
      Reset is retried if link is online but all devices attached to the
      link are unknown.  As all devices will be revalidated, this one-way
      check is enough to ensure that all devices are detected and
      revalidated reliably.
      
      This, luckily, also fixes the cases where host controller returns
      bogus status while harddrive is spinning up after hotplug making
      classification run before the device sends the first FIS and thus
      causes misdetection.
      
      Low level drivers can bypass the logic by setting class explicitly to
      ATA_DEV_NONE if ever necessary (currently none requires this).
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      f046519f
    • T
      libata: move reset freeze/thaw handling into ata_eh_reset() · dc98c32c
      Tejun Heo 提交于
      Previously reset freeze/thaw handling lived outside of ata_eh_reset()
      mainly because the original PMP reset code needed the port frozen
      while resetting all the fan-out ports, which is no longer the case.
      
      This patch moves freeze/thaw handling into ata_eh_reset().
      @prereset() and @postreset() are now called w/o freezing the port
      although @prereset() an be called frozen if the port is frozen prior
      to entering ata_eh_reset().
      
      This makes code simpler and will help removing hotplug event related
      races.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      dc98c32c
    • T
      libata: reorganize ata_eh_reset() no reset method path · 932648b0
      Tejun Heo 提交于
      Reorganize ata_eh_reset() such that @prereset() is called even when no
      reset method is available and if block is used instead of goto to skip
      actual reset.  This makes no reset case behave better (readiness wait)
      and future changes easier.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      932648b0
    • T
      libata: fix sata_link_hardreset() @online out parameter handling · 0cbf0711
      Tejun Heo 提交于
      The @online out parameter is supposed to set to true iff link is
      online and reset succeeded as advertised in the function description
      and callers are coded expecting that.  However, sata_link_reset()
      didn't behave this way on device readiness test failure.  Fix it.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      0cbf0711
    • M
      sata_promise: other cleanups · 7715a6f9
      Mikael Pettersson 提交于
      Minor coding-style fixes for sata_promise:
      - remove stray blank lines
      - fix checkpatch.pl errors; warnings about long lines
        remain, but I don't intend to address those at this time
      - remove two inline directives: neither is essential and
        both functions are trivially inlinable anyway by virtue
        of being static and having a single unique call site
      - fix comment in pdc_interrupt(): the bits in PDC_INT_SEQMASK
        denote SEQIDs not tags, the distinction becomes important
        when NCQ gets implemented
      Signed-off-by: NMikael Pettersson <mikpe@it.uu.se>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      7715a6f9
    • M
      sata_promise: mmio access cleanups · 821d22cd
      Mikael Pettersson 提交于
      This patch cleans up sata_promise's mmio accesses.
      
      In sata_promise there are three distinct mmio address spaces:
      1. global registers, offsets from host->iomap[PDC_MMIO_BAR]
      2. per-port ATA registers, offsets from ap->ioaddr.cmd_addr
      3. per-port SATA registers, offsets from ap->ioaddr.scr_addr
      
      The driver currently often fails to indicate which address space
      a given mmio base pointer refers to, which is a source of bugs
      and confusion (see recent pdc_thaw() irq clearing bug; it's also
      been an obstacle for the pending NCQ extensions).
      
      To reduce these problems, adopt a coding style where the name of
      a base pointer always indicates which address space it refers to:
      1. global registers: host_mmio
      2. per-port ATA registers: ata_mmio
      3. per-port SATA registers: sata_mmio
      
      Also rearrange register offset definitions to clearly indicate
      which address space they belong to, and add a symbolic definition
      for the previously hard-coded PHYMODE4 register.
      Signed-off-by: NMikael Pettersson <mikpe@it.uu.se>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      821d22cd
    • M
      sata_promise: fix irq clearing buglets · a13db78e
      Mikael Pettersson 提交于
      This patch fixes two bugs in sata_promise's irq status clearing paths:
      1. When clearing the irq status for a specific port, the driver
         read the global SEQMASK register. This is wrong because that
         clears the irq status for _all_ ports.
      2. pdc_thaw() incorrectly added the PDC_INT_SEQMASK host register
         offset to a per-port ata engine base address. This resulted in
         it reading the unrelated PDC_PKT_SUBMIT register, which did not
         have the desired irq status clearing effect.
      
      In both cases the fix is to read from the port's Command/Status
      register. This also matches what Promise's own driver does.
      Signed-off-by: NMikael Pettersson <mikpe@it.uu.se>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      a13db78e
    • H
      ata: remove FIT() macro · 07633b5d
      Harvey Harrison 提交于
      Use the kernel-provided clamp_val() macro.
      
      FIT was always applied to a member of struct ata_timing (unsigned short)
      and two constants.  clamp_val will not cast to short anymore.
      Signed-off-by: NHarvey Harrison <harvey.harrison@gmail.com>
      Cc: Jeff Garzik <jeff@garzik.org>
      Cc: Tejun Heo <htejun@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      07633b5d
    • M
      sata_mv: ensure empty request queue for FBS-NCQ EH · 06aaca3f
      Mark Lord 提交于
      Check for an empty request queue before stopping EDMA after a FBS-NCQ error,
      as per recommendation from the Marvell datasheet.
      
      This ensures that the EDMA won't suddenly become active again
      just after our subsequent check of the empty/idle bits.
      
      Also bump DRV_VERSION.
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      06aaca3f
    • M
      sata_mv: cache main_irq_mask register in hpriv · 96e2c487
      Mark Lord 提交于
      Part five of simplifying/fixing handling of the main_irq_mask register
      to resolve unexpected interrupt issues observed in 2.6.26-rc*.
      
      Keep a cached copy of the main_irq_mask so that we don't have
      to stall the CPU to read it on every pass through mv_interrupt.
      
      This significantly speeds up interrupt handling, both for sata_mv,
      and for any other driver/device sharing the same PCI IRQ line.
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      96e2c487
    • M
      sata_mv: disregard masked irqs · a44253d2
      Mark Lord 提交于
      Part four of simplifying/fixing handling of the main_irq_mask register
      to resolve unexpected interrupt issues observed in 2.6.26-rc*.
      
      Ignore masked IRQs in mv_interrupt().
      This prevents "unexpected device interrupt while idle" messages.
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      a44253d2
    • M
      sata_mv: fix pmp drives not found · 88e675e1
      Mark Lord 提交于
      Part three of simplifying/fixing handling of the main_irq_mask register
      to resolve unexpected interrupt issues observed in 2.6.26-rc*.
      
      Partially fix a reported bug whereby we sometimes miss seeing drives on
      a port-multiplier, as reported by Gwendal Grignou <gwendal@google.com>.
      
      The problem was that we were receiving unexpected interrupts
      during EH from POLLed commands while accessing port-multiplier registers.
      These unexpected interrupts can be prevented by masking the DONE_IRQ bit
      for the port whenever not operating in EDMA mode.
      
      Also fix port_stop() to mask all port interrupts.
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      88e675e1
    • M
      sata_mv: consolidate main_irq_mask updates · c4de573b
      Mark Lord 提交于
      Part two of simplifying/fixing handling of the main_irq_mask register
      to resolve unexpected interrupt issues observed in 2.6.26-rc*.
      
      Consolidate all updates of the host main_irq_mask register
      into a single function.  This simplifies maintenance,
      and also prepares the way for caching it (later).
      
      No functionality changes in this update.
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      c4de573b
    • M
      sata_mv: don't blindly enable IRQs · 51de32d2
      Mark Lord 提交于
      Part one of simplifying/fixing handling of the main_irq_mask register
      to resolve unexpected interrupt issues observed in 2.6.26-rc*.
      
      Don't blindly enable port IRQs at host init time.
      Instead, enable only the bits that we want,
      which in this case is simply the PCI_ERR bit.
      
      The per-port bits can wait until the ports are reset/probed for devices.
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      51de32d2
    • M
      sata_mv: async notify for genIIe only · c443c500
      Mark Lord 提交于
      Now that we handle the FIS_IRQ_CAUSE register correctly,
      we can also now handle SATA asynchronous notification events.
      
      So enable them, but only for the more modern GenIIe chips.
      (older chips have unaddressed errata issues related to this).
      
      This fixes hot plug/unplug for port-muliplier ports.
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      c443c500
    • M
      sata_mv: group genIIe flags · ad3aef51
      Mark Lord 提交于
      Group all of the flags for GenIIe devices into a common definition,
      to ensure that any updates to them are shared by all GenIIe devices.
      
      This will help make future maintenance somewhat simpler.
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      ad3aef51
    • M
      sata_mv: fis irq register fixes · e4006077
      Mark Lord 提交于
      Fix handling of the FIS_IRQ_CAUSE register in sata_mv.
      
      This register exists *only* on GenIIe devices, so don't bother
      writing to it on older chips.  Also, it has to be read/cleared
      in mv_err_intr() before clearing the main ERR_IRQ_CAUSE register.
      
      This keeps sata_mv from getting stuck forever on certain error types.
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      e4006077
    • M
      sata_mv: always do softreset · 9dcffd99
      Mark Lord 提交于
      Always request a softreset after hardreset succeeds.
      
      This fixes a regression reported by Martin Michlmayr <tbm@cyrius.com>.
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      9dcffd99
    • C
      avr32/pata: avoid unnecessary memset (updated after comments) · 68b90ee7
      Christophe Jaillet 提交于
      Remove an explicit memset(.., 0, ...) to a variable allocated with
      kzalloc (i.e. 'info').
      Signed-off-by: NChristophe Jaillet <christophe.jaillet@wanadoo.fr>
      Acked-by: NHaavard Skinnemoen <haavard.skinnemoen@atmel.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      68b90ee7