if (snd_hdac_bus_handle_stream_irq(bus, status, stream_update))
                        active = true;
 
-               /* clear rirb int */
                status = azx_readb(chip, RIRBSTS);
                if (status & RIRB_INT_MASK) {
+                       /*
+                        * Clearing the interrupt status here ensures that no
+                        * interrupt gets masked after the RIRB wp is read in
+                        * snd_hdac_bus_update_rirb. This avoids a possible
+                        * race condition where codec response in RIRB may
+                        * remain unserviced by IRQ, eventually falling back
+                        * to polling mode in azx_rirb_get_response.
+                        */
+                       azx_writeb(chip, RIRBSTS, RIRB_INT_MASK);
                        active = true;
                        if (status & RIRB_INT_RESPONSE) {
                                if (chip->driver_caps & AZX_DCAPS_CTX_WORKAROUND)
                                        udelay(80);
                                snd_hdac_bus_update_rirb(bus);
                        }
-                       azx_writeb(chip, RIRBSTS, RIRB_INT_MASK);
                }
        } while (active && ++repeat < 10);