File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -2096,12 +2096,13 @@ static void it6505_hdcp_wait_ksv_list(struct work_struct *work)
2096
2096
struct it6505 * it6505 = container_of (work , struct it6505 ,
2097
2097
hdcp_wait_ksv_list );
2098
2098
struct device * dev = it6505 -> dev ;
2099
- unsigned int timeout = 5000 ;
2100
- u8 bstatus = 0 ;
2099
+ u8 bstatus ;
2101
2100
bool ksv_list_check ;
2101
+ /* 1B-04 wait ksv list for 5s */
2102
+ unsigned long timeout = jiffies +
2103
+ msecs_to_jiffies (5000 ) + 1 ;
2102
2104
2103
- timeout /= 20 ;
2104
- while (timeout > 0 ) {
2105
+ for (;;) {
2105
2106
if (!it6505_get_sink_hpd_status (it6505 ))
2106
2107
return ;
2107
2108
@@ -2110,13 +2111,12 @@ static void it6505_hdcp_wait_ksv_list(struct work_struct *work)
2110
2111
if (bstatus & DP_BSTATUS_READY )
2111
2112
break ;
2112
2113
2113
- msleep (20 );
2114
- timeout -- ;
2115
- }
2114
+ if (time_after (jiffies , timeout )) {
2115
+ DRM_DEV_DEBUG_DRIVER (dev , "KSV list wait timeout" );
2116
+ goto timeout ;
2117
+ }
2116
2118
2117
- if (timeout == 0 ) {
2118
- DRM_DEV_DEBUG_DRIVER (dev , "timeout and ksv list wait failed" );
2119
- goto timeout ;
2119
+ msleep (20 );
2120
2120
}
2121
2121
2122
2122
ksv_list_check = it6505_hdcp_part2_ksvlist_check (it6505 );
You can’t perform that action at this time.
0 commit comments