@@ -2568,9 +2568,9 @@ static int dm_late_init(void *handle)
2568
2568
2569
2569
static void resume_mst_branch_status (struct drm_dp_mst_topology_mgr * mgr )
2570
2570
{
2571
+ u8 buf [UUID_SIZE ];
2572
+ guid_t guid ;
2571
2573
int ret ;
2572
- u8 guid [16 ];
2573
- u64 tmp64 ;
2574
2574
2575
2575
mutex_lock (& mgr -> lock );
2576
2576
if (!mgr -> mst_primary )
@@ -2591,26 +2591,27 @@ static void resume_mst_branch_status(struct drm_dp_mst_topology_mgr *mgr)
2591
2591
}
2592
2592
2593
2593
/* Some hubs forget their guids after they resume */
2594
- ret = drm_dp_dpcd_read (mgr -> aux , DP_GUID , guid , 16 );
2595
- if (ret != 16 ) {
2594
+ ret = drm_dp_dpcd_read (mgr -> aux , DP_GUID , buf , sizeof ( buf ) );
2595
+ if (ret != sizeof ( buf ) ) {
2596
2596
drm_dbg_kms (mgr -> dev , "dpcd read failed - undocked during suspend?\n" );
2597
2597
goto out_fail ;
2598
2598
}
2599
2599
2600
- if (memchr_inv (guid , 0 , 16 ) == NULL ) {
2601
- tmp64 = get_jiffies_64 ();
2602
- memcpy (& guid [0 ], & tmp64 , sizeof (u64 ));
2603
- memcpy (& guid [8 ], & tmp64 , sizeof (u64 ));
2600
+ import_guid (& guid , buf );
2604
2601
2605
- ret = drm_dp_dpcd_write (mgr -> aux , DP_GUID , guid , 16 );
2602
+ if (guid_is_null (& guid )) {
2603
+ guid_gen (& guid );
2604
+ export_guid (buf , & guid );
2606
2605
2607
- if (ret != 16 ) {
2606
+ ret = drm_dp_dpcd_write (mgr -> aux , DP_GUID , buf , sizeof (buf ));
2607
+
2608
+ if (ret != sizeof (buf )) {
2608
2609
drm_dbg_kms (mgr -> dev , "check mstb guid failed - undocked during suspend?\n" );
2609
2610
goto out_fail ;
2610
2611
}
2611
2612
}
2612
2613
2613
- import_guid (& mgr -> mst_primary -> guid , guid );
2614
+ guid_copy (& mgr -> mst_primary -> guid , & guid );
2614
2615
2615
2616
out_fail :
2616
2617
mutex_unlock (& mgr -> lock );
0 commit comments