Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755989AbbGPPgz (ORCPT ); Thu, 16 Jul 2015 11:36:55 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:60876 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752045AbbGPPgw (ORCPT ); Thu, 16 Jul 2015 11:36:52 -0400 Subject: Re: [PATCH v3] serial: mxs-auart: keep the AUART unit in reset state when not in use To: Juergen Borleis , linux-kernel@vger.kernel.org References: <1437032458-8577-1-git-send-email-jbe@pengutronix.de> Cc: Greg Kroah-Hartman , Jiri Slaby , linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de From: Stefan Wahren Message-ID: <55A7CF71.7050507@i2se.com> Date: Thu, 16 Jul 2015 17:36:17 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <1437032458-8577-1-git-send-email-jbe@pengutronix.de> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:9tgaXor3ZE+aEEVlB1iuPJ+141xlIqjZaSWkRoWHGFlEhsXxN0Z cfXmMcGBuWeFNN0f5ncuvWjoP/Eu1GolsuLLy65cObVpTnjE7Qd6Kuq6iRrlf3p12arvRkH I7/nUPeGYjunr0xuf5Q0CUgGM1CyNOAnb/PfDpgpjZVqEzjd3AQWBF3ECsoPg1gFhp5Yqyc +m0WJVA8u+srHI2bALodw== X-UI-Out-Filterresults: notjunk:1;V01:K0:AJk9oDnzvTg=:4G8JOLm5OHTmEiPF6YgLmt HEda8E0w7Wya1MkbnHjzaFpDM5B5/sv6gSjTKTusvrhmUGKj2F8kUgvwoc8eJ0s+MxmOX4qp/ RqQZ3ro38+jQKImIrZynkUHFDlhx8o5eDk9Wygf+VuDjftpi5kPWWomWPs9R527NpG8/v8Kpa cfOsh+pXntKaVMKDct5jSte/VeD+vlL+342JQAsSgvLyqK9pKqAXhgrm0+9nUwjPnYQ75LkxZ GITLu83BmvklBe+Wg05BlN6nb0oDIZdVQJ4HRE9hp5aAQGyq61cpXzbnp3B0F3m2a7enbeQUY csNf29R8p0InNGNO5E0lZvIst46/gAt8Om3cGv8GFVd5cD+vSEnDicYKYSgGqgn1vPBsdhEhH KGc/Y+0jGxiPW/zxzD7FBJFcqeqboP86hk6XPdxXaj1H3ZWi10lUFO4BTTnzto9Skb9K0cIL3 zfIAOeKYPsy/4xeLBRClOi+NEKX9+P5bniYkLjq77iw9rgYl2tFqepfHeTryxaiulEjE4U3Td F7YuGKaAm5Pm0i0rRl9Ej2dPP72cNNJ8kZPQsB1z5g6GH969M2BT8/Aj9uHQ7pNqs4s8qqlnX htL2K9Put+UOifIqNPxyQ+AMlrT7xn/uc/x5BMpElB8u6UzPuUcaYhwVVgg6BAWW1XvwbPbzh 1orS3cCbE7/JUUAvdZ8rJ7XrU5QVaowezQkBiyEShzLcsxQ== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1334 Lines: 34 > Whenever the UART device driver gets closed from userland, the driver > disables the UART unit and then stops its clock to save power. > > The bit which disabled the UART unit is described as: > > "UART Enable. If this bit is set to 1, the UART is enabled. Data > transmission and reception occurs for the UART signals. When the > UART is disabled in the middle of transmission or reception, it > completes the current character before stopping." > > The important part is the "it completes the current character". Whenever > a reception is ongoing when the UART gets disabled (including the clock > off) the statemachine freezes and "remembers" this state on the next > open() and re-enabling of the unit's clock. > > In this case we end up receiving an additional bogus character > immediately. > > The solution in this change is to move the AUART unit into its reset > state on close() and only release it from its reset state on the next > open(). > > Signed-off-by: Juergen Borleis > --- Acked-by: Stefan Wahren Thanks Stefan -- 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/