qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "andrzej zaborowski" <balrogg@gmail.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] TSC2005 interrupt handling fix
Date: Mon, 5 Jan 2009 06:33:06 +0100	[thread overview]
Message-ID: <fb249edb0901042133h5a818645s21533c4a14eefb6f@mail.gmail.com> (raw)
In-Reply-To: <94023A5D-715D-433A-9E23-A5DC1A9A819D@nokia.com>

2008/12/19 Riihimaki Juha (Nokia-D-MSW/Helsinki) <juha.riihimaki@nokia.com>:
> 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

  reply	other threads:[~2009-01-05  5:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-19 11:23 [Qemu-devel] [PATCH] TSC2005 interrupt handling fix Riihimaki Juha (Nokia-D-MSW/Helsinki)
2009-01-05  5:33 ` andrzej zaborowski [this message]
2009-01-07  7:58   ` Riihimaki Juha (Nokia-D-MSW/Helsinki)
2009-01-08  7:27     ` andrzej zaborowski
2009-01-08 10:44       ` Riihimaki Juha (Nokia-D-MSW/Helsinki)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fb249edb0901042133h5a818645s21533c4a14eefb6f@mail.gmail.com \
    --to=balrogg@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).