[iwm] Fix iwm_poll_bit() usage in iwm_stop_device(), fixup r303418.

* iwm_poll_bit() returns 1 on success and 0 on failure, whereas
  iwl_poll_bit() in Linux's iwlwifi returns >= 0 on success and < 0 on
  failure.

* Because of the wrong iwm_poll_bit return code check, no warning was
  printed if tx DMA stopping failed.

Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D7371
This commit is contained in:
Imre Vadász 2016-07-30 19:03:32 +00:00
parent aafbb33897
commit a3c0e7f2fb

View file

@ -1310,8 +1310,8 @@ iwm_stop_device(struct iwm_softc *sc)
}
/* Wait for DMA channels to be idle */
if (iwm_poll_bit(sc, IWM_FH_TSSR_TX_STATUS_REG, mask, mask,
5000) < 0) {
if (!iwm_poll_bit(sc, IWM_FH_TSSR_TX_STATUS_REG, mask, mask,
5000)) {
device_printf(sc->sc_dev,
"Failing on timeout while stopping DMA channel: [0x%08x]\n",
IWM_READ(sc, IWM_FH_TSSR_TX_STATUS_REG));