From patchwork Fri Mar 14 18:22:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 26280 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f71.google.com (mail-yh0-f71.google.com [209.85.213.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 83B79202DD for ; Fri, 14 Mar 2014 18:24:58 +0000 (UTC) Received: by mail-yh0-f71.google.com with SMTP id a41sf7043835yho.2 for ; Fri, 14 Mar 2014 11:24:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=AnyIpjxmLl+qry3fVWlDUlTERu3Lcw/zwr3IlhwtOLs=; b=ZTBIecOl+0KYYGLwiIW9UMCh4eQa14/fbfT9bLWCjn65232GxUDHNzQfJyYpWlxE7j cFyKqAFTD9K3gRucQJmmWFnBTrH++RUQ3wU4ifHITX/GhAX4t+pihT5R+Zdp+6u7mrM+ bXE81PzSUIkF9xFuj1cfaW4dB1YVD48Yr5IvLhSoXDNe1fIfifH2wvTXkOpeedqGKj5U vn+1gQ+nEqtdDdA8Kw6HvG+i9i9SSOdAnMrer1pHnsJKclRu8A6KwAEOUKKqZiihqBLn 4aYMM3lGN0vWcoGPui2cd0mm/bcbnltW+EElMwwoOqxMzlt5vtRC/55Jhg2dNVz1arfk 6GMQ== X-Gm-Message-State: ALoCoQkazR2sXqz1ExfT8Myc8xcPy1VgvtXBy3mlE1sIryZbbQjrx8dYq9m6GGwYbsdl0OAJaRKi X-Received: by 10.58.23.170 with SMTP id n10mr3894374vef.25.1394821498164; Fri, 14 Mar 2014 11:24:58 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.92.133 with SMTP id b5ls839314qge.38.gmail; Fri, 14 Mar 2014 11:24:58 -0700 (PDT) X-Received: by 10.220.131.210 with SMTP id y18mr7641093vcs.12.1394821498052; Fri, 14 Mar 2014 11:24:58 -0700 (PDT) Received: from mail-ve0-x235.google.com (mail-ve0-x235.google.com [2607:f8b0:400c:c01::235]) by mx.google.com with ESMTPS id oj4si2376632vcb.50.2014.03.14.11.24.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 14 Mar 2014 11:24:58 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::235 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c01::235; Received: by mail-ve0-f181.google.com with SMTP id oy12so3067617veb.40 for ; Fri, 14 Mar 2014 11:24:58 -0700 (PDT) X-Received: by 10.52.250.236 with SMTP id zf12mr6271545vdc.9.1394821497973; Fri, 14 Mar 2014 11:24:57 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.78.9 with SMTP id i9csp42436vck; Fri, 14 Mar 2014 11:24:57 -0700 (PDT) X-Received: by 10.229.219.133 with SMTP id hu5mr11746428qcb.5.1394821497420; Fri, 14 Mar 2014 11:24:57 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id m34si3878050qge.188.2014.03.14.11.24.57 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 14 Mar 2014 11:24:57 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:46436 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WOWmu-0007ZN-Vk for patch@linaro.org; Fri, 14 Mar 2014 14:24:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44381) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WOWkr-0003HN-4b for qemu-devel@nongnu.org; Fri, 14 Mar 2014 14:22:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WOWkl-0004k3-KN for qemu-devel@nongnu.org; Fri, 14 Mar 2014 14:22:49 -0400 Received: from mail-oa0-x232.google.com ([2607:f8b0:4003:c02::232]:39457) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WOWkl-0004jy-Ek for qemu-devel@nongnu.org; Fri, 14 Mar 2014 14:22:43 -0400 Received: by mail-oa0-f50.google.com with SMTP id i7so3036116oag.9 for ; Fri, 14 Mar 2014 11:22:43 -0700 (PDT) X-Received: by 10.60.233.202 with SMTP id ty10mr8040531oec.25.1394821362941; Fri, 14 Mar 2014 11:22:42 -0700 (PDT) Received: from localhost.localdomain (72-48-77-163.dyn.grandenetworks.net. [72.48.77.163]) by mx.google.com with ESMTPSA id oz15sm10829740oeb.13.2014.03.14.11.22.41 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 14 Mar 2014 11:22:42 -0700 (PDT) From: Rob Herring To: qemu-devel@nongnu.org, Peter Maydell Date: Fri, 14 Mar 2014 13:22:28 -0500 Message-Id: <1394821351-21477-2-git-send-email-robherring2@gmail.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1394821351-21477-1-git-send-email-robherring2@gmail.com> References: <1394821351-21477-1-git-send-email-robherring2@gmail.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c02::232 Cc: Rob Herring Subject: [Qemu-devel] [PATCH v2 1/4] pl011: reset the fifo when enabled or disabled X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Original-Sender: robherring2@gmail.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::235 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=fail header.i=@gmail.com; dmarc=fail (p=NONE dis=NONE) header.from=gmail.com Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Rob Herring Intermittent issues have been seen where no serial input occurs. It appears the pl011 gets in a state where the rx interrupt never fires because the rx interrupt only asserts when crossing the fifo trigger level. The fifo state appears to get out of sync when the pl011 is re-configured. This combined with the rx timeout interrupt not being modeled results in no more rx interrupts. Disabling the fifo is the recommended way to clear the tx fifo in the TRM (section 3.3.8). The behavior in this case for the rx fifo is undefined in the TRM, but having fifo contents to be maintained during configuration changes is not likely expected behavior. Reseting the fifo state when the fifo size is changed is the simplest solution. Signed-off-by: Rob Herring --- hw/char/pl011.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/char/pl011.c b/hw/char/pl011.c index a8ae6f4..f0c3fa3 100644 --- a/hw/char/pl011.c +++ b/hw/char/pl011.c @@ -162,6 +162,10 @@ static void pl011_write(void *opaque, hwaddr offset, s->fbrd = value; break; case 11: /* UARTLCR_H */ + if (!((s->lcr ^ value) & 0x10)) { + s->read_count = 0; + s->read_pos = 0; + } s->lcr = value; pl011_set_read_trigger(s); break;