[PATCH 1/5] drm/amdgpu/pm: Use scnprintf() for avoiding potential buffer overflow

2020-03-11 Thread Takashi Iwai
Since snprintf() returns the would-be-output size instead of the actual output size, the succeeding calls may go beyond the given buffer limit. Fix it by replacing with scnprintf(). Also adjust the size argument passed to scnprintf() so that it really cuts off at the right remaining buffer length

Re: [PATCH 1/5] drm/amdgpu/pm: Use scnprintf() for avoiding potential buffer overflow

2020-03-11 Thread Takashi Iwai
BTW, please ignore the subject prefix '[1/5]', which was added mistakenly while extracting a patch from the commit list. This is a single patch. thanks, Takashi On Wed, 11 Mar 2020 08:29:04 +0100, Takashi Iwai wrote: > > Since snprintf() returns the would-be-output size instead of the > actual

RE: [PATCH] drm/amdgpu: use amdgpu_ras.h in amdgpu_debugfs.c

2020-03-11 Thread Chen, Guchun
[AMD Public Use] Reviewed-by: Guchun Chen Regards, Guchun -Original Message- From: Stanley.Yang Sent: Wednesday, March 11, 2020 2:38 PM To: amd-gfx@lists.freedesktop.org Cc: Zhang, Hawking ; Chen, Guchun ; Li, Dennis ; Clements, John ; Yang, Stanley Subject: [PATCH] drm/amdgpu: us

[PATCH] drm/amdgpu: add fbdev suspend/resume on gpu reset

2020-03-11 Thread Evan Quan
This can fix the baco reset failure seen on Navi10. And this should be a low risk fix as the same sequence is already used for system suspend/resume. Change-Id: Idb4d02c5fcbbd5b7817195ee04c7af34c346a053 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 1 file chan

[PATCH -next 000/491] treewide: use fallthrough;

2020-03-11 Thread Joe Perches
There is a new fallthrough pseudo-keyword macro that can be used to replace the various /* fallthrough */ style comments that are used to indicate a case label code block is intended to fallthrough to the next case label block. See commit 294f69e662d1 ("compiler_attributes.h: Add 'fallthrough' pse

[PATCH -next 024/491] AMD DISPLAY CORE: Use fallthrough;

2020-03-11 Thread Joe Perches
Convert the various uses of fallthrough comments to fallthrough; Done via script Link: https://lore.kernel.org/lkml/b56602fcf79f849e733e7b521bb0e17895d390fa.1582230379.git.joe.com/ Signed-off-by: Joe Perches --- drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c | 4 ++-- drivers/gpu/drm/amd/d

[PATCH -next 023/491] AMD KFD: Use fallthrough;

2020-03-11 Thread Joe Perches
Convert the various uses of fallthrough comments to fallthrough; Done via script Link: https://lore.kernel.org/lkml/b56602fcf79f849e733e7b521bb0e17895d390fa.1582230379.git.joe.com/ Signed-off-by: Joe Perches --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_arcturus.c | 2 +- 1 file changed, 1 inse

[PATCH -next 025/491] AMD POWERPLAY: Use fallthrough;

2020-03-11 Thread Joe Perches
Convert the various uses of fallthrough comments to fallthrough; Done via script Link: https://lore.kernel.org/lkml/b56602fcf79f849e733e7b521bb0e17895d390fa.1582230379.git.joe.com/ Signed-off-by: Joe Perches --- drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 6 +++--- 1 file changed, 3 ins

[PATCH] drm/amdgpu: reenable runtime pm on navi12

2020-03-11 Thread Evan Quan
The runtime pm is verified as working now on navi12. Change-Id: I20393633678297308c9651237bbfdc854a3cff94 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/

Re: [PATCH v3 1/4] drm/amdgpu/vcn: fix race condition issue for vcn start

2020-03-11 Thread Zhu, James
[AMD Official Use Only - Internal Distribution Only] ping From: Zhu, James Sent: Monday, March 9, 2020 12:57 PM To: amd-gfx@lists.freedesktop.org Cc: Zhu, James ; Koenig, Christian Subject: [PATCH v3 1/4] drm/amdgpu/vcn: fix race condition issue for vcn start

Re: [PATCH v3 1/4] drm/amdgpu/vcn: fix race condition issue for vcn start

2020-03-11 Thread Christian König
Am 11.03.20 um 12:30 schrieb Zhu, James: [AMD Official Use Only - Internal Distribution Only] ping *From:* Zhu, James *Sent:* Monday, March 9, 2020 12:57 PM *To:* amd-gfx@lists.freedesktop.org *Cc:* Zhu, James ; Koenig

Re: [PATCH] drm/amdgpu: add fbdev suspend/resume on gpu reset

2020-03-11 Thread Deucher, Alexander
[AMD Public Use] Reviewed-by: Alex Deucher From: amd-gfx on behalf of Evan Quan Sent: Wednesday, March 11, 2020 4:18 AM To: amd-gfx@lists.freedesktop.org Cc: Quan, Evan Subject: [PATCH] drm/amdgpu: add fbdev suspend/resume on gpu reset This can fix the baco

Re: [PATCH] drm/amdgpu: reenable runtime pm on navi12

2020-03-11 Thread Deucher, Alexander
[AMD Public Use] Reviewed-by: Alex Deucher From: Quan, Evan Sent: Wednesday, March 11, 2020 6:56 AM To: amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander ; Quan, Evan Subject: [PATCH] drm/amdgpu: reenable runtime pm on navi12 The runtime pm is verified as

Re: [PATCH] drm/amdgpu: add fbdev suspend/resume on gpu reset

2020-03-11 Thread Yuan, Xiaojie
[AMD Official Use Only - Internal Distribution Only] Hi Evan, Does this patch also fix the baco failure on Navi14 with display connected? BR, Xiaojie From: amd-gfx on behalf of Evan Quan Sent: Wednesday, March 11, 2020 4:18 PM To: amd-gfx@lists.freede

Re: [PATCH v3 1/4] drm/amdgpu/vcn: fix race condition issue for vcn start

2020-03-11 Thread James Zhu
On 2020-03-11 7:38 a.m., Christian König wrote: Am 11.03.20 um 12:30 schrieb Zhu, James: [AMD Official Use Only - Internal Distribution Only] ping *From:* Zhu, James *Sent:* Monday, March 9, 2020 12:57 PM *To:* amd-gf

[PATCH v4 1/4] drm/amdgpu/vcn: fix race condition issue for vcn start

2020-03-11 Thread James Zhu
Fix race condition issue when multiple vcn starts are called. v2: Removed checking the return value of cancel_delayed_work_sync() to prevent possible races here. v3: Add total_submission_cnt to avoid gate power unexpectedly. v4: Remove extra counter check, and reduce counter before idle work sch

[PATCH v4 2/4] drm/amdgpu/vcn: fix race condition issue for dpg unpause mode switch

2020-03-11 Thread James Zhu
Couldn't only rely on enc fence to decide switching to dpg unpaude mode. Since a enc thread may not schedule a fence in time during multiple threads running situation. v3: 1. Rename enc_submission_cnt to dpg_enc_submission_cnt 2. Add dpg_enc_submission_cnt check in idle_work_handler v4: Remo

Re: [PATCH v4 1/4] drm/amdgpu/vcn: fix race condition issue for vcn start

2020-03-11 Thread Christian König
Am 11.03.20 um 15:15 schrieb James Zhu: Fix race condition issue when multiple vcn starts are called. v2: Removed checking the return value of cancel_delayed_work_sync() to prevent possible races here. v3: Add total_submission_cnt to avoid gate power unexpectedly. v4: Remove extra counter chec

[PATCH v5 1/4] drm/amdgpu/vcn: fix race condition issue for vcn start

2020-03-11 Thread James Zhu
Fix race condition issue when multiple vcn starts are called. v2: Removed checking the return value of cancel_delayed_work_sync() to prevent possible races here. v3: Add total_submission_cnt to avoid gate power unexpectedly. v4: Remove extra counter check, and reduce counter before idle work sch

Re: [PATCH v5 1/4] drm/amdgpu/vcn: fix race condition issue for vcn start

2020-03-11 Thread Christian König
Am 11.03.20 um 16:04 schrieb James Zhu: Fix race condition issue when multiple vcn starts are called. v2: Removed checking the return value of cancel_delayed_work_sync() to prevent possible races here. v3: Add total_submission_cnt to avoid gate power unexpectedly. v4: Remove extra counter chec

Re: [PATCH] drm/amd/amdgpu: Fix GPR read from debugfs

2020-03-11 Thread Alex Deucher
On Tue, Mar 10, 2020 at 8:53 AM Tom St Denis wrote: > > The offset into the array was specified in bytes but should > be in terms of 32-bit words. Also prevent large reads that > would also cause a buffer overread. > > Signed-off-by: Tom St Denis > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_debugf

Re: [PATCH] drm/amd/amdgpu: Fix GPR read from debugfs

2020-03-11 Thread Tom St Denis
On 2020-03-11 11:16 a.m., Alex Deucher wrote: On Tue, Mar 10, 2020 at 8:53 AM Tom St Denis wrote: The offset into the array was specified in bytes but should be in terms of 32-bit words. Also prevent large reads that would also cause a buffer overread. Signed-off-by: Tom St Denis --- dri

[RFC PATCH 2/2] drm/amdgpu: disable gpu load balancer for vcn jobs

2020-03-11 Thread Nirmoy Das
VCN HW doesn't support dynamic load balance on multiple instances for a context. This modifies the entity's sched_list to a sched_list consist of only one drm scheduler. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 25 ++

[RFC PATCH 1/2] drm/sched: implement drm_sched_entity_num_jobs

2020-03-11 Thread Nirmoy Das
Implement drm_sched_entity_num_jobs() so that drm drivers can query number of jobs in an entity. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/scheduler/sched_entity.c | 15 +++ include/drm/gpu_scheduler.h | 1 + 2 files changed, 16 insertions(+) diff --git a/drivers/g

Re: [RFC PATCH 1/2] drm/sched: implement drm_sched_entity_num_jobs

2020-03-11 Thread Andrey Grodzovsky
On 3/11/20 1:18 PM, Nirmoy Das wrote: Implement drm_sched_entity_num_jobs() so that drm drivers can query number of jobs in an entity. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/scheduler/sched_entity.c | 15 +++ include/drm/gpu_scheduler.h | 1 + 2 files chan

Re: [RFC PATCH 1/2] drm/sched: implement drm_sched_entity_num_jobs

2020-03-11 Thread Nirmoy
On 3/11/20 6:23 PM, Andrey Grodzovsky wrote: On 3/11/20 1:18 PM, Nirmoy Das wrote: Implement drm_sched_entity_num_jobs() so that drm drivers can query number of jobs in an entity. Signed-off-by: Nirmoy Das ---   drivers/gpu/drm/scheduler/sched_entity.c | 15 +++   include/drm/gpu_

Re: [RFC PATCH 1/2] drm/sched: implement drm_sched_entity_num_jobs

2020-03-11 Thread Christian König
Am 11.03.20 um 18:58 schrieb Nirmoy: On 3/11/20 6:23 PM, Andrey Grodzovsky wrote: On 3/11/20 1:18 PM, Nirmoy Das wrote: Implement drm_sched_entity_num_jobs() so that drm drivers can query number of jobs in an entity. Signed-off-by: Nirmoy Das ---   drivers/gpu/drm/scheduler/sched_entity.c |

Re: [RFC PATCH 2/2] drm/amdgpu: disable gpu load balancer for vcn jobs

2020-03-11 Thread Christian König
Am 11.03.20 um 18:18 schrieb Nirmoy Das: VCN HW doesn't support dynamic load balance on multiple instances for a context. This modifies the entity's sched_list to a sched_list consist of only one drm scheduler. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 1 + dr

Re: [RFC PATCH 2/2] drm/amdgpu: disable gpu load balancer for vcn jobs

2020-03-11 Thread Nirmoy
On 3/11/20 7:03 PM, Christian König wrote: Am 11.03.20 um 18:18 schrieb Nirmoy Das: VCN HW  doesn't support dynamic load balance on multiple instances for a context. This modifies the entity's sched_list to a sched_list consist of only one drm scheduler. Signed-off-by: Nirmoy Das ---   driver

[PATCH hmm 0/8] Various error case bug fixes for hmm_range_fault()

2020-03-11 Thread Jason Gunthorpe
From: Jason Gunthorpe The hmm_range_fault() flow is fairly complicated. The scheme allows the caller to specify if it needs a usable result for each page, or if it only needs the current page table status filled in. This mixture of behavior is useful for a caller that wants to build a 'prefetch a

[PATCH hmm 6/8] mm/hmm: reorganize how !pte_present is handled in hmm_vma_handle_pte()

2020-03-11 Thread Jason Gunthorpe
From: Jason Gunthorpe The intention with this code is to determine if the caller required the pages to be valid, and if so, then take some action to make them valid. The action varies depending on the page type. In all cases, if the caller doesn't ask for the page, then hmm_range_fault() should

[PATCH hmm 4/8] mm/hmm: add missing pfns set to hmm_vma_walk_pmd()

2020-03-11 Thread Jason Gunthorpe
From: Jason Gunthorpe All success exit paths from the walker functions must set the pfns array. A migration entry with no required fault is a HMM_PFN_NONE return, just like the pte case. Fixes: d08faca018c4 ("mm/hmm: properly handle migration pmd") Signed-off-by: Jason Gunthorpe --- mm/hmm.c

[PATCH hmm 2/8] mm/hmm: don't free the cached pgmap while scanning

2020-03-11 Thread Jason Gunthorpe
From: Jason Gunthorpe The pgmap is held in the hmm_vma_walk variable in hope of speeding up future get_dev_pagemap() calls by hitting the same pointer. The algorithm doesn't actually care about how long the pgmap is held for. Move the put of the cached pgmap to after the walk is completed and de

[PATCH hmm 5/8] mm/hmm: add missing call to hmm_range_need_fault() before returning EFAULT

2020-03-11 Thread Jason Gunthorpe
From: Jason Gunthorpe All return paths that do EFAULT must call hmm_range_need_fault() to determine if the user requires this page to be valid. If the page cannot be made valid if the user later requires it, due to vma flags in this case, then the return should be HMM_PFN_ERROR. Fixes: a3e0d41c

[PATCH hmm 8/8] mm/hmm: add missing call to hmm_pte_need_fault in HMM_PFN_SPECIAL handling

2020-03-11 Thread Jason Gunthorpe
From: Jason Gunthorpe Currently if a special PTE is encountered hmm_range_fault() immediately returns EFAULT and sets the HMM_PFN_SPECIAL error output (which nothing uses). EFAULT should only be returned after testing with hmm_pte_need_fault(). Also pte_devmap() and pte_special() are exclusive,

[PATCH hmm 3/8] mm/hmm: do not call hmm_vma_walk_hole() while holding a spinlock

2020-03-11 Thread Jason Gunthorpe
From: Jason Gunthorpe This eventually calls into handle_mm_fault() which is a sleeping function. Release the lock first. hmm_vma_walk_hole() does not touch the contents of the PUD, so it does not need the lock. Fixes: 3afc423632a1 ("mm: pagewalk: add p4d_entry() and pgd_entry()") Cc: Steven Pri

[PATCH hmm 1/8] mm/hmm: add missing unmaps of the ptep during hmm_vma_handle_pte()

2020-03-11 Thread Jason Gunthorpe
From: Jason Gunthorpe Many of the direct returns of error skipped doing the pte_unmap(). All non zero exit paths must unmap the pte. The pte_unmap() is split unnaturally like this because some of the error exit paths trigger a sleep and must release the lock before sleeping. Fixes: 992de9a8b751

[PATCH hmm 7/8] mm/hmm: return -EFAULT when setting HMM_PFN_ERROR on requested valid pages

2020-03-11 Thread Jason Gunthorpe
From: Jason Gunthorpe hmm_range_fault() should never return 0 if the caller requested a valid page, but the pfns output for that page would be HMM_PFN_ERROR. hmm_pte_need_fault() must always be called before setting HMM_PFN_ERROR to detect if the page is in faulting mode or not. Fix two cases i

[PATCH 1/1] drm/amdgpu: disable gpu_sched load balancer for vcn jobs

2020-03-11 Thread Nirmoy Das
VCN HW doesn't support dynamic load balance on multiple instances for a context. This patch modifies entity's sched_list to a sched_list consist of only one drm scheduler. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c

[PATCH 1/1] drm/amdgpu: disable gpu_sched load balancer for vcn jobs

2020-03-11 Thread Nirmoy Das
VCN HW doesn't support dynamic load balance on multiple instances for a context. This patch modifies entity's sched_list to a sched_list consist of only one drm scheduler. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c

Re: [PATCH 1/1] drm/amdgpu: disable gpu_sched load balancer for vcn jobs

2020-03-11 Thread Andrey Grodzovsky
On 3/11/20 4:00 PM, Nirmoy Das wrote: VCN HW doesn't support dynamic load balance on multiple instances for a context. This patch modifies entity's sched_list to a sched_list consist of only one drm scheduler. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4

Re: [PATCH 1/1] drm/amdgpu: disable gpu_sched load balancer for vcn jobs

2020-03-11 Thread Andrey Grodzovsky
On 3/11/20 4:00 PM, Andrey Grodzovsky wrote: On 3/11/20 4:00 PM, Nirmoy Das wrote: VCN HW  doesn't support dynamic load balance on multiple instances for a context. This patch modifies entity's sched_list to a sched_list consist of only one drm scheduler. Signed-off-by: Nirmoy Das ---   driv

Re: [PATCH 1/1] drm/amdgpu: disable gpu_sched load balancer for vcn jobs

2020-03-11 Thread James Zhu
On 2020-03-11 4:00 p.m., Nirmoy Das wrote: VCN HW doesn't support dynamic load balance on multiple instances for a context. This patch modifies entity's sched_list to a sched_list consist of only one drm scheduler. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4

Re: [PATCH 1/1] drm/amdgpu: disable gpu_sched load balancer for vcn jobs

2020-03-11 Thread Nirmoy
On 3/11/20 9:02 PM, Andrey Grodzovsky wrote: On 3/11/20 4:00 PM, Andrey Grodzovsky wrote: On 3/11/20 4:00 PM, Nirmoy Das wrote: VCN HW  doesn't support dynamic load balance on multiple instances for a context. This patch modifies entity's sched_list to a sched_list consist of only one drm sc

Re: [PATCH 1/1] drm/amdgpu: disable gpu_sched load balancer for vcn jobs

2020-03-11 Thread Nirmoy
On 3/11/20 9:14 PM, James Zhu wrote: On 2020-03-11 4:00 p.m., Nirmoy Das wrote: VCN HW  doesn't support dynamic load balance on multiple instances for a context. This patch modifies entity's sched_list to a sched_list consist of only one drm scheduler. Signed-off-by: Nirmoy Das ---   drivers

[PATCH] drm/amd/amdgpu: Fix GPR read from debugfs (v2)

2020-03-11 Thread Tom St Denis
The offset into the array was specified in bytes but should be in terms of 32-bit words. Also prevent large reads that would also cause a buffer overread. v2: Read from correct offset from internal storage buffer. Signed-off-by: Tom St Denis Acked-by: Christian König --- drivers/gpu/drm/amd/

Re: [PATCH] drm/amd/amdgpu: Fix GPR read from debugfs

2020-03-11 Thread Tom St Denis
Hi Alex, I sent out a v2 of the patch to the list that also addresses the fact we were reading from the wrong offset from the internal buffer. This entry was really only tested with offset==0 which is why this didn't come up until now that people want those trap registers :-) Tom On 2020-0

Re: [PATCH 1/1] drm/amdgpu: disable gpu_sched load balancer for vcn jobs

2020-03-11 Thread Andrey Grodzovsky
On 3/11/20 4:32 PM, Nirmoy wrote: On 3/11/20 9:02 PM, Andrey Grodzovsky wrote: On 3/11/20 4:00 PM, Andrey Grodzovsky wrote: On 3/11/20 4:00 PM, Nirmoy Das wrote: VCN HW  doesn't support dynamic load balance on multiple instances for a context. This patch modifies entity's sched_list to a s

[PATCH v5 2/4] drm/amdgpu/vcn: fix race condition issue for dpg unpause mode switch

2020-03-11 Thread James Zhu
Couldn't only rely on enc fence to decide switching to dpg unpaude mode. Since a enc thread may not schedule a fence in time during multiple threads running situation. v3: 1. Rename enc_submission_cnt to dpg_enc_submission_cnt 2. Add dpg_enc_submission_cnt check in idle_work_handler v4: Remo

[PATCH v5 3/4] drm/amdgpu/vcn2.0: add sync when WPTR/RPTR reset under DPG mode

2020-03-11 Thread James Zhu
Add vcn harware and firmware synchronization to fix race condition issue among vcn driver, hardware and firmware under DPG mode Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/vc

[PATCH v5 1/4] drm/amdgpu/vcn: fix race condition issue for vcn start

2020-03-11 Thread James Zhu
Fix race condition issue when multiple vcn starts are called. v2: Removed checking the return value of cancel_delayed_work_sync() to prevent possible races here. v3: Add total_submission_cnt to avoid gate power unexpectedly. v4: Remove extra counter check, and reduce counter before idle work sch

[PATCH v5 4/4] drm/amdgpu/vcn2.5: add sync when WPTR/RPTR reset under DPG mode

2020-03-11 Thread James Zhu
Add vcn harware and firmware synchronization to fix race condition issue among vcn driver, hardware and firmware under DPG mode. Signed-off-by: James Zhu Reviewed-by: Leo Liu --- drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 16 1 file changed, 16 insertions(+) diff --git a/drivers/

Re: [PATCH 1/1] drm/amdgpu: disable gpu_sched load balancer for vcn jobs

2020-03-11 Thread Nirmoy
On 3/11/20 9:35 PM, Andrey Grodzovsky wrote: On 3/11/20 4:32 PM, Nirmoy wrote: On 3/11/20 9:02 PM, Andrey Grodzovsky wrote: On 3/11/20 4:00 PM, Andrey Grodzovsky wrote: On 3/11/20 4:00 PM, Nirmoy Das wrote: VCN HW  doesn't support dynamic load balance on multiple instances for a context.

Re: [PATCH] drm/amd/amdgpu: Fix GPR read from debugfs (v2)

2020-03-11 Thread Alex Deucher
On Wed, Mar 11, 2020 at 4:33 PM Tom St Denis wrote: > > The offset into the array was specified in bytes but should > be in terms of 32-bit words. Also prevent large reads that > would also cause a buffer overread. > > v2: Read from correct offset from internal storage buffer. > > Signed-off-by:

Re: [PATCH -next 023/491] AMD KFD: Use fallthrough;

2020-03-11 Thread Felix Kuehling
On 2020-03-11 12:51 a.m., Joe Perches wrote: Convert the various uses of fallthrough comments to fallthrough; Done via script Link: https://lore.kernel.org/lkml/b56602fcf79f849e733e7b521bb0e17895d390fa.1582230379.git.joe.com/ The link seems to be broken. This one works: https://lore.kernel.

Re: [PATCH hmm 1/8] mm/hmm: add missing unmaps of the ptep during hmm_vma_handle_pte()

2020-03-11 Thread Ralph Campbell
On 3/11/20 11:34 AM, Jason Gunthorpe wrote: From: Jason Gunthorpe Many of the direct returns of error skipped doing the pte_unmap(). All non zero exit paths must unmap the pte. The pte_unmap() is split unnaturally like this because some of the error exit paths trigger a sleep and must releas

Re: [PATCH -next 023/491] AMD KFD: Use fallthrough;

2020-03-11 Thread Joe Perches
On Wed, 2020-03-11 at 17:50 -0400, Felix Kuehling wrote: > On 2020-03-11 12:51 a.m., Joe Perches wrote: > > Convert the various uses of fallthrough comments to fallthrough; > > > > Done via script > > Link: > > https://lore.kernel.org/lkml/b56602fcf79f849e733e7b521bb0e17895d390fa.1582230379.git.j

Re: [PATCH hmm 6/8] mm/hmm: reorganize how !pte_present is handled in hmm_vma_handle_pte()

2020-03-11 Thread Ralph Campbell
On 3/11/20 11:35 AM, Jason Gunthorpe wrote: From: Jason Gunthorpe The intention with this code is to determine if the caller required the pages to be valid, and if so, then take some action to make them valid. The action varies depending on the page type. In all cases, if the caller doesn't

Re: [PATCH hmm 7/8] mm/hmm: return -EFAULT when setting HMM_PFN_ERROR on requested valid pages

2020-03-11 Thread Ralph Campbell
On 3/11/20 11:35 AM, Jason Gunthorpe wrote: From: Jason Gunthorpe hmm_range_fault() should never return 0 if the caller requested a valid page, but the pfns output for that page would be HMM_PFN_ERROR. hmm_pte_need_fault() must always be called before setting HMM_PFN_ERROR to detect if the p

Re: [PATCH hmm 8/8] mm/hmm: add missing call to hmm_pte_need_fault in HMM_PFN_SPECIAL handling

2020-03-11 Thread Ralph Campbell
On 3/11/20 11:35 AM, Jason Gunthorpe wrote: From: Jason Gunthorpe Currently if a special PTE is encountered hmm_range_fault() immediately returns EFAULT and sets the HMM_PFN_SPECIAL error output (which nothing uses). EFAULT should only be returned after testing with hmm_pte_need_fault(). Al

Re: [PATCH hmm 2/8] mm/hmm: don't free the cached pgmap while scanning

2020-03-11 Thread Ralph Campbell
On 3/11/20 11:35 AM, Jason Gunthorpe wrote: From: Jason Gunthorpe The pgmap is held in the hmm_vma_walk variable in hope of speeding up future get_dev_pagemap() calls by hitting the same pointer. The algorithm doesn't actually care about how long the pgmap is held for. Move the put of the ca

Re: [PATCH hmm 3/8] mm/hmm: do not call hmm_vma_walk_hole() while holding a spinlock

2020-03-11 Thread Ralph Campbell
On 3/11/20 11:35 AM, Jason Gunthorpe wrote: From: Jason Gunthorpe This eventually calls into handle_mm_fault() which is a sleeping function. Release the lock first. hmm_vma_walk_hole() does not touch the contents of the PUD, so it does not need the lock. Fixes: 3afc423632a1 ("mm: pagewalk:

Re: [PATCH hmm 4/8] mm/hmm: add missing pfns set to hmm_vma_walk_pmd()

2020-03-11 Thread Ralph Campbell
On 3/11/20 11:35 AM, Jason Gunthorpe wrote: From: Jason Gunthorpe All success exit paths from the walker functions must set the pfns array. A migration entry with no required fault is a HMM_PFN_NONE return, just like the pte case. Fixes: d08faca018c4 ("mm/hmm: properly handle migration pmd"

Re: [PATCH hmm 5/8] mm/hmm: add missing call to hmm_range_need_fault() before returning EFAULT

2020-03-11 Thread Ralph Campbell
On 3/11/20 11:35 AM, Jason Gunthorpe wrote: From: Jason Gunthorpe All return paths that do EFAULT must call hmm_range_need_fault() to determine if the user requires this page to be valid. If the page cannot be made valid if the user later requires it, due to vma flags in this case, then the

[pull] amdgpu 5.6 fixes

2020-03-11 Thread Alex Deucher
Hi Dave, Daniel, Fixes for 5.6. The following changes since commit 513dc792d6060d5ef572e43852683097a8420f56: vgacon: Fix a UAF in vgacon_invert_region (2020-03-06 21:06:34 +0100) are available in the Git repository at: git://people.freedesktop.org/~agd5f/linux tags/amd-drm-fixes-5.6-2020-0

[PATCH 1/2] drm/amdgpu: update ras support capability with different sram ecc configuration

2020-03-11 Thread Guchun Chen
When sram ecc is disabled by vbios, ras initialization process in the corrresponding IPs that suppport sram ecc needs to be skipped. So update ras support capability accordingly on top of this configuration. This capability will block further ras operations to the unsupported IPs. v2: check HBM EC

[PATCH 2/2] drm/amdgpu: remove mem ecc check for vega20 and arcturus

2020-03-11 Thread Guchun Chen
Memory ecc check including HBM and SRAM has been done in ras init function for vega20 and arcturus. So remove it from gmc module, only keep this check for vega10. Suggested-by: Hawking Zhang Signed-off-by: Guchun Chen --- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 14 +++--- 1 file changed

RE: [PATCH] drm/amdgpu: add fbdev suspend/resume on gpu reset

2020-03-11 Thread Quan, Evan
Have not tried Navi14 yet. But likely it can fix that baco failure. At least it can fix the baco issue of Navi10 which is very similar as Navi14's. Regards, Evan -Original Message- From: Yuan, Xiaojie Sent: Wednesday, March 11, 2020 10:10 PM To: Quan, Evan ; amd-gfx@lists.freedesktop.org

RE: [PATCH 1/2] drm/amdgpu: update ras support capability with different sram ecc configuration

2020-03-11 Thread Zhang, Hawking
[AMD Official Use Only - Internal Distribution Only] Hi Guchun, It seems to me we still have redundant function call in amdgpu_ras_check_supported. The atomfirmware interfaces are possibly invoked twice? As I listed the steps in last thread, we can assume hw_supported to 0 or 0xfff either

RE: [PATCH 2/2] drm/amdgpu: remove mem ecc check for vega20 and arcturus

2020-03-11 Thread Zhang, Hawking
[AMD Official Use Only - Internal Distribution Only] I think we can merge the patch with first one as they are all refine current logic for querying ras capability. Regards, Hawking -Original Message- From: Chen, Guchun Sent: Thursday, March 12, 2020 10:55 To: amd-gfx@lists.freedeskto

RE: [PATCH 1/2] drm/amdgpu: update ras support capability with different sram ecc configuration

2020-03-11 Thread Chen, Guchun
[AMD Public Use] Thanks for your suggestion, Hawking. I will send one patch v3 to target this. Regards, Guchun -Original Message- From: Zhang, Hawking Sent: Thursday, March 12, 2020 11:13 AM To: Chen, Guchun ; amd-gfx@lists.freedesktop.org; Li, Dennis ; Zhou1, Tao ; Clements, John S

[PATCH] drm/amdgpu: update ras capability's query based on mem ecc configuration

2020-03-11 Thread Guchun Chen
RAS support capability needs to be updated on top of different memeory ECC enablement, and remove redundant memory ecc check in gmc module for vega20 and arcturus. v2: check HBM ECC enablement and set ras mask accordingly. v3: avoid to invoke atomfirmware interface to query twice. Suggested-by: H

RE: [PATCH] drm/amdgpu: update ras capability's query based on mem ecc configuration

2020-03-11 Thread Zhang, Hawking
[AMD Official Use Only - Internal Distribution Only] + if (!r) { + DRM_INFO("SRAM ECC is not present.\n"); + } else { + DRM_INFO("SRAM ECC is active.\n"); } {} is not needed. With that fixed, the patch is Rev