From: Wolfram Sang <wsa@the-dreams.de>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>,
Linux I2C <linux-i2c@vger.kernel.org>,
Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Subject: Re: [PATCH 1/3] i2c: rcar: sanity check for minimal DMA length
Date: Tue, 12 Mar 2019 13:58:20 +0100 [thread overview]
Message-ID: <20190312125820.fusrrfq6levuci6y@ninjato> (raw)
In-Reply-To: <CAMuHMdWsChk1i36u_dDAxMV3j64sHputH5jmGyLxsfjAbeK6sw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1559 bytes --]
On Mon, Mar 11, 2019 at 11:08:13AM +0100, Geert Uytterhoeven wrote:
> Hi Wolfram,
>
> On Tue, Mar 5, 2019 at 7:52 PM Wolfram Sang
> <wsa+renesas@sang-engineering.com> wrote:
> > Use a macro for the hardcoded value and apply a build check. If it is
> > not met, the driver logic will not work anymore.
> >
> > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> > ---
> > drivers/i2c/busses/i2c-rcar.c | 8 ++++++--
> > 1 file changed, 6 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c
> > index 3ce74edcd70c..925858915569 100644
> > --- a/drivers/i2c/busses/i2c-rcar.c
> > +++ b/drivers/i2c/busses/i2c-rcar.c
>
> > @@ -921,6 +922,9 @@ static int rcar_i2c_probe(struct platform_device *pdev)
> > struct i2c_timings i2c_t;
> > int irq, ret;
> >
> > + /* Otherwise logic will break because some bytes must always use PIO */
> > + BUILD_BUG_ON_MSG(RCAR_MIN_DMA_LEN < 3, "Invalid min DMA length");
>
> Given patch 3/3, it should still work with RCAR_MIN_DMA_LEN == 2, right?
Nope. It is not that we transfer one byte more with PIO now. The change
in patch 3 is that we explicitly wait for an interrupt when the (already
existing) PIO transfer ended. Before that patch, we assumed DMA would
take over on its own once the data register is empty again. Should I
update the commit message to make this more clear?
Also, it is the _read_ case which needs the minimum lenght of 3. This is
fixing the _write_ code path :)
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2019-03-12 12:58 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-05 17:54 [PATCH 0/3] i2c: rcar: make DMA more robust Wolfram Sang
2019-03-05 17:54 ` [PATCH 1/3] i2c: rcar: sanity check for minimal DMA length Wolfram Sang
2019-03-11 9:49 ` Geert Uytterhoeven
2019-03-11 10:08 ` Geert Uytterhoeven
2019-03-12 12:58 ` Wolfram Sang [this message]
2019-03-15 12:56 ` Simon Horman
2019-03-20 17:20 ` Wolfram Sang
2019-03-05 17:54 ` [PATCH 2/3] i2c: rcar: let DMA enable routine return success status Wolfram Sang
2019-03-11 9:50 ` Geert Uytterhoeven
2019-03-15 13:02 ` Simon Horman
2019-03-20 17:20 ` Wolfram Sang
2019-03-05 17:54 ` [PATCH 3/3] i2c: rcar: wait for data empty before starting DMA Wolfram Sang
2019-03-11 9:59 ` Geert Uytterhoeven
2019-03-12 12:50 ` Wolfram Sang
2019-03-12 13:14 ` Geert Uytterhoeven
2019-03-12 13:18 ` Wolfram Sang
2019-03-12 13:56 ` Geert Uytterhoeven
2019-03-15 13:09 ` Simon Horman
2019-03-20 17:20 ` Wolfram Sang
2019-03-11 9:59 ` [PATCH 0/3] i2c: rcar: make DMA more robust Geert Uytterhoeven
2019-03-11 10:39 ` Wolfram Sang
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=20190312125820.fusrrfq6levuci6y@ninjato \
--to=wsa@the-dreams.de \
--cc=geert@linux-m68k.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=wsa+renesas@sang-engineering.com \
--cc=yoshihiro.shimoda.uh@renesas.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox