Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2933726ybl; Fri, 20 Dec 2019 00:47:51 -0800 (PST) X-Google-Smtp-Source: APXvYqz8L4d3gQMiry7klWvL8WFlP5Yq0IDfWgQ+mYi8Khcr/6mR0FR767giOw+rWNwj13WGswAI X-Received: by 2002:a05:6830:1d7a:: with SMTP id l26mr13266206oti.138.1576831671708; Fri, 20 Dec 2019 00:47:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576831671; cv=none; d=google.com; s=arc-20160816; b=qTXWsPW0uv8YOR36eBa2biZMKCYXnIIhkVpmYYuDuZqUxA7gXmBI7bsk8w1tp6N3od 0G5fi32aFim3rLcXkUWfwUMR5BnUQonpCuYjujHJRo+gn8Hglm+T8pA1BOQsRa/wGNG0 rvxJxjeFzVTQ0wfrkgA22jVwxIYD5SAtGHdn02zvFvoMVefJBdiTQ3MRHnR+Heg7YrgJ pwJBGLZRiepiNMGWxkZzmPZR1zo7v2Ovag3r3zWbjlhbO2qwdrHLvR/QR6Dcfm5QIEkP j6zVFnUSxygDo4BBKNFcDxILAZBh2QdnpkLpjDGvuLmOb+edzhqw4c69fNfF0RHi3U9o 4+Og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=KC26HLxDRJovHhJMQJ5lAOVG1MGnXvkpVbRgP05Myy8=; b=S1ZAkc0UrEKEdaLx1DB0u33z2sczICPzGmRo72SYy77LF5tBIiFpJ6m/ZwwalSFXnh iTM9P5vBxi8DB4LJ6x3/lEczOVj3VrlHo15agTyUpaO9329IxQXbG0BG4WkHngNAKxdc Z1gcESUuK91XuBXwoLPIKDF2rDm8Hzdo++5yLDBvDtvvP0yPkukZW9NBZ4YSbYOcqW3a Ht7px6uY88PZ/I0hAGr8TkuKm4o8mkI7q/LBYe8jHrumxOYCgWVxuRwA3bi89697Bap7 4B/ecGuDWdnbE7xU8aLiuch8r0Qoo89lVeRFy7CDtaBA9plYeGv/wQBOamWnuwejY1Uv tP+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=wGysDDgA; 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 s26si4740481otr.38.2019.12.20.00.47.39; Fri, 20 Dec 2019 00:47:51 -0800 (PST) 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=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=wGysDDgA; 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 S1727239AbfLTIqG (ORCPT + 99 others); Fri, 20 Dec 2019 03:46:06 -0500 Received: from mail-il1-f194.google.com ([209.85.166.194]:38575 "EHLO mail-il1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727084AbfLTIqF (ORCPT ); Fri, 20 Dec 2019 03:46:05 -0500 Received: by mail-il1-f194.google.com with SMTP id f5so7308831ilq.5 for ; Fri, 20 Dec 2019 00:46:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=KC26HLxDRJovHhJMQJ5lAOVG1MGnXvkpVbRgP05Myy8=; b=wGysDDgA6GikQjvpFg8fc9uWKd6ow/H5uWmlEJTvI6JSdWwXLy7FE3Jk45OM7TPvx8 uDGbc6HjJYSEVAtx4uLF2iO4gIm6UMOpD2b+z2IlGicu85cZ7Pax5SHniFT1UWJv91tt dWsk/0xi4OGemcCc/UtNS94tkNge5KaCf0kwUQKC8SZWKmZYI756Ic7b5y+7FwczBX6y KMd8F4vcQdw20wrpAco9thUkr0jKhm2yz5exzZVOsmGj8wQbFg3e9PJXApdYVgi7oTyN huFMvLT5kaaXNxt58BBbOi1NPj4O4HMlL3fdS6mZxpf63vTvUavDdJAOXWWJEwDjpQ8f xpng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=KC26HLxDRJovHhJMQJ5lAOVG1MGnXvkpVbRgP05Myy8=; b=MgQEfwKuAY08RMERK4+qKoMEMUZ7rWdoLJ/o+HsIaEuYzscf+rullkpOsM/y6/Wo06 Y4ctxKNX3usQLWMu4orsKwe7KRZRUxXnz9dokKGH8PVuCnp/G35R8A9WpAWu9hDwXAzb oD/S3JEF00exrmzHnd9PmlF3yPOtiXJyOd2ofW1LCEGr0Zgwdom2Skh97gBIphBdZvY7 af+kP55IXuSaZbomyC6BlGotE7RCahhaff/OlYMUv0so74hJ1SeZGJsAXjP0JHgLpq8t eMgxENALXX5/v7FSek0GIVEOse53Y5AZEz7Yq/FC9wN6Wrs86HZ9PqCqxkMJnk7wNidn 8DZw== X-Gm-Message-State: APjAAAWQkjM8Acz3ZBF0oGaMWowix7K6XTcF4uIxj+vP7sEOlt4LRRtM rZajiWXcJp0NluylFAOKQP97A+rn1QPoRl+dZkBMCg== X-Received: by 2002:a92:8712:: with SMTP id m18mr6251028ild.40.1576831564827; Fri, 20 Dec 2019 00:46:04 -0800 (PST) MIME-Version: 1.0 References: <20191219171528.6348-1-brgl@bgdev.pl> <20191219171528.6348-13-brgl@bgdev.pl> <20191219172414.GA2094615@kroah.com> In-Reply-To: <20191219172414.GA2094615@kroah.com> From: Bartosz Golaszewski Date: Fri, 20 Dec 2019 09:45:53 +0100 Message-ID: Subject: Re: [PATCH v3 12/13] gpiolib: add new ioctl() for monitoring changes in line info To: Greg Kroah-Hartman Cc: Kent Gibson , Linus Walleij , Andy Shevchenko , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List , Bartosz Golaszewski Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org czw., 19 gru 2019 o 18:24 Greg Kroah-Hartman napisa=C5=82(a): > > On Thu, Dec 19, 2019 at 06:15:27PM +0100, Bartosz Golaszewski wrote: > > From: Bartosz Golaszewski > > > > Currently there is no way for user-space to be informed about changes > > in status of GPIO lines e.g. when someone else requests the line or its > > config changes. We can only periodically re-read the line-info. This > > is fine for simple one-off user-space tools, but any daemon that provid= es > > a centralized access to GPIO chips would benefit hugely from an event > > driven line info synchronization. > > > > This patch adds a new ioctl() that allows user-space processes to reuse > > the file descriptor associated with the character device for watching > > any changes in line properties. Every such event contains the updated > > line information. > > > > Currently the events are generated on three types of status changes: wh= en > > a line is requested, when it's released and when its config is changed. > > The first two are self-explanatory. For the third one: this will only > > happen when another user-space process calls the new SET_CONFIG ioctl() > > as any changes that can happen from within the kernel (i.e. > > set_transitory() or set_debounce()) are of no interest to user-space. > > > > Signed-off-by: Bartosz Golaszewski > > --- > > drivers/gpio/gpiolib.c | 191 ++++++++++++++++++++++++++++++++++++-- > > drivers/gpio/gpiolib.h | 1 + > > include/uapi/linux/gpio.h | 24 +++++ > > tools/gpio/gpio-watch | Bin 0 -> 26528 bytes > > Did you mean for this binary file to be checked in? > No, of course not, it's a mistake. I'll remove it in v4. Bart