From owner-svn-src-all@FreeBSD.ORG Mon Feb 1 20:58:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7530106566B; Mon, 1 Feb 2010 20:58:45 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 966CE8FC13; Mon, 1 Feb 2010 20:58:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o11Kwjv0070874; Mon, 1 Feb 2010 20:58:45 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o11KwjQK070872; Mon, 1 Feb 2010 20:58:45 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201002012058.o11KwjQK070872@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 1 Feb 2010 20:58:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203358 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2010 20:58:45 -0000 Author: yongari Date: Mon Feb 1 20:58:45 2010 New Revision: 203358 URL: http://svn.freebsd.org/changeset/base/203358 Log: PCI express device status register has W1C feature. Writing 0 has no effect. Make sure to clear error bits by writing 1. [1] While I'm here use predefined value instead of hardcodig magic vlaue. Submitted by: msaitoh at NetBSD [1] Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Mon Feb 1 20:54:45 2010 (r203357) +++ head/sys/dev/bge/if_bge.c Mon Feb 1 20:58:45 2010 (r203358) @@ -3136,14 +3136,17 @@ bge_reset(struct bge_softc *sc) devctl = pci_read_config(dev, sc->bge_expcap + PCIR_EXPRESS_DEVICE_CTL, 2); /* Clear enable no snoop and disable relaxed ordering. */ - devctl &= ~(0x0010 | 0x0800); + devctl &= ~(PCIM_EXP_CTL_RELAXED_ORD_ENABLE | + PCIM_EXP_CTL_NOSNOOP_ENABLE); /* Set PCIE max payload size to 128. */ devctl &= ~PCIM_EXP_CTL_MAX_PAYLOAD; pci_write_config(dev, sc->bge_expcap + PCIR_EXPRESS_DEVICE_CTL, devctl, 2); /* Clear error status. */ pci_write_config(dev, sc->bge_expcap + PCIR_EXPRESS_DEVICE_STA, - 0, 2); + PCIM_EXP_STA_CORRECTABLE_ERROR | + PCIM_EXP_STA_NON_FATAL_ERROR | PCIM_EXP_STA_FATAL_ERROR | + PCIM_EXP_STA_UNSUPPORTED_REQ, 2); } /* Reset some of the PCI state that got zapped by reset. */