| .. | .. |
|---|
| 111 | 111 | #define QBMAN_MEMREMAP_ATTR MEMREMAP_WC |
|---|
| 112 | 112 | #endif |
|---|
| 113 | 113 | |
|---|
| 114 | +static inline int dpaa_set_portal_irq_affinity(struct device *dev, |
|---|
| 115 | + int irq, int cpu) |
|---|
| 116 | +{ |
|---|
| 117 | + int ret = 0; |
|---|
| 118 | + |
|---|
| 119 | + if (!irq_can_set_affinity(irq)) { |
|---|
| 120 | + dev_err(dev, "unable to set IRQ affinity\n"); |
|---|
| 121 | + return -EINVAL; |
|---|
| 122 | + } |
|---|
| 123 | + |
|---|
| 124 | + if (cpu == -1 || !cpu_online(cpu)) |
|---|
| 125 | + cpu = cpumask_any(cpu_online_mask); |
|---|
| 126 | + |
|---|
| 127 | + ret = irq_set_affinity(irq, cpumask_of(cpu)); |
|---|
| 128 | + if (ret) |
|---|
| 129 | + dev_err(dev, "irq_set_affinity() on CPU %d failed\n", cpu); |
|---|
| 130 | + |
|---|
| 131 | + return ret; |
|---|
| 132 | +} |
|---|
| 133 | + |
|---|
| 114 | 134 | #endif /* __DPAA_SYS_H */ |
|---|