All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: Alain Volmat <alain.volmat@st.com>
Cc: linux-i2c@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	Michal Simek <michal.simek@xilinx.com>
Subject: Re: [PATCH 1/1] i2c: add slave testunit driver
Date: Fri, 11 Sep 2020 21:05:49 +0200	[thread overview]
Message-ID: <20200911190549.GA909@ninjato> (raw)
In-Reply-To: <20200911125419.GE23480@gnbcxd0016.gnb.st.com>

[-- Attachment #1: Type: text/plain, Size: 1056 bytes --]

Hi Alain,

> great that you published your slave-unittest driver.
> I gave it a try rapidly and can confirm it works as expected on the stm32
> platform. I tested with a loopback between 2 i2c controllers.

Thanks, much appreciated! I read this as Tested-by :)

> > +config I2C_SLAVE_TESTUNIT
> > +	tristate "I2C eeprom testunit driver"
> 
> Should be tristate "I2C testunit driver" I believe (no eeprom)

Oops, yes.

> > +	switch (tu->regs[TU_REG_CMD]) {
> > +	case TU_CMD_READ_BYTES:
> > +		msg.addr = tu->regs[TU_REG_DATAL];
> > +		msg.flags = I2C_M_RD;
> > +		msg.len = tu->regs[TU_REG_DATAH];
> 
> Some protection might be needed here since the size is coming straight from
> the i2cset command while the buffer is limited to 256 bytes.

Well, the size is not a problem because all the regs are u8. But for the
address, we should mask the lower 7 bits, in deed. We could use the free
8th bit to double the length, but we probably better keep it reserved for
something yet unknown.

Thanks for the review!

   Wolfram


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      reply	other threads:[~2020-09-11 19:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-11  7:16 [PATCH 0/1] i2c: add slave testunit driver Wolfram Sang
2020-09-11  7:16 ` [PATCH 1/1] " Wolfram Sang
2020-09-11 12:54   ` Alain Volmat
2020-09-11 19:05     ` Wolfram Sang [this message]

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=20200911190549.GA909@ninjato \
    --to=wsa+renesas@sang-engineering.com \
    --cc=alain.volmat@st.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=michal.simek@xilinx.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.