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-next>] [day] [month] [year] [list]
Date:   Sun, 26 Apr 2020 10:38:11 +0300
From:   Alexandru Ardelean <alexandru.ardelean@...log.com>
To:     <linux-iio@...r.kernel.org>, <linux-kernel@...r.kernel.org>
CC:     <lars@...afoo.de>, <jic23@...nel.org>, <pmeerw@...erw.net>,
        "Alexandru Ardelean" <alexandru.ardelean@...log.com>
Subject: [PATCH v5 0/6] iio: core,buffer: re-organize chardev creation

The main intent is to be able to add more chardevs per IIO device, one
for each buffer. To get there, some rework is needed.
This tries to re-organize the init of the chardev.

Changelog v4 -> v5:
- dropped patch 'iio: Use an early return in iio_device_alloc to simplify code.'
  is applied upstream

Changelog v3 -> v4:
- added patch [1] 'iio: Use an early return in iio_device_alloc to simplify code.'
  it's main purpose is so that this patch applies:
     [2]'iio: core: add simple centralized mechanism for ioctl() handlers'
  depending on the final version of patch [1], patch [2] needs some
  minor fixup
- added patch 'iio: core,buffer: wrap iio_buffer_put() call into iio_buffers_put()'
- patch 'iio: core: register buffer fileops only if buffer present'
  is now: 'iio: core: register chardev only if needed'
- dropped 'iio: buffer: move sysfs alloc/free in industrialio-buffer.c'
  it's likely we won't be doing this patch anymore
- patches:
    'iio: buffer: move iio buffer chrdev in industrialio-buffer.c'
    'iio: event: move event-only chardev in industrialio-event.c'
  have been merged into 'iio: buffer,event: duplicate chardev creation for buffers & events'
  since now, the logic is a bit different, and 'indio_dev->chrdev' is
  now a reference to either the buffer's chrdev & or the events-only
  chrdev
- added simple mechanism to register ioctl() handlers for IIO device
  which is currently used only by events mechanism

Changelog v2 -> v3:
* removed double init in
  'iio: event: move event-only chardev in industrialio-event.c'

Changelog v1 -> v2:
* re-reviewed some exit-paths and cleanup some potential leaks on those
  exit paths:
  - for 'iio: buffer: move iio buffer chrdev in industrialio-buffer.c'
    add iio_device_buffers_put() helper and calling iio_buffers_uninit()
    on device un-regsiter
  - for 'move sysfs alloc/free in industrialio-buffer.c'
    call 'iio_buffer_free_sysfs_and_mask()' on exit path if
    cdev_device_add() fails
  - for 'move event-only chardev in industrialio-event.c'
    check if event_interface is NULL in
    iio_device_unregister_event_chrdev()

Alexandru Ardelean (6):
  iio: buffer: add back-ref from iio_buffer to iio_dev
  iio: core,buffer: wrap iio_buffer_put() call into iio_buffers_put()
  iio: core: register chardev only if needed
  iio: buffer,event: duplicate chardev creation for buffers & events
  iio: core: add simple centralized mechanism for ioctl() handlers
  iio: core: use new common ioctl() mechanism

 drivers/iio/iio_core.h            |  29 ++++++---
 drivers/iio/industrialio-buffer.c | 102 +++++++++++++++++++++++++++--
 drivers/iio/industrialio-core.c   | 105 +++++++++++-------------------
 drivers/iio/industrialio-event.c  | 100 +++++++++++++++++++++++++++-
 include/linux/iio/buffer_impl.h   |  10 +++
 include/linux/iio/iio.h           |   8 +--
 6 files changed, 267 insertions(+), 87 deletions(-)

-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ