From patchwork Tue Jul 25 20:45:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 108704 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp28929qge; Tue, 25 Jul 2017 13:46:00 -0700 (PDT) X-Received: by 10.101.85.206 with SMTP id k14mr20214192pgs.153.1501015560015; Tue, 25 Jul 2017 13:46:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501015560; cv=none; d=google.com; s=arc-20160816; b=K/7UEjfn1TdrwnHX/Y3AKZRbdT7wKOk9SycSz4ZVBQaMKa0f3QCxLdPsKfTm9oG2Xn 4KrJFDAdHKIMWxY4MOhgI6bjXhwLxPEL+3zUC9tn8kRgsIV5Uim3gdtIlH4bYj0tVtzd JVlW8NpTeU3a5BtMPXqbXQGblWBfFVFN/M8Kz0fAUUEeVtumTEhX0qSyj+MrcI+86jxk J/NY1mXq4g4W0OHZnBI8c5tJ41kZRp2b/zlQAuXfAYzFKYBkzIVcXlADG6mHF5pREhLp emuBA6EBZNzTHf3/Qh3F84rPMPPAVcPrD9hWMBTgflFXuhFwsHjps4aP3V2AA5Ip1NNA n5jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=Hqdx6fqXvRQYHBYQ/c/n71dGveslt2HMO4kzrdcslxE=; b=U1S0+UEXTqsI8NwbRfbPxCRdeX0UDps4mtoJCZGIT8NzyibjPqwRwwsCxajyT7fdkp nopL9qP6VUF/lznjC2Ix4Luch+0zGANjtor3DFTPKo5Gg5tyOqRLYDabj6e1keCMZIJf 3l8TGgNo2/HAUGlIsS390QdFjhIK98bfFXzvzWmMqDrzeWxHTMPm7SU8XJL2jCYKLZR7 lDyEkJGEvXbdqE4ui4AyhvZkwHTfI3AdmEg0NT+y3YWZygh+x2StR6rY0wSX1i/yzW97 Li4WI9xPRCGKVeSc46c156m+g0mMAOjrWHrk5wCyUWei66cMVl+U88nm/Ifp4HHqFmG0 fuBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=NaQ6VJXe; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u1si9102153plm.762.2017.07.25.13.45.59; Tue, 25 Jul 2017 13:46:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.b=NaQ6VJXe; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752609AbdGYUp5 (ORCPT + 6 others); Tue, 25 Jul 2017 16:45:57 -0400 Received: from mail-pg0-f50.google.com ([74.125.83.50]:35197 "EHLO mail-pg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752552AbdGYUpz (ORCPT ); Tue, 25 Jul 2017 16:45:55 -0400 Received: by mail-pg0-f50.google.com with SMTP id v190so74826560pgv.2 for ; Tue, 25 Jul 2017 13:45:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Hqdx6fqXvRQYHBYQ/c/n71dGveslt2HMO4kzrdcslxE=; b=NaQ6VJXe7G3owi8w7zL8LkdOXdWRj4fWFMcrwIByIwvZJ+G1Pr/BLr/F9xpAFraB6i MfG60ZcnG8pYFEd/AoUMxi++cpNffkQypqNTGkkTv65tRA3B7tDCnsbHi2Vv3JB5y+Rq folTVu9HkhAW2FiUxLqoERGwpPLiZPe8nQ9rE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Hqdx6fqXvRQYHBYQ/c/n71dGveslt2HMO4kzrdcslxE=; b=Frz6zoEItIjNRN47XPaHsoG+GRkleGeqgrX8fjXdtMCq4w/IGEnhGiYxC6FlTOyqR/ NL8bLekSCtaUTcHM38O1kluKRXAVszI1RBUK16nMPMPmUFmKjnPhsAH6tQSCQHp15arG rYYYNcJ0pln4SHhIu/ocHXn5ILzLki0VBmqjxhsymh973C/ZW/X9gC4b4fzUeXPOlvrA eB31GuRTtlnTPYWqnmDu2YuqDtYOkZBdVwjKXXmxwIt94G2OCRMGqdg4FhusoGSH6yY8 STH6btlnTfFaX1fpOeCm4XQBWbmsOfxT9N6YDCUZlA2rkN88UYfDDH355bfZmccPd9mB 5byA== X-Gm-Message-State: AIVw110fT6LwUMmrG2FIAhhXmWWEqLPCRjQn0Q7HL6UmZfhNytAzf1Uu VSMnksBiYo0ENRoG X-Received: by 10.98.214.217 with SMTP id a86mr17118594pfl.244.1501015555246; Tue, 25 Jul 2017 13:45:55 -0700 (PDT) Received: from localhost.localdomain ([106.51.135.235]) by smtp.gmail.com with ESMTPSA id d4sm532125pfj.59.2017.07.25.13.45.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 25 Jul 2017 13:45:54 -0700 (PDT) From: Amit Pundir To: Greg KH Cc: Stable , Florian Fainelli , "David S . Miller" Subject: [PATCH for-3.18 08/15] net: phy: Do not perform software reset for Generic PHY Date: Wed, 26 Jul 2017 02:15:19 +0530 Message-Id: <1501015526-32178-9-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1501015526-32178-1-git-send-email-amit.pundir@linaro.org> References: <1501015526-32178-1-git-send-email-amit.pundir@linaro.org> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Florian Fainelli commit 0878fff1f42c18e448ab5b8b4f6a3eb32365b5b6 upstream. The Generic PHY driver is a catch-all PHY driver and it should preserve whatever prior initialization has been done by boot loader or firmware agents. For specific PHY device configuration it is expected that a specialized PHY driver would take over that role. Resetting the generic PHY was a bad idea that has lead to several complaints and downstream workarounds e.g: in OpenWrt/LEDE so restore the behavior prior to 87aa9f9c61ad ("net: phy: consolidate PHY reset in phy_init_hw()"). Reported-by: Felix Fietkau Fixes: 87aa9f9c61ad ("net: phy: consolidate PHY reset in phy_init_hw()") Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller Signed-off-by: Amit Pundir --- drivers/net/phy/phy_device.c | 2 +- include/linux/phy.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) -- 2.7.4 diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 70a0d88de654..9f8e10a240db 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -1341,7 +1341,7 @@ static struct phy_driver genphy_driver[] = { .phy_id = 0xffffffff, .phy_id_mask = 0xffffffff, .name = "Generic PHY", - .soft_reset = genphy_soft_reset, + .soft_reset = genphy_no_soft_reset, .config_init = genphy_config_init, .features = PHY_GBIT_FEATURES | SUPPORTED_MII | SUPPORTED_AUI | SUPPORTED_FIBRE | diff --git a/include/linux/phy.h b/include/linux/phy.h index d090cfcaa167..fbdacd1278e3 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -737,6 +737,10 @@ int genphy_read_status(struct phy_device *phydev); int genphy_suspend(struct phy_device *phydev); int genphy_resume(struct phy_device *phydev); int genphy_soft_reset(struct phy_device *phydev); +static inline int genphy_no_soft_reset(struct phy_device *phydev) +{ + return 0; +} void phy_driver_unregister(struct phy_driver *drv); void phy_drivers_unregister(struct phy_driver *drv, int n); int phy_driver_register(struct phy_driver *new_driver);