Skip to content

Commit d6dd930

Browse files
committed
Merge tag 'drm-misc-fixes-2025-10-16' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-fixes
Short summary of fixes pull: ast: - Fix display output after reboot bridge: - lt9211: Fix version check core: - draw: Avoid color truncation - gpuvm: Avoid kernel-doc warning - sched: Avoid double free panthor: - Fix MCU suspend qaic: - Init bootlog in correct order - Treat remaining == 0 as error in find_and_map_user_pages() - Lock access to DBC request queue rockchip: - vop2: Fix destination size in atomic check Signed-off-by: Dave Airlie <airlied@redhat.com> From: Thomas Zimmermann <tzimmermann@suse.de> Link: https://lore.kernel.org/r/20251016141607.GA73919@linux.fritz.box
2 parents 520133b + 5801e65 commit d6dd930

File tree

14 files changed

+43
-25
lines changed

14 files changed

+43
-25
lines changed

drivers/accel/qaic/qaic.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ struct dma_bridge_chan {
9797
* response queue's head and tail pointer of this DBC.
9898
*/
9999
void __iomem *dbc_base;
100+
/* Synchronizes access to Request queue's head and tail pointer */
101+
struct mutex req_lock;
100102
/* Head of list where each node is a memory handle queued in request queue */
101103
struct list_head xfer_list;
102104
/* Synchronizes DBC readers during cleanup */

drivers/accel/qaic/qaic_control.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ static int find_and_map_user_pages(struct qaic_device *qdev,
407407
return -EINVAL;
408408
remaining = in_trans->size - resources->xferred_dma_size;
409409
if (remaining == 0)
410-
return 0;
410+
return -EINVAL;
411411

412412
if (check_add_overflow(xfer_start_addr, remaining, &end))
413413
return -EINVAL;

drivers/accel/qaic/qaic_data.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1356,32 +1356,40 @@ static int __qaic_execute_bo_ioctl(struct drm_device *dev, void *data, struct dr
13561356
goto release_ch_rcu;
13571357
}
13581358

1359+
ret = mutex_lock_interruptible(&dbc->req_lock);
1360+
if (ret)
1361+
goto release_ch_rcu;
1362+
13591363
head = readl(dbc->dbc_base + REQHP_OFF);
13601364
tail = readl(dbc->dbc_base + REQTP_OFF);
13611365

13621366
if (head == U32_MAX || tail == U32_MAX) {
13631367
/* PCI link error */
13641368
ret = -ENODEV;
1365-
goto release_ch_rcu;
1369+
goto unlock_req_lock;
13661370
}
13671371

13681372
queue_level = head <= tail ? tail - head : dbc->nelem - (head - tail);
13691373

13701374
ret = send_bo_list_to_device(qdev, file_priv, exec, args->hdr.count, is_partial, dbc,
13711375
head, &tail);
13721376
if (ret)
1373-
goto release_ch_rcu;
1377+
goto unlock_req_lock;
13741378

13751379
/* Finalize commit to hardware */
13761380
submit_ts = ktime_get_ns();
13771381
writel(tail, dbc->dbc_base + REQTP_OFF);
1382+
mutex_unlock(&dbc->req_lock);
13781383

13791384
update_profiling_data(file_priv, exec, args->hdr.count, is_partial, received_ts,
13801385
submit_ts, queue_level);
13811386

13821387
if (datapath_polling)
13831388
schedule_work(&dbc->poll_work);
13841389

1390+
unlock_req_lock:
1391+
if (ret)
1392+
mutex_unlock(&dbc->req_lock);
13851393
release_ch_rcu:
13861394
srcu_read_unlock(&dbc->ch_lock, rcu_id);
13871395
unlock_dev_srcu:

drivers/accel/qaic/qaic_debugfs.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,9 @@ static int qaic_bootlog_mhi_probe(struct mhi_device *mhi_dev, const struct mhi_d
218218
if (ret)
219219
goto destroy_workqueue;
220220

221+
dev_set_drvdata(&mhi_dev->dev, qdev);
222+
qdev->bootlog_ch = mhi_dev;
223+
221224
for (i = 0; i < BOOTLOG_POOL_SIZE; i++) {
222225
msg = devm_kzalloc(&qdev->pdev->dev, sizeof(*msg), GFP_KERNEL);
223226
if (!msg) {
@@ -233,8 +236,6 @@ static int qaic_bootlog_mhi_probe(struct mhi_device *mhi_dev, const struct mhi_d
233236
goto mhi_unprepare;
234237
}
235238

236-
dev_set_drvdata(&mhi_dev->dev, qdev);
237-
qdev->bootlog_ch = mhi_dev;
238239
return 0;
239240

240241
mhi_unprepare:

drivers/accel/qaic/qaic_drv.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,9 @@ static struct qaic_device *create_qdev(struct pci_dev *pdev,
454454
return NULL;
455455
init_waitqueue_head(&qdev->dbc[i].dbc_release);
456456
INIT_LIST_HEAD(&qdev->dbc[i].bo_lists);
457+
ret = drmm_mutex_init(drm, &qdev->dbc[i].req_lock);
458+
if (ret)
459+
return NULL;
457460
}
458461

459462
return qdev;

drivers/gpu/drm/ast/ast_mode.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -836,22 +836,24 @@ ast_crtc_helper_atomic_flush(struct drm_crtc *crtc,
836836
static void ast_crtc_helper_atomic_enable(struct drm_crtc *crtc, struct drm_atomic_state *state)
837837
{
838838
struct ast_device *ast = to_ast_device(crtc->dev);
839+
u8 vgacr17 = 0x00;
840+
u8 vgacrb6 = 0xff;
839841

840-
ast_set_index_reg_mask(ast, AST_IO_VGACRI, 0xb6, 0xfc, 0x00);
841-
ast_set_index_reg_mask(ast, AST_IO_VGASRI, 0x01, 0xdf, 0x00);
842+
vgacr17 |= AST_IO_VGACR17_SYNC_ENABLE;
843+
vgacrb6 &= ~(AST_IO_VGACRB6_VSYNC_OFF | AST_IO_VGACRB6_HSYNC_OFF);
844+
845+
ast_set_index_reg_mask(ast, AST_IO_VGACRI, 0x17, 0x7f, vgacr17);
846+
ast_set_index_reg_mask(ast, AST_IO_VGACRI, 0xb6, 0xfc, vgacrb6);
842847
}
843848

844849
static void ast_crtc_helper_atomic_disable(struct drm_crtc *crtc, struct drm_atomic_state *state)
845850
{
846851
struct drm_crtc_state *old_crtc_state = drm_atomic_get_old_crtc_state(state, crtc);
847852
struct ast_device *ast = to_ast_device(crtc->dev);
848-
u8 vgacrb6;
853+
u8 vgacr17 = 0xff;
849854

850-
ast_set_index_reg_mask(ast, AST_IO_VGASRI, 0x01, 0xdf, AST_IO_VGASR1_SD);
851-
852-
vgacrb6 = AST_IO_VGACRB6_VSYNC_OFF |
853-
AST_IO_VGACRB6_HSYNC_OFF;
854-
ast_set_index_reg_mask(ast, AST_IO_VGACRI, 0xb6, 0xfc, vgacrb6);
855+
vgacr17 &= ~AST_IO_VGACR17_SYNC_ENABLE;
856+
ast_set_index_reg_mask(ast, AST_IO_VGACRI, 0x17, 0x7f, vgacr17);
855857

856858
/*
857859
* HW cursors require the underlying primary plane and CRTC to

drivers/gpu/drm/ast/ast_reg.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#define AST_IO_VGAGRI (0x4E)
3030

3131
#define AST_IO_VGACRI (0x54)
32+
#define AST_IO_VGACR17_SYNC_ENABLE BIT(7) /* called "Hardware reset" in docs */
3233
#define AST_IO_VGACR80_PASSWORD (0xa8)
3334
#define AST_IO_VGACR99_VGAMEM_RSRV_MASK GENMASK(1, 0)
3435
#define AST_IO_VGACRA1_VGAIO_DISABLED BIT(1)

drivers/gpu/drm/bridge/lontium-lt9211.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,7 @@ static int lt9211_read_chipid(struct lt9211 *ctx)
121121
}
122122

123123
/* Test for known Chip ID. */
124-
if (chipid[0] != REG_CHIPID0_VALUE || chipid[1] != REG_CHIPID1_VALUE ||
125-
chipid[2] != REG_CHIPID2_VALUE) {
124+
if (chipid[0] != REG_CHIPID0_VALUE || chipid[1] != REG_CHIPID1_VALUE) {
126125
dev_err(ctx->dev, "Unknown Chip ID: 0x%02x 0x%02x 0x%02x\n",
127126
chipid[0], chipid[1], chipid[2]);
128127
return -EINVAL;

drivers/gpu/drm/drm_draw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ EXPORT_SYMBOL(drm_draw_fill16);
127127

128128
void drm_draw_fill24(struct iosys_map *dmap, unsigned int dpitch,
129129
unsigned int height, unsigned int width,
130-
u16 color)
130+
u32 color)
131131
{
132132
unsigned int y, x;
133133

drivers/gpu/drm/drm_draw_internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ void drm_draw_fill16(struct iosys_map *dmap, unsigned int dpitch,
4747

4848
void drm_draw_fill24(struct iosys_map *dmap, unsigned int dpitch,
4949
unsigned int height, unsigned int width,
50-
u16 color);
50+
u32 color);
5151

5252
void drm_draw_fill32(struct iosys_map *dmap, unsigned int dpitch,
5353
unsigned int height, unsigned int width,

0 commit comments

Comments
 (0)