summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAurora pro automerger <aurora-pro-automerger@google.com>2022-05-25 17:46:04 +0000
committerSermin Aydin <sermin@google.com>2022-05-28 18:29:50 +0000
commitb16f2fa6d4a747b68c8eab8fefb4dd94537d5426 (patch)
tree07970abc5a3c639a8afb4eaf5fa0dbf65b1bf6f4
parentf74aa638e06c1edcb7c8c295c03d2f7b9b6f604d (diff)
downloadgs201-b16f2fa6d4a747b68c8eab8fefb4dd94537d5426.tar.gz
[Copybara Auto Merge] Merge branch 'gs201-release' into 'android13-gs-pixel-5.10-tm-d1'
Release info: 234196446 gxp: add tgid to client tracking and suspend block reporting Bug: 233584605 GitOrigin-RevId: c65eb571e8a8dfd0ad10ee9942354b1eeb699d34 Change-Id: I4f7ca25d0ba05954ef43a1b3b6592264c06749ca
-rw-r--r--gxp-client.h4
-rw-r--r--gxp-platform.c7
-rw-r--r--gxp-wakelock.c8
3 files changed, 13 insertions, 6 deletions
diff --git a/gxp-client.h b/gxp-client.h
index c3dacf3..fee0b9b 100644
--- a/gxp-client.h
+++ b/gxp-client.h
@@ -8,6 +8,7 @@
#define __GXP_CLIENT_H__
#include <linux/rwsem.h>
+#include <linux/sched.h>
#include <linux/types.h>
#include "gxp-internal.h"
@@ -40,6 +41,9 @@ struct gxp_client {
struct gxp_eventfd *mb_eventfds[GXP_NUM_CORES];
+ /* client process thread group ID is really the main process ID. */
+ pid_t tgid;
+ /* client process ID is really the thread ID, may be transient. */
pid_t pid;
};
diff --git a/gxp-platform.c b/gxp-platform.c
index 36ae93d..46fb5bb 100644
--- a/gxp-platform.c
+++ b/gxp-platform.c
@@ -22,6 +22,7 @@
#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
+#include <linux/sched.h>
#include <linux/uaccess.h>
#include <linux/uidgid.h>
#if (IS_ENABLED(CONFIG_GXP_TEST) || IS_ENABLED(CONFIG_ANDROID)) && !IS_ENABLED(CONFIG_GXP_GEM5)
@@ -159,6 +160,7 @@ static int gxp_open(struct inode *inode, struct file *file)
if (IS_ERR(client))
return PTR_ERR(client);
+ client->tgid = current->tgid;
client->pid = current->pid;
file->private_data = client;
@@ -1277,9 +1279,10 @@ static int gxp_acquire_wake_lock_compat(
client->has_block_wakelock = true;
/*
- * Update client's PID in case the process that opened /dev/gxp
- * is not the one that called this IOCTL.
+ * Update client's TGID/PID in case the process that opened
+ * /dev/gxp is not the one that called this IOCTL.
*/
+ client->tgid = current->tgid;
client->pid = current->pid;
}
diff --git a/gxp-wakelock.c b/gxp-wakelock.c
index 7f0d392..9110a3d 100644
--- a/gxp-wakelock.c
+++ b/gxp-wakelock.c
@@ -118,16 +118,16 @@ int gxp_wakelock_suspend(struct gxp_dev *gxp)
if (!down_read_trylock(&client->semaphore)) {
dev_warn_ratelimited(
gxp->dev,
- "Unable to acquire client lock (pid=%d)\n",
- client->pid);
+ "Unable to acquire client lock (tgid=%d pid=%d)\n",
+ client->tgid, client->pid);
continue;
}
if (client->has_block_wakelock)
dev_warn_ratelimited(
gxp->dev,
- "Cannot suspend with client holding wakelock (pid=%d)\n",
- client->pid);
+ "Cannot suspend with client holding wakelock (tgid=%d pid=%d)\n",
+ client->tgid, client->pid);
up_read(&client->semaphore);
}