Linux USB
 help / color / mirror / Atom feed
From: Oliver Neukum <oneukum@suse.com>
To: johan@kernel.org, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org
Cc: Oliver Neukum <oneukum@suse.com>
Subject: [PATCH] usb: serial: digi_accelport: fix crash on SPARC
Date: Tue,  4 Aug 2026 12:51:50 +0200	[thread overview]
Message-ID: <20260804105150.576159-1-oneukum@suse.com> (raw)

The helper function cond_wait_interruptible_timeout_irqrestore()
reenables interrupts. It does so by means of the flags saved
by spin_lock_irqsave() in the caller.
On SPARC these flags can be used only inside the same stack
frame. Details can be found in

https://www.kernel.org/pub/linux/kernel/people/rusty/kernel-locking/x467.html

If the compiler decides to not inline the helper function,
the kernel will crash on SPARC if the helper is executed. Hence the
compiler needs to be forced to always inline the function.
The bug was inadvertedly introduced by an adaption to modern
coding standards.

Fixes: c6d61269f530e ("digi_acceleport: Drag the driver kicking and screaming into coding style")
Signed-off-by: Oliver Neukum <oneukum@suse.com>
---
 drivers/usb/serial/digi_acceleport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c
index a687217eadd7..50b89316ba1c 100644
--- a/drivers/usb/serial/digi_acceleport.c
+++ b/drivers/usb/serial/digi_acceleport.c
@@ -336,7 +336,7 @@ static struct usb_serial_driver * const serial_drivers[] = {
  *  with the equivalent code.
  */
 
-static long cond_wait_interruptible_timeout_irqrestore(
+static __always_inline long cond_wait_interruptible_timeout_irqrestore(
 	wait_queue_head_t *q, long timeout,
 	spinlock_t *lock, unsigned long flags)
 __releases(lock)
-- 
2.55.0


             reply	other threads:[~2026-08-04 10:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-04 10:51 Oliver Neukum [this message]
2026-08-04 14:46 ` [PATCH] usb: serial: digi_accelport: fix crash on SPARC Johan Hovold

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=20260804105150.576159-1-oneukum@suse.com \
    --to=oneukum@suse.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=johan@kernel.org \
    --cc=linux-usb@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