Linux-i2c Archive on lore.kernel.org
 help / color / Atom feed
From: Wolfram Sang <wsa@kernel.org>
To: "linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: Pierre Yves MORDRET <pierre-yves.mordret@st.com>,
	Alexandre TORGUE <alexandre.torgue@st.com>,
	"linux-stm32@st-md-mailman.stormreply.com" 
	<linux-stm32@st-md-mailman.stormreply.com>,
	Fabrice GASNIER <fabrice.gasnier@st.com>
Subject: Re: [PATCH v2 1/2] i2c: smbus: add core function handling SMBus host-notify
Date: Sun, 2 Aug 2020 21:15:23 +0200
Message-ID: <20200802191523.GA13339@kunai> (raw)
In-Reply-To: <20200728121050.GC8715@gnbcxd0016.gnb.st.com>


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

> 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.


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

  parent reply index

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-03 11:36 [PATCH v2 0/2] i2c: stm32: add host-notify support via i2c slave Alain Volmat
2020-07-03 11:36 ` [PATCH v2 1/2] i2c: smbus: add core function handling SMBus host-notify Alain Volmat
2020-07-25 20:27   ` Wolfram Sang
2020-07-26 13:35     ` Wolfram Sang
2020-07-28 12:10     ` Alain Volmat
2020-07-28 16:36       ` Wolfram Sang
2020-08-02 19:15       ` Wolfram Sang [this message]
2020-07-03 11:36 ` [PATCH v2 2/2] i2c: stm32f7: Add SMBus Host-Notify protocol support Alain Volmat

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=20200802191523.GA13339@kunai \
    --to=wsa@kernel.org \
    --cc=alexandre.torgue@st.com \
    --cc=fabrice.gasnier@st.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=pierre-yves.mordret@st.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

Linux-i2c Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-i2c/0 linux-i2c/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-i2c linux-i2c/ https://lore.kernel.org/linux-i2c \
		linux-i2c@vger.kernel.org
	public-inbox-index linux-i2c

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-i2c


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git