Subject: Re: [PATCH] wifi: mac80211: Use subsystem appropriate debug call

From: Kalle Valo <[email-masked]>
Date: Thu, 21 Dec 2023 08:38:32 +0200

"Ma, Jun" <[email-masked]> writes:

> Hi,
>
> On 12/18/2023 11:17 PM, Kalle Valo wrote:
>> Mario Limonciello <[email-masked]> 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 <[email-masked]>
>>> Reported-by: [email-masked]
>>> Closes:
>>> https://lore.kernel.org/amd-gfx/[email-masked]/T/#mfe2f29372c45130d27745912faf33d9f7ce50118
>>> Fixes: d34be4310cbe ("wifi: mac80211: Add support for WBRF features")
>>> Signed-off-by: Mario Limonciello <[email-masked]>
>>> ---
>>>  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