mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Philipp Zabel <p.zabel@pengutronix.de>
To: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>,
	Krzysztof Kozlowski <krzk@kernel.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 07/15] reset: use lock guards in reset core
Date: Thu, 08 Jan 2026 10:39:31 +0100	[thread overview]
Message-ID: <e0ea95b88285cfbf71a175fc8c60f6b2cfd28dc8.camel@pengutronix.de> (raw)
In-Reply-To: <20260105-reset-core-refactor-v1-7-ac443103498d@oss.qualcomm.com>

On Mo, 2026-01-05 at 15:15 +0100, Bartosz Golaszewski wrote:
> Simplify the locking code in reset core by using lock guard from
> linux/cleanup.h.
> 
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
> ---
>  drivers/reset/core.c | 51 +++++++++++++++++++++++----------------------------
>  1 file changed, 23 insertions(+), 28 deletions(-)
> 
> diff --git a/drivers/reset/core.c b/drivers/reset/core.c
> index 39bedf990223212998fa8ed4cda517529f94ee23..ffb811cbc6460b48dd833d3560d6538eea2fd5c0 100644
> --- a/drivers/reset/core.c
> +++ b/drivers/reset/core.c
> @@ -1069,22 +1064,23 @@ __of_reset_control_get(struct device_node *node, const char *id, int index,
>  		}
>  	}
>  
> -	mutex_lock(&reset_list_mutex);
> +	guard(mutex)(&reset_list_mutex);
> +

This breaks the __reset_add_reset_gpio_device() error path,
which jumps to the of_put: label without reset_list_mutex locked.
See [1], where I made the same mistake:

[1] https://lore.kernel.org/all/20240928222702.GX3550746@ZenIV/

regards
Philipp

  reply	other threads:[~2026-01-08  9:39 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-05 14:15 [PATCH 00/15] reset: major reset core refactoring Bartosz Golaszewski
2026-01-05 14:15 ` [PATCH 01/15] reset: gpio: remove unneeded OF-node put Bartosz Golaszewski
2026-01-08  9:02   ` Philipp Zabel
2026-01-05 14:15 ` [PATCH 02/15] reset: gpio: add a devlink between reset-gpio and its consumer Bartosz Golaszewski
2026-01-08  9:02   ` Philipp Zabel
2026-01-05 14:15 ` [PATCH 03/15] reset: gpio: simplify fallback device matching Bartosz Golaszewski
2026-01-08  9:26   ` Philipp Zabel
2026-01-05 14:15 ` [PATCH 04/15] reset: gpio: remove unneeded auxiliary_set_drvdata() Bartosz Golaszewski
2026-01-08  9:27   ` Philipp Zabel
2026-01-05 14:15 ` [PATCH 05/15] reset: warn on reset-gpio release Bartosz Golaszewski
2026-01-05 14:15 ` [PATCH 06/15] reset: fold ida_alloc() into reset_create_gpio_aux_device() Bartosz Golaszewski
2026-01-05 14:15 ` [PATCH 07/15] reset: use lock guards in reset core Bartosz Golaszewski
2026-01-08  9:39   ` Philipp Zabel [this message]
2026-01-05 14:15 ` [PATCH 08/15] reset: remove unneeded include Bartosz Golaszewski
2026-01-08  9:44   ` Philipp Zabel
2026-01-08 14:13     ` Bartosz Golaszewski
2026-01-05 14:15 ` [PATCH 09/15] reset: handle removing supplier before consumers Bartosz Golaszewski
2026-01-05 14:15 ` [PATCH 10/15] reset: protect struct reset_controller_dev with its own mutex Bartosz Golaszewski
2026-01-05 14:15 ` [PATCH 11/15] reset: protect struct reset_control " Bartosz Golaszewski
2026-01-05 14:15 ` [PATCH 12/15] reset: convert of_reset_control_get_count() to using firmware nodes Bartosz Golaszewski
2026-01-05 14:15 ` [PATCH 13/15] reset: convert the core API " Bartosz Golaszewski
2026-01-05 14:15 ` [PATCH 14/15] reset: convert reset core " Bartosz Golaszewski
2026-01-05 14:15 ` [PATCH 15/15] reset: gpio: make the driver fwnode-agnostic 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=e0ea95b88285cfbf71a175fc8c60f6b2cfd28dc8.camel@pengutronix.de \
    --to=p.zabel@pengutronix.de \
    --cc=bartosz.golaszewski@oss.qualcomm.com \
    --cc=krzk@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®