From patchwork Tue Mar 26 14:57:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 2337931 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 2F6FFDF264 for ; Tue, 26 Mar 2013 14:57:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933685Ab3CZO5w (ORCPT ); Tue, 26 Mar 2013 10:57:52 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:39421 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933674Ab3CZO5v (ORCPT ); Tue, 26 Mar 2013 10:57:51 -0400 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MK9005FYW8DZU40@mailout3.samsung.com>; Tue, 26 Mar 2013 23:57:50 +0900 (KST) X-AuditID: cbfee61a-b7fa86d0000045ae-bf-5151b76ea2b7 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id BC.05.17838.E67B1515; Tue, 26 Mar 2013 23:57:50 +0900 (KST) Received: from mcdsrvbld02.digital.local ([106.116.37.23]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MK9007DRW86LQ60@mmp2.samsung.com>; Tue, 26 Mar 2013 23:57:49 +0900 (KST) From: Tomasz Figa To: linux-samsung-soc@vger.kernel.org Cc: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, kyungmin.park@samsung.com, kgene.kim@samsung.com, m.szyprowski@samsung.com, thomas.abraham@linaro.org, Tomasz Figa Subject: [PATCH] tty: serial: samsung: Disable interrupts in a suspend-friendly way Date: Tue, 26 Mar 2013 15:57:35 +0100 Message-id: <1364309855-10391-1-git-send-email-t.figa@samsung.com> X-Mailer: git-send-email 1.7.10 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrDJMWRmVeSWpSXmKPExsVy+t9jQd287YGBBivvK1o0L17PZtG74Cqb xdmmN+wWM87vY7I4s7iX3WLtkbvsFutnvGaxODZjCaMDh8eda3vYPPbPXcPu0bdlFaPH501y ASxRXDYpqTmZZalF+nYJXBn3F55hK5jOXdFwv429gXE1ZxcjJ4eEgInE05Xb2SFsMYkL99az dTFycQgJTGeU6DkwmQnC6WKSeNv2mA2kik1ATeJzwyMwW0RAVeJz2wJ2kCJmgZOMEo0//rOA JIQFQiV+vN4FZHNwsAAVtX0C28Yr4CSxYvcnFoht8hJP7/exTWDkXsDIsIpRNLUguaA4KT3X UK84Mbe4NC9dLzk/dxMjOEyeSe1gXNlgcYhRgINRiYd3Q3BAoBBrYllxZe4hRgkOZiURXsGN gYFCvCmJlVWpRfnxRaU5qcWHGKU5WJTEeQ+0WgcKCaQnlqRmp6YWpBbBZJk4OKUaGBdkZvhl /spzs3ya3VsX6aXx76jPC7/P3dUFi20jPqxn1ljfwWLxfqmM/K/PRu6Hv4msVGIXsT3lcKbk +3leP/W4VO/ztxt/7Ft9rNDSd8UrfZ8Js+f47Yn3NZcUnLe3IXflLtXwuKobi2NaHNZ7lrEr TrqXIlvmcb9vn+28vhjXLPd+tS1FSizFGYmGWsxFxYkAJzOfog8CAAA= Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Since the interrupt mask register is not preserved across system suspend and it defaults to all interrupts enabled, it is not enough to disable UART interrupt. This patch adds free_irq to port shutdown and mask setting to port startup to handle IRQ disabling in a suspend-friendly way. In addition, a bug caused by multiple request_irq calls in port startup callback is fixed. Signed-off-by: Tomasz Figa Signed-off-by: Kyungmin Park --- drivers/tty/serial/samsung.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c index 2769a38..b386fc8 100644 --- a/drivers/tty/serial/samsung.c +++ b/drivers/tty/serial/samsung.c @@ -446,6 +446,8 @@ static void s3c24xx_serial_shutdown(struct uart_port *port) /* Clear pending interrupts and mask all interrupts */ if (s3c24xx_serial_has_interrupt_mask(port)) { + free_irq(port->irq, ourport); + wr_regl(port, S3C64XX_UINTP, 0xf); wr_regl(port, S3C64XX_UINTM, 0xf); } @@ -505,6 +507,8 @@ static int s3c64xx_serial_startup(struct uart_port *port) dbg("s3c64xx_serial_startup: port=%p (%08lx,%p)\n", port->mapbase, port->membase); + wr_regl(port, S3C64XX_UINTM, 0xf); + ret = request_irq(port->irq, s3c64xx_serial_handle_irq, IRQF_SHARED, s3c24xx_serial_portname(port), ourport); if (ret) {