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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BEB72C433FE for ; Mon, 25 Apr 2022 16:01:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=MVBSMDPOJmaQVYhT5tCGGmKq6gn43F3B9OKjfFBEHmo=; b=uINJzQb4lcAAwh +b3ioEMl5bduSiRa3tPWvR2vRWeMzUpqOgf8IbvhbpsizZePnvooLpaQYdZooHU7wy1mNN/9EiaxT /dvAUdNr88xODcZc8qeh+BdTwJgUQb8hFU2gAWCuZBrvq9K5alwd6lsU20Knftfd/NPnbR0JOLyS1 HEZwvGmTKUK7nflcPwBgWPrrhgAa4w006m4edd29y01BEEFznUVujUwZAwnKSDfSiodo6Rod1PYLs Hw5WOVVtMC9PvT2LVVRg5esQ4ncm6QXjcMYoChmBv25pl2zt83rbstxZnRnBCOP8aww7hiBW9qytn 490gD2sjl1n3kEhTvKrQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nj18C-00ACzU-AG; Mon, 25 Apr 2022 16:00:08 +0000 Received: from vps0.lunn.ch ([185.16.172.187]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nj188-00ACwc-Ul for linux-arm-kernel@lists.infradead.org; Mon, 25 Apr 2022 16:00:06 +0000 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=tRaJqis/SWifEwnFIxuNq9dKtN4ay+SViNUuz6JWxmk=; b=ThIeBmQ7cVrq3qfftbtHsbnhFH MiYIVhIeiwQ/zC36tF3MmFeJIOhZ44Dqen2123Qt3MHtjiUMCvgzTZMe09t+7P6rXQhYvtNg5n3CZ bFJfNCoHoel9E7T0uxFlETsFL7flcOd06A9jeEvnoaiSxTpfA1B9vekbC8viaq2dZQ8Y=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1nj17m-00HQ8g-4S; Mon, 25 Apr 2022 17:59:42 +0200 Date: Mon, 25 Apr 2022 17:59:42 +0200 From: Andrew Lunn To: Marcel Ziswiler Cc: "linux-imx@nxp.com" , "peppe.cavallaro@st.com" , "linux-stm32@st-md-mailman.stormreply.com" , "davem@davemloft.net" , "linux-kernel@vger.kernel.org" , "pabeni@redhat.com" , "shawnguo@kernel.org" , "joabreu@synopsys.com" , "kernel@pengutronix.de" , "s.hauer@pengutronix.de" , "kuba@kernel.org" , "alexandre.torgue@foss.st.com" , "mcoquelin.stm32@gmail.com" , "linux-arm-kernel@lists.infradead.org" , "netdev@vger.kernel.org" , "festevam@gmail.com" Subject: Re: net: stmmac: dwmac-imx: half duplex crash Message-ID: References: <36ba455aad3e57c0c1f75cce4ee0f3da69e139a1.camel@toradex.com> <5e51e11bbbf6ecd0ee23b4fd2edec98e6e7fbaa8.camel@toradex.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <5e51e11bbbf6ecd0ee23b4fd2edec98e6e7fbaa8.camel@toradex.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220425_090005_036423_C33B0BE2 X-CRM114-Status: GOOD ( 17.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 > Good point. I was blinded by NXP downstream which, while listing all incl. 10baseT/Half and 100baseT/Half as > supported link modes, also does not work. However, upstream indeed shows only full-duplex modes as supported: > > root@verdin-imx8mp-07106916:~# ethtool eth1 > Settings for eth1: > Supported ports: [ TP MII ] > Supported link modes: 10baseT/Full > 100baseT/Full > 1000baseT/Full So maybe we actually want ethtool to report -EINVAL when asked to do something which is not supported! Humm: https://elixir.bootlin.com/linux/latest/source/drivers/net/phy/phy.c#L783 /* We make sure that we don't pass unsupported values in to the PHY */ linkmode_and(advertising, advertising, phydev->supported); So maybe the unsupported mode got removed, and the PHY was asked to advertise nothing! Anyway, this is roughly there the check should go. > ... > > Once I remove them queues being setup via device tree it shows all modes as supported again: > > root@verdin-imx8mp-07106916:~# ethtool eth1 > Settings for eth1: > Supported ports: [ TP MII ] > Supported link modes: 10baseT/Half 10baseT/Full > 100baseT/Half 100baseT/Full > 1000baseT/Full > ... > > However, 10baseT/Half, while no longer just crashing, still does not seem to work right. Looking at wireshark > traces it does send packets but seems not to ever get neither ARP nor DHCP answers (as well as any other packet > for that matter). So the answers are on the wire, just not received? > Looks like the same actually applies to 10baseT/Full as well. While 100baseT/Half and > 100baseT/Full work fine now. > > Any idea what else could still be going wrong with them 10baseT modes? I would use mii-tool to check the status of the PHY. Make sure it really has negotiated 10/Half mode. After that, it is very likely to be a MAC problem, and i don't think i can help you. > On a side note, besides modifying the device tree for such single-queue setup being half-duplex capable, is > there any easier way? Much nicer would, of course, be if it justworkedTM (e.g. advertise all modes but once a > half-duplex mode is chosen revert to such single-queue operation). Then, on the other hand, who still uses > half-duplex communication in this day and age (;-p). You seem to need it for some reason! Anyway, it is just code. You have all the needed information in the adjust_link callback, so you could implement it. Andrew _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel