2016-05-30 18:34:15

by Sudip Mukherjee

[permalink] [raw]
Subject: Re: linux-next: Tree for May 30

On Monday 30 May 2016 08:52 AM, Stephen Rothwell wrote:
> Hi all,
>
> Changes since 20160527:

Hi All,
I have just built and booted with next-20160530 and my dmesg is full of
warnings from ath9k. Last kernel tested was v4.6 and there was no
problem with that.

The traces are like:
Call Trace:
[<ffffffff813b8ddc>] dump_stack+0x63/0x87
[<ffffffff8107a331>] __warn+0xd1/0xf0
[<ffffffff8107a41d>] warn_slowpath_null+0x1d/0x20
[<ffffffffc095801f>] ath9k_hw_gpio_request+0x6f/0x320 [ath9k_hw]
[<ffffffffc095ac24>] ath9k_hw_reset+0xfe4/0x12e0 [ath9k_hw]
[<ffffffffc03d45d4>] ath_reset_internal+0x104/0x1f0 [ath9k]
[<ffffffffc03d46fd>] ath_reset+0x3d/0x60 [ath9k]
[<ffffffffc03dd1c6>] ath_chanctx_set_channel+0x1b6/0x300 [ath9k]
[<ffffffffc03d36b6>] ath9k_config+0xc6/0x1f0 [ath9k]
[<ffffffff817d6e92>] ? mutex_lock+0x12/0x2f
[<ffffffffc05a7923>] ieee80211_hw_config+0x63/0x350 [mac80211]
[<ffffffffc05b3041>] ieee80211_scan_work+0x161/0x480 [mac80211]
[<ffffffff81093183>] process_one_work+0x153/0x3f0
[<ffffffff8109393b>] worker_thread+0x12b/0x4b0
[<ffffffff81093810>] ? rescuer_thread+0x340/0x340
[<ffffffff81099129>] kthread+0xc9/0xe0
[<ffffffff817d8f1f>] ret_from_fork+0x1f/0x40
[<ffffffff81099060>] ? kthread_park+0x60/0x60
---[ end trace 27eb5094a52869ea ]---

Call Trace:
[<ffffffff813b8ddc>] dump_stack+0x63/0x87
[<ffffffff8107a331>] __warn+0xd1/0xf0
[<ffffffff8107a41d>] warn_slowpath_null+0x1d/0x20
[<ffffffffc0956b19>] ath9k_hw_gpio_get+0x1a9/0x1b0 [ath9k_hw]
[<ffffffffc03d03e4>] ath9k_rfkill_poll_state+0x34/0x60 [ath9k]
[<ffffffffc05c4b53>] ieee80211_rfkill_poll+0x33/0x40 [mac80211]
[<ffffffffc049d65a>] cfg80211_rfkill_poll+0x2a/0xc0 [cfg80211]
[<ffffffff817c5514>] rfkill_poll+0x24/0x50
[<ffffffff81093183>] process_one_work+0x153/0x3f0
[<ffffffff8109393b>] worker_thread+0x12b/0x4b0
[<ffffffff81093810>] ? rescuer_thread+0x340/0x340
[<ffffffff81099129>] kthread+0xc9/0xe0
[<ffffffff817d8f1f>] ret_from_fork+0x1f/0x40
[<ffffffff81099060>] ? kthread_park+0x60/0x60
---[ end trace 27eb5094a5286a3d ]---


If it is a known problem then great.. else i can debug and see what the
problem is. There are only few patches added for GPIO, so should not be
a problem to find out what is causing the error.

Regards
Sudip



2016-05-31 07:31:16

by Kalle Valo

[permalink] [raw]
Subject: ath9k gpio request

(Changing subject to a more descriptive one, was "Re: linux-next: Tree
for May 30")

Sudip Mukherjee <[email protected]> writes:

> Hi All,
> I have just built and booted with next-20160530 and my dmesg is full
> of warnings from ath9k. Last kernel tested was v4.6 and there was no
> problem with that.
>
> The traces are like:
> Call Trace:
> [<ffffffff813b8ddc>] dump_stack+0x63/0x87
> [<ffffffff8107a331>] __warn+0xd1/0xf0
> [<ffffffff8107a41d>] warn_slowpath_null+0x1d/0x20
> [<ffffffffc095801f>] ath9k_hw_gpio_request+0x6f/0x320 [ath9k_hw]
> [<ffffffffc095ac24>] ath9k_hw_reset+0xfe4/0x12e0 [ath9k_hw]
> [<ffffffffc03d45d4>] ath_reset_internal+0x104/0x1f0 [ath9k]
> [<ffffffffc03d46fd>] ath_reset+0x3d/0x60 [ath9k]
> [<ffffffffc03dd1c6>] ath_chanctx_set_channel+0x1b6/0x300 [ath9k]
> [<ffffffffc03d36b6>] ath9k_config+0xc6/0x1f0 [ath9k]
> [<ffffffff817d6e92>] ? mutex_lock+0x12/0x2f
> [<ffffffffc05a7923>] ieee80211_hw_config+0x63/0x350 [mac80211]
> [<ffffffffc05b3041>] ieee80211_scan_work+0x161/0x480 [mac80211]
> [<ffffffff81093183>] process_one_work+0x153/0x3f0
> [<ffffffff8109393b>] worker_thread+0x12b/0x4b0
> [<ffffffff81093810>] ? rescuer_thread+0x340/0x340
> [<ffffffff81099129>] kthread+0xc9/0xe0
> [<ffffffff817d8f1f>] ret_from_fork+0x1f/0x40
> [<ffffffff81099060>] ? kthread_park+0x60/0x60
> ---[ end trace 27eb5094a52869ea ]---
>
> Call Trace:
> [<ffffffff813b8ddc>] dump_stack+0x63/0x87
> [<ffffffff8107a331>] __warn+0xd1/0xf0
> [<ffffffff8107a41d>] warn_slowpath_null+0x1d/0x20
> [<ffffffffc0956b19>] ath9k_hw_gpio_get+0x1a9/0x1b0 [ath9k_hw]
> [<ffffffffc03d03e4>] ath9k_rfkill_poll_state+0x34/0x60 [ath9k]
> [<ffffffffc05c4b53>] ieee80211_rfkill_poll+0x33/0x40 [mac80211]
> [<ffffffffc049d65a>] cfg80211_rfkill_poll+0x2a/0xc0 [cfg80211]
> [<ffffffff817c5514>] rfkill_poll+0x24/0x50
> [<ffffffff81093183>] process_one_work+0x153/0x3f0
> [<ffffffff8109393b>] worker_thread+0x12b/0x4b0
> [<ffffffff81093810>] ? rescuer_thread+0x340/0x340
> [<ffffffff81099129>] kthread+0xc9/0xe0
> [<ffffffff817d8f1f>] ret_from_fork+0x1f/0x40
> [<ffffffff81099060>] ? kthread_park+0x60/0x60
> ---[ end trace 27eb5094a5286a3d ]---

The traces look incomplete to me, is there anything more before the
"Call Trace:" line? Full unedited logs are usually the best.

> If it is a known problem then great.. else i can debug and see what
> the problem is. There are only few patches added for GPIO, so should
> not be a problem to find out what is causing the error.

I haven't seen this kind of report before. My first suspect is the
commit below so adding Miaoqing.

commit b2d70d4944c1789bc64376ad97a811f37e230c87
Author: Miaoqing Pan <[email protected]>
Date: Mon Mar 7 10:38:15 2016 +0800

ath9k: make GPIO API to support both of WMAC and SOC

commit 61b559dea40e ("ath9k: add extra GPIO led support")
added ath9k to support access SOC's GPIOs, but implemented
in a separated API: ath9k_hw_request_gpio().

So this patch make the APIs more common, to support both
of WMAC and SOC GPIOs. The new APIs as below,

void ath9k_hw_gpio_request_in();
void ath9k_hw_gpio_request_out();
void ath9k_hw_gpio_free();

NOTE, the BSP of the SOC chips(AR9340, AR9531, AR9550, AR9561)
should set the corresponding MUX registers correctly.

Signed-off-by: Miaoqing Pan <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>

--
Kalle Valo

2016-05-31 12:05:24

by Sudip Mukherjee

[permalink] [raw]
Subject: Re: ath9k gpio request

On Tuesday 31 May 2016 01:01 PM, Kalle Valo wrote:
> (Changing subject to a more descriptive one, was "Re: linux-next: Tree
> for May 30")
>
> Sudip Mukherjee <[email protected]> writes:
>
>> Hi All,
>> I have just built and booted with next-20160530 and my dmesg is full
>> of warnings from ath9k. Last kernel tested was v4.6 and there was no
>> problem with that.
>>

<snip>


> The traces look incomplete to me, is there anything more before the
> "Call Trace:" line? Full unedited logs are usually the best.

sure, its attached. those two warnings are recursively going on and
there is nothing else left in dmesg to see what started it.

Regards
Sudip


Attachments:
dmesg.txt (215.29 kB)

2016-06-01 06:54:08

by Pan, Miaoqing

[permalink] [raw]
Subject: Re: ath9k gpio request

which chip ? And what's the GPIO number ?

Thanks,
Miaoqing

________________________________________
From: Sudip Mukherjee <[email protected]>
Sent: Tuesday, May 31, 2016 3:35 PM
To: Kalle Valo
Cc: Stephen Rothwell; ath9k-devel; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Miaoqing Pan
Subject: Re: ath9k gpio request

On Tuesday 31 May 2016 01:01 PM, Kalle Valo wrote:
> (Changing subject to a more descriptive one, was "Re: linux-next: Tree
> for May 30")
>
> Sudip Mukherjee <[email protected]> writes:
>
>> Hi All,
>> I have just built and booted with next-20160530 and my dmesg is full
>> of warnings from ath9k. Last kernel tested was v4.6 and there was no
>> problem with that.
>>

<snip>


> The traces look incomplete to me, is there anything more before the
> "Call Trace:" line? Full unedited logs are usually the best.

sure, its attached. those two warnings are recursively going on and
there is nothing else left in dmesg to see what started it.

Regards
Sudip

2016-06-04 14:37:58

by Kalle Valo

[permalink] [raw]
Subject: Re: ath9k gpio request

(Fixing top posting)

"Pan, Miaoqing" <[email protected]> writes:

>>> --- a/drivers/net/wireless/ath/ath9k/reg.h
>>> +++ b/drivers/net/wireless/ath/ath9k/reg.h
>>> @@ -1122,8 +1122,8 @@ enum {
>>> #define AR9300_NUM_GPIO 16
>>> #define AR9330_NUM_GPIO 16
>>> #define AR9340_NUM_GPIO 23
>>> -#define AR9462_NUM_GPIO 10
>>> -#define AR9485_NUM_GPIO 12
>>> +#define AR9462_NUM_GPIO 14
>>> +#define AR9485_NUM_GPIO 11
>>> #define AR9531_NUM_GPIO 18
>>> #define AR9550_NUM_GPIO 24
>>> #define AR9561_NUM_GPIO 23
>>> @@ -1139,8 +1139,8 @@ enum {
>>> #define AR9300_GPIO_MASK 0x0000F4FF
>>> #define AR9330_GPIO_MASK 0x0000F4FF
>>> #define AR9340_GPIO_MASK 0x0000000F
>>> -#define AR9462_GPIO_MASK 0x000003FF
>>> -#define AR9485_GPIO_MASK 0x00000FFF
>>> +#define AR9462_GPIO_MASK 0x00003FFF
>>> +#define AR9485_GPIO_MASK 0x000007FF
>>> #define AR9531_GPIO_MASK 0x0000000F
>>> #define AR9550_GPIO_MASK 0x0000000F
>>> #define AR9561_GPIO_MASK 0x0000000F
>>
>> solves the problem.
>>
>> Tested-by: Sudip Mukherjee <[email protected]>
>
> Done, https://patchwork.kernel.org/patch/9151847/

But the patch 9151847 is different from what Sudip tested above? Why?

And if you modify something _after_ the reporter has tested the patch
clearly document what you changed and why. I do not want find hidden
changes like this, even more so when the patch is going to a 4.7-rc
release.

Sudip, could you also test patch 9151847, please? You can download the
patch from the patchwork link above.

--
Kalle Valo

2016-06-03 05:49:13

by Pan, Miaoqing

[permalink] [raw]
Subject: Re: ath9k gpio request

Done, https://patchwork.kernel.org/patch/9151847/.

Thanks,
Miaoqing
________________________________________
From: Kalle Valo <[email protected]>
Sent: Friday, June 3, 2016 1:33 PM
To: Pan, Miaoqing
Cc: Sudip Mukherjee; Stephen Rothwell; ath9k-devel; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Miaoqing Pan
Subject: Re: ath9k gpio request

Sudip Mukherjee <[email protected]> writes:

> On Thursday 02 June 2016 01:32 PM, Pan, Miaoqing wrote:
>> Seems there are something wrong in the datasheet, try
>>
>> --- a/drivers/net/wireless/ath/ath9k/reg.h
>> +++ b/drivers/net/wireless/ath/ath9k/reg.h
>> @@ -1122,8 +1122,8 @@ enum {
>> #define AR9300_NUM_GPIO 16
>> #define AR9330_NUM_GPIO 16
>> #define AR9340_NUM_GPIO 23
>> -#define AR9462_NUM_GPIO 10
>> -#define AR9485_NUM_GPIO 12
>> +#define AR9462_NUM_GPIO 14
>> +#define AR9485_NUM_GPIO 11
>> #define AR9531_NUM_GPIO 18
>> #define AR9550_NUM_GPIO 24
>> #define AR9561_NUM_GPIO 23
>> @@ -1139,8 +1139,8 @@ enum {
>> #define AR9300_GPIO_MASK 0x0000F4FF
>> #define AR9330_GPIO_MASK 0x0000F4FF
>> #define AR9340_GPIO_MASK 0x0000000F
>> -#define AR9462_GPIO_MASK 0x000003FF
>> -#define AR9485_GPIO_MASK 0x00000FFF
>> +#define AR9462_GPIO_MASK 0x00003FFF
>> +#define AR9485_GPIO_MASK 0x000007FF
>> #define AR9531_GPIO_MASK 0x0000000F
>> #define AR9550_GPIO_MASK 0x0000000F
>> #define AR9561_GPIO_MASK 0x0000000F
>
> solves the problem.
>
> Tested-by: Sudip Mukherjee <[email protected]>

Great, thanks for testing everyone. Miaoqing, please send a proper patch
ASAP and I'll push it to 4.7.

--
Kalle Valo

2016-06-02 09:01:54

by Janusz Dziedzic

[permalink] [raw]
Subject: Re: ath9k gpio request

On 2 June 2016 at 10:02, Pan, Miaoqing <[email protected]> wrote:
> Seems there are something wrong in the datasheet, try
>
> --- a/drivers/net/wireless/ath/ath9k/reg.h
> +++ b/drivers/net/wireless/ath/ath9k/reg.h
> @@ -1122,8 +1122,8 @@ enum {
> #define AR9300_NUM_GPIO 16
> #define AR9330_NUM_GPIO 16
> #define AR9340_NUM_GPIO 23
> -#define AR9462_NUM_GPIO 10
> -#define AR9485_NUM_GPIO 12
> +#define AR9462_NUM_GPIO 14
> +#define AR9485_NUM_GPIO 11
> #define AR9531_NUM_GPIO 18
> #define AR9550_NUM_GPIO 24
> #define AR9561_NUM_GPIO 23
> @@ -1139,8 +1139,8 @@ enum {
> #define AR9300_GPIO_MASK 0x0000F4FF
> #define AR9330_GPIO_MASK 0x0000F4FF
> #define AR9340_GPIO_MASK 0x0000000F
> -#define AR9462_GPIO_MASK 0x000003FF
> -#define AR9485_GPIO_MASK 0x00000FFF
> +#define AR9462_GPIO_MASK 0x00003FFF
> +#define AR9485_GPIO_MASK 0x000007FF
> #define AR9531_GPIO_MASK 0x0000000F
> #define AR9550_GPIO_MASK 0x0000000F
> #define AR9561_GPIO_MASK 0x0000000F
>

Thanks, changes in reg.h solve the problem (my card AR9462 rev 01).

BR
Janusz

> Thanks,
> Miaoqing
>
> ________________________________________
> From: Sudip Mukherjee <[email protected]>
> Sent: Wednesday, June 1, 2016 8:18 PM
> To: Pan, Miaoqing; Kalle Valo
> Cc: Stephen Rothwell; ath9k-devel; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Miaoqing Pan
> Subject: Re: ath9k gpio request
>
> On Wednesday 01 June 2016 04:42 PM, Sudip Mukherjee wrote:
>> On Wednesday 01 June 2016 12:24 PM, Pan, Miaoqing wrote:
>>> which chip ? And what's the GPIO number ?
>>
>> lspci -v reports:
>> 09:00.0 Network controller: Qualcomm Atheros AR9462 Wireless Network
>> Adapter (rev 01)
>> Subsystem: Foxconn International, Inc. Device e052
>> Flags: bus master, fast devsel, latency 0, IRQ 19
>> Memory at c0500000 (64-bit, non-prefetchable) [size=512K]
>> Expansion ROM at c0580000 [disabled] [size=64K]
>> Capabilities: [40] Power Management version 2
>> Capabilities: [50] MSI: Enable- Count=1/4 Maskable+ 64bit+
>> Capabilities: [70] Express Endpoint, MSI 00
>> Capabilities: [100] Advanced Error Reporting
>> Capabilities: [140] Virtual Channel
>> Capabilities: [160] Device Serial Number 00-00-00-00-00-00-00-00
>> Kernel driver in use: ath9k
>>
>> Any easy way to find out the gpio number or i can modify the module to
>> find that out.
>
> Its trying for GPIO 11 with label ath9k-rfkill.
>
> The attached dmesg is with some modification as below.
>
> diff --git a/drivers/net/wireless/ath/ath9k/hw.c
> b/drivers/net/wireless/ath/ath9k/hw.c
> index 8b2895f9..23deea7 100644
> --- a/drivers/net/wireless/ath/ath9k/hw.c
> +++ b/drivers/net/wireless/ath/ath9k/hw.c
> @@ -2729,14 +2729,16 @@ static void ath9k_hw_gpio_cfg_wmac(struct ath_hw
> *ah, u32 gpio, bool out,
> static void ath9k_hw_gpio_request(struct ath_hw *ah, u32 gpio, bool out,
> const char *label, u32 ah_signal_type)
> {
> - WARN_ON(gpio >= ah->caps.num_gpio_pins);
> +// WARN_ON(gpio >= ah->caps.num_gpio_pins);
> +
> + pr_err("sudip: %d %s\n", gpio, label);
>
> if (BIT(gpio) & ah->caps.gpio_mask)
> ath9k_hw_gpio_cfg_wmac(ah, gpio, out, ah_signal_type);
> else if (AR_SREV_SOC(ah))
> ath9k_hw_gpio_cfg_soc(ah, gpio, out, label);
> - else
> - WARN_ON(1);
> +// else
> +// WARN_ON(1);
> }
>
> Regards
> Sudip
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html

2016-06-02 08:03:15

by Pan, Miaoqing

[permalink] [raw]
Subject: Re: ath9k gpio request

Seems there are something wrong in the datasheet, try

--- a/drivers/net/wireless/ath/ath9k/reg.h
+++ b/drivers/net/wireless/ath/ath9k/reg.h
@@ -1122,8 +1122,8 @@ enum {
#define AR9300_NUM_GPIO 16
#define AR9330_NUM_GPIO 16
#define AR9340_NUM_GPIO 23
-#define AR9462_NUM_GPIO 10
-#define AR9485_NUM_GPIO 12
+#define AR9462_NUM_GPIO 14
+#define AR9485_NUM_GPIO 11
#define AR9531_NUM_GPIO 18
#define AR9550_NUM_GPIO 24
#define AR9561_NUM_GPIO 23
@@ -1139,8 +1139,8 @@ enum {
#define AR9300_GPIO_MASK 0x0000F4FF
#define AR9330_GPIO_MASK 0x0000F4FF
#define AR9340_GPIO_MASK 0x0000000F
-#define AR9462_GPIO_MASK 0x000003FF
-#define AR9485_GPIO_MASK 0x00000FFF
+#define AR9462_GPIO_MASK 0x00003FFF
+#define AR9485_GPIO_MASK 0x000007FF
#define AR9531_GPIO_MASK 0x0000000F
#define AR9550_GPIO_MASK 0x0000000F
#define AR9561_GPIO_MASK 0x0000000F

Thanks,
Miaoqing

________________________________________
From: Sudip Mukherjee <[email protected]>
Sent: Wednesday, June 1, 2016 8:18 PM
To: Pan, Miaoqing; Kalle Valo
Cc: Stephen Rothwell; ath9k-devel; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Miaoqing Pan
Subject: Re: ath9k gpio request

On Wednesday 01 June 2016 04:42 PM, Sudip Mukherjee wrote:
> On Wednesday 01 June 2016 12:24 PM, Pan, Miaoqing wrote:
>> which chip ? And what's the GPIO number ?
>
> lspci -v reports:
> 09:00.0 Network controller: Qualcomm Atheros AR9462 Wireless Network
> Adapter (rev 01)
> Subsystem: Foxconn International, Inc. Device e052
> Flags: bus master, fast devsel, latency 0, IRQ 19
> Memory at c0500000 (64-bit, non-prefetchable) [size=512K]
> Expansion ROM at c0580000 [disabled] [size=64K]
> Capabilities: [40] Power Management version 2
> Capabilities: [50] MSI: Enable- Count=1/4 Maskable+ 64bit+
> Capabilities: [70] Express Endpoint, MSI 00
> Capabilities: [100] Advanced Error Reporting
> Capabilities: [140] Virtual Channel
> Capabilities: [160] Device Serial Number 00-00-00-00-00-00-00-00
> Kernel driver in use: ath9k
>
> Any easy way to find out the gpio number or i can modify the module to
> find that out.

Its trying for GPIO 11 with label ath9k-rfkill.

The attached dmesg is with some modification as below.

diff --git a/drivers/net/wireless/ath/ath9k/hw.c
b/drivers/net/wireless/ath/ath9k/hw.c
index 8b2895f9..23deea7 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -2729,14 +2729,16 @@ static void ath9k_hw_gpio_cfg_wmac(struct ath_hw
*ah, u32 gpio, bool out,
static void ath9k_hw_gpio_request(struct ath_hw *ah, u32 gpio, bool out,
const char *label, u32 ah_signal_type)
{
- WARN_ON(gpio >= ah->caps.num_gpio_pins);
+// WARN_ON(gpio >= ah->caps.num_gpio_pins);
+
+ pr_err("sudip: %d %s\n", gpio, label);

if (BIT(gpio) & ah->caps.gpio_mask)
ath9k_hw_gpio_cfg_wmac(ah, gpio, out, ah_signal_type);
else if (AR_SREV_SOC(ah))
ath9k_hw_gpio_cfg_soc(ah, gpio, out, label);
- else
- WARN_ON(1);
+// else
+// WARN_ON(1);
}

Regards
Sudip

2016-06-05 17:40:37

by Sudip Mukherjee

[permalink] [raw]
Subject: Re: ath9k gpio request

On Saturday 04 June 2016 08:07 PM, Kalle Valo wrote:
> (Fixing top posting)
>
> "Pan, Miaoqing" <[email protected]> writes:
>
>>>> --- a/drivers/net/wireless/ath/ath9k/reg.h
>>>> +++ b/drivers/net/wireless/ath/ath9k/reg.h
>>>> @@ -1122,8 +1122,8 @@ enum {
>>>> #define AR9300_NUM_GPIO 16
>>>> #define AR9330_NUM_GPIO 16
>>>> #define AR9340_NUM_GPIO 23
>>>> -#define AR9462_NUM_GPIO 10
>>>> -#define AR9485_NUM_GPIO 12
>>>> +#define AR9462_NUM_GPIO 14
>>>> +#define AR9485_NUM_GPIO 11
>>>> #define AR9531_NUM_GPIO 18
>>>> #define AR9550_NUM_GPIO 24
>>>> #define AR9561_NUM_GPIO 23
>>>> @@ -1139,8 +1139,8 @@ enum {
>>>> #define AR9300_GPIO_MASK 0x0000F4FF
>>>> #define AR9330_GPIO_MASK 0x0000F4FF
>>>> #define AR9340_GPIO_MASK 0x0000000F
>>>> -#define AR9462_GPIO_MASK 0x000003FF
>>>> -#define AR9485_GPIO_MASK 0x00000FFF
>>>> +#define AR9462_GPIO_MASK 0x00003FFF
>>>> +#define AR9485_GPIO_MASK 0x000007FF
>>>> #define AR9531_GPIO_MASK 0x0000000F
>>>> #define AR9550_GPIO_MASK 0x0000000F
>>>> #define AR9561_GPIO_MASK 0x0000000F
>>>
>>> solves the problem.
>>>
>>> Tested-by: Sudip Mukherjee <[email protected]>
>>
>> Done, https://patchwork.kernel.org/patch/9151847/
>
> But the patch 9151847 is different from what Sudip tested above? Why?
>
> And if you modify something _after_ the reporter has tested the patch
> clearly document what you changed and why. I do not want find hidden
> changes like this, even more so when the patch is going to a 4.7-rc
> release.
>
> Sudip, could you also test patch 9151847, please? You can download the
> patch from the patchwork link above.

This is also ok. Please add my
Tested-by: Sudip Mukherjee <[email protected]>

and maybe a Reported-by tag is also appropriate in this case.


Regards
Sudip

2016-06-07 11:44:09

by Kalle Valo

[permalink] [raw]
Subject: Re: ath9k gpio request

Sudip Mukherjee <[email protected]> writes:

>> Sudip, could you also test patch 9151847, please? You can download the
>> patch from the patchwork link above.
>
> This is also ok. Please add my
> Tested-by: Sudip Mukherjee <[email protected]>
>
> and maybe a Reported-by tag is also appropriate in this case.

Yeah, I add those. Thanks Sudip.

--
Kalle Valo

2016-06-02 16:09:35

by Sudip Mukherjee

[permalink] [raw]
Subject: Re: ath9k gpio request

On Thursday 02 June 2016 01:32 PM, Pan, Miaoqing wrote:
> Seems there are something wrong in the datasheet, try
>
> --- a/drivers/net/wireless/ath/ath9k/reg.h
> +++ b/drivers/net/wireless/ath/ath9k/reg.h
> @@ -1122,8 +1122,8 @@ enum {
> #define AR9300_NUM_GPIO 16
> #define AR9330_NUM_GPIO 16
> #define AR9340_NUM_GPIO 23
> -#define AR9462_NUM_GPIO 10
> -#define AR9485_NUM_GPIO 12
> +#define AR9462_NUM_GPIO 14
> +#define AR9485_NUM_GPIO 11
> #define AR9531_NUM_GPIO 18
> #define AR9550_NUM_GPIO 24
> #define AR9561_NUM_GPIO 23
> @@ -1139,8 +1139,8 @@ enum {
> #define AR9300_GPIO_MASK 0x0000F4FF
> #define AR9330_GPIO_MASK 0x0000F4FF
> #define AR9340_GPIO_MASK 0x0000000F
> -#define AR9462_GPIO_MASK 0x000003FF
> -#define AR9485_GPIO_MASK 0x00000FFF
> +#define AR9462_GPIO_MASK 0x00003FFF
> +#define AR9485_GPIO_MASK 0x000007FF
> #define AR9531_GPIO_MASK 0x0000000F
> #define AR9550_GPIO_MASK 0x0000000F
> #define AR9561_GPIO_MASK 0x0000000F

solves the problem.

Tested-by: Sudip Mukherjee <[email protected]>

Regards
Sudip

2016-06-01 15:43:07

by Sudip Mukherjee

[permalink] [raw]
Subject: Re: ath9k gpio request

On Wednesday 01 June 2016 12:24 PM, Pan, Miaoqing wrote:
> which chip ? And what's the GPIO number ?

lspci -v reports:
09:00.0 Network controller: Qualcomm Atheros AR9462 Wireless Network
Adapter (rev 01)
Subsystem: Foxconn International, Inc. Device e052
Flags: bus master, fast devsel, latency 0, IRQ 19
Memory at c0500000 (64-bit, non-prefetchable) [size=512K]
Expansion ROM at c0580000 [disabled] [size=64K]
Capabilities: [40] Power Management version 2
Capabilities: [50] MSI: Enable- Count=1/4 Maskable+ 64bit+
Capabilities: [70] Express Endpoint, MSI 00
Capabilities: [100] Advanced Error Reporting
Capabilities: [140] Virtual Channel
Capabilities: [160] Device Serial Number 00-00-00-00-00-00-00-00
Kernel driver in use: ath9k

Any easy way to find out the gpio number or i can modify the module to
find that out.

Regards
Sudip

2016-06-03 05:33:17

by Kalle Valo

[permalink] [raw]
Subject: Re: ath9k gpio request

Sudip Mukherjee <[email protected]> writes:

> On Thursday 02 June 2016 01:32 PM, Pan, Miaoqing wrote:
>> Seems there are something wrong in the datasheet, try
>>
>> --- a/drivers/net/wireless/ath/ath9k/reg.h
>> +++ b/drivers/net/wireless/ath/ath9k/reg.h
>> @@ -1122,8 +1122,8 @@ enum {
>> #define AR9300_NUM_GPIO 16
>> #define AR9330_NUM_GPIO 16
>> #define AR9340_NUM_GPIO 23
>> -#define AR9462_NUM_GPIO 10
>> -#define AR9485_NUM_GPIO 12
>> +#define AR9462_NUM_GPIO 14
>> +#define AR9485_NUM_GPIO 11
>> #define AR9531_NUM_GPIO 18
>> #define AR9550_NUM_GPIO 24
>> #define AR9561_NUM_GPIO 23
>> @@ -1139,8 +1139,8 @@ enum {
>> #define AR9300_GPIO_MASK 0x0000F4FF
>> #define AR9330_GPIO_MASK 0x0000F4FF
>> #define AR9340_GPIO_MASK 0x0000000F
>> -#define AR9462_GPIO_MASK 0x000003FF
>> -#define AR9485_GPIO_MASK 0x00000FFF
>> +#define AR9462_GPIO_MASK 0x00003FFF
>> +#define AR9485_GPIO_MASK 0x000007FF
>> #define AR9531_GPIO_MASK 0x0000000F
>> #define AR9550_GPIO_MASK 0x0000000F
>> #define AR9561_GPIO_MASK 0x0000000F
>
> solves the problem.
>
> Tested-by: Sudip Mukherjee <[email protected]>

Great, thanks for testing everyone. Miaoqing, please send a proper patch
ASAP and I'll push it to 4.7.

--
Kalle Valo

2016-06-06 01:51:48

by Pan, Miaoqing

[permalink] [raw]
Subject: RE: ath9k gpio request

Got it, thanks. There is no difference of the changes for AR9462 which is the chip Sudip tested.

Thanks,
Miaoqing

-----Original Message-----
From: Kalle Valo [mailto:[email protected]]
Sent: Saturday, June 04, 2016 10:38 PM
To: Pan, Miaoqing <[email protected]>
Cc: Sudip Mukherjee <[email protected]>; Stephen Rothwell <[email protected]>; ath9k-devel <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Miaoqing Pan <[email protected]>
Subject: Re: ath9k gpio request

(Fixing top posting)

"Pan, Miaoqing" <[email protected]> writes:

>>> --- a/drivers/net/wireless/ath/ath9k/reg.h
>>> +++ b/drivers/net/wireless/ath/ath9k/reg.h
>>> @@ -1122,8 +1122,8 @@ enum {
>>> #define AR9300_NUM_GPIO 16
>>> #define AR9330_NUM_GPIO 16
>>> #define AR9340_NUM_GPIO 23
>>> -#define AR9462_NUM_GPIO 10
>>> -#define AR9485_NUM_GPIO 12
>>> +#define AR9462_NUM_GPIO 14
>>> +#define AR9485_NUM_GPIO 11
>>> #define AR9531_NUM_GPIO 18
>>> #define AR9550_NUM_GPIO 24
>>> #define AR9561_NUM_GPIO 23
>>> @@ -1139,8 +1139,8 @@ enum {
>>> #define AR9300_GPIO_MASK 0x0000F4FF
>>> #define AR9330_GPIO_MASK 0x0000F4FF
>>> #define AR9340_GPIO_MASK 0x0000000F
>>> -#define AR9462_GPIO_MASK 0x000003FF
>>> -#define AR9485_GPIO_MASK 0x00000FFF
>>> +#define AR9462_GPIO_MASK 0x00003FFF
>>> +#define AR9485_GPIO_MASK 0x000007FF
>>> #define AR9531_GPIO_MASK 0x0000000F
>>> #define AR9550_GPIO_MASK 0x0000000F
>>> #define AR9561_GPIO_MASK 0x0000000F
>>
>> solves the problem.
>>
>> Tested-by: Sudip Mukherjee <[email protected]>
>
> Done, https://patchwork.kernel.org/patch/9151847/

But the patch 9151847 is different from what Sudip tested above? Why?

And if you modify something _after_ the reporter has tested the patch clearly document what you changed and why. I do not want find hidden changes like this, even more so when the patch is going to a 4.7-rc release.

Sudip, could you also test patch 9151847, please? You can download the patch from the patchwork link above.

--
Kalle Valo

2016-06-01 16:48:56

by Sudip Mukherjee

[permalink] [raw]
Subject: Re: ath9k gpio request

On Wednesday 01 June 2016 04:42 PM, Sudip Mukherjee wrote:
> On Wednesday 01 June 2016 12:24 PM, Pan, Miaoqing wrote:
>> which chip ? And what's the GPIO number ?
>
> lspci -v reports:
> 09:00.0 Network controller: Qualcomm Atheros AR9462 Wireless Network
> Adapter (rev 01)
> Subsystem: Foxconn International, Inc. Device e052
> Flags: bus master, fast devsel, latency 0, IRQ 19
> Memory at c0500000 (64-bit, non-prefetchable) [size=512K]
> Expansion ROM at c0580000 [disabled] [size=64K]
> Capabilities: [40] Power Management version 2
> Capabilities: [50] MSI: Enable- Count=1/4 Maskable+ 64bit+
> Capabilities: [70] Express Endpoint, MSI 00
> Capabilities: [100] Advanced Error Reporting
> Capabilities: [140] Virtual Channel
> Capabilities: [160] Device Serial Number 00-00-00-00-00-00-00-00
> Kernel driver in use: ath9k
>
> Any easy way to find out the gpio number or i can modify the module to
> find that out.

Its trying for GPIO 11 with label ath9k-rfkill.

The attached dmesg is with some modification as below.

diff --git a/drivers/net/wireless/ath/ath9k/hw.c
b/drivers/net/wireless/ath/ath9k/hw.c
index 8b2895f9..23deea7 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -2729,14 +2729,16 @@ static void ath9k_hw_gpio_cfg_wmac(struct ath_hw
*ah, u32 gpio, bool out,
static void ath9k_hw_gpio_request(struct ath_hw *ah, u32 gpio, bool out,
const char *label, u32 ah_signal_type)
{
- WARN_ON(gpio >= ah->caps.num_gpio_pins);
+// WARN_ON(gpio >= ah->caps.num_gpio_pins);
+
+ pr_err("sudip: %d %s\n", gpio, label);

if (BIT(gpio) & ah->caps.gpio_mask)
ath9k_hw_gpio_cfg_wmac(ah, gpio, out, ah_signal_type);
else if (AR_SREV_SOC(ah))
ath9k_hw_gpio_cfg_soc(ah, gpio, out, label);
- else
- WARN_ON(1);
+// else
+// WARN_ON(1);
}

Regards
Sudip


Attachments:
dm1.txt (174.29 kB)