From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757631AbbEVUPT (ORCPT ); Fri, 22 May 2015 16:15:19 -0400 Received: from shards.monkeyblade.net ([149.20.54.216]:50435 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756048AbbEVUPQ (ORCPT ); Fri, 22 May 2015 16:15:16 -0400 Date: Fri, 22 May 2015 16:15:11 -0400 (EDT) Message-Id: <20150522.161511.1791346966770946099.davem@davemloft.net> To: aparames@broadcom.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, rjui@broadcom.com, sbranden@broadcom.com, jdzheng@broadcom.com Subject: Re: [PATCH 1/1] net: core: 'ethtool' issue with querying phy settings From: David Miller In-Reply-To: <1432157730-26865-2-git-send-email-aparames@broadcom.com> References: <1432157730-26865-1-git-send-email-aparames@broadcom.com> <1432157730-26865-2-git-send-email-aparames@broadcom.com> X-Mailer: Mew version 6.6 on Emacs 24.5 / 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]); Fri, 22 May 2015 13:15:16 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arun Parameswaran Date: Wed, 20 May 2015 14:35:30 -0700 > When trying to configure the settings for PHY1, using commands > like 'ethtool -s eth0 phyad 1 speed 100', the 'ethtool' seems to > modify other settings apart from the speed of the PHY1, in the > above case. > > The ethtool seems to query the settings for PHY0, and use this > as the base to apply the new settings to the PHY1. This is > causing the other settings of the PHY 1 to be wrongly > configured. > > The issue is caused by the '_ethtool_get_settings()' API, which > gets called because of the 'ETHTOOL_GSET' command, is clearing > the 'cmd' pointer (of type 'struct ethtool_cmd') by calling > memset. This clears all the parameters (if any) passed for the > 'ETHTOOL_GSET' cmd. So the driver's callback is always invoked > with 'cmd->phy_address' as '0'. > > The '_ethtool_get_settings()' is called from other files in the > 'net/core'. So the fix is applied to the 'ethtool_get_settings()' > which is only called in the context of the 'ethtool'. > > Signed-off-by: Arun Parameswaran > Reviewed-by: Ray Jui > Reviewed-by: Scott Branden Applied and queued up for -stable, thanks.