Skip to content

Commit 2edefc0

Browse files
hongyansJiri Kosina
authored andcommitted
HID: intel-ish: ipc: handle PIMR before ish_wakeup also clear PISR busy_clear bit
Host driver should handle interrupt mask register earlier than wake up ish FW else there will be conditions when FW interrupt comes, host PIMR register still not set ready, so move the interrupt mask setting before ish_wakeup. Clear PISR busy_clear bit in ish_irq_handler. If not clear, there will be conditions host driver received a busy_clear interrupt (before the busy_clear mask bit is ready), it will return IRQ_NONE after check_generated_interrupt, the interrupt will never be cleared, causing the DEVICE not sending following IRQ. Since PISR clear should not be called for the CHV device we do this change. After the change, both ISH2HOST interrupt and busy_clear interrupt will be considered as interrupt from ISH, busy_clear interrupt will return IRQ_HANDLED from IPC_IS_BUSY check. Signed-off-by: Song Hongyan <[email protected]> Acked-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 787a3b4 commit 2edefc0

File tree

1 file changed

+6
-3
lines changed
  • drivers/hid/intel-ish-hid/ipc

1 file changed

+6
-3
lines changed

drivers/hid/intel-ish-hid/ipc/ipc.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,10 @@ static bool check_generated_interrupt(struct ishtp_device *dev)
9191
IPC_INT_FROM_ISH_TO_HOST_CHV_AB(pisr_val);
9292
} else {
9393
pisr_val = ish_reg_read(dev, IPC_REG_PISR_BXT);
94-
interrupt_generated = IPC_INT_FROM_ISH_TO_HOST_BXT(pisr_val);
94+
interrupt_generated = !!pisr_val;
95+
/* only busy-clear bit is RW, others are RO */
96+
if (pisr_val)
97+
ish_reg_write(dev, IPC_REG_PISR_BXT, pisr_val);
9598
}
9699

97100
return interrupt_generated;
@@ -839,11 +842,11 @@ int ish_hw_start(struct ishtp_device *dev)
839842
{
840843
ish_set_host_rdy(dev);
841844

845+
set_host_ready(dev);
846+
842847
/* After that we can enable ISH DMA operation and wakeup ISHFW */
843848
ish_wakeup(dev);
844849

845-
set_host_ready(dev);
846-
847850
/* wait for FW-initiated reset flow */
848851
if (!dev->recvd_hw_ready)
849852
wait_event_interruptible_timeout(dev->wait_hw_ready,

0 commit comments

Comments
 (0)