• Masahiro Yamada's avatar
    mtd: nand: denali: rework interrupt handling · c19e31d0
    Masahiro Yamada authored
    Simplify the interrupt handling and fix issues:
    
    - The register field view of INTR_EN / INTR_STATUS is different
      among IP versions.  The global macro DENALI_IRQ_ALL is hard-coded
      for Intel platforms.  The interrupt mask should be determined at
      run-time depending on the running platform.
    
    - wait_for_irq() loops do {} while() until interested flags are
      asserted.  The logic can be simplified.
    
    - The spin_lock() guard seems too complex (and suspicious in a race
      condition if wait_for_completion_timeout() bails out by timeout).
    
    - denali->complete is reused again and again, but reinit_completion()
      is missing.  Add it.
    
    Re-work the code to make it more robust and easier to handle.
    
    While we are here, also rename the jump label "failed_req_irq" to
    more appropriate "disable_irq".
    Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
    Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
    c19e31d0
denali.c 38.6 KB