File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -1955,11 +1955,23 @@ static bool_t hid_ups_walk(walkmode_t mode)
19551955
19561956 case HU_WALKMODE_FULL_UPDATE :
19571957 /* These don't need polling after initinfo() */
1958- if (item -> hidflags & (HU_FLAG_ABSENT | HU_TYPE_CMD | HU_FLAG_STATIC ))
1958+ if (item -> hidflags & (HU_FLAG_ABSENT | HU_TYPE_CMD ))
19591959 continue ;
19601960
1961- /* These need to be polled after user changes (setvar / instcmd) */
1962- if ( (item -> hidflags & HU_FLAG_SEMI_STATIC ) && (data_has_changed == FALSE) )
1961+ /* These don't need polling after initinfo() normally
1962+ * However in "pollonly" mode we use these to detect "Data stale"
1963+ * condition (e.g. cable disconnected) by failing the reads:
1964+ */
1965+ if ((item -> hidflags & HU_FLAG_STATIC ) && use_interrupt_pipe )
1966+ continue ;
1967+
1968+ /* These need to be polled after user changes (setvar / instcmd)
1969+ * or to detect "Data stale" in "pollonly" mode
1970+ */
1971+ if ( (item -> hidflags & HU_FLAG_SEMI_STATIC )
1972+ && (data_has_changed == FALSE)
1973+ && use_interrupt_pipe
1974+ )
19631975 continue ;
19641976
19651977 break ;
@@ -2074,7 +2086,7 @@ static bool_t hid_ups_walk(walkmode_t mode)
20742086 if (ups_infoval_set (item , value ) != 1 )
20752087 continue ;
20762088
2077- if (mode == HU_WALKMODE_INIT ) {
2089+ if (mode == HU_WALKMODE_INIT || (! use_interrupt_pipe ) ) {
20782090 info_lkp_t * info_lkp ;
20792091
20802092 dstate_setflags (item -> info_type , item -> info_flags );
You can’t perform that action at this time.
0 commit comments