From b530be4591365199dd47555157377048c2b26c06 Mon Sep 17 00:00:00 2001 From: Jay Vasanth Date: Tue, 8 Mar 2022 10:16:08 -0500 Subject: [PATCH] espi: mec172x: kbc0_ibf_isr: read sts before data Read KBC Status register before reading KBC Data register in kbc0_ibf_isr; since read data will clear status. Signed-off-by: Jay Vasanth --- drivers/espi/espi_mchp_xec_host_v2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/espi/espi_mchp_xec_host_v2.c b/drivers/espi/espi_mchp_xec_host_v2.c index 1512e7afca1..ad37f3766a2 100644 --- a/drivers/espi/espi_mchp_xec_host_v2.c +++ b/drivers/espi/espi_mchp_xec_host_v2.c @@ -196,9 +196,9 @@ static void kbc0_ibf_isr(const struct device *dev) * and the lower byte speficies if the host sent * a command or data. 1 = Command. */ - uint32_t isr_data = ((kbc_hw->EC_DATA & 0xFF) << E8042_ISR_DATA_POS) | - ((kbc_hw->EC_KBC_STS & MCHP_KBC_STS_CD) << - E8042_ISR_CMD_DATA_POS); + uint32_t isr_data = ((kbc_hw->EC_KBC_STS & MCHP_KBC_STS_CD) << + E8042_ISR_CMD_DATA_POS); + isr_data |= ((kbc_hw->EC_DATA & 0xFF) << E8042_ISR_DATA_POS); struct espi_event evt = { .evt_type = ESPI_BUS_PERIPHERAL_NOTIFICATION,