Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp37858imb; Thu, 28 Feb 2019 15:14:39 -0800 (PST) X-Google-Smtp-Source: APXvYqyaoF6nbrAv2LzeJv2fBSqrubOrbLU0g8SVDoOHmvpFqqxZ0cFmRh/74tvdeWY0Py0oWdQ4 X-Received: by 2002:a17:902:8d89:: with SMTP id v9mr2082209plo.254.1551395679032; Thu, 28 Feb 2019 15:14:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551395679; cv=none; d=google.com; s=arc-20160816; b=DMs5otCMBTKTLco3rD9TKDpv3rKDNG+re4dQAh3Bskm1BQTc1iHbCUd8MFvUDfdPM8 kTVHx9ePkJv6azG4GoBrJSn/NdLGFhC23L+h+yhdokVpc0xxK9Hq2rdGfj9/Nd4UO845 r60woGlNFW4qwuITAzTYtoJmlqvWNidLkHQALMebUmb7tP54YyOKxm5yprJOv7esJFu9 nzREDKslhQjIvneiRrK0jDi+Ns0VYkB0NSTM5avggWSrDhevueouZKTwREnOXEq6BhTG 3uAACuOeBjfyao3cA7rTYIqT0h7zZmk8oWSpljZeF1GwTN9ELtw2CT7YgQoGOjdmSU+u OrvA== 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 :message-id:date:subject:cc:to:from; bh=iP+uq+QlTqhqCOpSFRugSRi5SyZpbUPsAd8XnobAKq8=; b=VPGHYUEiennPuG0g+CuKXGFwsexux45SavrP9/NFMKihB2MIjhvgZ3UlIy8c/QzSC7 vW5I3lEu4cWNSnbvBW4RSlLsbGbqeKdwmec5yTqHqaOxfOpyfEDHublIOPro0hbF+uLk 9MawjTM9LVXaIbjpGO7mQPoE7TwSlBO4aqbBZDsGGuAhDfN+MQCOOga4cCjUed6tLnb3 jlMNwzjBV//IZT1qAvYKlrjqZJtPwANpGwbujLL2olYUIb6W1+J0z2GaPKOqfkvoPEhN Xbhpcg9pb1YcANBHb68o5akM6HoBpAs1qRfR9eDY11dlEwXP0Ca6OjTrzesBJWtpeslA R6gQ== 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 u4si19038894pgh.278.2019.02.28.15.14.24; Thu, 28 Feb 2019 15:14:39 -0800 (PST) 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 S1729231AbfB1VOu (ORCPT + 99 others); Thu, 28 Feb 2019 16:14:50 -0500 Received: from relay11.mail.gandi.net ([217.70.178.231]:53181 "EHLO relay11.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726467AbfB1VOt (ORCPT ); Thu, 28 Feb 2019 16:14:49 -0500 Received: from mc-bl-xps13.lan (lfbn-tou-1-149-99.w86-201.abo.wanadoo.fr [86.201.231.99]) (Authenticated sender: maxime.chevallier@bootlin.com) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 1A5E5100007; Thu, 28 Feb 2019 21:14:42 +0000 (UTC) From: Maxime Chevallier To: davem@davemloft.net Cc: Maxime Chevallier , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Lunn , Florian Fainelli , Heiner Kallweit , Vivien Didelot , linux-arm-kernel@lists.infradead.org, Antoine Tenart , thomas.petazzoni@bootlin.com, gregory.clement@bootlin.com, miquel.raynal@bootlin.com, nadavh@marvell.com, stefanc@marvell.com Subject: [PATCH net] net: dsa: mv88e6xxx: power serdes on/off for 10G interfaces on 6390X Date: Thu, 28 Feb 2019 22:14:33 +0100 Message-Id: <20190228211433.14211-1-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Upon setting the cmode on 6390 and 6390X, the associated serdes interfaces must be powered off/on. Both 6390X and 6390 share code to do so, but it currently uses the 6390 specific helper mv88e6390_serdes_power() to disable and enable the serdes interface. This call will fail silently on 6390X when trying so set a 10G interface such as XAUI or RXAUI, since mv88e6390_serdes_power() internally grabs the lane number based on modes supported by the 6390, and returns 0 when getting -ENODEV as a lane number. Using mv88e6390x_serdes_power() should be safe here, since we explicitly rule-out all ports but the 9 and 10, and because modes supported by 6390 ports 9 and 10 are a subset of those supported on 6390X. This was tested on 6390X using RXAUI mode. Fixes: 364e9d7776a3 ("net: dsa: mv88e6xxx: Power on/off SERDES on cmode change") Signed-off-by: Maxime Chevallier --- drivers/net/dsa/mv88e6xxx/port.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/dsa/mv88e6xxx/port.c b/drivers/net/dsa/mv88e6xxx/port.c index ebd26b6a93e6..4b02c96f6786 100644 --- a/drivers/net/dsa/mv88e6xxx/port.c +++ b/drivers/net/dsa/mv88e6xxx/port.c @@ -408,7 +408,7 @@ int mv88e6390x_port_set_cmode(struct mv88e6xxx_chip *chip, int port, return err; } - err = mv88e6390_serdes_power(chip, port, false); + err = mv88e6390x_serdes_power(chip, port, false); if (err) return err; @@ -424,7 +424,7 @@ int mv88e6390x_port_set_cmode(struct mv88e6xxx_chip *chip, int port, if (err) return err; - err = mv88e6390_serdes_power(chip, port, true); + err = mv88e6390x_serdes_power(chip, port, true); if (err) return err; -- 2.19.2