Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e4e73041 authored by Kenji Kaneshige's avatar Kenji Kaneshige Committed by Greg Kroah-Hartman
Browse files

[PATCH] shpchp - Fix incorrect return value of interrupt handler



Current SHPCHP driver has a bug in its interrupt handler which cause
"IRQ #: nobody cared" oops. This problem can be reproduced easily by
the following operation.

    # cd /sys/bus/pci/slots/<slot#>
    # while true; do echo 1 > attention ; done &

The reason is that when command complete interrupt is raised, current
SHPCHP driver's interrupt handler returns IRQ_NONE regardless of if
the interrupt is handled or not.

This patch fixes this issue.

Signed-off-by: default avatarKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent bbe779db
Loading
Loading
Loading
Loading
+3 −8
Original line number Original line Diff line number Diff line
@@ -1109,14 +1109,8 @@ static irqreturn_t shpc_isr(int IRQ, void *dev_id, struct pt_regs *regs)
		wake_up_interruptible(&ctrl->queue);
		wake_up_interruptible(&ctrl->queue);
	}
	}


	if ((intr_loc = (intr_loc >> 1)) == 0) {
	if ((intr_loc = (intr_loc >> 1)) == 0)
		/* Unmask Global Interrupt Mask */
		goto out;
		temp_dword = readl(php_ctlr->creg + SERR_INTR_ENABLE);
		temp_dword &= 0xfffffffe;
		writel(temp_dword, php_ctlr->creg + SERR_INTR_ENABLE);

		return IRQ_NONE;
	}


	for (hp_slot = 0; hp_slot < ctrl->num_slots; hp_slot++) { 
	for (hp_slot = 0; hp_slot < ctrl->num_slots; hp_slot++) { 
	/* To find out which slot has interrupt pending */
	/* To find out which slot has interrupt pending */
@@ -1146,6 +1140,7 @@ static irqreturn_t shpc_isr(int IRQ, void *dev_id, struct pt_regs *regs)
			dbg("%s: intr_loc2 = %x\n",__FUNCTION__, intr_loc2); 
			dbg("%s: intr_loc2 = %x\n",__FUNCTION__, intr_loc2); 
		}
		}
	}
	}
 out:
	if (!shpchp_poll_mode) {
	if (!shpchp_poll_mode) {
		/* Unmask Global Interrupt Mask */
		/* Unmask Global Interrupt Mask */
		temp_dword = readl(php_ctlr->creg + SERR_INTR_ENABLE);
		temp_dword = readl(php_ctlr->creg + SERR_INTR_ENABLE);