~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to kernel/irq/proc.c

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno
  • Date: 2011-06-07 12:14:05 UTC
  • mfrom: (43.1.9 sid)
  • Revision ID: james.westby@ubuntu.com-20110607121405-i3h1rd7nrnd2b73h
Tags: 2.6.39-2
[ Ben Hutchings ]
* [x86] Enable BACKLIGHT_APPLE, replacing BACKLIGHT_MBP_NVIDIA
  (Closes: #627492)
* cgroups: Disable memory resource controller by default. Allow it
  to be enabled using kernel parameter 'cgroup_enable=memory'.
* rt2800usb: Enable support for more USB devices including
  Linksys WUSB600N (Closes: #596626) (this change was accidentally
  omitted from 2.6.39-1)
* [x86] Remove Celeron from list of processors supporting PAE. Most
  'Celeron M' models do not.
* Update debconf template translations:
  - Swedish (Martin Bagge) (Closes: #628932)
  - French (David Prévot) (Closes: #628191)
* aufs: Update for 2.6.39 (Closes: #627837)
* Add stable 2.6.39.1, including:
  - ext4: dont set PageUptodate in ext4_end_bio()
  - pata_cmd64x: fix boot crash on parisc (Closes: #622997, #622745)
  - ext3: Fix fs corruption when make_indexed_dir() fails
  - netfilter: nf_ct_sip: validate Content-Length in TCP SIP messages
  - sctp: fix race between sctp_bind_addr_free() and
    sctp_bind_addr_conflict()
  - sctp: fix memory leak of the ASCONF queue when free asoc
  - md/bitmap: fix saving of events_cleared and other state
  - cdc_acm: Fix oops when Droids MuIn LCD is connected
  - cx88: Fix conversion from BKL to fine-grained locks (Closes: #619827)
  - keys: Set cred->user_ns in key_replace_session_keyring (CVE-2011-2184)
  - tmpfs: fix race between truncate and writepage
  - nfs41: Correct offset for LAYOUTCOMMIT
  - xen/mmu: fix a race window causing leave_mm BUG()
  - ext4: fix possible use-after-free in ext4_remove_li_request()
  For the complete list of changes, see:
   http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.39.1
* Bump ABI to 2
* netfilter: Enable IP_SET, IP_SET_BITMAP_IP, IP_SET_BITMAP_IPMAC,
  IP_SET_BITMAP_PORT, IP_SET_HASH_IP, IP_SET_HASH_IPPORT,
  IP_SET_HASH_IPPORTIP, IP_SET_HASH_IPPORTNET, IP_SET_HASH_NET,
  IP_SET_HASH_NETPORT, IP_SET_LIST_SET, NETFILTER_XT_SET as modules
  (Closes: #629401)

[ Aurelien Jarno ]
* [mipsel/loongson-2f] Disable_SCSI_LPFC to workaround GCC ICE.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
#include <linux/proc_fs.h>
12
12
#include <linux/seq_file.h>
13
13
#include <linux/interrupt.h>
 
14
#include <linux/kernel_stat.h>
14
15
 
15
16
#include "internals.h"
16
17
 
24
25
        const struct cpumask *mask = desc->irq_data.affinity;
25
26
 
26
27
#ifdef CONFIG_GENERIC_PENDING_IRQ
27
 
        if (desc->status & IRQ_MOVE_PENDING)
 
28
        if (irqd_is_setaffinity_pending(&desc->irq_data))
28
29
                mask = desc->pending_mask;
29
30
#endif
30
31
        seq_cpumask(m, mask);
65
66
        cpumask_var_t new_value;
66
67
        int err;
67
68
 
68
 
        if (!irq_to_desc(irq)->irq_data.chip->irq_set_affinity || no_irq_affinity ||
69
 
            irq_balancing_disabled(irq))
 
69
        if (!irq_can_set_affinity(irq) || no_irq_affinity)
70
70
                return -EIO;
71
71
 
72
72
        if (!alloc_cpumask_var(&new_value, GFP_KERNEL))
89
89
        if (!cpumask_intersects(new_value, cpu_online_mask)) {
90
90
                /* Special case for empty set - allow the architecture
91
91
                   code to set default SMP affinity. */
92
 
                err = irq_select_affinity_usr(irq) ? -EINVAL : count;
 
92
                err = irq_select_affinity_usr(irq, new_value) ? -EINVAL : count;
93
93
        } else {
94
94
                irq_set_affinity(irq, new_value);
95
95
                err = count;
357
357
        }
358
358
}
359
359
 
 
360
#ifdef CONFIG_GENERIC_IRQ_SHOW
 
361
 
 
362
int __weak arch_show_interrupts(struct seq_file *p, int prec)
 
363
{
 
364
        return 0;
 
365
}
 
366
 
 
367
#ifndef ACTUAL_NR_IRQS
 
368
# define ACTUAL_NR_IRQS nr_irqs
 
369
#endif
 
370
 
 
371
int show_interrupts(struct seq_file *p, void *v)
 
372
{
 
373
        static int prec;
 
374
 
 
375
        unsigned long flags, any_count = 0;
 
376
        int i = *(loff_t *) v, j;
 
377
        struct irqaction *action;
 
378
        struct irq_desc *desc;
 
379
 
 
380
        if (i > ACTUAL_NR_IRQS)
 
381
                return 0;
 
382
 
 
383
        if (i == ACTUAL_NR_IRQS)
 
384
                return arch_show_interrupts(p, prec);
 
385
 
 
386
        /* print header and calculate the width of the first column */
 
387
        if (i == 0) {
 
388
                for (prec = 3, j = 1000; prec < 10 && j <= nr_irqs; ++prec)
 
389
                        j *= 10;
 
390
 
 
391
                seq_printf(p, "%*s", prec + 8, "");
 
392
                for_each_online_cpu(j)
 
393
                        seq_printf(p, "CPU%-8d", j);
 
394
                seq_putc(p, '\n');
 
395
        }
 
396
 
 
397
        desc = irq_to_desc(i);
 
398
        if (!desc)
 
399
                return 0;
 
400
 
 
401
        raw_spin_lock_irqsave(&desc->lock, flags);
 
402
        for_each_online_cpu(j)
 
403
                any_count |= kstat_irqs_cpu(i, j);
 
404
        action = desc->action;
 
405
        if (!action && !any_count)
 
406
                goto out;
 
407
 
 
408
        seq_printf(p, "%*d: ", prec, i);
 
409
        for_each_online_cpu(j)
 
410
                seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
 
411
 
 
412
        if (desc->irq_data.chip) {
 
413
                if (desc->irq_data.chip->irq_print_chip)
 
414
                        desc->irq_data.chip->irq_print_chip(&desc->irq_data, p);
 
415
                else if (desc->irq_data.chip->name)
 
416
                        seq_printf(p, " %8s", desc->irq_data.chip->name);
 
417
                else
 
418
                        seq_printf(p, " %8s", "-");
 
419
        } else {
 
420
                seq_printf(p, " %8s", "None");
 
421
        }
 
422
#ifdef CONFIG_GENERIC_IRQ_SHOW_LEVEL
 
423
        seq_printf(p, " %-8s", irqd_is_level_type(&desc->irq_data) ? "Level" : "Edge");
 
424
#endif
 
425
        if (desc->name)
 
426
                seq_printf(p, "-%-8s", desc->name);
 
427
 
 
428
        if (action) {
 
429
                seq_printf(p, "  %s", action->name);
 
430
                while ((action = action->next) != NULL)
 
431
                        seq_printf(p, ", %s", action->name);
 
432
        }
 
433
 
 
434
        seq_putc(p, '\n');
 
435
out:
 
436
        raw_spin_unlock_irqrestore(&desc->lock, flags);
 
437
        return 0;
 
438
}
 
439
#endif