From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796153720; b=dqZXfQbDmiBqwQ+k5X78zKz1upI7AilHwqonFpBoPJTgRQ6SRHa3nLF1FTCZFizFUiI2 gFzahO6Ihvv/QRhYOLZRY2W6cEOUPruwRDkHuRU7eGPhXF7u9Iqm5nAMdWb4+/o+Yekm1 /UeMLAcrux+RwxmMJlYi9rzymrTmpRUIRy+8EeZVtuz08OmB7Uza0l6UHpU+JwIs5CHUF jvRB+UTUk8ioFcOS0Ql+D/QhaQoQH06XXYjIZ1R9wCx7eOiPbFwfphtU+/7UYGniJi3M3 US5iROiPONjRNarVLeSm9uROlOIZHDE2Zx7I8OSwPFFqAvu+3nAAImilGtLQKT1zKsA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796153720; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=kcIQfm+jljTblHBfDRRAQg9NRkcPyA19TR4pYrkUnvQ=; b=gYl4ku3ari26mfOf8uOm3h99TkcbOuAzANW1TKEu1NjPI0wvY3bLZ9kydNOPF8d9a+VM fTOQqmpwHnUhKI40dL9dQLCt9dBErsi8hahs8ooWPfvOybRKwpfOihNHb5ZNiMb0Igm47 GYhbYZ1mqIOjGvFoqte1jjTaqbc86ScFn8a9Kyjsw4noGCB/pVkL4usO6xUOhr5odqTti fHUdRiA+orKPp8wqJAMT+TUrzsrUKhAwA+PFwz9EK/5+glk2fdxxUQxfrYZA18jkOdnof maPEd/SPUF2HwBU2YKlSpV3+LwQx0vTr44LrZyrSojHYWT5BC2Tq0juGFbIMDpS19fA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=R5yjEbzu; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6F5C8606A31A for ; Tue, 1 Dec 2026 19:35:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=R5yjEbzu Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04D581F00897; Tue, 1 Dec 2026 19:35:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796153720; bh=kcIQfm+jljTblHBfDRRAQg9NRkcPyA19TR4pYrkUnvQ=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=R5yjEbzuw9PcxYv12meOLoR44S2Si/idAu4NCqPRqLeZT8HlYpkOuPMjfraTHE7y+ XKpBIvma3rNlJnizhvPVq/sTYrTnYIGl55bDcg0nQBkebNp8Q3k2wWNtDLA6Uu7H0d L4anmF+VaS/c/uITW179AwWIxb8pb6EKh7paEHahMt2P7C5ZfYrAIxx5l3WBOhaceo j1i59BxBA9O1cWj+SfHyDtRFhboUV+xNS10qIXoroopE0WHdZNcOY3zz1hcX7xQE3d S8NFm6EY/esHy2EBL1MwlgREdgq9yQNBjUR6SjEBpXRL/1AuOBJkiuJ6o3dnVb701D d2Cw4P9BOxkYA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] tty: serial: ip22zilog: Free the interrupt on unbind Reply-To: sashiko-reviews@lists.linux.dev To: "Arina Kharlamova" Cc: linux-serial@vger.kernel.org In-Reply-To: <20261201-s2p-d26-v1-1-a39b4ded58a6@mbzuai.ac.ae> References: <20261201-s2p-d26-v1-1-a39b4ded58a6@mbzuai.ac.ae> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 01 Dec 2026 19:35:19 +0000 X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] tty: serial: ip22zilog: race between IRQ and port teardown/re-init in ip22zilog_probe() -- commit d9c7f1ddd8187e669adae449f28b7838ada8e286 Author: Arina Kharlamova tty: serial: ip22zilog: Free the interrupt on unbind This commit switches ip22zilog_probe() from request_irq() to devm_request_irq() so the interrupt handler is freed when the driver is unbound. > diff --git a/drivers/tty/serial/ip22zilog.c b/drivers/tty/serial/ip22zilo= g.c > index 3fb8fdf8a853a..e887e01fb4d46 100644 > --- a/drivers/tty/serial/ip22zilog.c > +++ b/drivers/tty/serial/ip22zilog.c > @@ -1091,8 +1091,8 @@ static int ip22zilog_probe(struct platform_device *= pdev) > up->port.dev =3D &pdev->dev; > up->port.irq =3D irq; > =20 > - if (request_irq(irq, ip22zilog_interrupt, 0, > - "IP22-Zilog", NULL)) { > + if (devm_request_irq(&pdev->dev, irq, ip22zilog_interrupt, 0, > + "IP22-Zilog", NULL)) { > panic("IP22-Zilog: Unable to register zs interrupt handler.\n"); > } [Severity: Medium] Can using devm_request_irq() here leave ip22zilog_interrupt() active while the ports are being removed on unbind or re-initialized on a later bind? On unbind, __device_release_driver() runs ip22zilog_remove() before devres releases the IRQ. For a console port, ip22zilog_shutdown() leaves Z8530 interrupts enabled, and uart_remove_one_port() detaches the port without clearing up->port.state in the static ip22zilog_port_table[]. If the driver is then bound again, devm_request_irq() installs ip22zilog_interrupt() before uart_add_one_port() runs: CPU0 CPU1 () ip22zilog_probe() devm_request_irq() ip22zilog_interrupt() uart_port_lock(&up->port) uart_add_one_port() ... uart_port_spin_lock_init() <-- re-inits held lock An interrupt during unbind or re-probe can also see the stale up->port.state pointer in ip22zilog_receive_chars() or ip22zilog_transmit_chars() and push flip-buffer work or wakeups on a removed port, or corrupt up->port.lock. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261201-s2p-d26-v1= -1-a39b4ded58a6@mbzuai.ac.ae?part=3D1