Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp528004imm; Fri, 1 Jun 2018 05:23:35 -0700 (PDT) X-Google-Smtp-Source: ADUXVKI7Q22lTN6mB5XHVKnNWeV85+GY7AYS13YJTIZg5QpI9rw0v85LajKST2fRi6n1DIbVHj0b X-Received: by 2002:a62:a38d:: with SMTP id q13-v6mr10771558pfl.49.1527855815913; Fri, 01 Jun 2018 05:23:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527855815; cv=none; d=google.com; s=arc-20160816; b=z19n/KYzZuuF6552Ra0igwyNFVEU5HweP5k0PJmSo4v8UZU4XArN3E08cwjUdDNzjs aTZNd2VVAyv6aBfDhxV3ccYI8V8Y/DrBWQxBPZ7UNzPsq99bZWpcIU2q6N39v7tBc0jI U2jEDMKsde8eihHptBfuiZjTEDu3E3YSrw8MAWD42VGiuFi4HE1oD0dGleOMG1gLmxC7 i6Wn4YQZXOWaK5yj9vqubIFvyEvY45qTaGWvST0v2X7z3APNthjXg91jh/Kx7ZKxgQ+F Xwgjdl5/l0btRgOT9xiYs9vyup3kEVEcYSk24gAaethXIzdzpQezR8ASYjhkZO7sGuj+ 5sjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=7oDGpbQ44l0XqGThFRp72ncKrsCRTDoUVrRRJblq8js=; b=f/0gr+ss8flgnRjFgHcqMkBtRExmVon2E075Sckmydzb5EfD/ujPix0tE2qr6jDkmd BVZ/w81CXbN8DMbQdW6qaPC+JT0iWT7jJ8gvfFVJprxRe/WygHXG28CYMdSbJ3ZMEIs8 ANDdvZaQUzNik2cq1/4v3WuTFP6UrBWxeZezbIlQiEWmMOhJJNuKSKR+m4U9hHBCcmFX 7z0xDjIxURV6JiwMNHsxqEP7Ae2jdQI5ZLWyViIhn/yjQ+pmSAxDZ5c3BaRLealPDOmR 1eY4YCAYsQSuxDU3a2EQVpsk+2ILW0BA8YDn+ROqK2gkws+lezFFUwNlMQd0FEJYM9wH QBWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=IFLCmyhK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 189-v6si1910521pfg.163.2018.06.01.05.23.06; Fri, 01 Jun 2018 05:23:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=IFLCmyhK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751812AbeFAMW3 (ORCPT + 99 others); Fri, 1 Jun 2018 08:22:29 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:47041 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751092AbeFAMWZ (ORCPT ); Fri, 1 Jun 2018 08:22:25 -0400 Received: by mail-lf0-f66.google.com with SMTP id j13-v6so10105679lfb.13; Fri, 01 Jun 2018 05:22:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=7oDGpbQ44l0XqGThFRp72ncKrsCRTDoUVrRRJblq8js=; b=IFLCmyhKp6yuilQOYIUjSSEB5+vvMFzBYZyxydZokSi98dUIomK1swITzXsWl47/7C Rzo9SIgWuMsEz0D5gFzv87IHWVyNHAJwjqRtJgLrPcFiWtanrMHEr2P2xqtTUrKe4PBa ij+JvhphQwacO4a+oz2xARP1JD9SM3zbLJFMKeZBN79cWhAqqIo3rFOHWGhS810ei2Id oKmkslDXL+knwzu0T1dCPYmBTFiYM6mTppoqww6a0jBszWrEsnsQV6o+w9b3WgitNCqt FJaDKqTcyDYDjVD8O8Hvjm/vgIshhNFBuBS4sLYITeHzXlO84d58Nb7Z7XfKU/HGR/BH N4oA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=7oDGpbQ44l0XqGThFRp72ncKrsCRTDoUVrRRJblq8js=; b=OlfHIJ4RzC/gcURzZO40BQlOWTMQuoawXe1Yd0wxGEPfqCaX8QBnngh0L9deWvfoiw a5MIOIhGzfzGoMRIpS229V+njI8sgAI+mQ1odCzUV4zi9B/t69MIvxw8gVK61l8hSS0q 9xX6AkyjLsM2d2Br8Ljw+0nEWjNSGD/Z000UkyDthP35VI5BbbIn7AselQxcuK9YSM74 5uXhSq7u6UpZF7OFXNPAyhMhq/z+nWUa7RdbWiQVt4Uc42/OO42bJ5CXQQqLrxljLaL1 5EIx78eUOuBQIMd9tSYoJ8vYkc/NaB1TPoLRLJ7zH18LAQzhG+8pBlXIJlBVVbe1yMgk AEgQ== X-Gm-Message-State: ALKqPwflTk9BEjfV/I0OgErSPqz6h/99Cjc2ZIMcfEV0piKOSNTVBqGG zp0d2Ak1WK+QeBwp/Glruxg= X-Received: by 2002:a2e:4189:: with SMTP id d9-v6mr7880730ljf.36.1527855743653; Fri, 01 Jun 2018 05:22:23 -0700 (PDT) Received: from xi.terra (c-8bb2e655.07-184-6d6c6d4.bbcust.telenor.se. [85.230.178.139]) by smtp.gmail.com with ESMTPSA id b1-v6sm2845851ljk.56.2018.06.01.05.22.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Jun 2018 05:22:22 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.90_1) (envelope-from ) id 1fOj4T-0003w7-Dt; Fri, 01 Jun 2018 14:22:17 +0200 Date: Fri, 1 Jun 2018 14:22:17 +0200 From: Johan Hovold To: Pavel Machek Cc: Johan Hovold , Greg Kroah-Hartman , Rob Herring , Mark Rutland , Andreas Kemnade , Arnd Bergmann , "H . Nikolaus Schaller" , Marcel Holtmann , Sebastian Reichel , Tony Lindgren , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH v3 0/8] gnss: add new GNSS subsystem Message-ID: <20180601122217.GB13775@localhost> References: <20180601082259.17563-1-johan@kernel.org> <20180601093311.GA31639@amd> <20180601094959.GA13775@localhost> <20180601102612.GC31639@amd> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180601102612.GC31639@amd> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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