linux-next: manual merge of the drm tree with the origin tree
Subsystems (3)
Mark Brown
maintainerHi all,
Today's linux-next merge of the drm tree got conflicts in:
drivers/gpu/drm/xe/xe_hw_error.c
drivers/gpu/drm/xe/xe_pm.c
between commits:
a890a885b982f ("drm/xe/hw_error: Guard csc_hw_error_work() with runtime PM") fc0ba46fd8278 ("drm/xe: Access GT MMIO after pcode init") a17c5ed0dc715 ("drm/xe/pm: Apply tile workarounds after PCODE initialization")
from the origin tree and commits:
323047eeee980 ("drm/xe: Separate drm-ras netlink data from device and firmware RAS state") fc8d229d76102 ("drm/xe/hw_error: Guard csc_hw_error_work() with runtime PM") 638d116d755ed ("drm/xe: Access GT MMIO after pcode init")
1f6ac7c86aa52 ("drm/xe: Memset g2g buffer on resume")
6569aa6628799 ("drm/xe/xe_late_bind_fw: Refactor pm flow")
641ffb2132839 ("drm/xe/pm: Apply tile workarounds after PCODE initialization") be082ef8157b7 ("drm/xe/pm: skip BO eviction on iGPU for non-hibernation sleep") 3541c71284fa8 ("drm/xe/hw_error: Reuse CSC worker for generic error handling") 14bbd417a6e0f ("drm/xe/hw_error: Initialize hw_error_work per tile") b6bd6c613fd5e ("drm/xe: Add support for wa_14028434957")
ff03d9510426e ("drm/xe/pm: Introduce xe_device_suspend/resume()")
from the drm tree.
I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.
drivers/gpu/drm/xe/xe_hw_error.c +0 -0
@@@ -5,6 -5,8 +5,8 @@@#include <linux/bitmap.h> +#include <generated/xe_device_wa_oob.h> +#include "regs/xe_gsc_regs.h" #include "regs/xe_hw_error_regs.h" #include "regs/xe_irq_regs.h" #include "xe_hw_error.h" #include "xe_mmio.h" #include "xe_pm.h" +#include "xe_ras.h" #include "xe_survivability_mode.h" +#include "xe_wa.h" +#include "xe_wedge.h" +#define GT_HW_ERROR_MAX_ERR_BITS 16#define HEC_UNCORR_FW_ERR_BITS 4 pvc_master_local_fatal_err_reg : \ pvc_master_local_nonfatal_err_reg) - static void csc_hw_error_work(struct work_struct *work) + static void hw_error_work(struct work_struct *work) { - struct xe_tile *tile = container_of(work, typeof(*tile), csc_hw_error_work); + struct xe_tile *tile = container_of(work, typeof(*tile), hw_error_work);struct xe_device *xe =tile_to_xe (tile); +/* Skip hw error processing if device is already wedged */ +if (xe_wedged (xe)) +return ; +guard (xe_pm_runtime)(xe); + +if (xe->info.has_sysctrl &&XE_DEVICE_WA (xe,14028434957 )) { +/* +* Skip handling if an uncorrectable internal error is reported as +* reset is imminent +*/ +if (xe_ras_is_aer_internal_error (xe)) +return ; + +xe_ras_process_errors (xe); +return ; + } +xe_survivability_mode_runtime_enable (xe); } hec_uncorrected_fw_errors[err_bit], severity_str, err_bit); -schedule_work (&tile->csc_hw_error_work); +schedule_work (&tile->hw_error_work); } } {const char *severity_str = error_severity[severity];struct xe_device *xe =tile_to_xe (tile); -struct xe_drm_ras *ras = &xe->ras; +struct xe_drm_ras *ras = &xe->ras.nl_data;struct xe_drm_ras_counter *info = ras->info[severity];const char *name; {const enum drm_xe_ras_error_severity severity =hw_err_to_severity (hw_err);struct xe_device *xe =tile_to_xe (tile); -struct xe_drm_ras *ras = &xe->ras; +struct xe_drm_ras *ras = &xe->ras.nl_data;struct xe_drm_ras_counter *info = ras->info[severity];struct xe_mmio *mmio = &tile->mmio;unsigned long err_stat =0 ;const enum drm_xe_ras_error_severity severity =hw_err_to_severity (hw_err);const char *severity_str = error_severity[severity];struct xe_device *xe =tile_to_xe (tile); -struct xe_drm_ras *ras = &xe->ras; +struct xe_drm_ras *ras = &xe->ras.nl_data;struct xe_drm_ras_counter *info = ras->info[severity];unsigned long flags, err_src;u32 err_bit;return ;/* -* Hardware errors are reported through System Controller on the platforms that -* support it, and never routed as direct IRQ to SGUnit. So we should never be -* here for those platforms. +* Non-fatal errors are routed as a direct IRQ on platforms that support +* system controller. */ if (xe->info.has_sysctrl) { -drm_err_ratelimited (&xe->drm,HW_ERR "Invalid error routing\n" ); +drm_err_ratelimited (&xe->drm,HW_ERR "Non-fatal %s reported\n" , severity_str); +schedule_work (&tile->hw_error_work);return ; }enum hardware_error hw_err;if (xe_fault_csc_hw_error ()) -schedule_work (&tile->csc_hw_error_work); +schedule_work (&tile->hw_error_work);for (hw_err =0 ; hw_err <HARDWARE_ERROR_MAX ; hw_err++) { if (master_ctl & ERROR_IRQ(hw_err)) } } +/** +* xe_hw_error_work_disable - Disable hw error work +* @arg: xe device instance +* +* This function disables work for hardware error handling for all tiles. +*/ +void xe_hw_error_work_disable (void *arg) + { +struct xe_device *xe = arg; +struct xe_tile *tile; +u8 id; + +if (!IS_DGFX (xe) ||IS_SRIOV_VF (xe)) +return ; + +for_each_tile (tile, xe, id) +disable_work_sync (&tile->hw_error_work); + } +/** * xe_hw_error_init - Initialize hw errors * @xe: xe device instance */ void xe_hw_error_init (struct xe_device *xe) { -struct xe_tile *tile =xe_device_get_root_tile (xe); +struct xe_tile *tile; +u8 id;if (!IS_DGFX (xe) ||IS_SRIOV_VF (xe))return ; -INIT_WORK (&tile->csc_hw_error_work, csc_hw_error_work); +for_each_tile (tile, xe, id) +INIT_WORK (&tile->hw_error_work, hw_error_work);process_hw_errors (xe); +devm_add_action_or_reset (xe->drm.dev, xe_hw_error_work_disable, xe); }
drivers/gpu/drm/xe/xe_pm.c +0 -0
@@@ -167,59 -167,38 +167,38 @@@ static void xe_rpm_lockmap_release(cons} /** -* xe_pm_suspend - Helper for System suspend, i.e. S0->S3 / S0->S2idle +* xe_pm_needs_bo_evict() - Check if bo eviction is needed +* @xe: The xe device. +* @hibernate: Hibernation event +* +* Return: %true if bo eviction is needed, %false otherwise. +*/ +bool xe_pm_needs_bo_evict (struct xe_device *xe,bool hibernate) + { +return IS_DGFX (xe) || hibernate; + } + +/** +* xe_pm_suspend - Helper for System suspend, i.e. S0->S3 / S0->S2idle / S0->S4 * @xe: xe device instance +* @hibernate: true if preparing for S4 hibernation, false for < S4 suspend * * Return: 0 on success */ -int xe_pm_suspend (struct xe_device *xe) +int xe_pm_suspend (struct xe_device *xe,bool hibernate) { -struct xe_gt *gt; -u8 id;int err;drm_dbg (&xe->drm,"Suspending device\n" );xe_pm_block_begin_signalling ();trace_xe_pm_suspend (xe,__builtin_return_address (0 )); - err =xe_pxp_pm_suspend (xe->pxp); + err =xe_device_suspend (xe, hibernate, false);if (err) - goto err; +drm_dbg (&xe->drm,"Device suspend failed %d\n" , err); +else +drm_dbg (&xe->drm,"Device suspended\n" ); -xe_late_bind_wait_for_worker_completion (&xe->late_bind); - -for_each_gt (gt, xe, id) -xe_gt_suspend_prepare (gt); - -xe_display_pm_suspend (xe); - -/* FIXME: Super racey... */ - err =xe_bo_evict_all (xe); -if (err) - goto err_display; - -for_each_gt (gt, xe, id) { - err =xe_gt_suspend (gt); -if (err) - goto err_display; - } - -xe_irq_suspend (xe); - -xe_display_pm_suspend_late (xe); - -xe_i2c_pm_suspend (xe); - -drm_dbg (&xe->drm,"Device suspended\n" ); -xe_pm_block_end_signalling (); - -return 0 ; - - err_display: -xe_display_pm_resume (xe); -xe_pxp_pm_resume (xe->pxp); - err: -drm_dbg (&xe->drm,"Device suspend failed %d\n" , err);xe_pm_block_end_signalling ();return err; } */int xe_pm_resume (struct xe_device *xe) { -struct xe_tile *tile; -struct xe_gt *gt; -u8 id;int err;xe_pm_block_begin_signalling ();drm_dbg (&xe->drm,"Resuming device\n" );trace_xe_pm_resume (xe,__builtin_return_address (0 )); - err =xe_pcode_ready (xe, true); + err =xe_device_resume (xe, false);if (err) -return err; +drm_dbg (&xe->drm,"Device resume failed %d\n" , err); +else +drm_dbg (&xe->drm,"Device resumed\n" ); -for_each_tile (tile, xe, id) -xe_wa_apply_tile_workarounds (tile); - -for_each_gt (gt, xe, id) -xe_gt_idle_disable_c6 (gt); - -xe_display_pm_resume_early (xe); - -/* -* This only restores pinned memory which is the memory required for the -* GT(s) to resume. -*/ - err =xe_bo_restore_early (xe); -if (err) - goto err; - -xe_i2c_pm_resume (xe, true); - -xe_sysctrl_pm_resume (xe); - -xe_irq_resume (xe); - -for_each_gt (gt, xe, id) { - err =xe_gt_resume (gt); -if (err) -break ; - } - -/* -* Try to bring up display before bailing from GT resume failure, -* so we don't leave the user clueless with a blank screen. -*/ -xe_display_pm_resume (xe); -if (err) - goto err; - - err =xe_bo_restore_late (xe); -if (err) - goto err; - -xe_pxp_pm_resume (xe->pxp); - -if (IS_VF_CCS_READY (xe)) -xe_sriov_vf_ccs_register_context (xe); - -xe_late_bind_fw_load (&xe->late_bind); - -drm_dbg (&xe->drm,"Device resumed\n" ); -xe_pm_block_end_signalling (); -return 0 ; - err: -drm_dbg (&xe->drm,"Device resume failed %d\n" , err);xe_pm_block_end_signalling ();return err; }struct xe_validation_ctx ctx;reinit_completion (&xe->pm_block); +if (!xe_pm_needs_bo_evict (xe, action ==PM_HIBERNATION_PREPARE )) +break ; +xe_pm_block_begin_signalling ();xe_pm_runtime_get (xe); (void )xe_validation_ctx_init (&ctx, &xe->val,NULL , case PM_POST_SUSPEND: complete_all(&xe->pm_block); xe_pm_wake_rebind_workers(xe); +if (!xe_pm_needs_bo_evict (xe, action ==PM_POST_HIBERNATION )) +break ; +xe_bo_notifier_unprepare_all_pinned (xe);xe_pm_runtime_put (xe);break ;xe_wa_apply_tile_workarounds (tile);for_each_gt (gt, xe, id) -xe_gt_idle_disable_c6 (gt); +xe_gt_resume_early (gt);xe_display_pm_resume_early (xe);xe_sriov_vf_ccs_register_context (xe);if (xe->d3cold.allowed) -xe_late_bind_fw_load (&xe->late_bind); +xe_late_bind_pm_resume (&xe->late_bind); out:xe_rpm_lockmap_release (xe);