Increase Max Read Request Size for PCIe chips from 512 to 1024 bytes.

It gives those beasts additional 10% of write bandwidth.
This commit is contained in:
Alexander Motin 2009-12-09 13:10:10 +00:00
parent 471bf5f612
commit 1535d59d7c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=200291

View File

@ -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);