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 7D4C7145A16; Fri, 6 Dec 2024 15:18:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733498327; cv=none; b=so0k/rKgd0mtz369oF0iMeEybW91OlcXlKg8Zu0G52MLLtPqbQ8VR5ePh1NXh/myirbZYwcIJnxyBQ2VioclwloiTY19IF/UQr2HsSlxsx8+DyVz7TT/EgJz3LkE8XJMzD6RA+N6rGBEDaEgNDLiewlztlkzKwVajeOe46hQgIg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733498327; c=relaxed/simple; bh=gSgYqWSN7fcKTfCbvb+F3gduf92tSUo/lRlQ99WifeA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cVBU0xkSaWtS/fFBNk5aW8NcdZT9H9ww7+dqi7FtZ/+q7A7H6ze7pZIznG3u+1VNMJFOuSCu4MJW2XZ2EhITND/HQNQhxNXJgD9LXF5jq/G27LDoIESQ7nQOwl+wrpwD9c2y7sASnyZurQhnkScST0g/d7Tb4XtC/pADdUCCFAc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=YefdACpQ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="YefdACpQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E08F9C4CED1; Fri, 6 Dec 2024 15:18:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1733498327; bh=gSgYqWSN7fcKTfCbvb+F3gduf92tSUo/lRlQ99WifeA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YefdACpQ6OSAp1kwnYskDJMfPDJb/ioTNj172xY9t0OWmot786pzGWIsqP+DqcGO0 Z4t4tmHm458cjSrVgqul1VF8PUSgr7GeRSfD0aQiu5xj/GNsfREBapHp+heSNN2ux+ PvBLHGdp17g2V4G2RWDHXMJBQBWbGIpoSvHOTOaI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Bin Liu , Judith Mendez , Kevin Hilman Subject: [PATCH 6.6 520/676] serial: 8250: omap: Move pm_runtime_get_sync Date: Fri, 6 Dec 2024 15:35:39 +0100 Message-ID: <20241206143713.672069397@linuxfoundation.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241206143653.344873888@linuxfoundation.org> References: <20241206143653.344873888@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Bin Liu commit bcc7ba668818dcadd2f1db66b39ed860a63ecf97 upstream. Currently in omap_8250_shutdown, the dma->rx_running flag is set to zero in omap_8250_rx_dma_flush. Next pm_runtime_get_sync is called, which is a runtime resume call stack which can re-set the flag. When the call omap_8250_shutdown returns, the flag is expected to be UN-SET, but this is not the case. This is causing issues the next time UART is re-opened and omap_8250_rx_dma is called. Fix by moving pm_runtime_get_sync before the omap_8250_rx_dma_flush. cc: stable@vger.kernel.org Fixes: 0e31c8d173ab ("tty: serial: 8250_omap: add custom DMA-RX callback") Signed-off-by: Bin Liu [Judith: Add commit message] Signed-off-by: Judith Mendez Reviewed-by: Kevin Hilman Tested-by: Kevin Hilman Link: https://lore.kernel.org/r/20241031172315.453750-1-jm@ti.com Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/8250/8250_omap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/tty/serial/8250/8250_omap.c +++ b/drivers/tty/serial/8250/8250_omap.c @@ -766,12 +766,12 @@ static void omap_8250_shutdown(struct ua struct uart_8250_port *up = up_to_u8250p(port); struct omap8250_priv *priv = port->private_data; + pm_runtime_get_sync(port->dev); + flush_work(&priv->qos_work); if (up->dma) omap_8250_rx_dma_flush(up); - pm_runtime_get_sync(port->dev); - serial_out(up, UART_OMAP_WER, 0); if (priv->habit & UART_HAS_EFR2) serial_out(up, UART_OMAP_EFR2, 0x0);