Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1212141pxx; Tue, 27 Oct 2020 10:49:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwDZyCbp5KfQl3K0ZnKQpsE4RAYouZhS3s5te2IRSGOWkOrjXFT5ZQVLXFeARqedKbUeSA X-Received: by 2002:a05:6402:1ad9:: with SMTP id ba25mr3544394edb.120.1603820963655; Tue, 27 Oct 2020 10:49:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603820963; cv=none; d=google.com; s=arc-20160816; b=G3akVKhnlYwYvIVvY/nppCiccSMWOsxsyhZrnORvSXs5WBPmXRA/oAhSEuTcnfYyHr SklM5XzGw9Z6KdRH5l3KjxUnOI8E/LWNNyTQ34ud6DihPlwzO3OXojn36jo4Zi0O4gDB WFFVX9qsIgCKe+c1ykHL2aZR+SEoEmYAJjRlZpiV+NA827Wj+YVlRHkLhe3eVJ4hJIi6 LcCXlrRZrgPpRhranFQb7SxnMB8rAwjcUkAmUXHraKkmlWFTx2ViFDO7vRkVbDqI3vFJ 9crGz+sWAnd/RGGgxiOzaf4CvltMMgiWk/0+wjCePQwy9uOqKDrR/fzS5TEH1pbnewtb Ou7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=cZKIan3imImb061waBNyYO4wSh17cYIjX/3t0d6hi98=; b=Fwi49Y2neA/hkKhxT431VszylaRXamkFN8KWBfhIQIDB8nBgTAHDoZiZ3/MCcdM3QU zibT6/NHQp/B33gkl1fJI6GbcAbtfyy4hnUtu0hipw5OA8bYyexEbgNxeU8XL2vAmOkf NFkOjiuT0QB6C1c0i8rXN80i0c8xcVY0B2BvEj8M4qF7qeQISCyzIXthIBgr16/zfjxu a/h2El8E0g+LLdI3ewtTvR/mJhSJBtGPEDVNqXrBHL3MOnVf5v5AvamJQBg7tukwu3wI U2R+ennm6BXMRB2nhqoXXc1RKJlexZ/iZkvrF/LusGVI7xGthEzG6OV7OqCO4stUZHtW 4ZYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gCJrqbHj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y20si1369147ejw.238.2020.10.27.10.49.01; Tue, 27 Oct 2020 10:49:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gCJrqbHj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1781672AbgJ0O4D (ORCPT + 99 others); Tue, 27 Oct 2020 10:56:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:47000 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2899939AbgJ0OrE (ORCPT ); Tue, 27 Oct 2020 10:47:04 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 312C021D7B; Tue, 27 Oct 2020 14:47:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603810023; bh=QV3296mgt0LLvx8DAf1c+AMOqxEa23UclFI7vfMZM4U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gCJrqbHjIhmALUl3ovB78/ERepx6hVkHYSl+qYeqKH0Caf+kjm2o9sxxd7ZONiHB/ 7gRxMChI2YB7wVC3YUY/uk7wdhyYSrFYLVRY4f0aSjg+Xk96tRzPMRendSoHc2bNFN G/KM7w4l3hu2zRAL/+hlBubD0u3uxU7oCqeXTYCg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peng Fan Subject: [PATCH 5.4 402/408] tty: serial: lpuart: fix lpuart32_write usage Date: Tue, 27 Oct 2020 14:55:40 +0100 Message-Id: <20201027135513.653122533@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135455.027547757@linuxfoundation.org> References: <20201027135455.027547757@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peng Fan commit 9ea40db477c024dcb87321b7f32bd6ea12130ac2 upstream. The 2nd and 3rd parameter were wrongly used, and cause kernel abort when doing kgdb debug. Fixes: 1da17d7cf8e2 ("tty: serial: fsl_lpuart: Use appropriate lpuart32_* I/O funcs") Cc: stable Signed-off-by: Peng Fan Link: https://lore.kernel.org/r/20200929091920.22612-1-peng.fan@nxp.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/fsl_lpuart.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -635,26 +635,24 @@ static int lpuart32_poll_init(struct uar spin_lock_irqsave(&sport->port.lock, flags); /* Disable Rx & Tx */ - lpuart32_write(&sport->port, UARTCTRL, 0); + lpuart32_write(&sport->port, 0, UARTCTRL); temp = lpuart32_read(&sport->port, UARTFIFO); /* Enable Rx and Tx FIFO */ - lpuart32_write(&sport->port, UARTFIFO, - temp | UARTFIFO_RXFE | UARTFIFO_TXFE); + lpuart32_write(&sport->port, temp | UARTFIFO_RXFE | UARTFIFO_TXFE, UARTFIFO); /* flush Tx and Rx FIFO */ - lpuart32_write(&sport->port, UARTFIFO, - UARTFIFO_TXFLUSH | UARTFIFO_RXFLUSH); + lpuart32_write(&sport->port, UARTFIFO_TXFLUSH | UARTFIFO_RXFLUSH, UARTFIFO); /* explicitly clear RDRF */ if (lpuart32_read(&sport->port, UARTSTAT) & UARTSTAT_RDRF) { lpuart32_read(&sport->port, UARTDATA); - lpuart32_write(&sport->port, UARTFIFO, UARTFIFO_RXUF); + lpuart32_write(&sport->port, UARTFIFO_RXUF, UARTFIFO); } /* Enable Rx and Tx */ - lpuart32_write(&sport->port, UARTCTRL, UARTCTRL_RE | UARTCTRL_TE); + lpuart32_write(&sport->port, UARTCTRL_RE | UARTCTRL_TE, UARTCTRL); spin_unlock_irqrestore(&sport->port.lock, flags); return 0; @@ -663,7 +661,7 @@ static int lpuart32_poll_init(struct uar static void lpuart32_poll_put_char(struct uart_port *port, unsigned char c) { lpuart32_wait_bit_set(port, UARTSTAT, UARTSTAT_TDRE); - lpuart32_write(port, UARTDATA, c); + lpuart32_write(port, c, UARTDATA); } static int lpuart32_poll_get_char(struct uart_port *port)