From owner-svn-src-projects@freebsd.org Tue Oct 16 16:36:03 2018 Return-Path: Delivered-To: svn-src-projects@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 BCFAF10D9E5E for ; Tue, 16 Oct 2018 16:36:03 +0000 (UTC) (envelope-from luporl@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 7193F7498D; Tue, 16 Oct 2018 16:36:03 +0000 (UTC) (envelope-from luporl@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 688591F1C3; Tue, 16 Oct 2018 16:36:03 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9GGa3Z4001744; Tue, 16 Oct 2018 16:36:03 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9GGa3Nl001743; Tue, 16 Oct 2018 16:36:03 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201810161636.w9GGa3Nl001743@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Tue, 16 Oct 2018 16:36:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r339382 - projects/power8_bringup_hacks/sys/dev/bge X-SVN-Group: projects X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: projects/power8_bringup_hacks/sys/dev/bge X-SVN-Commit-Revision: 339382 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Oct 2018 16:36:03 -0000 Author: luporl Date: Tue Oct 16 16:36:02 2018 New Revision: 339382 URL: https://svnweb.freebsd.org/changeset/base/339382 Log: bge(4): limit DMA address to 2GB This is a temporary hack, to avoid POWER8 Broadcom NICs from becoming unusable after transferring a reasonable amount of data. The issue is the same as that of AHCI, where DMA addresses above 2GB do not work and causes PCI errors. Modified: projects/power8_bringup_hacks/sys/dev/bge/if_bge.c Modified: projects/power8_bringup_hacks/sys/dev/bge/if_bge.c ============================================================================== --- projects/power8_bringup_hacks/sys/dev/bge/if_bge.c Tue Oct 16 16:03:17 2018 (r339381) +++ projects/power8_bringup_hacks/sys/dev/bge/if_bge.c Tue Oct 16 16:36:02 2018 (r339382) @@ -134,6 +134,8 @@ MODULE_DEPEND(bge, miibus, 1, 1, 1); /* "device miibus" required. See GENERIC if you get errors here. */ #include "miibus_if.h" +#define BGE_BUS_SPACE_MAXADDR_32BIT 0x7FFFFFFFU + /* * Various supported device vendors/types and their names. Note: the * spec seems to indicate that the hardware still has Alteon's vendor @@ -3050,15 +3052,16 @@ bge_dma_alloc(struct bge_softc *sc) /* Create parent tag for buffers. */ if ((sc->bge_flags & BGE_FLAG_4G_BNDRY_BUG) != 0) { + lowaddr = BGE_BUS_SPACE_MAXADDR_32BIT; /* * XXX * watchdog timeout issue was observed on BCM5704 which * lives behind PCI-X bridge(e.g AMD 8131 PCI-X bridge). * Both limiting DMA address space to 32bits and flushing * mailbox write seem to address the issue. - */ if (sc->bge_pcixcap != 0) lowaddr = BUS_SPACE_MAXADDR_32BIT; + */ } error = bus_dma_tag_create(bus_get_dma_tag(sc->bge_dev), 1, 0, lowaddr, BUS_SPACE_MAXADDR, NULL, NULL, BUS_SPACE_MAXSIZE_32BIT, 0,