Skip to content

Commit a3efabe

Browse files
Andrzej Kacprowskisgruszka
authored andcommitted
accel/ivpu: Fix sporadic VPU boot failure
Wait for AON bit in HOST_SS_CPR_RST_CLR to return 0 before starting VPUIP power up sequence, otherwise the VPU device may sporadically fail to boot. An error in power up sequence is propagated to the runtime power management - the device will be in an error state until the VPU driver is reloaded. Fixes: 35b1376 ("accel/ivpu: Introduce a new DRM driver for Intel VPU") Cc: [email protected] # 6.3.x Signed-off-by: Andrzej Kacprowski <[email protected]> Reviewed-by: Krystian Pradzynski <[email protected]> Signed-off-by: Stanislaw Gruszka <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent b563e47 commit a3efabe

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

drivers/accel/ivpu/ivpu_hw_mtl.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,11 @@ static void ivpu_pll_init_frequency_ratios(struct ivpu_device *vdev)
197197
hw->pll.pn_ratio = clamp_t(u8, fuse_pn_ratio, hw->pll.min_ratio, hw->pll.max_ratio);
198198
}
199199

200+
static int ivpu_hw_mtl_wait_for_vpuip_bar(struct ivpu_device *vdev)
201+
{
202+
return REGV_POLL_FLD(MTL_VPU_HOST_SS_CPR_RST_CLR, AON, 0, 100);
203+
}
204+
200205
static int ivpu_pll_drive(struct ivpu_device *vdev, bool enable)
201206
{
202207
struct ivpu_hw_info *hw = vdev->hw;
@@ -239,6 +244,12 @@ static int ivpu_pll_drive(struct ivpu_device *vdev, bool enable)
239244
ivpu_err(vdev, "Timed out waiting for PLL ready status\n");
240245
return ret;
241246
}
247+
248+
ret = ivpu_hw_mtl_wait_for_vpuip_bar(vdev);
249+
if (ret) {
250+
ivpu_err(vdev, "Timed out waiting for VPUIP bar\n");
251+
return ret;
252+
}
242253
}
243254

244255
return 0;
@@ -256,7 +267,7 @@ static int ivpu_pll_disable(struct ivpu_device *vdev)
256267

257268
static void ivpu_boot_host_ss_rst_clr_assert(struct ivpu_device *vdev)
258269
{
259-
u32 val = REGV_RD32(MTL_VPU_HOST_SS_CPR_RST_CLR);
270+
u32 val = 0;
260271

261272
val = REG_SET_FLD(MTL_VPU_HOST_SS_CPR_RST_CLR, TOP_NOC, val);
262273
val = REG_SET_FLD(MTL_VPU_HOST_SS_CPR_RST_CLR, DSS_MAS, val);

drivers/accel/ivpu/ivpu_hw_mtl_reg.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@
9191
#define MTL_VPU_HOST_SS_CPR_RST_SET_MSS_MAS_MASK BIT_MASK(11)
9292

9393
#define MTL_VPU_HOST_SS_CPR_RST_CLR 0x00000098u
94+
#define MTL_VPU_HOST_SS_CPR_RST_CLR_AON_MASK BIT_MASK(0)
9495
#define MTL_VPU_HOST_SS_CPR_RST_CLR_TOP_NOC_MASK BIT_MASK(1)
9596
#define MTL_VPU_HOST_SS_CPR_RST_CLR_DSS_MAS_MASK BIT_MASK(10)
9697
#define MTL_VPU_HOST_SS_CPR_RST_CLR_MSS_MAS_MASK BIT_MASK(11)

0 commit comments

Comments
 (0)