Skip to content

i2c: i2c-qcom-geni: More properly fix the DMA race

Douglas Anderson linux-arm-msm linux-i2c lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 6 repliesIn review
  2. v13 patches 10 repliesSuperseded

Changes in v2 from the cover letter

- Consistently use "val_old" to keep track of old value.
- Add comments about why UART is special.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3soc: qcom: geni: More properly switch to DMA modedrivers/soc/qcom/qcom-geni-se.c+15 -20 replies
2/3Revert "i2c: i2c-qcom-geni: Fix DMA transfer race"drivers/i2c/busses/i2c-qcom-geni.c+2 -44 replies
3/3soc: qcom: geni: Optimize/comment select fifo/dma modedrivers/soc/qcom/qcom-geni-se.c+32 -182 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchAkash AsthanaStephen BoydDmitry Baryshkov
1/3R-b R-b T-b
2/3R-b R-b T-b
3/3R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCH v2 0/3] i2c: i2c-qcom-geni: More properly fix the DMA race

Previously I landed commit 02b9aec59243 ("i2c: i2c-qcom-geni: Fix DMA transfer race") to fix a race we were seeing. While that most definitely fixed the race we were seeing, it looks like it causes problems in the TX path, which we didn't stress test until we started trying to update firmware on devices.

Let's revert that patch and try another way: fix the original problem by disabling the interrupts that aren't relevant to DMA transfers. Now we can stress both TX and RX cases and see no problems. I also can't find any place to put an msleep() that causes problems anymore.

Since this problem only affects i2c, I'm hoping for an Ack from Bjorn and then all these patches can go through the i2c tree. However, if maintainers want to work a different way out to land that's OK too.

NOTE: the 3rd patch in the series could certianly be squashed with patch #1 or I could re-order / rejigger. To me it seemed like a good idea to first fix the probelm (and make the two functions as much of an inverse as possible) and later try to clean things up. Yell if you want something different.

Changes in v2:
- Consistently use "val_old" to keep track of old value.
- Add comments about why UART is special.

Douglas Anderson (3):
soc: qcom: geni: More properly switch to DMA mode Revert "i2c: i2c-qcom-geni: Fix DMA transfer race"
soc: qcom: geni: Optimize/comment select fifo/dma mode

 drivers/i2c/busses/i2c-qcom-geni.c |  6 ++--
 drivers/soc/qcom/qcom-geni-se.c    | 55 ++++++++++++++++++++++--------
 2 files changed, 43 insertions(+), 18 deletions(-)
Signature · 1 line
2.28.0.1011.ga647a8990f-goog