From: sashiko-bot@kernel.org
To: "Heiko Carstens" <hca@linux.ibm.com>
Cc: linux-s390@vger.kernel.org, "Heiko Carstens" <hca@linux.ibm.com>,
"Vasily Gorbik" <gor@linux.ibm.com>,
"Alexander Gordeev" <agordeev@linux.ibm.com>
Subject: Re: [PATCH net-next 1/2] s390/ctcm: Add __context_unsafe() attribute to various functions
Date: Thu, 06 Aug 2026 14:51:02 +0000 [thread overview]
Message-ID: <20260806145103.0820E1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260805145032.1409325-2-hca@linux.ibm.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Unsafe conditional locking using `!in_hardirq()` leads to guaranteed self-deadlocks on PREEMPT_RT or when using forced threaded interrupts (`threadirqs`).
--
--- Patch [1]: [PATCH net-next 1/2] s390/ctcm: Add __context_unsafe() attribute to various functions ---
commit c3d2fbe266a854e35b040af4b1c68b39c513a193
Author: Heiko Carstens <hca@linux.ibm.com>
Subject: s390/ctcm: Add __context_unsafe() attribute to various functions
Disable context analysis for various functions to get rid of context
analysis compile time warnings using clang caused by conditional
locking.
> diff --git a/drivers/s390/net/ctcm_fsms.c b/drivers/s390/net/ctcm_fsms.c
> index bf917f4264532..84fd394d35250 100644
> --- a/drivers/s390/net/ctcm_fsms.c
> +++ b/drivers/s390/net/ctcm_fsms.c
[ ... ]
> @@ -1462,7 +1456,7 @@ static void ctcmpc_chx_rx(fsm_instance *fi, int event, void *arg)
> spin_lock_irqsave(
> get_ccwdev_lock(ch->cdev), saveflags);
> rc = ccw_device_start(ch->cdev, &ch->ccw[0], 0, 0xff, 0);
> - if (dolock) /* see remark about conditional locking */
> + if (dolock)
> spin_unlock_irqrestore(
> get_ccwdev_lock(ch->cdev), saveflags);
[Severity: High]
This is a pre-existing issue, but does this conditional locking using
!in_hardirq() (which sets dolock earlier in ctcmpc_chx_rx) cause
self-deadlocks on PREEMPT_RT or when using forced threaded interrupts?
Since the CIO interrupt handler already holds the CCW device lock, when
threaded interrupts are enabled, the hardware interrupt handler runs in
process context and in_hardirq() evaluates to false.
Would this cause ctcmpc_chx_rx() to mistakenly attempt to re-acquire the lock
it already holds, leading to an immediate self-deadlock?
[ ... ]
> diff --git a/drivers/s390/net/ctcm_mpc.c b/drivers/s390/net/ctcm_mpc.c
> index aeb102537e7f5..08e36685e5788 100644
> --- a/drivers/s390/net/ctcm_mpc.c
> +++ b/drivers/s390/net/ctcm_mpc.c
[ ... ]
> @@ -1774,9 +1775,6 @@ static void mpc_action_side_xid(fsm_instance *fsm, void *arg, int side)
> CTCM_D3_DUMP((char *)ch->xid_id, 4);
>
> if (!in_hardirq()) {
> - /* Such conditional locking is a known problem for
> - * sparse because its static undeterministic.
> - * Warnings should be ignored here. */
> spin_lock_irqsave(get_ccwdev_lock(ch->cdev), saveflags);
> gotlock = 1;
> }
[Severity: High]
This is a pre-existing issue, but does checking !in_hardirq() for conditional
locking lead to the same self-deadlock here in mpc_action_side_xid()?
If this FSM action is executed from the interrupt handler while threaded
interrupts are active, !in_hardirq() will evaluate to true, causing an attempt
to acquire the already-held get_ccwdev_lock().
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260805145032.1409325-1-hca@linux.ibm.com?part=1
next prev parent reply other threads:[~2026-08-06 14:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-05 14:50 [PATCH net-next 0/2] drivers/s390/net: Enable CONTEXT_ANALYSIS Heiko Carstens
2026-08-05 14:50 ` [PATCH net-next 1/2] s390/ctcm: Add __context_unsafe() attribute to various functions Heiko Carstens
2026-08-06 14:51 ` sashiko-bot [this message]
2026-08-05 14:50 ` [PATCH net-next 2/2] drivers/s390/net: Enable CONTEXT_ANALYSIS Heiko Carstens
2026-08-06 14:51 ` sashiko-bot
2026-08-05 15:50 ` [PATCH net-next 0/2] " Alexandra Winter
2026-08-07 12:57 ` Simon Horman
2026-08-11 0:20 ` patchwork-bot+netdevbpf
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=20260806145103.0820E1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=agordeev@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=linux-s390@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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.