linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Pavel Machek <pavel@ucw.cz>
Cc: Johan Hovold <johan@kernel.org>,
	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 14:22:17 +0200	[thread overview]
Message-ID: <20180601122217.GB13775@localhost> (raw)
In-Reply-To: <20180601102612.GC31639@amd>

On Fri, Jun 01, 2018 at 12:26:12PM +0200, Pavel Machek wrote:
> On Fri 2018-06-01 11:49:59, Johan Hovold wrote:
> > On Fri, Jun 01, 2018 at 11:33:11AM +0200, Pavel Machek wrote:

> > 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.

It's a matter of finding the right abstraction level. A user space
location service will now have easy access to the class of devices it
cares about, without having to go through a list of other random devices
which happen to use a similar underlying interface (e.g. a modem or
whatever).

> > 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?

Point is, you can't write a subsystem for everything. If it later turns
out some part of the code can be shared internally, fine.

> > 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. 

Modems and GNSS devices would have different characteristics for buffers
and throughput for starters.

The GNSS interface uses a synchronous writes for commands to the
receiver, something which may not be appropriate for an outgoing data
channel, for example.

As mentioned in the cover letter, we may eventually want to add support
for some kinds of configuration from within the kernel (e.g. protocol
and line speed changes).

> > > 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.

Seriously? If you can't be arsed to summarise your use case, why would I
bother reading your random user space code?

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

You keep talking about this "gps" interface, which based on your
earlier comments I assume you mean a NMEA 0183 interface? Again,
converting a vendor-specific binary protocol may not be feasible. Please
try to be more be specific.

> 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.

This does not seem like the right abstraction level and doesn't appear
to provide much more than what we currently have with ttys.

> 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.

Specifics, please. What would such an interface look like? I'm pretty
sure, we do not want to move every GNSS middleware protocol handler into
the kernel.

Johan

  reply	other threads:[~2018-06-01 12:22 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
2018-06-01 12:22       ` Johan Hovold [this message]
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=20180601122217.GB13775@localhost \
    --to=johan@kernel.org \
    --cc=andreas@kemnade.info \
    --cc=arnd@arndb.de \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hns@goldelico.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=mark.rutland@arm.com \
    --cc=pavel@ucw.cz \
    --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).