Skip to content

Commit 3d3234d

Browse files
committed
Merge tag 'drm-misc-fixes-2026-03-05' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-fixes
A return type fix for ttm, a display fix for solomon, several misc fixes for amdxdna, a DSI clock rate fix for rz-du, a uapi fix for syncobj, a possible build failure fix for dma-buf, a doc warning fix for sched, a build failure fix for ttm tests, and a crash fix when suspended for nouveau. Signed-off-by: Dave Airlie <airlied@redhat.com> From: Maxime Ripard <mripard@redhat.com> Link: https://patch.msgid.link/20260305-ludicrous-quirky-raven-7cdafd@houat
2 parents 3fcb1cb + 8f3c6f0 commit 3d3234d

15 files changed

Lines changed: 85 additions & 36 deletions

File tree

drivers/accel/amdxdna/aie2_ctx.c

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -186,13 +186,13 @@ aie2_sched_resp_handler(void *handle, void __iomem *data, size_t size)
186186
cmd_abo = job->cmd_bo;
187187

188188
if (unlikely(job->job_timeout)) {
189-
amdxdna_cmd_set_state(cmd_abo, ERT_CMD_STATE_TIMEOUT);
189+
amdxdna_cmd_set_error(cmd_abo, job, 0, ERT_CMD_STATE_TIMEOUT);
190190
ret = -EINVAL;
191191
goto out;
192192
}
193193

194194
if (unlikely(!data) || unlikely(size != sizeof(u32))) {
195-
amdxdna_cmd_set_state(cmd_abo, ERT_CMD_STATE_ABORT);
195+
amdxdna_cmd_set_error(cmd_abo, job, 0, ERT_CMD_STATE_ABORT);
196196
ret = -EINVAL;
197197
goto out;
198198
}
@@ -202,7 +202,7 @@ aie2_sched_resp_handler(void *handle, void __iomem *data, size_t size)
202202
if (status == AIE2_STATUS_SUCCESS)
203203
amdxdna_cmd_set_state(cmd_abo, ERT_CMD_STATE_COMPLETED);
204204
else
205-
amdxdna_cmd_set_state(cmd_abo, ERT_CMD_STATE_ERROR);
205+
amdxdna_cmd_set_error(cmd_abo, job, 0, ERT_CMD_STATE_ERROR);
206206

207207
out:
208208
aie2_sched_notify(job);
@@ -244,13 +244,13 @@ aie2_sched_cmdlist_resp_handler(void *handle, void __iomem *data, size_t size)
244244
cmd_abo = job->cmd_bo;
245245

246246
if (unlikely(job->job_timeout)) {
247-
amdxdna_cmd_set_state(cmd_abo, ERT_CMD_STATE_TIMEOUT);
247+
amdxdna_cmd_set_error(cmd_abo, job, 0, ERT_CMD_STATE_TIMEOUT);
248248
ret = -EINVAL;
249249
goto out;
250250
}
251251

252252
if (unlikely(!data) || unlikely(size != sizeof(u32) * 3)) {
253-
amdxdna_cmd_set_state(cmd_abo, ERT_CMD_STATE_ABORT);
253+
amdxdna_cmd_set_error(cmd_abo, job, 0, ERT_CMD_STATE_ABORT);
254254
ret = -EINVAL;
255255
goto out;
256256
}
@@ -270,19 +270,12 @@ aie2_sched_cmdlist_resp_handler(void *handle, void __iomem *data, size_t size)
270270
fail_cmd_idx, fail_cmd_status);
271271

272272
if (fail_cmd_status == AIE2_STATUS_SUCCESS) {
273-
amdxdna_cmd_set_state(cmd_abo, ERT_CMD_STATE_ABORT);
273+
amdxdna_cmd_set_error(cmd_abo, job, fail_cmd_idx, ERT_CMD_STATE_ABORT);
274274
ret = -EINVAL;
275-
goto out;
275+
} else {
276+
amdxdna_cmd_set_error(cmd_abo, job, fail_cmd_idx, ERT_CMD_STATE_ERROR);
276277
}
277-
amdxdna_cmd_set_state(cmd_abo, ERT_CMD_STATE_ERROR);
278278

279-
if (amdxdna_cmd_get_op(cmd_abo) == ERT_CMD_CHAIN) {
280-
struct amdxdna_cmd_chain *cc = amdxdna_cmd_get_payload(cmd_abo, NULL);
281-
282-
cc->error_index = fail_cmd_idx;
283-
if (cc->error_index >= cc->command_count)
284-
cc->error_index = 0;
285-
}
286279
out:
287280
aie2_sched_notify(job);
288281
return ret;

drivers/accel/amdxdna/aie2_message.c

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,8 @@ static int aie2_send_mgmt_msg_wait(struct amdxdna_dev_hdl *ndev,
4040
return -ENODEV;
4141

4242
ret = xdna_send_msg_wait(xdna, ndev->mgmt_chann, msg);
43-
if (ret == -ETIME) {
44-
xdna_mailbox_stop_channel(ndev->mgmt_chann);
45-
xdna_mailbox_destroy_channel(ndev->mgmt_chann);
46-
ndev->mgmt_chann = NULL;
47-
}
43+
if (ret == -ETIME)
44+
aie2_destroy_mgmt_chann(ndev);
4845

4946
if (!ret && *hdl->status != AIE2_STATUS_SUCCESS) {
5047
XDNA_ERR(xdna, "command opcode 0x%x failed, status 0x%x",
@@ -914,6 +911,20 @@ void aie2_msg_init(struct amdxdna_dev_hdl *ndev)
914911
ndev->exec_msg_ops = &legacy_exec_message_ops;
915912
}
916913

914+
void aie2_destroy_mgmt_chann(struct amdxdna_dev_hdl *ndev)
915+
{
916+
struct amdxdna_dev *xdna = ndev->xdna;
917+
918+
drm_WARN_ON(&xdna->ddev, !mutex_is_locked(&xdna->dev_lock));
919+
920+
if (!ndev->mgmt_chann)
921+
return;
922+
923+
xdna_mailbox_stop_channel(ndev->mgmt_chann);
924+
xdna_mailbox_destroy_channel(ndev->mgmt_chann);
925+
ndev->mgmt_chann = NULL;
926+
}
927+
917928
static inline struct amdxdna_gem_obj *
918929
aie2_cmdlist_get_cmd_buf(struct amdxdna_sched_job *job)
919930
{

drivers/accel/amdxdna/aie2_pci.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -330,9 +330,7 @@ static void aie2_hw_stop(struct amdxdna_dev *xdna)
330330

331331
aie2_runtime_cfg(ndev, AIE2_RT_CFG_CLK_GATING, NULL);
332332
aie2_mgmt_fw_fini(ndev);
333-
xdna_mailbox_stop_channel(ndev->mgmt_chann);
334-
xdna_mailbox_destroy_channel(ndev->mgmt_chann);
335-
ndev->mgmt_chann = NULL;
333+
aie2_destroy_mgmt_chann(ndev);
336334
drmm_kfree(&xdna->ddev, ndev->mbox);
337335
ndev->mbox = NULL;
338336
aie2_psp_stop(ndev->psp_hdl);
@@ -441,8 +439,7 @@ static int aie2_hw_start(struct amdxdna_dev *xdna)
441439
return 0;
442440

443441
destroy_mgmt_chann:
444-
xdna_mailbox_stop_channel(ndev->mgmt_chann);
445-
xdna_mailbox_destroy_channel(ndev->mgmt_chann);
442+
aie2_destroy_mgmt_chann(ndev);
446443
stop_psp:
447444
aie2_psp_stop(ndev->psp_hdl);
448445
fini_smu:

drivers/accel/amdxdna/aie2_pci.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ int aie2_get_array_async_error(struct amdxdna_dev_hdl *ndev,
303303

304304
/* aie2_message.c */
305305
void aie2_msg_init(struct amdxdna_dev_hdl *ndev);
306+
void aie2_destroy_mgmt_chann(struct amdxdna_dev_hdl *ndev);
306307
int aie2_suspend_fw(struct amdxdna_dev_hdl *ndev);
307308
int aie2_resume_fw(struct amdxdna_dev_hdl *ndev);
308309
int aie2_set_runtime_cfg(struct amdxdna_dev_hdl *ndev, u32 type, u64 value);

drivers/accel/amdxdna/amdxdna_ctx.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,33 @@ u32 amdxdna_cmd_get_cu_idx(struct amdxdna_gem_obj *abo)
135135
return INVALID_CU_IDX;
136136
}
137137

138+
int amdxdna_cmd_set_error(struct amdxdna_gem_obj *abo,
139+
struct amdxdna_sched_job *job, u32 cmd_idx,
140+
enum ert_cmd_state error_state)
141+
{
142+
struct amdxdna_client *client = job->hwctx->client;
143+
struct amdxdna_cmd *cmd = abo->mem.kva;
144+
struct amdxdna_cmd_chain *cc = NULL;
145+
146+
cmd->header &= ~AMDXDNA_CMD_STATE;
147+
cmd->header |= FIELD_PREP(AMDXDNA_CMD_STATE, error_state);
148+
149+
if (amdxdna_cmd_get_op(abo) == ERT_CMD_CHAIN) {
150+
cc = amdxdna_cmd_get_payload(abo, NULL);
151+
cc->error_index = (cmd_idx < cc->command_count) ? cmd_idx : 0;
152+
abo = amdxdna_gem_get_obj(client, cc->data[0], AMDXDNA_BO_CMD);
153+
if (!abo)
154+
return -EINVAL;
155+
cmd = abo->mem.kva;
156+
}
157+
158+
memset(cmd->data, 0xff, abo->mem.size - sizeof(*cmd));
159+
if (cc)
160+
amdxdna_gem_put_obj(abo);
161+
162+
return 0;
163+
}
164+
138165
/*
139166
* This should be called in close() and remove(). DO NOT call in other syscalls.
140167
* This guarantee that when hwctx and resources will be released, if user

drivers/accel/amdxdna/amdxdna_ctx.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,9 @@ amdxdna_cmd_get_state(struct amdxdna_gem_obj *abo)
167167

168168
void *amdxdna_cmd_get_payload(struct amdxdna_gem_obj *abo, u32 *size);
169169
u32 amdxdna_cmd_get_cu_idx(struct amdxdna_gem_obj *abo);
170+
int amdxdna_cmd_set_error(struct amdxdna_gem_obj *abo,
171+
struct amdxdna_sched_job *job, u32 cmd_idx,
172+
enum ert_cmd_state error_state);
170173

171174
void amdxdna_sched_job_cleanup(struct amdxdna_sched_job *job);
172175
void amdxdna_hwctx_remove_all(struct amdxdna_client *client);

drivers/accel/amdxdna/npu1_regs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ const struct dpm_clk_freq npu1_dpm_clk_table[] = {
6767

6868
static const struct aie2_fw_feature_tbl npu1_fw_feature_table[] = {
6969
{ .major = 5, .min_minor = 7 },
70-
{ .features = BIT_U64(AIE2_NPU_COMMAND), .min_minor = 8 },
70+
{ .features = BIT_U64(AIE2_NPU_COMMAND), .major = 5, .min_minor = 8 },
7171
{ 0 }
7272
};
7373

drivers/gpu/drm/drm_syncobj.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ drm_syncobj_handle_to_fd_ioctl(struct drm_device *dev, void *data,
875875
return drm_syncobj_export_sync_file(file_private, args->handle,
876876
point, &args->fd);
877877

878-
if (args->point)
878+
if (point)
879879
return -EINVAL;
880880

881881
return drm_syncobj_handle_to_fd(file_private, args->handle,
@@ -909,7 +909,7 @@ drm_syncobj_fd_to_handle_ioctl(struct drm_device *dev, void *data,
909909
args->handle,
910910
point);
911911

912-
if (args->point)
912+
if (point)
913913
return -EINVAL;
914914

915915
return drm_syncobj_fd_to_handle(file_private, args->fd,

drivers/gpu/drm/nouveau/nouveau_connector.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,6 +1230,9 @@ nouveau_connector_aux_xfer(struct drm_dp_aux *obj, struct drm_dp_aux_msg *msg)
12301230
u8 size = msg->size;
12311231
int ret;
12321232

1233+
if (pm_runtime_suspended(nv_connector->base.dev->dev))
1234+
return -EBUSY;
1235+
12331236
nv_encoder = find_encoder(&nv_connector->base, DCB_OUTPUT_DP);
12341237
if (!nv_encoder)
12351238
return -ENODEV;

drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1122,6 +1122,7 @@ static int rzg2l_mipi_dsi_host_attach(struct mipi_dsi_host *host,
11221122
struct mipi_dsi_device *device)
11231123
{
11241124
struct rzg2l_mipi_dsi *dsi = host_to_rzg2l_mipi_dsi(host);
1125+
int bpp;
11251126
int ret;
11261127

11271128
if (device->lanes > dsi->num_data_lanes) {
@@ -1131,7 +1132,8 @@ static int rzg2l_mipi_dsi_host_attach(struct mipi_dsi_host *host,
11311132
return -EINVAL;
11321133
}
11331134

1134-
switch (mipi_dsi_pixel_format_to_bpp(device->format)) {
1135+
bpp = mipi_dsi_pixel_format_to_bpp(device->format);
1136+
switch (bpp) {
11351137
case 24:
11361138
break;
11371139
case 18:
@@ -1162,6 +1164,18 @@ static int rzg2l_mipi_dsi_host_attach(struct mipi_dsi_host *host,
11621164

11631165
drm_bridge_add(&dsi->bridge);
11641166

1167+
/*
1168+
* Report the required division ratio setting for the MIPI clock dividers.
1169+
*
1170+
* vclk * bpp = hsclk * 8 * num_lanes
1171+
*
1172+
* vclk * DSI_AB_divider = hsclk * 16
1173+
*
1174+
* which simplifies to...
1175+
* DSI_AB_divider = bpp * 2 / num_lanes
1176+
*/
1177+
rzg2l_cpg_dsi_div_set_divider(bpp * 2 / dsi->lanes, PLL5_TARGET_DSI);
1178+
11651179
return 0;
11661180
}
11671181

0 commit comments

Comments
 (0)