Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3302850imm; Fri, 19 Oct 2018 08:24:53 -0700 (PDT) X-Google-Smtp-Source: ACcGV63kq3IiaADzmgijcosabd0NpWWdrM19e5i9tJdYj9RpTIzROOd+y7vYDOHttFFkDrVYWMG2 X-Received: by 2002:a62:d75e:: with SMTP id v30-v6mr2815554pfl.90.1539962693418; Fri, 19 Oct 2018 08:24:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539962693; cv=none; d=google.com; s=arc-20160816; b=V+l7MMXX87iStjIwp27W7nBOJsuf77BSCESW+PbtekovSHLS6RwnMU8gewnMzNyaI/ EiOpzXPDKvtzdz1fwLaDX3Wgb9bpuX2TyUcRGIy7gHO+V4RN83gEu2Ug6ZIM+3kez/XD Y9ixEsRS2P+WL5bLztn+C1Tt4WOIzH+E7Kw+OPQCc9aDwMJj77l0O004+1b0hyMKIkKl x/Tv22b3Wp3J1vkx928MIEaJOWSLp7TmDa1PuFq3wyJsES2iS3VgI86nqFdewL6MKzxL 5DSiebRMGd5IPLn3+F3wsWX+OzxIWzriScTU4KiNlKTocFJu4nXyYKi3SFe9Sd0KFK1p Jd3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:mime-version:user-agent:date:message-id:subject :from:cc:to; bh=HD9/Am9+h1jM/CxXciDoRd8IhMZbbM2HPXT4VmkdOxo=; b=WVqZVCTMYlrfQugKrvX7fEvuQ9Z+jGpztJXc5g21WSsd8WRypM8APnMzE9kAKzQz3i Q+4g56rJirCW5XsvS8BKU8RrCyfDVHP/r+x3fo2DKvIdOP28JtDwc+lz+W8WXJbfORPn Hf6Rk5elA9tBlZYs9IJQSbVgmrVKygVhikav5KJPSCppMryH8mbmmHUH3vGm75jqa4bu wHnt8tX2Rz7QrOkesptuOJEBjLAtc4/xTlYWUAbqI12yYEOcfsi0MgtJsJ6Qu4ZFwm6A QsaNz51aBpLRXzpRmP0xR1c85IKB+bIGZRBOyniks9VNHlAfcYQjWGIDvrH8ahnWOeXI WytA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i9-v6si25240278pgk.20.2018.10.19.08.24.38; Fri, 19 Oct 2018 08:24:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727370AbeJSX3L (ORCPT + 99 others); Fri, 19 Oct 2018 19:29:11 -0400 Received: from mout01.posteo.de ([185.67.36.141]:43846 "EHLO mout01.posteo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726667AbeJSX3L (ORCPT ); Fri, 19 Oct 2018 19:29:11 -0400 X-Greylist: delayed 452 seconds by postgrey-1.27 at vger.kernel.org; Fri, 19 Oct 2018 19:29:10 EDT Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 6DC1120DD7 for ; Fri, 19 Oct 2018 17:15:05 +0200 (CEST) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 42c8br21VTz6tmH; Fri, 19 Oct 2018 17:15:04 +0200 (CEST) To: Thomas Petazzoni Cc: Antoine Tenart , Gregory CLEMENT , Yelena Krivosheev , Maxime Chevallier , Nicolas Ferre , netdev@vger.kernel.org, linux-kernel@vger.kernel.org From: Richard Genoud Subject: CRC errors between mvneta and macb Message-ID: Date: Fri, 19 Oct 2018 17:15:03 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: fr Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, I've been struggling with a strange behavior between a clearfog-pro and an at91sam9g35-ek boards. TL;DR: ethernet frames are received with a CRC error on the clearfog ETH0, but seem perfectly all right. Add a switch between the 2 boards, and the ethernet frames are accepted. I've got a clearfog pro and an at91sam9g35-ek, both with kernel 4.19-rc8. An RJ45 cable is plugged between the clearfog (on the solo port (eth0)) and the g35-ek board (100Mb/s). They are configured with autoneg and a fixed IP address. I start the 2 board, and, with the clearfog I ping the g35-ek. If it succeeds, it will until the g35-ek is rebooted. If it fails, it also will until the g35-ek is rebooted. Rebooting the cleafog doesn't change anything. Resetting the g35-ek PHY (mii-diag -R) doesn't change anything either. When the ping fails, it's actually because the mvneta returns a CRC error: mvneta f1070000.ethernet eth0: bad rx status 0cc10000 (crc error), size=66 And, if I plug the RJ45 cable between the clearfog's matrix and the g35-ek, everything works well, always. To ease the debugging, instead of a ping I used: https://gist.github.com/austinmarton/1922600 from the g35-ek in order to have the same frame every time. So, I check with the scope the ethernet CRC (on the g35-ek PHY TXD[0-1] (DM9161A)). And the CRC is all right. I also manage to trigger this bug by simply doing: rmmod macb ; insmod macb.ko on the g35-ek. Then, frames are accepted, or not. I checked all PHY/macb register values on the g35-ek, they are the same. The only thing I could find is related to the TXCLK on the PHY. When there's a CRC error, the TXCLK has its polarity inverted... That's a clue ! But this TXCLK (25MHz) is not used on the g35-ek. Only the REFCLK/XT2 (50MHz) is used to synchronise the PHY and the macb. So I guess that the TXCLK has a role to play to generate TX+/TX- And I also guess that when the signal is converted back on the clearfog, the clock polarity is somehow responsible for the CRC errors. I was heading to get my scope on the clearfog's PHY to see what it received, but Marvell's documentation is not as freely available as Atmel's ones, so I'm quite stuck at this point. Any idea ? NB: I also managed to trigger this with an at91sam9g20-ek (but not with a sama5d2) Regards, Richard