- 25 May, 2021 1 commit
-
-
Colin Ian King authored
There is a spelling mistake in an error message string, fix it. Signed-off-by:
Colin Ian King <colin.king@canonical.com> Reviewed-by:
Akash Asthana <akashast@codeaurora.org> Signed-off-by:
Wolfram Sang <wsa@kernel.org>
-
- 26 Feb, 2021 1 commit
-
-
Wolfram Sang authored
This reverts commit e0371298 . It was accidently applied despite discussion still going on. Signed-off-by:
Wolfram Sang <wsa@kernel.org> Acked-by:
Stephen Boyd <swboyd@chromium.org>
-
- 01 Feb, 2021 1 commit
-
-
Roja Rani Yarubandi authored
If the hardware is still accessing memory after SMMU translation is disabled (as part of smmu shutdown callback), then the IOVAs (I/O virtual address) which it was using will go on the bus as the physical addresses which will result in unknown crashes like NoC/interconnect errors. So, implement shutdown callback to i2c driver to stop on-going transfer and unmap DMA mappings during system "reboot" or "shutdown". Fixes: 37692de5 ("i2c: i2c-qcom-geni: Add bus driver for the Qualcomm GENI I2C controller") Signed-off-by:
Roja Rani Yarubandi <rojay@codeaurora.org> Reviewed-by:
Akash Asthana <akashast@codeaurora.org> Signed-off-by:
Wolfram Sang <wsa@kernel.org>
-
- 05 Jan, 2021 1 commit
-
-
Roja Rani Yarubandi authored
Store DMA mapping data in geni_i2c_dev struct to enhance DMA mapping data scope. For example during shutdown callback to unmap DMA mapping, this stored DMA mapping data can be used to call geni_se_tx_dma_unprep and geni_se_rx_dma_unprep functions. Add two helper functions geni_i2c_rx_msg_cleanup and geni_i2c_tx_msg_cleanup to unwrap the things after rx/tx FIFO/DMA transfers, so that the same can be used in geni_i2c_stop_xfer() function during shutdown callback. Signed-off-by:
Roja Rani Yarubandi <rojay@codeaurora.org> Reviewed-by:
Akash Asthana <akashast@codeaurora.org> Signed-off-by:
Wolfram Sang <wsa@kernel.org>
-
- 03 Dec, 2020 1 commit
-
-
Bjorn Andersson authored
A combination of recent bug fixes by Doug Anderson and the proper definition of iommu streams means that this hack is no longer needed. Let's clean up the code by reverting '127068ab ("i2c: qcom-geni: Disable DMA processing on the Lenovo Yoga C630")'. Signed-off-by:
Bjorn Andersson <bjorn.andersson@linaro.org> Acked-by:
Shawn Guo <shawn.guo@linaro.org> Acked-by:
Caleb Connolly <caleb@connolly.tech> Tested-by:
Steev Klimaszewski <steev@kali.org> Reviewed-by:
Akash Asthana <akashast@codeaurora.org> Signed-off-by:
Wolfram Sang <wsa@kernel.org>
-
- 26 Oct, 2020 1 commit
-
-
Douglas Anderson authored
This reverts commit 02b9aec5. As talked about in the patch ("soc: qcom: geni: More properly switch to DMA mode"), swapping the order of geni_se_setup_m_cmd() and geni_se_xx_dma_prep() can sometimes cause corrupted transfers. Thus we traded one problem for another. Now that we've debugged the problem further and fixed the geni helper functions to more disable FIFO interrupts when we move to DMA mode we can revert it and end up with (hopefully) zero problems! To be explicit, the patch ("soc: qcom: geni: More properly switch to DMA mode") is a prerequisite for this one. Fixes: 02b9aec5 ("i2c: i2c-qcom-geni: Fix DMA transfer race") Signed-off-by:
Douglas Anderson <dianders@chromium.org> Reviewed-by:
Stephen Boyd <swboyd@chromium.org> Reviewed-by:
Akash Asthana <akashast@codeaurora.org> Tested-by:
Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://lore.kernel.org/r/20201013142448.v2.2.I7b22281453b8a18ab16ef2bfd4c641fb1cc6a92c@changeid Signed-off-by:
Bjorn Andersson <bjorn.andersson@linaro.org>
-
- 29 Sep, 2020 1 commit
-
-
Barry Song authored
The code has been in a irq-disabled context since it is hard IRQ. There is no necessity to do it again. Signed-off-by:
Barry Song <song.bao.hua@hisilicon.com> Reviewed-by:
Akash Asthana <akashast@codeaurora.org> Reviewed-by:
Mukesh Kumar Savaliya <msavaliy@codeaurora.org> Signed-off-by:
Wolfram Sang <wsa@kernel.org>
-
- 23 Jul, 2020 1 commit
-
-
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:
Douglas Anderson <dianders@chromium.org> Tested-by:
Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org> Reviewed-by:
Akash Asthana <akashast@codeaurora.org> Reviewed-by:
Stephen Boyd <swboyd@chromium.org> Reviewed-by:
Mukesh Kumar Savaliya <msavaliy@codeaurora.org> Signed-off-by:
Wolfram Sang <wsa@kernel.org>
-
- 25 Jun, 2020 1 commit
-
-
Akash Asthana authored
Get the interconnect paths for I2C based Serial Engine device and vote according to the bus speed of the driver. Signed-off-by:
Akash Asthana <akashast@codeaurora.org> Reviewed-by:
Matthias Kaehlcke <mka@chromium.org> Acked-by:
Wolfram Sang <wsa@kernel.org> Link: https://lore.kernel.org/r/1592908737-7068-4-git-send-email-akashast@codeaurora.org Signed-off-by:
Bjorn Andersson <bjorn.andersson@linaro.org>
-
- 13 Mar, 2020 3 commits
-
-
Stephen Boyd authored
This driver doesn't call any DT platform functions like of_platform_*(). Remove the include as it isn't used. Reviewed-by:
Douglas Anderson <dianders@chromium.org> Reviewed-by:
Brendan Higgins <brendanhiggins@google.com> Signed-off-by:
Stephen Boyd <swboyd@chromium.org> Reviewed-by:
Bjorn Andersson <bjorn.andersson@linaro.org> Reviewed-by:
Amit Kucheria <amit.kucheria@linaro.org> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Stephen Boyd authored
Some lines are long here. Use a struct dev pointer to shorten lines and simplify code. The clk_get() call can fail because of EPROBE_DEFER problems too, so just remove the error print message because it isn't useful. Finally, platform_get_irq() already prints an error so just remove that error message. Reviewed-by:
Douglas Anderson <dianders@chromium.org> Reviewed-by:
Brendan Higgins <brendanhiggins@google.com> Signed-off-by:
Stephen Boyd <swboyd@chromium.org> Reviewed-by:
Bjorn Andersson <bjorn.andersson@linaro.org> Reviewed-by:
Amit Kucheria <amit.kucheria@linaro.org> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Stephen Boyd authored
We don't need to force IRQF_TRIGGER_HIGH here as the DT or ACPI tables should take care of this for us. Just use 0 instead so that we use the flags from the firmware. Also, remove specify dev_name() for the irq name so that we can get better information in /proc/interrupts about which device is generating interrupts. Cc: Alok Chauhan <alokc@codeaurora.org> Reviewed-by:
Douglas Anderson <dianders@chromium.org> Reviewed-by:
Brendan Higgins <brendanhiggins@google.com> Signed-off-by:
Stephen Boyd <swboyd@chromium.org> Reviewed-by:
Bjorn Andersson <bjorn.andersson@linaro.org> Reviewed-by:
Amit Kucheria <amit.kucheria@linaro.org> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
- 28 Sep, 2019 1 commit
-
-
Lee Jones authored
We have a production-level laptop (Lenovo Yoga C630) which is exhibiting a rather horrific bug. When I2C HID devices are being scanned for at boot-time the QCom Geni based I2C (Serial Engine) attempts to use DMA. When it does, the laptop reboots and the user never sees the OS. Attempts are being made to debug the reason for the spontaneous reboot. No luck so far, hence the requirement for this hot-fix. This workaround will be removed once we have a viable fix. Signed-off-by:
Lee Jones <lee.jones@linaro.org> Tested-by:
Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
- 14 Jun, 2019 2 commits
-
-
Lee Jones authored
Add a match table to allow automatic probing of ACPI device QCOM0220. Ignore clock attainment errors. Set default clock frequency value. Signed-off-by:
Lee Jones <lee.jones@linaro.org> Acked-by:
Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Lee Jones authored
The Qualcomm Geni I2C driver currently probes silently which can be confusing when debugging potential issues. Add a low level (INFO) print when each I2C controller is successfully initially set-up. Signed-off-by:
Lee Jones <lee.jones@linaro.org> Acked-by:
Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by:
Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
- 09 Nov, 2018 1 commit
-
-
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:
Stephen Boyd <swboyd@chromium.org> Reviewed-by:
Douglas Anderson <dianders@chromium.org> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
- 11 Oct, 2018 2 commits
-
-
Stephen Boyd authored
We don't need to use goto here, we can just collapse the if statement and goto chain into multiple branches and then combine some duplicate completion calls into one big if statement. Let's do it to clean up code some more. Signed-off-by:
Stephen Boyd <swboyd@chromium.org> Reviewed-by:
Douglas Anderson <dianders@chromium.org> Reviewed-by:
Alok Chauhan <alokc@codeaurora.org> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Stephen Boyd authored
We never really look at the 'ret' local variable in these functions, so let's remove it to make way for shorter and simpler code. Furthermore, we can shorten some lines by adding two local variables for the SE and the message length so that everything fits in 80 columns and testing the 'dma_buf' local variable in lieu of the 'mode' local variable. And kernel style is to leave the return statement by itself, detached from the rest of the function. Signed-off-by:
Stephen Boyd <swboyd@chromium.org> Reviewed-by:
Douglas Anderson <dianders@chromium.org> Reviewed-by:
Alok Chauhan <alokc@codeaurora.org> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
- 24 Sep, 2018 1 commit
-
-
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:
Philip Chen <philipchen@chromium.org> Signed-off-by:
Stephen Boyd <swboyd@chromium.org> Reviewed-by:
Douglas Anderson <dianders@chromium.org> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
- 31 Jul, 2018 1 commit
-
-
Karthikeyan Ramasubramanian authored
This bus driver supports the GENI based i2c hardware controller in the Qualcomm SOCs. The Qualcomm Generic Interface (GENI) is a programmable module supporting a wide range of serial interfaces including I2C. The driver supports FIFO mode and DMA mode of transfer and switches modes dynamically depending on the size of the transfer. Signed-off-by:
Karthikeyan Ramasubramanian <kramasub@codeaurora.org> Signed-off-by:
Sagar Dharia <sdharia@codeaurora.org> Signed-off-by:
Girish Mahadevan <girishm@codeaurora.org> Reviewed-by:
Douglas Anderson <dianders@chromium.org> Reviewed-by:
Stephen Boyd <swboyd@chromium.org> Tested-by:
Stephen Boyd <swboyd@chromium.org> [wsa: squashed the MAINTAINER addition and a RPM fix by Evan Green] Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-