@@ -3129,15 +3129,16 @@ static struct irq_remap_table *get_irq_table(struct amd_iommu *iommu, u16 devid)
3129
3129
return table ;
3130
3130
}
3131
3131
3132
- static struct irq_remap_table * __alloc_irq_table (int nid , int order )
3132
+ static struct irq_remap_table * __alloc_irq_table (int nid , size_t size )
3133
3133
{
3134
3134
struct irq_remap_table * table ;
3135
3135
3136
3136
table = kzalloc (sizeof (* table ), GFP_KERNEL );
3137
3137
if (!table )
3138
3138
return NULL ;
3139
3139
3140
- table -> table = iommu_alloc_pages_node (nid , GFP_KERNEL , order );
3140
+ table -> table = iommu_alloc_pages_node_sz (
3141
+ nid , GFP_KERNEL , max (DTE_INTTAB_ALIGNMENT , size ));
3141
3142
if (!table -> table ) {
3142
3143
kfree (table );
3143
3144
return NULL ;
@@ -3191,7 +3192,6 @@ static struct irq_remap_table *alloc_irq_table(struct amd_iommu *iommu,
3191
3192
struct irq_remap_table * new_table = NULL ;
3192
3193
struct amd_iommu_pci_seg * pci_seg ;
3193
3194
unsigned long flags ;
3194
- int order = get_order (get_irq_table_size (max_irqs ));
3195
3195
int nid = iommu && iommu -> dev ? dev_to_node (& iommu -> dev -> dev ) : NUMA_NO_NODE ;
3196
3196
u16 alias ;
3197
3197
@@ -3211,7 +3211,7 @@ static struct irq_remap_table *alloc_irq_table(struct amd_iommu *iommu,
3211
3211
spin_unlock_irqrestore (& iommu_table_lock , flags );
3212
3212
3213
3213
/* Nothing there yet, allocate new irq remapping table */
3214
- new_table = __alloc_irq_table (nid , order );
3214
+ new_table = __alloc_irq_table (nid , get_irq_table_size ( max_irqs ) );
3215
3215
if (!new_table )
3216
3216
return NULL ;
3217
3217
0 commit comments