Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4318636imm; Wed, 30 May 2018 03:28:01 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ2cGHaK0cMHz64eZqWP0yA0kLosgvoogSAe6s3k0hFO6TuRVMs+D0CWeZD4phZ92FFizrB X-Received: by 2002:a17:902:d886:: with SMTP id b6-v6mr2271492plz.361.1527676081184; Wed, 30 May 2018 03:28:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527676081; cv=none; d=google.com; s=arc-20160816; b=MnD+K3h7GijRXMshmjhuM4z/GleiU7MES3N02e+76LHcwU5RcnF9GLL2pax7ClQ4Fh vLothyqKBaLLgJfOMl9CzEEcg4RAAV6HppxeYptqAWCtzc23KNnD3ne2hyMElKcTv9r5 XNsw8c1yQK68t4sJmQ/hNUsqXRTbU/zAvc6Hssg/Ulw6sOXIokuMylF6RrnURsK/h/J/ vL0KU8+wwJQH517ky7cLbszh/Cu4tRGF3TpAk+0I2shoH5DT8/H6/YOqtGSPog34PluO t30i9rb4TvWblQM+m6aPN7qwV12Oqk/Iaf00fei5dA9tu4tgUF0bPJMJ5XLJZNLxgkQL eSAg== 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=CIPm2VCsrSU9VRjBaa/HiUe31wvisQagu6OFhXZLKGs=; b=BTFVJTjApqJ4mjngTkeEi+lDkNVIhMTWPnBwYxwpqPuHef833pI4OH308VKa1D58Ic 3flYyy1G95594hlRqq5ADYNZTuPD/hiwDv4iRNgMhb4EEyEARYWER8WTylU/THuXmMur /DP6dzOIjekviR/fZ44db+KX+NmT3wkAd1stmQIXIt/TZAvSyhdisI2A831SJcRq2hPF fDqS2eClVfoBYBhRW4gvmioEyT4iL+5s5ONRckEFX8BFNdOR1blN/VmRtXtHc7yhjwEm eqC20Ai3i82blhU1PQqxRsTCEnrxcAeXkhD9muHy+kjBY66GBIHP0TaewiObdxCanLVO OqIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=bCeP6aXv; 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 e124-v6si33726654pfe.80.2018.05.30.03.27.34; Wed, 30 May 2018 03:28:01 -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=bCeP6aXv; 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 S1751473AbeE3K0t (ORCPT + 99 others); Wed, 30 May 2018 06:26:49 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:33823 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751086AbeE3K0o (ORCPT ); Wed, 30 May 2018 06:26:44 -0400 Received: by mail-lf0-f66.google.com with SMTP id o9-v6so3449691lfk.1; Wed, 30 May 2018 03:26:43 -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=CIPm2VCsrSU9VRjBaa/HiUe31wvisQagu6OFhXZLKGs=; b=bCeP6aXvdvMkgQ58xkThB0w8NtHsV//Gv1Ym8X/XWSa65h2YjvP/O7jUjnImRYz80Z 3tofbBcToE0ea4bn3PDuqvXBofkMBsw9Ng0D3F0jio0XXsq6e23dFhn9ROHdX00bNEub pARuNvVO1pfKRJgcKKX9GKssYTeO3FpFd0e2YkJEb5OiBj3G75meQ3uwtn46fDg6X6gW mj4HY7UvQjjnjXYsf/eNub0qjs9sJC9qugMZm2SwW3D9hbSTvEHW1NAR9CN7BRbCwusM iyE4X0xqfIyELf36brMGFn28hBaDDKr7e0csIylm0tPZZH2tgQoRV16+ecatbbieAtCx uxsQ== 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=CIPm2VCsrSU9VRjBaa/HiUe31wvisQagu6OFhXZLKGs=; b=AZIyeTDZi0etccdxSJLaiZkFeOcOBLOQRjdwBbaH+CLlbqmgTtc4ZiQYCm3IQpTfpA diL0D+COFYrUDtaWIWJkm+kDZHrZowvZ28qD9CNCUpKukMiFTIgKbt8nhE7Mc+BOAHl7 hp1J2zoDC5SABTmOmmq1Qke7FRtKBZLPa1qUIHTORXV7QTQ0bHmCZuf64U8Yzmuj7vvz pw9L2JDVhLKf+i/bORepbiLf616cRjsSZaFnike15t+CkfK5tqPB63i4I9BKhKmHpLko W3o52ajbDE5bcOCpGDvu1GD0dedNTcWn9VfG78KPteqKkISO8xd4Rc8x4whA2RyHo8X8 a3Ig== X-Gm-Message-State: ALKqPweW+MNrs/js/n17N+A/lgK/AWWDscgKiBRFFDxgxGuAvzcssE7B 4htYrvPrY0WAaczheRKVVjM= X-Received: by 2002:a2e:9cd8:: with SMTP id g24-v6mr1649730ljj.141.1527676002639; Wed, 30 May 2018 03:26:42 -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 b65-v6sm7781128lff.5.2018.05.30.03.26.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 May 2018 03:26:41 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.90_1) (envelope-from ) id 1fNyJT-0005Mq-RJ; Wed, 30 May 2018 12:26:40 +0200 Date: Wed, 30 May 2018 12:26:39 +0200 From: Johan Hovold To: Marcel Holtmann Cc: Johan Hovold , Sebastian Reichel , Greg Kroah-Hartman , Rob Herring , Mark Rutland , Andreas Kemnade , Arnd Bergmann , "H . Nikolaus Schaller" , Pavel Machek , LKML , devicetree@vger.kernel.org Subject: Re: [PATCH 0/7] gnss: add new GNSS subsystem Message-ID: <20180530102639.GC3259@localhost> References: <20180424163458.11947-1-johan@kernel.org> <20180504132741.brn5jqv5ufjhp7ky@earth.universe> <20180507102056.GU2285@localhost> <20180508070153.GX2285@localhost> <20180508124817.GZ2285@localhost> <0EFEDDD9-C21B-458B-884D-FC23F3D38B94@holtmann.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0EFEDDD9-C21B-458B-884D-FC23F3D38B94@holtmann.org> 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 Hi Marcel, Sorry about the late reply. I got side-tracked with other things. On Tue, May 08, 2018 at 10:03:57PM +0200, Marcel Holtmann wrote: > 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. Fair enough. I've now added support for determining the GNSS type, which reflects the protocol(s) supported by the device and which should allow, for example, the gpsd protocol probing hack to be dropped. Currently, there are three types defined: "NMEA" NMEA 0183 "SiRF" SiRF Binary "UBX" UBX Note that both SiRF and UBX type devices typically support a subset of NMEA 0183 with vendor extensions (e.g. to allow switching to the vendor protocol). > > 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. I agree; it's horrid. Thanks, Johan