Skip to content

Commit d30239a

Browse files
committed
powerpc/mpc52xx: Properly update irq_desc when set_type() is called.
The MPC5200 PIC driver doesn't correctly update the .status field of the irq_desc structure when the set_type hook is called. This patch adds the required code. Also cleans up the external IRQ typename field to be something easier to read (very minor). Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
1 parent 23faf63 commit d30239a

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎arch/powerpc/platforms/52xx/mpc52xx_pic.c‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ static void mpc52xx_extirq_ack(unsigned int virq)
196196

197197
static int mpc52xx_extirq_set_type(unsigned int virq, unsigned int flow_type)
198198
{
199+
struct irq_desc *desc = get_irq_desc(virq);
199200
u32 ctrl_reg, type;
200201
int irq;
201202
int l2irq;
@@ -222,6 +223,11 @@ static int mpc52xx_extirq_set_type(unsigned int virq, unsigned int flow_type)
222223
type = 0;
223224
}
224225

226+
desc->status &= ~(IRQ_TYPE_SENSE_MASK | IRQ_LEVEL);
227+
desc->status |= flow_type & IRQ_TYPE_SENSE_MASK;
228+
if (flow_type & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW))
229+
desc->status |= IRQ_LEVEL;
230+
225231
ctrl_reg = in_be32(&intr->ctrl);
226232
ctrl_reg &= ~(0x3 << (22 - (l2irq * 2)));
227233
ctrl_reg |= (type << (22 - (l2irq * 2)));
@@ -231,7 +237,7 @@ static int mpc52xx_extirq_set_type(unsigned int virq, unsigned int flow_type)
231237
}
232238

233239
static struct irq_chip mpc52xx_extirq_irqchip = {
234-
.typename = " MPC52xx IRQ[0-3] ",
240+
.typename = "MPC52xx External",
235241
.mask = mpc52xx_extirq_mask,
236242
.unmask = mpc52xx_extirq_unmask,
237243
.ack = mpc52xx_extirq_ack,

0 commit comments

Comments
 (0)