// FPGA programming for this clock in diags framework that
        // needs to go through dm layer, therefore leave dummy interace here
 }
+
+
+void dm_helpers_enable_periodic_detection(struct dc_context *ctx, bool enable)
+{
+       /* TODO: add peridic detection implementation */
+}
 #endif
\ No newline at end of file
 
                if (new_clocks->zstate_support == DCN_ZSTATE_SUPPORT_ALLOW &&
                                new_clocks->zstate_support != clk_mgr_base->clks.zstate_support) {
                        dcn31_smu_set_Z9_support(clk_mgr, true);
+                       dm_helpers_enable_periodic_detection(clk_mgr_base->ctx, true);
                        clk_mgr_base->clks.zstate_support = new_clocks->zstate_support;
                }
 
                if (new_clocks->zstate_support == DCN_ZSTATE_SUPPORT_DISALLOW &&
                                new_clocks->zstate_support != clk_mgr_base->clks.zstate_support) {
                        dcn31_smu_set_Z9_support(clk_mgr, false);
+                       dm_helpers_enable_periodic_detection(clk_mgr_base->ctx, false);
                        clk_mgr_base->clks.zstate_support = new_clocks->zstate_support;
                }
 
 
 }
 
 #if defined(CONFIG_DRM_AMD_DC_DCN)
-void dc_z10_restore(struct dc *dc)
+void dc_z10_restore(const struct dc *dc)
 {
        if (dc->hwss.z10_restore)
                dc->hwss.z10_restore(dc);
 
                }
        }
 
+#if defined(CONFIG_DRM_AMD_DC_DCN)
+       dc_z10_restore(dc);
+#endif
+
        /* get out of low power state */
        if (!can_apply_seamless_boot && reason != DETECT_REASON_BOOT)
                clk_mgr_exit_optimized_pwr_state(dc, dc->clk_mgr);
 
 
 bool dc_set_psr_allow_active(struct dc *dc, bool enable);
 #if defined(CONFIG_DRM_AMD_DC_DCN)
-void dc_z10_restore(struct dc *dc);
+void dc_z10_restore(const struct dc *dc);
 void dc_z10_save_init(struct dc *dc);
 #endif
 
 
        dc_dmub_srv_wait_idle(dc->ctx->dmub_srv);
 }
 
-void dcn31_z10_restore(struct dc *dc)
+void dcn31_z10_restore(const struct dc *dc)
 {
        union dmub_rb_cmd cmd;
 
 
 
 void dcn31_update_info_frame(struct pipe_ctx *pipe_ctx);
 
-void dcn31_z10_restore(struct dc *dc);
+void dcn31_z10_restore(const struct dc *dc);
 void dcn31_z10_save_init(struct dc *dc);
 
 void dcn31_hubp_pg_control(struct dce_hwseq *hws, unsigned int hubp_inst, bool power_on);
 
                struct dc_context *ctx,
                struct dc_clocks *clks);
 
+#if defined(CONFIG_DRM_AMD_DC_DCN)
+void dm_helpers_enable_periodic_detection(struct dc_context *ctx, bool enable);
+#endif
+
 void dm_set_phyd32clk(struct dc_context *ctx, int freq_khz);
 
 bool dm_helpers_dmub_outbox_interrupt_control(struct dc_context *ctx, bool enable);
 
                        const struct tg_color *solid_color,
                        int width, int height, int offset);
 
-       void (*z10_restore)(struct dc *dc);
+       void (*z10_restore)(const struct dc *dc);
        void (*z10_save_init)(struct dc *dc);
 
        void (*update_visual_confirm_color)(struct dc *dc,
 
        uint32_t (*get_current_time)(struct dmub_srv *dmub);
 
        void (*get_diagnostic_data)(struct dmub_srv *dmub, struct dmub_diagnostic_data *dmub_oca);
+
+       bool (*should_detect)(struct dmub_srv *dmub);
 };
 
 /**
 
 bool dmub_srv_get_diagnostic_data(struct dmub_srv *dmub, struct dmub_diagnostic_data *diag_data);
 
+bool dmub_srv_should_detect(struct dmub_srv *dmub);
+
 #if defined(__cplusplus)
 }
 #endif
 
        REG_GET(DMCUB_REGION3_CW6_TOP_ADDRESS, DMCUB_REGION3_CW6_ENABLE, &is_cw6_enabled);
        diag_data->is_cw6_enabled = is_cw6_enabled;
 }
+
+bool dmub_dcn31_should_detect(struct dmub_srv *dmub)
+{
+       uint32_t fw_boot_status = REG_READ(DMCUB_SCRATCH0);
+       bool should_detect = fw_boot_status & DMUB_FW_BOOT_STATUS_BIT_DETECTION_REQUIRED;
+       return should_detect;
+}
+
 
 
 void dmub_dcn31_get_diagnostic_data(struct dmub_srv *dmub, struct dmub_diagnostic_data *diag_data);
 
+bool dmub_dcn31_should_detect(struct dmub_srv *dmub);
+
 #endif /* _DMUB_DCN31_H_ */
 
                funcs->set_outbox0_rptr = dmub_dcn31_set_outbox0_rptr;
 
                funcs->get_diagnostic_data = dmub_dcn31_get_diagnostic_data;
-
+               funcs->should_detect = dmub_dcn31_should_detect;
                funcs->get_current_time = dmub_dcn31_get_current_time;
 
                break;
        dmub->hw_funcs.get_diagnostic_data(dmub, diag_data);
        return true;
 }
+
+bool dmub_srv_should_detect(struct dmub_srv *dmub)
+{
+       if (!dmub->hw_init || !dmub->hw_funcs.should_detect)
+               return false;
+
+       return dmub->hw_funcs.should_detect(dmub);
+}