qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Register uhci_reset() callback.


From: Gleb Natapov
Subject: Re: [Qemu-devel] Register uhci_reset() callback.
Date: Tue, 16 Jun 2009 21:39:46 +0300

On Tue, Jun 16, 2009 at 08:19:00PM +0300, Blue Swirl wrote:
> On 6/16/09, Gleb Natapov <address@hidden> wrote:
> > On Tue, Jun 16, 2009 at 07:54:25PM +0300, Blue Swirl wrote:
> >  > On 6/16/09, Gleb Natapov <address@hidden> wrote:
> >  > > On Tue, Jun 16, 2009 at 06:14:51PM +0300, Blue Swirl wrote:
> >  > >  > > Because interrupt line is stuck a guest can't get to the point 
> > where it
> >  > >  > >  loads a driver to the second device. For outside observer the 
> > guest
> >  > >  > >  just hangs.
> >  > >  >
> >  > >  > I see. The problem is in piix_pci interrupt handling, 
> > pci_irq_levels[]
> >  > >  > should be set to zero on reset.
> >  > >
> >  > > The patch that does that was rejected earlier :)
> >  > >  http://lists.gnu.org/archive/html/qemu-devel/2009-06/msg00342.html
> >  > >  http://lists.gnu.org/archive/html/qemu-devel/2009-06/msg00344.html
> >  >
> >  > I think patch 2/3 is bogus, but 3/3 should be the correct way. Nobody
> >  > commented on that.
> >  >
> >
> > What is bogus about 2/3? But the comment were not about specific patch,
> >  more about the general approach. And conclusion was that each device should
> >  lower its line. This is how real HW works BTW. IMHO both things should
> 
> That was the conclusion then, but it was incorrect. Real HW works like
> that, but qemu_irq only handles transition edges. It does not have
> state.
> 
The state is handled elsewhere. And device on reset has to make sure
that state is correct wherever it is maintained. What about the mantra
that we should be as close to HW as possible? Reseting state only on
a bus level will not work for hot-unplug anyway.

> >  be done, pci bus should reset its internal state and each device should
> >  lower its own line (bus implementation may be changed in the future to
> >  more be like real HW).
> 
> Bus should reset its own internal state but devices need not do
> anything about the qemu_irq. In 2/3 bus would reset also devices,
> which is even more wrong.
It resets part of its internal state that happens to be maintained per
device. It is possible to register reset handler per device that will
clear the state, but then we will have to add qemu_reset_unregister()
for hot-unplug.

--
                        Gleb.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]