diff options
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm/fw-dbg.c')
| -rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/fw-dbg.c | 74 | 
1 files changed, 25 insertions, 49 deletions
| diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw-dbg.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw-dbg.c index 7b86a4f1b574..1602b360353c 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/fw-dbg.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw-dbg.c @@ -319,10 +319,8 @@ static void iwl_mvm_dump_fifos(struct iwl_mvm *mvm,  void iwl_mvm_free_fw_dump_desc(struct iwl_mvm *mvm)  { -	if (mvm->fw_dump_desc == &iwl_mvm_dump_desc_assert) -		return; - -	kfree(mvm->fw_dump_desc); +	if (mvm->fw_dump_desc != &iwl_mvm_dump_desc_assert) +		kfree(mvm->fw_dump_desc);  	mvm->fw_dump_desc = NULL;  } @@ -640,18 +638,21 @@ void iwl_mvm_fw_error_dump(struct iwl_mvm *mvm)  		}  		/* Make room for PRPH registers */ -		for (i = 0; i < ARRAY_SIZE(iwl_prph_dump_addr_comm); i++) { -			/* The range includes both boundaries */ -			int num_bytes_in_chunk = -				iwl_prph_dump_addr_comm[i].end - -				iwl_prph_dump_addr_comm[i].start + 4; - -			prph_len += sizeof(*dump_data) + -				sizeof(struct iwl_fw_error_dump_prph) + -				num_bytes_in_chunk; +		if (!mvm->trans->cfg->gen2) { +			for (i = 0; i < ARRAY_SIZE(iwl_prph_dump_addr_comm); +			     i++) { +				/* The range includes both boundaries */ +				int num_bytes_in_chunk = +					iwl_prph_dump_addr_comm[i].end - +					iwl_prph_dump_addr_comm[i].start + 4; + +				prph_len += sizeof(*dump_data) + +					sizeof(struct iwl_fw_error_dump_prph) + +					num_bytes_in_chunk; +			}  		} -		if (mvm->cfg->mq_rx_supported) { +		if (!mvm->trans->cfg->gen2 && mvm->cfg->mq_rx_supported) {  			for (i = 0; i <  				ARRAY_SIZE(iwl_prph_dump_addr_9000); i++) {  				/* The range includes both boundaries */ @@ -691,7 +692,8 @@ void iwl_mvm_fw_error_dump(struct iwl_mvm *mvm)  	}  	/* Make room for fw's virtual image pages, if it exists */ -	if (mvm->fw->img[mvm->cur_ucode].paging_mem_size && +	if (!mvm->trans->cfg->gen2 && +	    mvm->fw->img[mvm->cur_ucode].paging_mem_size &&  	    mvm->fw_paging_db[0].fw_paging_block)  		file_len += mvm->num_of_paging_blk *  			(sizeof(*dump_data) + @@ -704,14 +706,6 @@ void iwl_mvm_fw_error_dump(struct iwl_mvm *mvm)  			   sizeof(*dump_info);  	} -	/* -	 * In 8000 HW family B-step include the ICCM (which resides separately) -	 */ -	if (mvm->cfg->device_family == IWL_DEVICE_FAMILY_8000 && -	    CSR_HW_REV_STEP(mvm->trans->hw_rev) == SILICON_B_STEP) -		file_len += sizeof(*dump_data) + sizeof(*dump_mem) + -			    IWL8260_ICCM_LEN; -  	if (mvm->fw_dump_desc)  		file_len += sizeof(*dump_data) + sizeof(*dump_trig) +  			    mvm->fw_dump_desc->len; @@ -836,21 +830,9 @@ void iwl_mvm_fw_error_dump(struct iwl_mvm *mvm)  		dump_data = iwl_fw_error_next_data(dump_data);  	} -	if (mvm->cfg->device_family == IWL_DEVICE_FAMILY_8000 && -	    CSR_HW_REV_STEP(mvm->trans->hw_rev) == SILICON_B_STEP) { -		dump_data->type = cpu_to_le32(IWL_FW_ERROR_DUMP_MEM); -		dump_data->len = cpu_to_le32(IWL8260_ICCM_LEN + -					     sizeof(*dump_mem)); -		dump_mem = (void *)dump_data->data; -		dump_mem->type = cpu_to_le32(IWL_FW_ERROR_DUMP_MEM_SRAM); -		dump_mem->offset = cpu_to_le32(IWL8260_ICCM_OFFSET); -		iwl_trans_read_mem_bytes(mvm->trans, IWL8260_ICCM_OFFSET, -					 dump_mem->data, IWL8260_ICCM_LEN); -		dump_data = iwl_fw_error_next_data(dump_data); -	} -  	/* Dump fw's virtual image */ -	if (mvm->fw->img[mvm->cur_ucode].paging_mem_size && +	if (!mvm->trans->cfg->gen2 && +	    mvm->fw->img[mvm->cur_ucode].paging_mem_size &&  	    mvm->fw_paging_db[0].fw_paging_block) {  		for (i = 1; i < mvm->num_of_paging_blk + 1; i++) {  			struct iwl_fw_error_dump_paging *paging; @@ -931,6 +913,10 @@ int iwl_mvm_fw_dbg_collect_desc(struct iwl_mvm *mvm,  	if (trigger)  		delay = msecs_to_jiffies(le32_to_cpu(trigger->stop_delay)); +	if (WARN(mvm->trans->state == IWL_TRANS_NO_FW, +		 "Can't collect dbg data when FW isn't alive\n")) +		return -EIO; +  	if (test_and_set_bit(IWL_MVM_STATUS_DUMPING_FW_LOG, &mvm->status))  		return -EBUSY; @@ -943,7 +929,7 @@ int iwl_mvm_fw_dbg_collect_desc(struct iwl_mvm *mvm,  	mvm->fw_dump_desc = desc;  	mvm->fw_dump_trig = trigger; -	queue_delayed_work(system_wq, &mvm->fw_dump_wk, delay); +	schedule_delayed_work(&mvm->fw_dump_wk, delay);  	return 0;  } @@ -1002,14 +988,6 @@ int iwl_mvm_fw_dbg_collect_trig(struct iwl_mvm *mvm,  	return 0;  } -static inline void iwl_mvm_restart_early_start(struct iwl_mvm *mvm) -{ -	if (mvm->cfg->device_family == IWL_DEVICE_FAMILY_7000) -		iwl_clear_bits_prph(mvm->trans, MON_BUFF_SAMPLE_CTL, 0x100); -	else -		iwl_write_prph(mvm->trans, DBGC_IN_SAMPLE, 1); -} -  int iwl_mvm_start_fw_dbg_conf(struct iwl_mvm *mvm, u8 conf_id)  {  	u8 *ptr; @@ -1023,10 +1001,8 @@ int iwl_mvm_start_fw_dbg_conf(struct iwl_mvm *mvm, u8 conf_id)  	/* EARLY START - firmware's configuration is hard coded */  	if ((!mvm->fw->dbg_conf_tlv[conf_id] ||  	     !mvm->fw->dbg_conf_tlv[conf_id]->num_of_hcmds) && -	    conf_id == FW_DBG_START_FROM_ALIVE) { -		iwl_mvm_restart_early_start(mvm); +	    conf_id == FW_DBG_START_FROM_ALIVE)  		return 0; -	}  	if (!mvm->fw->dbg_conf_tlv[conf_id])  		return -EINVAL; | 
