mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Trent Piepho <tpiepho@impinj.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"alexandre.belloni@free-electrons.com"
	<alexandre.belloni@free-electrons.com>,
	"pure.logic@nexus-software.ie" <pure.logic@nexus-software.ie>
Cc: "shawn.guo@linaro.org" <shawn.guo@linaro.org>,
	"stefan@agner.ch" <stefan@agner.ch>,
	"bianpan2016@163.com" <bianpan2016@163.com>,
	"a.zummo@towertech.it" <a.zummo@towertech.it>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>,
	"guy.shapiro@mobi-wize.com" <guy.shapiro@mobi-wize.com>,
	"Frank.Li@freescale.com" <Frank.Li@freescale.com>,
	"linux-rtc@vger.kernel.org" <linux-rtc@vger.kernel.org>
Subject: Re: [RESEND] rtc: snvs: Fix usage of snvs_rtc_enable
Date: Fri, 30 Mar 2018 22:59:00 +0000	[thread overview]
Message-ID: <1522450739.10662.278.camel@impinj.com> (raw)
In-Reply-To: <f380bc29-c8dd-5c20-efc4-ffc0ad69b8d6@nexus-software.ie>

On Thu, 2018-03-29 at 02:53 +0100, Bryan O'Donoghue wrote:
> On 29/03/18 01:12, Trent Piepho wrote:
> 
> > I sent a patch a couple weeks ago that addressed a similar issue, see
> > https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatchwork.ozlabs.org%2Fpatch%2F887090%2F&data=02%7C01%7Ctpiepho%40impinj.com%7Cb622940802df49deac4c08d59517e8d8%7C6de70f0f73574529a415d8cbb7e93e5e%7C0%7C1%7C636578852283390745&sdata=ds0ofpbTqrHBjGA18N343cJJ9sy2STQ9ZzSxH2TUyzE%3D&reserved=0
> > 
> > Does this also fix the problem you see?
> 
> It breaks the endless loop that happens later on in the RTC read path.
> 
> This patch though is about fixing the bug with not handling the enable 
> of the snvs_rtc_enable() correctly, which is why it should be applied.
> 
> The right flow is to handle the error on snvs_rtc_enable() as soon as it 
> happens as opposed wait for read() to -ETIMEDOUT.

Unless there are boards that don't enable the 32kHz oscillator until
after the kernel driver loads.  I was concerned about that so didn't
add the check in probe to prevent the driver from loading.  If the
possible disruption of that is acceptable, then it does seem better to
fail to load.

However, I think that even if the driver fails to probe if there is a
timeout at probe time, it's still possible to hang later if there are
not limits to the hardware polling loops, such as the ones I added.

> > I think what you've done will prevent the driver from loading if the
> > clock is not working, but if the clock does not tick properly after
> > loading, there are still points (snvs_rtc_read_time for one) that will
> > lock up in the kernel.
> 
> I'll dig out your patch and give it a review.
> 

  reply	other threads:[~2018-03-30 22:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-28 19:14 [RESEND] [PATCH] " Bryan O'Donoghue
2018-03-29  0:12 ` [RESEND] " Trent Piepho
2018-03-29  1:53   ` Bryan O'Donoghue
2018-03-30 22:59     ` Trent Piepho [this message]
2018-04-02 22:51       ` Bryan O'Donoghue
2018-04-03 14:42         ` Alexandre Belloni
2018-03-29  2:18 ` [RESEND] [PATCH] " Shawn Guo
2018-04-03 14:56 ` 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=1522450739.10662.278.camel@impinj.com \
    --to=tpiepho@impinj.com \
    --cc=Frank.Li@freescale.com \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=bianpan2016@163.com \
    --cc=guy.shapiro@mobi-wize.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=pure.logic@nexus-software.ie \
    --cc=shawn.guo@linaro.org \
    --cc=stable@vger.kernel.org \
    --cc=stefan@agner.ch \
    /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®