All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kent Gibson <warthog618@gmail.com>
To: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,
	brgl@bgdev.pl, linus.walleij@linaro.org, andy@kernel.org
Cc: Kent Gibson <warthog618@gmail.com>
Subject: [PATCH v2 0/5] gpiolib: cdev: guard tidying
Date: Thu, 21 Dec 2023 09:20:35 +0800	[thread overview]
Message-ID: <20231221012040.17763-1-warthog618@gmail.com> (raw)

This series contains some tidying up of gpiolib-cdev following the
recent adoption of guard().

The first patch is a fix to protect gpio_ioctl() from having the
gpio chip removed while the ioctl is in progress.

The next couple of patches are minor fixes inspired by recent
submissions and reviews for gpiolib.c.

Patch 2 adds a missing include.

Patch 3 switches allocation of struct linereq from kzalloc() to
kvzalloc() as it can be larger than one page - even more so after the
recent relocation of debounce_period_us.

The final two patches replace wrapper functions with guards.

Patch 4 tidies up the functions that use a guard on the linereq
config_mutex.

Patch 5 tidies up the functions that use a guard on the gpio_device.

Changes v1 -> v2:
 - add patch 1 to protect gpio_ioctl() from chip removal
 - improve commit comment (patch 3)
 - use guard(rwsem_read) rather than rolling our own (patch 5)

Cheers,
Kent.

Kent Gibson (5):
  gpiolib: cdev: add gpio_device locking wrapper around gpio_ioctl()
  gpiolib: cdev: include overflow.h
  gpiolib: cdev: allocate linereq using kvzalloc()
  gpiolib: cdev: replace locking wrappers for config_mutex with guards
  gpiolib: cdev: replace locking wrappers for gpio_device with guards

 drivers/gpio/gpiolib-cdev.c | 257 ++++++++++--------------------------
 1 file changed, 70 insertions(+), 187 deletions(-)

--
2.39.2


             reply	other threads:[~2023-12-21  1:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-21  1:20 Kent Gibson [this message]
2023-12-21  1:20 ` [PATCH v2 1/5] gpiolib: cdev: add gpio_device locking wrapper around gpio_ioctl() Kent Gibson
2023-12-21  9:32   ` Bartosz Golaszewski
2023-12-21  1:20 ` [PATCH v2 2/5] gpiolib: cdev: include overflow.h Kent Gibson
2023-12-21  1:20 ` [PATCH v2 3/5] gpiolib: cdev: allocate linereq using kvzalloc() Kent Gibson
2023-12-21  1:20 ` [PATCH v2 4/5] gpiolib: cdev: replace locking wrappers for config_mutex with guards Kent Gibson
2023-12-21  1:20 ` [PATCH v2 5/5] gpiolib: cdev: replace locking wrappers for gpio_device " Kent Gibson
2023-12-21 15:48   ` Andy Shevchenko
2023-12-22  0:47     ` Kent Gibson
2023-12-22 14:05       ` Bartosz Golaszewski
2023-12-22 14:12         ` Kent Gibson
2023-12-27 14:46 ` [PATCH v2 0/5] gpiolib: cdev: guard tidying Bartosz Golaszewski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231221012040.17763-1-warthog618@gmail.com \
    --to=warthog618@gmail.com \
    --cc=andy@kernel.org \
    --cc=brgl@bgdev.pl \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.