Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755150AbbLFEkP (ORCPT ); Sat, 5 Dec 2015 23:40:15 -0500 Received: from mail-cys01nam02on0048.outbound.protection.outlook.com ([104.47.37.48]:5171 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754086AbbLFEkL (ORCPT ); Sat, 5 Dec 2015 23:40:11 -0500 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; ettus.com; dkim=none (message not signed) header.d=none;ettus.com; dmarc=bestguesspass action=none header.from=xilinx.com; From: Soren Brinkmann To: Greg Kroah-Hartman , Jiri Slaby CC: Michal Simek , , , , "Peter Hurley" , Moritz Fischer , Soren Brinkmann Subject: [PATCH LINUX v4 06/13] tty: xuartps: Move request_irq to after setting up the HW Date: Sat, 5 Dec 2015 20:39:22 -0800 Message-ID: <1449376769-13369-7-git-send-email-soren.brinkmann@xilinx.com> X-Mailer: git-send-email 2.6.3.3.g9bb996a In-Reply-To: <1449376769-13369-1-git-send-email-soren.brinkmann@xilinx.com> References: <1449376769-13369-1-git-send-email-soren.brinkmann@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.0.0.1202-21982.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)(189002)(229853001)(76176999)(86362001)(106466001)(5008740100001)(76506005)(2950100001)(11100500001)(5003940100001)(19580405001)(33646002)(77096005)(50986999)(50466002)(48376002)(87936001)(63266004)(1096002)(47776003)(50226001)(57986006)(19580395003)(6806005)(107886002)(81156007)(189998001)(36386004)(5001960100002)(92566002)(586003)(5001770100001)(36756003)(4001430100002)(1220700001)(107986001)(217873001);DIR:OUT;SFP:1101;SCL:1;SRVR:SN1NAM02HT086;H:xsj-pvapsmtpgw01;FPR:;SPF:Pass;PTR:unknown-60-83.xilinx.com;A:1;MX:1;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(8251501001);SRVR:SN1NAM02HT086; X-Microsoft-Antispam-PRVS: <92ed88d759c84c2b83e7b83094ca3e34@SN1NAM02HT086.eop-nam02.prod.protection.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(520078)(5005006)(8121501046)(3002001)(10201501046);SRVR:SN1NAM02HT086;BCL:0;PCL:0;RULEID:;SRVR:SN1NAM02HT086; X-Forefront-PRVS: 0782EC617F X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2015 04:39:51.3296 (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: SN1NAM02HT086 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1555 Lines: 49 Request_irq() should be _after_ h/w programming, otherwise an interrupt could be triggered and in-progress before the h/w has been setup. Reported-by: Peter Hurley Signed-off-by: Soren Brinkmann --- v4: - this patch has been added. Thanks to Peter for pointing it out and providing commit message --- drivers/tty/serial/xilinx_uartps.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index 6ffd3bbe3e18..1e9053656610 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -759,12 +759,7 @@ static void cdns_uart_set_termios(struct uart_port *port, static int cdns_uart_startup(struct uart_port *port) { unsigned long flags; - unsigned int retval = 0, status = 0; - - retval = request_irq(port->irq, cdns_uart_isr, 0, CDNS_UART_NAME, - (void *)port); - if (retval) - return retval; + unsigned int status = 0; spin_lock_irqsave(&port->lock, flags); @@ -818,7 +813,7 @@ static int cdns_uart_startup(struct uart_port *port) spin_unlock_irqrestore(&port->lock, flags); - return retval; + return request_irq(port->irq, cdns_uart_isr, 0, CDNS_UART_NAME, port); } /** -- 2.6.3.3.g9bb996a -- 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/