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=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 5EC25C38A2A for ; Fri, 8 May 2020 13:19:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 32F1624964 for ; Fri, 8 May 2020 13:19:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588943947; bh=92GMJ3vVz3kng28dkVP2FXCoZkRYgHbQffs0xOz9nSA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Oph5khHy85mBgqjUN5IQr/JuSg5iZfkWnAk06pYSlgN6DbXZDWyrgFEXMZzQ7e/az E5XnwlI6irQGE0huMPcKS51pYxyrzkVqMjEbBNeTnO22JvKZAM62ofrhUYh3UWlyCl KSwheBAWzWUikk/DQejO306ZKyqGTGUNmWNnwwuE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728957AbgEHMmc (ORCPT ); Fri, 8 May 2020 08:42:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:39630 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728951AbgEHMmc (ORCPT ); Fri, 8 May 2020 08:42:32 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 B8A6D21835; Fri, 8 May 2020 12:42:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588941751; bh=92GMJ3vVz3kng28dkVP2FXCoZkRYgHbQffs0xOz9nSA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MvEngcWYIHYMEzos8SN9sOKXwRzDHk/jc5BxWClC2jpx/4soH50Be42lh48rSNdln KI42KhDUSBqUhph2wHQQXjgZCmvP6bMxHZXgITBTwYGYqLto+9hHz+H6qXIUAkNU30 Ao/ZRQRgRVaYNso85lcW0hxpxpqnW5Y4OztYl5+4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Rivshin , Nicolas Chauvet , Andrew Goodbody , Mugunthan V N , "David S. Miller" Subject: [PATCH 4.4 158/312] drivers: net: cpsw: dont ignore phy-mode if phy-handle is used Date: Fri, 8 May 2020 14:32:29 +0200 Message-Id: <20200508123135.567401154@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200508123124.574959822@linuxfoundation.org> References: <20200508123124.574959822@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: David Rivshin commit ae092b5bded24d5dc7dae0e0aef4669c169ce874 upstream. The phy-mode emac property was only being processed in the phy_id or fixed-link cases. However if phy-handle was specified instead, an error message would complain about the lack of phy_id or fixed-link, and then jump past the of_get_phy_mode(). This would result in the PHY mode defaulting to MII, regardless of what the devicetree specified. Fixes: 9e42f715264f ("drivers: net: cpsw: add phy-handle parsing") Signed-off-by: David Rivshin Tested-by: Nicolas Chauvet Tested-by: Andrew Goodbody Reviewed-by: Mugunthan V N Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/ti/cpsw.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c @@ -2060,7 +2060,11 @@ static int cpsw_probe_dt(struct cpsw_pla slave_data->phy_node = of_parse_phandle(slave_node, "phy-handle", 0); parp = of_get_property(slave_node, "phy_id", &lenp); - if (of_phy_is_fixed_link(slave_node)) { + if (slave_data->phy_node) { + dev_dbg(&pdev->dev, + "slave[%d] using phy-handle=\"%s\"\n", + i, slave_data->phy_node->full_name); + } else if (of_phy_is_fixed_link(slave_node)) { struct device_node *phy_node; struct phy_device *phy_dev; @@ -2097,7 +2101,9 @@ static int cpsw_probe_dt(struct cpsw_pla PHY_ID_FMT, mdio->name, phyid); put_device(&mdio->dev); } else { - dev_err(&pdev->dev, "No slave[%d] phy_id or fixed-link property\n", i); + dev_err(&pdev->dev, + "No slave[%d] phy_id, phy-handle, or fixed-link property\n", + i); goto no_phy_slave; } slave_data->phy_if = of_get_phy_mode(slave_node);