Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2191387ybl; Thu, 19 Dec 2019 09:26:24 -0800 (PST) X-Google-Smtp-Source: APXvYqyPNO3wX6GKuoaVKTgM3FNECrV3o0Mh2ckVPP0cu0I9wIIAW/da+iu0ns5jy9ht43Q6WZeT X-Received: by 2002:aca:2b1a:: with SMTP id i26mr2581625oik.64.1576776384398; Thu, 19 Dec 2019 09:26:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576776384; cv=none; d=google.com; s=arc-20160816; b=VDJeIWGfd8NAPmYfm1x5Cr1ltEOmZUYyVbL5nkPikuqAyX+TwPefE/52XoNkkOSKro QduZGM0CarFC7oC4deEdYkHlQJFdBsUFmtwKGIJaHpm0BbQFfWt1uQAaPV1cif+wmHzm 0EMnLZCBWMhW34mF/wJ1hCe+sjaemWK2AqXP2TjzGaNG8G1rDYZwmwi4LOTXwTy1ehDp EhnrkYiEK74VEhlYj7ek40kLzdFWKhr7Lr78gAcRUbtt1q4lSzz8mh+QtKYGYEIHJz/M u4UHghl73CH6RCA2CStHmgNT4WPTDEs92XNSIg0OtUN/AaUxoEKyjawiIUl2YAQlJSGq xdMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=NIvHFcITQ1ojU09TsURcUHs6/E2taZ004bwYVU91XpY=; b=OEAJTEl7A726mdon1aGqCy8KYkakylrthAfgyZxdcfyPRQ3V2qyJ5fs7+tR0WRrteU nc9zbIbpNG9ftVku4Rl5JgfnsxuivfDX0kPGn4OgxibBM/o1jnvrJHLmlvCh4Ske9Nyq x2ZCt60K/sITDU/PLFgGKKcoWr/26W7dJff15OT621HqyZbI7Ds6hGwDdGJxgYuOJxD+ dYGtEC7e/0U6m9dalfxP98rf++fr/Va4xI0m9ykj55wQIqeUKeiqdfKKQECw+CdbCbc9 TTEQ0TfqWvMzoizOM/VLmquEakEem6zkZs2AAylUdcqVYVJ1F8bseP6Q4Wf6czBibvpg G1Qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="B2/HMkbI"; 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 a64si3396850oif.256.2019.12.19.09.26.11; Thu, 19 Dec 2019 09:26:24 -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=@kernel.org header.s=default header.b="B2/HMkbI"; 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 S1726906AbfLSRYS (ORCPT + 99 others); Thu, 19 Dec 2019 12:24:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:46048 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726866AbfLSRYR (ORCPT ); Thu, 19 Dec 2019 12:24:17 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 88D95227BF; Thu, 19 Dec 2019 17:24:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576776257; bh=Yc0dVxNqw4LEl2NuvNZOlnPXns4Hras9ntdGRuPQr+0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=B2/HMkbIMtPZL6hs4lEzVOIG4SnjS3h6bB2xyyx1Rsr2sWTj1+XZR1BUIFDN9panN RK8gRw67tNhvucPNv8CT+mr4sJWVk/nZma4jF10eEu2/nDOcNM76yBeWHf19Nfond1 AiWB3F31SfFfdqlwlK/PxBS14TxhkTi0hiBqaev8= Date: Thu, 19 Dec 2019 18:24:14 +0100 From: Greg Kroah-Hartman To: Bartosz Golaszewski Cc: Kent Gibson , Linus Walleij , Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: Re: [PATCH v3 12/13] gpiolib: add new ioctl() for monitoring changes in line info Message-ID: <20191219172414.GA2094615@kroah.com> References: <20191219171528.6348-1-brgl@bgdev.pl> <20191219171528.6348-13-brgl@bgdev.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191219171528.6348-13-brgl@bgdev.pl> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 provides > 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: when > 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?