From patchwork Thu Aug 23 10:33:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 1366261 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 8B774DF2AB for ; Thu, 23 Aug 2012 10:50:46 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T4Uvj-0006Yg-87; Thu, 23 Aug 2012 10:46:28 +0000 Received: from na3sys009aog107.obsmtp.com ([74.125.149.197]) by merlin.infradead.org with smtps (Exim 4.76 #1 (Red Hat Linux)) id 1T4UnZ-00013D-Ev for linux-arm-kernel@lists.infradead.org; Thu, 23 Aug 2012 10:38:03 +0000 Received: from mail-lpp01m010-f54.google.com ([209.85.215.54]) (using TLSv1) by na3sys009aob107.postini.com ([74.125.148.12]) with SMTP ID DSNKUDYIB4NjedeCZKjlq4AoLzokGVLaRzt1@postini.com; Thu, 23 Aug 2012 03:38:01 PDT Received: by lage12 with SMTP id e12so295408lag.41 for ; Thu, 23 Aug 2012 03:37:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=QJ97Grv8o551acOgI7+Wdynubllz4NpUvwWpo0V+IgQ=; b=NoIlAxQOrm04awMoN+i7pqfsC1YUs72VIBOWn8yt6ZSxDLHBZkAU3ce2bqlgXHd36k L4DBTvBAqbLSkEXfHaWW7Qc8kaRzrnoOdUFEEmHHTN7GLZELmgbqfaRRVUFFQaU4E0Lo Il4mqqk0teZN68U0/oov7Gp80peosi+5vaNCGe6oWWkwK9uJ9sCZ312vHBlSfwtfWHQi 7++iK3aIEPqgZ+BiSZw3sRKX0Fz/cwYBXGWj+7U9tHKC2Z2usRdAtutg8DI/CHUP9ikQ efQknPogaPTJuqeK1uNGVauzKdEi0RTW4I5NzUYmF/VFbKe5acBQtv3dZQxWK+DF7iXs PXYQ== Received: by 10.112.98.231 with SMTP id el7mr690580lbb.14.1345718277964; Thu, 23 Aug 2012 03:37:57 -0700 (PDT) Received: from localhost (cs78217178.pp.htv.fi. [62.78.217.178]) by mx.google.com with ESMTPS id lr17sm7077512lab.12.2012.08.23.03.37.56 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 23 Aug 2012 03:37:57 -0700 (PDT) From: Felipe Balbi To: alan@linux.intel.com Subject: [PATCH v3 20/23] serial: omap: fix software flow control Date: Thu, 23 Aug 2012 13:33:00 +0300 Message-Id: <1345717983-18179-21-git-send-email-balbi@ti.com> X-Mailer: git-send-email 1.7.12.rc3 In-Reply-To: <1345717983-18179-1-git-send-email-balbi@ti.com> References: <1345717983-18179-1-git-send-email-balbi@ti.com> X-Gm-Message-State: ALoCoQljjo8x4D3HLGIkQN8Ss/OI47m9fr60ah7yQvcCnT1nrggWOGhVycXKMm6V9zp0Ckh4O5Dx X-Spam-Note: CRM114 invocation failed X-Spam-Score: -4.2 (----) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-4.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [74.125.149.197 listed in list.dnswl.org] 0.0 KHOP_BIG_TO_CC Sent to 10+ recipients instaed of Bcc or a list -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Kevin Hilman , Vikram Pandita , Tony Lindgren , Linux Kernel Mailing List , stable@vger.kernel.org, Santosh Shilimkar , Felipe Balbi , linux-serial@vger.kernel.org, Sourav Poddar , Linux OMAP Mailing List , Shubhrajyoti Datta , Linux ARM Kernel Mailing List X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Vikram Pandita Software flow control register bits were not defined correctly. Also clarify the IXON and IXOFF logic to reflect what userspace wants. Cc: stable@vger.kernel.org Tested-by: Shubhrajyoti D Signed-off-by: Vikram Pandita Signed-off-by: Shubhrajyoti D Signed-off-by: Felipe Balbi Acked-by: Tony Lindgren --- arch/arm/plat-omap/include/plat/omap-serial.h | 4 ++-- drivers/tty/serial/omap-serial.c | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/arm/plat-omap/include/plat/omap-serial.h b/arch/arm/plat-omap/include/plat/omap-serial.h index 743ac80..12e6805 100644 --- a/arch/arm/plat-omap/include/plat/omap-serial.h +++ b/arch/arm/plat-omap/include/plat/omap-serial.h @@ -42,10 +42,10 @@ #define OMAP_UART_WER_MOD_WKUP 0X7F /* Enable XON/XOFF flow control on output */ -#define OMAP_UART_SW_TX 0x04 +#define OMAP_UART_SW_TX 0x8 /* Enable XON/XOFF flow control on input */ -#define OMAP_UART_SW_RX 0x04 +#define OMAP_UART_SW_RX 0x2 #define OMAP_UART_SYSC_RESET 0X07 #define OMAP_UART_TCR_TRIG 0X0F diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c index c3579c0..d49981d 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c @@ -606,19 +606,19 @@ serial_omap_configure_xonxoff /* * IXON Flag: - * Enable XON/XOFF flow control on output. - * Transmit XON1, XOFF1 + * Flow control for OMAP.TX + * OMAP.RX should listen for XON/XOFF */ if (termios->c_iflag & IXON) - up->efr |= OMAP_UART_SW_TX; + up->efr |= OMAP_UART_SW_RX; /* * IXOFF Flag: - * Enable XON/XOFF flow control on input. - * Receiver compares XON1, XOFF1. + * Flow control for OMAP.RX + * OMAP.TX should send XON/XOFF */ if (termios->c_iflag & IXOFF) - up->efr |= OMAP_UART_SW_RX; + up->efr |= OMAP_UART_SW_TX; serial_out(up, UART_EFR, up->efr | UART_EFR_ECB); serial_out(up, UART_LCR, UART_LCR_CONF_MODE_A);