Guest User

Untitled

a guest
Jan 8th, 2020
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. static irqreturn_t pcie_isr(int irq, void *data)
  2. {
  3. struct test_device *ctrl = (struct test_device *)data;
  4. u32 status;
  5.  
  6. status = readl(ctrl->reg + INT_STATUS);
  7. /*
  8. * Check to see if it was our interrupt
  9. */
  10. if (!(status & 0x000C))
  11. return IRQ_NONE;
  12.  
  13. /* Clear the interrupt */
  14. writel(status, ctrl->reg + INT_STATUS);
  15.  
  16. if (status & 0x0004) {
  17. /*
  18. * Tx interrupt pending.
  19. */
  20. ....
  21. }
  22.  
  23. if (status & 0x0008) {
  24. /* Rx interrupt Pending */
  25. /* The system freezes if I read again the INT_STATUS register as given below */
  26. status = readl(ctrl->reg + INT_STATUS);
  27. ....
  28. }
  29. ..
  30. return IRQ_HANDLED;
  31. }
Add Comment
Please, Sign In to add comment