From patchwork Thu Apr 15 13:07:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksij Rempel X-Patchwork-Id: 12205443 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=-11.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 82A0FC433ED for ; Thu, 15 Apr 2021 13:10:19 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4D8C7611F1 for ; Thu, 15 Apr 2021 13:10:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4D8C7611F1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=L3HA2y7oQyEJseWshFjzkqLoYT3bZkrCrc35c/CW3Js=; b=KaAIKdl2/TSzza3mtyjzmV2Mjd XrsCg7EGhb0gibwBMcKP0rgQcoqfRfs5U/roSOqKXdk+nnWQpsGljpxxqzN3isZnK6YZvBN1Iyx5Y 1fHA/EHArzSbaEGkW1pAy2LLDT7Kv1WBu4EDuc7GLqNOP0vLJyh5hh9/KHgYA1mfKnjDaXoY/L/lD z5pKZrVNQk5Z6Ob+cA2yEUUHpVR8E6oGt/mOnH0G3QWtwzwkdelJLxo3TwVvVI0oYOkIWZSZ+N7tp q23SqYcU8Tf0sfCXh0AX5SI9+yuJqlNlfAYq/2MMYTBbdsJ+08zoMysytL414Vz3K5vMxucVpnByf MIUoBbzw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lX1jm-00GCqJ-Ie; Thu, 15 Apr 2021 13:08:50 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lX1j1-00GCgz-64 for linux-arm-kernel@desiato.infradead.org; Thu, 15 Apr 2021 13:08:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=YblmEdkmp0ez7Y0BSE8Ljx0AUBOOd+Z+jOq9tBG/0Ac=; b=hOb+xKqxXCbMgO7gW4RPg0n2ki S59bjQm9q/zQbGGn4WU47TSjQZ5WeWRwaWELYjGXWhlQLhbz0ZTdx//WCyIPzkzNrXFg7LCVCMp2q m/YE70LixsEtzw+ehsCVRxH25NVklzTRL0R6SGp9nHAFWCLbiFFQuM+PJXSd+1rgmxUXSGLIl9E0i 2lML0r2Il0qz40rUhEuV/JS/pwc2N6cT/VoTGn+kTpLi1MmqbialGHNZlGo0PSZYHFhyFA1caIqU7 FvFUx+YZqezcaXyXMpJKyLhfaakSCOHkId1K9UsN6CPQ299yLlG+XVIlyGjU5q88t8nYrmPQ77v8r tjgz3heA==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lX1iy-008afy-No for linux-arm-kernel@lists.infradead.org; Thu, 15 Apr 2021 13:08:01 +0000 Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lX1ig-0006KP-Ub; Thu, 15 Apr 2021 15:07:42 +0200 Received: from ore by dude.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1lX1if-0005KG-GR; Thu, 15 Apr 2021 15:07:41 +0200 From: Oleksij Rempel To: Shawn Guo , Sascha Hauer , Andrew Lunn , Florian Fainelli , Heiner Kallweit , Fugang Duan Cc: Oleksij Rempel , kernel@pengutronix.de, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-imx@nxp.com, Fabio Estevam , David Jander , Russell King , Philippe Schenker Subject: [PATCH net-next v2 0/7] provide generic net selftest support Date: Thu, 15 Apr 2021 15:07:31 +0200 Message-Id: <20210415130738.19603-1-o.rempel@pengutronix.de> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210415_060800_791771_4F088DF8 X-CRM114-Status: GOOD ( 12.57 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org changes v2: - make this tests available for all netowking devices. - enable them on FEC, ag71xx and all DSA switches. - add and test loopback support on more PHYs. This patch set provides diagnostic capabilities for some iMX, ag71xx or any DSA based devices. For proper functionality, PHY loopback support is needed. So far there is only initial infrastructure with basic tests. Oleksij Rempel (7): net: phy: genphy_loopback: add link speed configuration net: phy: micrel: KSZ8081 & KSZ9031: add loopback support net: phy: at803x: AR8085 & AR9331: add loopback support net: add generic selftest support net: fec: make use of generic NET_SELFTESTS library net: ag71xx: make use of generic NET_SELFTESTS library net: dsa: enable selftest support for all switches by default drivers/net/ethernet/atheros/Kconfig | 1 + drivers/net/ethernet/atheros/ag71xx.c | 20 +- drivers/net/ethernet/freescale/Kconfig | 1 + drivers/net/ethernet/freescale/fec_main.c | 7 + drivers/net/phy/at803x.c | 2 + drivers/net/phy/micrel.c | 2 + drivers/net/phy/phy.c | 3 +- drivers/net/phy/phy_device.c | 21 +- include/linux/phy.h | 1 + include/net/dsa.h | 2 + include/net/selftests.h | 12 + net/Kconfig | 4 + net/core/Makefile | 1 + net/core/selftests.c | 366 ++++++++++++++++++++++ net/dsa/Kconfig | 1 + net/dsa/slave.c | 21 ++ 16 files changed, 458 insertions(+), 7 deletions(-) create mode 100644 include/net/selftests.h create mode 100644 net/core/selftests.c