[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7b79d4b5-ba91-41a0-90d1-c64bcab53cec@kernel.org>
Date: Wed, 11 Dec 2024 09:44:13 +0100
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Liju-clr Chen <liju-clr.chen@...iatek.com>, Rob Herring
<robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, Jonathan Corbet <corbet@....net>,
Catalin Marinas <catalin.marinas@....com>, Will Deacon <will@...nel.org>,
Steven Rostedt <rostedt@...dmis.org>, Masami Hiramatsu
<mhiramat@...nel.org>, Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Richard Cochran <richardcochran@...il.com>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
Yingshiuan Pan <Yingshiuan.Pan@...iatek.com>,
Ze-yu Wang <Ze-yu.Wang@...iatek.com>
Cc: devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-doc@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-trace-kernel@...r.kernel.org, netdev@...r.kernel.org,
linux-mediatek@...ts.infradead.org, Shawn Hsiao <shawn.hsiao@...iatek.com>,
PeiLun Suei <PeiLun.Suei@...iatek.com>,
Chi-shen Yeh <Chi-shen.Yeh@...iatek.com>,
Kevenny Hsieh <Kevenny.Hsieh@...iatek.com>
Subject: Re: [PATCH v13 04/25] virt: geniezone: Add GenieZone hypervisor
driver
On 14/11/2024 11:07, Liju-clr Chen wrote:
> +
> +static int gzvm_dev_open(struct inode *inode, struct file *file)
> +{
> + /*
> + * Reference count to prevent this module is unload without destroying
> + * VM
So you re-implemented suppress-bind attrs... no, drop.
> + */
> + try_module_get(THIS_MODULE);
> + return 0;
> +}
> +
> +static int gzvm_dev_release(struct inode *inode, struct file *file)
> +{
> + module_put(THIS_MODULE);
> + return 0;
> +}
> +
> +static const struct file_operations gzvm_chardev_ops = {
> + .llseek = noop_llseek,
> + .open = gzvm_dev_open,
> + .release = gzvm_dev_release,
> +};
> +
> +static struct miscdevice gzvm_dev = {
> + .minor = MISC_DYNAMIC_MINOR,
> + .name = KBUILD_MODNAME,
> + .fops = &gzvm_chardev_ops,
> +};
> +
> +static int gzvm_drv_probe(struct platform_device *pdev)
> +{
> + if (gzvm_arch_probe(gzvm_drv.drv_version, &gzvm_drv.hyp_version) != 0) {
> + dev_err(&pdev->dev, "Not found available conduit\n");
So you can autodetect your hypervisor? Why your soc info drivers cannot
instantiate this device thus removing any need for fake DT node (fake
because no resources and used only to satisfy Linux driver instantiation)?
> + return -ENODEV;
> + }
> +
> + pr_debug("Found GenieZone hypervisor version %u.%u.%llu\n",
> + gzvm_drv.hyp_version.major, gzvm_drv.hyp_version.minor,
> + gzvm_drv.hyp_version.sub);
> +
> + return misc_register(&gzvm_dev);
> +}
> +
> +static void gzvm_drv_remove(struct platform_device *pdev)
> +{
> + misc_deregister(&gzvm_dev);
> +}
> +
> +static const struct of_device_id gzvm_of_match[] = {
> + { .compatible = "mediatek,geniezone" },
> + {/* sentinel */},
> +};
> +
> +static struct platform_driver gzvm_driver = {
> + .probe = gzvm_drv_probe,
> + .remove = gzvm_drv_remove,
> + .driver = {
> + .name = KBUILD_MODNAME,
> + .of_match_table = gzvm_of_match,
> + },
> +};
> +
> +module_platform_driver(gzvm_driver);
> +
> +MODULE_DEVICE_TABLE(of, gzvm_of_match);
This is immediately after next to ID table. Never in different place, so
I wonder from which obscure code did you copy it and what other issues
like that we can find...
> +MODULE_AUTHOR("MediaTek");
> +MODULE_DESCRIPTION("GenieZone interface for VMM");
> +MODULE_LICENSE("GPL");
Best regards,
Krzysztof
Powered by blists - more mailing lists