lkml.org 
[lkml]   [2016]   [Nov]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] net: fec: turn on device when extracting statistics
From
From: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
Date: Mon, 28 Nov 2016 10:06:31 +0300

>
>
> 28.11.2016 04:29, David Miller пишет:
>> From: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
>> Date: Fri, 25 Nov 2016 13:02:00 +0300
>>
>>> + int i, ret;
>>> +
>>> + ret = pm_runtime_get_sync(&fep->pdev->dev);
>>> + if (IS_ERR_VALUE(ret)) {
>>> + memset(data, 0, sizeof(*data) * ARRAY_SIZE(fec_stats));
>>> + return;
>>> + }
>>
>> This really isn't the way to do this.
>>
>> When the device is suspended and the clocks are going to be stopped,
>> you must fetch the statistic values into a software copy and provide
>> those if the device is suspended when statistics are requested.
>
> Ok, can do that, although can't see what's wrong with waking device
> here. The situation of requesting stats on down device isn't something
> widely used, thus keeping handling of that as local as possible looks
> better for me.

The issue is the fact that you need error handling at all and might
therefore provide a set of zero stats to the user when that entire
possibility could have been avoided in the first place by recording
the stats at suspend time.

\
 
 \ /
  Last update: 2016-11-28 15:12    [W:0.029 / U:0.632 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site