Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753959AbcK1B35 (ORCPT ); Sun, 27 Nov 2016 20:29:57 -0500 Received: from shards.monkeyblade.net ([184.105.139.130]:36444 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752675AbcK1B3s (ORCPT ); Sun, 27 Nov 2016 20:29:48 -0500 Date: Sun, 27 Nov 2016 20:29:45 -0500 (EST) Message-Id: <20161127.202945.1759992980026862076.davem@davemloft.net> To: nikita.yoush@cogentembedded.com Cc: fugang.duan@nxp.com, troy.kisky@boundarydevices.com, andrew@lunn.ch, eric@nelint.com, tremyfr@gmail.com, johannes@sipsolutions.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, cphealy@gmail.com Subject: Re: [PATCH] net: fec: turn on device when extracting statistics From: David Miller In-Reply-To: <1480068120-22137-1-git-send-email-nikita.yoush@cogentembedded.com> References: <1480068120-22137-1-git-send-email-nikita.yoush@cogentembedded.com> X-Mailer: Mew version 6.7 on Emacs 25.1 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Sun, 27 Nov 2016 16:30:22 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 516 Lines: 16 From: Nikita Yushchenko 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.