linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Kemnade <andreas@kemnade.info>
To: Johan Hovold <johan@kernel.org>
Cc: robh+dt@kernel.org, mark.rutland@arm.com,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	Discussions about the Letux Kernel 
	<letux-kernel@openphoenux.org>
Subject: Re: [PATCH v2 2/5] gnss: sirf: power on logic for devices without wakeup signal
Date: Mon, 14 Jan 2019 13:13:46 +0100	[thread overview]
Message-ID: <20190114131346.4d476055@kemnade.info> (raw)
In-Reply-To: <20190114105129.GE3691@localhost>

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

On Mon, 14 Jan 2019 11:51:29 +0100
Johan Hovold <johan@kernel.org> wrote:

> On Thu, Jan 10, 2019 at 11:02:23PM +0100, Andreas Kemnade wrote:
> > Hi Johan,
> > 
> > On Thu, 10 Jan 2019 13:10:38 +0100
> > Johan Hovold <johan@kernel.org> wrote:  
> 
> > > On Sun, Dec 09, 2018 at 08:51:47PM +0100, Andreas Kemnade wrote:  
> 
> > > > Additionally it checks for the initial state of the device during
> > > > probing to ensure it is off.    
> > > 
> > > Is this really needed? If so, it should probably go in a separate patch.
> > >   
> > Well, it is the main motivation for the new try of upstreaming this again.
> > You know the loooong history...
> > It has several times messed up my power consumption statistics. As I try
> > to test patches on top of mainline, this has often led to false alarms
> > regarding pm bugs in other drivers.
> > 
> > We could also come from another kernel here via kexec having the
> > device in another state. 
> > 
> > And why we do not want to check for uncommon things here? We e.g. do
> > multiple tries for changing power state.   
> 
> You still need to argue why it is needed (e.g. the kexec case) and that
> needs to go in the commit message of a separate patch adding something
> like that as it is orthogonal to supporting configurations without
> wakeup.
> 
yes, totally agreed, there is already a separate patch with an extensive
commit message.

> This may also be better handled by a shutdown() callback which is where
> such kexec concerns are supposed to be handled, and that would also take
> care of the reboot case. This way, not everyone has to pay a penalty on
> every boot for the arguable rare use case of kexec.
> 
there are more possibilities than kexec.

> > GPS chips will have usually some boot messages. So it is not the
> > "send nmea data set every X seconds" for the wakeup case, it is
> > another situation deserving IMHO another name.  
> 
> Ok, but unless all supported (sirf-star-based) chips have boot messages,
> we'd still need to wait that long for wakeup.
> 
I have never seen one without. But that could also be attached
to the dtb compatible name or a separate property.

> Are these messages you refer to output also on wake from hibernate, and
> not just on boot?
> 
also wake from hibernate.
I mean
$PSRF150,1*3E


> > > In pseudo code we have:
> > > 
> > >   activate:
> > >    - toggle on-off
> > >    - wait(data-received, ACTIVATE_TIMEOUT + REPORT_CYCLE)
> > >      - reception: success   
> > 
> > Note: we can also get the goodbye/shutdown message from the chip here
> > so there are chances of a false success, but since we initially power down,
> > we will rule out wrong state here.  
> 
> Good point. Unless we know the current state, we'd need to sleep for
> HIBERNATE_TIMEOUT before waiting for data reception.
> 
> > >      - timeout: failure
> > > 
> > >   hibernate:
> > >    - toggle on-off
> > >    - sleep(HIBERNATE_TIMEOUT)  
> > we could also additionally check here for 
> >    if (last_bytes_received == GOODBYE_MSG)  
> 
> Caching and parsing the stream for this could get messy. And is the
> expected message clearly defined somewhere, or would it be device (and
> firmware) dependent?
> 
I think so but I must check.
$PSRF150.0

But as said, these ideas are be for a possibly later patchset.

Regards,
Andreas

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

  reply	other threads:[~2019-01-15 16:00 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-09 19:51 [PATCH v2 0/5] gnss: sirf: add support for w2sg0004 + lna Andreas Kemnade
2018-12-09 19:51 ` [PATCH v2 1/5] gnss: sirf: write data to gnss only when the gnss device is open Andreas Kemnade
2019-01-10 12:02   ` Johan Hovold
2019-01-13 20:50     ` Andreas Kemnade
2019-01-14 12:00       ` Johan Hovold
2018-12-09 19:51 ` [PATCH v2 2/5] gnss: sirf: power on logic for devices without wakeup signal Andreas Kemnade
2019-01-10 12:10   ` Johan Hovold
2019-01-10 22:02     ` Andreas Kemnade
2019-01-14 10:51       ` Johan Hovold
2019-01-14 12:13         ` Andreas Kemnade [this message]
2019-01-22  8:38           ` Johan Hovold
2019-01-14 21:58         ` Andreas Kemnade
2019-01-15  9:08           ` Johan Hovold
2018-12-09 19:51 ` [PATCH v2 3/5] dt-bindings: gnss: add w2sg0004 compatible string Andreas Kemnade
2019-01-10 12:12   ` Johan Hovold
2018-12-09 19:51 ` [PATCH v2 4/5] gnss: sirf: add a separate supply for a lna Andreas Kemnade
2018-12-10  7:42   ` [Letux-kernel] " H. Nikolaus Schaller
2019-01-10 12:25   ` Johan Hovold
2018-12-09 19:51 ` [PATCH v2 5/5] dt-bindings: gnss: add lna-supply property Andreas Kemnade
2019-01-10 12:27   ` Johan Hovold
2019-01-10 17:07     ` Andreas Kemnade
2019-01-14  9:15       ` Johan Hovold

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=20190114131346.4d476055@kemnade.info \
    --to=andreas@kemnade.info \
    --cc=devicetree@vger.kernel.org \
    --cc=johan@kernel.org \
    --cc=letux-kernel@openphoenux.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).