1. 25 May, 2021 1 commit
  2. 26 Feb, 2021 1 commit
  3. 01 Feb, 2021 1 commit
  4. 05 Jan, 2021 1 commit
  5. 03 Dec, 2020 1 commit
  6. 26 Oct, 2020 1 commit
  7. 29 Sep, 2020 1 commit
  8. 23 Jul, 2020 1 commit
    • Douglas Anderson's avatar
      i2c: i2c-qcom-geni: Fix DMA transfer race · 02b9aec5
      Douglas Anderson authored
      When I have KASAN enabled on my kernel and I start stressing the
      touchscreen my system tends to hang.  The touchscreen is one of the
      only things that does a lot of big i2c transfers and ends up hitting
      the DMA paths in the geni i2c driver.  It appears that KASAN adds
      enough delay in my system to tickle a race condition in the DMA setup
      code.
      
      When the system hangs, I found that it was running the geni_i2c_irq()
      over and over again.  It had these:
      
      m_stat   = 0x04000080
      rx_st    = 0x30000011
      dm_tx_st = 0x00000000
      dm_rx_st = 0x00000000
      dma      = 0x00000001
      
      Notably we're in DMA mode but are getting M_RX_IRQ_EN and
      M_RX_FIFO_WATERMARK_EN over and over again.
      
      Putting some traces in geni_i2c_rx_one_msg() showed that when we
      failed we were getting to the start of geni_i2c_rx_one_msg() but were
      never executing geni_se_rx_dma_prep().
      
      I believe that the problem here is that we are starting the geni
      command before we run geni_se_rx_dma_prep().  If a transfer makes it
      far enough before we do that then we get into the state I have
      observed.  Let's change the order, which seems to work fine.
      
      Although problems were seen on the RX path, code inspection suggests
      that the TX should be changed too.  Change it as well.
      
      Fixes: 37692de5
      
       ("i2c: i2c-qcom-geni: Add bus driver for the Qualcomm GENI I2C controller")
      Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
      Tested-by: default avatarSai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
      Reviewed-by: default avatarAkash Asthana <akashast@codeaurora.org>
      Reviewed-by: default avatarStephen Boyd <swboyd@chromium.org>
      Reviewed-by: default avatarMukesh Kumar Savaliya <msavaliy@codeaurora.org>
      Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
      02b9aec5
  9. 25 Jun, 2020 1 commit
  10. 13 Mar, 2020 3 commits
  11. 28 Sep, 2019 1 commit
  12. 14 Jun, 2019 2 commits
  13. 09 Nov, 2018 1 commit
    • Stephen Boyd's avatar
      i2c: qcom-geni: Fix runtime PM mismatch with child devices · 848bd3f3
      Stephen Boyd authored
      We need to enable runtime PM on this i2c controller before populating
      child devices with i2c_add_adapter(). Otherwise, if a child device uses
      runtime PM and stays runtime PM enabled we'll get the following warning
      at boot.
      
       Enabling runtime PM for inactive device (a98000.i2c) with active children
      
      [...]
      
       Call trace:
        pm_runtime_enable+0xd8/0xf8
        geni_i2c_probe+0x440/0x460
        platform_drv_probe+0x74/0xc8
      [...]
      
      Let's move the runtime PM enabling and setup to before we add the
      adapter, so that this device can respond to runtime PM requests from
      children.
      
      Fixes: 37692de5
      
       ("i2c: i2c-qcom-geni: Add bus driver for the Qualcomm GENI I2C controller")
      Signed-off-by: default avatarStephen Boyd <swboyd@chromium.org>
      Reviewed-by: default avatarDouglas Anderson <dianders@chromium.org>
      Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
      848bd3f3
  14. 11 Oct, 2018 2 commits
  15. 24 Sep, 2018 1 commit
    • Stephen Boyd's avatar
      i2c: i2c-qcom-geni: Properly handle DMA safe buffers · 66975767
      Stephen Boyd authored
      
      
      We shouldn't attempt to DMA map the message buffers passed into this
      driver from the i2c core unless the message we're mapping have been
      properly setup for DMA. The i2c core indicates such a situation by
      setting the I2C_M_DMA_SAFE flag, so check for that flag before using DMA
      mode. We can also bounce the buffer if it isn't already mapped properly
      by using the i2c_get_dma_safe_msg_buf() APIs, so do that when we
      want to use DMA for a message.
      
      This fixes a problem where the kernel oopses cleaning pages for a buffer
      that's mapped into the vmalloc space. The pages are returned from
      request_firmware() and passed down directly to the i2c master to write
      to the i2c touchscreen device. Mapping vmalloc buffers with
      dma_map_single() won't work reliably, causing an oops like below:
      
       Unable to handle kernel paging request at virtual address ffffffc01391d000
       ...
      Reported-by: default avatarPhilip Chen <philipchen@chromium.org>
      Signed-off-by: default avatarStephen Boyd <swboyd@chromium.org>
      Reviewed-by: default avatarDouglas Anderson <dianders@chromium.org>
      Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
      66975767
  16. 31 Jul, 2018 1 commit