[PATCH V3 5/7] drm/amd/pm: add flood detection for wbrf events

2023-06-16 Thread Evan Quan
To protect PMFW from being overloaded. Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 28 --- drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 7 + 2 files changed, 31 insertions(+), 4 deletions(-) diff --git

[PATCH V3 7/7] drm/amd/pm: enable Wifi RFI mitigation feature support for SMU13.0.7

2023-06-16 Thread Evan Quan
Fulfill the SMU13.0.7 support for Wifi RFI mitigation feature. Signed-off-by: Evan Quan --- .../drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c | 59 +++ 1 file changed, 59 insertions(+) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c

[PATCH V3 6/7] drm/amd/pm: enable Wifi RFI mitigation feature support for SMU13.0.0

2023-06-16 Thread Evan Quan
Fulfill the SMU13.0.0 support for Wifi RFI mitigation feature. Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 3 + drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h | 3 +- drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h | 3 +

[PATCH] drm/amdgpu: fix clearing mappings for BOs that are always valid in VM

2023-06-16 Thread Samuel Pitoiset
If the BO has been moved the PT should be updated, otherwise the VAs might point to invalid PT. This fixes random GPU hangs when replacing sparse mappings from the userspace, while OP_MAP/OP_UNMAP works fine because always valid BOs are correctly handled there. Cc: sta...@vger.kernel.org

[PATCH V3 3/7] drm/amd/pm: update driver_if and ppsmc headers for coming wbrf feature

2023-06-16 Thread Evan Quan
Add those data structures to support Wifi RFI mitigation feature. Signed-off-by: Evan Quan --- .../pm/swsmu/inc/pmfw_if/smu13_driver_if_v13_0_0.h | 14 +- .../pm/swsmu/inc/pmfw_if/smu13_driver_if_v13_0_7.h | 14 +- .../amd/pm/swsmu/inc/pmfw_if/smu_v13_0_0_ppsmc.h | 3

[PATCH V3 4/7] drm/amd/pm: setup the framework to support Wifi RFI mitigation feature

2023-06-16 Thread Evan Quan
With WBRF feature supported, as a driver responding to the frequencies, amdgpu driver is able to do shadow pstate switching to mitigate possible interference(between its (G-)DDR memory clocks and local radio module frequency bands used by Wifi 6/6e/7). To make WBRF feature functional, the kernel

[PATCH V3 1/7] drivers/acpi: Add support for Wifi band RF mitigations

2023-06-16 Thread Evan Quan
From: Mario Limonciello 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

[PATCH V3 2/7] wifi: mac80211: Add support for ACPI WBRF

2023-06-16 Thread Evan Quan
From: Mario Limonciello To support AMD's WBRF interference mitigation mechanism, Wifi adapters utilized in the system must register the frequencies in use(or unregister those frequencies no longer used) via the dedicated APCI calls. So that, other drivers responding to the frequencies can take

[PATCH V3 0/7] Support Wifi RFI interference mitigation feature

2023-06-16 Thread Evan Quan
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 possible RFI interference producers can advertise

Re: [PATCH v7 2/8] PCI/VGA: Deal only with VGA class devices

2023-06-16 Thread Sui Jingfeng
Hi, On 2023/6/16 05:11, Alex Deucher wrote: On Wed, Jun 14, 2023 at 6:50 AM Sui Jingfeng wrote: Hi, On 2023/6/13 11:01, Sui Jingfeng wrote: From: Sui Jingfeng Deal only with the VGA devcie(pdev->class == 0x0300), so replace the pci_get_subsys() function with pci_get_class(). Filter the

Re: [PATCH 2/2] drm/amd/pm: update the LC_L1_INACTIIVY setting to address possible noise issue

2023-06-16 Thread Alex Deucher
Series is: Reviewed-by: Alex Deucher On Thu, Jun 15, 2023 at 9:20 PM Evan Quan wrote: > > It is proved that insufficient LC_L1_INACTIIVY setting can cause audio > noise on some platform. With the LC_L1_INACTIIVY increased to 4ms, the > issue can be resolved. > > Signed-off-by: Evan Quan > ---

Re: [PATCH] drm/amdgpu: enable mcbp by default on gfx9 chips

2023-06-16 Thread Christian König
Am 16.06.23 um 07:07 schrieb jiadong@amd.com: From: Jiadong Zhu Gfx9 is using software rings which would trigger mcbp in some cases. Thus the parameter amdgpu_mcbp shall be enabled by default. Actually the idea was to not need the amdgpu_mcbp parameter any more and deprecate it with the

[PATCH v2] drm/amdgpu: fix clearing mappings for BOs that are always valid in VM

2023-06-16 Thread Samuel Pitoiset
Per VM BOs must be marked as moved or otherwise their ranges are not updated on use which might be necessary when the replace operation splits mappings. This fixes random GPU hangs when replacing sparse mappings from the userspace, while OP_MAP/OP_UNMAP works fine because always valid BOs are

Re: [PATCH] drm/amdgpu: Modify for_each_inst macro

2023-06-16 Thread Deucher, Alexander
[Public] Acked-by: Alex Deucher From: Lazar, Lijo Sent: Friday, June 16, 2023 6:23 AM To: amd-gfx@lists.freedesktop.org Cc: Zhang, Hawking ; Deucher, Alexander ; Kamal, Asad ; Ma, Le Subject: [PATCH] drm/amdgpu: Modify for_each_inst macro Modify it such

Re: [PATCH v7 2/8] PCI/VGA: Deal only with VGA class devices

2023-06-16 Thread Alex Deucher
On Fri, Jun 16, 2023 at 3:11 AM Sui Jingfeng wrote: > > Hi, > > On 2023/6/16 05:11, Alex Deucher wrote: > > On Wed, Jun 14, 2023 at 6:50 AM Sui Jingfeng > > wrote: > >> Hi, > >> > >> On 2023/6/13 11:01, Sui Jingfeng wrote: > >>> From: Sui Jingfeng > >>> > >>> Deal only with the VGA

[PATCH] drm/amdgpu: Modify for_each_inst macro

2023-06-16 Thread Lijo Lazar
Modify it such that it doesn't change the instance mask parameter. Signed-off-by: Lijo Lazar --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index

[PATCH AUTOSEL 5.15 12/16] drm/radeon: fix race condition UAF in radeon_gem_set_domain_ioctl

2023-06-16 Thread Sasha Levin
From: Min Li [ Upstream commit 982b173a6c6d9472730c3116051977e05d17c8c5 ] Userspace can race to free the gobj(robj converted from), robj should not be accessed again after drm_gem_object_put, otherwith it will result in use-after-free. Reviewed-by: Christian König Signed-off-by: Min Li

[PATCH AUTOSEL 5.10 11/14] drm/radeon: fix race condition UAF in radeon_gem_set_domain_ioctl

2023-06-16 Thread Sasha Levin
From: Min Li [ Upstream commit 982b173a6c6d9472730c3116051977e05d17c8c5 ] Userspace can race to free the gobj(robj converted from), robj should not be accessed again after drm_gem_object_put, otherwith it will result in use-after-free. Reviewed-by: Christian König Signed-off-by: Min Li

[PATCH AUTOSEL 6.3 25/30] drm/radeon: fix race condition UAF in radeon_gem_set_domain_ioctl

2023-06-16 Thread Sasha Levin
From: Min Li [ Upstream commit 982b173a6c6d9472730c3116051977e05d17c8c5 ] Userspace can race to free the gobj(robj converted from), robj should not be accessed again after drm_gem_object_put, otherwith it will result in use-after-free. Reviewed-by: Christian König Signed-off-by: Min Li

Re: [PATCH] drm/amdgpu: enable mcbp by default on gfx9 chips

2023-06-16 Thread Alex Deucher
On Fri, Jun 16, 2023 at 1:07 AM wrote: > > From: Jiadong Zhu > > Gfx9 is using software rings which would trigger mcbp in some cases. > Thus the parameter amdgpu_mcbp shall be enabled by default. > > Signed-off-by: Jiadong Zhu > --- > drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 1 + > 1 file

Re: [PATCH] drm/amdgpu: fix clearing mappings for BOs that are always valid in VM

2023-06-16 Thread Christian König
Am 16.06.23 um 08:27 schrieb Samuel Pitoiset: If the BO has been moved the PT should be updated, otherwise the VAs might point to invalid PT. You might want to update this sentence a bit. Something like: Per VM BOs must be marked as moved or otherwise their ranges are not updated on use

Re: [PATCH v2] drm/amdgpu: fix clearing mappings for BOs that are always valid in VM

2023-06-16 Thread Alex Deucher
Applied. Thanks! Alex On Fri, Jun 16, 2023 at 9:38 AM Samuel Pitoiset wrote: > > Per VM BOs must be marked as moved or otherwise their ranges are not > updated on use which might be necessary when the replace operation > splits mappings. > > This fixes random GPU hangs when replacing sparse

[PATCH AUTOSEL 6.1 22/26] drm/radeon: fix race condition UAF in radeon_gem_set_domain_ioctl

2023-06-16 Thread Sasha Levin
From: Min Li [ Upstream commit 982b173a6c6d9472730c3116051977e05d17c8c5 ] Userspace can race to free the gobj(robj converted from), robj should not be accessed again after drm_gem_object_put, otherwith it will result in use-after-free. Reviewed-by: Christian König Signed-off-by: Min Li

Re: [PATCH] drm/amdgpu: Add missing MODULE_FIRMWARE macro

2023-06-16 Thread Alex Deucher
On Fri, Jun 16, 2023 at 8:11 AM Juerg Haefliger wrote: > > Add the missing MODULE_FIRMWARE macro for "amdgpu/fiji_smc.bin". > > Signed-off-by: Juerg Haefliger > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git

[PATCH AUTOSEL 5.4 7/8] drm/radeon: fix race condition UAF in radeon_gem_set_domain_ioctl

2023-06-16 Thread Sasha Levin
From: Min Li [ Upstream commit 982b173a6c6d9472730c3116051977e05d17c8c5 ] Userspace can race to free the gobj(robj converted from), robj should not be accessed again after drm_gem_object_put, otherwith it will result in use-after-free. Reviewed-by: Christian König Signed-off-by: Min Li

[PATCH AUTOSEL 4.14 4/5] drm/radeon: fix race condition UAF in radeon_gem_set_domain_ioctl

2023-06-16 Thread Sasha Levin
From: Min Li [ Upstream commit 982b173a6c6d9472730c3116051977e05d17c8c5 ] Userspace can race to free the gobj(robj converted from), robj should not be accessed again after drm_gem_object_put, otherwith it will result in use-after-free. Reviewed-by: Christian König Signed-off-by: Min Li

[PATCH AUTOSEL 4.19 5/6] drm/radeon: fix race condition UAF in radeon_gem_set_domain_ioctl

2023-06-16 Thread Sasha Levin
From: Min Li [ Upstream commit 982b173a6c6d9472730c3116051977e05d17c8c5 ] Userspace can race to free the gobj(robj converted from), robj should not be accessed again after drm_gem_object_put, otherwith it will result in use-after-free. Reviewed-by: Christian König Signed-off-by: Min Li

[PATCH] drm/amdgpu: Add missing MODULE_FIRMWARE macro

2023-06-16 Thread Juerg Haefliger
Add the missing MODULE_FIRMWARE macro for "amdgpu/fiji_smc.bin". Signed-off-by: Juerg Haefliger --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index

Re: [PATCH v7 2/8] PCI/VGA: Deal only with VGA class devices

2023-06-16 Thread Sui Jingfeng
On 2023/6/16 21:41, Alex Deucher wrote: On Fri, Jun 16, 2023 at 3:11 AM Sui Jingfeng wrote: Hi, On 2023/6/16 05:11, Alex Deucher wrote: On Wed, Jun 14, 2023 at 6:50 AM Sui Jingfeng wrote: Hi, On 2023/6/13 11:01, Sui Jingfeng wrote: From: Sui Jingfeng Deal only with the VGA

Re: [PATCH] drm/amdgpu: Modify for_each_inst macro

2023-06-16 Thread Felix Kuehling
Am 2023-06-16 um 06:23 schrieb Lijo Lazar: Modify it such that it doesn't change the instance mask parameter. Signed-off-by: Lijo Lazar Reviewed-by: Felix Kuehling --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git

Re: [PATCH v7 2/8] PCI/VGA: Deal only with VGA class devices

2023-06-16 Thread Alex Deucher
On Fri, Jun 16, 2023 at 10:22 AM Sui Jingfeng wrote: > > > On 2023/6/16 21:41, Alex Deucher wrote: > > On Fri, Jun 16, 2023 at 3:11 AM Sui Jingfeng > > wrote: > >> Hi, > >> > >> On 2023/6/16 05:11, Alex Deucher wrote: > >>> On Wed, Jun 14, 2023 at 6:50 AM Sui Jingfeng > >>> wrote: > Hi,

Re: [PATCH v7 2/8] PCI/VGA: Deal only with VGA class devices

2023-06-16 Thread Sui Jingfeng
Hi, On 2023/6/16 22:34, Alex Deucher wrote: On Fri, Jun 16, 2023 at 10:22 AM Sui Jingfeng wrote: On 2023/6/16 21:41, Alex Deucher wrote: On Fri, Jun 16, 2023 at 3:11 AM Sui Jingfeng wrote: Hi, On 2023/6/16 05:11, Alex Deucher wrote: On Wed, Jun 14, 2023 at 6:50 AM Sui Jingfeng wrote:

Re: [PATCH] drm/amdgpu: Modify for_each_inst macro

2023-06-16 Thread Lazar, Lijo
[AMD Official Use Only - General] cc: Victor Victor pointed at a shift beyond MSB condition. Will send a v2. Thanks, Lijo From: amd-gfx on behalf of Lijo Lazar Sent: Friday, June 16, 2023 3:53:40 PM To: amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander ;

[pull] amdgpu, amdkfd, radeon, drm, scheduler, UAPI drm-next-6.5

2023-06-16 Thread Alex Deucher
Hi Dave, Daniel, Last few odds and ends for 6.5. Mostly bug fixes. Was waiting on some GPU scheduler changes in drm-misc for a few of the GPU reset fixes in amdgpu. The following changes since commit 901bdf5ea1a836400ee69aa32b04e9c209271ec7: Merge tag 'amd-drm-next-6.5-2023-06-09' of

[PATCH] drm/amdkfd: Enable GWS on GFX9.4.3

2023-06-16 Thread Mukul Joshi
Enable GWS capable queue creation for forward progress gaurantee on GFX 9.4.3. Signed-off-by: Mukul Joshi --- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 1 + .../amd/amdkfd/kfd_process_queue_manager.c| 31 --- 2 files changed, 20 insertions(+), 12 deletions(-) diff

[PATCH] drm/amdkfd: Use KIQ to unmap HIQ

2023-06-16 Thread Mukul Joshi
Currently, we unmap HIQ by directly writing to HQD registers. This doesn't work for GFX9.4.3. Instead, use KIQ to unmap HIQ, similar to how we use KIQ to map HIQ. Using KIQ to unmap HIQ works for all GFX series post GFXv9. Signed-off-by: Mukul Joshi ---

[PATCHv2] drm/amdkfd: Enable GWS on GFX9.4.3

2023-06-16 Thread Mukul Joshi
Enable GWS capable queue creation for forward progress gaurantee on GFX 9.4.3. Signed-off-by: Mukul Joshi --- v1->v2: - Update the condition for setting pqn->q->gws for GFX 9.4.3. drivers/gpu/drm/amd/amdkfd/kfd_device.c | 1 + .../amd/amdkfd/kfd_process_queue_manager.c| 35

Re: [PATCH] drm/amdkfd: Enable GWS on GFX9.4.3

2023-06-16 Thread Felix Kuehling
On 2023-06-16 13:59, Mukul Joshi wrote: Enable GWS capable queue creation for forward progress gaurantee on GFX 9.4.3. Signed-off-by: Mukul Joshi --- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 1 + .../amd/amdkfd/kfd_process_queue_manager.c| 31 --- 2 files

Re: [PATCH] drm/amdkfd: Use KIQ to unmap HIQ

2023-06-16 Thread Felix Kuehling
On 2023-06-16 14:00, Mukul Joshi wrote: Currently, we unmap HIQ by directly writing to HQD registers. This doesn't work for GFX9.4.3. Instead, use KIQ to unmap HIQ, similar to how we use KIQ to map HIQ. Using KIQ to unmap HIQ works for all GFX series post GFXv9. Signed-off-by: Mukul Joshi

[PATCH 1/2] drm/amdgpu: make mcbp a per device setting

2023-06-16 Thread Alex Deucher
So we can selectively enable it on certain devices. No intended functional change. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 19 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h| 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c| 4 ++--

[PATCH 2/2] drm/amdgpu: enable mcbp by default on gfx9

2023-06-16 Thread Alex Deucher
It's required for high priority queues. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2535 Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 5 + drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c| 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff

Re: [PATCHv2] drm/amdkfd: Enable GWS on GFX9.4.3

2023-06-16 Thread Felix Kuehling
On 2023-06-16 14:44, Mukul Joshi wrote: Enable GWS capable queue creation for forward progress gaurantee on GFX 9.4.3. Signed-off-by: Mukul Joshi Reviewed-by: Felix Kuehling --- v1->v2: - Update the condition for setting pqn->q->gws for GFX 9.4.3.