Re: [PATCH v2 3/9] PCI: Drop pci_is_thunderbolt_attached()

2023-11-03 Thread kernel test robot
Hi Mario, kernel test robot noticed the following build errors: [auto build test ERROR on pci/for-linus] [also build test ERROR on drm-misc/drm-misc-next westeri-thunderbolt/next rafael-pm/linux-next rafael-pm/acpi-bus linus/master rafael-pm/devprop v6.6 next-20231103] [cannot apply to pci

Re: [PATCH] drm/amdgpu: move buffer funcs setting up a level

2023-11-03 Thread Alex Deucher
On Fri, Nov 3, 2023 at 4:17 PM Alex Deucher wrote: > > On Thu, Oct 26, 2023 at 4:17 PM Luben Tuikov wrote: > > > > Pushed to drm-misc-next. > > BTW, I'm seeing the following on older GPUs with VCE and UVD even with > this patch: > [ 11.886024] amdgpu :0a:00.0: [drm] *ERROR* drm_sched_job_in

Re: [PATCH] drm/amdgpu: move buffer funcs setting up a level

2023-11-03 Thread Alex Deucher
On Thu, Oct 26, 2023 at 4:17 PM Luben Tuikov wrote: > > Pushed to drm-misc-next. BTW, I'm seeing the following on older GPUs with VCE and UVD even with this patch: [ 11.886024] amdgpu :0a:00.0: [drm] *ERROR* drm_sched_job_init: entity has no rq! [ 11.886028] amdgpu :0a:00.0: [drm:amdg

Re: [PATCH v2 6/9] PCI: Rename is_thunderbolt to is_tunneled

2023-11-03 Thread Hans de Goede
Hi, On 11/3/23 20:07, Mario Limonciello wrote: > The `is_thunderbolt` bit has been used to indicate that a PCIe device > contained the Intel VSEC which is used by various parts of the kernel > to change behavior. To later allow usage with USB4 controllers as well, > rename this to `is_tunneled`. >

Re: [PATCH v2 0/9] Improvements to pcie_bandwidth_available() for eGPUs

2023-11-03 Thread Bjorn Helgaas
On Fri, Nov 03, 2023 at 02:07:49PM -0500, Mario Limonciello wrote: > Downstream drivers are getting the wrong values from > pcie_bandwidth_available() which is causing problems for performance > of eGPUs. > > This series overhauls Thunderbolt related device detection and uses > the changes to chan

[PATCH v2 9/9] PCI: Add a quirk to mark 0x8086 : 0x9a23 as supporting PCIe tunneling

2023-11-03 Thread Mario Limonciello
The PCI root port used for tunneling USB4 traffic on Tiger Lake is is not marked as tunneling but has the same limitations as other PCIe root ports used for tunneling. This causes pcie_bandwidth_available() to treat it as the limiting device in the PCI hierarchy and downstream driver to program de

[PATCH v2 8/9] PCI: Exclude PCIe ports used for tunneling in pcie_bandwidth_available()

2023-11-03 Thread Mario Limonciello
The USB4 spec specifies that PCIe ports that are used for tunneling PCIe traffic over USB4 fabric will be hardcoded to advertise 2.5GT/s and behave as a PCIe Gen1 device. The actual performance of these ports is controlled by the fabric implementation. Downstream drivers such as amdgpu which utili

[PATCH v2 7/9] PCI: ACPI: Detect PCIe root ports that are used for tunneling

2023-11-03 Thread Mario Limonciello
USB4 routers support a feature called "PCIe tunneling". This allows PCIe traffic to be transmitted over USB4 fabric. PCIe root ports that are used in this fashion can be discovered by device specific data that specifies the USB4 router they are connected to. For the PCI core, the specific connecti

[PATCH v2 6/9] PCI: Rename is_thunderbolt to is_tunneled

2023-11-03 Thread Mario Limonciello
The `is_thunderbolt` bit has been used to indicate that a PCIe device contained the Intel VSEC which is used by various parts of the kernel to change behavior. To later allow usage with USB4 controllers as well, rename this to `is_tunneled`. Signed-off-by: Mario Limonciello --- drivers/pci/pci.c

[PATCH v2 5/9] PCI: pciehp: Move check for is_thunderbolt into a quirk

2023-11-03 Thread Mario Limonciello
commit 493fb50e958c ("PCI: pciehp: Assume NoCompl+ for Thunderbolt ports") added a check into pciehp code to explicitly set NoCompl+ for all Intel Thunderbolt controllers, including those that don't need it. This overloaded the purpose of the `is_thunderbolt` member of `struct pci_device` because

[PATCH v2 4/9] PCI: Move the `PCI_CLASS_SERIAL_USB_USB4` definition to common header

2023-11-03 Thread Mario Limonciello
`PCI_CLASS_SERIAL_USB_USB4` may be used by code outside of thunderbolt. Move the declaration into the common pci_ids.h header. Acked-by: Mika Westerberberg Signed-off-by: Mario Limonciello --- drivers/thunderbolt/nhi.h | 2 -- include/linux/pci_ids.h | 1 + 2 files changed, 1 insertion(+), 2

[PATCH v2 3/9] PCI: Drop pci_is_thunderbolt_attached()

2023-11-03 Thread Mario Limonciello
All callers have switched to dev_is_removable() for detecting hotpluggable PCIe devices. Signed-off-by: Mario Limonciello --- include/linux/pci.h | 22 -- 1 file changed, 22 deletions(-) diff --git a/include/linux/pci.h b/include/linux/pci.h index b56417276042..530b0a360514

[PATCH v2 2/9] drm/radeon: Switch from pci_is_thunderbolt_attached() to dev_is_removable()

2023-11-03 Thread Mario Limonciello
pci_is_thunderbolt_attached() only works for Intel TBT devices. Switch to using dev_is_removable() to be able to detect USB4 devices as well. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/radeon/radeon_device.c | 4 ++-- drivers/gpu/drm/radeon/radeon_kms.c| 2 +- 2 files changed, 3 in

[PATCH v2 1/9] drm/nouveau: Switch from pci_is_thunderbolt_attached() to dev_is_removable()

2023-11-03 Thread Mario Limonciello
pci_is_thunderbolt_attached() only works for Intel TBT devices. Switch to using dev_is_removable() to be able to detect USB4 devices as well. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/nouveau/nouveau_vga.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drive

[PATCH v2 0/9] Improvements to pcie_bandwidth_available() for eGPUs

2023-11-03 Thread Mario Limonciello
Downstream drivers are getting the wrong values from pcie_bandwidth_available() which is causing problems for performance of eGPUs. This series overhauls Thunderbolt related device detection and uses the changes to change the behavior of pcie_bandwidth_available(). NOTE: This series is currently

[pull] amdgpu, amdkfd, radeon drm-next-6.7

2023-11-03 Thread Alex Deucher
Hi Dave, Sima, Fixes for 6.7. The following changes since commit 631808095a82e6b6f8410a95f8b12b8d0d38b161: Merge tag 'amd-drm-next-6.7-2023-10-27' of https://gitlab.freedesktop.org/agd5f/linux into drm-next (2023-10-31 12:37:19 +1000) are available in the Git repository at: https://gitla

[PATCH] drivers: gpu: Fix warning using plain integer as NULL

2023-11-03 Thread Abhinav Singh
sparse static analysis tools generate a warning with this message "Using plain integer as NULL pointer". In this case this warning is being shown because we are trying to intialize a pointer to NULL using integer value 0. Signed-off-by: Abhinav Singh --- drivers/gpu/drm/radeon/clearstate_evergre

[PATCH 2/4] drm/amdgpu: Add xcc param to SRIOV kiq write and WREG32_SOC15_IP_NO_KIQ (v4)

2023-11-03 Thread Victor Lu
WREG32/RREG32_SOC15_IP_NO_KIQ and amdgpu_virt_kiq_reg_write_reg_wait are not using the correct rlcg interface or mec engine, respectively. Add xcc instance parameter to them. v4: Use GET_INST and squash commit with: "drm/amdgpu: Add xcc_inst param to amdgpu_virt_kiq_reg_write_reg_wait" v3: xcc n

[PATCH 4/4] drm/amdgpu: Change WREG32_RLC to WREG32_SOC15_RLC where inst != 0 (v2)

2023-11-03 Thread Victor Lu
W/RREG32_RLC is hardedcoded to use instance 0. W/RREG32_SOC15_RLC should be used instead when inst != 0. v2: rebase Signed-off-by: Victor Lu --- .../drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c | 38 -- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c | 40 +-- drivers

[PATCH 1/4] drm/amdgpu: Add flag to enable indirect RLCG access for gfx v9.4.3

2023-11-03 Thread Victor Lu
The "rlcg_reg_access_supported" flag is missing. Add it back in. Signed-off-by: Victor Lu --- drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c index a1c2c952d882..ce2a987

[PATCH 3/4] drm/amdgpu: Use correct KIQ MEC engine for gfx9.4.3 (v5)

2023-11-03 Thread Victor Lu
amdgpu_kiq_wreg/rreg is hardcoded to use MEC engine 0. Add an xcc_id parameter to amdgpu_kiq_wreg/rreg, define W/RREG32_XCC and amdgpu_device_xcc_wreg/rreg to to use the new xcc_id parameter. Using amdgpu_sriov_runtime to determine whether to access via kiq or RLC is sufficient for now. v5: add

RE: [PATCH] drm/amd/pm: Move some functions to smu_v13_0.c as generic code

2023-11-03 Thread Wang, Yang(Kevin)
-Original Message- From: Ma, Jun Sent: Friday, November 3, 2023 4:21 PM To: amd-gfx@lists.freedesktop.org; Feng, Kenneth ; Deucher, Alexander ; Wang, Yang(Kevin) Cc: Ma, Jun Subject: [PATCH] drm/amd/pm: Move some functions to smu_v13_0.c as generic code Use generic functions and re

RE: [PATCH 2/2] drm/amd/pm: Hide pp_dpm_pcie device attribute

2023-11-03 Thread Wang, Yang(Kevin)
Series is Reviewed-by: Yang Wang Best Regards, Kevin -Original Message- From: amd-gfx On Behalf Of Lijo Lazar Sent: Friday, November 3, 2023 2:00 PM To: amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander ; Zhang, Hawking Subject: [PATCH 2/2] drm/amd/pm: Hide pp_dpm_pcie device attr

[PATCH 18/24] drm/amdkfd: enable pc sampling start

2023-11-03 Thread James Zhu
Enable pc sampling start. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c | 26 +--- drivers/gpu/drm/amd/amdkfd/kfd_priv.h| 2 ++ 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c b/dri

[PATCH 12/24] drm/amdgpu: use trapID 4 for host trap

2023-11-03 Thread James Zhu
Since TRAPSTS.HOST_TRAP won't work pre-MI300, so use TTMP1 (bit 24: HT) and (bit 16-23: trapID) to identify the host trap. Signed-off-by: James Zhu --- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c |2 + .../gpu/drm/amd/amdkfd/cwsr_trap_handler.h| 2117 + .../drm/amd/amdk

[PATCH 21/24] drm/amdkfd: add queue remapping

2023-11-03 Thread James Zhu
Add queue remapping to force the waves in any running processes to complete a CWSR trap. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 11 +++ drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h | 5 + drivers/gpu/drm/amd/amdkfd/kfd_pc_sampli

[PATCH 22/24] drm/amdkfd: add pc sampling release when process release

2023-11-03 Thread James Zhu
Add pc sampling release when process release, it will force to stop all activate sessions with this process. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c | 26 drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.h | 1 + drivers/gpu/drm/amd/amdkfd/kfd_pr

[PATCH 19/24] drm/amdkfd: enable pc sampling stop

2023-11-03 Thread James Zhu
Enable pc sampling stop. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c | 28 +--- drivers/gpu/drm/amd/amdkfd/kfd_priv.h| 2 ++ 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c b/driv

[PATCH 20/24] drm/amdkfd: enable pc sampling work to trigger trap

2023-11-03 Thread James Zhu
Enable a delay work to trigger pc sampling trap. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 3 ++ drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c | 39 drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.h | 1 + drivers/gpu/drm/amd/amdkfd/kfd_priv.h

[PATCH 23/24] drm/amdkfd: add pc sampling capability check

2023-11-03 Thread James Zhu
From: David Yat Sin Add pc sampling capability check. Signed-off-by: David Yat Sin Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 10 +- drivers/gpu/drm/amd/amdkfd/kfd_priv.h| 13 + 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a

[PATCH 24/24] drm/amdkfd: bump kfd ioctl minor version for pc sampling availability

2023-11-03 Thread James Zhu
Bump the minor version to declare pc sampling feature is now available. Signed-off-by: James Zhu --- include/uapi/linux/kfd_ioctl.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/kfd_ioctl.h b/include/uapi/linux/kfd_ioctl.h index 5202e29c9560..68

[PATCH 17/24] drm/amdkfd: add setting trap pc sampling flag

2023-11-03 Thread James Zhu
Add setting trap pc sampling flag. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdkfd/kfd_priv.h| 2 ++ drivers/gpu/drm/amd/amdkfd/kfd_process.c | 13 + 2 files changed, 15 insertions(+) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd/kfd_p

[PATCH 00/24] Support Host Trap Sampling for MI200

2023-11-03 Thread James Zhu
PC sampling is a form of software profiling, where the threads of an application are periodically interrupted and the program counter that the thread is currently attempting to execute is saved out for profiling. David Yat Sin (5): drm/amdkfd/kfd_ioctl: add pc sampling support drm/amdkfd: add

[PATCH 16/24] drm/amdkfd: use bit operation set debug trap

2023-11-03 Thread James Zhu
1st level TMA's 2nd byte which used for trap type setting, to use bit operation to change selected bit only. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdkfd/kfd_process.c | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_

[PATCH 15/24] drm/amdkfd: trigger pc sampling trap for aldebaran

2023-11-03 Thread James Zhu
Implement trigger pc sampling trap for aldebaran. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_aldebaran.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_aldebaran.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_al

[PATCH 13/24] drm/amdgpu: add sq host trap status check

2023-11-03 Thread James Zhu
Before fire a new host trap, check the host trap status. Signed-off-by: James Zhu --- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c | 35 +++ .../amd/include/asic_reg/gc/gc_9_0_offset.h | 2 ++ .../amd/include/asic_reg/gc/gc_9_0_sh_mask.h | 5 +++ 3 files changed, 42 inserti

[PATCH 14/24] drm/amdkfd: trigger pc sampling trap for arcturus

2023-11-03 Thread James Zhu
Implement trigger pc sampling trap for arcturus. Signed-off-by: James Zhu --- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_arcturus.c| 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_arcturus.c b/drivers/gpu/drm/amd/amdgpu/am

[PATCH 11/24] drm/amdkfd/gfx9: enable host trap

2023-11-03 Thread James Zhu
Enable host trap. Signed-off-by: James Zhu --- .../gpu/drm/amd/amdkfd/cwsr_trap_handler.h| 63 +++ .../drm/amd/amdkfd/cwsr_trap_handler_gfx9.asm | 24 --- 2 files changed, 52 insertions(+), 35 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler.h b/dr

[PATCH 07/24] drm/amdkfd: check pcs_enrty valid

2023-11-03 Thread James Zhu
Check pcs_enrty valid for pc sampling ioctl. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c | 30 ++-- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c b/drivers/gpu/drm/amd/amdkfd/kfd_pc_sampl

[PATCH 01/24] drm/amdkfd/kfd_ioctl: add pc sampling support

2023-11-03 Thread James Zhu
From: David Yat Sin Add pc sampling support in kfd_ioctl. Co-developed-by: James Zhu Signed-off-by: James Zhu Signed-off-by: David Yat Sin --- include/uapi/linux/kfd_ioctl.h | 57 +- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/include/uapi/li

[PATCH 05/24] drm/amdkfd: enable pc sampling create

2023-11-03 Thread James Zhu
From: David Yat Sin Enable pc sampling create. Co-developed-by: James Zhu Signed-off-by: James Zhu Signed-off-by: David Yat Sin --- drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c | 54 +++- drivers/gpu/drm/amd/amdkfd/kfd_priv.h| 10 2 files changed, 63 insertions(+

[PATCH 10/24] drm/amdkfd: trigger pc sampling trap for gfx v9

2023-11-03 Thread James Zhu
Implement trigger pc sampling trap for gfx v9. Signed-off-by: James Zhu --- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c | 35 +++ .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.h | 7 2 files changed, 42 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gf

[PATCH 08/24] drm/amdkfd: enable pc sampling destroy

2023-11-03 Thread James Zhu
Enable pc sampling destroy. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c | 20 +--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c b/drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c index 36366

[PATCH 09/24] drm/amdkfd: add interface to trigger pc sampling trap

2023-11-03 Thread James Zhu
Add interface to trigger pc sampling trap. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/include/kgd_kfd_interface.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/amd/include/kgd_kfd_interface.h b/drivers/gpu/drm/amd/include/kgd_kfd_interface.h index 6d094cf3587d.

[PATCH 04/24] drm/amdkfd: add pc sampling mutex

2023-11-03 Thread James Zhu
Add pc sampling mutex per node, and do init/destroy in node init. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 12 drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 7 +++ 2 files changed, 19 insertions(+) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c

[PATCH 03/24] drm/amdkfd: enable pc sampling query

2023-11-03 Thread James Zhu
From: David Yat Sin Enable pc sampling to query system capability. Co-developed-by: James Zhu Signed-off-by: James Zhu Signed-off-by: David Yat Sin --- drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c | 54 +++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/driver

[PATCH 06/24] drm/amdkfd: add trace_id return

2023-11-03 Thread James Zhu
Add trace_id return for new pc sampling creation per device, Use IDR to quickly locate pc_sampling_entry for reference. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 2 ++ drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c | 20 +++- drivers/gpu/drm/amd/a

[PATCH 02/24] drm/amdkfd: add pc sampling support

2023-11-03 Thread James Zhu
From: David Yat Sin Add pc sampling functions in amdkfd. Co-developed-by: James Zhu Signed-off-by: James Zhu Signed-off-by: David Yat Sin --- drivers/gpu/drm/amd/amdkfd/Makefile | 3 +- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 36 + drivers/gpu/drm/amd/amdkfd/kfd_pc_s

RE: [PATCH 1/2] drm/amd/pm: Hide irrelevant pm device attributes

2023-11-03 Thread Kamal, Asad
[AMD Official Use Only - General] Seies is Reviewed-by: Asad Kamal Thanks & Regards Asad -Original Message- From: amd-gfx On Behalf Of Lijo Lazar Sent: Friday, November 3, 2023 11:30 AM To: amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander ; Zhang, Hawking Subject: [PATCH 1/2] drm

[PATCH] drm/amd/pm: Move some functions to smu_v13_0.c as generic code

2023-11-03 Thread Ma Jun
Use generic functions and remove the duplicate code Signed-off-by: Ma Jun --- .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c| 38 ++- .../drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 36 +- .../drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c | 36 +- 3 fi