From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0985C433E0 for ; Wed, 24 Jun 2020 09:58:45 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AF1B82088E for ; Wed, 24 Jun 2020 09:58:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="h5OZ7kbg"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="VUwwGOA3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AF1B82088E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=qzMb6VYZ12QnZYVUcXn62jsyiBc+BMX/VjAXEjM6apI=; b=h5OZ7kbgm4c9tXvO5pVsyXfx4 LP8IQgFxqXqkdEtmbShxehv8qp14wjx5L8zu34iCpT/2lpzSyt4ptzwx2XvPmgvFLGd5sQiXvsQTm SBMsjxIOZlCg6BnrdNU7nubqDjVeL1ItJpvuznADpbRBUU0Z8ZEZlbuke7FhKz2yO1hTyPy2CxlAQ Ah4vqXyubYB6etE6KWF7Ttkl6DognM27J/q7tqKeMddQ73lqERURuD8CEqrogaPJS3oiCdRURMkC0 CKCM2it3hgHfgO8mDZ4wYhgSzwrfspf03c7WvIFsZaUup92++L4Zy13ZE+2rj4/VqnoZ+G+GKxkWe tmwBt6xOQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jo29U-0008C3-WC; Wed, 24 Jun 2020 09:57:09 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jo29S-0007ZW-2i for linux-arm-kernel@lists.infradead.org; Wed, 24 Jun 2020 09:57:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=88KQOG6XVKFLe8l1a2buG0sRs1RMztmoAEts+TmmAY8=; b=VUwwGOA34gLYHkj8Ep97sKRx5 66CPiBQM5QJ8C85ptkaCtf5AwRJrasE+JPHnJCdWNYki/y0yaPL1PGKnWUqKg96vdEREKf/Iyz25h X4Z77rgwDNYt9GXPd/aDtDLHiPnj11bmPVNZz6Qn7uVtKwEOhlGNRBeUlMnvnkqL2SqaBtLIvKJvw 2Mvo0ZwdUYP+wCLlSXR8HQPWafjgmeLEO39NCoSM1gEXwtYOkFzEf7jDYXFaEFegTUFDJv42CUzuT D6XD/VBNTBOtT1C2vEAfZ1BXdaPm5Bm7TuMvCVxOI9h0RLfaBGYixNRA0/oSRCqBYBHKeCTiWD1ZE tIobfFXwg==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:59054) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jo27T-0002q1-1V; Wed, 24 Jun 2020 10:55:03 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1jo27S-0001qe-QR; Wed, 24 Jun 2020 10:55:02 +0100 Date: Wed, 24 Jun 2020 10:55:02 +0100 From: Russell King - ARM Linux admin To: Sascha Hauer Subject: Re: [PATCH 2/2] net: ethernet: mvneta: Add back interface mode validation Message-ID: <20200624095502.GZ1551@shell.armlinux.org.uk> References: <20200624070045.8878-1-s.hauer@pengutronix.de> <20200624070045.8878-2-s.hauer@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200624070045.8878-2-s.hauer@pengutronix.de> User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jun 24, 2020 at 09:00:45AM +0200, Sascha Hauer wrote: > When writing the serdes configuration register was moved to > mvneta_config_interface() the whole code block was removed from > mvneta_port_power_up() in the assumption that its only purpose was to > write the serdes configuration register. As mentioned by Russell King > its purpose was also to check for valid interface modes early so that > later in the driver we do not have to care for unexpected interface > modes. > Add back the test to let the driver bail out early on unhandled > interface modes. > > Signed-off-by: Sascha Hauer Fixes: b4748553f53f ("net: ethernet: mvneta: Fix Serdes configuration for SoCs without comphy") Reviewed-by: Russell King Thanks. > --- > drivers/net/ethernet/marvell/mvneta.c | 22 +++++++++++++++++++--- > 1 file changed, 19 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c > index c4552f868157c..c639e3a293024 100644 > --- a/drivers/net/ethernet/marvell/mvneta.c > +++ b/drivers/net/ethernet/marvell/mvneta.c > @@ -5009,10 +5009,18 @@ static void mvneta_conf_mbus_windows(struct mvneta_port *pp, > } > > /* Power up the port */ > -static void mvneta_port_power_up(struct mvneta_port *pp, int phy_mode) > +static int mvneta_port_power_up(struct mvneta_port *pp, int phy_mode) > { > /* MAC Cause register should be cleared */ > mvreg_write(pp, MVNETA_UNIT_INTR_CAUSE, 0); > + > + if (phy_mode != PHY_INTERFACE_MODE_QSGMII && > + phy_mode != PHY_INTERFACE_MODE_SGMII && > + !phy_interface_mode_is_8023z(phy_mode) && > + !phy_interface_mode_is_rgmii(phy_mode)) > + return -EINVAL; > + > + return 0; > } > > /* Device initialization routine */ > @@ -5198,7 +5206,11 @@ static int mvneta_probe(struct platform_device *pdev) > if (err < 0) > goto err_netdev; > > - mvneta_port_power_up(pp, phy_mode); > + err = mvneta_port_power_up(pp, pp->phy_interface); > + if (err < 0) { > + dev_err(&pdev->dev, "can't power up port\n"); > + return err; > + } > > /* Armada3700 network controller does not support per-cpu > * operation, so only single NAPI should be initialized. > @@ -5352,7 +5364,11 @@ static int mvneta_resume(struct device *device) > } > } > mvneta_defaults_set(pp); > - mvneta_port_power_up(pp, pp->phy_interface); > + err = mvneta_port_power_up(pp, pp->phy_interface); > + if (err < 0) { > + dev_err(device, "can't power up port\n"); > + return err; > + } > > netif_device_attach(dev); > > -- > 2.27.0 -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel