From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2A02611C83 for ; Mon, 28 Aug 2023 10:16:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A011EC433C7; Mon, 28 Aug 2023 10:16:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1693217768; bh=EwrkWVXLHlbsKyyqoPMNsvGCRnMSnUZfSjXi7514S2Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HF52IhAQ2NM8T4D5TpAuD0waatbQvTteoi/q+yrcyfNhRF2LM8aW0KxcMkcrXXSrH pHWVoq0noQtjXgZjjr0cLynJOepIVM4lDc9vUaQUUHY0ws2/wiME2ShFrEJ4L6wtnT 5iZ2J9oJHuP8XyTNgpg8QE88perjwBRQiB3+gZgc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Tony Lindgren Subject: [PATCH 4.14 32/57] serial: 8250: Fix oops for port->pm on uart_change_pm() Date: Mon, 28 Aug 2023 12:12:52 +0200 Message-ID: <20230828101145.438210237@linuxfoundation.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230828101144.231099710@linuxfoundation.org> References: <20230828101144.231099710@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tony Lindgren commit dfe2aeb226fd5e19b0ee795f4f6ed8bc494c1534 upstream. Unloading a hardware specific 8250 driver can produce error "Unable to handle kernel paging request at virtual address" about ten seconds after unloading the driver. This happens on uart_hangup() calling uart_change_pm(). Turns out commit 04e82793f068 ("serial: 8250: Reinit port->pm on port specific driver unbind") was only a partial fix. If the hardware specific driver has initialized port->pm function, we need to clear port->pm too. Just reinitializing port->ops does not do this. Otherwise serial8250_pm() will call port->pm() instead of serial8250_do_pm(). Fixes: 04e82793f068 ("serial: 8250: Reinit port->pm on port specific driver unbind") Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20230804131553.52927-1-tony@atomide.com Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/8250/8250_port.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -3191,6 +3191,7 @@ void serial8250_init_port(struct uart_82 struct uart_port *port = &up->port; spin_lock_init(&port->lock); + port->pm = NULL; port->ops = &serial8250_pops; up->cur_iotype = 0xFF;