Stable Archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	patches@lists.linux.dev,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Nicholas Piggin <npiggin@gmail.com>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	"Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
	"Naveen N. Rao" <naveen.n.rao@linux.ibm.com>,
	Andy Shevchenko <andy.shevchenko@gmail.com>,
	stable@kernel.org, linux-m68k@lists.linux-m68k.org,
	Finn Thain <fthain@linux-m68k.org>
Subject: [PATCH 4.19 23/77] serial/pmac_zilog: Remove flawed mitigation for rx irq flood
Date: Tue, 30 Apr 2024 12:39:02 +0200	[thread overview]
Message-ID: <20240430103041.812993586@linuxfoundation.org> (raw)
In-Reply-To: <20240430103041.111219002@linuxfoundation.org>

4.19-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Finn Thain <fthain@linux-m68k.org>

commit 1be3226445362bfbf461c92a5bcdb1723f2e4907 upstream.

The mitigation was intended to stop the irq completely. That may be
better than a hard lock-up but it turns out that you get a crash anyway
if you're using pmac_zilog as a serial console:

ttyPZ0: pmz: rx irq flood !
BUG: spinlock recursion on CPU#0, swapper/0

That's because the pr_err() call in pmz_receive_chars() results in
pmz_console_write() attempting to lock a spinlock already locked in
pmz_interrupt(). With CONFIG_DEBUG_SPINLOCK=y, this produces a fatal
BUG splat. The spinlock in question is the one in struct uart_port.

Even when it's not fatal, the serial port rx function ceases to work.
Also, the iteration limit doesn't play nicely with QEMU, as can be
seen in the bug report linked below.

A web search for other reports of the error message "pmz: rx irq flood"
didn't produce anything. So I don't think this code is needed any more.
Remove it.

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Aneesh Kumar K.V <aneesh.kumar@kernel.org>
Cc: Naveen N. Rao <naveen.n.rao@linux.ibm.com>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: stable@kernel.org
Cc: linux-m68k@lists.linux-m68k.org
Link: https://github.com/vivier/qemu-m68k/issues/44
Link: https://lore.kernel.org/all/1078874617.9746.36.camel@gaston/
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable <stable@kernel.org>
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
Link: https://lore.kernel.org/r/e853cf2c762f23101cd2ddec0cc0c2be0e72685f.1712568223.git.fthain@linux-m68k.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/tty/serial/pmac_zilog.c |   14 --------------
 1 file changed, 14 deletions(-)

--- a/drivers/tty/serial/pmac_zilog.c
+++ b/drivers/tty/serial/pmac_zilog.c
@@ -220,7 +220,6 @@ static bool pmz_receive_chars(struct uar
 {
 	struct tty_port *port;
 	unsigned char ch, r1, drop, error, flag;
-	int loops = 0;
 
 	/* Sanity check, make sure the old bug is no longer happening */
 	if (uap->port.state == NULL) {
@@ -303,25 +302,12 @@ static bool pmz_receive_chars(struct uar
 		if (r1 & Rx_OVR)
 			tty_insert_flip_char(port, 0, TTY_OVERRUN);
 	next_char:
-		/* We can get stuck in an infinite loop getting char 0 when the
-		 * line is in a wrong HW state, we break that here.
-		 * When that happens, I disable the receive side of the driver.
-		 * Note that what I've been experiencing is a real irq loop where
-		 * I'm getting flooded regardless of the actual port speed.
-		 * Something strange is going on with the HW
-		 */
-		if ((++loops) > 1000)
-			goto flood;
 		ch = read_zsreg(uap, R0);
 		if (!(ch & Rx_CH_AV))
 			break;
 	}
 
 	return true;
- flood:
-	pmz_interrupt_control(uap, 0);
-	pmz_error("pmz: rx irq flood !\n");
-	return true;
 }
 
 static void pmz_status_handle(struct uart_pmac_port *uap)



  parent reply	other threads:[~2024-04-30 10:44 UTC|newest]

Thread overview: 86+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-30 10:38 [PATCH 4.19 00/77] 4.19.313-rc1 review Greg Kroah-Hartman
2024-04-30 10:38 ` [PATCH 4.19 01/77] batman-adv: Avoid infinite loop trying to resize local TT Greg Kroah-Hartman
2024-04-30 10:38 ` [PATCH 4.19 02/77] Bluetooth: Fix memory leak in hci_req_sync_complete() Greg Kroah-Hartman
2024-04-30 10:38 ` [PATCH 4.19 03/77] nouveau: fix function cast warning Greg Kroah-Hartman
2024-04-30 10:38 ` [PATCH 4.19 04/77] geneve: fix header validation in geneve[6]_xmit_skb Greg Kroah-Hartman
2024-04-30 10:38 ` [PATCH 4.19 05/77] ipv6: fib: hide unused pn variable Greg Kroah-Hartman
2024-04-30 10:38 ` [PATCH 4.19 06/77] ipv4/route: avoid unused-but-set-variable warning Greg Kroah-Hartman
2024-04-30 10:38 ` [PATCH 4.19 07/77] ipv6: fix race condition between ipv6_get_ifaddr and ipv6_del_addr Greg Kroah-Hartman
2024-04-30 10:38 ` [PATCH 4.19 08/77] net/mlx5: Properly link new fs rules into the tree Greg Kroah-Hartman
2024-04-30 10:38 ` [PATCH 4.19 09/77] tracing: hide unused ftrace_event_id_fops Greg Kroah-Hartman
2024-04-30 10:38 ` [PATCH 4.19 10/77] vhost: Add smp_rmb() in vhost_vq_avail_empty() Greg Kroah-Hartman
2024-04-30 10:38 ` [PATCH 4.19 11/77] selftests: timers: Fix abs() warning in posix_timers test Greg Kroah-Hartman
2024-04-30 10:38 ` [PATCH 4.19 12/77] x86/apic: Force native_apic_mem_read() to use the MOV instruction Greg Kroah-Hartman
2024-04-30 10:38 ` [PATCH 4.19 13/77] btrfs: record delayed inode root in transaction Greg Kroah-Hartman
2024-04-30 10:38 ` [PATCH 4.19 14/77] selftests/ftrace: Limit length in subsystem-enable tests Greg Kroah-Hartman
2024-04-30 10:38 ` [PATCH 4.19 15/77] kprobes: Fix possible use-after-free issue on kprobe registration Greg Kroah-Hartman
2024-04-30 10:38 ` [PATCH 4.19 16/77] Revert "tracing/trigger: Fix to return error if failed to alloc snapshot" Greg Kroah-Hartman
2024-04-30 10:38 ` [PATCH 4.19 17/77] netfilter: nf_tables: __nft_expr_type_get() selects specific family type Greg Kroah-Hartman
2024-04-30 10:38 ` [PATCH 4.19 18/77] netfilter: nf_tables: Fix potential data-race in __nft_expr_type_get() Greg Kroah-Hartman
2024-04-30 10:38 ` [PATCH 4.19 19/77] tun: limit printing rate when illegal packet received by tun dev Greg Kroah-Hartman
2024-04-30 10:38 ` [PATCH 4.19 20/77] RDMA/mlx5: Fix port number for counter query in multi-port configuration Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 21/77] drm: nv04: Fix out of bounds access Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 22/77] comedi: vmk80xx: fix incomplete endpoint checking Greg Kroah-Hartman
2024-04-30 10:39 ` Greg Kroah-Hartman [this message]
2024-04-30 10:39 ` [PATCH 4.19 24/77] USB: serial: option: add Fibocom FM135-GL variants Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 25/77] USB: serial: option: add support for Fibocom FM650/FG650 Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 26/77] USB: serial: option: add Lonsung U8300/U9300 product Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 27/77] USB: serial: option: support Quectel EM060K sub-models Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 28/77] USB: serial: option: add Rolling RW101-GL and RW135-GL support Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 29/77] USB: serial: option: add Telit FN920C04 rmnet compositions Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 30/77] Revert "usb: cdc-wdm: close race between read and workqueue" Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 31/77] usb: dwc2: host: Fix dereference issue in DDMA completion flow Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 32/77] speakup: Avoid crash on very long word Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 33/77] fs: sysfs: Fix reference leak in sysfs_break_active_protection() Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 34/77] nouveau: fix instmem race condition around ptr stores Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 35/77] nilfs2: fix OOB in nilfs_set_de_type Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 36/77] tracing: Remove hist trigger synth_var_refs Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 37/77] tracing: Use var_refs[] for hist trigger reference checking Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 38/77] arm64: dts: rockchip: fix alphabetical ordering RK3399 puma Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 39/77] arm64: dts: rockchip: enable internal pull-up on PCIE_WAKE# for RK3399 Puma Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 40/77] arm64: dts: mediatek: mt7622: fix IR nodename Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 41/77] arm64: dts: mediatek: mt7622: fix ethernet controller "compatible" Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 42/77] arm64: dts: mediatek: mt7622: drop "reset-names" from thermal block Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 43/77] ARC: [plat-hsdk]: Remove misplaced interrupt-cells property Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 44/77] vxlan: drop packets from invalid src-address Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 45/77] mlxsw: core: Unregister EMAD trap using FORWARD action Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 46/77] NFC: trf7970a: disable all regulators on removal Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 47/77] net: usb: ax88179_178a: stop lying about skb->truesize Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 48/77] net: gtp: Fix Use-After-Free in gtp_dellink Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 49/77] ipvs: Fix checksumming on GSO of SCTP packets Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 50/77] net: openvswitch: ovs_ct_exit to be done under ovs_lock Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 51/77] net: openvswitch: Fix Use-After-Free in ovs_ct_exit Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 52/77] i40e: Do not use WQ_MEM_RECLAIM flag for workqueue Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 53/77] serial: core: Provide port lock wrappers Greg Kroah-Hartman
2024-04-30 10:50   ` John Ogness
2024-04-30 12:10     ` John Ogness
2024-04-30 12:40       ` Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 54/77] serial: mxs-auart: add spinlock around changing cts state Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 55/77] drm/amdgpu: restrict bo mapping within gpu address limits Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 56/77] amdgpu: validate offset_in_bo of drm_amdgpu_gem_va Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 57/77] drm/amdgpu: validate the parameters of bo mapping operations more clearly Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 58/77] Revert "crypto: api - Disallow identical driver names" Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 59/77] tracing: Show size of requested perf buffer Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 60/77] tracing: Increase PERF_MAX_TRACE_SIZE to handle Sentinel1 and docker together Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 61/77] Bluetooth: Fix type of len in {l2cap,sco}_sock_getsockopt_old() Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 62/77] btrfs: fix information leak in btrfs_ioctl_logical_to_ino() Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 63/77] arm64: dts: rockchip: enable internal pull-up for Q7_THRM# on RK3399 Puma Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 64/77] irqchip/gic-v3-its: Prevent double free on error Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 65/77] net: b44: set pause params only when interface is up Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 66/77] stackdepot: respect __GFP_NOLOCKDEP allocation flag Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 67/77] mtd: diskonchip: work around ubsan link failure Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 68/77] tcp: Clean up kernel listeners reqsk in inet_twsk_purge() Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 69/77] tcp: Fix NEW_SYN_RECV handling " Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 70/77] dmaengine: owl: fix register access functions Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 71/77] idma64: Dont try to serve interrupts when device is powered off Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 72/77] i2c: smbus: fix NULL function pointer dereference Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 73/77] HID: i2c-hid: remove I2C_HID_READ_PENDING flag to prevent lock-up Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 74/77] Revert "loop: Remove sector_t truncation checks" Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 75/77] Revert "y2038: rusage: use __kernel_old_timeval" Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 76/77] udp: preserve the connected status if only UDP cmsg Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 4.19 77/77] serial: core: fix kernel-doc for uart_port_unlock_irqrestore() Greg Kroah-Hartman
2024-05-01 13:37 ` [PATCH 4.19 00/77] 4.19.313-rc1 review Jon Hunter
2024-05-01 19:44 ` Pavel Machek
2024-05-02  3:13 ` Shuah Khan
2024-05-02  7:49 ` Naresh Kamboju
2024-05-02  8:31 ` Harshit Mogalapalli

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=20240430103041.812993586@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=aneesh.kumar@kernel.org \
    --cc=benh@kernel.crashing.org \
    --cc=christophe.leroy@csgroup.eu \
    --cc=fthain@linux-m68k.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=mpe@ellerman.id.au \
    --cc=naveen.n.rao@linux.ibm.com \
    --cc=npiggin@gmail.com \
    --cc=patches@lists.linux.dev \
    --cc=stable@kernel.org \
    --cc=stable@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).