1. 27 1月, 2012 14 次提交
    • B
      sfc: Add hwmon driver for boards using SFC9000-family controllers · 55c5e0f8
      Ben Hutchings 提交于
      The SFC9000-family controllers have firmware to manage all board
      peripherals including temperature, heat sink continuity and voltage
      sensors.  The firmware reports sensor alarms, which we log, and
      will shut down the board if necessary.
      
      Some users may want to monitor their boards more closely, so add an
      hwmon driver that exposes all sensors reported by the firmware.  Move
      efx_mcdi_sensor_event() into the new file so it can share the array of
      sensor labels with the hwmon driver.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      55c5e0f8
    • B
      sfc: Clean up test interrupt handling · 1646a6f3
      Ben Hutchings 提交于
      Interrupts are normally generated by the event queues, moderated by
      timers.  However, they may also be triggered by detection of a 'fatal'
      error condition (e.g. memory parity error) or by the host writing to
      certain CSR fields as part of a self-test.
      
      The IRQ level/index used for these on Falcon rev B0 and Siena is set
      by the KER_INT_LEVE_SEL field and cached by the driver in
      efx_nic::fatal_irq_level.  Since this value is also relevant to
      self-tests rename the field to just 'irq_level'.
      
      Avoid unnecessary cache traffic by using a per-channel 'last_irq_cpu'
      field and only writing to the per-controller field when the interrupt
      matches efx_nic::irq_level.  Remove the volatile qualifier and use
      ACCESS_ONCE in the places we read these fields.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      1646a6f3
    • B
      Partly revert "sfc: Handle serious errors in exactly one interrupt handler" · f70d1847
      Ben Hutchings 提交于
      This reverts commit 63695459 in
      drivers/net/ethernet/sfc/falcon.c.
      
      Unlike the INT_ISR0 register on later controller revisions, the
      NET_IVEC_INT_Q bits written to memory are only ever set for
      interrupting event queues, not for any other interrupt sources.
      
      By definition there can only be one legacy interrupt handler per
      function, so there is no need to worry about detecting a fatal
      interrupt more than once.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      f70d1847
    • B
      sfc: Remove dependence on NAPI polling in efx_test_eventq_irq() · 0fb53faa
      Ben Hutchings 提交于
      We cannot safely assume that the NAPI handler will complete within the
      20 ms that we allow for the event self-test.  The handler may be
      deferred for longer than this, particularly on realtime kernels.
      
      Instead, check whether either an event has been handled or (as in the
      old failure path) whether an interrupt has been received and an event
      has been delivered but not yet handled.  Use napi_disable() to
      synchronize with the NAPI handler before checking, since it will
      clear events before updating eventq_read_ptr.
      
      Remove the test result chan.N.eventq.poll, since it is not an error
      if the NAPI handler does not run during the test.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      0fb53faa
    • B
      sfc: Correct interrupt timer quantum for Siena (normal and turbo mode) · cc180b69
      Ben Hutchings 提交于
      We currently assume that the timer quantum for Siena is 5 us, the same
      as for Falcon.  This is not correct; timer ticks are generated on a
      rota which takes a minimum of 768 cycles (each event delivery or other
      timer change will delay it by 3 cycles).  The timer quantum should be
      6.144 or 3.072 us depending on whether turbo mode is active.
      
      Replace EFX_IRQ_MOD_RESOLUTION with a timer_quantum_ns field in struct
      efx_nic, initialised by the efx_nic_type::probe function.
      
      While we're at it, replace EFX_IRQ_MOD_MAX with a timer_period_max
      field in struct efx_nic_type.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      cc180b69
    • M
    • B
      sfc: Consistently test DEBUG macro, not EFX_ENABLE_DEBUG · 5f3f9d6c
      Ben Hutchings 提交于
      The netif_dbg() macro is defined in <linux/netdevice.h>.  If the DEBUG
      macro is defined, it logs a message at 'debug' level, otherwise it
      does nothing.
      
      In net_driver.h we define DEBUG if EFX_ENABLE_DEBUG is defined, but
      this is too late for those source files that already got a
      definition of netif_dbg() by including <linux/netdevice.h>
      
      Get rid of EFX_ENABLE_DEBUG, and only define and test DEBUG.
      
      In mtd.c, we do not use DEBUG as a condition flag but are forced to
      use the DEBUG macro-function from <linux/mtd/mtd.h>.  Undefine DEBUG
      before including it.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      5f3f9d6c
    • B
      sfc: Remove efx_nic_type::push_multicast_hash operation · 30b81cda
      Ben Hutchings 提交于
      Both implementations of efx_nic_type::reconfigure_mac operation
      push the multicast hash filter to the hardware.  It is therefore
      redundant to call efx_nic_type::push_multicast_hash as well.
      
      efx_mcdi_mac_reconfigure() also uses this operation, but the
      implementation for Siena just uses MCDI anyway.  Merge that into
      efx_mcdi_mac_reconfigure().
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      30b81cda
    • B
      sfc: Merge efx_mcdi_mac_check_fault() and efx_mcdi_get_mac_faults() · 1daf4170
      Ben Hutchings 提交于
      The latter is only called by the former, which is a very short
      wrapper.  Further, gcc 4.5 may currently wrongly warn that the
      'faults' variable may be used uninitialised.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      1daf4170
    • B
      sfc: Merge efx_mac_operations into efx_nic_type · 710b208d
      Ben Hutchings 提交于
      No NICs need to switch efx_mac_operations at run-time, and the MAC
      operations are fairly closely bound to NIC types.
      
      Move efx_mac_operations::reconfigure to efx_nic_type::reconfigure_mac
      and efx_mac_operations::check_fault fo efx_nic_type::check_mac_fault.
      Change callers to call through efx->type or directly if the NIC type
      is known.
      
      Remove efx_mac_operations::update_stats.  The implementations for
      Falcon used to fetch MAC statistics synchronously and this was used by
      efx_register_netdev() to clear statistics after running self-tests.
      However, it now only converts statistics that have already been
      fetched (and that only for Falcon), and the call from
      efx_register_netdev() has no effect.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      710b208d
    • B
      sfc: Hold efx_nic::stats_lock while reading efx_nic::mac_stats · 1cb34522
      Ben Hutchings 提交于
      efx_nic::stats_lock is used to serialise stats updates, but each
      reader was dropping it before it finished reading efx_nic::mac_stats.
      
      If there were concurrent stats reads using procfs, or one using procfs
      and one using ethtool, an update could race with a read.  On a 32-bit
      system, the reader could see word-tearing of 64-bit stats (32 bits of
      the old value and 32 bits of the new).
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      1cb34522
    • B
      sfc: Use new names for MC shared memory layout constants · 788ec41c
      Ben Hutchings 提交于
      These are defined alongside the firmware protocol in mcdi_pcol.h.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      788ec41c
    • B
      sfc: Make handling of MC reboot more reliable · 3f713bf4
      Ben Hutchings 提交于
      When the MC reboots, either as part of a firmware upgrade or due to a
      bug, it attempts to complete (with an error) any requests that were
      outstanding before the reboot.  Since there is an inherent race
      condition in checking this, it will also write to a status word in
      shared memory.
      
      If we look at each of these separately, we may detect each reboot
      twice, resulting in a spurious command failure after a firmware
      upgrade or frustrating recovery from a firmware bug.  Instead, if a
      request completion indicates a reboot, we must poll and clear the
      status word.
      
      This bug was previously masked by use of an incorrect address for the
      status word.  Fix that, using the definition now included in
      mcdi_pcol.h.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      3f713bf4
    • B
      sfc: Remove fallback for invalid permanent MAC address · e332bcb3
      Ben Hutchings 提交于
      By the time we look at the MAC address in efx_probe_port(), either the
      driver or the firmware has already validated the board configuration.
      The possibility of having an invalid MAC address just isn't worth
      considering.  It certainly isn't worth having a compile-time option
      for this.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      e332bcb3
  2. 10 1月, 2012 5 次提交
  3. 06 1月, 2012 3 次提交
  4. 05 1月, 2012 18 次提交