From patchwork Mon Oct 8 15:18:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 190048 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id BF17B2C0310 for ; Tue, 9 Oct 2012 02:18:46 +1100 (EST) Received: from localhost ([::1]:44497 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TLF6S-0001dZ-Pt for incoming@patchwork.ozlabs.org; Mon, 08 Oct 2012 11:18:44 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60958) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TLF6I-0001cX-7T for qemu-devel@nongnu.org; Mon, 08 Oct 2012 11:18:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TLF6C-0003mi-Px for qemu-devel@nongnu.org; Mon, 08 Oct 2012 11:18:34 -0400 Received: from mail-da0-f45.google.com ([209.85.210.45]:35489) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TLF6C-0003m2-IV for qemu-devel@nongnu.org; Mon, 08 Oct 2012 11:18:28 -0400 Received: by mail-da0-f45.google.com with SMTP id n15so1631958dad.4 for ; Mon, 08 Oct 2012 08:18:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=/37LdBqBBQ6ddj3wYfjJ772PH4DQYRIOif1C+D1JtYo=; b=ZJ83UdBAeANJ+uArkcG+uS0VJes/hV0EXSX0fD1yZkWQDq7GZMPW1ze1aOfC5lf71K efEMgHNRKKCPghzFBA3Krmq4q74t61IKlYdRjErTCeR1oYvE+XUgffJgDLvsKNzn0UmE lgcoiZAX7CDoOzm4ueGN8AAvrY4ZSF2UgcNkri+EY49FMbMTwQ82TwTqjhnqoJRs0dAG 5DbSw7zvH2tOMBrj601O7rIo+8FGZ72ujFPuBdD71Q6NI91aE37LfZzlMRdS7WqpiNdw xYsHSo9izi3gKycNKJMJ/d5z6AVDXazJUcN8eZfmP6gK9yipGmv2AulCJES/slfzLUAN 6IKw== Received: by 10.66.74.196 with SMTP id w4mr43823062pav.32.1349709506562; Mon, 08 Oct 2012 08:18:26 -0700 (PDT) Received: from yakj.usersys.redhat.com (93-34-169-1.ip50.fastwebnet.it. [93.34.169.1]) by mx.google.com with ESMTPS id rz10sm10862809pbc.32.2012.10.08.08.18.18 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 08 Oct 2012 08:18:21 -0700 (PDT) Message-ID: <5072EEB7.2070408@redhat.com> Date: Mon, 08 Oct 2012 17:18:15 +0200 From: Paolo Bonzini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120911 Thunderbird/15.0.1 MIME-Version: 1.0 To: Jan Kiszka References: <506F1934.5000002@siemens.com> <506F207A.70805@siemens.com> <5072782E.9090707@siemens.com> In-Reply-To: <5072782E.9090707@siemens.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.210.45 Cc: Peter Maydell , qemu-devel Subject: Re: [Qemu-devel] [PATCH] versatile: Push lsi initialization to the end 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Il 08/10/2012 08:52, Jan Kiszka ha scritto: > On 2012-10-06 04:13, Peter Maydell wrote: >> On 5 October 2012 19:01, Jan Kiszka wrote: >>> I'm not a fan of this either, but the alternatives are way more >>> complicated. We either need to rewrite the chardev subsystem, >>> specifically how mux'ed devices are registered and how the active one is >>> selected. Or we need to avoid flushing "unrelated" BHs for block >>> devices. Not sure of those read requests can be postponed. >> >> Is this a regression? If it is then the obvious answer is to back >> out whatever broke it... > > I'm using this machine for the first time, so I cannot answer this from > the top of my head. However, I don't think it can be a regression. > > Mux chardevs work like this: You create the backend, then you register > the frontend with them, one by one. The last one registered is the first > one active. It should also receive the open event of chardev. But as > that open even is issued via a BH and last frontend, the serial device, > arrives after the first BH flushing, things break. Does something like this work instead? static CharDriverState *qemu_chr_open_mux(CharDriverState *drv) Paolo diff --git a/qemu-char.c b/qemu-char.c index b082bae..1ed6d49 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -465,6 +465,9 @@ static void mux_chr_update_read_handler(CharDriverState *chr) d->focus = d->mux_cnt; d->mux_cnt++; mux_chr_send_event(d, d->focus, CHR_EVENT_MUX_IN); + if (chr->opened) { + mux_chr_send_event(d, d->focus, CHR_EVENT_OPENED); + } }