From: Alexander Kochetkov <al.kochet@gmail.com>
To: balbi@ti.com
Cc: Kevin Hilman <khilman@kernel.org>,
Tony Lindgren <tony@atomide.com>,
Wolfram Sang <wsa@the-dreams.de>,
linux-omap <linux-omap@vger.kernel.org>,
linux-i2c@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: Question about patch "i2c: omap: resize fifos before each message"
Date: Wed, 3 Dec 2014 20:34:21 +0300 [thread overview]
Message-ID: <8C51B585-BFD6-48CC-A2C4-EB88CB820426@gmail.com> (raw)
In-Reply-To: <20141203154936.GF16138@saruman>
03 дек. 2014 г., в 18:49, Felipe Balbi <balbi@ti.com> написал(а):
>
>> 2. I want to avoid changing fifos before message submission, because
>> IP can start receiving message in a slave mode (race).
>
> I2C is not full-duplex. There's no way it will receive any data while
> you're transmitting, right ?
>
I2C is half duplex, right. But, IP work in slave receiver and master transmitter modes.
And IP switch to slave receiver mode after master transfer (simply clear MST bit and ready for
reception and that TRM state about).
And question sounds like: what happen if we reset or change FIFO threshold value
(in order to submit new master transfer) when IP start receiving data to the fifo.
How many bytes we have to read on RRDY?
That race I'am talking about. And there is only one place where race couldn't happen: it's
ISR (thread). So I want to move almost all master initialization code into ISR.
>> 3. dev->threshold is changed in range 1-fifo_size/2. So instead of RDR
>> we get RRDY and for messages larger then fifo_size/2 we still get RRDY
>> and RDR.
>
> we will only get RDR if message_size % threshold > 0. If we have a 16
> byte transfer and we program threshold to 8 bytes, we will get two RRDY
> IRQs.
>
>> Felipe, do you have in mind why do you want to avoid RDR and XDR events?
>> Something about errata?
>
> nothing about errata. As the commit log say (or tried to say), if the
> entire message fits into the FIFO we save one interrupt. It's a
> micro-optimization.
I see, thank you. But due to error only half of fifo is utilized for that.
And, I'll try to move fifo threshold init code into ISR. Don't see something wrong.
Thank you a lot!
Regards,
Alexander.
next prev parent reply other threads:[~2014-12-03 17:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-03 15:11 Question about patch "i2c: omap: resize fifos before each message" Alexander Kochetkov
2014-12-03 15:49 ` Felipe Balbi
2014-12-03 17:34 ` Alexander Kochetkov [this message]
2014-12-03 17:49 ` Felipe Balbi
2014-12-03 19:01 ` Alexander Kochetkov
2014-12-03 19:38 ` Felipe Balbi
2014-12-03 20:04 ` Alexander Kochetkov
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=8C51B585-BFD6-48CC-A2C4-EB88CB820426@gmail.com \
--to=al.kochet@gmail.com \
--cc=balbi@ti.com \
--cc=khilman@kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=tony@atomide.com \
--cc=wsa@the-dreams.de \
/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