mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 03:24:45 +01:00
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. -----BEGIN PGP SIGNATURE----- iJUEABMJAB0WIQTkHFbLp4ejekA/qfgnX84Zoj2+dgUCaak6GgAKCRAnX84Zoj2+ dkHpAX91/gbgY5FDu7va/7Ybo3oH/YvZOIQsbOz0sfJsjnszyKT3Wh4MGM8QphlI 93YHoi8Bf2M++H1mQgFrm97kjISmjgZYufM+6Cy92oqMO/SKCxiHTCBRnTBxas1B CXek10L1Pg== =jxDJ -----END PGP SIGNATURE----- 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
This commit is contained in:
commit
3d3234d5da
15 changed files with 85 additions and 36 deletions
|
|
@ -186,13 +186,13 @@ aie2_sched_resp_handler(void *handle, void __iomem *data, size_t size)
|
|||
cmd_abo = job->cmd_bo;
|
||||
|
||||
if (unlikely(job->job_timeout)) {
|
||||
amdxdna_cmd_set_state(cmd_abo, ERT_CMD_STATE_TIMEOUT);
|
||||
amdxdna_cmd_set_error(cmd_abo, job, 0, ERT_CMD_STATE_TIMEOUT);
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (unlikely(!data) || unlikely(size != sizeof(u32))) {
|
||||
amdxdna_cmd_set_state(cmd_abo, ERT_CMD_STATE_ABORT);
|
||||
amdxdna_cmd_set_error(cmd_abo, job, 0, ERT_CMD_STATE_ABORT);
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
|
@ -202,7 +202,7 @@ aie2_sched_resp_handler(void *handle, void __iomem *data, size_t size)
|
|||
if (status == AIE2_STATUS_SUCCESS)
|
||||
amdxdna_cmd_set_state(cmd_abo, ERT_CMD_STATE_COMPLETED);
|
||||
else
|
||||
amdxdna_cmd_set_state(cmd_abo, ERT_CMD_STATE_ERROR);
|
||||
amdxdna_cmd_set_error(cmd_abo, job, 0, ERT_CMD_STATE_ERROR);
|
||||
|
||||
out:
|
||||
aie2_sched_notify(job);
|
||||
|
|
@ -244,13 +244,13 @@ aie2_sched_cmdlist_resp_handler(void *handle, void __iomem *data, size_t size)
|
|||
cmd_abo = job->cmd_bo;
|
||||
|
||||
if (unlikely(job->job_timeout)) {
|
||||
amdxdna_cmd_set_state(cmd_abo, ERT_CMD_STATE_TIMEOUT);
|
||||
amdxdna_cmd_set_error(cmd_abo, job, 0, ERT_CMD_STATE_TIMEOUT);
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (unlikely(!data) || unlikely(size != sizeof(u32) * 3)) {
|
||||
amdxdna_cmd_set_state(cmd_abo, ERT_CMD_STATE_ABORT);
|
||||
amdxdna_cmd_set_error(cmd_abo, job, 0, ERT_CMD_STATE_ABORT);
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
|
@ -270,19 +270,12 @@ aie2_sched_cmdlist_resp_handler(void *handle, void __iomem *data, size_t size)
|
|||
fail_cmd_idx, fail_cmd_status);
|
||||
|
||||
if (fail_cmd_status == AIE2_STATUS_SUCCESS) {
|
||||
amdxdna_cmd_set_state(cmd_abo, ERT_CMD_STATE_ABORT);
|
||||
amdxdna_cmd_set_error(cmd_abo, job, fail_cmd_idx, ERT_CMD_STATE_ABORT);
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
} else {
|
||||
amdxdna_cmd_set_error(cmd_abo, job, fail_cmd_idx, ERT_CMD_STATE_ERROR);
|
||||
}
|
||||
amdxdna_cmd_set_state(cmd_abo, ERT_CMD_STATE_ERROR);
|
||||
|
||||
if (amdxdna_cmd_get_op(cmd_abo) == ERT_CMD_CHAIN) {
|
||||
struct amdxdna_cmd_chain *cc = amdxdna_cmd_get_payload(cmd_abo, NULL);
|
||||
|
||||
cc->error_index = fail_cmd_idx;
|
||||
if (cc->error_index >= cc->command_count)
|
||||
cc->error_index = 0;
|
||||
}
|
||||
out:
|
||||
aie2_sched_notify(job);
|
||||
return ret;
|
||||
|
|
|
|||
|
|
@ -40,11 +40,8 @@ static int aie2_send_mgmt_msg_wait(struct amdxdna_dev_hdl *ndev,
|
|||
return -ENODEV;
|
||||
|
||||
ret = xdna_send_msg_wait(xdna, ndev->mgmt_chann, msg);
|
||||
if (ret == -ETIME) {
|
||||
xdna_mailbox_stop_channel(ndev->mgmt_chann);
|
||||
xdna_mailbox_destroy_channel(ndev->mgmt_chann);
|
||||
ndev->mgmt_chann = NULL;
|
||||
}
|
||||
if (ret == -ETIME)
|
||||
aie2_destroy_mgmt_chann(ndev);
|
||||
|
||||
if (!ret && *hdl->status != AIE2_STATUS_SUCCESS) {
|
||||
XDNA_ERR(xdna, "command opcode 0x%x failed, status 0x%x",
|
||||
|
|
@ -914,6 +911,20 @@ void aie2_msg_init(struct amdxdna_dev_hdl *ndev)
|
|||
ndev->exec_msg_ops = &legacy_exec_message_ops;
|
||||
}
|
||||
|
||||
void aie2_destroy_mgmt_chann(struct amdxdna_dev_hdl *ndev)
|
||||
{
|
||||
struct amdxdna_dev *xdna = ndev->xdna;
|
||||
|
||||
drm_WARN_ON(&xdna->ddev, !mutex_is_locked(&xdna->dev_lock));
|
||||
|
||||
if (!ndev->mgmt_chann)
|
||||
return;
|
||||
|
||||
xdna_mailbox_stop_channel(ndev->mgmt_chann);
|
||||
xdna_mailbox_destroy_channel(ndev->mgmt_chann);
|
||||
ndev->mgmt_chann = NULL;
|
||||
}
|
||||
|
||||
static inline struct amdxdna_gem_obj *
|
||||
aie2_cmdlist_get_cmd_buf(struct amdxdna_sched_job *job)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -330,9 +330,7 @@ static void aie2_hw_stop(struct amdxdna_dev *xdna)
|
|||
|
||||
aie2_runtime_cfg(ndev, AIE2_RT_CFG_CLK_GATING, NULL);
|
||||
aie2_mgmt_fw_fini(ndev);
|
||||
xdna_mailbox_stop_channel(ndev->mgmt_chann);
|
||||
xdna_mailbox_destroy_channel(ndev->mgmt_chann);
|
||||
ndev->mgmt_chann = NULL;
|
||||
aie2_destroy_mgmt_chann(ndev);
|
||||
drmm_kfree(&xdna->ddev, ndev->mbox);
|
||||
ndev->mbox = NULL;
|
||||
aie2_psp_stop(ndev->psp_hdl);
|
||||
|
|
@ -441,8 +439,7 @@ static int aie2_hw_start(struct amdxdna_dev *xdna)
|
|||
return 0;
|
||||
|
||||
destroy_mgmt_chann:
|
||||
xdna_mailbox_stop_channel(ndev->mgmt_chann);
|
||||
xdna_mailbox_destroy_channel(ndev->mgmt_chann);
|
||||
aie2_destroy_mgmt_chann(ndev);
|
||||
stop_psp:
|
||||
aie2_psp_stop(ndev->psp_hdl);
|
||||
fini_smu:
|
||||
|
|
|
|||
|
|
@ -303,6 +303,7 @@ int aie2_get_array_async_error(struct amdxdna_dev_hdl *ndev,
|
|||
|
||||
/* aie2_message.c */
|
||||
void aie2_msg_init(struct amdxdna_dev_hdl *ndev);
|
||||
void aie2_destroy_mgmt_chann(struct amdxdna_dev_hdl *ndev);
|
||||
int aie2_suspend_fw(struct amdxdna_dev_hdl *ndev);
|
||||
int aie2_resume_fw(struct amdxdna_dev_hdl *ndev);
|
||||
int aie2_set_runtime_cfg(struct amdxdna_dev_hdl *ndev, u32 type, u64 value);
|
||||
|
|
|
|||
|
|
@ -135,6 +135,33 @@ u32 amdxdna_cmd_get_cu_idx(struct amdxdna_gem_obj *abo)
|
|||
return INVALID_CU_IDX;
|
||||
}
|
||||
|
||||
int amdxdna_cmd_set_error(struct amdxdna_gem_obj *abo,
|
||||
struct amdxdna_sched_job *job, u32 cmd_idx,
|
||||
enum ert_cmd_state error_state)
|
||||
{
|
||||
struct amdxdna_client *client = job->hwctx->client;
|
||||
struct amdxdna_cmd *cmd = abo->mem.kva;
|
||||
struct amdxdna_cmd_chain *cc = NULL;
|
||||
|
||||
cmd->header &= ~AMDXDNA_CMD_STATE;
|
||||
cmd->header |= FIELD_PREP(AMDXDNA_CMD_STATE, error_state);
|
||||
|
||||
if (amdxdna_cmd_get_op(abo) == ERT_CMD_CHAIN) {
|
||||
cc = amdxdna_cmd_get_payload(abo, NULL);
|
||||
cc->error_index = (cmd_idx < cc->command_count) ? cmd_idx : 0;
|
||||
abo = amdxdna_gem_get_obj(client, cc->data[0], AMDXDNA_BO_CMD);
|
||||
if (!abo)
|
||||
return -EINVAL;
|
||||
cmd = abo->mem.kva;
|
||||
}
|
||||
|
||||
memset(cmd->data, 0xff, abo->mem.size - sizeof(*cmd));
|
||||
if (cc)
|
||||
amdxdna_gem_put_obj(abo);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* This should be called in close() and remove(). DO NOT call in other syscalls.
|
||||
* This guarantee that when hwctx and resources will be released, if user
|
||||
|
|
|
|||
|
|
@ -167,6 +167,9 @@ amdxdna_cmd_get_state(struct amdxdna_gem_obj *abo)
|
|||
|
||||
void *amdxdna_cmd_get_payload(struct amdxdna_gem_obj *abo, u32 *size);
|
||||
u32 amdxdna_cmd_get_cu_idx(struct amdxdna_gem_obj *abo);
|
||||
int amdxdna_cmd_set_error(struct amdxdna_gem_obj *abo,
|
||||
struct amdxdna_sched_job *job, u32 cmd_idx,
|
||||
enum ert_cmd_state error_state);
|
||||
|
||||
void amdxdna_sched_job_cleanup(struct amdxdna_sched_job *job);
|
||||
void amdxdna_hwctx_remove_all(struct amdxdna_client *client);
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ const struct dpm_clk_freq npu1_dpm_clk_table[] = {
|
|||
|
||||
static const struct aie2_fw_feature_tbl npu1_fw_feature_table[] = {
|
||||
{ .major = 5, .min_minor = 7 },
|
||||
{ .features = BIT_U64(AIE2_NPU_COMMAND), .min_minor = 8 },
|
||||
{ .features = BIT_U64(AIE2_NPU_COMMAND), .major = 5, .min_minor = 8 },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -875,7 +875,7 @@ drm_syncobj_handle_to_fd_ioctl(struct drm_device *dev, void *data,
|
|||
return drm_syncobj_export_sync_file(file_private, args->handle,
|
||||
point, &args->fd);
|
||||
|
||||
if (args->point)
|
||||
if (point)
|
||||
return -EINVAL;
|
||||
|
||||
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,
|
|||
args->handle,
|
||||
point);
|
||||
|
||||
if (args->point)
|
||||
if (point)
|
||||
return -EINVAL;
|
||||
|
||||
return drm_syncobj_fd_to_handle(file_private, args->fd,
|
||||
|
|
|
|||
|
|
@ -1230,6 +1230,9 @@ nouveau_connector_aux_xfer(struct drm_dp_aux *obj, struct drm_dp_aux_msg *msg)
|
|||
u8 size = msg->size;
|
||||
int ret;
|
||||
|
||||
if (pm_runtime_suspended(nv_connector->base.dev->dev))
|
||||
return -EBUSY;
|
||||
|
||||
nv_encoder = find_encoder(&nv_connector->base, DCB_OUTPUT_DP);
|
||||
if (!nv_encoder)
|
||||
return -ENODEV;
|
||||
|
|
|
|||
|
|
@ -1122,6 +1122,7 @@ static int rzg2l_mipi_dsi_host_attach(struct mipi_dsi_host *host,
|
|||
struct mipi_dsi_device *device)
|
||||
{
|
||||
struct rzg2l_mipi_dsi *dsi = host_to_rzg2l_mipi_dsi(host);
|
||||
int bpp;
|
||||
int ret;
|
||||
|
||||
if (device->lanes > dsi->num_data_lanes) {
|
||||
|
|
@ -1131,7 +1132,8 @@ static int rzg2l_mipi_dsi_host_attach(struct mipi_dsi_host *host,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
switch (mipi_dsi_pixel_format_to_bpp(device->format)) {
|
||||
bpp = mipi_dsi_pixel_format_to_bpp(device->format);
|
||||
switch (bpp) {
|
||||
case 24:
|
||||
break;
|
||||
case 18:
|
||||
|
|
@ -1162,6 +1164,18 @@ static int rzg2l_mipi_dsi_host_attach(struct mipi_dsi_host *host,
|
|||
|
||||
drm_bridge_add(&dsi->bridge);
|
||||
|
||||
/*
|
||||
* Report the required division ratio setting for the MIPI clock dividers.
|
||||
*
|
||||
* vclk * bpp = hsclk * 8 * num_lanes
|
||||
*
|
||||
* vclk * DSI_AB_divider = hsclk * 16
|
||||
*
|
||||
* which simplifies to...
|
||||
* DSI_AB_divider = bpp * 2 / num_lanes
|
||||
*/
|
||||
rzg2l_cpg_dsi_div_set_divider(bpp * 2 / dsi->lanes, PLL5_TARGET_DSI);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -361,6 +361,7 @@ static void drm_sched_run_free_queue(struct drm_gpu_scheduler *sched)
|
|||
/**
|
||||
* drm_sched_job_done - complete a job
|
||||
* @s_job: pointer to the job which is done
|
||||
* @result: 0 on success, -ERRNO on error
|
||||
*
|
||||
* Finish the job's fence and resubmit the work items.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -737,6 +737,7 @@ static int ssd130x_update_rect(struct ssd130x_device *ssd130x,
|
|||
unsigned int height = drm_rect_height(rect);
|
||||
unsigned int line_length = DIV_ROUND_UP(width, 8);
|
||||
unsigned int page_height = SSD130X_PAGE_HEIGHT;
|
||||
u8 page_start = ssd130x->page_offset + y / page_height;
|
||||
unsigned int pages = DIV_ROUND_UP(height, page_height);
|
||||
struct drm_device *drm = &ssd130x->drm;
|
||||
u32 array_idx = 0;
|
||||
|
|
@ -774,14 +775,11 @@ static int ssd130x_update_rect(struct ssd130x_device *ssd130x,
|
|||
*/
|
||||
|
||||
if (!ssd130x->page_address_mode) {
|
||||
u8 page_start;
|
||||
|
||||
/* Set address range for horizontal addressing mode */
|
||||
ret = ssd130x_set_col_range(ssd130x, ssd130x->col_offset + x, width);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
page_start = ssd130x->page_offset + y / page_height;
|
||||
ret = ssd130x_set_page_range(ssd130x, page_start, pages);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
|
@ -813,7 +811,7 @@ static int ssd130x_update_rect(struct ssd130x_device *ssd130x,
|
|||
*/
|
||||
if (ssd130x->page_address_mode) {
|
||||
ret = ssd130x_set_page_pos(ssd130x,
|
||||
ssd130x->page_offset + i,
|
||||
page_start + i,
|
||||
ssd130x->col_offset + x);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
|
|
|||
|
|
@ -222,13 +222,13 @@ static void ttm_bo_reserve_interrupted(struct kunit *test)
|
|||
KUNIT_FAIL(test, "Couldn't create ttm bo reserve task\n");
|
||||
|
||||
/* Take a lock so the threaded reserve has to wait */
|
||||
mutex_lock(&bo->base.resv->lock.base);
|
||||
dma_resv_lock(bo->base.resv, NULL);
|
||||
|
||||
wake_up_process(task);
|
||||
msleep(20);
|
||||
err = kthread_stop(task);
|
||||
|
||||
mutex_unlock(&bo->base.resv->lock.base);
|
||||
dma_resv_unlock(bo->base.resv);
|
||||
|
||||
KUNIT_ASSERT_EQ(test, err, -ERESTARTSYS);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ static inline bool ttm_pool_uses_dma32(struct ttm_pool *pool)
|
|||
return pool->alloc_flags & TTM_ALLOCATION_POOL_USE_DMA32;
|
||||
}
|
||||
|
||||
static inline bool ttm_pool_beneficial_order(struct ttm_pool *pool)
|
||||
static inline unsigned int ttm_pool_beneficial_order(struct ttm_pool *pool)
|
||||
{
|
||||
return pool->alloc_flags & 0xff;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
#ifndef _DMA_BUF_UAPI_H_
|
||||
#define _DMA_BUF_UAPI_H_
|
||||
|
||||
#include <linux/ioctl.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue