From patchwork Mon Apr 9 19:38:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Karthikeyan Ramasubramanian X-Patchwork-Id: 10331945 X-Patchwork-Delegate: agross@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E2B906022E for ; Mon, 9 Apr 2018 19:39:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D440F28BF4 for ; Mon, 9 Apr 2018 19:39:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C907928BF7; Mon, 9 Apr 2018 19:39:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7705528BF4 for ; Mon, 9 Apr 2018 19:39:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754172AbeDITjB (ORCPT ); Mon, 9 Apr 2018 15:39:01 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:42698 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751742AbeDITi7 (ORCPT ); Mon, 9 Apr 2018 15:38:59 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id DA1C760FF7; Mon, 9 Apr 2018 19:38:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1523302738; bh=i9DirUvgzWRfAkq6LykZFVRMFrGUKsxUZZjHIBa+SJo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FQs44f25EwzTvN+xIiAENjzj8oXnQMu+ahKMZym0HrDaXQwVIb0ToIGr99AFSq46O 4WtkPMrpXMKHvdJwPwmWYuI3YDY8GuAth/TkFCrGn8ZVFf2R6oZEuy3FJgiCsw6mxk 0bHIzEwj0+hzLSrP4sJlFilyLqUS5mnVq69xQn4A= Received: from codeaurora.org (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: kramasub@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id E0D6360FF7; Mon, 9 Apr 2018 19:38:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1523302737; bh=i9DirUvgzWRfAkq6LykZFVRMFrGUKsxUZZjHIBa+SJo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nonDV/YGGV8JMB+n2Cc51+wNZ/M7L91x1ZhsHU6qbgYEjJaojYdO5TpUHWriatLJ8 t8fvWXobGm4iDn2hQCZxPSMWdXMEs8/NUetbhexdNrG0zd5P/izS1zwOEFFfGEzs/a PO0OcJ3qmhRgbp+EP4LtpHQdRX4BqjI5Ok7CBK4E= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org E0D6360FF7 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=kramasub@codeaurora.org From: Karthikeyan Ramasubramanian To: gregkh@linuxfoundation.org, jslaby@suse.com Cc: Karthikeyan Ramasubramanian , linux-arm-msm@vger.kernel.org, linux-serial@vger.kernel.org, evgreen@chromium.org, acourbot@chromium.org, swboyd@chromium.org, dianders@chromium.org, sdharia@codeaurora.org, girishm@codeaurora.org, festevam@gmail.com Subject: [PATCH v2 6/8] tty: serial: qcom_geni_serial: Use iowrite32_rep to write to FIFO Date: Mon, 9 Apr 2018 13:38:39 -0600 Message-Id: <1523302721-19439-7-git-send-email-kramasub@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1523302721-19439-1-git-send-email-kramasub@codeaurora.org> References: <1523302721-19439-1-git-send-email-kramasub@codeaurora.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use iowrite32_rep to write to the hardware FIFO so that the code does not have to worry about the system endianness. Signed-off-by: Karthikeyan Ramasubramanian Reviewed-by: Matthias Kaehlcke Reviewed-by: Stephen Boyd --- drivers/tty/serial/qcom_geni_serial.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c index 3274071..801e6eb 100644 --- a/drivers/tty/serial/qcom_geni_serial.c +++ b/drivers/tty/serial/qcom_geni_serial.c @@ -600,14 +600,15 @@ static void qcom_geni_serial_handle_tx(struct uart_port *uport) remaining = chunk; for (i = 0; i < chunk; ) { unsigned int tx_bytes; - unsigned int buf = 0; + u8 buf[sizeof(u32)]; int c; + memset(buf, 0, ARRAY_SIZE(buf)); tx_bytes = min_t(size_t, remaining, port->tx_bytes_pw); for (c = 0; c < tx_bytes ; c++) - buf |= (xmit->buf[tail + c] << (c * BITS_PER_BYTE)); + buf[c] = xmit->buf[tail + c]; - writel_relaxed(buf, uport->membase + SE_GENI_TX_FIFOn); + iowrite32_rep(uport->membase + SE_GENI_TX_FIFOn, buf, 1); i += tx_bytes; tail = (tail + tx_bytes) & (UART_XMIT_SIZE - 1);