From owner-svn-src-head@FreeBSD.ORG Sun Sep 14 00:02:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6FE623AE; Sun, 14 Sep 2014 00:02:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B4CFABD; Sun, 14 Sep 2014 00:02:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8E02c33036044; Sun, 14 Sep 2014 00:02:38 GMT (envelope-from kan@FreeBSD.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8E02cUr036043; Sun, 14 Sep 2014 00:02:38 GMT (envelope-from kan@FreeBSD.org) Message-Id: <201409140002.s8E02cUr036043@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kan set sender to kan@FreeBSD.org using -f From: Alexander Kabaev Date: Sun, 14 Sep 2014 00:02:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271561 - head/sys/mips/cavium/octe X-SVN-Group: head 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.18-1 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: Sun, 14 Sep 2014 00:02:38 -0000 Author: kan Date: Sun Sep 14 00:02:37 2014 New Revision: 271561 URL: http://svnweb.freebsd.org/changeset/base/271561 Log: Add delay to Octeon MDIO access routines. Prevent saturattion of the bus by constant polling which in extreme cases can cause interface lockup. This makes FreeBSD match similar case in the executive. Modified: head/sys/mips/cavium/octe/ethernet-mdio.c Modified: head/sys/mips/cavium/octe/ethernet-mdio.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-mdio.c Sat Sep 13 23:50:51 2014 (r271560) +++ head/sys/mips/cavium/octe/ethernet-mdio.c Sun Sep 14 00:02:37 2014 (r271561) @@ -71,6 +71,7 @@ int cvm_oct_mdio_read(struct ifnet *ifp, cvmx_write_csr(CVMX_SMI_CMD, smi_cmd.u64); do { + cvmx_wait(1000); smi_rd.u64 = cvmx_read_csr(CVMX_SMI_RD_DAT); } while (smi_rd.s.pending); @@ -108,6 +109,7 @@ void cvm_oct_mdio_write(struct ifnet *if cvmx_write_csr(CVMX_SMI_CMD, smi_cmd.u64); do { + cvmx_wait(1000); smi_wr.u64 = cvmx_read_csr(CVMX_SMI_WR_DAT); } while (smi_wr.s.pending); MDIO_UNLOCK();