From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161173AbcFOQpM (ORCPT ); Wed, 15 Jun 2016 12:45:12 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:47859 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932671AbcFOQpI (ORCPT ); Wed, 15 Jun 2016 12:45:08 -0400 Subject: Re: [PATCH 04/15] drivers: net: cpsw: ethtool: fix accessing to suspended device To: Florian Fainelli , "David S. Miller" , , Sekhar Nori , Mugunthan V N References: <20160615115603.4897-1-grygorii.strashko@ti.com> <20160615115603.4897-5-grygorii.strashko@ti.com> <57617ECF.2010902@gmail.com> CC: , , Ivan Khoronzhuk , Rob Herring , From: Grygorii Strashko Message-ID: <5761860C.2020502@ti.com> Date: Wed, 15 Jun 2016 19:45:00 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: <57617ECF.2010902@gmail.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/15/2016 07:14 PM, Florian Fainelli wrote: > On 06/15/2016 04:55 AM, Grygorii Strashko wrote: >> The CPSW might be suspended by RPM if all ethX interfaces are down, >> but it still could be accesible through ethtool interfce. In this case >> ethtool operations, requiring registers access, will cause L3 errors and >> CPSW crash. >> >> Hence, fix it by adding RPM get/put calls in ethtool callbcaks which >> can access CPSW registers: .set_coalesce(), .get_ethtool_stats(), >> .set_pauseparam(), .get_regs() > > Provided that you implement an ethtool_ops::begin, it will be called > before each ethtool operation runs, so that could allow you to eliminate > some of the duplication here. Conversely ethtool_ops::end terminates > each operation and can be used for that purpose. Ah. Thanks for the advice. (assume you've meant .complete()) -- regards, -grygorii