From: Allen Pais <hidden> Date: 2021-02-17 09:28:51
From: Allen Pais <redacted>
On Wed, 17 Feb 2021 14:57:12 +0530, Allen Pais wrote:
- /*
- * Ask OP-TEE to free all cached shared memory objects to decrease
- * reference counters and also avoid wild pointers in secure world
- * into the old shared memory range.
- */
- optee_disable_shm_cache(optee);
+ if (shutdown) {
+ optee_disable_shm_cache(optee);
+ } else {
+ /*
+ * Ask OP-TEE to free all cached shared memory
+ * objects to decrease reference counters and
+ * also avoid wild pointers in secure world
+ * into the old shared memory range.
+ */
+ optee_disable_shm_cache(optee);
Calling optee_disable_shm_cache() in both if and else. It could be
put in front of if().
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Allen Pais <hidden> Date: 2021-02-22 13:50:53
On Wed, 17 Feb 2021 14:57:12 +0530, Allen Pais wrote:
quoted
- /*
- * Ask OP-TEE to free all cached shared memory objects to decrease
- * reference counters and also avoid wild pointers in secure world
- * into the old shared memory range.
- */
- optee_disable_shm_cache(optee);
+ if (shutdown) {
+ optee_disable_shm_cache(optee);
+ } else {
+ /*
+ * Ask OP-TEE to free all cached shared memory
+ * objects to decrease reference counters and
+ * also avoid wild pointers in secure world
+ * into the old shared memory range.
+ */
+ optee_disable_shm_cache(optee);
Calling optee_disable_shm_cache() in both if and else. It could be
put in front of if().
Ideally, I could just use optee_remove for shutdown() too.
But it would not look good. Hence this approach.
- Allen
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
On Mon, Feb 22, 2021 at 06:15:08PM +0530, Allen Pais wrote:
quoted
On Wed, 17 Feb 2021 14:57:12 +0530, Allen Pais wrote:
quoted
- /*
- * Ask OP-TEE to free all cached shared memory objects to decrease
- * reference counters and also avoid wild pointers in secure world
- * into the old shared memory range.
- */
- optee_disable_shm_cache(optee);
+ if (shutdown) {
+ optee_disable_shm_cache(optee);
+ } else {
+ /*
+ * Ask OP-TEE to free all cached shared memory
+ * objects to decrease reference counters and
+ * also avoid wild pointers in secure world
+ * into the old shared memory range.
+ */
+ optee_disable_shm_cache(optee);
Calling optee_disable_shm_cache() in both if and else. It could be
put in front of if().
Ideally, I could just use optee_remove for shutdown() too.
But it would not look good. Hence this approach.
What is the problem with using optee_remove() for shutdown()?
Cheers,
Jens
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Allen Pais <hidden> Date: 2021-02-23 16:27:10
quoted
quoted
quoted
- /*
- * Ask OP-TEE to free all cached shared memory objects to decrease
- * reference counters and also avoid wild pointers in secure world
- * into the old shared memory range.
- */
- optee_disable_shm_cache(optee);
+ if (shutdown) {
+ optee_disable_shm_cache(optee);
+ } else {
+ /*
+ * Ask OP-TEE to free all cached shared memory
+ * objects to decrease reference counters and
+ * also avoid wild pointers in secure world
+ * into the old shared memory range.
+ */
+ optee_disable_shm_cache(optee);
Calling optee_disable_shm_cache() in both if and else. It could be
put in front of if().
Ideally, I could just use optee_remove for shutdown() too.
But it would not look good. Hence this approach.
What is the problem with using optee_remove() for shutdown()?
There is no problem, I just thought it would be more cleaner/readable
with this approach. If you'd like to keep it simple by just calling
optee_remove() for shutdown() too, I could quickly send out V2.
Thanks for the review.
- Allen
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
On Tue, Feb 23, 2021 at 09:56:13PM +0530, Allen Pais wrote:
quoted
quoted
quoted
quoted
- /*
- * Ask OP-TEE to free all cached shared memory objects to decrease
- * reference counters and also avoid wild pointers in secure world
- * into the old shared memory range.
- */
- optee_disable_shm_cache(optee);
+ if (shutdown) {
+ optee_disable_shm_cache(optee);
+ } else {
+ /*
+ * Ask OP-TEE to free all cached shared memory
+ * objects to decrease reference counters and
+ * also avoid wild pointers in secure world
+ * into the old shared memory range.
+ */
+ optee_disable_shm_cache(optee);
Calling optee_disable_shm_cache() in both if and else. It could be
put in front of if().
Ideally, I could just use optee_remove for shutdown() too.
But it would not look good. Hence this approach.
What is the problem with using optee_remove() for shutdown()?
There is no problem, I just thought it would be more cleaner/readable
with this approach. If you'd like to keep it simple by just calling
optee_remove() for shutdown() too, I could quickly send out V2.
In the patch you posted it looks like you'd like to call
only optee_disable_shm_cache() in the case of shutdown. Like:
static void optee_shutdown(struct platform_device *pdev)
{
optee_disable_shm_cache(platform_get_drvdata(pdev));
}
and optee_remove() kept as it was before this patch.
Cheers,
Jens
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Allen Pais <hidden> Date: 2021-02-24 16:56:07
quoted
quoted
quoted
quoted
quoted
- /*
- * Ask OP-TEE to free all cached shared memory objects to decrease
- * reference counters and also avoid wild pointers in secure world
- * into the old shared memory range.
- */
- optee_disable_shm_cache(optee);
+ if (shutdown) {
+ optee_disable_shm_cache(optee);
+ } else {
+ /*
+ * Ask OP-TEE to free all cached shared memory
+ * objects to decrease reference counters and
+ * also avoid wild pointers in secure world
+ * into the old shared memory range.
+ */
+ optee_disable_shm_cache(optee);
Calling optee_disable_shm_cache() in both if and else. It could be
put in front of if().
Ideally, I could just use optee_remove for shutdown() too.
But it would not look good. Hence this approach.
What is the problem with using optee_remove() for shutdown()?
There is no problem, I just thought it would be more cleaner/readable
with this approach. If you'd like to keep it simple by just calling
optee_remove() for shutdown() too, I could quickly send out V2.
In the patch you posted it looks like you'd like to call
only optee_disable_shm_cache() in the case of shutdown. Like:
static void optee_shutdown(struct platform_device *pdev)
{
optee_disable_shm_cache(platform_get_drvdata(pdev));
}
and optee_remove() kept as it was before this patch.