From owner-svn-src-head@FreeBSD.ORG Wed Dec 9 13:10:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB9341065679; Wed, 9 Dec 2009 13:10:10 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB1068FC2E; Wed, 9 Dec 2009 13:10:10 +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 nB9DAAs4026007; Wed, 9 Dec 2009 13:10:10 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9DAAMG026005; Wed, 9 Dec 2009 13:10:10 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912091310.nB9DAAMG026005@svn.freebsd.org> From: Alexander Motin Date: Wed, 9 Dec 2009 13:10:10 +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: r200291 - head/sys/dev/siis X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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, 09 Dec 2009 13:10:11 -0000 Author: mav Date: Wed Dec 9 13:10:10 2009 New Revision: 200291 URL: http://svn.freebsd.org/changeset/base/200291 Log: Increase Max Read Request Size for PCIe chips from 512 to 1024 bytes. It gives those beasts additional 10% of write bandwidth. Modified: head/sys/dev/siis/siis.c Modified: head/sys/dev/siis/siis.c ============================================================================== --- head/sys/dev/siis/siis.c Wed Dec 9 11:00:00 2009 (r200290) +++ head/sys/dev/siis/siis.c Wed Dec 9 13:10:10 2009 (r200291) @@ -231,7 +231,20 @@ static int siis_resume(device_t dev) { struct siis_controller *ctlr = device_get_softc(dev); + int cap; + uint16_t val; + /* Set PCIe max read request size to at least 1024 bytes */ + if (pci_find_extcap(dev, PCIY_EXPRESS, &cap) == 0) { + val = pci_read_config(dev, + cap + PCIR_EXPRESS_DEVICE_CTL, 2); + if ((val & PCIM_EXP_CTL_MAX_READ_REQUEST) < 0x3000) { + val &= ~PCIM_EXP_CTL_MAX_READ_REQUEST; + val |= 0x3000; + pci_write_config(dev, + cap + PCIR_EXPRESS_DEVICE_CTL, val, 2); + } + } /* Put controller into reset state. */ ctlr->gctl |= SIIS_GCTL_GRESET; ATA_OUTL(ctlr->r_gmem, SIIS_GCTL, ctlr->gctl);