Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp985468ybd; Wed, 26 Jun 2019 09:11:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqyIrO5oJJbHi5R2urDSvBy8vUDJgQBdr83ApXcxuXfHylipPEDGegEvW39ZvzmDE1xLvuLW X-Received: by 2002:a17:90a:26e4:: with SMTP id m91mr5691204pje.93.1561565491551; Wed, 26 Jun 2019 09:11:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561565491; cv=none; d=google.com; s=arc-20160816; b=bjNanLbL+vsw/zpfdmdpJquSP9DPW977GTDdbcKx7LnjzY22rxAtszgWyquQPD0gzo e8ENhj7JZr0iDd0ZaCwQoz+fvUoRxQiso5l7JUklkAqvzqrt2tAbWcUjY3zyOHUjiwiB yZYJskLwWAfQtQgvXZ5ozT1y7jw0r+Cx3feK2ntPj3vx36/s+7wkoP7YaUhrEV86WQnu 3Vzyx1kwCa3CYlwezSTmkTAUWuy1+H9402K93aR5DCGlR60n0Uj+5lNQbB3MZOK1AYtT g3ydHQNt1r580w5alWeVRdHpE1fl08PBao/OfHSd3dgEmCLOXR9hNT7Bzuzgnt9eWgPD UEIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=KJSoY4l0uizj29TGkmgPwCMcCSCt3n9TViI1gjeXrL0=; b=Y49BQin8vqiU7/z2sRuC2QWaK8HA1ijAunhlfDH3Mpr9nQai5nG27bAHZ9FgrPIHbi IJ9xmVjd0uBY3oH2kdzfa5MF3O5wrmFNDwd8kd69dZFGvdiqryu21GWbWwPI4BQnurXy 3cP6VWtW8zaoTvOcbMRuwRrHlS8Jyt5nlbwoXIWR2Ov8V6wBZcVbCpqMJepRW4b6sqFj vCPv9pfEKONIPRZAY0q0UhS90DJS6chZ00RECwrJeYERr62vcBcDNai/dDyhaM1AqxgJ vgRZMgS3W4+vp8TeAURDNvYtJ9YBsQghkX65rT6SXHmyKaLPckUGTUgXP6ighli2LrRS ubNA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x4si2510666pju.0.2019.06.26.09.11.15; Wed, 26 Jun 2019 09:11:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726612AbfFZQLD (ORCPT + 99 others); Wed, 26 Jun 2019 12:11:03 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:37258 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725958AbfFZQLC (ORCPT ); Wed, 26 Jun 2019 12:11:02 -0400 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::d71]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 4719D144FF0E6; Wed, 26 Jun 2019 09:11:02 -0700 (PDT) Date: Wed, 26 Jun 2019 09:11:01 -0700 (PDT) Message-Id: <20190626.091101.141287264489993877.davem@davemloft.net> To: jonathanh@nvidia.com Cc: peppe.cavallaro@st.com, alexandre.torgue@st.com, joabreu@synopsys.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org Subject: Re: [PATCH 2/2] net: stmmac: Fix crash observed if PHY does not support EEE From: David Miller In-Reply-To: <20190626102322.18821-2-jonathanh@nvidia.com> References: <20190626102322.18821-1-jonathanh@nvidia.com> <20190626102322.18821-2-jonathanh@nvidia.com> X-Mailer: Mew version 6.8 on Emacs 26.1 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]); Wed, 26 Jun 2019 09:11:02 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jon Hunter Date: Wed, 26 Jun 2019 11:23:22 +0100 > If the PHY does not support EEE mode, then a crash is observed when the > ethernet interface is enabled. The crash occurs, because if the PHY does > not support EEE, then although the EEE timer is never configured, it is > still marked as enabled and so the stmmac ethernet driver is still > trying to update the timer by calling mod_timer(). This triggers a BUG() > in the mod_timer() because we are trying to update a timer when there is > no callback function set because timer_setup() was never called for this > timer. > > The problem is caused because we return true from the function > stmmac_eee_init(), marking the EEE timer as enabled, even when we have > not configured the EEE timer. Fix this by ensuring that we return false > if the PHY does not support EEE and hence, 'eee_active' is not set. > > Fixes: 74371272f97f ("net: stmmac: Convert to phylink and remove phylib logic") > Signed-off-by: Jon Hunter Applied.