Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1163301AbbKTR2Z (ORCPT ); Fri, 20 Nov 2015 12:28:25 -0500 Received: from mail-bl2nam02on0062.outbound.protection.outlook.com ([104.47.38.62]:45024 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1760112AbbKTR2V (ORCPT ); Fri, 20 Nov 2015 12:28:21 -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 09:29:31 -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: <20151120172931.GX32017@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> <20151120165804.GV32017@xsjsorenbubuntu> <564F5574.4070407@hurleysoftware.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <564F5574.4070407@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)(979002)(6009001)(2980300002)(438002)(199003)(377454003)(479174004)(24454002)(189002)(377424004)(23676002)(19580395003)(54356999)(76176999)(81156007)(33716001)(47776003)(83506001)(189998001)(4001350100001)(86362001)(4001150100001)(33656002)(11100500001)(5001960100002)(110136002)(93886004)(5007970100001)(85182001)(87936001)(15975445007)(6806005)(77096005)(586003)(76506005)(50466002)(92566002)(2950100001)(50986999)(36386004)(106466001)(5008740100001)(85202003)(63266004)(57986006)(107986001)(217873001)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1101;SCL:1;SRVR:SN1NAM02HT002;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:SN1NAM02HT002; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(520078)(5005006)(8121501046)(3002001)(10201501046);SRVR:SN1NAM02HT002;BCL:0;PCL:0;RULEID:;SRVR:SN1NAM02HT002; X-Forefront-PRVS: 07665BE9D1 X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Nov 2015 17:28:19.2589 (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: SN1NAM02HT002 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2745 Lines: 66 On Fri, 2015-11-20 at 12:16PM -0500, Peter Hurley wrote: > On 11/20/2015 11:58 AM, Sören Brinkmann wrote: > > On Fri, 2015-11-20 at 11:30AM -0500, Peter Hurley wrote: > >> 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. > > The test below should pass too, but I know it won't because this xilinx > driver isn't handling x_char at all. > > Aside: does this h/w have rts driver/cts receiver? I would have to look up the details. But, IIRC, the HW has all the modem/flow control signals. But on our SoCs those signals are only available when routing the UART through the FPGA part, which makes it a rather unlikely configuration since most platforms want the UART as a low level debug port that should not depend on any FPGA bistreams. Hence, I suspect it might just be a limitation of the driver. 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/