Skip to content

Commit 6531a2c

Browse files
committed
Merge tag 'drm-xe-next-fixes-2025-07-31' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-next
- Fix BMG probe on unsupported mailbox command (Raag) - Fix OA static checker warning about null gt (Ashutosh) - Fix a NULL vs IS_ERR() bug in xe_i2c_register_adapter (Dan) - Fix missing unwind goto in GuC/HuC (Zhanjun) - Don't register I2C devices if VF (Lukasz) - Clear whole GuC g2h_fence during initialization (Michal) - Avoid call kfree for drmm_kzalloc (Shuicheng) - Fix pci_dev reference leak on configfs (Michal) - SRIOV: Disable CSC support on VF (Lukasz) Signed-off-by: Dave Airlie <[email protected]> From: Rodrigo Vivi <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2 parents bb9ddd9 + f62408e commit 6531a2c

File tree

8 files changed

+23
-33
lines changed

8 files changed

+23
-33
lines changed

drivers/gpu/drm/xe/xe_configfs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,8 @@ static struct config_group *xe_config_make_device_group(struct config_group *gro
267267

268268
pdev = pci_get_domain_bus_and_slot(domain, bus, PCI_DEVFN(slot, function));
269269
if (!pdev)
270-
return ERR_PTR(-EINVAL);
270+
return ERR_PTR(-ENODEV);
271+
pci_dev_put(pdev);
271272

272273
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
273274
if (!dev)

drivers/gpu/drm/xe/xe_device.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,7 @@ static void sriov_update_device_info(struct xe_device *xe)
681681
/* disable features that are not available/applicable to VFs */
682682
if (IS_SRIOV_VF(xe)) {
683683
xe->info.probe_display = 0;
684+
xe->info.has_heci_cscfi = 0;
684685
xe->info.has_heci_gscfi = 0;
685686
xe->info.skip_guc_pc = 1;
686687
xe->info.skip_pcode = 1;

drivers/gpu/drm/xe/xe_device_sysfs.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,13 @@ static int late_bind_create_files(struct device *dev)
160160

161161
ret = xe_pcode_read(root, PCODE_MBOX(PCODE_LATE_BINDING, GET_CAPABILITY_STATUS, 0),
162162
&cap, NULL);
163-
if (ret)
163+
if (ret) {
164+
if (ret == -ENXIO) {
165+
drm_dbg(&xe->drm, "Late binding not supported by firmware\n");
166+
ret = 0;
167+
}
164168
goto out;
169+
}
165170

166171
if (REG_FIELD_GET(V1_FAN_SUPPORTED, cap)) {
167172
ret = sysfs_create_file(&dev->kobj, &dev_attr_lb_fan_control_version.attr);

drivers/gpu/drm/xe/xe_guc_ct.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,8 @@ struct g2h_fence {
9595

9696
static void g2h_fence_init(struct g2h_fence *g2h_fence, u32 *response_buffer)
9797
{
98+
memset(g2h_fence, 0, sizeof(*g2h_fence));
9899
g2h_fence->response_buffer = response_buffer;
99-
g2h_fence->response_data = 0;
100-
g2h_fence->response_len = 0;
101-
g2h_fence->fail = false;
102-
g2h_fence->retry = false;
103-
g2h_fence->done = false;
104100
g2h_fence->seqno = ~0x0;
105101
}
106102

drivers/gpu/drm/xe/xe_hw_engine_group.c

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -75,25 +75,18 @@ int xe_hw_engine_setup_groups(struct xe_gt *gt)
7575
enum xe_hw_engine_id id;
7676
struct xe_hw_engine_group *group_rcs_ccs, *group_bcs, *group_vcs_vecs;
7777
struct xe_device *xe = gt_to_xe(gt);
78-
int err;
7978

8079
group_rcs_ccs = hw_engine_group_alloc(xe);
81-
if (IS_ERR(group_rcs_ccs)) {
82-
err = PTR_ERR(group_rcs_ccs);
83-
goto err_group_rcs_ccs;
84-
}
80+
if (IS_ERR(group_rcs_ccs))
81+
return PTR_ERR(group_rcs_ccs);
8582

8683
group_bcs = hw_engine_group_alloc(xe);
87-
if (IS_ERR(group_bcs)) {
88-
err = PTR_ERR(group_bcs);
89-
goto err_group_bcs;
90-
}
84+
if (IS_ERR(group_bcs))
85+
return PTR_ERR(group_bcs);
9186

9287
group_vcs_vecs = hw_engine_group_alloc(xe);
93-
if (IS_ERR(group_vcs_vecs)) {
94-
err = PTR_ERR(group_vcs_vecs);
95-
goto err_group_vcs_vecs;
96-
}
88+
if (IS_ERR(group_vcs_vecs))
89+
return PTR_ERR(group_vcs_vecs);
9790

9891
for_each_hw_engine(hwe, gt, id) {
9992
switch (hwe->class) {
@@ -116,15 +109,6 @@ int xe_hw_engine_setup_groups(struct xe_gt *gt)
116109
}
117110

118111
return 0;
119-
120-
err_group_vcs_vecs:
121-
kfree(group_vcs_vecs);
122-
err_group_bcs:
123-
kfree(group_bcs);
124-
err_group_rcs_ccs:
125-
kfree(group_rcs_ccs);
126-
127-
return err;
128112
}
129113

130114
/**

drivers/gpu/drm/xe/xe_i2c.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ static int xe_i2c_register_adapter(struct xe_i2c *i2c)
9696
int ret;
9797

9898
fwnode = fwnode_create_software_node(xe_i2c_adapter_properties, NULL);
99-
if (!fwnode)
100-
return -ENOMEM;
99+
if (IS_ERR(fwnode))
100+
return PTR_ERR(fwnode);
101101

102102
/*
103103
* Not using platform_device_register_full() here because we don't have
@@ -283,6 +283,9 @@ int xe_i2c_probe(struct xe_device *xe)
283283
if (xe->info.platform != XE_BATTLEMAGE)
284284
return 0;
285285

286+
if (IS_SRIOV_VF(xe))
287+
return 0;
288+
286289
xe_i2c_read_endpoint(xe_root_tile_mmio(xe), &ep);
287290
if (ep.cookie != XE_I2C_EP_COOKIE_DEVICE)
288291
return 0;

drivers/gpu/drm/xe/xe_oa.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1941,7 +1941,7 @@ static int xe_oa_assign_hwe(struct xe_oa *oa, struct xe_oa_open_param *param)
19411941

19421942
/* If not provided, OA unit defaults to OA unit 0 as per uapi */
19431943
if (!param->oa_unit)
1944-
param->oa_unit = &xe_device_get_gt(oa->xe, 0)->oa.oa_unit[0];
1944+
param->oa_unit = &xe_root_mmio_gt(oa->xe)->oa.oa_unit[0];
19451945

19461946
/* When we have an exec_q, get hwe from the exec_q */
19471947
if (param->exec_q) {

drivers/gpu/drm/xe/xe_uc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ static int vf_uc_load_hw(struct xe_uc *uc)
164164

165165
err = xe_guc_opt_in_features_enable(&uc->guc);
166166
if (err)
167-
return err;
167+
goto err_out;
168168

169169
err = xe_gt_record_default_lrcs(uc_to_gt(uc));
170170
if (err)

0 commit comments

Comments
 (0)