Linux block layer
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: "Heiko Carstens" <hca@linux.ibm.com>,
	"Jens Axboe" <axboe@kernel.dk>,
	"Stefan Haberland" <sth@linux.ibm.com>,
	"Jan Höppner" <hoeppner@linux.ibm.com>
Cc: linux-s390@vger.kernel.org, linux-block@vger.kernel.org
Subject: Re: [PATCH 1/2] s390/dasd: Add __context_unsafe() attribute to various functions
Date: Thu, 6 Aug 2026 09:34:06 -0700	[thread overview]
Message-ID: <f6ec3927-cf77-484c-a3d8-c0417f2f2870@acm.org> (raw)
In-Reply-To: <20260806130050.2057443-2-hca@linux.ibm.com>

On 8/6/26 6:00 AM, Heiko Carstens wrote:
> diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
> index bacf770c0e1f..b4dcef06edaa 100644
> --- a/drivers/s390/block/dasd_eckd.c
> +++ b/drivers/s390/block/dasd_eckd.c
> @@ -1468,6 +1468,7 @@ static void dasd_eckd_path_available_action(struct dasd_device *device,
>   }
>   
>   static void do_pe_handler_work(struct work_struct *work)
> +__context_unsafe(/* Conditional locking */)
>   {
>   	struct pe_handler_work_data *data;
>   	struct dasd_device *device;

__context_unsafe() should be avoided if there is a better solution. For
this driver I propose to make the following changes:
- Change dasd_pe_handler_mutex into a semaphore. This driver locks this
   mutex from one kernel thread and unlocks it from another kernel
   thread. That's not allowed!
- Split the dasd_eckd_read_vol_info(), dasd_eckd_release(), ...
   functions. Move the code between the mutex_lock() and mutex_unlock()
   calls into a new function. Rework both functions such that the
   mutex_lock() and mutex_unlock() calls end up in the same branch of an
   if-statement.

Thanks,

Bart.


  reply	other threads:[~2026-08-06 16:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-06 13:00 [PATCH 0/2] s390/block: Enable CONTEXT_ANALYSIS Heiko Carstens
2026-08-06 13:00 ` [PATCH 1/2] s390/dasd: Add __context_unsafe() attribute to various functions Heiko Carstens
2026-08-06 16:34   ` Bart Van Assche [this message]
2026-08-06 18:09     ` Heiko Carstens
2026-08-06 13:00 ` [PATCH 2/2] s390/block: Enable CONTEXT_ANALYSIS Heiko Carstens
2026-08-06 16:34   ` Bart Van Assche
2026-08-06 13:09 ` [PATCH 0/2] " Stefan Haberland
2026-08-06 14:14 ` Jens Axboe

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=f6ec3927-cf77-484c-a3d8-c0417f2f2870@acm.org \
    --to=bvanassche@acm.org \
    --cc=axboe@kernel.dk \
    --cc=hca@linux.ibm.com \
    --cc=hoeppner@linux.ibm.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=sth@linux.ibm.com \
    /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