Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1162000AbbKEHWx (ORCPT ); Thu, 5 Nov 2015 02:22:53 -0500 Received: from mail-bl2on0057.outbound.protection.outlook.com ([65.55.169.57]:22849 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1030938AbbKEHVh (ORCPT ); Thu, 5 Nov 2015 02:21:37 -0500 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; linuxfoundation.org; dkim=none (message not signed) header.d=none;linuxfoundation.org; dmarc=bestguesspass action=none header.from=xilinx.com; From: Soren Brinkmann To: Greg Kroah-Hartman , Jiri Slaby CC: Michal Simek , , , , "Soren Brinkmann" Subject: [PATCH v2 00/10] tty: xuartps: Fix lock ups Date: Wed, 4 Nov 2015 23:21:09 -0800 Message-ID: <1446708079-1105-1-git-send-email-soren.brinkmann@xilinx.com> X-Mailer: git-send-email 2.6.2.3.ga463a5b MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.0.0.1202-21920.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BY2FFO11FD007;1:qFw3tCvl/uV34o57zN2pSTzLJMmXhrkQ8SIFHGrpThoHLrcvIdkgELi/DcW9l0u+bDLqDnCexUvWXIVJy+GfFesp3m4ZUuK19nq1K/LMP7qPhpnJjyj0kmsTyadsvNJ08A+0X9ginauGSfEl2kSLjuUdnKONBSkX5kGsYQg4cGvV8JX+HlVqBuHInRGVIDYnhPkXjQjWbMcCMH87jE3U199E3V4sPhsDvCXLPcdAAQMJlmump59qj5zihBAdCjc2BI5macXLoUEMXm1VSDlxefyfveAlKNiZjmOEK873e2xIKtjSlK4b6KaF0tJW/DPDQED9tSBXnoOjVOgDYNs2QNZBiuKGl9STpJaikrFeBxjmCNW2hiDlC4XsSH+GhLX/ X-Forefront-Antispam-Report: CIP:149.199.60.83;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(2980300002)(438002)(189002)(199003)(50466002)(33646002)(57986006)(92566002)(87936001)(47776003)(4001430100002)(16796002)(77096005)(50986999)(76506005)(63266004)(86362001)(5007970100001)(106466001)(36386004)(189998001)(5001960100002)(5820100001)(23676002)(50226001)(6806005)(36756003)(5008740100001)(107886002)(229853001)(11100500001)(5001770100001)(81156007)(107986001);DIR:OUT;SFP:1101;SCL:1;SRVR:BY2FFO11HUB024;H:xsj-pvapsmtpgw01;FPR:;SPF:Pass;PTR:unknown-60-83.xilinx.com;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BY2FFO11HUB024;2:4a7+kxnmcOlBv/rhe1B5cJsEuzIwuMSjoIJXLPo6oHkmN8kobDEYniYnxpP+7otAcN2F9RJf0/DY2E20EpAiae2qnmX9K+9LCw4S97s/DxBjQGXe0JFYpQmVkNf5t4w2F/WaQil1ljzX+u3DBckQ8T12rk4tvQfW7Gak01B62H8=;3:/13CegX3+n0fgkC2NTgpODno2pSaXTJM4PuZ+1qP4VrO9cbRQlP3wwr2w505nBgQRatG7vzcNKzM+G5jFURwWNHOjTfRls7/4d/YbXRtNL0pKSkNZa7wbaH/ubjdHC5MrcBQK1bU7qCRiphxEnwljaRGVPnAYyamyKxtYKta1zuSz4KcZpw7X0bFg6vNLa/kcAjMaSq+1kKeElxOxTUbt6QBsM/7DMFu/3VMaL+9evnAWMgxIh7G0CQpIJem5yGpqGODXWTpzi+ug8nxo/hbbg==;25:9ZzgRbKcFBJFAMEKSBwVPYBPmBS0wo+0uL69efG3CBXj4nAyaAbJp/h6BHsF6F1XgnLfGDZyX+nlNEaEDGdzAaREXiAzGVw5EMs45WqcXwdOKT6CjcuoVpWfs64m3jIXItdiEPxcowPb9zTcPA3dXTR20p7J6NRitPnwHykmPFmqk2EjIPzhIsI2zMnLl8j4UtFeUce5bgW2sOUm1FpqAzHQ1r+Bp8jXKpWEoy6cYeI2OZTDWBW142xZqQzzsmay X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(8251501001);SRVR:BY2FFO11HUB024; X-Microsoft-Exchange-Diagnostics: 1;BY2FFO11HUB024;20:2u7kwuFNGGu0WGmlLgLQEeVL5Wr2jYIyqRs/O/7noa1xt2+uzRtz1lYDgKiPMcLKN1SnOAHn2WR3Bh+kg+EWwB5BQaQO2B7OmqY7nZa2HjnyVZTr+lxbRuoSXOIu0k0Cl/Heasn9l1tem8yNf70v+uJw99tBCeySdagXnAT1q2zYUVyy39LeYQf/IIs3l82pCNlFSgmWZRBC2EBnERtNazL+52EbTb9mFun9Eo/AHBH2cD1y+a2oyfttg/srWl+MK8w6RQZVDo140HehOokVzVH6AHcuMqlLta1nhH2CqtUV8UlhSB09Dbqaa0G3cNsyHG2ZytJk6B3x6hL0cFY/Kz9GACTf0S0FR5TNCzim4nnKqubgGA9e0JdHUxHgV/u5LYrnOKg4Xo752XNriNX7/SwIFejnOAK3PY+Kvz0Mbdm1LbvaqSQZH8JDmO5damLtLkDAKCBybuMPx0IXaTbFygpuTeUg9qqMAvfBto8BELd514MPE4VI7xZCpkoT64zg;4:PZvP0marAydaTWZOat2s+j/TB+omlAQqcRbnph8zod4JLtto1/WUE74BSGXiZDl8IMGA9O57rND2pr0Y9iHxf8x/9uRJh4iebfXkevmomZ23ePsn6lijxvGtP7QFEQugXkIS7k+s0NiXDEYsFZKP/rqW2Y8XXAQF5lOEB0vCPGyL44hzkq2c35MOe518yu4X3dEXr2w/qWHI+hRRHXo0nEiqzaPrznMDHSvazXGVHqy5L7JXLAzklcz2TNzSpT49W+c6FR7/G3AiOEGpAf8ukBK55+gZiu5PCyOeORzd3M45tcTN1AZO3PUHHySrYGuaiNkr18Kxjrbglqz3sC8tMNXiMV81icE3xqZoI4Czk1k0v48T/ma93ZMxL6WOVgXm X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(8121501046)(520078)(5005006)(10201501046)(3002001);SRVR:BY2FFO11HUB024;BCL:0;PCL:0;RULEID:;SRVR:BY2FFO11HUB024; X-Forefront-PRVS: 0751474A44 X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCWTJGRk8xMUhVQjAyNDsyMzordGEwSHBJRmtZenozYTc1TmpIbFU3U0Ix?= =?utf-8?B?U1pYMFZiRVR5TmZNaHVFN0QvRU1vY0VmOU5lMlpUcTk4em5kek9LWTBlMjRl?= =?utf-8?B?UWxhL0wrdzNsTFFydGJRcDNiYXlMMHYwMVRCN25mU3Z3ZkZKSmhuMlB1V2lS?= =?utf-8?B?aVZ4dXpWQlFWSlNpdGJ0NGZSRld6Zit5NEw0a01tdmJRSGZ3NU1vSzJ4WERV?= =?utf-8?B?V0tJOWpVMjMzSitJYlNEdHRSLzZwK1Q0RXRxYm1oL0FtbXVRK2RXNnFjUkJ4?= =?utf-8?B?YW94Tkp6Y0NtdGJwcElYNW96SGtGZ2tRbENwT000Wk0wNjB2UzVZa3BpWTE1?= =?utf-8?B?dzVUS3NKRlRoUHdkRHlXbmt0a2tFRG9QaDBER25VcUNncHJqTGNLaDZYc3Q0?= =?utf-8?B?UWxXMitTUGV1aTNXV0h2bHVSUHVXWEpRdFZqQk1HN3c0T1hHSXJQUGtjbUxi?= =?utf-8?B?YWpXZXBSNU1JdlpGNjhPRDNvdzdiWGdDYkJvTTJVN2VMdWQ1V0QyTGxMaXFa?= =?utf-8?B?RWFNR0hkYmlnY2tyZkU0WDNuejBYNHNRL2U3cFZIV2JLbUNORVYrbU8vcEtS?= =?utf-8?B?dVI4WUFaWmdiR292M091akFJSmJMaUl1RzdnUFNqYnpnRnlZMTcvSzIrZnJ5?= =?utf-8?B?R3Nybm8zeERva2lRbGZ0ZmFESTc5U1RCSHFEcnVvU3o4ODZPdlh0QklJTWgw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DiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Nov 2015 07:21:34.6791 (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: BY2FFO11HUB024 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1781 Lines: 45 Hi, this is v2, hopefully without any build issues. The changes are the same as before, just the warning reported by kbuild test robot about unused variables have been fixed. And, I added one more patch with some cleanup/refactoring. I recently found my system locking up under some conditions. I dug through the code a bit and the result is this collections of various changes. Some of it may not be required and has just been created out of half-baked theories and re-reading the documentation. The actual failing scenarios seem to be: - RX IRQ conditions are handled while the receiver is disabled, leaving the driver in an infinite loop - console_put_char seems to be interrupted by uart_shutdown disabling the transmitter while/just before printing I.e. overall I tried to serialize all operations using the port lock to avoid such interaction. Sören Sören Brinkmann (10): tty: xuartps: Beautify read-modify writes tty: xuartps: Use spinlock to serialize HW access tty: xuartps: Always enable transmitter in start_tx tty: xuartps: Clear interrupt status register in shutdown tty: xuartps: Improve startup function tty: xuartps: Keep lock for whole ISR tty: xuartps: Acquire port lock for shutdown tty: xuartps: Move RX path into helper function tty: xuartps: Only handle RX IRQs when RX is enabled tty: xuartps: Cleanup: Reformat if-else drivers/tty/serial/xilinx_uartps.c | 247 ++++++++++++++++++++----------------- 1 file changed, 136 insertions(+), 111 deletions(-) -- 2.6.2.3.ga463a5b -- 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/