[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Should bus-less devices default to .user_creatable = false? (was: [PATCH
From: |
Markus Armbruster |
Subject: |
Should bus-less devices default to .user_creatable = false? (was: [PATCH 13/13] bcm2835_cprman: put some peripherals of bcm2835 cprman into the 'misc' category) |
Date: |
Wed, 18 Nov 2020 09:50:14 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) |
Markus Armbruster <armbru@redhat.com> writes:
[...]
> qdev_device_add() looks like a bus-less device is usable if the machine
> provides a hotplug handler for it. Commit 03fcbd9dc5 "qdev: Check for
> the availability of a hotplug controller before adding a device" seems
> to be pertinent.
Nope. A hotplug handler is only required for hot plug (d'oh!), not for
cold plug.
I wonder whether bus-less devices should default to .user_creatable =
false like sysbus devices, and for the same reasons.
To actually *do* something, a physical device requires some connection
to the rest of the world. Same for a virtual device (at least the ones
that model physical devices).
sysbus_device_class_init():
/*
* device_add plugs devices into a suitable bus. For "real" buses,
* that actually connects the device. For sysbus, the connections
* need to be made separately, and device_add can't do that. The
* device would be left unconnected, and will probably not work
*
* However, a few machines can handle device_add/-device with
* a few specific sysbus devices. In those cases, the device
* subclass needs to override it and set user_creatable=true.
*/
k->user_creatable = false;
The reasoning applies to bus-less devices just as well, doesn't it?
[...]
- Re: [PATCH 13/13] bcm2835_cprman: put some peripherals of bcm2835 cprman into the 'misc' category, (continued)
- Re: [PATCH 13/13] bcm2835_cprman: put some peripherals of bcm2835 cprman into the 'misc' category, Philippe Mathieu-Daudé, 2020/11/16
- Re: [PATCH 13/13] bcm2835_cprman: put some peripherals of bcm2835 cprman into the 'misc' category, Thomas Huth, 2020/11/16
- Re: [PATCH 13/13] bcm2835_cprman: put some peripherals of bcm2835 cprman into the 'misc' category, Markus Armbruster, 2020/11/16
- Re: [PATCH 13/13] bcm2835_cprman: put some peripherals of bcm2835 cprman into the 'misc' category, Peter Maydell, 2020/11/16
- Re: [PATCH 13/13] bcm2835_cprman: put some peripherals of bcm2835 cprman into the 'misc' category, Markus Armbruster, 2020/11/17
- Re: [PATCH 13/13] bcm2835_cprman: put some peripherals of bcm2835 cprman into the 'misc' category, Peter Maydell, 2020/11/17
- Re: [PATCH 13/13] bcm2835_cprman: put some peripherals of bcm2835 cprman into the 'misc' category, Thomas Huth, 2020/11/17
- Re: [PATCH 13/13] bcm2835_cprman: put some peripherals of bcm2835 cprman into the 'misc' category, Markus Armbruster, 2020/11/18
- Should bus-less devices default to .user_creatable = false? (was: [PATCH 13/13] bcm2835_cprman: put some peripherals of bcm2835 cprman into the 'misc' category),
Markus Armbruster <=
- Re: Should bus-less devices default to .user_creatable = false? (was: [PATCH 13/13] bcm2835_cprman: put some peripherals of bcm2835 cprman into the 'misc' category), Thomas Huth, 2020/11/18
- RE: [PATCH 13/13] bcm2835_cprman: put some peripherals of bcm2835 cprman into the 'misc' category, ganqixin, 2020/11/17