From patchwork Tue Jul 25 20:07:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 108686 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp14194obm; Tue, 25 Jul 2017 13:07:44 -0700 (PDT) X-Received: by 10.84.217.19 with SMTP id o19mr22456835pli.305.1501013264809; Tue, 25 Jul 2017 13:07:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501013264; cv=none; d=google.com; s=arc-20160816; b=05Ygk6JbL9NPs7KuTQLV4nfwPuSEO9KSnNbKwZM5oDzHYCXZ3MNwpBJOaBeX//0Nz3 p8W24y+1M8LzMbLDDgURKg8GuO6LCB+x3/6hwOfrwAJU8G0Aqw9Mnilr3a+BqDs6wD/g UsUe1B2I2lSVxu9SzieCbyhycXDKOHY07Cn2TuCeH08iV6ikJTuCpWJX6AkL5/ZatdTA LJvC1tMrGsxIWThSPv/ozWTt/X0bEL1WB4frmLcbLG4tO3i0dXU7VGlh3aJlH/gN8MGJ gCu+YLk7qb3rsHLrHAaHtHKKzFZiiXGYeJjNZWrxEzPoEoLizMifyz4xoKdVKmPGoVjs l5Ug== 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=nOvsCL5dKEhdK8MM+4THvePmB4/pjKYRFdn8OvNiC+g=; b=Z302YUQDvJKxkYvKThUfgOXOOu1VE7hwWPJ1HkbtAKnp9QIDc1DkVmMO7LPhUgKTJ1 pHDf3BFrJ/ZH2i4kaI//Xpbt7+0cl1k2QLjbGvt1XSznDWmyQDifFNXV6FqUyDhCDsmJ pP9Ecjnga13ap42AVjZ7hRcLfuiDB0ESYHGazBPVB5W7gLXxL2DcJeMi/nMiPdDH/X0C ZJsZpUaNwaLXnS5eYYh8AOre1PpwafreKoRpL8wRACv+09IpCJpziY4OeBklOaP1nes8 ZL1J8ceLdhxhrmEkxRhquVFSukU7HjOQlLMNsVAxlC6HUC5kiDSxVe3TgYTD5XRYMrAk uK7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=M/hb7Auv; 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 h10si8970990plk.237.2017.07.25.13.07.44; Tue, 25 Jul 2017 13:07:44 -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=M/hb7Auv; 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 S1753453AbdGYUHn (ORCPT + 6 others); Tue, 25 Jul 2017 16:07:43 -0400 Received: from mail-pf0-f180.google.com ([209.85.192.180]:33129 "EHLO mail-pf0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752319AbdGYUHm (ORCPT ); Tue, 25 Jul 2017 16:07:42 -0400 Received: by mail-pf0-f180.google.com with SMTP id s70so62311170pfs.0 for ; Tue, 25 Jul 2017 13:07:41 -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=nOvsCL5dKEhdK8MM+4THvePmB4/pjKYRFdn8OvNiC+g=; b=M/hb7AuveRi3Axn4uPm3afEa181c5T+MNxxjntzWi7IHv/5CqOsMyQI6CLZx+gby3T xPfISKbl7unGgiNrb8TagMtTWbVb6eAFjROBn+K/lrA2eb7e2NRP90JXu0fvjAAef6jQ qiM2lgnkVMK5T200Yw9qodEqXtllTtgY206YU= 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=nOvsCL5dKEhdK8MM+4THvePmB4/pjKYRFdn8OvNiC+g=; b=fEIg1vhFl04i6Vvtcpd3on1JMo5C+R56FB4zmNBSoM8jV9PZ1nZLbfhh5U5ItgK4pu eDF61Djsl1PAZfsZrpeJ44cz6MxI+wisdaxzmmXscTbHYiusy7UeN2Y7vQ9Ic1mAfdUV icQeViiJQVIaul0AVnCPpYZ41NTK0Zviil1uyvd+FydABTcQ9I50yAdizooMw8vW7bYp 1hETw1Moj9hE8EsS5uDva8U676TsTj+WBHtOrSc9t3djsEPq5xaIdytjvpFvBz0+xy0k RsrEYatL1dITQK8g/pJrv+xfr3dh7ApC5cUyCH1Ght1bECfWegl5s+3rIfA8eN4mbJm7 fiOw== X-Gm-Message-State: AIVw112End2JuJLxDElZ+TtfqM172BsGsGmc/QJ1t0mi6l7FtLfB5ZHm dxkU3bTCZo8BaRbR X-Received: by 10.84.225.134 with SMTP id u6mr49036plj.176.1501013261563; Tue, 25 Jul 2017 13:07:41 -0700 (PDT) Received: from localhost.localdomain ([106.51.135.235]) by smtp.gmail.com with ESMTPSA id c76sm27684356pfj.91.2017.07.25.13.07.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 25 Jul 2017 13:07:40 -0700 (PDT) From: Amit Pundir To: Greg KH Cc: Stable , Florian Fainelli , "David S . Miller" Subject: [PATCH for-4.4 05/13] net: phy: Do not perform software reset for Generic PHY Date: Wed, 26 Jul 2017 01:37:13 +0530 Message-Id: <1501013241-31961-6-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1501013241-31961-1-git-send-email-amit.pundir@linaro.org> References: <1501013241-31961-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 0bfbabad4431..1d1e5f7723ab 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -1442,7 +1442,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 05fde31b6dc6..b64825d6ad26 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -785,6 +785,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);