From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LJi5P-0001JJ-6h for qemu-devel@nongnu.org; Mon, 05 Jan 2009 00:33:11 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LJi5M-0001J7-Rl for qemu-devel@nongnu.org; Mon, 05 Jan 2009 00:33:09 -0500 Received: from [199.232.76.173] (port=53608 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LJi5M-0001J4-Mu for qemu-devel@nongnu.org; Mon, 05 Jan 2009 00:33:08 -0500 Received: from rv-out-0708.google.com ([209.85.198.247]:47304) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LJi5M-0003dA-7K for qemu-devel@nongnu.org; Mon, 05 Jan 2009 00:33:08 -0500 Received: by rv-out-0708.google.com with SMTP id f25so6556777rvb.22 for ; Sun, 04 Jan 2009 21:33:06 -0800 (PST) Message-ID: Date: Mon, 5 Jan 2009 06:33:06 +0100 From: "andrzej zaborowski" Subject: Re: [Qemu-devel] [PATCH] TSC2005 interrupt handling fix In-Reply-To: <94023A5D-715D-433A-9E23-A5DC1A9A819D@nokia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <94023A5D-715D-433A-9E23-A5DC1A9A819D@nokia.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 2008/12/19 Riihimaki Juha (Nokia-D-MSW/Helsinki) : > Fixing couple of timing related issues in the TSC2005 emulation. > > Problems: > 1) Setting DAV bits while previous conversion results are being read results > in PINTDAV interrupt line never being released. > 2) Altering PINTDAV state during SPI data transfer can result in an > inconsistent interrupt state. Is that because the read happens in two steps (write register number, read value)? The specs say that the DAV bit is not reset, and new conversion doesn't start until the result is completely read out, I assumed that means it starts after the read command is written, rather than after both steps finished. If this wrong, then I see how this can cause problems. > > Solution proposal: > Moved PINTDAV altering code from tsc2005_pin_update to tsc2005_timer_tick > and prohibited setting of DAV bits unless PINTDAV is to be set. You moved the qemu_set_irq to the timer callback while the irq can be set/reset in other situations too (e.g. on reset). I thinkt he correct thing to do might be to leave tsc2005_pin_update as it and not reset the dav bit immediately (adn thus not deassert PINTDAV) until the value is also fully read. Only then we would assign s->dav and call tsc2005_pin_update again and start a new conversion. Same might apply to tsc2102. Cheers