|
@@ -2049,13 +2049,19 @@ static long pnv_pci_ioda2_setup_default_config(struct pnv_ioda_pe *pe)
|
|
struct iommu_table *tbl = NULL;
|
|
struct iommu_table *tbl = NULL;
|
|
long rc;
|
|
long rc;
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
+ * crashkernel= specifies the kdump kernel's maximum memory at
|
|
|
|
+ * some offset and there is no guaranteed the result is a power
|
|
|
|
+ * of 2, which will cause errors later.
|
|
|
|
+ */
|
|
|
|
+ const u64 max_memory = __rounddown_pow_of_two(memory_hotplug_max());
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* In memory constrained environments, e.g. kdump kernel, the
|
|
* In memory constrained environments, e.g. kdump kernel, the
|
|
* DMA window can be larger than available memory, which will
|
|
* DMA window can be larger than available memory, which will
|
|
* cause errors later.
|
|
* cause errors later.
|
|
*/
|
|
*/
|
|
- const u64 window_size = min((u64)pe->table_group.tce32_size,
|
|
|
|
- memory_hotplug_max());
|
|
|
|
|
|
+ const u64 window_size = min((u64)pe->table_group.tce32_size, max_memory);
|
|
|
|
|
|
rc = pnv_pci_ioda2_create_table(&pe->table_group, 0,
|
|
rc = pnv_pci_ioda2_create_table(&pe->table_group, 0,
|
|
IOMMU_PAGE_SHIFT_4K,
|
|
IOMMU_PAGE_SHIFT_4K,
|