Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4206503imu; Mon, 7 Jan 2019 18:05:43 -0800 (PST) X-Google-Smtp-Source: ALg8bN4OTLb9+49B1IFVCsdQPnC5gwq7zmfHpxtQr1i8NIJI1pjfbXGouDzZG201nIECPc1QN0ac X-Received: by 2002:a17:902:3143:: with SMTP id w61mr28973002plb.253.1546913143672; Mon, 07 Jan 2019 18:05:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546913143; cv=none; d=google.com; s=arc-20160816; b=crBluUYH6c587oKGmTCshEsTYD64kYjoT8ijgKMsLeDHdFpfISJxPnkaidLiuX5XBE GGuNDIzt+wBXqCM/oG1Rd0VPDCHb00HuQUF31CnjLoy2V8ksoGnCGKHSWuD3izvlNDqA ikEWfoPE93UDS29Hn5L0/qy/61IQV1fhIBZQmaVbw6iCAJjFRaWc49jfXEZtx30sgeME wj+bf9e7nsodyr8GVmbm1XwzEIaXHTWmRiesl+/Q09scVzK2oMO1ZrQEjY6HF9VKpTHD x2hrrBPlyY8sg3FxrQ6U4f9Gp8CoSLy++CW1EKJz95dfesqC4zbs5liPJarEWdz5uMem RXGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=0xFJ9W1/VfwL86QLPSSZmss0MI0vEVm5Y/K7IaVawNs=; b=LTOiHhTQ9R9+r5Sqp8mMwzl93DjehNNRtJG/OQXocnhNN2S6zmZN9zJwN9sVvDmnG7 7jYJsG3aZ1tiFeVRk4cSxBpzUJIv/7d/Zk+oRiFVWvqP/ePAGx0xM1qoqgmpWBhFEBHk SABxHc5do9nwkA4PGIo2NWMlNQ1GefqqO9e2EzegETGJrM5ckmHXa8OXR4kVCNQ9zlkw WwOnKPj4L3POrZEbJAmLc1guz+1CG/gs4FzbNHTZs2thX3NFexpco0rVzdqLPwIehxpt 3Hl8HLh7NbsP9OD9BTneKW+NDM/EDPTNlK3eb7bC4oSJewEk3bchhKkNsITmuvVNrlla cRjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=QbAX+gro; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w5si7439746pll.64.2019.01.07.18.05.28; Mon, 07 Jan 2019 18:05:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=QbAX+gro; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727410AbfAHB7Y (ORCPT + 99 others); Mon, 7 Jan 2019 20:59:24 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:44159 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727340AbfAHB7W (ORCPT ); Mon, 7 Jan 2019 20:59:22 -0500 Received: by mail-pl1-f193.google.com with SMTP id e11so1047185plt.11 for ; Mon, 07 Jan 2019 17:59:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0xFJ9W1/VfwL86QLPSSZmss0MI0vEVm5Y/K7IaVawNs=; b=QbAX+gro2dWmORQC277ALWVayIfzKwUwTjY+OraSy0BZ4OHTbBDUQk3eq9qYuebp// PSn7Z0snjzY78n7v9bQuD8+1CXCfaTW2hBh1cdaMLyzrCd8rr5/3dH7f3puFXqqAeTYb qrVccC8hLscdgRuCtdPXaugLnYWcgF88FFQRc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0xFJ9W1/VfwL86QLPSSZmss0MI0vEVm5Y/K7IaVawNs=; b=TTwYhjnQNJOSOXpQ4QVVJxy45s/EtGVh9iGK7wer8yyTaNSNDQLAbJxsWqs8hK+6Zp S2toqcOYQ5uIAYXrjykDokrJkbWIVs6PUug49i+RVwjgJDbRa35Tc/benWPvB118UcQ0 nliCB7wZsKpsBYctwiEvNbVJof4Vr1ndw2sGM8GxIsBtPUYnxGpXirfbSJGVZoO8CDjL 7wz1Xp1nqcEMOu455ToE/dJg/8FSaKARrgIcr9miRW+mYBuNPAZfZbXzUeVPk98jRgtK qbsbpDKVw43rR9lqEjQx+wKvAriR+iRcm02SID3qUJzyo9eDmCLuFwz0T1Vl8qjtnjlh IaQQ== X-Gm-Message-State: AJcUukdqVGnMP9WVY2tf8gpylL7giW3Z6x6Et0WCHhFRBJ1baQzq+oXh QHbhZmlXPo2tnK1oQBNAVdr+XA== X-Received: by 2002:a17:902:6948:: with SMTP id k8mr62756459plt.2.1546912761539; Mon, 07 Jan 2019 17:59:21 -0800 (PST) Received: from ryandcase.mtv.corp.google.com ([2620:15c:202:201:ed1c:3d1c:9d92:99cb]) by smtp.gmail.com with ESMTPSA id p2sm93942693pfb.28.2019.01.07.17.59.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Jan 2019 17:59:21 -0800 (PST) From: Ryan Case To: Greg Kroah-Hartman , Jiri Slaby Cc: Evan Green , Doug Anderson , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Stephen Boyd , Ryan Case Subject: [PATCH v2 2/4] tty: serial: qcom_geni_serial: Remove set_rfr_wm() and related variables Date: Mon, 7 Jan 2019 17:58:36 -0800 Message-Id: <20190108015838.166271-3-ryandcase@chromium.org> X-Mailer: git-send-email 2.20.1.97.g81188d93c3-goog In-Reply-To: <20190108015838.166271-1-ryandcase@chromium.org> References: <20190108015838.166271-1-ryandcase@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The variables of tx_wm and rx_wm were set to the same define value in all cases, never updated, and the define was sometimes used interchangably. Remove the variables/function and use the fixed value. Signed-off-by: Ryan Case Reviewed-by: Evan Green --- Changes in v2: - Removed CONSOLE from UART_CONSOLE_RX_WM drivers/tty/serial/qcom_geni_serial.c | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c index e2cb3f7d1a7c..22d3cb4b3b39 100644 --- a/drivers/tty/serial/qcom_geni_serial.c +++ b/drivers/tty/serial/qcom_geni_serial.c @@ -89,7 +89,7 @@ #define DEF_FIFO_DEPTH_WORDS 16 #define DEF_TX_WM 2 #define DEF_FIFO_WIDTH_BITS 32 -#define UART_CONSOLE_RX_WM 2 +#define UART_RX_WM 2 #define MAX_LOOPBACK_CFG 3 #ifdef CONFIG_CONSOLE_POLL @@ -105,9 +105,6 @@ struct qcom_geni_serial_port { u32 tx_fifo_depth; u32 tx_fifo_width; u32 rx_fifo_depth; - u32 tx_wm; - u32 rx_wm; - u32 rx_rfr; enum geni_se_xfer_mode xfer_mode; bool setup; int (*handle_rx)(struct uart_port *uport, u32 bytes, bool drop); @@ -365,9 +362,7 @@ static int qcom_geni_serial_get_char(struct uart_port *uport) static void qcom_geni_serial_poll_put_char(struct uart_port *uport, unsigned char c) { - struct qcom_geni_serial_port *port = to_dev_port(uport, uport); - - writel(port->tx_wm, uport->membase + SE_GENI_TX_WATERMARK_REG); + writel(DEF_TX_WM, uport->membase + SE_GENI_TX_WATERMARK_REG); qcom_geni_serial_setup_tx(uport, 1); WARN_ON(!qcom_geni_serial_poll_bit(uport, SE_GENI_M_IRQ_STATUS, M_TX_FIFO_WATERMARK_EN, true)); @@ -576,7 +571,7 @@ static void qcom_geni_serial_start_tx(struct uart_port *uport) irq_en = readl(uport->membase + SE_GENI_M_IRQ_EN); irq_en |= M_TX_FIFO_WATERMARK_EN | M_CMD_DONE_EN; - writel(port->tx_wm, uport->membase + + writel(DEF_TX_WM, uport->membase + SE_GENI_TX_WATERMARK_REG); writel(irq_en, uport->membase + SE_GENI_M_IRQ_EN); } @@ -848,17 +843,6 @@ static void get_tx_fifo_size(struct qcom_geni_serial_port *port) (port->tx_fifo_depth * port->tx_fifo_width) / BITS_PER_BYTE; } -static void set_rfr_wm(struct qcom_geni_serial_port *port) -{ - /* - * Set RFR (Flow off) to FIFO_DEPTH - 2. - * RX WM level at 10% RX_FIFO_DEPTH. - * TX WM level at 10% TX_FIFO_DEPTH. - */ - port->rx_rfr = port->rx_fifo_depth - 2; - port->rx_wm = UART_CONSOLE_RX_WM; - port->tx_wm = DEF_TX_WM; -} static void qcom_geni_serial_shutdown(struct uart_port *uport) { @@ -899,7 +883,6 @@ static int qcom_geni_serial_port_setup(struct uart_port *uport) get_tx_fifo_size(port); - set_rfr_wm(port); writel(rxstale, uport->membase + SE_UART_RX_STALE_CNT); /* * Make an unconditional cancel on the main sequencer to reset @@ -912,7 +895,7 @@ static int qcom_geni_serial_port_setup(struct uart_port *uport) false, true, false); geni_se_config_packing(&port->se, BITS_PER_BYTE, port->rx_bytes_pw, false, false, true); - geni_se_init(&port->se, port->rx_wm, port->rx_rfr); + geni_se_init(&port->se, UART_RX_WM, port->rx_fifo_depth - 2); geni_se_select_mode(&port->se, port->xfer_mode); if (!uart_console(uport)) { port->rx_fifo = devm_kcalloc(uport->dev, -- 2.20.1.97.g81188d93c3-goog