Commit ae2031fb authored by Chris Metcalf's avatar Chris Metcalf

tile PCI RC: reduce driver's vmalloc space usage

We can take advantage of the fact that bit 29 is hard-wired
to zero in register TRIO_TILE_PIO_REGION_SETUP_CFG_ADDR.
This is handy since at the moment we only allocate one 4GB
region for vmalloc, and with this change we can allocate
four or more TRIO MACs without using up all the vmalloc space.
Signed-off-by: default avatarChris Metcalf <cmetcalf@tilera.com>
parent 5026dafa
......@@ -860,9 +860,15 @@ int __init pcibios_init(void)
#endif
/*
* To save VMALLOC space, we take advantage of the fact that
* bit 29 in the PIO CFG address format is reserved 0. With
* TRIO_TILE_PIO_REGION_SETUP_CFG_ADDR__MAC_SHIFT being 30,
* this cuts VMALLOC space usage from 1GB to 512MB per mac.
*/
trio_context->mmio_base_pio_cfg[mac] =
iorpc_ioremap(trio_context->fd, offset,
(1 << TRIO_TILE_PIO_REGION_SETUP_CFG_ADDR__MAC_SHIFT));
iorpc_ioremap(trio_context->fd, offset, (1UL <<
(TRIO_TILE_PIO_REGION_SETUP_CFG_ADDR__MAC_SHIFT - 1)));
if (trio_context->mmio_base_pio_cfg[mac] == NULL) {
pr_err("PCI: PIO map failure for mac %d on TRIO %d\n",
mac, trio_index);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment