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

« back to all changes in this revision

Viewing changes to arch/mips/sni/rm200.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:
155
155
#define cached_master_mask      (rm200_cached_irq_mask)
156
156
#define cached_slave_mask       (rm200_cached_irq_mask >> 8)
157
157
 
158
 
static void sni_rm200_disable_8259A_irq(unsigned int irq)
 
158
static void sni_rm200_disable_8259A_irq(struct irq_data *d)
159
159
{
160
 
        unsigned int mask;
 
160
        unsigned int mask, irq = d->irq - RM200_I8259A_IRQ_BASE;
161
161
        unsigned long flags;
162
162
 
163
 
        irq -= RM200_I8259A_IRQ_BASE;
164
163
        mask = 1 << irq;
165
164
        raw_spin_lock_irqsave(&sni_rm200_i8259A_lock, flags);
166
165
        rm200_cached_irq_mask |= mask;
171
170
        raw_spin_unlock_irqrestore(&sni_rm200_i8259A_lock, flags);
172
171
}
173
172
 
174
 
static void sni_rm200_enable_8259A_irq(unsigned int irq)
 
173
static void sni_rm200_enable_8259A_irq(struct irq_data *d)
175
174
{
176
 
        unsigned int mask;
 
175
        unsigned int mask, irq = d->irq - RM200_I8259A_IRQ_BASE;
177
176
        unsigned long flags;
178
177
 
179
 
        irq -= RM200_I8259A_IRQ_BASE;
180
178
        mask = ~(1 << irq);
181
179
        raw_spin_lock_irqsave(&sni_rm200_i8259A_lock, flags);
182
180
        rm200_cached_irq_mask &= mask;
210
208
 * first, _then_ send the EOI, and the order of EOI
211
209
 * to the two 8259s is important!
212
210
 */
213
 
void sni_rm200_mask_and_ack_8259A(unsigned int irq)
 
211
void sni_rm200_mask_and_ack_8259A(struct irq_data *d)
214
212
{
215
 
        unsigned int irqmask;
 
213
        unsigned int irqmask, irq = d->irq - RM200_I8259A_IRQ_BASE;
216
214
        unsigned long flags;
217
215
 
218
 
        irq -= RM200_I8259A_IRQ_BASE;
219
216
        irqmask = 1 << irq;
220
217
        raw_spin_lock_irqsave(&sni_rm200_i8259A_lock, flags);
221
218
        /*
285
282
 
286
283
static struct irq_chip sni_rm200_i8259A_chip = {
287
284
        .name           = "RM200-XT-PIC",
288
 
        .mask           = sni_rm200_disable_8259A_irq,
289
 
        .unmask         = sni_rm200_enable_8259A_irq,
290
 
        .mask_ack       = sni_rm200_mask_and_ack_8259A,
 
285
        .irq_mask       = sni_rm200_disable_8259A_irq,
 
286
        .irq_unmask     = sni_rm200_enable_8259A_irq,
 
287
        .irq_mask_ack   = sni_rm200_mask_and_ack_8259A,
291
288
};
292
289
 
293
290
/*
416
413
        sni_rm200_init_8259A();
417
414
 
418
415
        for (i = RM200_I8259A_IRQ_BASE; i < RM200_I8259A_IRQ_BASE + 16; i++)
419
 
                set_irq_chip_and_handler(i, &sni_rm200_i8259A_chip,
 
416
                irq_set_chip_and_handler(i, &sni_rm200_i8259A_chip,
420
417
                                         handle_level_irq);
421
418
 
422
419
        setup_irq(RM200_I8259A_IRQ_BASE + PIC_CASCADE_IR, &sni_rm200_irq2);
429
426
#define SNI_RM200_INT_START  24
430
427
#define SNI_RM200_INT_END    28
431
428
 
432
 
static void enable_rm200_irq(unsigned int irq)
 
429
static void enable_rm200_irq(struct irq_data *d)
433
430
{
434
 
        unsigned int mask = 1 << (irq - SNI_RM200_INT_START);
 
431
        unsigned int mask = 1 << (d->irq - SNI_RM200_INT_START);
435
432
 
436
433
        *(volatile u8 *)SNI_RM200_INT_ENA_REG &= ~mask;
437
434
}
438
435
 
439
 
void disable_rm200_irq(unsigned int irq)
 
436
void disable_rm200_irq(struct irq_data *d)
440
437
{
441
 
        unsigned int mask = 1 << (irq - SNI_RM200_INT_START);
 
438
        unsigned int mask = 1 << (d->irq - SNI_RM200_INT_START);
442
439
 
443
440
        *(volatile u8 *)SNI_RM200_INT_ENA_REG |= mask;
444
441
}
445
442
 
446
 
void end_rm200_irq(unsigned int irq)
447
 
{
448
 
        if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
449
 
                enable_rm200_irq(irq);
450
 
}
451
 
 
452
443
static struct irq_chip rm200_irq_type = {
453
444
        .name = "RM200",
454
 
        .ack = disable_rm200_irq,
455
 
        .mask = disable_rm200_irq,
456
 
        .mask_ack = disable_rm200_irq,
457
 
        .unmask = enable_rm200_irq,
458
 
        .end = end_rm200_irq,
 
445
        .irq_mask = disable_rm200_irq,
 
446
        .irq_unmask = enable_rm200_irq,
459
447
};
460
448
 
461
449
static void sni_rm200_hwint(void)
489
477
        mips_cpu_irq_init();
490
478
        /* Actually we've got more interrupts to handle ...  */
491
479
        for (i = SNI_RM200_INT_START; i <= SNI_RM200_INT_END; i++)
492
 
                set_irq_chip_and_handler(i, &rm200_irq_type, handle_level_irq);
 
480
                irq_set_chip_and_handler(i, &rm200_irq_type, handle_level_irq);
493
481
        sni_hwint = sni_rm200_hwint;
494
482
        change_c0_status(ST0_IM, IE_IRQ0);
495
483
        setup_irq(SNI_RM200_INT_START + 0, &sni_rm200_i8259A_irq);