Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 56045
b: refs/heads/master
c: 25d6157
h: refs/heads/master
i:
  56043: 6c59f4b
v: v3
  • Loading branch information
John Keller authored and Tony Luck committed May 11, 2007
1 parent 174f125 commit 009f71a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3e3d32770204ea24cf71919a90d9ccfc2bd407dd
refs/heads/master: 25d61578daae697c4a0eb817f42a868af9824f82
11 changes: 11 additions & 0 deletions trunk/arch/ia64/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,17 @@ void set_irq_affinity_info (unsigned int irq, int hwid, int redir)
irq_redir[irq] = (char) (redir & 0xff);
}
}

bool is_affinity_mask_valid(cpumask_t cpumask)
{
if (ia64_platform_is("sn2")) {
/* Only allow one CPU to be specified in the smp_affinity mask */
if (cpus_weight(cpumask) != 1)
return false;
}
return true;
}

#endif /* CONFIG_SMP */

#ifdef CONFIG_HOTPLUG_CPU
Expand Down
6 changes: 6 additions & 0 deletions trunk/include/asm-ia64/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
* 02/29/00 D.Mosberger moved most things into hw_irq.h
*/

#include <linux/types.h>
#include <linux/cpumask.h>

#define NR_IRQS 256
#define NR_IRQ_VECTORS NR_IRQS

Expand All @@ -29,5 +32,8 @@ extern void disable_irq (unsigned int);
extern void disable_irq_nosync (unsigned int);
extern void enable_irq (unsigned int);
extern void set_irq_affinity_info (unsigned int irq, int dest, int redir);
bool is_affinity_mask_valid(cpumask_t cpumask);

#define is_affinity_mask_valid is_affinity_mask_valid

#endif /* _ASM_IA64_IRQ_H */
7 changes: 7 additions & 0 deletions trunk/kernel/irq/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ static int irq_affinity_read_proc(char *page, char **start, off_t off,
return len;
}

#ifndef is_affinity_mask_valid
#define is_affinity_mask_valid(val) 1
#endif

int no_irq_affinity;
static int irq_affinity_write_proc(struct file *file, const char __user *buffer,
unsigned long count, void *data)
Expand All @@ -42,6 +46,9 @@ static int irq_affinity_write_proc(struct file *file, const char __user *buffer,
if (err)
return err;

if (!is_affinity_mask_valid(new_value))
return -EINVAL;

/*
* Do not allow disabling IRQs completely - it's a too easy
* way to make the system unusable accidentally :-) At least
Expand Down

0 comments on commit 009f71a

Please sign in to comment.