* [PATCH] ath10k: Fix return value for btcoex and peer stats debugfs
@ 2016-04-05 15:28 Mohammed Shafi Shajakhan
2016-04-05 17:28 ` Joe Perches
2016-04-19 15:46 ` Valo, Kalle
0 siblings, 2 replies; 5+ messages in thread
From: Mohammed Shafi Shajakhan @ 2016-04-05 15:28 UTC (permalink / raw)
To: ath10k
Cc: Kalle Valo, kvalo, mohammed, linux-wireless,
Mohammed Shafi Shajakhan
From: Mohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
Return value is incorrect for btcoex and peer stats debugfs
'write' entries if the user provides a value that matches with
the already available debugfs entry, this results in the debugfs
entry getting stuck and the operation has to be terminated manually.
Fix this by returning the appropriate return 'count' as we do it for
other debugfs entries like pktlog etc
Fixes: cc61a1bbbc0e ("ath10k: enable debugfs provision to enable
Peer Stats feature")
Fixes: c28e6f06ff40 ("ath10k: fix sanity check on enabling btcoex via
debugfs")
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/debug.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c
index 76bbe17..e7d441c 100644
--- a/drivers/net/wireless/ath/ath10k/debug.c
+++ b/drivers/net/wireless/ath/ath10k/debug.c
@@ -2122,7 +2122,7 @@ static ssize_t ath10k_write_btcoex(struct file *file,
struct ath10k *ar = file->private_data;
char buf[32];
size_t buf_size;
- int ret = 0;
+ int ret;
bool val;
buf_size = min(count, (sizeof(buf) - 1));
@@ -2142,8 +2142,10 @@ static ssize_t ath10k_write_btcoex(struct file *file,
goto exit;
}
- if (!(test_bit(ATH10K_FLAG_BTCOEX, &ar->dev_flags) ^ val))
+ if (!(test_bit(ATH10K_FLAG_BTCOEX, &ar->dev_flags) ^ val)) {
+ ret = count;
goto exit;
+ }
if (val)
set_bit(ATH10K_FLAG_BTCOEX, &ar->dev_flags);
@@ -2189,7 +2191,7 @@ static ssize_t ath10k_write_peer_stats(struct file *file,
struct ath10k *ar = file->private_data;
char buf[32];
size_t buf_size;
- int ret = 0;
+ int ret;
bool val;
buf_size = min(count, (sizeof(buf) - 1));
@@ -2209,8 +2211,10 @@ static ssize_t ath10k_write_peer_stats(struct file *file,
goto exit;
}
- if (!(test_bit(ATH10K_FLAG_PEER_STATS, &ar->dev_flags) ^ val))
+ if (!(test_bit(ATH10K_FLAG_PEER_STATS, &ar->dev_flags) ^ val)) {
+ ret = count;
goto exit;
+ }
if (val)
set_bit(ATH10K_FLAG_PEER_STATS, &ar->dev_flags);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] ath10k: Fix return value for btcoex and peer stats debugfs
2016-04-05 15:28 [PATCH] ath10k: Fix return value for btcoex and peer stats debugfs Mohammed Shafi Shajakhan
@ 2016-04-05 17:28 ` Joe Perches
2016-04-06 10:11 ` Mohammed Shafi Shajakhan
2016-04-19 15:46 ` Valo, Kalle
1 sibling, 1 reply; 5+ messages in thread
From: Joe Perches @ 2016-04-05 17:28 UTC (permalink / raw)
To: Mohammed Shafi Shajakhan, ath10k, Yanbo Li
Cc: Kalle Valo, kvalo, mohammed, linux-wireless
On Tue, 2016-04-05 at 20:58 +0530, Mohammed Shafi Shajakhan wrote:
> From: Mohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
>
> Return value is incorrect for btcoex and peer stats debugfs
> 'write' entries if the user provides a value that matches with
> the already available debugfs entry, this results in the debugfs
> entry getting stuck and the operation has to be terminated manually.
> Fix this by returning the appropriate return 'count' as we do it for
> other debugfs entries like pktlog etc
Not your code, but some of the xor uses are odd at best.
> diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c
[]
> @@ -2122,7 +2122,7 @@ static ssize_t ath10k_write_btcoex(struct file *file,
> struct ath10k *ar = file->private_data;
> char buf[32];
> size_t buf_size;
> - int ret = 0;
> + int ret;
> bool val;
>
> buf_size = min(count, (sizeof(buf) - 1));
> @@ -2142,8 +2142,10 @@ static ssize_t ath10k_write_btcoex(struct file *file,
> goto exit;
> }
>
> - if (!(test_bit(ATH10K_FLAG_BTCOEX, &ar->dev_flags) ^ val))
> + if (!(test_bit(ATH10K_FLAG_BTCOEX, &ar->dev_flags) ^ val)) {
xor on an int and a bool.
> @@ -2189,7 +2191,7 @@ static ssize_t ath10k_write_peer_stats(struct file *file,
> struct ath10k *ar = file->private_data;
> char buf[32];
> size_t buf_size;
> - int ret = 0;
> + int ret;
> bool val;
>
> buf_size = min(count, (sizeof(buf) - 1));
> @@ -2209,8 +2211,10 @@ static ssize_t ath10k_write_peer_stats(struct file *file,
> goto exit;
> }
>
> - if (!(test_bit(ATH10K_FLAG_PEER_STATS, &ar->dev_flags) ^ val))
> + if (!(test_bit(ATH10K_FLAG_PEER_STATS, &ar->dev_flags) ^ val)) {
here too
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ath10k: Fix return value for btcoex and peer stats debugfs
2016-04-05 17:28 ` Joe Perches
@ 2016-04-06 10:11 ` Mohammed Shafi Shajakhan
0 siblings, 0 replies; 5+ messages in thread
From: Mohammed Shafi Shajakhan @ 2016-04-06 10:11 UTC (permalink / raw)
To: Joe Perches
Cc: Mohammed Shafi Shajakhan, ath10k, Yanbo Li, Kalle Valo, kvalo,
linux-wireless
Hello Joe,
On Tue, Apr 05, 2016 at 10:28:56AM -0700, Joe Perches wrote:
> On Tue, 2016-04-05 at 20:58 +0530, Mohammed Shafi Shajakhan wrote:
> > From: Mohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
> >
> > Return value is incorrect for btcoex and peer stats debugfs
> > 'write' entries if the user provides a value that matches with
> > the already available debugfs entry, this results in the debugfs
> > entry getting stuck and the operation has to be terminated manually.
> > Fix this by returning the appropriate return 'count' as we do it for
> > other debugfs entries like pktlog etc
>
> Not your code, but some of the xor uses are odd at best.
[shafi] ok.
>
> > diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c
> []
> > @@ -2122,7 +2122,7 @@ static ssize_t ath10k_write_btcoex(struct file *file,
> > struct ath10k *ar = file->private_data;
> > char buf[32];
> > size_t buf_size;
> > - int ret = 0;
> > + int ret;
> > bool val;
> >
> > buf_size = min(count, (sizeof(buf) - 1));
> > @@ -2142,8 +2142,10 @@ static ssize_t ath10k_write_btcoex(struct file *file,
> > goto exit;
> > }
> >
> > - if (!(test_bit(ATH10K_FLAG_BTCOEX, &ar->dev_flags) ^ val))
> > + if (!(test_bit(ATH10K_FLAG_BTCOEX, &ar->dev_flags) ^ val)) {
>
> xor on an int and a bool.
[shafi] Should we change the 'val' to int, but this code seems to be working
test_bit seems to do this :
return 1UL & (addr[BIT_WORD(nr)] >> (nr & (BITS_PER_LONG-1)));
do we see a problem, it should work right (because they are bitwise
'ANDING' with 1UL)
>
> > @@ -2189,7 +2191,7 @@ static ssize_t ath10k_write_peer_stats(struct file *file,
> > struct ath10k *ar = file->private_data;
> > char buf[32];
> > size_t buf_size;
> > - int ret = 0;
> > + int ret;
> > bool val;
> >
> > buf_size = min(count, (sizeof(buf) - 1));
> > @@ -2209,8 +2211,10 @@ static ssize_t ath10k_write_peer_stats(struct file *file,
> > goto exit;
> > }
> >
> > - if (!(test_bit(ATH10K_FLAG_PEER_STATS, &ar->dev_flags) ^ val))
> > + if (!(test_bit(ATH10K_FLAG_PEER_STATS, &ar->dev_flags) ^ val)) {
>
> here too
[shafi] same thing here ? is there a better code , kindly suggest
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ath10k: Fix return value for btcoex and peer stats debugfs
2016-04-05 15:28 [PATCH] ath10k: Fix return value for btcoex and peer stats debugfs Mohammed Shafi Shajakhan
2016-04-05 17:28 ` Joe Perches
@ 2016-04-19 15:46 ` Valo, Kalle
2016-04-19 15:57 ` Shajakhan, Mohammed Shafi (Mohammed Shafi)
1 sibling, 1 reply; 5+ messages in thread
From: Valo, Kalle @ 2016-04-19 15:46 UTC (permalink / raw)
To: Shajakhan, Mohammed Shafi (Mohammed Shafi)
Cc: ath10k@lists.infradead.org, mohammed@codeaurora.org,
linux-wireless@vger.kernel.org
Mohammed Shafi Shajakhan <mohammed@qti.qualcomm.com> writes:
> From: Mohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
>
> Return value is incorrect for btcoex and peer stats debugfs
> 'write' entries if the user provides a value that matches with
> the already available debugfs entry, this results in the debugfs
> entry getting stuck and the operation has to be terminated manually.
> Fix this by returning the appropriate return 'count' as we do it for
> other debugfs entries like pktlog etc
>
> Fixes: cc61a1bbbc0e ("ath10k: enable debugfs provision to enable
> Peer Stats feature")
> Fixes: c28e6f06ff40 ("ath10k: fix sanity check on enabling btcoex via
> debugfs")
> Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
Applied, thanks.
I removed the line wrapping from "Fixes:" lines.
--
Kalle Valo
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] ath10k: Fix return value for btcoex and peer stats debugfs
2016-04-19 15:46 ` Valo, Kalle
@ 2016-04-19 15:57 ` Shajakhan, Mohammed Shafi (Mohammed Shafi)
0 siblings, 0 replies; 5+ messages in thread
From: Shajakhan, Mohammed Shafi (Mohammed Shafi) @ 2016-04-19 15:57 UTC (permalink / raw)
To: Valo, Kalle
Cc: ath10k@lists.infradead.org, mohammed@codeaurora.org,
linux-wireless@vger.kernel.org
Applied, thanks.
I removed the line wrapping from "Fixes:" lines.
[shafi] thank you Kalle.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-04-19 15:57 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-05 15:28 [PATCH] ath10k: Fix return value for btcoex and peer stats debugfs Mohammed Shafi Shajakhan
2016-04-05 17:28 ` Joe Perches
2016-04-06 10:11 ` Mohammed Shafi Shajakhan
2016-04-19 15:46 ` Valo, Kalle
2016-04-19 15:57 ` Shajakhan, Mohammed Shafi (Mohammed Shafi)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).