Re: [PATCH 01/22] virtio: store owner from modules with register_virtio_driver()

2024-03-31 Thread Michael S. Tsirkin
On Wed, Mar 27, 2024 at 01:40:54PM +0100, Krzysztof Kozlowski wrote: > Modules registering driver with register_virtio_driver() might forget to > set .owner field. i2c-virtio.c for example has it missing. The field > is used by some of other kernel parts for reference counting >

Re: [PATCH 01/22] virtio: store owner from modules with register_virtio_driver()

2024-03-29 Thread Stefano Garzarella
On Fri, Mar 29, 2024 at 01:07:31PM +0100, Krzysztof Kozlowski wrote: On 29/03/2024 12:42, Stefano Garzarella wrote: }; -int register_virtio_driver(struct virtio_driver *driver) +int __register_virtio_driver(struct virtio_driver *driver, struct module *owner) { /* Catch this early. */

Re: [PATCH 01/22] virtio: store owner from modules with register_virtio_driver()

2024-03-29 Thread Krzysztof Kozlowski
On 29/03/2024 12:42, Stefano Garzarella wrote: >> }; >> >> -int register_virtio_driver(struct virtio_driver *driver) >> +int __register_virtio_driver(struct virtio_driver *driver, struct module >> *owner) >> { >> /* Catch this early. */ >> BUG_ON(driver->feature_table_size &&

Re: [PATCH 01/22] virtio: store owner from modules with register_virtio_driver()

2024-03-29 Thread Stefano Garzarella
On Wed, Mar 27, 2024 at 01:40:54PM +0100, Krzysztof Kozlowski wrote: Modules registering driver with register_virtio_driver() might forget to set .owner field. i2c-virtio.c for example has it missing. The field is used by some of other kernel parts for reference counting (try_module_get()), so

[PATCH 01/22] virtio: store owner from modules with register_virtio_driver()

2024-03-27 Thread Krzysztof Kozlowski
Modules registering driver with register_virtio_driver() might forget to set .owner field. i2c-virtio.c for example has it missing. The field is used by some of other kernel parts for reference counting (try_module_get()), so it is expected that drivers will set it. Solve the problem by moving