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=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 3D72CC4338F for ; Wed, 28 Jul 2021 19:24:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 100B76101E for ; Wed, 28 Jul 2021 19:24:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230443AbhG1TYO (ORCPT ); Wed, 28 Jul 2021 15:24:14 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:50576 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229542AbhG1TYN (ORCPT ); Wed, 28 Jul 2021 15:24:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=aFv9sT0cxR5NccK1AcZhjra4GfhXLnSG8WtLz1k6r8Y=; b=FG5CsXWVwG3OcJTtQGk+/6Q7Bq XQ0vLKoIDw33mNyK/W1ie+huQXXc3JLn5GqRR/SeWsisoCGwPLtJQaN4yEAQbUVDN44vX02OxJ33y wRPYr3onZBm8gSCpAwVUJ+7btmYy98LV1zrFl5AhORZ8JciShTyjxyW9j1bpcGoQYJrE=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1m8pA2-00FDy7-Om; Wed, 28 Jul 2021 21:24:10 +0200 Date: Wed, 28 Jul 2021 21:24:10 +0200 From: Andrew Lunn To: Dario Alcocer Cc: netdev@vger.kernel.org Subject: Re: Marvell switch port shows LOWERLAYERDOWN, ping fails Message-ID: References: <82974be6-4ccc-3ae1-a7ad-40fd2e134805@helixd.com> <527bcc43-d99c-f86e-29b0-2b4773226e38@helixd.com> <59790fef-bf4a-17e5-4927-5f8d8a1645f7@helixd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <59790fef-bf4a-17e5-4927-5f8d8a1645f7@helixd.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, Jul 28, 2021 at 11:33:35AM -0700, Dario Alcocer wrote: > On 7/28/21 11:23 AM, Andrew Lunn wrote: > > On Wed, Jul 28, 2021 at 11:07:37AM -0700, Dario Alcocer wrote: > > > It appears the port link-state issue is caused by the mv88e6xxx switch > > > driver. The function mv88e6xxx_mac_config identifies the PHY as internal and > > > skips the call to mv88e6xxx_port_setup_mac. > > > > > > It does not make sense to me why internal PHY configuration should be > > > skipped. > > > > The switch should do the configuration itself for internal PHYs. At > > least that works for other switches. What value does CMODE have for > > the port? 0xf? > > > > Andrew > > > > Is CMODE available via the DSA debugfs? Here are the registers for port0, > which should be lan1: > > root@dali:~# ls /sys/kernel/debug/dsa/switch0/ > port0/ port1/ port2/ port3/ port4/ port5/ > port6/ tag_protocol tree > root@dali:~# ls /sys/kernel/debug/dsa/switch0/port0/ > fdb mdb regs stats vlan > root@dali:~# cat /sys/kernel/debug/dsa/switch0/port0/regs > 0: 100f It is the lower nibble of this register. So 0xf. Take a look at: https://github.com/lunn/mv88e6xxx_dump/blob/master/mv88e6xxx_dump.c The 1 in 100f means it has found the PHY. But there is no link, 10/Half duplex, etc. > 1: 0003 This at least looks sensible. Nothing is forced, normal speed detection should be performed. So what should happen is the link speed, duplex etc from the internal PHY should directly appear in register 0. There is no need for software to ask the PHY and then configure the MAC. Andrew