public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Ma, Jun" <majun@amd.com>
To: Hans de Goede <hdegoede@redhat.com>, Ma Jun <Jun.Ma2@amd.com>,
	amd-gfx@lists.freedesktop.org, lenb@kernel.org,
	johannes@sipsolutions.net, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	alexander.deucher@amd.com, Lijo.Lazar@amd.com,
	mario.limonciello@amd.com, netdev@vger.kernel.org,
	linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-doc@vger.kernel.org, platform-driver-x86@vger.kernel.org
Cc: majun@amd.com, Evan Quan <quanliangl@hotmail.com>
Subject: Re: [PATCH v14 2/9] platform/x86/amd: Add support for AMD ACPI based Wifi band RFI mitigation feature
Date: Tue, 5 Dec 2023 15:22:07 +0800	[thread overview]
Message-ID: <67fe48be-8e10-47f7-bf47-e819ed02e732@amd.com> (raw)
In-Reply-To: <99de0223-6d28-4379-ac2a-ef093ee0386c@redhat.com>

Hi Hans,

On 12/4/2023 9:00 PM, Hans de Goede wrote:
> Hi,
> 
> On 11/29/23 10:13, Ma Jun wrote:
>> Due to electrical and mechanical constraints in certain platform designs
>> there may be likely interference of relatively high-powered harmonics of
>> the (G-)DDR memory clocks with local radio module frequency bands used
>> by Wifi 6/6e/7.
>>
>> To mitigate this, AMD has introduced a mechanism that devices can use to
>> notify active use of particular frequencies so that other devices can make
>> relative internal adjustments as necessary to avoid this resonance.
>>
>> Co-developed-by: Evan Quan <quanliangl@hotmail.com>
>> Signed-off-by: Evan Quan <quanliangl@hotmail.com>
>> Signed-off-by: Ma Jun <Jun.Ma2@amd.com>
>>
>> --
>> v11:
>>  - fix typo(Simon)
>> v12:
>>  - Fix the code logic (Rafael)
>>  - Move amd_wbrf.c to drivers/platform/x86/amd/wbrf.c
>>  - Updated Evan's email because he's no longer at AMD.Thanks
>> for his work in earlier versions.
>> v13:
>>  - Fix the format issue (IIpo Jarvinen)
>>  - Add comment for some functions
>> v14:
>>  - Use the apci_check_dsm and acpi_evaluate_dsm (Hans de Goede)
> 
> Thank you this is much better.
> 
> I notice that the #define ACPI_AMD_WBRF_METHOD	"\\WBRF"
> still exists though and that this is still used in
> static bool acpi_amd_wbrf_supported_system(void).
> 
> I think it might be better to just remove
> these 2 all together.
> 
> Checking if a DSM with the expected GUID is present
> and if that has the correct bits set in its supported
> mask should be enough.
> 
> And on future systems the implementer may decide to
> not have a WBRF helper function at all and instead
> handle everything in the _DSM method.
> 
> So the "\\WBRF" check seems to be checking for
> what really is an implementation detail.
> 
Yes,you are right. I will fix these issues.
Thanks for your review and suggestion. 

Regards,
Ma Jun
> 2 other very small remark
> 
>> +/**
>> + * acpi_amd_wbrf_supported_producer - determine if the WBRF can be enabled
>> + *                                    for the device as a producer
>> + *
>> + * @dev: device pointer
>> + *
>> + * Check if the platform equipped with necessary implementations to
>> + * support WBRF for the device as a producer.
>> + *
>> + * Return:
>> + * true if WBRF is supported, otherwise returns false
>> + */
>> +bool acpi_amd_wbrf_supported_producer(struct device *dev)
>> +{
>> +	struct acpi_device *adev;
>> +
>> +	adev = ACPI_COMPANION(dev);
>> +	if (!adev)
>> +		return false;
>> +
>> +	if (!acpi_amd_wbrf_supported_system())
>> +		return false;
>> +
>> +
>> +	return acpi_check_dsm(adev->handle, &wifi_acpi_dsm_guid,
>> +			      WBRF_REVISION, BIT(WBRF_RECORD));
>> +}
>> +EXPORT_SYMBOL_GPL(acpi_amd_wbrf_supported_producer);
> 
> Please don't use double empty lines, one empty line to separate things
> is enough.
> 
>> +
>> +/**
>> + * acpi_amd_wbrf_supported_consumer - determine if the WBRF can be enabled
>> + *                                    for the device as a consumer
>> + *
>> + * @dev: device pointer
>> + *
>> + * Determine if the platform equipped with necessary implementations to
>> + * support WBRF for the device as a consumer.
>> + *
>> + * Return:
>> + * true if WBRF is supported, otherwise returns false.
>> + */
>> +bool acpi_amd_wbrf_supported_consumer(struct device *dev)
>> +{
>> +	struct acpi_device *adev;
>> +
>> +	adev = ACPI_COMPANION(dev);
>> +	if (!adev)
>> +		return false;
>> +
>> +	if (!acpi_amd_wbrf_supported_system())
>> +		return false;
>> +
>> +	return acpi_check_dsm(adev->handle, &wifi_acpi_dsm_guid,
>> +			      WBRF_REVISION, BIT(WBRF_RETRIEVE));
>> +}
>> +EXPORT_SYMBOL_GPL(acpi_amd_wbrf_supported_consumer);
>> +
>> +/**
>> + * amd_wbrf_retrieve_freq_band - retrieve current active frequency
>> + *                                     bands
> 
> You may go a bit over the 80 chars limit, please just make this
> a single line:
> 
>  * amd_wbrf_retrieve_freq_band - retrieve current active frequency bands
> 
>> + *
>> + * @dev: device pointer
>> + * @out: output structure containing all the active frequency bands
>> + *
>> + * Retrieve the current active frequency bands which were broadcasted
>> + * by other producers. The consumer who calls this API should take
>> + * proper actions if any of the frequency band may cause RFI with its
>> + * own frequency band used.
>> + *
>> + * Return:
>> + * 0 for getting wifi freq band successfully.
>> + * Returns a negative error code for failure.
>> + */
> 
> Regards,
> 
> Hans
> 

  reply	other threads:[~2023-12-05  7:22 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-29  9:13 [PATCH v14 0/9] Enable Wifi RFI interference mitigation feature support Ma Jun
2023-11-29  9:13 ` [PATCH v14 1/9] Documentation/driver-api: Add document about WBRF mechanism Ma Jun
2023-11-29 17:21   ` Mario Limonciello
2023-11-29  9:13 ` [PATCH v14 2/9] platform/x86/amd: Add support for AMD ACPI based Wifi band RFI mitigation feature Ma Jun
2023-11-29 17:24   ` Mario Limonciello
2023-12-05  7:24     ` Ma, Jun
2023-12-04 13:00   ` Hans de Goede
2023-12-05  7:22     ` Ma, Jun [this message]
2023-11-29  9:13 ` [PATCH v14 3/9] cfg80211: expose nl80211_chan_width_to_mhz for wide sharing Ma Jun
2023-11-29 17:26   ` Mario Limonciello
2023-11-29  9:13 ` [PATCH v14 4/9] wifi: mac80211: Add support for WBRF features Ma Jun
2023-12-06  4:23   ` kernel test robot
2023-12-06  4:34   ` kernel test robot
2023-11-29  9:13 ` [PATCH v14 5/9] drm/amd/pm: update driver_if and ppsmc headers for coming wbrf feature Ma Jun
2023-11-29  9:13 ` [PATCH v14 6/9] drm/amd/pm: setup the framework to support Wifi RFI mitigation feature Ma Jun
2023-11-29  9:13 ` [PATCH v14 7/9] drm/amd/pm: add flood detection for wbrf events Ma Jun
2023-11-29  9:13 ` [PATCH v14 8/9] drm/amd/pm: enable Wifi RFI mitigation feature support for SMU13.0.0 Ma Jun
2023-11-29  9:13 ` [PATCH v14 9/9] drm/amd/pm: enable Wifi RFI mitigation feature support for SMU13.0.7 Ma Jun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=67fe48be-8e10-47f7-bf47-e819ed02e732@amd.com \
    --to=majun@amd.com \
    --cc=Jun.Ma2@amd.com \
    --cc=Lijo.Lazar@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hdegoede@redhat.com \
    --cc=johannes@sipsolutions.net \
    --cc=kuba@kernel.org \
    --cc=lenb@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=quanliangl@hotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox