From owner-svn-src-head@freebsd.org Wed Feb 7 01:54:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E071F1C6DD; Wed, 7 Feb 2018 01:54:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2FAC66FD60; Wed, 7 Feb 2018 01:54:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A8F420552; Wed, 7 Feb 2018 01:54:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w171sDqC049907; Wed, 7 Feb 2018 01:54:13 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w171sD4P049906; Wed, 7 Feb 2018 01:54:13 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802070154.w171sD4P049906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 7 Feb 2018 01:54:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328964 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 328964 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Feb 2018 01:54:14 -0000 Author: kevans Date: Wed Feb 7 01:54:13 2018 New Revision: 328964 URL: https://svnweb.freebsd.org/changeset/base/328964 Log: if_awg: Skip emac reset if configured for internal PHY On the OrangePi One at least, emac reset when an ethernet cable is not plugged in seems to break ethernet. Soft reset will fail, even with increasing the delay and retries to wait for up to 20 seconds. This can be reproduced across at least two different OrangePi One's by simply leaving ethernet cable unplugged when awg attaches. Whether it's plugged in or not through u-boot process makes no difference. Skipping the reset in this configuration doesn't seem to cause any problems, tried across many many reboots with and without ethernet cable plugged in. Tested on: OrangePi One Tested on: Other boards (manu) Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D13974 Modified: head/sys/arm/allwinner/if_awg.c Modified: head/sys/arm/allwinner/if_awg.c ============================================================================== --- head/sys/arm/allwinner/if_awg.c Wed Feb 7 01:24:49 2018 (r328963) +++ head/sys/arm/allwinner/if_awg.c Wed Feb 7 01:54:13 2018 (r328964) @@ -1834,9 +1834,11 @@ awg_attach(device_t dev) awg_get_eaddr(dev, eaddr); /* Soft reset EMAC core */ - error = awg_reset(dev); - if (error != 0) - return (error); + if (!awg_has_internal_phy(dev)) { + error = awg_reset(dev); + if (error != 0) + return (error); + } /* Setup DMA descriptors */ error = awg_setup_dma(dev);