1. 20 4月, 2017 1 次提交
    • S
      iwlwifi: pcie: prepare for dynamic queue allocation · b2a3b1c1
      Sara Sharon 提交于
      In a000 transport we will allocate queues dynamically.
      Right now queue are allocated as one big chunk of memory
      and accessed as such.
      The dynamic allocation of the queues will require accessing
      the queues as pointers.
      In order to keep simplicity of pre-a000 tx queues handling,
      keep allocating and freeing the memory in the same style,
      but move to access the queues in the various functions as
      individual pointers.
      Dynamic allocation for the a000 devices will be in a separate
      patch.
      Signed-off-by: NSara Sharon <sara.sharon@intel.com>
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      b2a3b1c1
  2. 11 4月, 2017 2 次提交
    • S
      iwlwifi: pcie: add context information support · eda50cde
      Sara Sharon 提交于
      Context information structure is going to be used in a000
      devices for firmware self init.
      
      The self init includes firmware self loading from DRAM by
      ROM.
      This means the TFH relevant firmware loading can be cleaned up.
      
      The firmware loading includes the paging memory as well, so op
      mode can stop initializing the paging and sending the DRAM_BLOCK_CMD.
      
      Firmware is doing RFH, TFH and SCD configuration, while driver
      only fills the required configurations and addresses in the
      context information structure.
      
      The only remaining access to RFH is the write pointer, which
      is updated upon alive interrupt after FW configured the RFH.
      Signed-off-by: NSara Sharon <sara.sharon@intel.com>
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      eda50cde
    • E
      iwlwifi: pcie: print less data upon firmware crash · afb84431
      Emmanuel Grumbach 提交于
      We don't need to print so much data in the kernel log.
      Limit the data to be printed to the queue that actually
      got stuck in case of a TFD queue hang, and stop dumping
      all the CSR and FH registers. Over the course of time, the
      CSR and FH values haven't proven themselves to be really
      useful for debugging, and they are now in the firmware dump
      anyway.
      
      This comes as a preparation to the addition of more data
      required to be printed by the firwmare team.
      Signed-off-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      afb84431
  3. 08 2月, 2017 1 次提交
    • G
      iwlwifi: pcie: set STATUS_RFKILL immediately after interrupt · 2b18824a
      Golan Ben Ami 提交于
      Currently, when getting a RFKILL interrupt, the transport enters a flow
      in which it stops the device, disables other interrupts, etc. After
      stopping the device, the transport resets the hw, and sleeps. During
      the sleep, a context switch occurs and host commands are sent by upper
      layers (e.g. mvm) to the fw. This is possible since the op_mode layer
      and the transport layer hold different mutexes.
      
      Since the STATUS_RFKILL bit isn't set, the transport layer doesn't
      recognize that RFKILL was toggled on, and no commands can actually be
      sent, so it enqueues the command to the tx queue and sets a timer on
      the queue.
      
      After switching context back to stopping the device, STATUS_RFKILL is
      set, and then the transport can't send the command to the fw.
      This eventually results in a queue hang.
      
      Fix this by setting STATUS_RFKILL immediately when
      the interrupt is fired.
      Signed-off-by: NGolan Ben-Ami <golan.ben.ami@intel.com>
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      2b18824a
  4. 07 2月, 2017 1 次提交
    • J
      iwlwifi: pcie: fix another RF-kill race · 23aeea94
      Johannes Berg 提交于
      When resuming, it's possible for the following scenario to occur:
      
       * iwl_pci_resume() enables the RF-kill interrupt
       * iwl_pci_resume() reads the RF-kill state (e.g. to 'radio enabled')
       * RF_KILL interrupt triggers, and iwl_pcie_irq_handler() reads the
         state, now 'radio disabled', and acquires the &trans_pcie->mutex.
       * iwl_pcie_irq_handler() further calls iwl_trans_pcie_rf_kill() to
         indicate to the higher layers that the radio is now disabled (and
         stops the device while at it)
       * iwl_pcie_irq_handler() drops the mutex
       * iwl_pci_resume() continues, acquires the mutex and calls the higher
         layers to indicate that the radio is enabled.
      
      At this point, the device is stopped but the higher layers think it's
      available, and can call deeply into the driver to try to enable it.
      However, this will fail since the device is actually disabled.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      23aeea94
  5. 19 9月, 2016 2 次提交
  6. 16 9月, 2016 2 次提交
  7. 06 7月, 2016 6 次提交
  8. 01 7月, 2016 4 次提交
  9. 11 5月, 2016 3 次提交
  10. 30 3月, 2016 3 次提交
  11. 10 3月, 2016 2 次提交
    • G
      iwlwifi: pcie: avoid restocks inside rx loop if not emergency · e0e168dc
      Gregory Greenman 提交于
      When trying to reach high Rx throughput of more than 500Mbps on
      a device with a relatively weak CPU (Atom x5-Z8500), CPU utilization
      may become a bottleneck. Analysis showed that we are looping in
      iwl_pcie_rx_handle for very long periods which led to starvation
      of other threads (iwl_pcie_rx_handle runs with _bh disabled).
      We were handling Rx and allocating new buffers and the new buffers
      were ready quickly enough to be available before we had finished
      handling all the buffers available in the hardware. As a
      consequence, we called iwl_pcie_rxq_restock to refill the hardware
      with the new buffers, and start again handling new buffers without
      exiting the function. Since we read the hardware pointer again when
      we goto restart, new buffers were handled immediately instead of
      exiting the function.
      
      This patch avoids refilling RBs inside rx handling loop, unless an
      emergency situation is reached. It also doesn't read the hardware
      pointer again unless we are in an emergency (unlikely) case.
      This significantly reduce the maximal time we spend in
      iwl_pcie_rx_handle with _bh disabled.
      Signed-off-by: NGregory Greenman <gregory.greenman@intel.com>
      Signed-off-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      e0e168dc
    • S
      iwlwifi: pcie: fine tune number of rxbs · 7b542436
      Sara Sharon 提交于
      We kick the allocator when we have 2 RBDs that don't have
      attached RBs, and the allocator allocates 8 RBs meaning
      that it needs another 6 RBDs to attach the RBs to.
      The design is that allocator should always have enough RBDs
      to fulfill requests, so we give in advance 6 RBDs to the
      allocator so that when it is kicked, it gets additional 2 RBDs
      and has enough RBDs.
      These RBDs were taken from the Rx queue itself, meaning
      that each Rx queue didn't have the maximal number of
      RBDs, but MAX - 6.
      Change initial number of RBDs in the system to include both
      queue size and allocator reserves.
      Note the multi-queue is always 511 instead of 512 to avoid a
      full queue since we cannot detect this state easily enough in
      the 9000 arch.
      Signed-off-by: NSara Sharon <sara.sharon@intel.com>
      Signed-off-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      7b542436
  12. 07 3月, 2016 2 次提交
  13. 02 3月, 2016 1 次提交
  14. 28 2月, 2016 2 次提交
  15. 15 2月, 2016 1 次提交
    • E
      iwlwifi: pcie: fix RF-Kill vs. firmware load race · a6bd005f
      Emmanuel Grumbach 提交于
      When we load the firmware, we hold trans_pcie->mutex to
      avoid nested flows. We also rely on the ISR to wake up the
      thread when the DMA has finished copying a chunk. During
      this flow, we enable the RF-Kill interrupt.
      
      The problem is that the RF-Kill interrupt handler can take
      the mutex and bring the device down. This means that if
      we load the firmware while the RF-Kill switch is enabled
      (which will happen when we load the INIT firmware to read
      the device's capabilities and register to mac80211), we
      may get an RF-Kill interrupt immediately and the ISR will
      be waiting for the mutex held by the thread that is
      currently loading the firmware. At this stage, the ISR
      won't be able to service the DMA's interrupt needed to
      wake up the thread that load the firmware. We are in a
      deadlock situation which ends when the thread that loads
      the firmware fails on timeout and releases the mutex.
      
      To fix this, take the mutex later in the flow, disable
      the interrupts and synchronize_irq() to give a chance to
      the RF-Kill interrupt to run and complete.
      After that, mask all the interrupts besides the DMA
      interrupt and proceed with firmware load. Make sure to
      check that there was no RF-Kill interrupt when the
      interrupts were disabled.
      
      This fixes https://bugzilla.kernel.org/show_bug.cgi?id=111361Signed-off-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      a6bd005f
  16. 01 2月, 2016 1 次提交
  17. 31 1月, 2016 2 次提交
    • S
      iwlwifi: pcie: add 9000 series multi queue rx DMA support · 96a6497b
      Sara Sharon 提交于
      The 9000 series introduces several changes in the device
      DMA operation.
      As the device now supports multi-queue rx, several DMA channels
      should be configured.
      The flows of providing the device with the allocated RBDs now
      changes as well - the device maintains a separate table of used
      and free table.
      
      The hardware may use the free table to feed RBDs to any queue.
      This requires maintaing a shared table to map returned RBDs to
      the original RXB - for that purpose the VID is introduced - an
      internal identifier of the RB placed in the lower 12 bits and
      returned by HW in the used data.
      
      Another change is the support of 64 bit DMA address.
      Signed-off-by: NSara Sharon <sara.sharon@intel.com>
      Signed-off-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      96a6497b
    • S
      iwlwifi: pcie: add infrastructure for multi-queue rx · 78485054
      Sara Sharon 提交于
      The 9000 series devices will support multi rx queues.
      Current code has one static rx queue - change it to allocate
      a number of queues per the device capability (pre-9000 devices
      have the number of rx queues set to one).
      
      Subsequent generalizations are:
      
      Change the code to access an explicit numbered rx queue only
      when the queue number is known - when handling interrupt, when
      accessing the default queue and when iterating the queues.
      The rest of the functions will receive the rx queue as a pointer.
      
      Generalize the warning in allocation failure to consider the
      allocator status instead of a single rx queue status.
      
      Move the rx initial pool of memory buffers to be shared among
      all the queues and allocated to the default queue on init.
      Signed-off-by: NSara Sharon <sara.sharon@intel.com>
      Signed-off-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      78485054
  18. 13 12月, 2015 1 次提交
  19. 02 12月, 2015 2 次提交
  20. 26 11月, 2015 1 次提交