1. 06 3月, 2013 1 次提交
  2. 28 2月, 2013 3 次提交
    • J
      iwlwifi: use coherent DMA memory for command header · 38c0f334
      Johannes Berg 提交于
      Recently in commit 8a964f44
      ("iwlwifi: always copy first 16 bytes of commands") we fixed
      the problem that the hardware writes back to the command and
      that could overwrite parts of the data that was still needed
      and would thus be corrupted.
      
      Investigating this problem more closely we found that this
      write-back isn't really ordered very well with respect to
      other DMA traffic. Therefore, it sometimes happened that the
      write-back occurred after unmapping the command again which
      is clearly an issue and could corrupt the next allocation
      that goes to that spot, or (better) cause IOMMU faults.
      
      To fix this, allocate coherent memory for the first 16 bytes
      of each command, containing the write-back part, and use it
      for all queues. All the dynamic DMA mappings only need to be
      TO_DEVICE then. This ensures that even when the write-back
      happens "too late" it can't hit memory that has been freed
      or a mapping that doesn't exist any more.
      
      Since now the actual command is no longer modified, we can
      also remove CMD_WANT_HCMD and get rid of the DMA sync that
      was necessary to update the scratch pointer.
      Reviewed-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      38c0f334
    • J
      iwlwifi: rename IWL_MAX_CMD_TFDS to IWL_MAX_CMD_TBS_PER_TFD · 1afbfb60
      Johannes Berg 提交于
      The IWL_MAX_CMD_TFDS name for this constant is wrong, the
      constant really indicates how many TBs we can use in the
      driver for a single command TFD, rename the constant and
      also add a comment explaining it.
      Reviewed-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      1afbfb60
    • J
      iwlwifi: don't map complete commands bidirectionally · 98891754
      Johannes Berg 提交于
      The reason we mapped them bidirectionally was that not doing
      so had caused IOMMU exceptions, due to the fact that the HW
      writes back into the command. Now that the first part of the
      command including the write-back part is always in the first
      buffer, we don't need to map the remaining buffer(s) bidi
      and can get rid of the special-casing for commands.
      
      This is a requisite patch for another one to fix DMA mapping.
      Reviewed-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      98891754
  3. 27 2月, 2013 1 次提交
    • J
      iwlwifi: always copy first 16 bytes of commands · 8a964f44
      Johannes Berg 提交于
      The FH hardware will always write back to the scratch field
      in commands, even host commands not just TX commands, which
      can overwrite parts of the command. This is problematic if
      the command is re-used (with IWL_HCMD_DFL_NOCOPY) and can
      cause calibration issues.
      
      Address this problem by always putting at least the first
      16 bytes into the buffer we also use for the command header
      and therefore make the DMA engine write back into this.
      
      For commands that are smaller than 16 bytes also always map
      enough memory for the DMA engine to write back to.
      
      Cc: stable@vger.kernel.org
      Reviewed-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      8a964f44
  4. 05 2月, 2013 1 次提交
    • J
      iwlwifi: use threaded interrupt handler · 2bfb5092
      Johannes Berg 提交于
      With new transports coming up, move to threaded
      interrupt handling now. This has the advantage
      that we can use the same locking scheme with all
      different transports we may need to implement.
      
      Note that the TX path obviously still runs in a
      tasklet, so some spin_lock() calls need to change
      to spin_lock_bh() calls to properly lock out the
      TX path.
      
      In my test on a Calpella platform this has no
      impact on throughput or latency.
      
      Also add lockdep annotations to avoid lockups due
      to catch sending synchronous commands or using
      locks that connect with them from the irq thread.
      Reviewed-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      2bfb5092
  5. 01 2月, 2013 2 次提交
  6. 31 1月, 2013 1 次提交
  7. 24 1月, 2013 2 次提交
  8. 16 1月, 2013 6 次提交
  9. 03 1月, 2013 8 次提交
  10. 11 12月, 2012 1 次提交
    • E
      iwlwifi: don't handle masked interrupt · 25a17265
      Emmanuel Grumbach 提交于
      This can lead to a panic if the driver isn't ready to
      handle them. Since our interrupt line is shared, we can get
      an interrupt at any time (and CONFIG_DEBUG_SHIRQ checks
      that even when the interrupt is being freed).
      
      If the op_mode has gone away, we musn't call it. To avoid
      this the transport disables the interrupts when the hw is
      stopped and the op_mode is leaving.
      If there is an event that would cause an interrupt the INTA
      register is updated regardless of the enablement of the
      interrupts: even if the interrupts are disabled, the INTA
      will be changed, but the device won't issue an interrupt.
      But the ISR can be called at any time, so we ought ignore
      the value in the INTA otherwise we can call the op_mode
      after it was freed.
      
      I found this bug when the op_mode_start failed, and called
      iwl_trans_stop_hw(trans, true). Then I played with the
      RFKILL button, and removed the module.
      While removing the module, the IRQ is freed, and the ISR is
      called (CONFIG_DEBUG_SHIRQ enabled). Panic.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Reviewed-by: NGregory Greenman <gregory.greenman@intel.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      25a17265
  11. 08 12月, 2012 2 次提交
  12. 07 12月, 2012 4 次提交
  13. 29 11月, 2012 1 次提交
  14. 28 11月, 2012 1 次提交
  15. 19 11月, 2012 6 次提交