public inbox for linux-tegra@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i2c: tegra: Fix i2c-tegra DMA config option processing
@ 2023-08-03 17:10 Parker Newman
  2023-08-04 21:49 ` Andi Shyti
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Parker Newman @ 2023-08-03 17:10 UTC (permalink / raw)
  To: Laxman Dewangan, Dmitry Osipenko, Andi Shyti, Thierry Reding,
	Jonathan Hunter, linux-i2c@vger.kernel.org,
	linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org


This patch fixes the Tegra DMA config option processing in the
i2c-tegra driver.

Tegra processors prior to Tegra186 used APB DMA for I2C requiring
CONFIG_TEGRA20_APB_DMA=y while Tegra186 and later use GPC DMA requiring
CONFIG_TEGRA186_GPC_DMA=y.

The check for if the processor uses APB DMA is inverted and so the wrong
DMA config options are checked.

This means if CONFIG_TEGRA20_APB_DMA=y but CONFIG_TEGRA186_GPC_DMA=n
with a Tegra186 or later processor the driver will incorrectly think DMA is
enabled and attempt to request DMA channels that will never be availible,
leaving the driver in a perpetual EPROBE_DEFER state.

Signed-off-by: Parker Newman <pnewman@connecttech.com>
---
 drivers/i2c/busses/i2c-tegra.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
index bcbbf23aa530..dc6ed3a8d69e 100644
--- a/drivers/i2c/busses/i2c-tegra.c
+++ b/drivers/i2c/busses/i2c-tegra.c
@@ -442,7 +442,7 @@ static int tegra_i2c_init_dma(struct tegra_i2c_dev *i2c_dev)
    if (IS_VI(i2c_dev))
        return 0;

-   if (!i2c_dev->hw->has_apb_dma) {
+   if (i2c_dev->hw->has_apb_dma) {
        if (!IS_ENABLED(CONFIG_TEGRA20_APB_DMA)) {
            dev_dbg(i2c_dev->dev, "APB DMA support not enabled\n");
            return 0;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-08-14 15:55 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-03 17:10 [PATCH] i2c: tegra: Fix i2c-tegra DMA config option processing Parker Newman
2023-08-04 21:49 ` Andi Shyti
2023-08-14 15:25   ` Dmitry Osipenko
2023-08-14 15:54     ` Parker Newman
2023-08-04 21:56 ` Andi Shyti
2023-08-06 14:21   ` Akhil R
2023-08-08 12:42     ` Parker Newman
2023-08-08 13:23       ` Andi Shyti
2023-08-14 13:37     ` Wolfram Sang
2023-08-14 14:26       ` Akhil R
2023-08-08 14:05 ` Andi Shyti
2023-08-14 13:38 ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox