qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Weil <weil@mail.berlios.de>
To: Isaku Yamahata <yamahata@valinux.co.jp>,
	"Michael S. Tsirkin" <mst@redhat.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>,
	qemu-devel@nongnu.org, Aurelien Jarno <aurelien@aurel32.net>
Subject: Re: [Qemu-devel] [PATCH v2 2/6] qdev: reset qdev along with qdev tree
Date: Sat, 18 Dec 2010 19:11:17 +0100	[thread overview]
Message-ID: <4D0CF945.4050404@mail.berlios.de> (raw)
In-Reply-To: <20101217044730.GQ7962@valinux.co.jp>

Am 17.12.2010 05:47, schrieb Isaku Yamahata:
> On Fri, Dec 17, 2010 at 01:29:42PM +0900, Isaku Yamahata wrote:
>> On Thu, Dec 16, 2010 at 08:31:21PM +0100, Stefan Weil wrote:
>>> The second regression also occurs with MIPS malta.
>>> Networking no longer works with the default pcnet nic.
>>>
>>> This is caused because the reset function for pcnet is no
>>> longer called during system boot. The result in an invalid
>>> mac address (all zero) and a non-working nic.
>>>
>>> For this second regression I still have no simple solution.
>>> Of course mips_malta.c should be converted to qdev which
>>> would fix both problems (but only for malta system emulation).
>>>
>>> Maybe other systems / devices don't get their reset functions
>>> called during system boot, too.
>>
>> Arg, sorry for regression. How about the following?
>
> The issue is, it is assumed that all qbuses, qdeves
> are under main_system_bus.
> But there are qbuses whose parent is NULL. So it is necessary
> to trigger reset for those qbuses.
>
> Ideally those buses should be moved under bus controller
> device which is qdev. But it's not done yet.
>
>>
>> diff --git a/hw/qdev.c b/hw/qdev.c
>> index 10e28df..774c53b 100644
>> --- a/hw/qdev.c
>> +++ b/hw/qdev.c
>> @@ -753,8 +753,11 @@ void qbus_create_inplace(BusState *bus, BusInfo 
>> *info,
>> if (parent) {
>> QLIST_INSERT_HEAD(&parent->child_bus, bus, sibling);
>> parent->num_child_bus++;
>> + } else if (bus != main_system_bus) {
>> + /* TODO: once all device is qdevified,
>> + reset handler for main_system_bus should also be registered here */
>> + qemu_register_reset((void *)qbus_reset_all, bus);
>> }
>> -
>> }
>>
>> BusState *qbus_create(BusInfo *info, DeviceState *parent, const char 
>> *name)
>> diff --git a/vl.c b/vl.c
>> index c4d3fc0..2ec3989 100644
>> --- a/vl.c
>> +++ b/vl.c
>> @@ -3088,6 +3088,8 @@ int main(int argc, char **argv, char **envp)
>> exit(1);
>> }
>>
>> + /* TODO: once all device is qdevified, this should be done by
>> + qbus_create_inplace() */
>> qemu_register_reset((void *)qbus_reset_all, sysbus_get_default());
>> qemu_run_machine_init_done_notifiers();
>>
>>
>> -- 
>> yamahata
>

I can confirm that this patch fixes the second regression:
the reset code for pcnet is called during system boot,
and networking with pcnet works fine again.

Could you please provide a signed patch which is ready for commit?

Michael, my patch (which fixes the first regression / crash)
is needed, too. Please add it to your git queue.

Stefan

  reply	other threads:[~2010-12-18 18:11 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-19  9:55 [Qemu-devel] [PATCH v2 0/6] qdev reset refactoring and pci bus reset Isaku Yamahata
2010-11-19  9:55 ` [Qemu-devel] [PATCH v2 1/6] qbus: add functions to walk both devices and busses Isaku Yamahata
2010-11-19  9:55 ` [Qemu-devel] [PATCH v2 2/6] qdev: reset qdev along with qdev tree Isaku Yamahata
2010-12-16 19:31   ` Stefan Weil
2010-12-16 23:48     ` Michael S. Tsirkin
2010-12-17  0:24       ` Anthony Liguori
2010-12-17 14:45         ` Peter Maydell
2010-12-17 14:56           ` Anthony Liguori
2010-12-20 12:58             ` Markus Armbruster
2010-12-20 19:40               ` Stefan Weil
2010-12-20 21:01                 ` Markus Armbruster
2010-12-17  4:29     ` Isaku Yamahata
2010-12-17  4:47       ` Isaku Yamahata
2010-12-18 18:11         ` Stefan Weil [this message]
2010-12-19 13:25           ` Michael S. Tsirkin
2010-11-19  9:56 ` [Qemu-devel] [PATCH v2 3/6] qdev: introduce reset call back for qbus level Isaku Yamahata
2010-11-19  9:56 ` [Qemu-devel] [PATCH v2 4/6] qdev: introduce a helper function which triggers reset from a given device Isaku Yamahata
2010-11-19  9:56 ` [Qemu-devel] [PATCH v2 5/6] pci: make use of qdev reset frame work to pci bus reset Isaku Yamahata
2010-11-19  9:56 ` [Qemu-devel] [PATCH v2 6/6] pci bridge: implement secondary " Isaku Yamahata
2010-11-19 12:00   ` [Qemu-devel] " Michael S. Tsirkin
2010-11-22  7:54 ` [Qemu-devel] Re: [PATCH v2 0/6] qdev reset refactoring and pci " Michael S. Tsirkin
2010-11-22 10:43   ` Isaku Yamahata
2010-11-22 10:54     ` Michael S. Tsirkin
2010-11-22 22:53     ` Michael S. Tsirkin
2010-11-23 18:10       ` Michael S. Tsirkin
2010-11-24  2:37         ` Isaku Yamahata
2010-11-24  5:27           ` Michael S. Tsirkin
2010-11-24  7:15             ` Isaku Yamahata
2010-11-24 10:59               ` Michael S. Tsirkin
2010-11-24 11:09                 ` Isaku Yamahata

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=4D0CF945.4050404@mail.berlios.de \
    --to=weil@mail.berlios.de \
    --cc=aliguori@us.ibm.com \
    --cc=aurelien@aurel32.net \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=yamahata@valinux.co.jp \
    /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).