linux-mips
[Top] [All Lists]

irq hande default_startup qestion

To: linux-mips@linux-mips.org
Subject: irq hande default_startup qestion
From: "Wang, Baojun" <wangbj@lzu.edu.cn>
Date: Thu, 12 Jun 2008 17:42:54 +0800
Organization: DSLab, Lanzhou University
Original-recipient: rfc822;linux-mips@linux-mips.org
Reply-to: wangbj@dslab.lzu.edu.cn
Sender: linux-mips-bounce@linux-mips.org
hi, list:

I have a question about default_startup() in kernel/irq/chip.c:

/*
 * default startup function
 */
static unsigned int default_startup(unsigned int irq)
{
        irq_desc[irq].chip->enable(irq);

        return 0;
}

By default, default_startup will call irq_chip->enable(), but some
drivers like i8259A, in arch/mips/kenrel/i8259.c:

static struct irq_chip i8259A_chip = {
        .name           = "XT-PIC",
        .mask           = disable_8259A_irq,
        .disable        = disable_8259A_irq,
        .unmask         = enable_8259A_irq,
        .mask_ack       = mask_and_ack_8259A,
#ifdef CONFIG_MIPS_MT_SMTC_IRQAFF
        .set_affinity   = plat_set_irq_affinity,
#endif /* CONFIG_MIPS_MT_SMTC_IRQAFF */
};

which don't initialize irq_chip->enable, in some (probably rare) case
when irq_chip->startup() get called, it will cause NULL pointer
reference. is it OK to change i8259A_chip (add .enable =
xxx_unmask, .disable = xxx_mask) or just change default_startup()
function? (irq_desc[irq].chip->unmask() or so?)

  Regards,
Wang

-- 
Wang, Baojun                                                Lanzhou University
Distributed & Embedded System Lab                      http://dslab.lzu.edu.cn
School of Information Science and Engeneering          wangbj@dslab.lzu.edu.cn
Tianshui South Road 222. Lanzhou 730000                             .P.R.China
Tel: +86-931-8912025                                      Fax: +86-931-8912022

Attachment: signature.asc
Description: =?gb2312?Q?=D5=E2=CA=C7=D0=C5=BC=FE=B5=C4=CA=FD=D7=D6=C7=A9?= =?gb2312?Q?=C3=FB=B2=BF=B7=D6?=

<Prev in Thread] Current Thread [Next in Thread>
  • irq hande default_startup qestion, Wang, Baojun <=