[v3] ath10k: cache calibration data when the core is stopped

Kalle Valo kvalo at qca.qualcomm.com
Tue Oct 11 22:05:00 PDT 2016


Kalle Valo <kvalo at qca.qualcomm.com> wrote:
> From: Marty Faltesek <mfaltesek at google.com>
> 
> Commit 0b8e3c4ca29f ("ath10k: move cal data len to hw_params") broke retrieving
> the calibration data from cal_data debugfs file. The length of file was always
> zero. The reason is:
> 
>     static ssize_t ath10k_debug_cal_data_read(struct file *file,
>                                           char __user *user_buf,
>                                           size_t count, loff_t *ppos)
>     {
>         struct ath10k *ar = file->private_data;
>         void *buf = file->private_data;
> 
> 
> This is obviously bogus, private_data cannot contain both struct ath10k and the
> buffer. Fix it by caching calibration data to ar->debug.cal_data. This also
> allows it to be accessed when the device is not active (interface is down).
> 
> The cal_data buffer is fixed size because during the first firmware probe we
> don't yet know what will be the lenght of the calibration data. It was simplest
> just to use a fixed length. There's a WARN_ON() in
> ath10k_debug_cal_data_fetch() if the buffer is too small.
> 
> Tested with qca988x and firmware 10.2.4.70.56.
> 
> Reported-by: Nikolay Martynov <mar.kolya at gmail.com>
> Fixes: 0b8e3c4ca29f ("ath10k: move cal data len to hw_params")
> Cc: stable at vger.kernel.org # 4.7+
> Signed-off-by: Marty Faltesek <mfaltesek at google.com>
> [kvalo at qca.qualcomm.com: improve commit log and minor other changes]
> Signed-off-by: Kalle Valo <kvalo at qca.qualcomm.com>

There were few checkpatch warnings, I fixed those in the pending branch.

drivers/net/wireless/ath/ath10k/debug.c:1472: code indent should use tabs where possible
drivers/net/wireless/ath/ath10k/debug.c:1504: code indent should use tabs where possible
drivers/net/wireless/ath/ath10k/debug.c:1504: please, no spaces at the start of a line
drivers/net/wireless/ath/ath10k/debug.c:1505: code indent should use tabs where possible
drivers/net/wireless/ath/ath10k/debug.c:1505: please, no spaces at the start of a line

-- 
https://patchwork.kernel.org/patch/9369685/

Documentation about submitting wireless patches and checking status
from patchwork:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches




More information about the ath10k mailing list