From: Krzysztof Kozlowski <krzk@kernel.org>
To: Amirreza Zarrabi <quic_azarrabi@quicinc.com>,
Jens Wiklander <jens.wiklander@linaro.org>,
Sumit Garg <sumit.garg@linaro.org>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>,
Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: linux-arm-msm@vger.kernel.org, op-tee@lists.trustedfirmware.org,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
linux-doc@vger.kernel.org
Subject: Re: [PATCH 08/10] tee: add Qualcomm TEE driver
Date: Tue, 3 Dec 2024 08:57:57 +0100 [thread overview]
Message-ID: <00e3bd13-eab8-47b0-b577-dfdb3bd5900e@kernel.org> (raw)
In-Reply-To: <20241202-qcom-tee-using-tee-ss-without-mem-obj-v1-8-f502ef01e016@quicinc.com>
On 03/12/2024 05:19, Amirreza Zarrabi wrote:
> +static const struct tee_desc qcom_tee_desc = {
> + .name = "qcom_tee",
> + .ops = &qcom_tee_ops,
> + .owner = THIS_MODULE,
> +};
> +
> +static int qcom_tee_probe(struct platform_device *pdev)
> +{
> + struct tee_device *teedev;
> + int err;
> +
> + if (!qcom_scm_is_available())
> + return -EPROBE_DEFER;
So this is part of SCM? Instantiate it there instead of creating fake
DTS nodes.
> +
> + teedev = tee_device_alloc(&qcom_tee_desc, NULL, NULL, NULL);
> + if (IS_ERR(teedev))
> + return PTR_ERR(teedev);
> +
> + err = tee_device_register(teedev);
> + if (err)
> + goto err_unreg_teedev;
> +
> + platform_set_drvdata(pdev, teedev);
> + return 0;
> +
> +err_unreg_teedev:
> + tee_device_unregister(teedev);
> +
> + return err;
> +}
> +
> +static void qcom_tee_remove(struct platform_device *pdev)
> +{
> + struct tee_device *teedev = platform_get_drvdata(pdev);
> +
> + /* Keep a copy, tee_device_unregister() sets it to NULL. */
> + struct tee_shm_pool *pool = teedev->pool;
> +
> + /* Wait for users to go away. */
> + tee_device_unregister(teedev);
> + tee_shm_pool_free(pool);
> +}
> +
> +static const struct of_device_id qcom_tee_dt_match[] = {
> + { .compatible = "qcom,tee" },
> + {},
> +};
> +MODULE_DEVICE_TABLE(of, qcom_tee_dt_match);
> +
> +static struct platform_driver qcom_tee_platform_driver = {
> + .probe = qcom_tee_probe,
> + .remove = qcom_tee_remove,
> + .driver = {
> + .name = "qcom_tee",
> + .of_match_table = qcom_tee_dt_match,
> + },
> +};
> +
> +int qcom_tee_driver_register(void)
> +{
> + return platform_driver_register(&qcom_tee_platform_driver);
> +}
> +
> +void qcom_tee_driver_unregister(void)
> +{
> + platform_driver_unregister(&qcom_tee_platform_driver);
> +}
Why open-coding typical module platform driver macro?
Best regards,
Krzysztof
next prev parent reply other threads:[~2024-12-03 7:58 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-03 4:19 [PATCH 00/10] Trusted Execution Environment (TEE) driver for Qualcomm TEE (QTEE) Amirreza Zarrabi
2024-12-03 4:19 ` [PATCH 01/10] tee: allow a driver to allocate a tee_device without a pool Amirreza Zarrabi
2024-12-03 4:19 ` [PATCH 02/10] tee: add TEE_IOCTL_PARAM_ATTR_TYPE_MEMBUF Amirreza Zarrabi
2024-12-03 8:01 ` kernel test robot
2024-12-09 15:46 ` Jens Wiklander
2024-12-09 23:00 ` Amirreza Zarrabi
2024-12-03 4:19 ` [PATCH 03/10] tee: add TEE_IOCTL_PARAM_ATTR_TYPE_OBJREF Amirreza Zarrabi
2024-12-03 4:19 ` [PATCH 04/10] firmware: qcom: scm: add support for object invocation Amirreza Zarrabi
2024-12-03 4:19 ` [PATCH 05/10] qcomtee: implement object invoke support Amirreza Zarrabi
2024-12-09 18:43 ` Jens Wiklander
2024-12-10 21:42 ` Amirreza Zarrabi
2024-12-10 10:24 ` Jens Wiklander
2024-12-10 21:44 ` Amirreza Zarrabi
2024-12-03 4:19 ` [PATCH 06/10] qcomtee: add primordial object Amirreza Zarrabi
2024-12-03 4:19 ` [PATCH 07/10] dt-bindings: arm: qcomtee: add QTEE driver devicetree binding for TEE subsystem Amirreza Zarrabi
2024-12-03 7:55 ` Krzysztof Kozlowski
2024-12-03 4:19 ` [PATCH 08/10] tee: add Qualcomm TEE driver Amirreza Zarrabi
2024-12-03 7:57 ` Krzysztof Kozlowski [this message]
2024-12-10 11:58 ` Jens Wiklander
2024-12-11 2:30 ` Amirreza Zarrabi
2024-12-11 14:04 ` Jens Wiklander
2024-12-12 0:19 ` Amirreza Zarrabi
2024-12-12 7:07 ` Jens Wiklander
2024-12-03 4:19 ` [PATCH 09/10] arm64: dts: qcom: sm8650: add support for QTEE Amirreza Zarrabi
2024-12-03 7:59 ` Krzysztof Kozlowski
2024-12-04 1:00 ` Amirreza Zarrabi
2024-12-03 4:19 ` [PATCH 10/10] Documentation: tee: Add Qualcomm TEE driver Amirreza Zarrabi
2024-12-03 7:58 ` Krzysztof Kozlowski
2024-12-03 6:06 ` [PATCH 00/10] Trusted Execution Environment (TEE) driver for Qualcomm TEE (QTEE) Trilok Soni
2024-12-03 22:13 ` Amirreza Zarrabi
2024-12-03 23:43 ` Dmitry Baryshkov
2024-12-04 0:45 ` Amirreza Zarrabi
2024-12-18 14:25 ` Sumit Garg
2024-12-18 19:20 ` Amirreza Zarrabi
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=00e3bd13-eab8-47b0-b577-dfdb3bd5900e@kernel.org \
--to=krzk@kernel.org \
--cc=andersson@kernel.org \
--cc=bartosz.golaszewski@linaro.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jens.wiklander@linaro.org \
--cc=konradybcio@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=op-tee@lists.trustedfirmware.org \
--cc=quic_azarrabi@quicinc.com \
--cc=robh@kernel.org \
--cc=srinivas.kandagatla@linaro.org \
--cc=sumit.garg@linaro.org \
/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).