vfio-mdev/samples: change RDI interrupt condition
authorShunyong Yang <shunyong.yang@hxt-semitech.com>
Wed, 21 Mar 2018 18:46:23 +0000 (12:46 -0600)
committerAlex Williamson <alex.williamson@redhat.com>
Thu, 22 Mar 2018 19:18:18 +0000 (13:18 -0600)
When FIFO mode is enabled, the receive data available interrupt
(UART_IIR_RDI in code) should be triggered when the number of data
in FIFO is equal or larger than interrupt trigger level.

This patch changes the trigger level check to ensure multiple bytes
received from upper layer can trigger RDI interrupt correctly.

Cc: Joey Zheng <yu.zheng@hxt-semitech.com>
Signed-off-by: Shunyong Yang <shunyong.yang@hxt-semitech.com>
Reviewed by: Kirti Wankhede <kwankhede@nvidia.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
samples/vfio-mdev/mtty.c

index 09f255bdf3ace89b83b560b6d24a8ee1d136ee71..7abb79d8313d94c5bd214485ed7f2a6b8b555ce1 100644 (file)
@@ -534,7 +534,7 @@ static void handle_bar_read(unsigned int index, struct mdev_state *mdev_state,
 
                /* Interrupt priority 2: Fifo trigger level reached */
                if ((ier & UART_IER_RDI) &&
-                   (mdev_state->s[index].rxtx.count ==
+                   (mdev_state->s[index].rxtx.count >=
                      mdev_state->s[index].intr_trigger_level))
                        *buf |= UART_IIR_RDI;