From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:49353) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8WpS-00045s-GZ for qemu-devel@nongnu.org; Tue, 27 Sep 2011 08:32:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R8WpI-0003aK-Lm for qemu-devel@nongnu.org; Tue, 27 Sep 2011 08:32:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:12705) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8WpI-0003aG-A0 for qemu-devel@nongnu.org; Tue, 27 Sep 2011 08:31:56 -0400 Date: Tue, 27 Sep 2011 15:32:53 +0300 From: "Michael S. Tsirkin" Message-ID: <20110927123252.GA11276@redhat.com> References: <20110927112530.GA10828@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH qemu] e1000: CTRL.RST emulation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Anthony Liguori , Dean Nelson , qemu-devel@nongnu.org, Jesse Brandeburg , Aurelien Jarno , Alex Williamson , Jeff Kirsher , Kevin Wolf , Andy Gospodarek On Tue, Sep 27, 2011 at 12:50:21PM +0100, Peter Maydell wrote: > On 27 September 2011 12:25, Michael S. Tsirkin wrote: > > e1000 spec says CTRL.RST write should have the same effect > > as bus reset, except that is preserves PCI Config. > > Reset device registers and interrupts. > > > > Fix suggested by Andy Gospodarek > > Doesn't this have the same effect as this patch: > http://patchwork.ozlabs.org/patch/108673/ Right except mine clears the interrupts as well. I missed that patch - what happened to it in the end? > except that it's harder to read because it's moved a lot > of code around in the file? > > (I think you have an extra qemu_set_irq() call in there, The device spec says we should reset the interrupts. So it seems necessary. > actually. But it was hard to find. I probably should split the patch out 1. code movement 2. code change Forward declarations just to work around random placement of functions in file seem wrong - why not order the functions sensibly instead? > Also your code has the > bug that was in earlier revisions of Anthony's patch where > after doing the reset you fall through and allow other bits > in the ctrl register to be set.) > > -- PMM True. -- MST