Received: by 10.192.165.148 with SMTP id m20csp4714735imm; Tue, 8 May 2018 13:04:39 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpA+N1oLGyNY/NQkMTY+js6+uwRtzrytAg73diFV28GQughO9pK9bEhDQzKOwWKs1R8uPDz X-Received: by 2002:a17:902:968d:: with SMTP id n13-v6mr41525686plp.168.1525809879244; Tue, 08 May 2018 13:04:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525809879; cv=none; d=google.com; s=arc-20160816; b=P66sK5DpBpQr9Hs6wdntBy2Q1uveN8+aB/PkPjX4/mPoxRaLAZsL+dCM1QrSpD4a2K R4fThs9cTIk+6M8Mb/6m1jEaKI9tVQInMFKj9SKtDbsv6f3K50XgO6uhP78j1YJiJk1k TR/yo30kR4zlRe9UReMxVVU3H1VeieDaYVGrVPtP/NEe211WvsGlwqoZxHrmCf/VnGRw CuKnnEisAiktquB9+BBa1fd4Ta2hjQV6GFoVovQ0d5IVno8e4C5e0AKvAxAB8wRZ3Xfh KTucxU1IVT2yn2thOakTqsoFpusTMPrSkH86s6s0hAs+ntqkQDKWG2JeE11w4XkmMBIF UDzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:arc-authentication-results; bh=Upd75nR8bmtfCvegCjsuxgLHRdR1UDvv+U6tMg1uTCA=; b=Ca+3d/zvCsr+V1O6kpPadm+NWW2KZv+EP2yoabAlgYntDtHLNPNEU7LK2/kNwTCdhc Io6PClqjXcUkOBvagxmGG1E9mubuvuCyPWaHBxhYQ199IdRfW13wS4L+aUTEqxavNHNS NylFUXQDokOH42AiKEOZVh/JuNNNPzkp/z6ppM7llT/DoXs5ztuiNi9HT/YyQ7euveIh utpICzNywdr5OAzZ6R30NUTQseeX28PMZkOd71ZmkAr8gS8tJKbF40Djec5de5vEEBPg NIG1sLLoEzD+dUwevxyOwnBqNe0zRHDX1MLVrZSBtIOc+wTDu7f99NofkKTsljwQuzfe JcDQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h12-v6si6429157pls.278.2018.05.08.13.04.24; Tue, 08 May 2018 13:04:39 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755520AbeEHUEB convert rfc822-to-8bit (ORCPT + 99 others); Tue, 8 May 2018 16:04:01 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:49506 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754370AbeEHUEA (ORCPT ); Tue, 8 May 2018 16:04:00 -0400 Received: from marcel-macpro.fritz.box (p5B3D2CDF.dip0.t-ipconnect.de [91.61.44.223]) by mail.holtmann.org (Postfix) with ESMTPSA id B93F8CEEB1; Tue, 8 May 2018 22:10:27 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.3 \(3445.6.18\)) Subject: Re: [PATCH 0/7] gnss: add new GNSS subsystem From: Marcel Holtmann In-Reply-To: <20180508124817.GZ2285@localhost> Date: Tue, 8 May 2018 22:03:57 +0200 Cc: Sebastian Reichel , Greg Kroah-Hartman , Rob Herring , Mark Rutland , Andreas Kemnade , Arnd Bergmann , "H . Nikolaus Schaller" , Pavel Machek , LKML , devicetree@vger.kernel.org Content-Transfer-Encoding: 8BIT Message-Id: <0EFEDDD9-C21B-458B-884D-FC23F3D38B94@holtmann.org> References: <20180424163458.11947-1-johan@kernel.org> <20180504132741.brn5jqv5ufjhp7ky@earth.universe> <20180507102056.GU2285@localhost> <20180508070153.GX2285@localhost> <20180508124817.GZ2285@localhost> To: Johan Hovold X-Mailer: Apple Mail (2.3445.6.18) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Johan, >>>>>> I have one concern, though. While providing raw data by >>>>>> default is fine generally, it is a problem with device >>>>>> auto-discovery. I think there should be some IOCTL from >>>>>> the start, that can be used to inform userspace about >>>>>> the raw protocol being used (i.e. "NMEA"). I fear, that >>>>>> userspace may start to just assume raw = NMEA without >>>>>> having this (especially since all initial drivers provide >>>>>> NMEA). >>>>> >>>>> One problem I see here would be that the driver does not necessarily >>>>> know either what protocol is currently being used. Some devices have >>>>> boot-pins which can be used to configure the initial protocol used (and >>>>> this could perhaps be reflected in DT), but this can often later be >>>>> changed (by user space) and even be made persistent using battery-backed >>>>> ram or eeproms. >>>>> >>>>> Also note that at least u-blox devices supports having more than one >>>>> protocol active on the same port... >>>> >>>> as long as userspace can determine that it is GNSS hardware and what >>>> hardware it is, then you deal with the rest in userspace. >>> >>> Yeah, I think that will do for now. >> >> I forgot to mention that this part should be simple. So providing a >> DEVTYPE attribute that can be easily associated to the /dev/gnssX >> nodes is a must have here. Doing complex mapping of USB or DT layouts >> to figure out this is NMEA vs some vendor vs I need extra code to >> change the mode etc. > > Yes, as I mentioned in the cover letter some kind of generic interface > for identifying the device type (and its features) should be defined > eventually. > I think this needs to be present from the start. Half backed subsystems are dangerous. And I really want to avoid hacking in userspace to figure out details about the hardware. > Note that this is not necessarily something that is needed from the > start however as, for example, gpsd implements protocol detection. That might be, but that is a total hack. Lets get this right from the get-go. >> So a proper GNSS daemon will require some hardware abstraction anyway. >> There will be still a few GNSS devices that are part of the cellular >> modem, where you have to go via the telephony daemon to get access to >> it. We have done this within oFono since there would be otherwise no >> access to it. So only extra pieces that could be done here is to >> provide a /dev/ugnss (like /dev/uinput, /dev/uhid) so that you can >> emulate GNSS hardware from userspace as well. In oFono, we could then >> just hook this up with /dev/ugnss and the GNSS daemon would not have >> to have to know how to talk to oFono. > > Interesting idea, could be useful for testing purposes as well. But just > so I understand your use case better, why do you need to go through > oFono rather than implement, say, a serdev driver for the GNSS port of > the modem? To enable the receiver using AT commands on a different port? > Or what kind of interface did you have in mind here? There are bunch of AT command based modems that will require you to send an AT command to enable NMEA reporting. Same as QMI requires you to send a command to enable the reporting. The QMI part might be eventually moved into the kernel if we get QMUX done there and all the USB modems ported to participate in a QMI subsystem so to speak. Until then even for QMI this is needed. Look at oFono and its location reporting drivers. We could easily change oFono to support /dev/ugnss and feed this all into a single GNSS subsystem. Regards Marcel