From patchwork Thu Mar 3 08:04:42 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Courbot X-Patchwork-Id: 605131 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2385XDp032450 for ; Thu, 3 Mar 2011 08:05:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757750Ab1CCIFd (ORCPT ); Thu, 3 Mar 2011 03:05:33 -0500 Received: from mail-iw0-f174.google.com ([209.85.214.174]:64669 "EHLO mail-iw0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754793Ab1CCIFc (ORCPT ); Thu, 3 Mar 2011 03:05:32 -0500 Received: by iwn34 with SMTP id 34so716791iwn.19 for ; Thu, 03 Mar 2011 00:05:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer; bh=qUq7/eq8wnIzqTJrlxELSjensa8MXE0KbV7kqCZd5YA=; b=oEuE1Px7xPRPoJEgpBRUY3NA5RuAZEx+22x1ZxGbDDpP/cKQwECAEAn//Y9GcqxT/o 8Z98UGv05RXtvrAgwTH8/RGcW7LC2RNFEFocky1AjxvcE/XWcHgtE30stXG9zguYRnOc RXa8BM2LeovvJCuMZwFujgAcOR2duLJIW8uYg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=tw5eSRIBMxf/a3+GZorTYiiR7zLHw+Aa653s06NP8KolWqkFqXcs7Ie/6JKkp6+AS1 GGY/MBPj6DIaP1fjB1c88KFfqzgMYDcNh5cggdh79lzh9s4gpct6lgGPZUZdDkkqrVTz zkG8CfVB1cHMSZvIl/E0bM3e0YyvmXyjQMj24= Received: by 10.42.154.138 with SMTP id q10mr1247195icw.134.1299139531189; Thu, 03 Mar 2011 00:05:31 -0800 (PST) Received: from localhost.localdomain (e0109-114-22-24-102.uqwimax.jp [114.22.24.102]) by mx.google.com with ESMTPS id i2sm581468icv.3.2011.03.03.00.05.27 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 03 Mar 2011 00:05:29 -0800 (PST) From: Alexandre Courbot To: Paul Mundt , Magnus Damm Cc: linux-sh@vger.kernel.org, Alexandre Courbot Subject: [PATCH] serial: sh-sci: fix deadlock when resuming from S3 sleep Date: Thu, 3 Mar 2011 17:04:42 +0900 Message-Id: <1299139482-5235-1-git-send-email-gnurou@gmail.com> X-Mailer: git-send-email 1.7.4.1 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 03 Mar 2011 08:05:34 +0000 (UTC) diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index e180bc9..264209c 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -1504,6 +1504,9 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios, if (likely(baud && port->uartclk)) t = sci_scbrr_calc(s->cfg->scbrr_algo_id, baud, port->uartclk); + if (s->enable) + s->enable(port); + do { status = sci_in(port, SCxSR); } while (!(status & SCxSR_TEND(port))); @@ -1571,6 +1574,9 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios, if ((termios->c_cflag & CREAD) != 0) sci_start_rx(port); + + if (s->disable) + s->disable(port); } static const char *sci_type(struct uart_port *port)