[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e2xy5kjdctpitcrev2byqc5gcwntvsd6pfutrvp3l2kfe3llgs@l2xp5opj7xu2>
Date: Fri, 29 Mar 2024 14:28:27 +0100
From: Stefano Garzarella <sgarzare@...hat.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
Cc: "Michael S. Tsirkin" <mst@...hat.com>,
Jason Wang <jasowang@...hat.com>, Xuan Zhuo <xuanzhuo@...ux.alibaba.com>,
Richard Weinberger <richard@....at>, Anton Ivanov <anton.ivanov@...bridgegreys.com>,
Johannes Berg <johannes@...solutions.net>, Paolo Bonzini <pbonzini@...hat.com>,
Stefan Hajnoczi <stefanha@...hat.com>, Jens Axboe <axboe@...nel.dk>,
Marcel Holtmann <marcel@...tmann.org>, Luiz Augusto von Dentz <luiz.dentz@...il.com>,
Olivia Mackall <olivia@...enic.com>, Herbert Xu <herbert@...dor.apana.org.au>,
Amit Shah <amit@...nel.org>, Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>, Gonglei <arei.gonglei@...wei.com>,
"David S. Miller" <davem@...emloft.net>, Viresh Kumar <vireshk@...nel.org>,
Linus Walleij <linus.walleij@...aro.org>, Bartosz Golaszewski <brgl@...ev.pl>,
David Airlie <airlied@...hat.com>, Gerd Hoffmann <kraxel@...hat.com>,
Gurchetan Singh <gurchetansingh@...omium.org>, Chia-I Wu <olvaffe@...il.com>,
Jean-Philippe Brucker <jean-philippe@...aro.org>, Joerg Roedel <joro@...tes.org>, Alexander Graf <graf@...zon.com>,
Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, Eric Van Hensbergen <ericvh@...nel.org>,
Latchesar Ionkov <lucho@...kov.net>, Dominique Martinet <asmadeus@...ewreck.org>,
Christian Schoenebeck <linux_oss@...debyte.com>, Kalle Valo <kvalo@...nel.org>,
Dan Williams <dan.j.williams@...el.com>, Vishal Verma <vishal.l.verma@...el.com>,
Dave Jiang <dave.jiang@...el.com>, Ira Weiny <ira.weiny@...el.com>,
Pankaj Gupta <pankaj.gupta.linux@...il.com>, Bjorn Andersson <andersson@...nel.org>,
Mathieu Poirier <mathieu.poirier@...aro.org>, "Martin K. Petersen" <martin.petersen@...cle.com>,
Vivek Goyal <vgoyal@...hat.com>, Miklos Szeredi <miklos@...redi.hu>,
Anton Yakovlev <anton.yakovlev@...nsynergy.com>, Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>,
virtualization@...ts.linux.dev, linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-um@...ts.infradead.org, linux-block@...r.kernel.org, linux-bluetooth@...r.kernel.org,
linux-crypto@...r.kernel.org, linux-arm-kernel@...ts.infradead.org, linux-gpio@...r.kernel.org,
dri-devel@...ts.freedesktop.org, iommu@...ts.linux.dev, netdev@...r.kernel.org,
v9fs@...ts.linux.dev, kvm@...r.kernel.org, linux-wireless@...r.kernel.org,
nvdimm@...ts.linux.dev, linux-remoteproc@...r.kernel.org, linux-scsi@...r.kernel.org,
linux-fsdevel@...r.kernel.org, alsa-devel@...a-project.org, linux-sound@...r.kernel.org
Subject: Re: [PATCH 01/22] virtio: store owner from modules with
register_virtio_driver()
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. */
>>> BUG_ON(driver->feature_table_size && !driver->feature_table);
>>> driver->driver.bus = &virtio_bus;
>>> + driver->driver.owner = owner;
>>> +
>>
>> `.driver.name = KBUILD_MODNAME` also seems very common, should we put
>> that in the macro as well?
>
>This is a bit different thing. Every driver is expected to set owner to
>itself (THIS_MODULE), but is every driver name KBUILD_MODNAME?
Nope, IIUC we have 2 exceptions:
- drivers/firmware/arm_scmi/virtio.c
- arch/um/drivers/virt-pci.c
>Remember that this overrides whatever driver actually put there.
They can call __register_virtio_driver() where we can add the `name`
parameter. That said, I don't have a strong opinion, we can leave it
as it is.
Thanks,
Stefano
Powered by blists - more mailing lists