Received: by 10.192.165.148 with SMTP id m20csp2005758imm; Thu, 26 Apr 2018 05:15:11 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp0KxL5GvYupcwhYbr6EDTFkEib5wSyCFr9gJeRjD8sl6CokrEUjGjSMvkh5lm2UzwYu081 X-Received: by 10.98.170.24 with SMTP id e24mr11250247pff.107.1524744911668; Thu, 26 Apr 2018 05:15:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524744911; cv=none; d=google.com; s=arc-20160816; b=hnw6+15GxcnIl9WueFUbMttmYQOTzbKhbLUfwGwykYejBpLA3AkJbiD7k+fhjvPLcW JcRCSmhM7QG6LDG7C5z+aMnhjDaZfr916cmf/r6BKIlObj+RMW6ee7I/Hig3wSey6HrM U/R7v9zL4wtmefc/jSL1egGtV8H1o08pG7KNTlngu9igJ6RG4vN0dHmkv2zlYDKWDAKN LZ96/l1JfffkVgZ+zMSmoNfReccMXxP76wg58mCcYw1nBT8h2oWEPHCk1WoehyAdAHg+ IEA4iS2+9mYXFH4Fj4k6wNkieSqmKEJr+BCmvwgX+sFwmneTgGosWMjIBmATyQY7xFRl //2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=LEWY//XWBM8XklR1/nYiDMK3q6ggM8+or/1JLxedQy4=; b=fTD0OKAtbRePt35IkbcpI69zY+Lflt4R9MZv6JPuxCsyXz3V/Fq9CRsfjIZxQYfTko 6ss7Hh7z99BgcH1LVDTLqT8wf0oCwph110ljeF5Azm/KOI+49Fn4sQTYaw91mov/IPVY Hh//PTbue6IBW1B7ekfdzaUnEYFmZU6p61/pCNsYfFgiwb8eqWqU9Ai/0/1ofDbh8LGg W0ee4iX76nt7Yj1vvl6KX9Q/8D3yDJK5gOyqxEemjAvY0LTtJgIBMlAL51rCoa4T9815 swqsWu3BRV6kEorn4xdbKmle+hsP0HSnIYX8HYnmIZUpGrSLo76lTVF4frya3SyJwTfA U92g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OyKXUE1B; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c2si4505118pfh.215.2018.04.26.05.14.57; Thu, 26 Apr 2018 05:15:11 -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=pass header.i=@linaro.org header.s=google header.b=OyKXUE1B; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755363AbeDZMNp (ORCPT + 99 others); Thu, 26 Apr 2018 08:13:45 -0400 Received: from mail-it0-f50.google.com ([209.85.214.50]:37600 "EHLO mail-it0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754847AbeDZMNl (ORCPT ); Thu, 26 Apr 2018 08:13:41 -0400 Received: by mail-it0-f50.google.com with SMTP id 71-v6so23442925ith.2 for ; Thu, 26 Apr 2018 05:13:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=LEWY//XWBM8XklR1/nYiDMK3q6ggM8+or/1JLxedQy4=; b=OyKXUE1BsQ/iEZG6BMK6ZhmqJ1uA+KO+r7C4Xmnk2+RT2YbNdastegfaBcF0jJRjyj RG4WmvxZ2oDPmgt5OatEMATijEcxk/+Jd/W59aVv7dRsS2sFlPGgDPYyLzOvX3a+YwDJ kUJxN2B41Tpqr5npQcTlNTn6Ml4uM5HWZVz58= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=LEWY//XWBM8XklR1/nYiDMK3q6ggM8+or/1JLxedQy4=; b=kLfGYwQI+iku61NosN7swSopUbUbkzEuyOZaPyTEjuDbOy+f0QKj/PcKv9NODLtd6h esT23ZHBMiIyk800OrMnlln1WJ48aFdOJXmVr/EJd4UCW5dkEhNroSTfqH9W2LF09LQE BcV3nzvJI3TRVba7NuxIHxDRvrNNFdBTabOcU/67svXfUg2Jx45cz15W53xL8w7BMESm Tnf1FWwGZpJU0G29FE4BwlbWROTFiz3iJpuzmWDG3e441jENeCnHQ8iNwAr+46ohUG+S gf+fymfBpLrtdIgj8HcNOGsEjFGQAbp9WZjy419jWv4+zu5vrbpJ5vxsv3lzaE1q8/lM GJ7w== X-Gm-Message-State: ALQs6tD7YekKzzHiEtKojskH3fWZeN6+4oNwgONoSQE1TzqIQ89hNWPx wsuz595x8o7u5JWujqMe0odjWn61KxX0oT3BITghLj6Y X-Received: by 2002:a24:ad1e:: with SMTP id c30-v6mr5194578itf.38.1524744821274; Thu, 26 Apr 2018 05:13:41 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4f:2793:0:0:0:0:0 with HTTP; Thu, 26 Apr 2018 05:13:40 -0700 (PDT) In-Reply-To: <17720832.6ELUnVt0BR@debian64> References: <20180410203028.11412-1-brgl@bgdev.pl> <17720832.6ELUnVt0BR@debian64> From: Linus Walleij Date: Thu, 26 Apr 2018 14:13:40 +0200 Message-ID: Subject: Re: [PATCH v2] gpiolib: add hogs support for machine code To: Christian Lamparter , Andy Shevchenko Cc: Bartosz Golaszewski , Jonathan Corbet , "open list:GPIO SUBSYSTEM" , linux-doc@vger.kernel.org, "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 12, 2018 at 10:00 PM, Christian Lamparter wrote: > The problem is that unlike native gpio-controllers, pinctrls need > to have a "pin/gpio range" defined before any gpio-hogs can be added. Indeed. But the primary use case (correct me if I am wrong Bartosz) is to clean up old boardfile code. Old boardfiles belong to equally old boards. They very often do not have pin control, just GPIO, and they very often have custom code that just issue gpio_get(), gpio_* etc to set up hogs. So this will be able to replace all such boilerplate with some hog table for each boardfile and be done with it. I.e. they have only drivers/gpio/gpio-foo.c and no pin control driver in 9 cases out of 10. Cases do exist where they use pin control with board files. Those are rare. But they will have problems. Some machine descriptor tables are used on modern archs and the most prominent is x86 Intel. However the Intel pin control driver is one of those that (IIRC) will actually survive this (i.e. it doesn not have this bug). They are not even using DT, they use ACPI. > So what will happen is that you'll get an > "gpiochip_machine_hog: unable to hog GPIO line $LABEL $GPIONR -517" error > for every single gpio-hog and wonder why :(. Hm maybe we can simply improbe the error messages so people realize they have to go and fix their pin control driver(s)? OK maybe a bit whimsical comment from me here... :/ Yours, Linus Walleij