From patchwork Tue Dec 1 09:54:46 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 63910 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nB19sieG029432 for ; Tue, 1 Dec 2009 09:54:44 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753841AbZLAJyg (ORCPT ); Tue, 1 Dec 2009 04:54:36 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753899AbZLAJyg (ORCPT ); Tue, 1 Dec 2009 04:54:36 -0500 Received: from mail.gmx.net ([213.165.64.20]:60496 "HELO mail.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753841AbZLAJyg (ORCPT ); Tue, 1 Dec 2009 04:54:36 -0500 Received: (qmail invoked by alias); 01 Dec 2009 09:54:41 -0000 Received: from p57BD1769.dip0.t-ipconnect.de (EHLO axis700.grange) [87.189.23.105] by mail.gmx.net (mp040) with SMTP; 01 Dec 2009 10:54:41 +0100 X-Authenticated: #20450766 X-Provags-ID: V01U2FsdGVkX1/yOzV59FXyz4PNpNzaK8sPDijdx9O7/g40UOt7iG HRYbiJ101GpLw3 Received: from lyakh (helo=localhost) by axis700.grange with local-esmtp (Exim 4.63) (envelope-from ) id 1NFPRW-0001Tw-5b for linux-sh@vger.kernel.org; Tue, 01 Dec 2009 10:54:46 +0100 Date: Tue, 1 Dec 2009 10:54:46 +0100 (CET) From: Guennadi Liakhovetski To: linux-sh@vger.kernel.org Subject: [PATCH] Fix too early disabling of the serial (SCI(F)) ports Message-ID: MIME-Version: 1.0 X-Y-GMX-Trusted: 0 X-FuHaFi: 0.52 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c index 85119fb..70a52a5 100644 --- a/drivers/serial/sh-sci.c +++ b/drivers/serial/sh-sci.c @@ -833,8 +833,8 @@ static void sci_free_irq(struct sci_port *port) static unsigned int sci_tx_empty(struct uart_port *port) { - /* Can't detect */ - return TIOCSER_TEMT; + unsigned short status = sci_in(port, SCxSR); + return status & SCxSR_TEND(port) ? TIOCSER_TEMT : 0; } static void sci_set_mctrl(struct uart_port *port, unsigned int mctrl)