powerpc/eeh: Stop using do_gettimeofday()
This interface is inefficient and deprecated because of the y2038 overflow. ktime_get_seconds() is an appropriate replacement here, since it has sufficient granularity but is more efficient and uses monotonic time. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Acked-by: Russell Currey <ruscur@russell.cc> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
committed by
Michael Ellerman
parent
cbb55eeb49
commit
edfd17ff39
@@ -526,16 +526,16 @@ int eeh_rmv_from_parent_pe(struct eeh_dev *edev)
|
||||
*/
|
||||
void eeh_pe_update_time_stamp(struct eeh_pe *pe)
|
||||
{
|
||||
struct timeval tstamp;
|
||||
time64_t tstamp;
|
||||
|
||||
if (!pe) return;
|
||||
|
||||
if (pe->freeze_count <= 0) {
|
||||
pe->freeze_count = 0;
|
||||
do_gettimeofday(&pe->tstamp);
|
||||
pe->tstamp = ktime_get_seconds();
|
||||
} else {
|
||||
do_gettimeofday(&tstamp);
|
||||
if (tstamp.tv_sec - pe->tstamp.tv_sec > 3600) {
|
||||
tstamp = ktime_get_seconds();
|
||||
if (tstamp - pe->tstamp > 3600) {
|
||||
pe->tstamp = tstamp;
|
||||
pe->freeze_count = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user