netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] wifi: mac80211: Use subsystem appropriate debug call
@ 2023-12-15 14:54 Mario Limonciello
  2023-12-18 15:17 ` Kalle Valo
  0 siblings, 1 reply; 6+ messages in thread
From: Mario Limonciello @ 2023-12-15 14:54 UTC (permalink / raw)
  To: Johannes Berg
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	open list:MAC80211, open list:NETWORKING [GENERAL], open list,
	Mario Limonciello, Jun Ma, kvalo

mac80211 doesn't use dev_dbg() but instead various macros from
net/mac80211/debug.h. Adjust wbrf code to use wiphy_dbg() instead.

Cc: Jun Ma <Jun.ma2@amd.com>
Reported-by: kvalo@kernel.org
Closes: https://lore.kernel.org/amd-gfx/8bd60010-7534-4c22-9337-c4219946d8d6@amd.com/T/#mfe2f29372c45130d27745912faf33d9f7ce50118
Fixes: d34be4310cbe ("wifi: mac80211: Add support for WBRF features")
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
 net/mac80211/wbrf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/mac80211/wbrf.c b/net/mac80211/wbrf.c
index a05c5b971789..12c23e14f884 100644
--- a/net/mac80211/wbrf.c
+++ b/net/mac80211/wbrf.c
@@ -23,8 +23,8 @@ void ieee80211_check_wbrf_support(struct ieee80211_local *local)
 		return;
 
 	local->wbrf_supported = acpi_amd_wbrf_supported_producer(dev);
-	dev_dbg(dev, "WBRF is %s supported\n",
-		local->wbrf_supported ? "" : "not");
+	wiphy_dbg(wiphy, "WBRF is %s supported\n",
+		  local->wbrf_supported ? "" : "not");
 }
 
 static void get_chan_freq_boundary(u32 center_freq, u32 bandwidth, u64 *start, u64 *end)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] wifi: mac80211: Use subsystem appropriate debug call
  2023-12-15 14:54 [PATCH] wifi: mac80211: Use subsystem appropriate debug call Mario Limonciello
@ 2023-12-18 15:17 ` Kalle Valo
  2023-12-21  5:57   ` Ma, Jun
  0 siblings, 1 reply; 6+ messages in thread
From: Kalle Valo @ 2023-12-18 15:17 UTC (permalink / raw)
  To: Mario Limonciello
  Cc: Johannes Berg, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, open list:MAC80211, open list:NETWORKING [GENERAL],
	open list, Jun Ma

Mario Limonciello <mario.limonciello@amd.com> writes:

> mac80211 doesn't use dev_dbg() but instead various macros from
> net/mac80211/debug.h. Adjust wbrf code to use wiphy_dbg() instead.
>
> Cc: Jun Ma <Jun.ma2@amd.com>
> Reported-by: kvalo@kernel.org
> Closes:
> https://lore.kernel.org/amd-gfx/8bd60010-7534-4c22-9337-c4219946d8d6@amd.com/T/#mfe2f29372c45130d27745912faf33d9f7ce50118
> Fixes: d34be4310cbe ("wifi: mac80211: Add support for WBRF features")
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
>  net/mac80211/wbrf.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/mac80211/wbrf.c b/net/mac80211/wbrf.c
> index a05c5b971789..12c23e14f884 100644
> --- a/net/mac80211/wbrf.c
> +++ b/net/mac80211/wbrf.c
> @@ -23,8 +23,8 @@ void ieee80211_check_wbrf_support(struct ieee80211_local *local)
>  		return;
>  
>  	local->wbrf_supported = acpi_amd_wbrf_supported_producer(dev);
> -	dev_dbg(dev, "WBRF is %s supported\n",
> -		local->wbrf_supported ? "" : "not");
> +	wiphy_dbg(wiphy, "WBRF is %s supported\n",
> +		  local->wbrf_supported ? "" : "not");
>  }

This won't work, I still see the debug message:

[  333.765867] ieee80211 phy0: WBRF is not supported

The issue seems to be that mac80211 defines DEBUG in
net/mac80211/Makefile:

ccflags-y += -DDEBUG

That -DDEBUG should be cleaned up, but I think separately. It's just
that I cannot come up with any good proposal, all the macros in
net/mac80211/debug.h require sdata and we don't have that in this stage.
Any ideas?

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] wifi: mac80211: Use subsystem appropriate debug call
  2023-12-18 15:17 ` Kalle Valo
@ 2023-12-21  5:57   ` Ma, Jun
  2023-12-21  6:38     ` Kalle Valo
  0 siblings, 1 reply; 6+ messages in thread
From: Ma, Jun @ 2023-12-21  5:57 UTC (permalink / raw)
  To: Kalle Valo, Mario Limonciello
  Cc: majun, Johannes Berg, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, open list:MAC80211,
	open list:NETWORKING [GENERAL], open list, Jun Ma

Hi,

On 12/18/2023 11:17 PM, Kalle Valo wrote:
> Mario Limonciello <mario.limonciello@amd.com> writes:
> 
>> mac80211 doesn't use dev_dbg() but instead various macros from
>> net/mac80211/debug.h. Adjust wbrf code to use wiphy_dbg() instead.
>>
>> Cc: Jun Ma <Jun.ma2@amd.com>
>> Reported-by: kvalo@kernel.org
>> Closes:
>> https://lore.kernel.org/amd-gfx/8bd60010-7534-4c22-9337-c4219946d8d6@amd.com/T/#mfe2f29372c45130d27745912faf33d9f7ce50118
>> Fixes: d34be4310cbe ("wifi: mac80211: Add support for WBRF features")
>> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
>> ---
>>  net/mac80211/wbrf.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/net/mac80211/wbrf.c b/net/mac80211/wbrf.c
>> index a05c5b971789..12c23e14f884 100644
>> --- a/net/mac80211/wbrf.c
>> +++ b/net/mac80211/wbrf.c
>> @@ -23,8 +23,8 @@ void ieee80211_check_wbrf_support(struct ieee80211_local *local)
>>  		return;
>>  
>>  	local->wbrf_supported = acpi_amd_wbrf_supported_producer(dev);
>> -	dev_dbg(dev, "WBRF is %s supported\n",
>> -		local->wbrf_supported ? "" : "not");
>> +	wiphy_dbg(wiphy, "WBRF is %s supported\n",
>> +		  local->wbrf_supported ? "" : "not");
>>  }
> 
> This won't work, I still see the debug message:
> 
> [  333.765867] ieee80211 phy0: WBRF is not supported
> 
> The issue seems to be that mac80211 defines DEBUG in
> net/mac80211/Makefile:
> 
> ccflags-y += -DDEBUG
> 
> That -DDEBUG should be cleaned up, but I think separately. It's just
> that I cannot come up with any good proposal, all the macros in
> net/mac80211/debug.h require sdata and we don't have that in this stage.
> Any ideas?

I will submit a patch that only compiles wbrf.c when CONFIG_AMD_WBRF=y

Regards,
Ma Jun


> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] wifi: mac80211: Use subsystem appropriate debug call
  2023-12-21  5:57   ` Ma, Jun
@ 2023-12-21  6:38     ` Kalle Valo
  2023-12-30  2:42       ` Mario Limonciello
  0 siblings, 1 reply; 6+ messages in thread
From: Kalle Valo @ 2023-12-21  6:38 UTC (permalink / raw)
  To: Ma, Jun
  Cc: Mario Limonciello, Johannes Berg, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, open list:MAC80211,
	open list:NETWORKING [GENERAL], open list, Jun Ma

"Ma, Jun" <majun@amd.com> writes:

> Hi,
>
> On 12/18/2023 11:17 PM, Kalle Valo wrote:
>> Mario Limonciello <mario.limonciello@amd.com> writes:
>> 
>>> mac80211 doesn't use dev_dbg() but instead various macros from
>>> net/mac80211/debug.h. Adjust wbrf code to use wiphy_dbg() instead.
>>>
>>> Cc: Jun Ma <Jun.ma2@amd.com>
>>> Reported-by: kvalo@kernel.org
>>> Closes:
>>> https://lore.kernel.org/amd-gfx/8bd60010-7534-4c22-9337-c4219946d8d6@amd.com/T/#mfe2f29372c45130d27745912faf33d9f7ce50118
>>> Fixes: d34be4310cbe ("wifi: mac80211: Add support for WBRF features")
>>> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
>>> ---
>>>  net/mac80211/wbrf.c | 4 ++--
>>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/net/mac80211/wbrf.c b/net/mac80211/wbrf.c
>>> index a05c5b971789..12c23e14f884 100644
>>> --- a/net/mac80211/wbrf.c
>>> +++ b/net/mac80211/wbrf.c
>>> @@ -23,8 +23,8 @@ void ieee80211_check_wbrf_support(struct ieee80211_local *local)
>>>  		return;
>>>  
>>>  	local->wbrf_supported = acpi_amd_wbrf_supported_producer(dev);
>>> -	dev_dbg(dev, "WBRF is %s supported\n",
>>> -		local->wbrf_supported ? "" : "not");
>>> +	wiphy_dbg(wiphy, "WBRF is %s supported\n",
>>> +		  local->wbrf_supported ? "" : "not");
>>>  }
>> 
>> This won't work, I still see the debug message:
>> 
>> [  333.765867] ieee80211 phy0: WBRF is not supported
>> 
>> The issue seems to be that mac80211 defines DEBUG in
>> net/mac80211/Makefile:
>> 
>> ccflags-y += -DDEBUG
>> 
>> That -DDEBUG should be cleaned up, but I think separately. It's just
>> that I cannot come up with any good proposal, all the macros in
>> net/mac80211/debug.h require sdata and we don't have that in this stage.
>> Any ideas?
>
> I will submit a patch that only compiles wbrf.c when CONFIG_AMD_WBRF=y

But does this mean that the debug is still printed when CONFIG_AMD_WBRF
is enabled? And I would assume all distros enable that, right?

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] wifi: mac80211: Use subsystem appropriate debug call
  2023-12-21  6:38     ` Kalle Valo
@ 2023-12-30  2:42       ` Mario Limonciello
  2024-01-11 10:58         ` Kalle Valo
  0 siblings, 1 reply; 6+ messages in thread
From: Mario Limonciello @ 2023-12-30  2:42 UTC (permalink / raw)
  To: Kalle Valo, Ma, Jun
  Cc: Johannes Berg, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, open list:MAC80211, open list:NETWORKING [GENERAL],
	open list, Jun Ma

On 12/21/2023 00:38, Kalle Valo wrote:
> "Ma, Jun" <majun@amd.com> writes:
> 
>> Hi,
>>
>> On 12/18/2023 11:17 PM, Kalle Valo wrote:
>>> Mario Limonciello <mario.limonciello@amd.com> writes:
>>>
>>>> mac80211 doesn't use dev_dbg() but instead various macros from
>>>> net/mac80211/debug.h. Adjust wbrf code to use wiphy_dbg() instead.
>>>>
>>>> Cc: Jun Ma <Jun.ma2@amd.com>
>>>> Reported-by: kvalo@kernel.org
>>>> Closes:
>>>> https://lore.kernel.org/amd-gfx/8bd60010-7534-4c22-9337-c4219946d8d6@amd.com/T/#mfe2f29372c45130d27745912faf33d9f7ce50118
>>>> Fixes: d34be4310cbe ("wifi: mac80211: Add support for WBRF features")
>>>> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
>>>> ---
>>>>   net/mac80211/wbrf.c | 4 ++--
>>>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/net/mac80211/wbrf.c b/net/mac80211/wbrf.c
>>>> index a05c5b971789..12c23e14f884 100644
>>>> --- a/net/mac80211/wbrf.c
>>>> +++ b/net/mac80211/wbrf.c
>>>> @@ -23,8 +23,8 @@ void ieee80211_check_wbrf_support(struct ieee80211_local *local)
>>>>   		return;
>>>>   
>>>>   	local->wbrf_supported = acpi_amd_wbrf_supported_producer(dev);
>>>> -	dev_dbg(dev, "WBRF is %s supported\n",
>>>> -		local->wbrf_supported ? "" : "not");
>>>> +	wiphy_dbg(wiphy, "WBRF is %s supported\n",
>>>> +		  local->wbrf_supported ? "" : "not");
>>>>   }
>>>
>>> This won't work, I still see the debug message:
>>>
>>> [  333.765867] ieee80211 phy0: WBRF is not supported
>>>
>>> The issue seems to be that mac80211 defines DEBUG in
>>> net/mac80211/Makefile:
>>>
>>> ccflags-y += -DDEBUG
>>>
>>> That -DDEBUG should be cleaned up, but I think separately. It's just
>>> that I cannot come up with any good proposal, all the macros in
>>> net/mac80211/debug.h require sdata and we don't have that in this stage.
>>> Any ideas?
>>
>> I will submit a patch that only compiles wbrf.c when CONFIG_AMD_WBRF=y
> 
> But does this mean that the debug is still printed when CONFIG_AMD_WBRF
> is enabled? And I would assume all distros enable that, right?
> 

Maybe just discard the debug message instead of have to deal with this.

We'll be able to tell from the consumer (amdgpu right now) when WBRF is 
being used and if we need to debug an issue knowing that it's supported 
or not supported from the producer side is the least of our worries.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] wifi: mac80211: Use subsystem appropriate debug call
  2023-12-30  2:42       ` Mario Limonciello
@ 2024-01-11 10:58         ` Kalle Valo
  0 siblings, 0 replies; 6+ messages in thread
From: Kalle Valo @ 2024-01-11 10:58 UTC (permalink / raw)
  To: Mario Limonciello
  Cc: Ma, Jun, Johannes Berg, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, open list:MAC80211,
	open list:NETWORKING [GENERAL], open list, Jun Ma

Mario Limonciello <mario.limonciello@amd.com> writes:

> On 12/21/2023 00:38, Kalle Valo wrote:
>
>> "Ma, Jun" <majun@amd.com> writes:
>> 
>>> Hi,
>>>
>>> On 12/18/2023 11:17 PM, Kalle Valo wrote:
>>>> Mario Limonciello <mario.limonciello@amd.com> writes:
>>>>
>>>>> mac80211 doesn't use dev_dbg() but instead various macros from
>>>>> net/mac80211/debug.h. Adjust wbrf code to use wiphy_dbg() instead.
>>>>>
>>>>> Cc: Jun Ma <Jun.ma2@amd.com>
>>>>> Reported-by: kvalo@kernel.org
>>>>> Closes:
>>>>> https://lore.kernel.org/amd-gfx/8bd60010-7534-4c22-9337-c4219946d8d6@amd.com/T/#mfe2f29372c45130d27745912faf33d9f7ce50118
>>>>> Fixes: d34be4310cbe ("wifi: mac80211: Add support for WBRF features")
>>>>> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
>>>>> ---
>>>>>   net/mac80211/wbrf.c | 4 ++--
>>>>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>>>>
>>>>> diff --git a/net/mac80211/wbrf.c b/net/mac80211/wbrf.c
>>>>> index a05c5b971789..12c23e14f884 100644
>>>>> --- a/net/mac80211/wbrf.c
>>>>> +++ b/net/mac80211/wbrf.c
>>>>> @@ -23,8 +23,8 @@ void ieee80211_check_wbrf_support(struct ieee80211_local *local)
>>>>>   		return;
>>>>>     	local->wbrf_supported =
>>>>> acpi_amd_wbrf_supported_producer(dev);
>>>>> -	dev_dbg(dev, "WBRF is %s supported\n",
>>>>> -		local->wbrf_supported ? "" : "not");
>>>>> +	wiphy_dbg(wiphy, "WBRF is %s supported\n",
>>>>> +		  local->wbrf_supported ? "" : "not");
>>>>>   }
>>>>
>>>> This won't work, I still see the debug message:
>>>>
>>>> [  333.765867] ieee80211 phy0: WBRF is not supported
>>>>
>>>> The issue seems to be that mac80211 defines DEBUG in
>>>> net/mac80211/Makefile:
>>>>
>>>> ccflags-y += -DDEBUG
>>>>
>>>> That -DDEBUG should be cleaned up, but I think separately. It's just
>>>> that I cannot come up with any good proposal, all the macros in
>>>> net/mac80211/debug.h require sdata and we don't have that in this stage.
>>>> Any ideas?
>>>
>>> I will submit a patch that only compiles wbrf.c when CONFIG_AMD_WBRF=y
>> But does this mean that the debug is still printed when
>> CONFIG_AMD_WBRF
>> is enabled? And I would assume all distros enable that, right?
>> 
>
> Maybe just discard the debug message instead of have to deal with this.
>
> We'll be able to tell from the consumer (amdgpu right now) when WBRF
> is being used and if we need to debug an issue knowing that it's
> supported or not supported from the producer side is the least of our
> worries.

Yeah, removing the message for now is the best solution. It can be added
later after we have improved mac80211 logging.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-01-11 10:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-15 14:54 [PATCH] wifi: mac80211: Use subsystem appropriate debug call Mario Limonciello
2023-12-18 15:17 ` Kalle Valo
2023-12-21  5:57   ` Ma, Jun
2023-12-21  6:38     ` Kalle Valo
2023-12-30  2:42       ` Mario Limonciello
2024-01-11 10:58         ` Kalle Valo

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).