devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Johan Hovold <johan@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Andreas Kemnade <andreas@kemnade.info>,
	Arnd Bergmann <arnd@arndb.de>,
	"H . Nikolaus Schaller" <hns@goldelico.com>,
	Marcel Holtmann <marcel@holtmann.org>,
	Sebastian Reichel <sebastian.reichel@collabora.co.uk>,
	Tony Lindgren <tony@atomide.com>,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v3 0/8] gnss: add new GNSS subsystem
Date: Fri, 1 Jun 2018 12:26:12 +0200	[thread overview]
Message-ID: <20180601102612.GC31639@amd> (raw)
In-Reply-To: <20180601094959.GA13775@localhost>

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

On Fri 2018-06-01 11:49:59, Johan Hovold wrote:
> On Fri, Jun 01, 2018 at 11:33:11AM +0200, Pavel Machek wrote:
> > Hi!
> > 
> > > This series adds a new subsystem for GNSS receivers (e.g. GPS
> > > receivers).
> > > 
> > > While GNSS receivers are typically accessed using a UART interface they
> > > often also support other I/O interfaces such as I2C, SPI and USB, while
> > > yet other devices use iomem or even some form of remote-processor
> > > messaging (rpmsg).
> > > 
> > > The new GNSS subsystem abstracts the underlying interface and provides a
> > > new "gnss" class type, which exposes a character-device interface (e.g.
> > > /dev/gnss0) to user space. This allows GNSS receivers to have a
> > > representation in the Linux device model, something which is important
> > > not least for power management purposes and which also allows for easy
> > > detection and identification of GNSS devices.
> > > 
> > > Note that the character-device interface provides raw access to whatever
> > > protocol the receiver is (currently) using, such as NMEA 0183, UBX or
> > > SiRF Binary. These protocols are expected to be continued to be handled
> > > by user space for the time being, even if some hybrid solutions are also
> > > conceivable (e.g. to have kernel drivers issue management commands).
> > 
> > So.. while you did good work on serial power management, this is
> > grossly misnamed. There's nothing GNSS specific in the code, and you
> > are not presenting consistent interface to the userland.
> > 
> > This is _not_ GNSS subsystem. This is serial power management
> > subsystem, or something like that. GPS/GNSS subsystem will need to be
> > built on top of this.
> 
> I thought we had this discussion already.

I don't remember useful discussion.

> This series adds an abstraction for GNSS receivers so that they can be
> detected by userspace without resorting to probing hacks. That is GNSS
> specific.
> 
> Furthermore, (since v2) we export a GNSS receiver type, which allows
> further protocol detection hacks to be dropped, something which is also
> GNSS specific.

So you have serial line + pm + protocol type. Nothing GNSS specific
really, it would be useful to (for example) say this is modem with AT
commands. Or this is QMI modem.

> The two drivers and library added are for GNSS devices and their
> specific power management needs, while a random serial-connected device
> may need to manage power differently. Also GNSS specific.

Or maybe it will need to manager power in the same way. How would the
AT modem be different?

> Finally, the GNSS subsystem is clearly not serial (as in UART) specific
> and works just as fine with I2C, SPI, USB, iomem, rproc or whatever
> interface the GNSS uses.

Ok, true. It is "we pass tty-like data across". Again, it would be
useful for AT commands, too, and yes, they go over serials and usbs
and more, too. 

> > This will never handle devices like Nokia N900, where GPS is connected
> > over netlink.
> 
> Marcel already suggested adding a ugnss interface, which would allow
> feeding GNSS data through the generic GNSS interface from user space for
> use cases where it's not (yet) feasible to implement a kernel
> driver.

Yes, and ugnss would be at wrong layer for N900. First, lets take a
look at N900 gps driver:
https://github.com/postmarketOS/gps-nokia-n900

Got it? I'll eventually like to see it in the kernel, but your "GNSS"
subsystem is unsuitable for it, as it does not talk well-known
protocol.

I'd like to see "datapipe" devices (what you currently call GNSS) and
"gps" devices, which would have common interface to the userland.

N900 would not have any datapipe devices, but would have /dev/gps0
exposing common GPS interface.

Droid4 would have /dev/datapipe0 (usb, AT protocol), /dev/datapipe1
(usb, QMI protocol), /dev/datapipe2 (gsmtty over serial, custom AT
protocol), /dev/datapipe3 (gsmtty over serial, NMEA wrapped in AT
protocol) (and more, it is complex hardware). And if we really wanted,
we'd have /dev/gps0, too, exposing common GPS interface.

Your devices would have /dev/datapipe0 with sirf or ublox or nmea
protocol. In we really wanted, we'd have /dev/gps0, too, again,
exposing common GPS interface.

I believe we really want to use your code for AT commands, too. And we
really should keep GNSS/GPS names for future layer that actually
provides single interface for userland.

Best regards,

									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

  reply	other threads:[~2018-06-01 10:26 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-01  8:22 [PATCH v3 0/8] gnss: add new GNSS subsystem Johan Hovold
2018-06-01  8:22 ` [PATCH v3 1/8] gnss: add GNSS receiver subsystem Johan Hovold
2018-06-01  8:22 ` [PATCH v3 2/8] dt-bindings: add generic gnss binding Johan Hovold
2018-06-01  8:22 ` [PATCH v3 3/8] gnss: add generic serial driver Johan Hovold
2018-06-01  8:22 ` [PATCH v3 4/8] dt-bindings: gnss: add u-blox binding Johan Hovold
2018-06-01 14:34   ` Rob Herring
2018-06-01  8:22 ` [PATCH v3 5/8] gnss: add driver for u-blox receivers Johan Hovold
2018-06-01  8:22 ` [PATCH v3 6/8] dt-bindings: gnss: add sirfstar binding Johan Hovold
2018-06-01  8:22 ` [PATCH v3 7/8] gnss: add driver for sirfstar-based receivers Johan Hovold
2018-06-01  8:22 ` [PATCH v3 8/8] gnss: add receiver type support Johan Hovold
2018-06-01  9:33 ` [PATCH v3 0/8] gnss: add new GNSS subsystem Pavel Machek
2018-06-01  9:49   ` Johan Hovold
2018-06-01 10:26     ` Pavel Machek [this message]
2018-06-01 12:22       ` Johan Hovold
2018-06-01 16:26         ` Pavel Machek
2018-06-01 16:37           ` H. Nikolaus Schaller
2018-06-01 21:46             ` Pavel Machek
2018-06-04 10:22           ` Johan Hovold
2018-06-05 21:47             ` Pavel Machek
2018-06-13  8:21               ` Johan Hovold
2018-06-28 12:01 ` Greg Kroah-Hartman
2018-06-29  9:46   ` Pavel Machek
2018-06-29 11:46     ` Johan Hovold
2018-06-29 12:05       ` Pavel Machek
2018-06-29 12:09         ` Johan Hovold
2018-07-02 19:32           ` Pavel Machek
2018-07-03  7:20             ` Johan Hovold
2018-06-29 18:26     ` Greg Kroah-Hartman
2018-07-02 19:01       ` Pavel Machek

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=20180601102612.GC31639@amd \
    --to=pavel@ucw.cz \
    --cc=andreas@kemnade.info \
    --cc=arnd@arndb.de \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hns@goldelico.com \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=sebastian.reichel@collabora.co.uk \
    --cc=tony@atomide.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;
as well as URLs for NNTP newsgroup(s).