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 848DAC433F5 for ; Mon, 7 Feb 2022 10:57:09 +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:MIME-Version:Message-ID:In-reply-to: Date:Subject:To:From:References:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VF3NlWFkUAQy26XbkrtWpMi2IWvcHIZxl3wiBgq76zA=; b=ueC+x53HlkSGpK Xc1Q6ncHy/Ucf+t5Anfa49W+wVP49PDMsY6FTcFRudbGhf5ARtbt/9hvxN8pxlxvchspr6+1YR/Jf gkG6sZeIeuUdDAoxs5SkKmFhR0Z4oNmEjqyhTU74/hotkOWeirpKYdBOnwzmdXn9h+XI/OlCHKuPf xyRby5rTLFuW55d59vxrFtty3ANG8O7e71P6OhiGG/leXuSklAHqLZcBpNLWz+480AKm2WcSPeRd1 q6b/XoROAs/3FBUvymYyfDVttirGSzGiFZsBjQB993LRZ2cPmBP+esbXe9jpd2h+Ekj5fyTXs0TPO cxGBQGqMQSenSu5EG95A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nH1hf-009ude-IQ; Mon, 07 Feb 2022 10:57:03 +0000 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nH1hb-009ucD-AD for linux-amlogic@lists.infradead.org; Mon, 07 Feb 2022 10:57:01 +0000 Received: by mail-wm1-x329.google.com with SMTP id bg19-20020a05600c3c9300b0034565e837b6so7088452wmb.1 for ; Mon, 07 Feb 2022 02:56:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=references:user-agent:from:to:subject:date:in-reply-to:message-id :mime-version; bh=gCbLAdNfo6DzwKZZhiI2gvYSp0E58X2J6K8BZ7WMiCw=; b=HdVq6PkDWV64cO4Meh1wk8wgo8CdzN+zPTFC2pB2FI0bwgSi81Z/HYG5aXK5pBx5W9 CmRKZIAdtvIRSGLTDlE7WkPAMx3+g4v7iK/1sAjHYfFRJIQxN++xO0oQC3iVySbmeEr2 liwS39gPsfsrucyJX8zQIoivl9PssDAZCHqaTY/Q4YEotG+CRwK7yiaR7SA6dxoLkTLT XN4QMOE6TX7YM/Kbh9Mi64oJnP8lOtqYENqGa81nj35oCQXlA63fr2aOZkdR8SPGvjWe /QH8n567hcYJd3qk1Xz01BRQxfBCrVSfmkDJxRGb0BFFuatHy6dfNxj6/KD2RZaZSB2P 1GTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:references:user-agent:from:to:subject:date :in-reply-to:message-id:mime-version; bh=gCbLAdNfo6DzwKZZhiI2gvYSp0E58X2J6K8BZ7WMiCw=; b=hOOEU/8mSbmr+dJZwtxD9KulEYMlu7nffMUKbQJ5mu0qdc3B8n5ynb6XjmQ3wVOLQJ aUVSrWShvPVA7VKublhHXBJi/Nb4Nb2bjRZvthYym+L9s/Cl3qSSg+BsTQscq4ow+UIL 7QB7x/kZF+7TmI7LPyZm8A8oV2ViHSVbYWSmgkKjZetb112cy1uOteFqqhYZwtHDDTLm Z7UaujwlkPpJrbc2ivth5mjDitNsMeVrk0hpGLOkpVdE0vG1aJj4yPgXj+kgMLFYI9Z0 qTkBD9sYFL6zhCMCaLasFZeUvgHEbYXM8cWN8ds/PcHBB52D81wGQKrvAyknZwe+LzfA Fu+w== X-Gm-Message-State: AOAM530qG5aQT5pjEihlbOSOgy74OkRHtItNSq4TF86lN3G3lq2kpYbL /o6+6yO35zoQMjuDPx6reTyXEg== X-Google-Smtp-Source: ABdhPJya4Y4U2ZAbUsCovhbUSLiaQE9fPad2ZHKayIa+Ateyevndqek8qHHFBktc7reIkkgLh7oW+A== X-Received: by 2002:a7b:cbd7:: with SMTP id n23mr284984wmi.76.1644231416515; Mon, 07 Feb 2022 02:56:56 -0800 (PST) Received: from localhost (82-65-169-74.subs.proxad.net. [82.65.169.74]) by smtp.gmail.com with ESMTPSA id u14sm11073998wmq.41.2022.02.07.02.56.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Feb 2022 02:56:56 -0800 (PST) References: User-agent: mu4e 1.6.10; emacs 27.1 From: Jerome Brunet To: Erico Nunes , Alexandre Torgue , Giuseppe Cavallaro , Jose Abreu , Kevin Hilman , Martin Blumenstingl , Neil Armstrong , linux-amlogic@lists.infradead.org, netdev@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-sunxi@lists.linux.dev Subject: Re: net: stmmac: dwmac-meson8b: interface sometimes does not come up at boot Date: Mon, 07 Feb 2022 11:41:36 +0100 In-reply-to: Message-ID: <1jczjzt05k.fsf@starbuckisacylon.baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220207_025659_531885_B1BC25EC X-CRM114-Status: GOOD ( 31.78 ) X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org On Wed 02 Feb 2022 at 21:18, Erico Nunes wrote: > Hello, > > I've been tracking down an issue with network interfaces from > meson8b-dwmac sometimes not coming up properly at boot. > The target systems are AML-S805X-CC boards (Amlogic S805X SoC), I have > a group of them as part of a CI test farm that uses nfsroot. > > After hopefully ruling out potential platform/firmware and network > issues I managed to bisect this commit in the kernel to make a big > difference: > > 46f69ded988d2311e3be2e4c3898fc0edd7e6c5a net: stmmac: Use resolved > link config in mac_link_up() > > With a kernel before that commit, I am able to submit hundreds of test > jobs and the boards always start the network interface properly. > > After that commit, around 30% of the jobs start hitting this: > > [ 2.178078] meson8b-dwmac c9410000.ethernet eth0: PHY > [0.e40908ff:08] driver [Meson GXL Internal PHY] (irq=48) > [ 2.183505] meson8b-dwmac c9410000.ethernet eth0: Register > MEM_TYPE_PAGE_POOL RxQ-0 > [ 2.200784] meson8b-dwmac c9410000.ethernet eth0: No Safety > Features support found > [ 2.202713] meson8b-dwmac c9410000.ethernet eth0: PTP not supported by HW > [ 2.209825] meson8b-dwmac c9410000.ethernet eth0: configuring for > phy/rmii link mode > [ 3.762108] meson8b-dwmac c9410000.ethernet eth0: Link is Up - > 100Mbps/Full - flow control off > [ 3.783162] Sending DHCP requests ...... timed out! > [ 93.680402] meson8b-dwmac c9410000.ethernet eth0: Link is Down > [ 93.685712] IP-Config: Retrying forever (NFS root)... > [ 93.756540] meson8b-dwmac c9410000.ethernet eth0: PHY > [0.e40908ff:08] driver [Meson GXL Internal PHY] (irq=48) > [ 93.763266] meson8b-dwmac c9410000.ethernet eth0: Register > MEM_TYPE_PAGE_POOL RxQ-0 > [ 93.779340] meson8b-dwmac c9410000.ethernet eth0: No Safety > Features support found > [ 93.781336] meson8b-dwmac c9410000.ethernet eth0: PTP not supported by HW > [ 93.788088] meson8b-dwmac c9410000.ethernet eth0: configuring for > phy/rmii link mode > [ 93.807459] random: fast init done > [ 95.353076] meson8b-dwmac c9410000.ethernet eth0: Link is Up - > 100Mbps/Full - flow control off > > This still happens with a kernel from master, currently 5.17-rc2 (less > frequently but still often hit by CI test jobs). > The jobs still usually get to work after restarting the interface a > couple of times, but sometimes it takes 3-4 attempts. > > Here is one example and full dmesg: > https://gitlab.freedesktop.org/enunes/mesa/-/jobs/16452399/raw > > Note that DHCP does not seem to be an issue here, besides the fact > that the problem only happens since the mentioned commit under the > same setup, I did try to set up the boards to use a static ip but then > the interfaces just don't communicate at all from boot. > > For test purposes I attempted to revert > 46f69ded988d2311e3be2e4c3898fc0edd7e6c5a on top of master but that > does not apply trivially anymore, and by trying to revert it manually > I haven't been able to get a working interface. > > Any advice on how to further debug or fix this? Hi Erico, Thanks a lot for digging into this topic. I'm seeing exactly the same behavior on the g12 based khadas-vim3: * Boot stalled waiting for DHCP - with an NFS based filesystem * Every minute, the network driver gets a reset and try again Sometimes it works on the first attempt, sometimes it takes up to 5 attempts. Eventually, it reaches the prompt which might be why it went unnoticed so far. I think that NFS just makes the problem easier to see. On devices with an eMMC based filesystem, I noticed that, sometimes, I had unplug/plug the ethernet cable to make it go. So far, the problem is reported on all the Amlogic SoC generation we support. I think a way forward is to ask the the other users of stmmac whether they have this problem or not - adding Allwinner and Rockchip ML. Since the commit you have identified is in the generic part of the stmmac code, Maybe Jose can help us understand what is going on. > > Thanks > > Erico _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic