Re: [PATCH v3 0/8] Support DEVICE_GENERIC memory in migrate_vma_*

2021-07-16 Thread Felix Kuehling
Am 2021-07-16 um 11:07 a.m. schrieb Theodore Y. Ts'o: > On Wed, Jun 23, 2021 at 05:49:55PM -0400, Felix Kuehling wrote: >> I can think of two ways to test the changes for MEMORY_DEVICE_GENERIC in >> this patch series in a way that is reproducible without special hardware and >> firmware: >> >> For

Re: [PATCH] drm/amd/pm: Fix a bug communicating with the SMU (v3)

2021-07-16 Thread Luben Tuikov
On 2021-07-16 4:29 p.m., Alex Deucher wrote: On Wed, Jul 14, 2021 at 1:58 PM Luben Tuikov wrote: This fixes a bug which if we probe a non-existing I2C device, and the SMU returns 0xFF, from then on we can never communicate with the SMU, because the

[PATCH 2/3] drm/amdkfd: report xgmi bandwidth between direct peers to the kfd

2021-07-16 Thread Jonathan Kim
Report the min/max bandwidth in megabytes to the kfd for direct xgmi connections only. v2: change reporting from num links to bandwidth Signed-off-by: Jonathan Kim --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 23 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h | 1 +

[PATCH 3/3] drm/amdkfd: report pcie bandwidth to the kfd

2021-07-16 Thread Jonathan Kim
Similar to xGMI reporting the min/max bandwidth between direct peers, PCIe will report the min/max bandwidth to the KFD. v2: change to bandwidth Signed-off-by: Jonathan Kim --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 61 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h |

[PATCH 1/3] drm/amdgpu: add psp command to get num xgmi links between direct peers

2021-07-16 Thread Jonathan Kim
The TA can now be invoked to provide the number of xgmi links connecting a direct source and destination peer. Non-direct peers will report zero links. Signed-off-by: Jonathan Kim --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 23 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h |

Re: [PATCH] drm/amd/pm: Fix a bug communicating with the SMU (v3)

2021-07-16 Thread Alex Deucher
On Wed, Jul 14, 2021 at 1:58 PM Luben Tuikov wrote: > > This fixes a bug which if we probe a non-existing > I2C device, and the SMU returns 0xFF, from then on > we can never communicate with the SMU, because the > code before this patch reads and interprets 0xFF > as a terminal error, and thus we

Re: [PATCH 5/5] drm/amdkfd: Fix a concurrency issue during kfd recovery

2021-07-16 Thread Felix Kuehling
Patches 3 and 5 are Reviewed-by: Felix Kuehling Am 2021-07-16 um 11:36 a.m. schrieb Oak Zeng: > start_cpsch and stop_cpsch can be called during kfd device > initialization or during gpu reset/recovery. So they can > run concurrently. Currently in start_cpsch and stop_cpsch, > pm_init and

[PATCH 4/5] drm/amdkfd: Set priv_queue to NULL after it is freed

2021-07-16 Thread Oak Zeng
This variable will be used to determine whether packet manager is initialized or not, in a future patch. Signed-off-by: Oak Zeng Acked-by: Christian Konig Reviewed-by: Felix Kuehling --- drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH 0/5] MISC fixes

2021-07-16 Thread Oak Zeng
Oak Zeng (5): drm/amdgpu: Fix a printing message drm/amdgpu: Change a few function names drm/amdkfd: Renaming dqm->packets to dqm->packet_mgr drm/amdkfd: Set priv_queue to NULL after it is freed drm/amdkfd: Fix a concurrency issue during kfd recovery

[PATCH 1/5] drm/amdgpu: Fix a printing message

2021-07-16 Thread Oak Zeng
The printing message "PSP loading VCN firmware" is mis-leading because people might think driver is loading VCN firmware. Actually when this message is printed, driver is just preparing some VCN ucode, not loading VCN firmware yet. The actual VCN firmware loading will be in the PSP block hw_init.

[PATCH 2/5] drm/amdgpu: Change a few function names

2021-07-16 Thread Oak Zeng
Function name "psp_np_fw_load" is not proper as people don't know _np_fw_ means "non psp firmware". Change the function name to psp_load_non_psp_fw for better understanding. Same thing for function psp_execute_np_fw_load. Signed-off-by: Oak Zeng Reviewed-by: Alex Deucher Reviewed-by: Christian

[PATCH 5/5] drm/amdkfd: Fix a concurrency issue during kfd recovery

2021-07-16 Thread Oak Zeng
start_cpsch and stop_cpsch can be called during kfd device initialization or during gpu reset/recovery. So they can run concurrently. Currently in start_cpsch and stop_cpsch, pm_init and pm_uninit is not protected by the dpm lock. Imagine such a case that user use packet manager's function to

[PATCH 3/5] drm/amdkfd: Renaming dqm->packets to dqm->packet_mgr

2021-07-16 Thread Oak Zeng
Renaming packets to packet_mgr to reflect the real meaning of this variable. Signed-off-by: Oak Zeng Acked-by: Christian Konig --- drivers/gpu/drm/amd/amdkfd/kfd_device.c| 2 +- .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 26 +++---

Re: [PATCH 5/5] drm/amdkfd: Fix a concurrency issue during kfd recovery

2021-07-16 Thread Felix Kuehling
Am 2021-07-15 um 9:34 p.m. schrieb Oak Zeng: > start_cpsch and stop_cpsch can be called during kfd device > initialization or during gpu reset/recovery. So they can > run concurrently. Currently in start_cpsch and stop_cpsch, > pm_init and pm_uninit is not protected by the dpm lock. > Imagine

Re: [PATCH 4/5] drm/amdkfd: Set priv_queue to NULL after it is freed

2021-07-16 Thread Felix Kuehling
Am 2021-07-15 um 9:34 p.m. schrieb Oak Zeng: > This variable will be used to determine whether packet > manager is initialized or not, in a future patch. > > Signed-off-by: Oak Zeng Reviewed-by: Felix Kuehling > --- > drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c | 1 + > 1 file changed, 1

Re: [PATCH 3/5] drm/amdkfd: Renaming dqm->packets to dqm->dpm

2021-07-16 Thread Felix Kuehling
Am 2021-07-15 um 9:34 p.m. schrieb Oak Zeng: > Renaming packets to dpm (device packet manager) to > reflect the real meaning of this variable. I don't think introducing another new acronym is helpful. Also "dpm" and "dqm" are visually too similar. Other places use "pm" for packet manager. If you

Re: [PATCH 2/5] drm/amdgpu: Change a few function names

2021-07-16 Thread Deucher, Alexander
[Public] Reviewed-by: Alex Deucher From: amd-gfx on behalf of Oak Zeng Sent: Thursday, July 15, 2021 9:25 PM To: amd-gfx@lists.freedesktop.org Cc: Xu, Feifei ; Kuehling, Felix ; Liu, Leo ; Zeng, Oak ; Zhang, Hawking Subject: [PATCH 2/5] drm/amdgpu: Change

Re: [PATCH 1/5] drm/amdgpu: Fix a printing message

2021-07-16 Thread Deucher, Alexander
[Public] Please use dev_info rather than DRM_INFO. Alex From: amd-gfx on behalf of Oak Zeng Sent: Thursday, July 15, 2021 9:25 PM To: amd-gfx@lists.freedesktop.org Cc: Xu, Feifei ; Kuehling, Felix ; Liu, Leo ; Zeng, Oak ; Zhang, Hawking Subject: [PATCH

Re: [PATCH] drm/amd/display: Fix identical code for different branches

2021-07-16 Thread Len Baker
On Sun, Jul 11, 2021 at 10:45:48AM -0700, Joe Perches wrote: > On Sun, 2021-07-11 at 19:24 +0200, Len Baker wrote: > > The branches of the "if" statement are the same. So remove the > > unnecessary if and goto statements. > > > > Addresses-Coverity-ID: 1456916 ("Identical code for different

Re: [PATCH v3 0/8] Support DEVICE_GENERIC memory in migrate_vma_*

2021-07-16 Thread Theodore Y. Ts'o
On Wed, Jun 23, 2021 at 05:49:55PM -0400, Felix Kuehling wrote: > > I can think of two ways to test the changes for MEMORY_DEVICE_GENERIC in > this patch series in a way that is reproducible without special hardware and > firmware: > > For the reference counting changes we could use the dax

Re: [PATCH] drm/amd/display: Fix 10bit 4K display on CIK GPUs

2021-07-16 Thread Alex Deucher
Applied. Thanks! Alex On Thu, Jul 15, 2021 at 3:40 PM Harry Wentland wrote: > > > > On 2021-07-15 3:19 p.m., Mario Kleiner wrote: > > On Thu, Jul 15, 2021 at 6:10 PM Alex Deucher wrote: > >> > >> On Wed, Jul 14, 2021 at 4:15 AM Liviu Dudau wrote: > >>> > >>> Commit 72a7cf0aec0c

Re: [PATCH v3 1/3] drm/amdgpu: split amdgpu_device_access_vram() into two small parts

2021-07-16 Thread Christian König
Am 16.07.21 um 10:23 schrieb Kevin Wang: split amdgpu_device_access_vram() 1. amdgpu_device_mm_access(): using MM_INDEX/MM_DATA to access vram 2. amdgpu_device_aper_access(): using vram aperature to access vram (option) Signed-off-by: Kevin Wang Reviewed-by: Christian König for the series.

[PATCH v3 2/3] drm/amdgpu/ttm: replace duplicate code with exiting function

2021-07-16 Thread Kevin Wang
using exiting function to replace duplicate code blocks in amdgpu_ttm_vram_write(). Signed-off-by: Kevin Wang --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c

[PATCH v3 1/3] drm/amdgpu: split amdgpu_device_access_vram() into two small parts

2021-07-16 Thread Kevin Wang
split amdgpu_device_access_vram() 1. amdgpu_device_mm_access(): using MM_INDEX/MM_DATA to access vram 2. amdgpu_device_aper_access(): using vram aperature to access vram (option) Signed-off-by: Kevin Wang --- drivers/gpu/drm/amd/amdgpu/amdgpu.h| 7 +-

[PATCH v3 3/3] drm/amdgpu/ttm: optimize vram access in amdgpu_ttm_access_memory()

2021-07-16 Thread Kevin Wang
1. using vram aper to access vram if possible 2. avoid MM_INDEX/MM_DATA is not working when mmio protect feature is enabled. Signed-off-by: Kevin Wang --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 84 ++--- 1 file changed, 49 insertions(+), 35 deletions(-) diff --git

Re: [PATCH 1/1] drm/amdgpu: workaround failed COW checks for Thunk VMAs

2021-07-16 Thread Christian König
Am 15.07.21 um 21:05 schrieb Felix Kuehling: KFD Thunk maps invisible VRAM BOs with PROT_NONE, MAP_PRIVATE. is_cow_mapping returns true for these mappings, which causes mmap to fail in ttm_bo_mmap_obj. As a workaround, clear VM_MAYWRITE for PROT_NONE-COW mappings. This should prevent the

Re: misc vgaarb cleanups

2021-07-16 Thread Rodrigo Vivi
On Fri, Jul 16, 2021 at 08:16:27AM +0200, Christoph Hellwig wrote: > Hi all, > > this series cleans up a bunch of lose ends in the vgaarb code. > > Diffstat: > drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 11 +- > drivers/gpu/drm/drm_irq.c |4 >

Re: [PATCH 1/7] vgaarb: remove VGA_DEFAULT_DEVICE

2021-07-16 Thread Christian König
Am 16.07.21 um 08:16 schrieb Christoph Hellwig: The define is entirely unused. Signed-off-by: Christoph Hellwig I'm not an expert for this particular code, but at least of hand everything you do here makes totally sense. Whole series is Acked-by: Christian König Regards, Christian.

Re: [RFC PATCH v2 3/3] drm/amdgpu/ttm: optimize vram access in amdgpu_ttm_access_memory()

2021-07-16 Thread Christian König
Am 16.07.21 um 05:10 schrieb Kevin Wang: 1. using vram aper to access vram if possible 2. avoid MM_INDEX/MM_DATA is not working when mmio protect feature is enabled. Signed-off-by: Kevin Wang --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 91 +++-- 1 file changed, 54

Re: [PATCH 5/5] drm/amdkfd: Fix a concurrency issue during kfd recovery

2021-07-16 Thread Lazar, Lijo
On 7/16/2021 7:04 AM, Oak Zeng wrote: start_cpsch and stop_cpsch can be called during kfd device initialization or during gpu reset/recovery. So they can run concurrently. Currently in start_cpsch and stop_cpsch, pm_init and pm_uninit is not protected by the dpm lock. Imagine such a case that

Re: [PATCH 1/5] drm/amdgpu: Fix a printing message

2021-07-16 Thread Christian König
Am 16.07.21 um 03:34 schrieb Oak Zeng: The printing message "PSP loading VCN firmware" is mis-leading because people might think driver is loading VCN firmware. Actually when this message is printed, driver is just preparing some VCN ucode, not loading VCN firmware yet. The actual VCN firmware

[PATCH 7/7] vgaarb: don't pass a cookie to vga_client_register

2021-07-16 Thread Christoph Hellwig
The VGA arbitration is entirely based on pci_dev structures, so just pass that back to the set_vga_decode callback. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 9 drivers/gpu/drm/i915/display/intel_vga.c | 7 ---

[PATCH 5/7] vgaarb: provide a vga_client_unregister wrapper

2021-07-16 Thread Christoph Hellwig
Add a trivial wrapper for the unregister case that sets all fields to NULL. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +- drivers/gpu/drm/drm_irq.c | 4 ++-- drivers/gpu/drm/i915/display/intel_vga.c | 2 +-

[PATCH 4/7] vgaarb: cleanup vgaarb.h

2021-07-16 Thread Christoph Hellwig
Merge the different CONFIG_VGA_ARB ifdef blocks, remove superflous externs, and regularize the stubs for !CONFIG_VGA_ARB. Signed-off-by: Christoph Hellwig --- include/linux/vgaarb.h | 90 -- 1 file changed, 42 insertions(+), 48 deletions(-) diff --git

[PATCH 1/7] vgaarb: remove VGA_DEFAULT_DEVICE

2021-07-16 Thread Christoph Hellwig
The define is entirely unused. Signed-off-by: Christoph Hellwig --- include/linux/vgaarb.h | 6 -- 1 file changed, 6 deletions(-) diff --git a/include/linux/vgaarb.h b/include/linux/vgaarb.h index dc6ddce92066..26ec8a057d2a 100644 --- a/include/linux/vgaarb.h +++ b/include/linux/vgaarb.h

misc vgaarb cleanups

2021-07-16 Thread Christoph Hellwig
Hi all, this series cleans up a bunch of lose ends in the vgaarb code. Diffstat: drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 11 +- drivers/gpu/drm/drm_irq.c |4 drivers/gpu/drm/i915/display/intel_vga.c |9 +- drivers/gpu/drm/nouveau/nouveau_vga.c |8 -

[PATCH 6/7] vgaarb: remove the unused irq_set_state argument to vga_client_register

2021-07-16 Thread Christoph Hellwig
All callers pass NULL as the irq_set_state argument, so remove it and the ->irq_set_state member in struct vga_device. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +- drivers/gpu/drm/i915/display/intel_vga.c | 2 +-

[PATCH 3/7] vgaarb: move the kerneldoc for vga_set_legacy_decoding to vgaarb.c

2021-07-16 Thread Christoph Hellwig
Kerneldoc comments should be at the implementation side, not in the header just declaring the prototype. Signed-off-by: Christoph Hellwig --- drivers/gpu/vga/vgaarb.c | 11 +++ include/linux/vgaarb.h | 13 - 2 files changed, 11 insertions(+), 13 deletions(-) diff --git

[PATCH 2/7] vgaarb: remove vga_conflicts

2021-07-16 Thread Christoph Hellwig
vga_conflicts only has a single caller and none of the arch overrides mentioned in the comment. Just remove it and the thus dead check in the caller. Signed-off-by: Christoph Hellwig --- drivers/gpu/vga/vgaarb.c | 6 -- include/linux/vgaarb.h | 12 2 files changed, 18

[RFC PATCH v2 2/3] drm/amdgpu/ttm: replace duplicate code with exiting function

2021-07-16 Thread Kevin Wang
using exiting function to replace duplicate code blocks in amdgpu_ttm_vram_write(). Signed-off-by: Kevin Wang --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c

[RFC PATCH v2 1/3] drm/amdgpu: split amdgpu_device_access_vram() into two small parts

2021-07-16 Thread Kevin Wang
split amdgpu_device_access_vram() 1. amdgpu_device_mm_access(): using MM_INDEX/MM_DATA to access vram 2. amdgpu_device_aper_access(): using vram aperature to access vram (option) Signed-off-by: Kevin Wang --- drivers/gpu/drm/amd/amdgpu/amdgpu.h| 7 +-

[RFC PATCH v2 3/3] drm/amdgpu/ttm: optimize vram access in amdgpu_ttm_access_memory()

2021-07-16 Thread Kevin Wang
1. using vram aper to access vram if possible 2. avoid MM_INDEX/MM_DATA is not working when mmio protect feature is enabled. Signed-off-by: Kevin Wang --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 91 +++-- 1 file changed, 54 insertions(+), 37 deletions(-) diff --git

RE: [PATCH v2] drm/amd/amdgpu: Recovery vcn instance iterate.

2021-07-16 Thread Zhou, Peng Ju
[AMD Official Use Only] Hi @Liu, Leo Can you help to review this patch? Monk and Alex have reviewed it. -- BW Pengju Zhou > -Original Message- > From: Liu, Monk > Sent: Thursday, July 15, 2021 7:54 AM > To: Alex