• Masahiro Yamada's avatar
    mmc: tmio: move TMIO_MASK_{READOP, WRITEOP} handling to correct place · b12a7a28
    Masahiro Yamada authored
    As far as I tested the IP on UniPhier SoCs, TMIO_STAT_{RXRDY,TXRQ}
    are asserted for DMA mode as well as for PIO.  I need to disable the
    those IRQs in dma_ops->start hook, otherwise the DMA transfer fails
    with the following error message:
      PIO IRQ in DMA mode!
    
    Renesas chips are the same cases since I see their dma_ops->start
    hooks explicitly clear TMIO_STAT_{RXRDY,TXRQ} (with nice comment!).
    
    If we do this sanity check in TMIO MMC core, RXRDY/TXRQ handling
    should be entirely moved to the core.  tmio_mmc_cmd_irq() will
    be a suitable place to disable them.
    
    The probe function sets TMIO_MASK_{READOP,WRITEOP} but this is odd.
    
        /* Unmask the IRQs we want to know about */
        if (!_host->chan_rx)
                irq_mask |= TMIO_MASK_READOP;
        if (!_host->chan_tx)
                irq_mask |= TMIO_MASK_WRITEOP;
    
    At this point, _host->{chan_rx,chan_tx} are _always_ NULL because
    tmio_mmc_request_dma() is called after this code.  Consequently,
    TMIO_MASK_{READOP,WRITEOP} are set here whether DMA is used or not.
    Remove this pointless code.
    Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
    Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
    Reviewed-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
    Tested-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
    b12a7a28
renesas_sdhi_internal_dmac.c 8.24 KB