Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2463979imd; Fri, 2 Nov 2018 11:51:52 -0700 (PDT) X-Google-Smtp-Source: AJdET5dI+KF9KBGdDYi64BcVyqfHd4QRZoyIJGHe6ER8OMWOYMoJT8i7K5BBe/kpUkm3czgsiFZG X-Received: by 2002:a62:2fc1:: with SMTP id v184-v6mr12806327pfv.115.1541184712646; Fri, 02 Nov 2018 11:51:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541184712; cv=none; d=google.com; s=arc-20160816; b=dbuY1kV1jIIC24vyJ2JubbYAQ0VsGxbiZzlUXCv9GVfrtYErYMhgC/RHmwQ4GBpxQG VRKDQ1mGHhnA1EhH20FvQv1xvx1+GX+Sanuc5yeolKjkI/XViAa8lfkdxuZhf/iCt1Rg EGtK84eZKOqsn3V1EOcUKZsssNd+ucflGbvuHh8a7QnLK9wsiM1z5Vn6pO6DrSBlYhyw ALOtoDRNJH/6xXAAHBUHgPKQA3GhBiY8nvyLJsGd0/Z3eReNTEZJq/qccoPibNNyAoSc wwAUZBmLT36EUWdBHrtv8ZuvxGNw9ZiB8RYdL5jt8xX1KJGcprQva52+j5C6d7BV+v6+ tERA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+NaRrQoeBFcMudIRGxxnHE3NrbAxHOefHxnFxZPSji0=; b=HLnXB+gmI/FCv8IDpWlIlh/5JqOjx0BogM2RvRQubFpzvae2aMapY+6UzllHAQAZ/V XbwpDtEAB/OP2uI899sasitEzOGHPTgq8hzwWlHn/sdDZdR4hxSmtROpsUR+bRvWq+F9 v+F30wnumZacj+OO4EO30Sc3zc7ij8NLmBWnK9Ie9wUF8674gK/GTFdJEt4RQoIwqxV4 YKXZcxSGuVc5BZs2q5SvCWWmEKnjDAGp0eL84O5vRkSnrSfRAgrlbFDurn0TxvvE7l8h VF9GPLB9QhhIeZtrMOLJbcu/wLaZqXO1yNrL6NY3LlOs0pH+cwbXW/kooDt7rdvagGjz SVGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QRlOgxZf; 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 d34si4060982pgb.43.2018.11.02.11.51.38; Fri, 02 Nov 2018 11:51:52 -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; dkim=pass header.i=@kernel.org header.s=default header.b=QRlOgxZf; 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 S1730469AbeKCD72 (ORCPT + 99 others); Fri, 2 Nov 2018 23:59:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:55176 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729339AbeKCD72 (ORCPT ); Fri, 2 Nov 2018 23:59:28 -0400 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DECF62082D; Fri, 2 Nov 2018 18:51:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541184673; bh=x6CQ0s9Aa3WathYO6waZll+VY+raGYIHjGhpjy+SVAA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QRlOgxZff6ZS/INj1NDPVmLZrv5RdtMw3mekheQ1QUmffbxxn3Mh088vhIiOAMhsd Xi/dqg3shkvCIfC2QGTo2Fq4rKPM0e0qBN0KqmcKUWrGKHT3RoVM/P2xo2h0DxsCBH AwJikidK2CrVxsU3PU9jwKpLxloK+OKEV26+tJ4M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kevin Hao , "David S. Miller" , Sasha Levin Subject: [PATCH 4.14 064/143] net: phy: Add general dummy stubs for MMD register access Date: Fri, 2 Nov 2018 19:34:09 +0100 Message-Id: <20181102182902.279267153@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181102182857.064326086@linuxfoundation.org> References: <20181102182857.064326086@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 5df7af85ecd88e8b5f1f31d6456c3cf38a8bbdda ] For some phy devices, even though they don't support the MMD extended register access, it does have some side effect if we are trying to read/write the MMD registers via indirect method. So introduce general dummy stubs for MMD register access which these devices can use to avoid such side effect. Fixes: b6b5e8a69118 ("gianfar: Disable EEE autoneg by default") Signed-off-by: Kevin Hao Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/phy/phy_device.c | 17 +++++++++++++++++ include/linux/phy.h | 4 ++++ 2 files changed, 21 insertions(+) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index a174d05a9752..fe76e2c4022a 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -1641,6 +1641,23 @@ int genphy_config_init(struct phy_device *phydev) } EXPORT_SYMBOL(genphy_config_init); +/* This is used for the phy device which doesn't support the MMD extended + * register access, but it does have side effect when we are trying to access + * the MMD register via indirect method. + */ +int genphy_read_mmd_unsupported(struct phy_device *phdev, int devad, u16 regnum) +{ + return -EOPNOTSUPP; +} +EXPORT_SYMBOL(genphy_read_mmd_unsupported); + +int genphy_write_mmd_unsupported(struct phy_device *phdev, int devnum, + u16 regnum, u16 val) +{ + return -EOPNOTSUPP; +} +EXPORT_SYMBOL(genphy_write_mmd_unsupported); + int genphy_suspend(struct phy_device *phydev) { int value; diff --git a/include/linux/phy.h b/include/linux/phy.h index dca9e926b88f..efc04c2d92c9 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -879,6 +879,10 @@ static inline int genphy_no_soft_reset(struct phy_device *phydev) { return 0; } +int genphy_read_mmd_unsupported(struct phy_device *phdev, int devad, + u16 regnum); +int genphy_write_mmd_unsupported(struct phy_device *phdev, int devnum, + u16 regnum, u16 val); /* Clause 45 PHY */ int genphy_c45_restart_aneg(struct phy_device *phydev); -- 2.17.1