All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heiko Carstens <hca@linux.ibm.com>
To: Bart Van Assche <bvanassche@acm.org>
Cc: "Jens Axboe" <axboe@kernel.dk>,
	"Stefan Haberland" <sth@linux.ibm.com>,
	"Jan Höppner" <hoeppner@linux.ibm.com>,
	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 20:09:57 +0200	[thread overview]
Message-ID: <20260806180957.10725Aa3-hca@linux.ibm.com> (raw)
In-Reply-To: <f6ec3927-cf77-484c-a3d8-c0417f2f2870@acm.org>

On Thu, Aug 06, 2026 at 09:34:06AM -0700, Bart Van Assche wrote:
> 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.

Sure, I did that for other code, but this one is up to Stefan.

> 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!

Yes, I did not realize that when adding those attributes, however that
was also reported by Sashiko.

> - 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.

Agreed, all for Stefan's todo list :)

  reply	other threads:[~2026-08-06 18:10 UTC|newest]

Thread overview: 12+ 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 13:09   ` sashiko-bot
2026-08-06 14:06     ` Heiko Carstens
2026-08-06 14:09       ` Stefan Haberland
2026-08-06 16:34   ` Bart Van Assche
2026-08-06 18:09     ` Heiko Carstens [this message]
2026-08-06 13:00 ` [PATCH 2/2] s390/block: Enable CONTEXT_ANALYSIS Heiko Carstens
2026-08-06 13:02   ` sashiko-bot
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=20260806180957.10725Aa3-hca@linux.ibm.com \
    --to=hca@linux.ibm.com \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --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 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.