iwlwifi: work around bogus active chains detection

The current algorithm will sometimes "detect" that
more chains are enabled than are really present in
the device because, for unknown reasons, the ucode
sends up all-zeroes signal values.

The simplest way of solving this is to restrict the
active chains mask to the chains we know are really
present on the device.

This fixes a bug with some devices where, since sometimes
more chains are enabled than really present, the system would hang.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>

authored by Johannes Berg and committed by Reinette Chatre 8b9fce77 ece6444c

+12
+12
drivers/net/wireless/iwlwifi/iwl-calib.c
··· 807 807 } 808 808 } 809 809 810 + /* 811 + * The above algorithm sometimes fails when the ucode 812 + * reports 0 for all chains. It's not clear why that 813 + * happens to start with, but it is then causing trouble 814 + * because this can make us enable more chains than the 815 + * hardware really has. 816 + * 817 + * To be safe, simply mask out any chains that we know 818 + * are not on the device. 819 + */ 820 + active_chains &= priv->hw_params.valid_rx_ant; 821 + 810 822 num_tx_chains = 0; 811 823 for (i = 0; i < NUM_RX_CHAINS; i++) { 812 824 /* loops on all the bits of