Skip to contentSkip to conversation

KFD upstreaming

PATCH In review Felix Kuehling 3 participants 7 messages Apr 30, 2020

Subsystems (3)
lore
Share & tools
lore

Felix Kuehling

author maintainer
#0 lore raw

cover KFD upstreaming

A few small patches found during DKMS branch rebasing that were missing from amd-staging-drm-next for no good reason.

Felix Kuehling (2):
drm/amdkfd: Fix comment formatting
drm/amdgpu: Add missing parameter description in comments

Oak Zeng (1):
drm/amdgpu: Changed CU reservation golden settings

Ori Messinger (1):
drm/amdkfd: Report domain with topology

 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c     | 4 ++--
 drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c     | 1 +
 drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c     | 1 +
 drivers/gpu/drm/amd/amdkfd/kfd_process.c  | 4 ++--
 drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 3 +++
 drivers/gpu/drm/amd/amdkfd/kfd_topology.h | 1 +
 include/uapi/linux/kfd_ioctl.h            | 2 +-
 7 files changed, 11 insertions(+), 5 deletions(-)
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
author maintainer
#1 lore raw

PATCH 1/4 drm/amdkfd: Report domain with topology

From: Ori Messinger <[email protected]>

PCI domain has moved to 32-bits to accommodate virtualization, so a 32-bit integer is exposed for domain to reflect this change.

Domain can be found in here:
/sys/class/kfd/kfd/topology/nodes/X/properties
Where X is the card number

---
 drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 3 +++
 drivers/gpu/drm/amd/amdkfd/kfd_topology.h | 1 +
 2 files changed, 4 insertions(+)
drivers/gpu/drm/amd/amdkfd/kfd_topology.c +3 -0
index bc4a22df12d7..bb77f7af2b6d 100644
@@ -478,6 +478,8 @@ static ssize_t node_show(struct kobject *kobj, struct attribute *attr,
 			dev->node_props.device_id);
 	sysfs_show_32bit_prop(buffer, "location_id",
 			dev->node_props.location_id);
+	sysfs_show_32bit_prop(buffer, "domain",
+			dev->node_props.domain);
 	sysfs_show_32bit_prop(buffer, "drm_render_minor",
 			dev->node_props.drm_render_minor);
 	sysfs_show_64bit_prop(buffer, "hive_id",
@@ -1306,6 +1308,7 @@ int kfd_topology_add_device(struct kfd_dev *gpu)
 			HSA_CAP_ASIC_REVISION_SHIFT) &
 			HSA_CAP_ASIC_REVISION_MASK);
 	dev->node_props.location_id = pci_dev_id(gpu->pdev);
+	dev->node_props.domain = pci_domain_nr(gpu->pdev->bus);
 	dev->node_props.max_engine_clk_fcompute =
 		amdgpu_amdkfd_get_max_engine_clock_in_mhz(dev->gpu->kgd);
 	dev->node_props.max_engine_clk_ccompute =
drivers/gpu/drm/amd/amdkfd/kfd_topology.h +1 -0
index 0c51bd3dcd59..326d9b26b7aa 100644
@@ -80,6 +80,7 @@ struct kfd_node_properties {
 	uint32_t vendor_id;
 	uint32_t device_id;
 	uint32_t location_id;
+	uint32_t domain;
 	uint32_t max_engine_clk_fcompute;
 	uint32_t max_engine_clk_ccompute;
 	int32_t  drm_render_minor;
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
author maintainer
#2 lore raw

PATCH 2/4 drm/amdgpu: Changed CU reservation golden settings

In reply to Felix Kuehling

From: Oak Zeng <[email protected]>

With previous golden settings, compute task can't use reserved LDS (32K) on CU0 and CU1. On 64K LDS system, if compute work group allocate more than 32K LDS, then it can't be dispatched to CU0 and CU1 because of the reservation. This enables compute task to use reserved LDS on CU0 and CU1.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +2 -2
index 2767c6d03370..a4e95e03d97c 100644
@@ -507,8 +507,8 @@ static const struct soc15_reg_golden golden_settings_gc_9_0[] =
 	SOC15_REG_GOLDEN_VALUE(GC, 0, mmSH_MEM_CONFIG, 0x00001000, 0x00001000),
 	SOC15_REG_GOLDEN_VALUE(GC, 0, mmSPI_RESOURCE_RESERVE_CU_0, 0x0007ffff, 0x00000800),
 	SOC15_REG_GOLDEN_VALUE(GC, 0, mmSPI_RESOURCE_RESERVE_CU_1, 0x0007ffff, 0x00000800),
-	SOC15_REG_GOLDEN_VALUE(GC, 0, mmSPI_RESOURCE_RESERVE_EN_CU_0, 0x01ffffff, 0x0000ff87),
-	SOC15_REG_GOLDEN_VALUE(GC, 0, mmSPI_RESOURCE_RESERVE_EN_CU_1, 0x01ffffff, 0x0000ff8f),
+	SOC15_REG_GOLDEN_VALUE(GC, 0, mmSPI_RESOURCE_RESERVE_EN_CU_0, 0x01ffffff, 0x00ffff87),
+	SOC15_REG_GOLDEN_VALUE(GC, 0, mmSPI_RESOURCE_RESERVE_EN_CU_1, 0x01ffffff, 0x00ffff8f),
 	SOC15_REG_GOLDEN_VALUE(GC, 0, mmSQC_CONFIG, 0x03000000, 0x020a2000),
 	SOC15_REG_GOLDEN_VALUE(GC, 0, mmTA_CNTL_AUX, 0xfffffeef, 0x010b0000),
 	SOC15_REG_GOLDEN_VALUE(GC, 0, mmTCP_CHAN_STEER_HI, 0xffffffff, 0x4a2c0e68),
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
author maintainer
#3 lore raw

PATCH 3/4 drm/amdkfd: Fix comment formatting

In reply to Felix Kuehling

Corrected two function names. Added a missing space.

---
 drivers/gpu/drm/amd/amdkfd/kfd_process.c | 4 ++--
 include/uapi/linux/kfd_ioctl.h           | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_process.c +2 -2
index 598296034b43..d27221ddcdeb 100644
@@ -1122,7 +1122,7 @@ struct kfd_process *kfd_lookup_process_by_mm(const struct mm_struct *mm)
 	return p;
 }
 
-/* process_evict_queues - Evict all user queues of a process
+/* kfd_process_evict_queues - Evict all user queues of a process
  *
  * Eviction is reference-counted per process-device. This means multiple
  * evictions from different sources can be nested safely.
@@ -1162,7 +1162,7 @@ int kfd_process_evict_queues(struct kfd_process *p)
 	return r;
 }
 
-/* process_restore_queues - Restore all user queues of a process */
+/* kfd_process_restore_queues - Restore all user queues of a process */
 int kfd_process_restore_queues(struct kfd_process *p)
 {
 	struct kfd_process_device *pdd;
include/uapi/linux/kfd_ioctl.h +1 -1
index 4f6676428c5c..b6be62356d34 100644
@@ -251,7 +251,7 @@ struct kfd_memory_exception_failure {
 	__u32 imprecise;	/* Can't determine the	exact fault address */
 };
 
-/* memory exception data*/
+/* memory exception data */
 struct kfd_hsa_memory_exception_data {
 	struct kfd_memory_exception_failure failure;
 	__u64 va;
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
author maintainer
#4 lore raw

PATCH 4/4 drm/amdgpu: Add missing parameter description in comments

In reply to Felix Kuehling

Kerneldoc comments should describe all function parameters.

---
 drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 1 +
 drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 1 +
 2 files changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c +1 -0
index e8529e244a2b..bcd4baecfe11 100644
@@ -762,6 +762,7 @@ static void gmc_v7_0_gart_disable(struct amdgpu_device *adev)
  * @adev: amdgpu_device pointer
  * @status: VM_CONTEXT1_PROTECTION_FAULT_STATUS register value
  * @addr: VM_CONTEXT1_PROTECTION_FAULT_ADDR register value
+ * @mc_client: VM_CONTEXT1_PROTECTION_FAULT_MCCLIENT register value
  *
  * Print human readable fault information (CIK).
  */
drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c +1 -0
index 0aa5b82808d1..26976e50e2a2 100644
@@ -1005,6 +1005,7 @@ static void gmc_v8_0_gart_disable(struct amdgpu_device *adev)
  * @adev: amdgpu_device pointer
  * @status: VM_CONTEXT1_PROTECTION_FAULT_STATUS register value
  * @addr: VM_CONTEXT1_PROTECTION_FAULT_ADDR register value
+ * @mc_client: VM_CONTEXT1_PROTECTION_FAULT_MCCLIENT register value
  *
  * Print human readable fault information (VI).
  */
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#5 lore raw
In reply to Felix Kuehling

[AMD Official Use Only - Internal Distribution Only]

You can add Reviewed-By Kent Russell <kent.russell> for patches 3 and 4 and use them for 1/2 if needed (since they were already reviewed/acked by you or Alex).

Kent

Quoted 32 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Felix Kuehling
Sent: Wednesday, April 29, 2020 8:01 PM
To: [email protected]
Subject: [PATCH 0/4] KFD upstreaming

A few small patches found during DKMS branch rebasing that were missing from amd-staging-drm-next for no good reason.

Felix Kuehling (2):
drm/amdkfd: Fix comment formatting
drm/amdgpu: Add missing parameter description in comments

Oak Zeng (1):
drm/amdgpu: Changed CU reservation golden settings

Ori Messinger (1):
drm/amdkfd: Report domain with topology

 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c     | 4 ++--
 drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c     | 1 +
 drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c     | 1 +
 drivers/gpu/drm/amd/amdkfd/kfd_process.c  | 4 ++--
drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 3 +++
drivers/gpu/drm/amd/amdkfd/kfd_topology.h | 1 +
 include/uapi/linux/kfd_ioctl.h            | 2 +-
 7 files changed, 11 insertions(+), 5 deletions(-)

--
2.17.1

Quoted 9 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.fr
eedesktop.org%2Fmailman%2Flistinfo%2Famd- gfx&amp;data=02%7C01%7Ckent.russell%40amd.com%7C04b4185d714a4375 46bc08d7ec99a178%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C 637238017505884390&amp;sdata=eFMYK%2FzJBYAzQz7BOAqmMR1QOhRMe nh0KXIEhYsv0bI%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Acked-by Reviewed-by
#6 lore raw

1,2:

3, 4:

Quoted 48 lines · Kent

[AMD Official Use Only - Internal Distribution Only]

You can add Reviewed-By Kent Russell <kent.russell> for patches 3 and 4 and use them for 1/2 if needed (since they were already reviewed/acked by you or Alex).

Kent

Quoted 32 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Felix Kuehling
Sent: Wednesday, April 29, 2020 8:01 PM
To: [email protected]
Subject: [PATCH 0/4] KFD upstreaming

A few small patches found during DKMS branch rebasing that were missing from amd-staging-drm-next for no good reason.

Felix Kuehling (2):
drm/amdkfd: Fix comment formatting
drm/amdgpu: Add missing parameter description in comments

Oak Zeng (1):
drm/amdgpu: Changed CU reservation golden settings

Ori Messinger (1):
drm/amdkfd: Report domain with topology

 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c     | 4 ++--
 drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c     | 1 +
 drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c     | 1 +
 drivers/gpu/drm/amd/amdkfd/kfd_process.c  | 4 ++--
drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 3 +++
drivers/gpu/drm/amd/amdkfd/kfd_topology.h | 1 +
 include/uapi/linux/kfd_ioctl.h            | 2 +-
 7 files changed, 11 insertions(+), 5 deletions(-)

--
2.17.1

Quoted 9 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.fr
eedesktop.org%2Fmailman%2Flistinfo%2Famd- gfx&amp;data=02%7C01%7Ckent.russell%40amd.com%7C04b4185d714a4375 46bc08d7ec99a178%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C 637238017505884390&amp;sdata=eFMYK%2FzJBYAzQz7BOAqmMR1QOhRMe nh0KXIEhYsv0bI%3D&amp;reserved=0

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx