nxp-archive / openil_linuxptp

PTP IEEE 1588 stack for Linux
GNU General Public License v2.0
136 stars 60 forks source link

The implementation here is a bit confusing @sk.c line 352 #24

Open Dazzingdusk opened 3 years ago

Dazzingdusk commented 3 years ago
if (res < 1) {
    pr_err(res ? "poll for tx timestamp failed: %m" :
                         "timed out while polling for tx timestamp");
    pr_err("increasing tx_timestamp_timeout may correct "
                   "this issue, but it is likely caused by a driver bug");
        /* the errno is  0 or other value  ,*/
          return -errno;
} else if (!(pfd.revents & sk_revents)) {
 pr_err("poll for tx timestamp woke up on non ERR event");
 return -1;
}

I guess it is implemented like this?Otherwise errno is not necessarily modified by calling poll this time。

if (res < **0**) {
    pr_err(res ? "poll for tx timestamp failed: %m" :
                         "timed out while polling for tx timestamp");
    pr_err("increasing tx_timestamp_timeout may correct "
                   "this issue, but it is likely caused by a driver bug");
        /* the errno is  0 or other value  ,*/
          return -errno;
} else if (!(pfd.revents & sk_revents)) {
 pr_err("poll for tx timestamp woke up on non ERR event");
 return -1;
}