* [PATCH 01/22] staging: vc04_services: Remove unused variables in struct vchiq_arm_state
2020-01-24 14:45 [PATCH 00/22] staging: vc04_services: suspend/resume cleanup Nicolas Saenz Julienne
@ 2020-01-24 14:45 ` Nicolas Saenz Julienne
2020-01-24 14:45 ` [PATCH 02/22] staging: vc04_services: Get rid of resume_blocked " Nicolas Saenz Julienne
` (20 subsequent siblings)
21 siblings, 0 replies; 26+ messages in thread
From: Nicolas Saenz Julienne @ 2020-01-24 14:45 UTC (permalink / raw)
To: gregkh, linux-kernel
Cc: Nicolas Saenz Julienne, bcm-kernel-feedback-list,
linux-rpi-kernel, linux-arm-kernel, devel
There are not being used, so we're better off without them.
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
---
.../vc04_services/interface/vchiq_arm/vchiq_arm.h | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
index 19d2a2eefb6a..f0044289b6bc 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
@@ -53,8 +53,6 @@ struct vchiq_arm_state {
enum vc_suspend_status vc_suspend_state;
enum vc_resume_status vc_resume_state;
- unsigned int wake_address;
-
struct vchiq_state *state;
struct timer_list suspend_timer;
int suspend_timer_timeout;
@@ -80,19 +78,11 @@ struct vchiq_arm_state {
struct completion blocked_blocker;
int blocked_count;
- int autosuspend_override;
-
/* Flag to indicate that the first vchiq connect has made it through.
** This means that both sides should be fully ready, and we should
** be able to suspend after this point.
*/
int first_connect;
-
- unsigned long long suspend_start_time;
- unsigned long long sleep_start_time;
- unsigned long long resume_start_time;
- unsigned long long last_wake_time;
-
};
struct vchiq_drvdata {
--
2.25.0
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 02/22] staging: vc04_services: Get rid of resume_blocked in struct vchiq_arm_state
2020-01-24 14:45 [PATCH 00/22] staging: vc04_services: suspend/resume cleanup Nicolas Saenz Julienne
2020-01-24 14:45 ` [PATCH 01/22] staging: vc04_services: Remove unused variables in struct vchiq_arm_state Nicolas Saenz Julienne
@ 2020-01-24 14:45 ` Nicolas Saenz Julienne
2020-01-24 14:45 ` [PATCH 03/22] staging: vc04_services: Get rid of resume_blocker completion " Nicolas Saenz Julienne
` (19 subsequent siblings)
21 siblings, 0 replies; 26+ messages in thread
From: Nicolas Saenz Julienne @ 2020-01-24 14:45 UTC (permalink / raw)
To: gregkh, linux-kernel
Cc: Nicolas Saenz Julienne, bcm-kernel-feedback-list,
linux-rpi-kernel, linux-arm-kernel, devel
The boolean value is never set to true, hence remove it and all the code that
depends on it.
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
---
.../interface/vchiq_arm/vchiq_arm.c | 51 +------------------
.../interface/vchiq_arm/vchiq_arm.h | 1 -
2 files changed, 2 insertions(+), 50 deletions(-)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
index 4458c1e60fa3..af4dc23f5510 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
@@ -2270,10 +2270,7 @@ vchiq_videocore_wanted(struct vchiq_state *state)
return 1;
else if (!arm_state->videocore_use_count)
/* usage count zero - check for override unless we're forcing */
- if (arm_state->resume_blocked)
- return 0;
- else
- return vchiq_platform_videocore_wanted(state);
+ return vchiq_platform_videocore_wanted(state);
else
/* non-zero usage count - videocore still required */
return 1;
@@ -2567,7 +2564,6 @@ static inline void
unblock_resume(struct vchiq_arm_state *arm_state)
{
complete_all(&arm_state->resume_blocker);
- arm_state->resume_blocked = 0;
}
/* Initiate suspend via slot handler. Should be called with the write lock
@@ -2724,46 +2720,6 @@ vchiq_use_internal(struct vchiq_state *state, struct vchiq_service *service,
}
write_lock_bh(&arm_state->susp_res_lock);
- while (arm_state->resume_blocked) {
- /* If we call 'use' while force suspend is waiting for suspend,
- * then we're about to block the thread which the force is
- * waiting to complete, so we're bound to just time out. In this
- * case, set the suspend state such that the wait will be
- * canceled, so we can complete as quickly as possible. */
- if (arm_state->resume_blocked && arm_state->vc_suspend_state ==
- VC_SUSPEND_IDLE) {
- set_suspend_state(arm_state, VC_SUSPEND_FORCE_CANCELED);
- break;
- }
- /* If suspend is already in progress then we need to block */
- if (!try_wait_for_completion(&arm_state->resume_blocker)) {
- /* Indicate that there are threads waiting on the resume
- * blocker. These need to be allowed to complete before
- * a _second_ call to force suspend can complete,
- * otherwise low priority threads might never actually
- * continue */
- arm_state->blocked_count++;
- write_unlock_bh(&arm_state->susp_res_lock);
- vchiq_log_info(vchiq_susp_log_level, "%s %s resume "
- "blocked - waiting...", __func__, entity);
- if (wait_for_completion_killable(
- &arm_state->resume_blocker)) {
- vchiq_log_error(vchiq_susp_log_level, "%s %s "
- "wait for resume blocker interrupted",
- __func__, entity);
- ret = VCHIQ_ERROR;
- write_lock_bh(&arm_state->susp_res_lock);
- arm_state->blocked_count--;
- write_unlock_bh(&arm_state->susp_res_lock);
- goto out;
- }
- vchiq_log_info(vchiq_susp_log_level, "%s %s resume "
- "unblocked", __func__, entity);
- write_lock_bh(&arm_state->susp_res_lock);
- if (--arm_state->blocked_count == 0)
- complete_all(&arm_state->blocked_blocker);
- }
- }
stop_suspend_timer(arm_state);
@@ -2861,10 +2817,7 @@ vchiq_release_internal(struct vchiq_state *state, struct vchiq_service *service)
--(*entity_uc);
if (!vchiq_videocore_wanted(state)) {
- if (vchiq_platform_use_suspend_timer() &&
- !arm_state->resume_blocked) {
- /* Only use the timer if we're not trying to force
- * suspend (=> resume_blocked) */
+ if (vchiq_platform_use_suspend_timer()) {
start_suspend_timer(arm_state);
} else {
vchiq_log_info(vchiq_susp_log_level,
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
index f0044289b6bc..c904f7be9084 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
@@ -74,7 +74,6 @@ struct vchiq_arm_state {
** ARM is suspending
*/
struct completion resume_blocker;
- int resume_blocked;
struct completion blocked_blocker;
int blocked_count;
--
2.25.0
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 03/22] staging: vc04_services: Get rid of resume_blocker completion in struct vchiq_arm_state
2020-01-24 14:45 [PATCH 00/22] staging: vc04_services: suspend/resume cleanup Nicolas Saenz Julienne
2020-01-24 14:45 ` [PATCH 01/22] staging: vc04_services: Remove unused variables in struct vchiq_arm_state Nicolas Saenz Julienne
2020-01-24 14:45 ` [PATCH 02/22] staging: vc04_services: Get rid of resume_blocked " Nicolas Saenz Julienne
@ 2020-01-24 14:45 ` Nicolas Saenz Julienne
2020-01-24 14:45 ` [PATCH 04/22] staging: vc04_services: get rid of blocked_blocker " Nicolas Saenz Julienne
` (18 subsequent siblings)
21 siblings, 0 replies; 26+ messages in thread
From: Nicolas Saenz Julienne @ 2020-01-24 14:45 UTC (permalink / raw)
To: gregkh, linux-kernel
Cc: Nicolas Saenz Julienne, bcm-kernel-feedback-list,
linux-rpi-kernel, linux-arm-kernel, devel
Nobody is waiting on it, so delete all relevant code.
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
---
.../vc04_services/interface/vchiq_arm/vchiq_arm.c | 11 -----------
.../vc04_services/interface/vchiq_arm/vchiq_arm.h | 4 ----
2 files changed, 15 deletions(-)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
index af4dc23f5510..311df3d85494 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
@@ -2386,11 +2386,6 @@ vchiq_arm_init_state(struct vchiq_state *state,
* completion while videocore is suspended. */
set_resume_state(arm_state, VC_RESUME_RESUMED);
- init_completion(&arm_state->resume_blocker);
- /* Initialise to 'done' state. We only want to block on this
- * completion while resume is blocked */
- complete_all(&arm_state->resume_blocker);
-
init_completion(&arm_state->blocked_blocker);
/* Initialise to 'done' state. We only want to block on this
* completion while things are waiting on the resume blocker */
@@ -2560,12 +2555,6 @@ need_resume(struct vchiq_state *state)
vchiq_videocore_wanted(state);
}
-static inline void
-unblock_resume(struct vchiq_arm_state *arm_state)
-{
- complete_all(&arm_state->resume_blocker);
-}
-
/* Initiate suspend via slot handler. Should be called with the write lock
* held */
enum vchiq_status
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
index c904f7be9084..7d1316875343 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
@@ -70,10 +70,6 @@ struct vchiq_arm_state {
*/
int peer_use_count;
- /* Flag to indicate whether resume is blocked. This happens when the
- ** ARM is suspending
- */
- struct completion resume_blocker;
struct completion blocked_blocker;
int blocked_count;
--
2.25.0
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 04/22] staging: vc04_services: get rid of blocked_blocker completion in struct vchiq_arm_state
2020-01-24 14:45 [PATCH 00/22] staging: vc04_services: suspend/resume cleanup Nicolas Saenz Julienne
` (2 preceding siblings ...)
2020-01-24 14:45 ` [PATCH 03/22] staging: vc04_services: Get rid of resume_blocker completion " Nicolas Saenz Julienne
@ 2020-01-24 14:45 ` Nicolas Saenz Julienne
2020-01-24 14:45 ` [PATCH 05/22] staging: vc04_services: Delete blocked_count " Nicolas Saenz Julienne
` (17 subsequent siblings)
21 siblings, 0 replies; 26+ messages in thread
From: Nicolas Saenz Julienne @ 2020-01-24 14:45 UTC (permalink / raw)
To: gregkh, linux-kernel
Cc: Nicolas Saenz Julienne, bcm-kernel-feedback-list,
linux-rpi-kernel, linux-arm-kernel, devel
Nobody is waiting on it, so delete it.
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
---
.../staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 5 -----
.../staging/vc04_services/interface/vchiq_arm/vchiq_arm.h | 1 -
2 files changed, 6 deletions(-)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
index 311df3d85494..9264bb5d0bbe 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
@@ -2386,11 +2386,6 @@ vchiq_arm_init_state(struct vchiq_state *state,
* completion while videocore is suspended. */
set_resume_state(arm_state, VC_RESUME_RESUMED);
- init_completion(&arm_state->blocked_blocker);
- /* Initialise to 'done' state. We only want to block on this
- * completion while things are waiting on the resume blocker */
- complete_all(&arm_state->blocked_blocker);
-
arm_state->suspend_timer_timeout = SUSPEND_TIMER_TIMEOUT_MS;
arm_state->suspend_timer_running = 0;
arm_state->state = state;
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
index 7d1316875343..6bab241313b8 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
@@ -70,7 +70,6 @@ struct vchiq_arm_state {
*/
int peer_use_count;
- struct completion blocked_blocker;
int blocked_count;
/* Flag to indicate that the first vchiq connect has made it through.
--
2.25.0
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 05/22] staging: vc04_services: Delete blocked_count in struct vchiq_arm_state
2020-01-24 14:45 [PATCH 00/22] staging: vc04_services: suspend/resume cleanup Nicolas Saenz Julienne
` (3 preceding siblings ...)
2020-01-24 14:45 ` [PATCH 04/22] staging: vc04_services: get rid of blocked_blocker " Nicolas Saenz Julienne
@ 2020-01-24 14:45 ` Nicolas Saenz Julienne
2020-01-24 14:46 ` [PATCH 06/22] staging: vc04_services: get rid of vchiq_platform_use_suspend_timer() Nicolas Saenz Julienne
` (16 subsequent siblings)
21 siblings, 0 replies; 26+ messages in thread
From: Nicolas Saenz Julienne @ 2020-01-24 14:45 UTC (permalink / raw)
To: gregkh, linux-kernel
Cc: Nicolas Saenz Julienne, bcm-kernel-feedback-list,
linux-rpi-kernel, linux-arm-kernel, devel
The variable is always 0. So delete it an all the code conditional to
it.
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
---
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 2 --
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h | 2 --
2 files changed, 4 deletions(-)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
index 9264bb5d0bbe..4545df573c90 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
@@ -2266,8 +2266,6 @@ vchiq_videocore_wanted(struct vchiq_state *state)
if (!arm_state)
/* autosuspend not supported - always return wanted */
return 1;
- else if (arm_state->blocked_count)
- return 1;
else if (!arm_state->videocore_use_count)
/* usage count zero - check for override unless we're forcing */
return vchiq_platform_videocore_wanted(state);
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
index 6bab241313b8..35889a65b17f 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
@@ -70,8 +70,6 @@ struct vchiq_arm_state {
*/
int peer_use_count;
- int blocked_count;
-
/* Flag to indicate that the first vchiq connect has made it through.
** This means that both sides should be fully ready, and we should
** be able to suspend after this point.
--
2.25.0
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 06/22] staging: vc04_services: get rid of vchiq_platform_use_suspend_timer()
2020-01-24 14:45 [PATCH 00/22] staging: vc04_services: suspend/resume cleanup Nicolas Saenz Julienne
` (4 preceding siblings ...)
2020-01-24 14:45 ` [PATCH 05/22] staging: vc04_services: Delete blocked_count " Nicolas Saenz Julienne
@ 2020-01-24 14:46 ` Nicolas Saenz Julienne
2020-01-26 20:11 ` kbuild test robot
` (2 more replies)
2020-01-24 14:46 ` [PATCH 07/22] staging: vc04_services: Get rid of vchiq_platform_paused/resumed() Nicolas Saenz Julienne
` (15 subsequent siblings)
21 siblings, 3 replies; 26+ messages in thread
From: Nicolas Saenz Julienne @ 2020-01-24 14:46 UTC (permalink / raw)
To: gregkh, linux-kernel
Cc: Nicolas Saenz Julienne, bcm-kernel-feedback-list,
linux-rpi-kernel, linux-arm-kernel, devel
The function always returns 0, delete the function and all code
conditional to it.
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
---
.../interface/vchiq_arm/vchiq_2835_arm.c | 11 ---
.../interface/vchiq_arm/vchiq_arm.c | 84 ++-----------------
.../interface/vchiq_arm/vchiq_arm.h | 16 +---
3 files changed, 7 insertions(+), 104 deletions(-)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
index ca30bfd52919..1ffb2aea947c 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
@@ -284,17 +284,6 @@ vchiq_platform_videocore_wanted(struct vchiq_state *state)
{
return 1; // autosuspend not supported - videocore always wanted
}
-
-int
-vchiq_platform_use_suspend_timer(void)
-{
- return 0;
-}
-void
-vchiq_dump_platform_use_state(struct vchiq_state *state)
-{
- vchiq_log_info(vchiq_arm_log_level, "Suspend timer not in use");
-}
void
vchiq_platform_handle_timeout(struct vchiq_state *state)
{
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
index 4545df573c90..a75d5092cc73 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
@@ -48,9 +48,6 @@
int vchiq_arm_log_level = VCHIQ_LOG_DEFAULT;
int vchiq_susp_log_level = VCHIQ_LOG_ERROR;
-#define SUSPEND_TIMER_TIMEOUT_MS 100
-#define SUSPEND_RETRY_TIMER_TIMEOUT_MS 1000
-
#define VC_SUSPEND_NUM_OFFSET 3 /* number of values before idle which are -ve */
static const char *const suspend_state_names[] = {
"VC_SUSPEND_FORCE_CANCELED",
@@ -79,8 +76,6 @@ static const char *const resume_state_names[] = {
* requested */
#define FORCE_SUSPEND_TIMEOUT_MS 200
-static void suspend_timer_callback(struct timer_list *t);
-
struct user_service {
struct vchiq_service *service;
void *userdata;
@@ -2384,12 +2379,7 @@ vchiq_arm_init_state(struct vchiq_state *state,
* completion while videocore is suspended. */
set_resume_state(arm_state, VC_RESUME_RESUMED);
- arm_state->suspend_timer_timeout = SUSPEND_TIMER_TIMEOUT_MS;
- arm_state->suspend_timer_running = 0;
arm_state->state = state;
- timer_setup(&arm_state->suspend_timer, suspend_timer_callback,
- 0);
-
arm_state->first_connect = 0;
}
@@ -2517,27 +2507,6 @@ set_resume_state(struct vchiq_arm_state *arm_state,
}
}
-/* should be called with the write lock held */
-inline void
-start_suspend_timer(struct vchiq_arm_state *arm_state)
-{
- del_timer(&arm_state->suspend_timer);
- arm_state->suspend_timer.expires = jiffies +
- msecs_to_jiffies(arm_state->suspend_timer_timeout);
- add_timer(&arm_state->suspend_timer);
- arm_state->suspend_timer_running = 1;
-}
-
-/* should be called with the write lock held */
-static inline void
-stop_suspend_timer(struct vchiq_arm_state *arm_state)
-{
- if (arm_state->suspend_timer_running) {
- del_timer(&arm_state->suspend_timer);
- arm_state->suspend_timer_running = 0;
- }
-}
-
static inline int
need_resume(struct vchiq_state *state)
{
@@ -2626,28 +2595,6 @@ vchiq_platform_check_suspend(struct vchiq_state *state)
return;
}
-void
-vchiq_check_suspend(struct vchiq_state *state)
-{
- struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state);
-
- if (!arm_state)
- goto out;
-
- vchiq_log_trace(vchiq_susp_log_level, "%s", __func__);
-
- write_lock_bh(&arm_state->susp_res_lock);
- if (arm_state->vc_suspend_state != VC_SUSPEND_SUSPENDED &&
- arm_state->first_connect &&
- !vchiq_videocore_wanted(state)) {
- vchiq_arm_vcsuspend(state);
- }
- write_unlock_bh(&arm_state->susp_res_lock);
-
-out:
- vchiq_log_trace(vchiq_susp_log_level, "%s exit", __func__);
-}
-
/* This function should be called with the write lock held */
int
vchiq_check_resume(struct vchiq_state *state)
@@ -2702,9 +2649,6 @@ vchiq_use_internal(struct vchiq_state *state, struct vchiq_service *service,
}
write_lock_bh(&arm_state->susp_res_lock);
-
- stop_suspend_timer(arm_state);
-
local_uc = ++arm_state->videocore_use_count;
local_entity_uc = ++(*entity_uc);
@@ -2799,15 +2743,11 @@ vchiq_release_internal(struct vchiq_state *state, struct vchiq_service *service)
--(*entity_uc);
if (!vchiq_videocore_wanted(state)) {
- if (vchiq_platform_use_suspend_timer()) {
- start_suspend_timer(arm_state);
- } else {
- vchiq_log_info(vchiq_susp_log_level,
- "%s %s count %d, state count %d - suspending",
- __func__, entity, *entity_uc,
- arm_state->videocore_use_count);
- vchiq_arm_vcsuspend(state);
- }
+ vchiq_log_info(vchiq_susp_log_level,
+ "%s %s count %d, state count %d - suspending",
+ __func__, entity, *entity_uc,
+ arm_state->videocore_use_count);
+ vchiq_arm_vcsuspend(state);
} else
vchiq_log_trace(vchiq_susp_log_level,
"%s %s count %d, state count %d",
@@ -2902,17 +2842,6 @@ vchiq_instance_set_trace(struct vchiq_instance *instance, int trace)
instance->trace = (trace != 0);
}
-static void suspend_timer_callback(struct timer_list *t)
-{
- struct vchiq_arm_state *arm_state =
- from_timer(arm_state, t, suspend_timer);
- struct vchiq_state *state = arm_state->state;
-
- vchiq_log_info(vchiq_susp_log_level,
- "%s - suspend timer expired - check suspend", __func__);
- vchiq_check_suspend(state);
-}
-
enum vchiq_status
vchiq_use_service(unsigned int handle)
{
@@ -3028,8 +2957,6 @@ vchiq_dump_service_use_state(struct vchiq_state *state)
"--- Overall vchiq instance use count %d", vc_use_count);
kfree(service_data);
-
- vchiq_dump_platform_use_state(state);
}
enum vchiq_status
@@ -3059,7 +2986,6 @@ vchiq_check_service(struct vchiq_service *service)
arm_state->videocore_use_count,
suspend_state_names[arm_state->vc_suspend_state +
VC_SUSPEND_NUM_OFFSET]);
- vchiq_dump_service_use_state(service->state);
}
out:
return ret;
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
index 35889a65b17f..6daeb3e4f4b1 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
@@ -54,9 +54,6 @@ struct vchiq_arm_state {
enum vc_resume_status vc_resume_state;
struct vchiq_state *state;
- struct timer_list suspend_timer;
- int suspend_timer_timeout;
- int suspend_timer_running;
/* Global use count for videocore.
** This is equal to the sum of the use counts for all services. When
@@ -121,20 +118,14 @@ vchiq_platform_suspend(struct vchiq_state *state);
extern int
vchiq_platform_videocore_wanted(struct vchiq_state *state);
-extern int
-vchiq_platform_use_suspend_timer(void);
-
extern void
vchiq_dump_platform_use_state(struct vchiq_state *state);
-extern void
-vchiq_dump_service_use_state(struct vchiq_state *state);
-
extern struct vchiq_arm_state*
vchiq_platform_get_arm_state(struct vchiq_state *state);
-extern int
-vchiq_videocore_wanted(struct vchiq_state *state);
+extern struct vchiq_arm_state*
+vchiq_platform_get_arm_state(struct vchiq_state *state);
extern enum vchiq_status
vchiq_use_internal(struct vchiq_state *state, struct vchiq_service *service,
@@ -166,7 +157,4 @@ extern void
set_resume_state(struct vchiq_arm_state *arm_state,
enum vc_resume_status new_state);
-extern void
-start_suspend_timer(struct vchiq_arm_state *arm_state);
-
#endif /* VCHIQ_ARM_H */
--
2.25.0
^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PATCH 06/22] staging: vc04_services: get rid of vchiq_platform_use_suspend_timer()
2020-01-24 14:46 ` [PATCH 06/22] staging: vc04_services: get rid of vchiq_platform_use_suspend_timer() Nicolas Saenz Julienne
@ 2020-01-26 20:11 ` kbuild test robot
2020-01-26 20:11 ` [RFC PATCH] staging: vc04_services: vchiq_dump_service_use_state can be static kbuild test robot
2020-01-27 11:06 ` [PATCH 06/22] staging: vc04_services: get rid of vchiq_platform_use_suspend_timer() Nicolas Saenz Julienne
2 siblings, 0 replies; 26+ messages in thread
From: kbuild test robot @ 2020-01-26 20:11 UTC (permalink / raw)
To: Nicolas Saenz Julienne
Cc: kbuild-all, gregkh, linux-kernel, Nicolas Saenz Julienne,
bcm-kernel-feedback-list, linux-rpi-kernel, linux-arm-kernel,
devel
Hi Nicolas,
I love your patch! Perhaps something to improve:
[auto build test WARNING on staging/staging-testing]
[also build test WARNING on linux/master linus/master v5.5-rc7 next-20200121]
[cannot apply to anholt/for-next]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Nicolas-Saenz-Julienne/staging-vc04_services-suspend-resume-cleanup/20200125-193041
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git fc157998b8257fb9cfe753e7f4af1411da995c9b
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-153-g47b6dfef-dirty
make ARCH=x86_64 allmodconfig
make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
sparse warnings: (new ones prefixed by >>)
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1239:60: sparse: sparse: incorrect type in assignment (different address spaces)
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1239:60: sparse: expected struct vchiq_header *header
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1239:60: sparse: got void [noderef] <asn:1> *[addressable] msgbuf
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1508:13: sparse: sparse: incorrect type in assignment (different address spaces)
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1508:13: sparse: expected int enum vchiq_status ( *__pu_val )( ... )
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1508:13: sparse: got void [noderef] <asn:1> *
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1510:13: sparse: sparse: incorrect type in assignment (different address spaces)
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1510:13: sparse: expected void *__pu_val
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1510:13: sparse: got void [noderef] <asn:1> *
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1636:13: sparse: sparse: incorrect type in assignment (different address spaces)
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1636:13: sparse: expected void *__pu_val
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1636:13: sparse: got void [noderef] <asn:1> *
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1638:13: sparse: sparse: incorrect type in assignment (different address spaces)
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1638:13: sparse: expected void *__pu_val
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1638:13: sparse: got void [noderef] <asn:1> *
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1713:13: sparse: sparse: incorrect type in assignment (different address spaces)
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1713:13: sparse: expected struct vchiq_completion_data *__pu_val
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1713:13: sparse: got void [noderef] <asn:1> *
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1716:13: sparse: sparse: incorrect type in assignment (different address spaces)
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1716:13: sparse: expected void **__pu_val
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1716:13: sparse: got void [noderef] <asn:1> *
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1763:13: sparse: sparse: incorrect type in assignment (different address spaces)
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1763:13: sparse: expected struct vchiq_completion_data *__pu_val
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1763:13: sparse: got struct vchiq_completion_data [noderef] <asn:1> *[assigned] completion
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1793:59: sparse: sparse: incorrect type in argument 1 (different address spaces)
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1793:59: sparse: expected void [noderef] <asn:1> *uptr
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1793:59: sparse: got struct vchiq_header *[addressable] header
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1795:45: sparse: sparse: incorrect type in argument 1 (different address spaces)
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1795:45: sparse: expected void [noderef] <asn:1> *uptr
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1795:45: sparse: got void *[addressable] service_userdata
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1797:45: sparse: sparse: incorrect type in argument 1 (different address spaces)
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1797:45: sparse: expected void [noderef] <asn:1> *uptr
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1797:45: sparse: got void *[addressable] bulk_userdata
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1851:13: sparse: sparse: incorrect type in assignment (different address spaces)
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1851:13: sparse: expected void *__pu_val
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1851:13: sparse: got void [noderef] <asn:1> *
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:2257:1: sparse: sparse: symbol 'vchiq_videocore_wanted' was not declared. Should it be static?
>> drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:2879:1: sparse: sparse: symbol 'vchiq_dump_service_use_state' was not declared. Should it be static?
Please review and possibly fold the followup patch.
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org Intel Corporation
^ permalink raw reply [flat|nested] 26+ messages in thread
* [RFC PATCH] staging: vc04_services: vchiq_dump_service_use_state can be static
2020-01-24 14:46 ` [PATCH 06/22] staging: vc04_services: get rid of vchiq_platform_use_suspend_timer() Nicolas Saenz Julienne
2020-01-26 20:11 ` kbuild test robot
@ 2020-01-26 20:11 ` kbuild test robot
2020-01-27 11:06 ` [PATCH 06/22] staging: vc04_services: get rid of vchiq_platform_use_suspend_timer() Nicolas Saenz Julienne
2 siblings, 0 replies; 26+ messages in thread
From: kbuild test robot @ 2020-01-26 20:11 UTC (permalink / raw)
To: Nicolas Saenz Julienne
Cc: kbuild-all, gregkh, linux-kernel, Nicolas Saenz Julienne,
bcm-kernel-feedback-list, linux-rpi-kernel, linux-arm-kernel,
devel
Fixes: fc2dd7f28276 ("staging: vc04_services: get rid of vchiq_platform_use_suspend_timer()")
Signed-off-by: kbuild test robot <lkp@intel.com>
---
vchiq_arm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
index a75d5092cc73b..f87818c03cfff 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
@@ -2875,7 +2875,7 @@ struct service_data_struct {
int use_count;
};
-void
+static void
vchiq_dump_service_use_state(struct vchiq_state *state)
{
struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state);
^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PATCH 06/22] staging: vc04_services: get rid of vchiq_platform_use_suspend_timer()
2020-01-24 14:46 ` [PATCH 06/22] staging: vc04_services: get rid of vchiq_platform_use_suspend_timer() Nicolas Saenz Julienne
2020-01-26 20:11 ` kbuild test robot
2020-01-26 20:11 ` [RFC PATCH] staging: vc04_services: vchiq_dump_service_use_state can be static kbuild test robot
@ 2020-01-27 11:06 ` Nicolas Saenz Julienne
2 siblings, 0 replies; 26+ messages in thread
From: Nicolas Saenz Julienne @ 2020-01-27 11:06 UTC (permalink / raw)
To: gregkh, linux-kernel
Cc: bcm-kernel-feedback-list, linux-rpi-kernel, linux-arm-kernel, devel
[-- Attachment #1: Type: text/plain, Size: 660 bytes --]
On Fri, 2020-01-24 at 15:46 +0100, Nicolas Saenz Julienne wrote:
> @@ -3059,7 +2986,6 @@ vchiq_check_service(struct vchiq_service *service)
> arm_state->videocore_use_count,
> suspend_state_names[arm_state->vc_suspend_state +
> VC_SUSPEND_NUM_OFFSET]);
> - vchiq_dump_service_use_state(service->state);
> }
> out:
> return ret;
As highlighted by the kbuild test robot, this shouldn't be removed. Sorry it
slipped through the cracks. Happened because of it similarities with
vchiq_dump_platform_use_state(), which is being rightfully removed.
I'll give some time for further feedback, and send a v2.
Regards,
Nicolas
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH 07/22] staging: vc04_services: Get rid of vchiq_platform_paused/resumed()
2020-01-24 14:45 [PATCH 00/22] staging: vc04_services: suspend/resume cleanup Nicolas Saenz Julienne
` (5 preceding siblings ...)
2020-01-24 14:46 ` [PATCH 06/22] staging: vc04_services: get rid of vchiq_platform_use_suspend_timer() Nicolas Saenz Julienne
@ 2020-01-24 14:46 ` Nicolas Saenz Julienne
2020-01-24 14:46 ` [PATCH 08/22] staging: vc04_services: Get rid of vchiq_platform_suspend/resume() Nicolas Saenz Julienne
` (14 subsequent siblings)
21 siblings, 0 replies; 26+ messages in thread
From: Nicolas Saenz Julienne @ 2020-01-24 14:46 UTC (permalink / raw)
To: gregkh, linux-kernel
Cc: Nicolas Saenz Julienne, bcm-kernel-feedback-list,
linux-rpi-kernel, linux-arm-kernel, devel
vchiq_platform_paused() and vchiq_platform_resumed() do nothing.
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
---
.../vc04_services/interface/vchiq_arm/vchiq_2835_arm.c | 10 ----------
.../vc04_services/interface/vchiq_arm/vchiq_core.c | 3 ---
.../vc04_services/interface/vchiq_arm/vchiq_core.h | 6 ------
3 files changed, 19 deletions(-)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
index 1ffb2aea947c..5f59145f251b 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
@@ -269,16 +269,6 @@ vchiq_platform_resume(struct vchiq_state *state)
return VCHIQ_SUCCESS;
}
-void
-vchiq_platform_paused(struct vchiq_state *state)
-{
-}
-
-void
-vchiq_platform_resumed(struct vchiq_state *state)
-{
-}
-
int
vchiq_platform_videocore_wanted(struct vchiq_state *state)
{
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
index 76351078affb..71342826ed33 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
@@ -1798,7 +1798,6 @@ parse_rx_slots(struct vchiq_state *state)
}
/* At this point slot_mutex is held */
vchiq_set_conn_state(state, VCHIQ_CONNSTATE_PAUSED);
- vchiq_platform_paused(state);
break;
case VCHIQ_MSG_RESUME:
vchiq_log_trace(vchiq_core_log_level,
@@ -1807,7 +1806,6 @@ parse_rx_slots(struct vchiq_state *state)
/* Release the slot mutex */
mutex_unlock(&state->slot_mutex);
vchiq_set_conn_state(state, VCHIQ_CONNSTATE_CONNECTED);
- vchiq_platform_resumed(state);
break;
case VCHIQ_MSG_REMOTE_USE:
@@ -1908,7 +1906,6 @@ slot_handler_func(void *v)
!= VCHIQ_RETRY) {
vchiq_set_conn_state(state,
VCHIQ_CONNSTATE_CONNECTED);
- vchiq_platform_resumed(state);
} else {
/* This should really be impossible,
** since the PAUSE should have flushed
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
index c31f953a9986..72c88fe5feb1 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
@@ -593,15 +593,9 @@ remote_event_signal(struct remote_event *event);
void
vchiq_platform_check_suspend(struct vchiq_state *state);
-extern void
-vchiq_platform_paused(struct vchiq_state *state);
-
extern enum vchiq_status
vchiq_platform_resume(struct vchiq_state *state);
-extern void
-vchiq_platform_resumed(struct vchiq_state *state);
-
extern int
vchiq_dump(void *dump_context, const char *str, int len);
--
2.25.0
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 08/22] staging: vc04_services: Get rid of vchiq_platform_suspend/resume()
2020-01-24 14:45 [PATCH 00/22] staging: vc04_services: suspend/resume cleanup Nicolas Saenz Julienne
` (6 preceding siblings ...)
2020-01-24 14:46 ` [PATCH 07/22] staging: vc04_services: Get rid of vchiq_platform_paused/resumed() Nicolas Saenz Julienne
@ 2020-01-24 14:46 ` Nicolas Saenz Julienne
2020-01-24 14:46 ` [PATCH 09/22] staging: vc04_services: Get rid of vchiq_platform_videocore_wanted() Nicolas Saenz Julienne
` (13 subsequent siblings)
21 siblings, 0 replies; 26+ messages in thread
From: Nicolas Saenz Julienne @ 2020-01-24 14:46 UTC (permalink / raw)
To: gregkh, linux-kernel
Cc: Nicolas Saenz Julienne, bcm-kernel-feedback-list,
linux-rpi-kernel, linux-arm-kernel, devel
vchiq_platform_suspend() and vchiq_platform_resume() do nothing, get rid
of them.
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
---
.../interface/vchiq_arm/vchiq_2835_arm.c | 12 ------------
.../vc04_services/interface/vchiq_arm/vchiq_arm.c | 8 +-------
.../vc04_services/interface/vchiq_arm/vchiq_arm.h | 3 ---
.../vc04_services/interface/vchiq_arm/vchiq_core.c | 4 ----
.../vc04_services/interface/vchiq_arm/vchiq_core.h | 3 ---
5 files changed, 1 insertion(+), 29 deletions(-)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
index 5f59145f251b..65e26a90c1db 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
@@ -257,18 +257,6 @@ int vchiq_dump_platform_state(void *dump_context)
return vchiq_dump(dump_context, buf, len + 1);
}
-enum vchiq_status
-vchiq_platform_suspend(struct vchiq_state *state)
-{
- return VCHIQ_ERROR;
-}
-
-enum vchiq_status
-vchiq_platform_resume(struct vchiq_state *state)
-{
- return VCHIQ_SUCCESS;
-}
-
int
vchiq_platform_videocore_wanted(struct vchiq_state *state)
{
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
index a75d5092cc73..3c374686ce89 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
@@ -2572,7 +2572,6 @@ void
vchiq_platform_check_suspend(struct vchiq_state *state)
{
struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state);
- int susp = 0;
if (!arm_state)
goto out;
@@ -2581,15 +2580,10 @@ vchiq_platform_check_suspend(struct vchiq_state *state)
write_lock_bh(&arm_state->susp_res_lock);
if (arm_state->vc_suspend_state == VC_SUSPEND_REQUESTED &&
- arm_state->vc_resume_state == VC_RESUME_RESUMED) {
+ arm_state->vc_resume_state == VC_RESUME_RESUMED)
set_suspend_state(arm_state, VC_SUSPEND_IN_PROGRESS);
- susp = 1;
- }
write_unlock_bh(&arm_state->susp_res_lock);
- if (susp)
- vchiq_platform_suspend(state);
-
out:
vchiq_log_trace(vchiq_susp_log_level, "%s exit", __func__);
return;
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
index 6daeb3e4f4b1..1f1ec679584b 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
@@ -112,9 +112,6 @@ vchiq_release_service(unsigned int handle);
extern enum vchiq_status
vchiq_check_service(struct vchiq_service *service);
-extern enum vchiq_status
-vchiq_platform_suspend(struct vchiq_state *state);
-
extern int
vchiq_platform_videocore_wanted(struct vchiq_state *state);
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
index 71342826ed33..ef8340ab8a52 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
@@ -1895,10 +1895,6 @@ slot_handler_func(void *v)
}
break;
- case VCHIQ_CONNSTATE_PAUSED:
- vchiq_platform_resume(state);
- break;
-
case VCHIQ_CONNSTATE_RESUMING:
if (queue_message(state, NULL,
VCHIQ_MAKE_MSG(VCHIQ_MSG_RESUME, 0, 0),
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
index 72c88fe5feb1..535a67cc68ed 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
@@ -593,9 +593,6 @@ remote_event_signal(struct remote_event *event);
void
vchiq_platform_check_suspend(struct vchiq_state *state);
-extern enum vchiq_status
-vchiq_platform_resume(struct vchiq_state *state);
-
extern int
vchiq_dump(void *dump_context, const char *str, int len);
--
2.25.0
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 09/22] staging: vc04_services: Get rid of vchiq_platform_videocore_wanted()
2020-01-24 14:45 [PATCH 00/22] staging: vc04_services: suspend/resume cleanup Nicolas Saenz Julienne
` (7 preceding siblings ...)
2020-01-24 14:46 ` [PATCH 08/22] staging: vc04_services: Get rid of vchiq_platform_suspend/resume() Nicolas Saenz Julienne
@ 2020-01-24 14:46 ` Nicolas Saenz Julienne
2020-01-24 14:46 ` [PATCH 10/22] staging: vc04_services: Get rid of vchiq_platform_handle_timeout() Nicolas Saenz Julienne
` (12 subsequent siblings)
21 siblings, 0 replies; 26+ messages in thread
From: Nicolas Saenz Julienne @ 2020-01-24 14:46 UTC (permalink / raw)
To: gregkh, linux-kernel
Cc: Nicolas Saenz Julienne, bcm-kernel-feedback-list,
linux-rpi-kernel, linux-arm-kernel, devel
The function always returns true, which makes a whole bunch of code
useless.
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
---
.../interface/vchiq_arm/vchiq_2835_arm.c | 5 ---
.../interface/vchiq_arm/vchiq_arm.c | 34 +++----------------
.../interface/vchiq_arm/vchiq_arm.h | 3 --
3 files changed, 5 insertions(+), 37 deletions(-)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
index 65e26a90c1db..a7f72dba2e20 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
@@ -257,11 +257,6 @@ int vchiq_dump_platform_state(void *dump_context)
return vchiq_dump(dump_context, buf, len + 1);
}
-int
-vchiq_platform_videocore_wanted(struct vchiq_state *state)
-{
- return 1; // autosuspend not supported - videocore always wanted
-}
void
vchiq_platform_handle_timeout(struct vchiq_state *state)
{
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
index 3c374686ce89..a90d6fbbb54b 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
@@ -2253,22 +2253,6 @@ vchiq_fops = {
* Autosuspend related functionality
*/
-int
-vchiq_videocore_wanted(struct vchiq_state *state)
-{
- struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state);
-
- if (!arm_state)
- /* autosuspend not supported - always return wanted */
- return 1;
- else if (!arm_state->videocore_use_count)
- /* usage count zero - check for override unless we're forcing */
- return vchiq_platform_videocore_wanted(state);
- else
- /* non-zero usage count - videocore still required */
- return 1;
-}
-
static enum vchiq_status
vchiq_keepalive_vchiq_callback(enum vchiq_reason reason,
struct vchiq_header *header,
@@ -2513,8 +2497,7 @@ need_resume(struct vchiq_state *state)
struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state);
return (arm_state->vc_suspend_state > VC_SUSPEND_IDLE) &&
- (arm_state->vc_resume_state < VC_RESUME_REQUESTED) &&
- vchiq_videocore_wanted(state);
+ (arm_state->vc_resume_state < VC_RESUME_REQUESTED);
}
/* Initiate suspend via slot handler. Should be called with the write lock
@@ -2736,17 +2719,10 @@ vchiq_release_internal(struct vchiq_state *state, struct vchiq_service *service)
--arm_state->videocore_use_count;
--(*entity_uc);
- if (!vchiq_videocore_wanted(state)) {
- vchiq_log_info(vchiq_susp_log_level,
- "%s %s count %d, state count %d - suspending",
- __func__, entity, *entity_uc,
- arm_state->videocore_use_count);
- vchiq_arm_vcsuspend(state);
- } else
- vchiq_log_trace(vchiq_susp_log_level,
- "%s %s count %d, state count %d",
- __func__, entity, *entity_uc,
- arm_state->videocore_use_count);
+ vchiq_log_trace(vchiq_susp_log_level,
+ "%s %s count %d, state count %d",
+ __func__, entity, *entity_uc,
+ arm_state->videocore_use_count);
unlock:
write_unlock_bh(&arm_state->susp_res_lock);
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
index 1f1ec679584b..beac1469d54d 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
@@ -112,9 +112,6 @@ vchiq_release_service(unsigned int handle);
extern enum vchiq_status
vchiq_check_service(struct vchiq_service *service);
-extern int
-vchiq_platform_videocore_wanted(struct vchiq_state *state);
-
extern void
vchiq_dump_platform_use_state(struct vchiq_state *state);
--
2.25.0
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 10/22] staging: vc04_services: Get rid of vchiq_platform_handle_timeout()
2020-01-24 14:45 [PATCH 00/22] staging: vc04_services: suspend/resume cleanup Nicolas Saenz Julienne
` (8 preceding siblings ...)
2020-01-24 14:46 ` [PATCH 09/22] staging: vc04_services: Get rid of vchiq_platform_videocore_wanted() Nicolas Saenz Julienne
@ 2020-01-24 14:46 ` Nicolas Saenz Julienne
2020-01-24 14:46 ` [PATCH 11/22] staging: vc04_services: Get rid of vchiq_on_remote_use_active() Nicolas Saenz Julienne
` (11 subsequent siblings)
21 siblings, 0 replies; 26+ messages in thread
From: Nicolas Saenz Julienne @ 2020-01-24 14:46 UTC (permalink / raw)
To: gregkh, linux-kernel
Cc: Nicolas Saenz Julienne, bcm-kernel-feedback-list,
linux-rpi-kernel, linux-arm-kernel, devel
The function does nothing.
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
---
.../vc04_services/interface/vchiq_arm/vchiq_2835_arm.c | 5 -----
.../staging/vc04_services/interface/vchiq_arm/vchiq_core.c | 5 -----
.../staging/vc04_services/interface/vchiq_arm/vchiq_core.h | 3 ---
3 files changed, 13 deletions(-)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
index a7f72dba2e20..c18c6ca0b6c0 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
@@ -257,11 +257,6 @@ int vchiq_dump_platform_state(void *dump_context)
return vchiq_dump(dump_context, buf, len + 1);
}
-void
-vchiq_platform_handle_timeout(struct vchiq_state *state)
-{
- (void)state;
-}
/*
* Local functions
*/
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
index ef8340ab8a52..f135d55b29e5 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
@@ -1911,11 +1911,6 @@ slot_handler_func(void *v)
"message");
}
break;
-
- case VCHIQ_CONNSTATE_PAUSE_TIMEOUT:
- case VCHIQ_CONNSTATE_RESUME_TIMEOUT:
- vchiq_platform_handle_timeout(state);
- break;
default:
break;
}
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
index 535a67cc68ed..11037a499408 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
@@ -638,9 +638,6 @@ vchiq_platform_conn_state_changed(struct vchiq_state *state,
enum vchiq_connstate oldstate,
enum vchiq_connstate newstate);
-extern void
-vchiq_platform_handle_timeout(struct vchiq_state *state);
-
extern void
vchiq_set_conn_state(struct vchiq_state *state, enum vchiq_connstate newstate);
--
2.25.0
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 11/22] staging: vc04_services: Get rid of vchiq_on_remote_use_active()
2020-01-24 14:45 [PATCH 00/22] staging: vc04_services: suspend/resume cleanup Nicolas Saenz Julienne
` (9 preceding siblings ...)
2020-01-24 14:46 ` [PATCH 10/22] staging: vc04_services: Get rid of vchiq_platform_handle_timeout() Nicolas Saenz Julienne
@ 2020-01-24 14:46 ` Nicolas Saenz Julienne
2020-01-24 14:46 ` [PATCH 12/22] staging: vc04_services: Get rid of vchiq_arm_vcsuspend() Nicolas Saenz Julienne
` (10 subsequent siblings)
21 siblings, 0 replies; 26+ messages in thread
From: Nicolas Saenz Julienne @ 2020-01-24 14:46 UTC (permalink / raw)
To: gregkh, linux-kernel
Cc: Nicolas Saenz Julienne, bcm-kernel-feedback-list,
linux-rpi-kernel, linux-arm-kernel, devel
Function does nothing.
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
---
.../staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 6 ------
.../staging/vc04_services/interface/vchiq_arm/vchiq_core.c | 1 -
2 files changed, 7 deletions(-)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
index a90d6fbbb54b..dbe403f9291b 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
@@ -2961,12 +2961,6 @@ vchiq_check_service(struct vchiq_service *service)
return ret;
}
-/* stub functions */
-void vchiq_on_remote_use_active(struct vchiq_state *state)
-{
- (void)state;
-}
-
void vchiq_platform_conn_state_changed(struct vchiq_state *state,
enum vchiq_connstate oldstate,
enum vchiq_connstate newstate)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
index f135d55b29e5..c5493dee6dd7 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
@@ -1815,7 +1815,6 @@ parse_rx_slots(struct vchiq_state *state)
vchiq_on_remote_release(state);
break;
case VCHIQ_MSG_REMOTE_USE_ACTIVE:
- vchiq_on_remote_use_active(state);
break;
default:
--
2.25.0
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 12/22] staging: vc04_services: Get rid of vchiq_arm_vcsuspend()
2020-01-24 14:45 [PATCH 00/22] staging: vc04_services: suspend/resume cleanup Nicolas Saenz Julienne
` (10 preceding siblings ...)
2020-01-24 14:46 ` [PATCH 11/22] staging: vc04_services: Get rid of vchiq_on_remote_use_active() Nicolas Saenz Julienne
@ 2020-01-24 14:46 ` Nicolas Saenz Julienne
2020-01-24 14:46 ` [PATCH 13/22] staging: vc04_services: Get rid of vchiq_check_resume() Nicolas Saenz Julienne
` (9 subsequent siblings)
21 siblings, 0 replies; 26+ messages in thread
From: Nicolas Saenz Julienne @ 2020-01-24 14:46 UTC (permalink / raw)
To: gregkh, linux-kernel
Cc: Nicolas Saenz Julienne, bcm-kernel-feedback-list,
linux-rpi-kernel, linux-arm-kernel, devel
It's not used.
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
---
.../interface/vchiq_arm/vchiq_arm.c | 51 -------------------
.../interface/vchiq_arm/vchiq_arm.h | 3 --
2 files changed, 54 deletions(-)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
index dbe403f9291b..55a5b77e7abd 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
@@ -2500,57 +2500,6 @@ need_resume(struct vchiq_state *state)
(arm_state->vc_resume_state < VC_RESUME_REQUESTED);
}
-/* Initiate suspend via slot handler. Should be called with the write lock
- * held */
-enum vchiq_status
-vchiq_arm_vcsuspend(struct vchiq_state *state)
-{
- enum vchiq_status status = VCHIQ_ERROR;
- struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state);
-
- if (!arm_state)
- goto out;
-
- vchiq_log_trace(vchiq_susp_log_level, "%s", __func__);
- status = VCHIQ_SUCCESS;
-
- switch (arm_state->vc_suspend_state) {
- case VC_SUSPEND_REQUESTED:
- vchiq_log_info(vchiq_susp_log_level, "%s: suspend already "
- "requested", __func__);
- break;
- case VC_SUSPEND_IN_PROGRESS:
- vchiq_log_info(vchiq_susp_log_level, "%s: suspend already in "
- "progress", __func__);
- break;
-
- default:
- /* We don't expect to be in other states, so log but continue
- * anyway */
- vchiq_log_error(vchiq_susp_log_level,
- "%s unexpected suspend state %s", __func__,
- suspend_state_names[arm_state->vc_suspend_state +
- VC_SUSPEND_NUM_OFFSET]);
- /* fall through */
- case VC_SUSPEND_REJECTED:
- case VC_SUSPEND_FAILED:
- /* Ensure any idle state actions have been run */
- set_suspend_state(arm_state, VC_SUSPEND_IDLE);
- /* fall through */
- case VC_SUSPEND_IDLE:
- vchiq_log_info(vchiq_susp_log_level,
- "%s: suspending", __func__);
- set_suspend_state(arm_state, VC_SUSPEND_REQUESTED);
- /* kick the slot handler thread to initiate suspend */
- request_poll(state, NULL, 0);
- break;
- }
-
-out:
- vchiq_log_trace(vchiq_susp_log_level, "%s exit %d", __func__, status);
- return status;
-}
-
void
vchiq_platform_check_suspend(struct vchiq_state *state)
{
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
index beac1469d54d..0f69956c221e 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
@@ -88,9 +88,6 @@ int vchiq_platform_init(struct platform_device *pdev,
extern struct vchiq_state *
vchiq_get_state(void);
-extern enum vchiq_status
-vchiq_arm_vcsuspend(struct vchiq_state *state);
-
extern enum vchiq_status
vchiq_arm_vcresume(struct vchiq_state *state);
--
2.25.0
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 13/22] staging: vc04_services: Get rid of vchiq_check_resume()
2020-01-24 14:45 [PATCH 00/22] staging: vc04_services: suspend/resume cleanup Nicolas Saenz Julienne
` (11 preceding siblings ...)
2020-01-24 14:46 ` [PATCH 12/22] staging: vc04_services: Get rid of vchiq_arm_vcsuspend() Nicolas Saenz Julienne
@ 2020-01-24 14:46 ` Nicolas Saenz Julienne
2020-01-24 14:46 ` [PATCH 14/22] staging: vc04_services: Delete vc_suspend_complete completion Nicolas Saenz Julienne
` (8 subsequent siblings)
21 siblings, 0 replies; 26+ messages in thread
From: Nicolas Saenz Julienne @ 2020-01-24 14:46 UTC (permalink / raw)
To: gregkh, linux-kernel
Cc: Nicolas Saenz Julienne, bcm-kernel-feedback-list,
linux-rpi-kernel, linux-arm-kernel, devel
Nobody calls this function.
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
---
.../interface/vchiq_arm/vchiq_arm.c | 23 -------------------
.../interface/vchiq_arm/vchiq_arm.h | 3 ---
2 files changed, 26 deletions(-)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
index 55a5b77e7abd..774ce4aa216f 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
@@ -2521,29 +2521,6 @@ vchiq_platform_check_suspend(struct vchiq_state *state)
return;
}
-/* This function should be called with the write lock held */
-int
-vchiq_check_resume(struct vchiq_state *state)
-{
- struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state);
- int resume = 0;
-
- if (!arm_state)
- goto out;
-
- vchiq_log_trace(vchiq_susp_log_level, "%s", __func__);
-
- if (need_resume(state)) {
- set_resume_state(arm_state, VC_RESUME_REQUESTED);
- request_poll(state, NULL, 0);
- resume = 1;
- }
-
-out:
- vchiq_log_trace(vchiq_susp_log_level, "%s exit", __func__);
- return resume;
-}
-
enum vchiq_status
vchiq_use_internal(struct vchiq_state *state, struct vchiq_service *service,
enum USE_TYPE_E use_type)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
index 0f69956c221e..9a8ecc089c69 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
@@ -95,9 +95,6 @@ extern enum vchiq_status
vchiq_arm_init_state(struct vchiq_state *state,
struct vchiq_arm_state *arm_state);
-extern int
-vchiq_check_resume(struct vchiq_state *state);
-
extern void
vchiq_check_suspend(struct vchiq_state *state);
enum vchiq_status
--
2.25.0
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 14/22] staging: vc04_services: Delete vc_suspend_complete completion
2020-01-24 14:45 [PATCH 00/22] staging: vc04_services: suspend/resume cleanup Nicolas Saenz Julienne
` (12 preceding siblings ...)
2020-01-24 14:46 ` [PATCH 13/22] staging: vc04_services: Get rid of vchiq_check_resume() Nicolas Saenz Julienne
@ 2020-01-24 14:46 ` Nicolas Saenz Julienne
2020-01-24 14:46 ` [PATCH 15/22] staging: vc04_services: Get rid of unused suspend/resume states Nicolas Saenz Julienne
` (7 subsequent siblings)
21 siblings, 0 replies; 26+ messages in thread
From: Nicolas Saenz Julienne @ 2020-01-24 14:46 UTC (permalink / raw)
To: gregkh, linux-kernel
Cc: Nicolas Saenz Julienne, bcm-kernel-feedback-list,
linux-rpi-kernel, linux-arm-kernel, devel
Nobody is waiting on it.
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
---
.../staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 7 -------
.../staging/vc04_services/interface/vchiq_arm/vchiq_arm.h | 1 -
2 files changed, 8 deletions(-)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
index 774ce4aa216f..da95bb1ec0eb 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
@@ -2356,8 +2356,6 @@ vchiq_arm_init_state(struct vchiq_state *state,
atomic_set(&arm_state->ka_use_ack_count, 0);
atomic_set(&arm_state->ka_release_count, 0);
- init_completion(&arm_state->vc_suspend_complete);
-
init_completion(&arm_state->vc_resume_complete);
/* Initialise to 'done' state. We only want to block on resume
* completion while videocore is suspended. */
@@ -2436,18 +2434,14 @@ set_suspend_state(struct vchiq_arm_state *arm_state,
/* state specific additional actions */
switch (new_state) {
case VC_SUSPEND_FORCE_CANCELED:
- complete_all(&arm_state->vc_suspend_complete);
break;
case VC_SUSPEND_REJECTED:
- complete_all(&arm_state->vc_suspend_complete);
break;
case VC_SUSPEND_FAILED:
- complete_all(&arm_state->vc_suspend_complete);
arm_state->vc_resume_state = VC_RESUME_RESUMED;
complete_all(&arm_state->vc_resume_complete);
break;
case VC_SUSPEND_IDLE:
- reinit_completion(&arm_state->vc_suspend_complete);
break;
case VC_SUSPEND_REQUESTED:
break;
@@ -2455,7 +2449,6 @@ set_suspend_state(struct vchiq_arm_state *arm_state,
set_resume_state(arm_state, VC_RESUME_IDLE);
break;
case VC_SUSPEND_SUSPENDED:
- complete_all(&arm_state->vc_suspend_complete);
break;
default:
BUG();
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
index 9a8ecc089c69..ac065f284372 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
@@ -46,7 +46,6 @@ struct vchiq_arm_state {
atomic_t ka_use_ack_count;
atomic_t ka_release_count;
- struct completion vc_suspend_complete;
struct completion vc_resume_complete;
rwlock_t susp_res_lock;
--
2.25.0
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 15/22] staging: vc04_services: Get rid of unused suspend/resume states
2020-01-24 14:45 [PATCH 00/22] staging: vc04_services: suspend/resume cleanup Nicolas Saenz Julienne
` (13 preceding siblings ...)
2020-01-24 14:46 ` [PATCH 14/22] staging: vc04_services: Delete vc_suspend_complete completion Nicolas Saenz Julienne
@ 2020-01-24 14:46 ` Nicolas Saenz Julienne
2020-01-24 14:46 ` [PATCH 16/22] staging: vc04_services: Get rid of USE_TYPE_SERVICE_NO_RESUME Nicolas Saenz Julienne
` (6 subsequent siblings)
21 siblings, 0 replies; 26+ messages in thread
From: Nicolas Saenz Julienne @ 2020-01-24 14:46 UTC (permalink / raw)
To: gregkh, linux-kernel
Cc: Nicolas Saenz Julienne, bcm-kernel-feedback-list,
linux-rpi-kernel, linux-arm-kernel, devel
It's impossible to get into them, so simply delete them.
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
---
.../interface/vchiq_arm/vchiq_arm.c | 55 -------------------
.../interface/vchiq_arm/vchiq_arm.h | 7 ---
2 files changed, 62 deletions(-)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
index da95bb1ec0eb..a0636385f0c8 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
@@ -50,20 +50,13 @@ int vchiq_susp_log_level = VCHIQ_LOG_ERROR;
#define VC_SUSPEND_NUM_OFFSET 3 /* number of values before idle which are -ve */
static const char *const suspend_state_names[] = {
- "VC_SUSPEND_FORCE_CANCELED",
- "VC_SUSPEND_REJECTED",
- "VC_SUSPEND_FAILED",
"VC_SUSPEND_IDLE",
- "VC_SUSPEND_REQUESTED",
"VC_SUSPEND_IN_PROGRESS",
- "VC_SUSPEND_SUSPENDED"
};
#define VC_RESUME_NUM_OFFSET 1 /* number of values before idle which are -ve */
static const char *const resume_state_names[] = {
- "VC_RESUME_FAILED",
"VC_RESUME_IDLE",
"VC_RESUME_REQUESTED",
- "VC_RESUME_IN_PROGRESS",
"VC_RESUME_RESUMED"
};
/* The number of times we allow force suspend to timeout before actually
@@ -2396,18 +2389,6 @@ vchiq_arm_init_state(struct vchiq_state *state,
** before resuming can occur. We therefore also reset the
** resume state machine to VC_RESUME_IDLE in this state.
**
-** VC_SUSPEND_SUSPENDED - Suspend has completed successfully. Also call
-** complete_all on the suspend completion to notify
-** anything waiting for suspend to happen.
-**
-** VC_SUSPEND_REJECTED - Videocore rejected suspend. Videocore will also
-** initiate resume, so no need to alter resume state.
-** We call complete_all on the suspend completion to notify
-** of suspend rejection.
-**
-** VC_SUSPEND_FAILED - We failed to initiate videocore suspend. We notify the
-** suspend completion and reset the resume state machine.
-**
** VC_RESUME_IDLE - Initialise the resume completion at the same time. The
** resume completion is in it's 'done' state whenever
** videcore is running. Therefore, the VC_RESUME_IDLE
@@ -2415,13 +2396,6 @@ vchiq_arm_init_state(struct vchiq_state *state,
** Hence, any thread which needs to wait until videocore is
** running can wait on this completion - it will only block
** if videocore is suspended.
-**
-** VC_RESUME_RESUMED - Resume has completed successfully. Videocore is running.
-** Call complete_all on the resume completion to unblock
-** any threads waiting for resume. Also reset the suspend
-** state machine to it's idle state.
-**
-** VC_RESUME_FAILED - Currently unused - no mechanism to fail resume exists.
*/
void
@@ -2433,23 +2407,11 @@ set_suspend_state(struct vchiq_arm_state *arm_state,
/* state specific additional actions */
switch (new_state) {
- case VC_SUSPEND_FORCE_CANCELED:
- break;
- case VC_SUSPEND_REJECTED:
- break;
- case VC_SUSPEND_FAILED:
- arm_state->vc_resume_state = VC_RESUME_RESUMED;
- complete_all(&arm_state->vc_resume_complete);
- break;
case VC_SUSPEND_IDLE:
break;
- case VC_SUSPEND_REQUESTED:
- break;
case VC_SUSPEND_IN_PROGRESS:
set_resume_state(arm_state, VC_RESUME_IDLE);
break;
- case VC_SUSPEND_SUSPENDED:
- break;
default:
BUG();
break;
@@ -2465,15 +2427,11 @@ set_resume_state(struct vchiq_arm_state *arm_state,
/* state specific additional actions */
switch (new_state) {
- case VC_RESUME_FAILED:
- break;
case VC_RESUME_IDLE:
reinit_completion(&arm_state->vc_resume_complete);
break;
case VC_RESUME_REQUESTED:
break;
- case VC_RESUME_IN_PROGRESS:
- break;
case VC_RESUME_RESUMED:
complete_all(&arm_state->vc_resume_complete);
set_suspend_state(arm_state, VC_SUSPEND_IDLE);
@@ -2503,12 +2461,6 @@ vchiq_platform_check_suspend(struct vchiq_state *state)
vchiq_log_trace(vchiq_susp_log_level, "%s", __func__);
- write_lock_bh(&arm_state->susp_res_lock);
- if (arm_state->vc_suspend_state == VC_SUSPEND_REQUESTED &&
- arm_state->vc_resume_state == VC_RESUME_RESUMED)
- set_suspend_state(arm_state, VC_SUSPEND_IN_PROGRESS);
- write_unlock_bh(&arm_state->susp_res_lock);
-
out:
vchiq_log_trace(vchiq_susp_log_level, "%s exit", __func__);
return;
@@ -2548,13 +2500,6 @@ vchiq_use_internal(struct vchiq_state *state, struct vchiq_service *service,
local_uc = ++arm_state->videocore_use_count;
local_entity_uc = ++(*entity_uc);
- /* If there's a pending request which hasn't yet been serviced then
- * just clear it. If we're past VC_SUSPEND_REQUESTED state then
- * vc_resume_complete will block until we either resume or fail to
- * suspend */
- if (arm_state->vc_suspend_state <= VC_SUSPEND_REQUESTED)
- set_suspend_state(arm_state, VC_SUSPEND_IDLE);
-
if ((use_type != USE_TYPE_SERVICE_NO_RESUME) && need_resume(state)) {
set_resume_state(arm_state, VC_RESUME_REQUESTED);
vchiq_log_info(vchiq_susp_log_level,
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
index ac065f284372..ba616ee4fc95 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
@@ -15,20 +15,13 @@
#include "vchiq_debugfs.h"
enum vc_suspend_status {
- VC_SUSPEND_FORCE_CANCELED = -3, /* Force suspend canceled, too busy */
- VC_SUSPEND_REJECTED = -2, /* Videocore rejected suspend request */
- VC_SUSPEND_FAILED = -1, /* Videocore suspend failed */
VC_SUSPEND_IDLE = 0, /* VC active, no suspend actions */
- VC_SUSPEND_REQUESTED, /* User has requested suspend */
VC_SUSPEND_IN_PROGRESS, /* Slot handler has recvd suspend request */
- VC_SUSPEND_SUSPENDED /* Videocore suspend succeeded */
};
enum vc_resume_status {
- VC_RESUME_FAILED = -1, /* Videocore resume failed */
VC_RESUME_IDLE = 0, /* VC suspended, no resume actions */
VC_RESUME_REQUESTED, /* User has requested resume */
- VC_RESUME_IN_PROGRESS, /* Slot handler has received resume request */
VC_RESUME_RESUMED /* Videocore resumed successfully (active) */
};
--
2.25.0
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 16/22] staging: vc04_services: Get rid of USE_TYPE_SERVICE_NO_RESUME
2020-01-24 14:45 [PATCH 00/22] staging: vc04_services: suspend/resume cleanup Nicolas Saenz Julienne
` (14 preceding siblings ...)
2020-01-24 14:46 ` [PATCH 15/22] staging: vc04_services: Get rid of unused suspend/resume states Nicolas Saenz Julienne
@ 2020-01-24 14:46 ` Nicolas Saenz Julienne
2020-01-24 14:46 ` [PATCH 17/22] staging: vc04_services: Delete vchiq_platform_check_suspend() Nicolas Saenz Julienne
` (5 subsequent siblings)
21 siblings, 0 replies; 26+ messages in thread
From: Nicolas Saenz Julienne @ 2020-01-24 14:46 UTC (permalink / raw)
To: gregkh, linux-kernel
Cc: Nicolas Saenz Julienne, bcm-kernel-feedback-list,
linux-rpi-kernel, linux-arm-kernel, devel
It's not used anywhere.
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
---
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 2 +-
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h | 1 -
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
index a0636385f0c8..591fbb99d015 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
@@ -2500,7 +2500,7 @@ vchiq_use_internal(struct vchiq_state *state, struct vchiq_service *service,
local_uc = ++arm_state->videocore_use_count;
local_entity_uc = ++(*entity_uc);
- if ((use_type != USE_TYPE_SERVICE_NO_RESUME) && need_resume(state)) {
+ if (need_resume(state)) {
set_resume_state(arm_state, VC_RESUME_REQUESTED);
vchiq_log_info(vchiq_susp_log_level,
"%s %s count %d, state count %d",
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
index ba616ee4fc95..d01d91e24a89 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
@@ -27,7 +27,6 @@ enum vc_resume_status {
enum USE_TYPE_E {
USE_TYPE_SERVICE,
- USE_TYPE_SERVICE_NO_RESUME,
USE_TYPE_VCHIQ
};
--
2.25.0
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 17/22] staging: vc04_services: Delete vchiq_platform_check_suspend()
2020-01-24 14:45 [PATCH 00/22] staging: vc04_services: suspend/resume cleanup Nicolas Saenz Julienne
` (15 preceding siblings ...)
2020-01-24 14:46 ` [PATCH 16/22] staging: vc04_services: Get rid of USE_TYPE_SERVICE_NO_RESUME Nicolas Saenz Julienne
@ 2020-01-24 14:46 ` Nicolas Saenz Julienne
2020-01-24 14:46 ` [PATCH 18/22] staging: vc04_services: Get of even more suspend/resume states Nicolas Saenz Julienne
` (4 subsequent siblings)
21 siblings, 0 replies; 26+ messages in thread
From: Nicolas Saenz Julienne @ 2020-01-24 14:46 UTC (permalink / raw)
To: gregkh, linux-kernel
Cc: Nicolas Saenz Julienne, bcm-kernel-feedback-list,
linux-rpi-kernel, linux-arm-kernel, devel
The function does nothing.
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
---
.../vc04_services/interface/vchiq_arm/vchiq_arm.c | 15 ---------------
.../interface/vchiq_arm/vchiq_core.c | 3 ---
.../interface/vchiq_arm/vchiq_core.h | 3 ---
3 files changed, 21 deletions(-)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
index 591fbb99d015..8ec5a61c5d89 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
@@ -2451,21 +2451,6 @@ need_resume(struct vchiq_state *state)
(arm_state->vc_resume_state < VC_RESUME_REQUESTED);
}
-void
-vchiq_platform_check_suspend(struct vchiq_state *state)
-{
- struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state);
-
- if (!arm_state)
- goto out;
-
- vchiq_log_trace(vchiq_susp_log_level, "%s", __func__);
-
-out:
- vchiq_log_trace(vchiq_susp_log_level, "%s exit", __func__);
- return;
-}
-
enum vchiq_status
vchiq_use_internal(struct vchiq_state *state, struct vchiq_service *service,
enum USE_TYPE_E use_type)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
index c5493dee6dd7..d5957411d906 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
@@ -1866,9 +1866,6 @@ slot_handler_func(void *v)
DEBUG_TRACE(SLOT_HANDLER_LINE);
if (state->poll_needed) {
- /* Check if we need to suspend - may change our
- * conn_state */
- vchiq_platform_check_suspend(state);
state->poll_needed = 0;
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
index 11037a499408..604d0c330819 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
@@ -590,9 +590,6 @@ vchiq_complete_bulk(struct vchiq_bulk *bulk);
extern void
remote_event_signal(struct remote_event *event);
-void
-vchiq_platform_check_suspend(struct vchiq_state *state);
-
extern int
vchiq_dump(void *dump_context, const char *str, int len);
--
2.25.0
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 18/22] staging: vc04_services: Get of even more suspend/resume states
2020-01-24 14:45 [PATCH 00/22] staging: vc04_services: suspend/resume cleanup Nicolas Saenz Julienne
` (16 preceding siblings ...)
2020-01-24 14:46 ` [PATCH 17/22] staging: vc04_services: Delete vchiq_platform_check_suspend() Nicolas Saenz Julienne
@ 2020-01-24 14:46 ` Nicolas Saenz Julienne
2020-01-24 14:46 ` [PATCH 19/22] staging: vc04_services: Get rid of vc_suspend_state in struct vchiq_arm_state Nicolas Saenz Julienne
` (3 subsequent siblings)
21 siblings, 0 replies; 26+ messages in thread
From: Nicolas Saenz Julienne @ 2020-01-24 14:46 UTC (permalink / raw)
To: gregkh, linux-kernel
Cc: Nicolas Saenz Julienne, bcm-kernel-feedback-list,
linux-rpi-kernel, linux-arm-kernel, devel
After the first states cleanup pass some set_suspend/resume_state()
calls disappeared which opened up even more opportunities for deletions.
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
---
.../interface/vchiq_arm/vchiq_arm.c | 92 +------------------
.../interface/vchiq_arm/vchiq_arm.h | 11 ---
2 files changed, 3 insertions(+), 100 deletions(-)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
index 8ec5a61c5d89..577ecfefce3c 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
@@ -48,15 +48,8 @@
int vchiq_arm_log_level = VCHIQ_LOG_DEFAULT;
int vchiq_susp_log_level = VCHIQ_LOG_ERROR;
-#define VC_SUSPEND_NUM_OFFSET 3 /* number of values before idle which are -ve */
-static const char *const suspend_state_names[] = {
- "VC_SUSPEND_IDLE",
- "VC_SUSPEND_IN_PROGRESS",
-};
#define VC_RESUME_NUM_OFFSET 1 /* number of values before idle which are -ve */
static const char *const resume_state_names[] = {
- "VC_RESUME_IDLE",
- "VC_RESUME_REQUESTED",
"VC_RESUME_RESUMED"
};
/* The number of times we allow force suspend to timeout before actually
@@ -2361,63 +2354,6 @@ vchiq_arm_init_state(struct vchiq_state *state,
return VCHIQ_SUCCESS;
}
-/*
-** Functions to modify the state variables;
-** set_suspend_state
-** set_resume_state
-**
-** There are more state variables than we might like, so ensure they remain in
-** step. Suspend and resume state are maintained separately, since most of
-** these state machines can operate independently. However, there are a few
-** states where state transitions in one state machine cause a reset to the
-** other state machine. In addition, there are some completion events which
-** need to occur on state machine reset and end-state(s), so these are also
-** dealt with in these functions.
-**
-** In all states we set the state variable according to the input, but in some
-** cases we perform additional steps outlined below;
-**
-** VC_SUSPEND_IDLE - Initialise the suspend completion at the same time.
-** The suspend completion is completed after any suspend
-** attempt. When we reset the state machine we also reset
-** the completion. This reset occurs when videocore is
-** resumed, and also if we initiate suspend after a suspend
-** failure.
-**
-** VC_SUSPEND_IN_PROGRESS - This state is considered the point of no return for
-** suspend - ie from this point on we must try to suspend
-** before resuming can occur. We therefore also reset the
-** resume state machine to VC_RESUME_IDLE in this state.
-**
-** VC_RESUME_IDLE - Initialise the resume completion at the same time. The
-** resume completion is in it's 'done' state whenever
-** videcore is running. Therefore, the VC_RESUME_IDLE
-** state implies that videocore is suspended.
-** Hence, any thread which needs to wait until videocore is
-** running can wait on this completion - it will only block
-** if videocore is suspended.
-*/
-
-void
-set_suspend_state(struct vchiq_arm_state *arm_state,
- enum vc_suspend_status new_state)
-{
- /* set the state in all cases */
- arm_state->vc_suspend_state = new_state;
-
- /* state specific additional actions */
- switch (new_state) {
- case VC_SUSPEND_IDLE:
- break;
- case VC_SUSPEND_IN_PROGRESS:
- set_resume_state(arm_state, VC_RESUME_IDLE);
- break;
- default:
- BUG();
- break;
- }
-}
-
void
set_resume_state(struct vchiq_arm_state *arm_state,
enum vc_resume_status new_state)
@@ -2427,14 +2363,8 @@ set_resume_state(struct vchiq_arm_state *arm_state,
/* state specific additional actions */
switch (new_state) {
- case VC_RESUME_IDLE:
- reinit_completion(&arm_state->vc_resume_complete);
- break;
- case VC_RESUME_REQUESTED:
- break;
case VC_RESUME_RESUMED:
complete_all(&arm_state->vc_resume_complete);
- set_suspend_state(arm_state, VC_SUSPEND_IDLE);
break;
default:
BUG();
@@ -2442,15 +2372,6 @@ set_resume_state(struct vchiq_arm_state *arm_state,
}
}
-static inline int
-need_resume(struct vchiq_state *state)
-{
- struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state);
-
- return (arm_state->vc_suspend_state > VC_SUSPEND_IDLE) &&
- (arm_state->vc_resume_state < VC_RESUME_REQUESTED);
-}
-
enum vchiq_status
vchiq_use_internal(struct vchiq_state *state, struct vchiq_service *service,
enum USE_TYPE_E use_type)
@@ -2485,16 +2406,9 @@ vchiq_use_internal(struct vchiq_state *state, struct vchiq_service *service,
local_uc = ++arm_state->videocore_use_count;
local_entity_uc = ++(*entity_uc);
- if (need_resume(state)) {
- set_resume_state(arm_state, VC_RESUME_REQUESTED);
- vchiq_log_info(vchiq_susp_log_level,
- "%s %s count %d, state count %d",
- __func__, entity, local_entity_uc, local_uc);
- request_poll(state, NULL, 0);
- } else
- vchiq_log_trace(vchiq_susp_log_level,
- "%s %s count %d, state count %d",
- __func__, entity, *entity_uc, local_uc);
+ vchiq_log_trace(vchiq_susp_log_level,
+ "%s %s count %d, state count %d",
+ __func__, entity, *entity_uc, local_uc);
write_unlock_bh(&arm_state->susp_res_lock);
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
index d01d91e24a89..e2f7fa865694 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
@@ -14,14 +14,7 @@
#include "vchiq_core.h"
#include "vchiq_debugfs.h"
-enum vc_suspend_status {
- VC_SUSPEND_IDLE = 0, /* VC active, no suspend actions */
- VC_SUSPEND_IN_PROGRESS, /* Slot handler has recvd suspend request */
-};
-
enum vc_resume_status {
- VC_RESUME_IDLE = 0, /* VC suspended, no resume actions */
- VC_RESUME_REQUESTED, /* User has requested resume */
VC_RESUME_RESUMED /* Videocore resumed successfully (active) */
};
@@ -128,10 +121,6 @@ vchiq_instance_get_trace(struct vchiq_instance *instance);
extern void
vchiq_instance_set_trace(struct vchiq_instance *instance, int trace);
-extern void
-set_suspend_state(struct vchiq_arm_state *arm_state,
- enum vc_suspend_status new_state);
-
extern void
set_resume_state(struct vchiq_arm_state *arm_state,
enum vc_resume_status new_state);
--
2.25.0
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 19/22] staging: vc04_services: Get rid of vc_suspend_state in struct vchiq_arm_state
2020-01-24 14:45 [PATCH 00/22] staging: vc04_services: suspend/resume cleanup Nicolas Saenz Julienne
` (17 preceding siblings ...)
2020-01-24 14:46 ` [PATCH 18/22] staging: vc04_services: Get of even more suspend/resume states Nicolas Saenz Julienne
@ 2020-01-24 14:46 ` Nicolas Saenz Julienne
2020-01-24 14:46 ` [PATCH 20/22] staging: vc04_services: Get rid of vchiq_arm_vcresume()'s signature Nicolas Saenz Julienne
` (2 subsequent siblings)
21 siblings, 0 replies; 26+ messages in thread
From: Nicolas Saenz Julienne @ 2020-01-24 14:46 UTC (permalink / raw)
To: gregkh, linux-kernel
Cc: Nicolas Saenz Julienne, bcm-kernel-feedback-list,
linux-rpi-kernel, linux-arm-kernel, devel
It's never used.
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
---
.../vc04_services/interface/vchiq_arm/vchiq_arm.c | 11 ++---------
.../vc04_services/interface/vchiq_arm/vchiq_arm.h | 1 -
2 files changed, 2 insertions(+), 10 deletions(-)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
index 577ecfefce3c..049512589375 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
@@ -2619,7 +2619,6 @@ vchiq_dump_service_use_state(struct vchiq_state *state)
int only_nonzero = 0;
static const char *nz = "<-- preventing suspend";
- enum vc_suspend_status vc_suspend_state;
enum vc_resume_status vc_resume_state;
int peer_count;
int vc_use_count;
@@ -2634,7 +2633,6 @@ vchiq_dump_service_use_state(struct vchiq_state *state)
return;
read_lock_bh(&arm_state->susp_res_lock);
- vc_suspend_state = arm_state->vc_suspend_state;
vc_resume_state = arm_state->vc_resume_state;
peer_count = arm_state->peer_use_count;
vc_use_count = arm_state->videocore_use_count;
@@ -2664,9 +2662,6 @@ vchiq_dump_service_use_state(struct vchiq_state *state)
read_unlock_bh(&arm_state->susp_res_lock);
- vchiq_log_warning(vchiq_susp_log_level,
- "-- Videcore suspend state: %s --",
- suspend_state_names[vc_suspend_state + VC_SUSPEND_NUM_OFFSET]);
vchiq_log_warning(vchiq_susp_log_level,
"-- Videcore resume state: %s --",
resume_state_names[vc_resume_state + VC_RESUME_NUM_OFFSET]);
@@ -2713,12 +2708,10 @@ vchiq_check_service(struct vchiq_service *service)
if (ret == VCHIQ_ERROR) {
vchiq_log_error(vchiq_susp_log_level,
"%s ERROR - %c%c%c%c:%d service count %d, "
- "state count %d, videocore suspend state %s", __func__,
+ "state count %d", __func__,
VCHIQ_FOURCC_AS_4CHARS(service->base.fourcc),
service->client_id, service->service_use_count,
- arm_state->videocore_use_count,
- suspend_state_names[arm_state->vc_suspend_state +
- VC_SUSPEND_NUM_OFFSET]);
+ arm_state->videocore_use_count);
}
out:
return ret;
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
index e2f7fa865694..780c352a5d64 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
@@ -34,7 +34,6 @@ struct vchiq_arm_state {
struct completion vc_resume_complete;
rwlock_t susp_res_lock;
- enum vc_suspend_status vc_suspend_state;
enum vc_resume_status vc_resume_state;
struct vchiq_state *state;
--
2.25.0
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 20/22] staging: vc04_services: Get rid of vchiq_arm_vcresume()'s signature
2020-01-24 14:45 [PATCH 00/22] staging: vc04_services: suspend/resume cleanup Nicolas Saenz Julienne
` (18 preceding siblings ...)
2020-01-24 14:46 ` [PATCH 19/22] staging: vc04_services: Get rid of vc_suspend_state in struct vchiq_arm_state Nicolas Saenz Julienne
@ 2020-01-24 14:46 ` Nicolas Saenz Julienne
2020-01-24 14:46 ` [PATCH 21/22] staging: vc04_services: Get rid of the rest of suspend/resume state handling Nicolas Saenz Julienne
2020-01-24 14:46 ` [PATCH 22/22] staging: vc04_services: vchiq_arm: Get rid of unused defines Nicolas Saenz Julienne
21 siblings, 0 replies; 26+ messages in thread
From: Nicolas Saenz Julienne @ 2020-01-24 14:46 UTC (permalink / raw)
To: gregkh, linux-kernel
Cc: Nicolas Saenz Julienne, bcm-kernel-feedback-list,
linux-rpi-kernel, linux-arm-kernel, devel
The function implementation does not exist.
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
---
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
index 780c352a5d64..7f5daa9aaf3d 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
@@ -71,9 +71,6 @@ int vchiq_platform_init(struct platform_device *pdev,
extern struct vchiq_state *
vchiq_get_state(void);
-extern enum vchiq_status
-vchiq_arm_vcresume(struct vchiq_state *state);
-
extern enum vchiq_status
vchiq_arm_init_state(struct vchiq_state *state,
struct vchiq_arm_state *arm_state);
--
2.25.0
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 21/22] staging: vc04_services: Get rid of the rest of suspend/resume state handling
2020-01-24 14:45 [PATCH 00/22] staging: vc04_services: suspend/resume cleanup Nicolas Saenz Julienne
` (19 preceding siblings ...)
2020-01-24 14:46 ` [PATCH 20/22] staging: vc04_services: Get rid of vchiq_arm_vcresume()'s signature Nicolas Saenz Julienne
@ 2020-01-24 14:46 ` Nicolas Saenz Julienne
2020-01-24 14:46 ` [PATCH 22/22] staging: vc04_services: vchiq_arm: Get rid of unused defines Nicolas Saenz Julienne
21 siblings, 0 replies; 26+ messages in thread
From: Nicolas Saenz Julienne @ 2020-01-24 14:46 UTC (permalink / raw)
To: gregkh, linux-kernel
Cc: Nicolas Saenz Julienne, bcm-kernel-feedback-list,
linux-rpi-kernel, linux-arm-kernel, devel
The only remaining state doesn't provide any information anymore nor the
completion that depends on it, which is set to complete_all() before any
user may wait on it.
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
---
.../interface/vchiq_arm/vchiq_arm.c | 49 -------------------
.../interface/vchiq_arm/vchiq_arm.h | 11 -----
2 files changed, 60 deletions(-)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
index 049512589375..d81c2ed27ccc 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
@@ -48,10 +48,6 @@
int vchiq_arm_log_level = VCHIQ_LOG_DEFAULT;
int vchiq_susp_log_level = VCHIQ_LOG_ERROR;
-#define VC_RESUME_NUM_OFFSET 1 /* number of values before idle which are -ve */
-static const char *const resume_state_names[] = {
- "VC_RESUME_RESUMED"
-};
/* The number of times we allow force suspend to timeout before actually
** _forcing_ suspend. This is to cater for SW which fails to release vchiq
** correctly - we don't want to prevent ARM suspend indefinitely in this case.
@@ -2342,11 +2338,6 @@ vchiq_arm_init_state(struct vchiq_state *state,
atomic_set(&arm_state->ka_use_ack_count, 0);
atomic_set(&arm_state->ka_release_count, 0);
- init_completion(&arm_state->vc_resume_complete);
- /* Initialise to 'done' state. We only want to block on resume
- * completion while videocore is suspended. */
- set_resume_state(arm_state, VC_RESUME_RESUMED);
-
arm_state->state = state;
arm_state->first_connect = 0;
@@ -2354,24 +2345,6 @@ vchiq_arm_init_state(struct vchiq_state *state,
return VCHIQ_SUCCESS;
}
-void
-set_resume_state(struct vchiq_arm_state *arm_state,
- enum vc_resume_status new_state)
-{
- /* set the state in all cases */
- arm_state->vc_resume_state = new_state;
-
- /* state specific additional actions */
- switch (new_state) {
- case VC_RESUME_RESUMED:
- complete_all(&arm_state->vc_resume_complete);
- break;
- default:
- BUG();
- break;
- }
-}
-
enum vchiq_status
vchiq_use_internal(struct vchiq_state *state, struct vchiq_service *service,
enum USE_TYPE_E use_type)
@@ -2412,22 +2385,6 @@ vchiq_use_internal(struct vchiq_state *state, struct vchiq_service *service,
write_unlock_bh(&arm_state->susp_res_lock);
- /* Completion is in a done state when we're not suspended, so this won't
- * block for the non-suspended case. */
- if (!try_wait_for_completion(&arm_state->vc_resume_complete)) {
- vchiq_log_info(vchiq_susp_log_level, "%s %s wait for resume",
- __func__, entity);
- if (wait_for_completion_killable(
- &arm_state->vc_resume_complete)) {
- vchiq_log_error(vchiq_susp_log_level, "%s %s wait for "
- "resume interrupted", __func__, entity);
- ret = VCHIQ_ERROR;
- goto out;
- }
- vchiq_log_info(vchiq_susp_log_level, "%s %s resumed", __func__,
- entity);
- }
-
if (ret == VCHIQ_SUCCESS) {
enum vchiq_status status = VCHIQ_SUCCESS;
long ack_cnt = atomic_xchg(&arm_state->ka_use_ack_count, 0);
@@ -2619,7 +2576,6 @@ vchiq_dump_service_use_state(struct vchiq_state *state)
int only_nonzero = 0;
static const char *nz = "<-- preventing suspend";
- enum vc_resume_status vc_resume_state;
int peer_count;
int vc_use_count;
int active_services;
@@ -2633,7 +2589,6 @@ vchiq_dump_service_use_state(struct vchiq_state *state)
return;
read_lock_bh(&arm_state->susp_res_lock);
- vc_resume_state = arm_state->vc_resume_state;
peer_count = arm_state->peer_use_count;
vc_use_count = arm_state->videocore_use_count;
active_services = state->unused_service;
@@ -2662,10 +2617,6 @@ vchiq_dump_service_use_state(struct vchiq_state *state)
read_unlock_bh(&arm_state->susp_res_lock);
- vchiq_log_warning(vchiq_susp_log_level,
- "-- Videcore resume state: %s --",
- resume_state_names[vc_resume_state + VC_RESUME_NUM_OFFSET]);
-
if (only_nonzero)
vchiq_log_warning(vchiq_susp_log_level, "Too many active "
"services (%d). Only dumping up to first %d services "
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
index 7f5daa9aaf3d..2d747af4457a 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
@@ -14,10 +14,6 @@
#include "vchiq_core.h"
#include "vchiq_debugfs.h"
-enum vc_resume_status {
- VC_RESUME_RESUMED /* Videocore resumed successfully (active) */
-};
-
enum USE_TYPE_E {
USE_TYPE_SERVICE,
USE_TYPE_VCHIQ
@@ -31,10 +27,7 @@ struct vchiq_arm_state {
atomic_t ka_use_ack_count;
atomic_t ka_release_count;
- struct completion vc_resume_complete;
-
rwlock_t susp_res_lock;
- enum vc_resume_status vc_resume_state;
struct vchiq_state *state;
@@ -117,8 +110,4 @@ vchiq_instance_get_trace(struct vchiq_instance *instance);
extern void
vchiq_instance_set_trace(struct vchiq_instance *instance, int trace);
-extern void
-set_resume_state(struct vchiq_arm_state *arm_state,
- enum vc_resume_status new_state);
-
#endif /* VCHIQ_ARM_H */
--
2.25.0
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 22/22] staging: vc04_services: vchiq_arm: Get rid of unused defines
2020-01-24 14:45 [PATCH 00/22] staging: vc04_services: suspend/resume cleanup Nicolas Saenz Julienne
` (20 preceding siblings ...)
2020-01-24 14:46 ` [PATCH 21/22] staging: vc04_services: Get rid of the rest of suspend/resume state handling Nicolas Saenz Julienne
@ 2020-01-24 14:46 ` Nicolas Saenz Julienne
21 siblings, 0 replies; 26+ messages in thread
From: Nicolas Saenz Julienne @ 2020-01-24 14:46 UTC (permalink / raw)
To: gregkh, linux-kernel
Cc: Nicolas Saenz Julienne, bcm-kernel-feedback-list,
linux-rpi-kernel, linux-arm-kernel, devel
They aren't used anywhere. Get rid of them.
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
---
.../vc04_services/interface/vchiq_arm/vchiq_arm.c | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
index d81c2ed27ccc..9dcd73def3be 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
@@ -48,16 +48,6 @@
int vchiq_arm_log_level = VCHIQ_LOG_DEFAULT;
int vchiq_susp_log_level = VCHIQ_LOG_ERROR;
-/* The number of times we allow force suspend to timeout before actually
-** _forcing_ suspend. This is to cater for SW which fails to release vchiq
-** correctly - we don't want to prevent ARM suspend indefinitely in this case.
-*/
-#define FORCE_SUSPEND_FAIL_MAX 8
-
-/* The time in ms allowed for videocore to go idle when force suspend has been
- * requested */
-#define FORCE_SUSPEND_TIMEOUT_MS 200
-
struct user_service {
struct vchiq_service *service;
void *userdata;
--
2.25.0
^ permalink raw reply related [flat|nested] 26+ messages in thread