[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200802191523.GA13339@kunai>
Date: Sun, 2 Aug 2020 21:15:23 +0200
From: Wolfram Sang <wsa@...nel.org>
To: "linux-i2c@...r.kernel.org" <linux-i2c@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Cc: Pierre Yves MORDRET <pierre-yves.mordret@...com>,
Alexandre TORGUE <alexandre.torgue@...com>,
"linux-stm32@...md-mailman.stormreply.com"
<linux-stm32@...md-mailman.stormreply.com>,
Fabrice GASNIER <fabrice.gasnier@...com>
Subject: Re: [PATCH v2 1/2] i2c: smbus: add core function handling SMBus
host-notify
> I've simplified the index handling as you suggested. The only impact is that
> finally we do not consider anymore the I2C_SLAVE_WRITE_REQUESTED event as the
> beginning of the transaction since we don't perform the "reset" of the
> handling upon this event.
One more comment on this one because I had to update the testunit, too.
To be robust against multiple write messages in one transfer, we need to
reset both, after STOP and when I2C_SLAVE_WRITE_REQUESTED. See here:
96 case I2C_SLAVE_STOP:
97 if (tu->reg_idx == TU_NUM_REGS)
98 queue_delayed_work(system_long_wq, &tu->worker,
99 msecs_to_jiffies(100 * tu->regs[TU_REG_DELAY]));
100 fallthrough;
101
102 case I2C_SLAVE_WRITE_REQUESTED:
103 tu->reg_idx = 0;
104 break;
As you see, I used 'fallthrough' to avoid code duplication and that only
one reset part will be updated.
Dunno if you really need it, too, as I haven't seen your latest code yet.
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists