Re: [PATCH 1/1] i2c: add slave testunit driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux