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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51E02C433EF for ; Tue, 26 Apr 2022 13:37:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233677AbiDZNk0 (ORCPT ); Tue, 26 Apr 2022 09:40:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243111AbiDZNkY (ORCPT ); Tue, 26 Apr 2022 09:40:24 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [185.16.172.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01C194198F; Tue, 26 Apr 2022 06:37:12 -0700 (PDT) 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=l4h0Ov9OzmifR5jldxkma+y1tJv7QCkgxeL1WbcVp2I=; b=vGRJbhRGckl9QnEYvsb4P+RCnc cua3k6wPbIPbIu3JCsJ8VLa6meBL5p23ZHiDphp+sDc/ZuaEcKn9wMqiYtOVxS5NS5MbNnQfTC4iH iEsWZAc5fY0ReNehxoSgLoHaBmifIfYByjwW15JkwHWmfYrAB+6ETgQYXrk0C1/3grjk=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1njLN9-00HYfD-GM; Tue, 26 Apr 2022 15:36:55 +0200 Date: Tue, 26 Apr 2022 15:36:55 +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" , "netdev@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "festevam@gmail.com" Subject: Re: net: stmmac: dwmac-imx: half duplex crash Message-ID: References: <36ba455aad3e57c0c1f75cce4ee0f3da69e139a1.camel@toradex.com> <5e51e11bbbf6ecd0ee23b4fd2edec98e6e7fbaa8.camel@toradex.com> <8f8cdcf584c13faf8bcdc2abfdb62b09950ea652.camel@toradex.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8f8cdcf584c13faf8bcdc2abfdb62b09950ea652.camel@toradex.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > Anyway, this is roughly there the check should go. > > You mean it would need an additional check against advertising nothing? I would check for a mode being requested which is not supported. phydev->supported tells you what the MAC/PHY can actually do. If there is a bit set which is not a member of that, return EINVAL. I don't think the plumbing is there, but netlink ethtool allows you to also return a text message via extack, so you could give the user a bit more information, the link mode which is invalid. > Well, we are gearing up on our automated testing infrastructure and asking my humble opinion on what exactly to > test concerning the Ethernet subsystem I gave the brilliant suggestion to try each and every supported link > mode (;-p). Which actually works just fine on every other hardware of ours just not the i.MX 8M Plus with the > DWMAC IP (remember, even FEC MAC works). So for now this is not something a customer of ours has real trouble > with but it raised some questions concerning whether or not and what exactly we do support... So in practice, this should not happen. You don't advertise the half modes, so you should never end up in a half mode. So it is not a problem :-) Andrew 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 88A31C433F5 for ; Tue, 26 Apr 2022 13:38:32 +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=06VcqADGoZy0QiqmuBIbgzNHZnEbQ48+qG0SsIiFeHo=; b=aI6rwwQfMI3fCK 9xPCGh2w5VJSZ0mVI0KgUcorUpM0epgn3+CboTRzyrpNVbf6DEIw1FJTSRCbs3N4eQju1iHmNByy9 FlS/BFuWBzC+NRyArX7wv1ktz8y5EWsMWKYlVx1k2wkTDiKoo57bVKEeSk8nxx112+ENLuwIcI7fN OoKX4ME3O/JwOnRbQ8muuBcT3Wkee+dSmWOquitPnQI6zmHQFuHfwyvdAurbulN0pSrYoDXCb7n2J zI5a3wkT/oQPDkSSH6bnGnBH78W2SCkifJ2CoGHWtBVVWq+Zzg78RAH+jLf/JyTi7ylCJ0mZ12QBC 4JnieUe022mZ06GilCxA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1njLNd-00Ef1a-PD; Tue, 26 Apr 2022 13:37:26 +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 1njLNX-00Eey9-Ig for linux-arm-kernel@lists.infradead.org; Tue, 26 Apr 2022 13:37:21 +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=l4h0Ov9OzmifR5jldxkma+y1tJv7QCkgxeL1WbcVp2I=; b=vGRJbhRGckl9QnEYvsb4P+RCnc cua3k6wPbIPbIu3JCsJ8VLa6meBL5p23ZHiDphp+sDc/ZuaEcKn9wMqiYtOVxS5NS5MbNnQfTC4iH iEsWZAc5fY0ReNehxoSgLoHaBmifIfYByjwW15JkwHWmfYrAB+6ETgQYXrk0C1/3grjk=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1njLN9-00HYfD-GM; Tue, 26 Apr 2022 15:36:55 +0200 Date: Tue, 26 Apr 2022 15:36:55 +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" , "netdev@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "festevam@gmail.com" Subject: Re: net: stmmac: dwmac-imx: half duplex crash Message-ID: References: <36ba455aad3e57c0c1f75cce4ee0f3da69e139a1.camel@toradex.com> <5e51e11bbbf6ecd0ee23b4fd2edec98e6e7fbaa8.camel@toradex.com> <8f8cdcf584c13faf8bcdc2abfdb62b09950ea652.camel@toradex.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <8f8cdcf584c13faf8bcdc2abfdb62b09950ea652.camel@toradex.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220426_063719_698634_4B6FD209 X-CRM114-Status: GOOD ( 13.21 ) 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 > > Anyway, this is roughly there the check should go. > > You mean it would need an additional check against advertising nothing? I would check for a mode being requested which is not supported. phydev->supported tells you what the MAC/PHY can actually do. If there is a bit set which is not a member of that, return EINVAL. I don't think the plumbing is there, but netlink ethtool allows you to also return a text message via extack, so you could give the user a bit more information, the link mode which is invalid. > Well, we are gearing up on our automated testing infrastructure and asking my humble opinion on what exactly to > test concerning the Ethernet subsystem I gave the brilliant suggestion to try each and every supported link > mode (;-p). Which actually works just fine on every other hardware of ours just not the i.MX 8M Plus with the > DWMAC IP (remember, even FEC MAC works). So for now this is not something a customer of ours has real trouble > with but it raised some questions concerning whether or not and what exactly we do support... So in practice, this should not happen. You don't advertise the half modes, so you should never end up in a half mode. So it is not a problem :-) Andrew _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel