Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1163122AbbKTQ4w (ORCPT ); Fri, 20 Nov 2015 11:56:52 -0500 Received: from mail-bl2nam02on0072.outbound.protection.outlook.com ([104.47.38.72]:23424 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1759507AbbKTQ4t (ORCPT ); Fri, 20 Nov 2015 11:56:49 -0500 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Date: Fri, 20 Nov 2015 08:58:04 -0800 From: =?utf-8?B?U8O2cmVu?= Brinkmann To: Peter Hurley CC: Greg Kroah-Hartman , Jiri Slaby , , Michal Simek , , Subject: Re: [PATH RESEND v2 03/10] tty: xuartps: Always enable transmitter in start_tx Message-ID: <20151120165804.GV32017@xsjsorenbubuntu> References: <1447963344-16266-1-git-send-email-soren.brinkmann@xilinx.com> <1447963344-16266-4-git-send-email-soren.brinkmann@xilinx.com> <564F0E75.5020100@hurleysoftware.com> <20151120152849.GU32017@xsjsorenbubuntu> <564F4A95.3010303@hurleysoftware.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <564F4A95.3010303@hurleysoftware.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.0.0.1202-21952.006 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:149.199.60.83;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(2980300002)(438002)(199003)(377454003)(479174004)(164054003)(189002)(24454002)(377424004)(586003)(86362001)(57986006)(83506001)(110136002)(189998001)(87936001)(33716001)(19580395003)(4001350100001)(54356999)(50466002)(92566002)(85182001)(5001960100002)(81156007)(4001150100001)(47776003)(2950100001)(5001920100001)(6806005)(76176999)(5008740100001)(50986999)(76506005)(15975445007)(106466001)(36386004)(85202003)(33656002)(77096005)(93886004)(11100500001)(23676002)(5007970100001)(63266004)(107986001)(217873001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1NAM02HT009;H:xsj-pvapsmtpgw01;FPR:;SPF:Pass;PTR:unknown-60-83.xilinx.com;A:1;MX:1;LANG:en; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(8251501001);SRVR:CY1NAM02HT009; X-Microsoft-Antispam-PRVS: <4512c45bcba04e7d8ccd7a7ed69101a7@CY1NAM02HT009.eop-nam02.prod.protection.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(520078)(8121501046)(3002001)(10201501046);SRVR:CY1NAM02HT009;BCL:0;PCL:0;RULEID:;SRVR:CY1NAM02HT009; X-Forefront-PRVS: 07665BE9D1 X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Nov 2015 16:56:47.1298 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.83];Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1NAM02HT009 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1982 Lines: 57 Hi Peter, On Fri, 2015-11-20 at 11:30AM -0500, Peter Hurley wrote: > Hi Sören, > > On 11/20/2015 10:28 AM, Sören Brinkmann wrote: > > On Fri, 2015-11-20 at 07:13AM -0500, Peter Hurley wrote: > >> On 11/19/2015 03:02 PM, Soren Brinkmann wrote: > >>> start_tx must start transmitting characters. Regardless of the state of > >>> the circular buffer, always enable the transmitter hardware. > >> > >> Why? > >> > >> Does cdns_uart_stop_tx() actually stop the transmitter so that > >> data remains in the transmitter? > > > > Well, I saw my system freezing and the cause seemed to be that the UART > > receiver and/or transmitters were disabled while the system was trying > > to print. Hence, I started questioning all locations touching the > > transmitter/receiver enable. I read the docs in > > https://www.kernel.org/doc/Documentation/serial/driver, which simply > > says "Start transmitting characters." for start_tx(). Hence, I thought, > > this function is probably supposed to just do that and start the > > transmitter. I'll test whether this patch can be dropped. > > I don't think that patch would fix any freeze problems, but restarting > the transmitter even if the circ buffer is empty may be necessary to > push out remaining data when the port is restarted after being stopped. > > IOW, something like > > if (uart_tx_stopped(port)) > return; > > .... > > > if (uart_circ_empty(&port->state->xmit) > return; Thanks! I'll change the patch accordingly. > > > Below is a (work-in-progress) serial driver validation test for flow > control handling (it may need some tuning for slow line speeds). > Usual caveats apply. Takes ~40secs @ 115200. I'll try to get that running on my system. Thanks, Sören -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/