qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] Register usb-uhci reset function.


From: Gleb Natapov
Subject: Re: [Qemu-devel] [PATCH] Register usb-uhci reset function.
Date: Tue, 16 Jun 2009 22:11:48 +0300

On Tue, Jun 16, 2009 at 07:41:05PM +0100, Paul Brook wrote:
> >> If allow devices to be reset independently then they should probably set
> >> theit IRQ output on reset.
> >
> >It is not "if" it is "when". We have to allow device to be reset
> > independently for hot-unplug.
> 
> I'm not entirely convinced about reset-on-hotunplug. What about a device that 
> pulls its IRQ line high on reset?
> 
There are several different resets for device. SW reset (triggered by
driver issuing a command), HW reset (triggered by external reset
signal). If they are different device should implement them differently.
HW reset should be called on device unplug. And if spec says that device
pulls its IRQ line high on HW reset then device emulation should do that
too.

> > > The only relevant circumstances are if the devices raises an IRQ, and is
> > > then reset by software while the system is running. It's got nothing to
> > > do with piix3, PCI bus interrupt sharing or system reset. If you are
> > > seeing problems after a system reset then your bug lies elsewhere.
> >
> > So you apparently never heard about hardware reset? You never saw buggy
> > guests that does not reset HW before reboot?
> 
> Clearing device state on full system reset makes sense because the whole 
> point 
> is that we're returning the system to its power-on state.
Power-up state is not always the same as the state after triggering
reset on real HW. System reset in QEMU currently emulates neither of
them properly. And on real HW there are different power planes and they
can be powered down independently. QEMU can't emulates this neither.

> Lowering the IRQ when a single device is reset also makes sense.
>
It is much more simple then that. If spec says that IRQ line should be lowered
on reset we should code it this way. (Spec may say this indirectly. It
may say that IRQ level is an AND of N registers and on reset those
registers are cleared).
 
> However having the device explicit set its IRQ line during a full system 
> reset 
> is a different matter. This is probably harmless most of the time, and may 
> paper over other bugs (e.g. the PCI bus not being reset properly). However I 
> do not believe it is the correct justification for these changes.
> 
The IRQ state inside piix3 code is QEMU implementation detail. There is
now such thing on real HW.

The real bug in case of usb-uhci is that it is not reset on system reset.
Are you arguing with that too, or just with IRQ level bits?

--
                        Gleb.




reply via email to

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