Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 50913e32 authored by Kalle Valo's avatar Kalle Valo
Browse files
ath.git patches for 4.11. Major changes:

ath9k

* cleanup eeprom endian handling
* add airtime fairness scheduling

ath10k

* fix issues for new QCA9377 firmware version
* support dev_coredump() for firmware crash dump
* enable channel 169 on 5 GHz band
parents ad334bbb 34c30b0a
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -694,8 +694,11 @@ static int ath10k_core_get_board_id_from_otp(struct ath10k *ar)
		   "boot get otp board id result 0x%08x board_id %d chip_id %d\n",
		   result, board_id, chip_id);

	if ((result & ATH10K_BMI_BOARD_ID_STATUS_MASK) != 0)
	if ((result & ATH10K_BMI_BOARD_ID_STATUS_MASK) != 0 ||
	    (board_id == 0)) {
		ath10k_warn(ar, "board id is not exist in otp, ignore it\n");
		return -EOPNOTSUPP;
	}

	ar->id.bmi_ids_valid = true;
	ar->id.bmi_board_id = board_id;
@@ -1510,6 +1513,7 @@ static int ath10k_init_hw_params(struct ath10k *ar)
static void ath10k_core_restart(struct work_struct *work)
{
	struct ath10k *ar = container_of(work, struct ath10k, restart_work);
	int ret;

	set_bit(ATH10K_FLAG_CRASH_FLUSH, &ar->dev_flags);

@@ -1561,6 +1565,11 @@ static void ath10k_core_restart(struct work_struct *work)
	}

	mutex_unlock(&ar->conf_mutex);

	ret = ath10k_debug_fw_devcoredump(ar);
	if (ret)
		ath10k_warn(ar, "failed to send firmware crash dump via devcoredump: %d",
			    ret);
}

static void ath10k_core_set_coverage_class_work(struct work_struct *work)
+1 −1
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@
#define WMI_READY_TIMEOUT (5 * HZ)
#define ATH10K_FLUSH_TIMEOUT_HZ (5 * HZ)
#define ATH10K_CONNECTION_LOSS_HZ (3 * HZ)
#define ATH10K_NUM_CHANS 39
#define ATH10K_NUM_CHANS 40

/* Antenna noise floor */
#define ATH10K_DEFAULT_NOISE_FLOOR -95
+40 −3
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
#include <linux/utsname.h>
#include <linux/crc32.h>
#include <linux/firmware.h>
#include <linux/devcoredump.h>

#include "core.h"
#include "debug.h"
@@ -721,7 +722,8 @@ ath10k_debug_get_new_fw_crash_data(struct ath10k *ar)
}
EXPORT_SYMBOL(ath10k_debug_get_new_fw_crash_data);

static struct ath10k_dump_file_data *ath10k_build_dump_file(struct ath10k *ar)
static struct ath10k_dump_file_data *ath10k_build_dump_file(struct ath10k *ar,
							    bool mark_read)
{
	struct ath10k_fw_crash_data *crash_data = ar->debug.fw_crash_data;
	struct ath10k_dump_file_data *dump_data;
@@ -790,19 +792,54 @@ static struct ath10k_dump_file_data *ath10k_build_dump_file(struct ath10k *ar)
	       sizeof(crash_data->registers));
	sofar += sizeof(*dump_tlv) + sizeof(crash_data->registers);

	ar->debug.fw_crash_data->crashed_since_read = false;
	ar->debug.fw_crash_data->crashed_since_read = !mark_read;

	spin_unlock_bh(&ar->data_lock);

	return dump_data;
}

int ath10k_debug_fw_devcoredump(struct ath10k *ar)
{
	struct ath10k_dump_file_data *dump;
	void *dump_ptr;
	u32 dump_len;

	/* To keep the dump file available also for debugfs don't mark the
	 * file read, only debugfs should do that.
	 */
	dump = ath10k_build_dump_file(ar, false);
	if (!dump) {
		ath10k_warn(ar, "no crash dump data found for devcoredump");
		return -ENODATA;
	}

	/* Make a copy of the dump file for dev_coredumpv() as during the
	 * transition period we need to own the original file. Once
	 * fw_crash_dump debugfs file is removed no need to have a copy
	 * anymore.
	 */
	dump_len = le32_to_cpu(dump->len);
	dump_ptr = vzalloc(dump_len);

	if (!dump_ptr)
		return -ENOMEM;

	memcpy(dump_ptr, dump, dump_len);

	dev_coredumpv(ar->dev, dump_ptr, dump_len, GFP_KERNEL);

	return 0;
}

static int ath10k_fw_crash_dump_open(struct inode *inode, struct file *file)
{
	struct ath10k *ar = inode->i_private;
	struct ath10k_dump_file_data *dump;

	dump = ath10k_build_dump_file(ar);
	ath10k_warn(ar, "fw_crash_dump debugfs file is deprecated, please use /sys/class/devcoredump instead.");

	dump = ath10k_build_dump_file(ar, true);
	if (!dump)
		return -ENODATA;

+8 −0
Original line number Diff line number Diff line
@@ -84,6 +84,9 @@ struct ath10k_fw_crash_data *
ath10k_debug_get_new_fw_crash_data(struct ath10k *ar);

void ath10k_debug_dbglog_add(struct ath10k *ar, u8 *buffer, int len);

int ath10k_debug_fw_devcoredump(struct ath10k *ar);

#define ATH10K_DFS_STAT_INC(ar, c) (ar->debug.dfs_stats.c++)

void ath10k_debug_get_et_strings(struct ieee80211_hw *hw,
@@ -166,6 +169,11 @@ static inline u32 ath10k_debug_get_fw_dbglog_level(struct ath10k *ar)
	return 0;
}

static inline int ath10k_debug_fw_devcoredump(struct ath10k *ar)
{
	return 0;
}

#define ATH10K_DFS_STAT_INC(ar, c) do { } while (0)

#define ath10k_debug_get_et_strings NULL
+2 −0
Original line number Diff line number Diff line
@@ -239,6 +239,7 @@ static void ath10k_htt_tx_free_cont_txbuf(struct ath10k_htt *htt)

	size = htt->max_num_pending_tx * sizeof(struct ath10k_htt_txbuf);
	dma_free_coherent(ar->dev, size, htt->txbuf.vaddr, htt->txbuf.paddr);
	htt->txbuf.vaddr = NULL;
}

static int ath10k_htt_tx_alloc_cont_txbuf(struct ath10k_htt *htt)
@@ -268,6 +269,7 @@ static void ath10k_htt_tx_free_cont_frag_desc(struct ath10k_htt *htt)
			  size,
			  htt->frag_desc.vaddr,
			  htt->frag_desc.paddr);
	htt->frag_desc.vaddr = NULL;
}

static int ath10k_htt_tx_alloc_cont_frag_desc(struct ath10k_htt *htt)
Loading