All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Osipenko <digetx@gmail.com>
To: Sowjanya Komatineni <skomatineni@nvidia.com>,
	thierry.reding@gmail.com, jonathanh@nvidia.com,
	mkarthik@nvidia.com, smohammed@nvidia.com, talho@nvidia.com
Cc: linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-i2c@vger.kernel.org
Subject: Re: [PATCH V14 3/5] i2c: tegra: Add DMA support
Date: Thu, 7 Feb 2019 17:52:16 +0300	[thread overview]
Message-ID: <a6b1acbd-9be0-62b7-29bb-081d93ee92fb@gmail.com> (raw)
In-Reply-To: <1549480569-24860-3-git-send-email-skomatineni@nvidia.com>

06.02.2019 22:16, Sowjanya Komatineni пишет:
> This patch adds DMA support for Tegra I2C.
> 
> Tegra I2C TX and RX FIFO depth is 8 words. PIO mode is used for
> transfer size of the max FIFO depth and DMA mode is used for
> transfer size higher than max FIFO depth to save CPU overhead.
> 
> PIO mode needs full intervention of CPU to fill or empty FIFO's
> and also need to service multiple data requests interrupt for the
> same transaction. This adds delay between data bytes of the same
> transfer when CPU is fully loaded and some slave devices has
> internal timeout for no bus activity and stops transaction to
> avoid bus hang. DMA mode is helpful in such cases.
> 
> DMA mode is also helpful for Large transfers during downloading or
> uploading FW over I2C to some external devices.
> 
> Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com>
> ---


[snip]

> @@ -1124,6 +1453,10 @@ static int tegra_i2c_probe(struct platform_device *pdev)
>  		}
>  	}
>  
> +	ret = tegra_i2c_init_dma(i2c_dev);
> +	if (ret < 0)
> +		goto disable_div_clk;
> +
>  	ret = tegra_i2c_init(i2c_dev);
>  	if (ret) {
>  		dev_err(&pdev->dev, "Failed to initialize i2c controller\n");


Missing DMA resourcing release on probe failure.


diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
index 7921d3e6237d..11f25357b843 100644
--- a/drivers/i2c/busses/i2c-tegra.c
+++ b/drivers/i2c/busses/i2c-tegra.c
@@ -1612,14 +1612,14 @@ static int tegra_i2c_probe(struct platform_device *pdev)
        ret = tegra_i2c_init(i2c_dev, false);
        if (ret) {
                dev_err(&pdev->dev, "Failed to initialize i2c controller\n");
-               goto disable_div_clk;
+               goto release_dma;
        }
 
        ret = devm_request_irq(&pdev->dev, i2c_dev->irq,
                        tegra_i2c_isr, 0, dev_name(&pdev->dev), i2c_dev);
        if (ret) {
                dev_err(&pdev->dev, "Failed to request irq %i\n", i2c_dev->irq);
-               goto disable_div_clk;
+               goto release_dma;
        }
 
        i2c_set_adapdata(&i2c_dev->adapter, i2c_dev);
@@ -1633,10 +1633,13 @@ static int tegra_i2c_probe(struct platform_device *pdev)
 
        ret = i2c_add_numbered_adapter(&i2c_dev->adapter);
        if (ret)
-               goto disable_div_clk;
+               goto release_dma;
 
        return 0;
 
+release_dma:
+       tegra_i2c_release_dma(i2c_dev);
+
 disable_div_clk:
        if (i2c_dev->is_multimaster_mode)
                clk_disable(i2c_dev->div_clk);

  parent reply	other threads:[~2019-02-07 14:52 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-06 19:16 [PATCH V14 1/5] i2c: tegra: sort all the include headers alphabetically Sowjanya Komatineni
2019-02-06 19:16 ` Sowjanya Komatineni
2019-02-06 19:16 ` [PATCH V14 2/5] i2c: tegra: add bus clear Master Support Sowjanya Komatineni
2019-02-06 19:16   ` Sowjanya Komatineni
2019-02-07 18:26   ` Dmitry Osipenko
2019-02-06 19:16 ` [PATCH V14 3/5] i2c: tegra: Add DMA support Sowjanya Komatineni
2019-02-06 19:16   ` Sowjanya Komatineni
2019-02-07 11:01   ` Thierry Reding
2019-02-07 13:57   ` Dmitry Osipenko
2019-02-07 15:23     ` Sowjanya Komatineni
2019-02-07 16:01       ` Dmitry Osipenko
2019-02-07 16:06         ` Thierry Reding
2019-02-07 16:08           ` Sowjanya Komatineni
2019-02-07 16:17             ` Dmitry Osipenko
2019-02-07 18:02               ` Sowjanya Komatineni
2019-02-07 18:22                 ` Dmitry Osipenko
2019-02-07 14:52   ` Dmitry Osipenko [this message]
2019-02-07 15:11     ` Sowjanya Komatineni
2019-02-07 15:17       ` Dmitry Osipenko
2019-02-07 15:17       ` Sowjanya Komatineni
2019-02-07 15:56         ` Dmitry Osipenko
2019-02-07 16:02       ` Thierry Reding
2019-02-07 18:24   ` Dmitry Osipenko
2019-02-07 18:50   ` Dmitry Osipenko
2019-02-07 18:56     ` Sowjanya Komatineni
2019-02-07 19:03       ` Dmitry Osipenko
2019-02-07 19:14         ` Sowjanya Komatineni
2019-02-07 18:55   ` Dmitry Osipenko
2019-02-07 19:14   ` Dmitry Osipenko
2019-02-07 20:22     ` Dmitry Osipenko
2019-02-07 20:46   ` Dmitry Osipenko
2019-02-06 19:16 ` [PATCH V14 4/5] i2c: tegra: update transfer timeout Sowjanya Komatineni
2019-02-06 19:16   ` Sowjanya Komatineni
2019-02-06 19:16 ` [PATCH V14 5/5] i2c: tegra: add i2c interface timing support Sowjanya Komatineni
2019-02-06 19:16   ` Sowjanya Komatineni
2019-02-07 14:34   ` Dmitry Osipenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a6b1acbd-9be0-62b7-29bb-081d93ee92fb@gmail.com \
    --to=digetx@gmail.com \
    --cc=jonathanh@nvidia.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=mkarthik@nvidia.com \
    --cc=skomatineni@nvidia.com \
    --cc=smohammed@nvidia.com \
    --cc=talho@nvidia.com \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.