Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753144AbbKWHGI (ORCPT ); Mon, 23 Nov 2015 02:06:08 -0500 Received: from mail-sn1nam02on0046.outbound.protection.outlook.com ([104.47.36.46]:60192 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752076AbbKWHGG (ORCPT ); Mon, 23 Nov 2015 02:06:06 -0500 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; hurleysoftware.com; dkim=none (message not signed) header.d=none;hurleysoftware.com; dmarc=bestguesspass action=none header.from=xilinx.com; Subject: Re: [PATH RESEND v2 03/10] tty: xuartps: Always enable transmitter in start_tx To: Peter Hurley , =?UTF-8?Q?S=c3=b6ren_Brinkmann?= 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> CC: Greg Kroah-Hartman , Jiri Slaby , , Michal Simek , , From: Michal Simek Message-ID: <5652BAD2.4090000@xilinx.com> Date: Mon, 23 Nov 2015 08:05:54 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <564F5574.4070407@hurleysoftware.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.0.0.1202-21956.005 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)(479174004)(199003)(24454002)(377454003)(377424004)(189002)(164054003)(19580395003)(4001150100001)(93886004)(5001960100002)(81156007)(64126003)(11100500001)(65816999)(83506001)(80316001)(50986999)(106466001)(86362001)(23676002)(5001770100001)(76176999)(189998001)(59896002)(50466002)(36386004)(33656002)(63266004)(2950100001)(87266999)(92566002)(586003)(47776003)(15975445007)(77096005)(54356999)(87936001)(6806005)(5008740100001)(5007970100001)(4001450100002)(65806001)(36756003)(4001350100001)(65956001)(5001920100001)(107986001)(217873001);DIR:OUT;SFP:1101;SCL:1;SRVR:SN1NAM02HT185;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:SN1NAM02HT185; X-Microsoft-Antispam-PRVS: <0f78d3ff16d24096b8219ae1bc2e4a91@SN1NAM02HT185.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)(520078)(8121501046)(5005006)(3002001)(10201501046);SRVR:SN1NAM02HT185;BCL:0;PCL:0;RULEID:;SRVR:SN1NAM02HT185; X-Forefront-PRVS: 07697999E6 X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Nov 2015 07:06:02.8946 (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: SN1NAM02HT185 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2638 Lines: 74 Hi Peter, On 20.11.2015 18:16, 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? > > --- >% --- > --- /dev/null 2015-11-20 07:19:13.265468435 -0500 > +++ xchar.c 2015-11-20 11:55:26.210233102 -0500 > @@ -0,0 +1,354 @@ > +/* > + * x_char unit test for tty drivers All these tests looks very interesting. Do you have any any work-in-progress repo with other tests? It will be good to run all of them to validate our drivers. Thanks, Michal -- 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/