mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Benoît Thébaudeau" <benoit@wsystem.com>
To: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	rtc-linux <rtc-linux@googlegroups.com>
Subject: Re: [PATCH 4/6] rtc: rv8803: Always apply the I²C workaround
Date: Thu, 21 Jul 2016 20:30:46 +0200 (CEST)	[thread overview]
Message-ID: <664693872.422612.1469125846237.JavaMail.open-xchange@popperamen03.register.it> (raw)
In-Reply-To: <20160721111008.GE4446@piout.net>

On 21/07/2016 at 14:34, Benoît Thébaudeau wrote:
> On 21/07/2016 at 13:10, Alexandre Belloni wrote:
>> On 21/07/2016 at 12:41:30 +0200, Benoît Thébaudeau wrote :
>>> The I²C NACK issue of the RV-8803 may occur after any I²C START
>>> condition, depending on the timings. Consequently, the workaround must
>>> be applied for all the I²C transfers.
>>>
>>> This commit abstracts the I²C transfer code into register access
>>> functions. This avoids duplicating the I²C workaround everywhere. This
>>> also avoids the duplication of the code handling the return value of
>>> i2c_smbus_read_i2c_block_data(). Error messages are issued in case of
>>> definitive register access failures (if the workaround fails). This
>>> change also makes the I²C transfer return value checks consistent.
>>>
>>
>> Well, my initial idea was that the workaround is actually needed only
>> for operations that are not restartable from userspace.
>>
>> Did you it that bug? On which RTC?
>
> No, I've not seen that bug. However, the errata sheet says that this issue may
> occur if two consecutive I²C START conditions are slightly more than 950 ms
> apart. It does not even say that this is restricted to I²C transfers
> addressing
> this RTC. Moreover, if the time is read or set from userspace, this might
> occur
> at any time relatively to an RTC interrupt or to a previous time read/set
> operation, so possibly 950 ms afterwards.
>
> All in all, it's safer and easier to always apply this workaround, all the
> more
> it is applied at almost no cost when there is no issue.

To fully answer your questions, it's the job of the driver to execute the
userspace requests properly without returning spurious errors. Userspace might
consider that such errors are definitive and that there is no reason to try and
restart the operation, which could cause all sorts of issues. In other words,
the driver should not rely on userspace operation restarts as a kind of
workaround if it can easily handle this itself.

Also, the kernel itself (not only userspace) may read the RTC time (with
CONFIG_RTC_HCTOSYS), without userspace caring.

I'm rather working with the RX8900.

Best regards,
Benoît

  parent reply	other threads:[~2016-07-21 18:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-21 10:41 [PATCH 1/6] rtc: rv8803: Kconfig: Indicate rx8900 support Benoît Thébaudeau
2016-07-21 10:41 ` [PATCH 2/6] rtc: rv8803: Remove the check for valid time Benoît Thébaudeau
2016-07-21 10:41 ` [PATCH 3/6] rtc: rv8803: Fix read day of week Benoît Thébaudeau
2016-07-21 10:41 ` [PATCH 4/6] rtc: rv8803: Always apply the I²C workaround Benoît Thébaudeau
2016-07-21 11:10   ` Alexandre Belloni
2016-07-21 12:34     ` Benoît Thébaudeau
2016-07-21 18:30     ` Benoît Thébaudeau [this message]
2016-07-21 10:41 ` [PATCH 5/6] rtc: rv8803: Stop the clock while setting the time Benoît Thébaudeau
2016-07-21 10:41 ` [PATCH 6/6] rtc: rv8803: Clear V1F when " Benoît Thébaudeau
2016-07-28  8:00 ` [PATCH 1/6] rtc: rv8803: Kconfig: Indicate rx8900 support Alexandre Belloni

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=664693872.422612.1469125846237.JavaMail.open-xchange@popperamen03.register.it \
    --to=benoit@wsystem.com \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rtc-linux@googlegroups.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®