|
@@ -424,27 +424,25 @@ extern int set_irq_msi(unsigned int irq, struct msi_desc *entry);
|
|
|
|
|
|
#ifdef CONFIG_SMP
|
|
#ifdef CONFIG_SMP
|
|
/**
|
|
/**
|
|
- * init_alloc_desc_masks - allocate cpumasks for irq_desc
|
|
|
|
|
|
+ * alloc_desc_masks - allocate cpumasks for irq_desc
|
|
* @desc: pointer to irq_desc struct
|
|
* @desc: pointer to irq_desc struct
|
|
* @cpu: cpu which will be handling the cpumasks
|
|
* @cpu: cpu which will be handling the cpumasks
|
|
* @boot: true if need bootmem
|
|
* @boot: true if need bootmem
|
|
*
|
|
*
|
|
* Allocates affinity and pending_mask cpumask if required.
|
|
* Allocates affinity and pending_mask cpumask if required.
|
|
* Returns true if successful (or not required).
|
|
* Returns true if successful (or not required).
|
|
- * Side effect: affinity has all bits set, pending_mask has all bits clear.
|
|
|
|
*/
|
|
*/
|
|
-static inline bool init_alloc_desc_masks(struct irq_desc *desc, int cpu,
|
|
|
|
|
|
+static inline bool alloc_desc_masks(struct irq_desc *desc, int cpu,
|
|
bool boot)
|
|
bool boot)
|
|
{
|
|
{
|
|
|
|
+#ifdef CONFIG_CPUMASK_OFFSTACK
|
|
int node;
|
|
int node;
|
|
|
|
|
|
if (boot) {
|
|
if (boot) {
|
|
alloc_bootmem_cpumask_var(&desc->affinity);
|
|
alloc_bootmem_cpumask_var(&desc->affinity);
|
|
- cpumask_setall(desc->affinity);
|
|
|
|
|
|
|
|
#ifdef CONFIG_GENERIC_PENDING_IRQ
|
|
#ifdef CONFIG_GENERIC_PENDING_IRQ
|
|
alloc_bootmem_cpumask_var(&desc->pending_mask);
|
|
alloc_bootmem_cpumask_var(&desc->pending_mask);
|
|
- cpumask_clear(desc->pending_mask);
|
|
|
|
#endif
|
|
#endif
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
@@ -453,18 +451,25 @@ static inline bool init_alloc_desc_masks(struct irq_desc *desc, int cpu,
|
|
|
|
|
|
if (!alloc_cpumask_var_node(&desc->affinity, GFP_ATOMIC, node))
|
|
if (!alloc_cpumask_var_node(&desc->affinity, GFP_ATOMIC, node))
|
|
return false;
|
|
return false;
|
|
- cpumask_setall(desc->affinity);
|
|
|
|
|
|
|
|
#ifdef CONFIG_GENERIC_PENDING_IRQ
|
|
#ifdef CONFIG_GENERIC_PENDING_IRQ
|
|
if (!alloc_cpumask_var_node(&desc->pending_mask, GFP_ATOMIC, node)) {
|
|
if (!alloc_cpumask_var_node(&desc->pending_mask, GFP_ATOMIC, node)) {
|
|
free_cpumask_var(desc->affinity);
|
|
free_cpumask_var(desc->affinity);
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
- cpumask_clear(desc->pending_mask);
|
|
|
|
|
|
+#endif
|
|
#endif
|
|
#endif
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static inline void init_desc_masks(struct irq_desc *desc)
|
|
|
|
+{
|
|
|
|
+ cpumask_setall(desc->affinity);
|
|
|
|
+#ifdef CONFIG_GENERIC_PENDING_IRQ
|
|
|
|
+ cpumask_clear(desc->pending_mask);
|
|
|
|
+#endif
|
|
|
|
+}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* init_copy_desc_masks - copy cpumasks for irq_desc
|
|
* init_copy_desc_masks - copy cpumasks for irq_desc
|
|
* @old_desc: pointer to old irq_desc struct
|
|
* @old_desc: pointer to old irq_desc struct
|
|
@@ -478,7 +483,7 @@ static inline bool init_alloc_desc_masks(struct irq_desc *desc, int cpu,
|
|
static inline void init_copy_desc_masks(struct irq_desc *old_desc,
|
|
static inline void init_copy_desc_masks(struct irq_desc *old_desc,
|
|
struct irq_desc *new_desc)
|
|
struct irq_desc *new_desc)
|
|
{
|
|
{
|
|
-#ifdef CONFIG_CPUMASKS_OFFSTACK
|
|
|
|
|
|
+#ifdef CONFIG_CPUMASK_OFFSTACK
|
|
cpumask_copy(new_desc->affinity, old_desc->affinity);
|
|
cpumask_copy(new_desc->affinity, old_desc->affinity);
|
|
|
|
|
|
#ifdef CONFIG_GENERIC_PENDING_IRQ
|
|
#ifdef CONFIG_GENERIC_PENDING_IRQ
|
|
@@ -499,12 +504,16 @@ static inline void free_desc_masks(struct irq_desc *old_desc,
|
|
|
|
|
|
#else /* !CONFIG_SMP */
|
|
#else /* !CONFIG_SMP */
|
|
|
|
|
|
-static inline bool init_alloc_desc_masks(struct irq_desc *desc, int cpu,
|
|
|
|
|
|
+static inline bool alloc_desc_masks(struct irq_desc *desc, int cpu,
|
|
bool boot)
|
|
bool boot)
|
|
{
|
|
{
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static inline void init_desc_masks(struct irq_desc *desc)
|
|
|
|
+{
|
|
|
|
+}
|
|
|
|
+
|
|
static inline void init_copy_desc_masks(struct irq_desc *old_desc,
|
|
static inline void init_copy_desc_masks(struct irq_desc *old_desc,
|
|
struct irq_desc *new_desc)
|
|
struct irq_desc *new_desc)
|
|
{
|
|
{
|