lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aHYPYZgq17ogdEgC@smile.fi.intel.com>
Date: Tue, 15 Jul 2025 11:20:49 +0300
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Sean Anderson <sean.anderson@...ux.dev>
Cc: Jonathan Cameron <jic23@...nel.org>, Jean Delvare <jdelvare@...e.com>,
	Guenter Roeck <linux@...ck-us.net>, linux-iio@...r.kernel.org,
	linux-hwmon@...r.kernel.org, Andy Shevchenko <andy@...nel.org>,
	Nuno Sá <nuno.sa@...log.com>,
	linux-kernel@...r.kernel.org, David Lechner <dlechner@...libre.com>
Subject: Re: [PATCH 3/7] iio: Add in-kernel API for events

On Mon, Jul 14, 2025 at 09:20:19PM -0400, Sean Anderson wrote:
> Add an API to notify consumers about events. Events still need to be
> enabled using the iio_read_event/iio_write_event functions. Of course,
> userspace can also manipulate the enabled events. I don't think this is
> too much of an issue, since userspace can also manipulate the event
> thresholds. But enabling events may cause existing programs to be
> surprised when they get something unexpected. Maybe we should set the
> interface as busy when there are any in-kernel listeners?

...

>  #include <linux/wait.h>

While at it...

+ blank line here...

> +#include <linux/iio/consumer.h>
>  #include <linux/iio/iio.h>
>  #include <linux/iio/iio-opaque.h>

...and here?

>  #include "iio_core.h"

...

> +	struct iio_event_data ev = {
> +		.id = ev_code,
> +		.timestamp = timestamp,
> +	};

...

>  	/* Does anyone care? */
>  	if (iio_event_enabled(ev_int)) {
> -
> -		ev.id = ev_code;
> -		ev.timestamp = timestamp;
> -
>  		copied = kfifo_put(&ev_int->det_events, ev);
>  		if (copied != 0)
>  			wake_up_poll(&ev_int->wait, EPOLLIN);

Looks like this refactoring can be done before main change.

...

> +	WARN_ON(atomic_notifier_chain_unregister(&ev_int->notifier, block));

Is bug.h already included?


-- 
With Best Regards,
Andy Shevchenko



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ