.. | .. |
---|
1 | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
---|
2 | 2 | /* |
---|
3 | 3 | * |
---|
4 | | - * (C) COPYRIGHT 2019-2021 ARM Limited. All rights reserved. |
---|
| 4 | + * (C) COPYRIGHT 2019-2022 ARM Limited. All rights reserved. |
---|
5 | 5 | * |
---|
6 | 6 | * This program is free software and is provided to you under the terms of the |
---|
7 | 7 | * GNU General Public License version 2 as published by the Free Software |
---|
.. | .. |
---|
91 | 91 | * Refer to kbase_reset_gpu_prevent_and_wait() for more information. |
---|
92 | 92 | * |
---|
93 | 93 | * Return: 0 on success. -EAGAIN if a reset is currently happening. Other |
---|
94 | | - * negative error codes on failure. |
---|
| 94 | + * negative error codes on failure, where -ENOMEM indicates that GPU reset |
---|
| 95 | + * had failed. |
---|
95 | 96 | */ |
---|
96 | 97 | int kbase_reset_gpu_try_prevent(struct kbase_device *kbdev); |
---|
97 | 98 | |
---|
.. | .. |
---|
143 | 144 | void kbase_reset_gpu_assert_failed_or_prevented(struct kbase_device *kbdev); |
---|
144 | 145 | |
---|
145 | 146 | /** |
---|
146 | | - * Flags for kbase_prepare_to_reset_gpu |
---|
| 147 | + * RESET_FLAGS_NONE - Flags for kbase_prepare_to_reset_gpu |
---|
147 | 148 | */ |
---|
148 | | -#define RESET_FLAGS_NONE ((unsigned int)0) |
---|
| 149 | +#define RESET_FLAGS_NONE (0U) |
---|
| 150 | + |
---|
149 | 151 | /* This reset should be treated as an unrecoverable error by HW counter logic */ |
---|
150 | 152 | #define RESET_FLAGS_HWC_UNRECOVERABLE_ERROR ((unsigned int)(1 << 0)) |
---|
151 | 153 | |
---|
.. | .. |
---|
168 | 170 | * kbase_prepare_to_reset_gpu - Prepare for resetting the GPU. |
---|
169 | 171 | * @kbdev: Device pointer |
---|
170 | 172 | * @flags: Bitfield indicating impact of reset (see flag defines) |
---|
171 | | - |
---|
| 173 | + * |
---|
172 | 174 | * Return: a boolean which should be interpreted as follows: |
---|
173 | 175 | * - true - Prepared for reset, kbase_reset_gpu should be called. |
---|
174 | 176 | * - false - Another thread is performing a reset, kbase_reset_gpu should |
---|
.. | .. |
---|
235 | 237 | bool kbase_reset_gpu_is_active(struct kbase_device *kbdev); |
---|
236 | 238 | |
---|
237 | 239 | /** |
---|
| 240 | + * kbase_reset_gpu_not_pending - Reports if the GPU reset isn't pending |
---|
| 241 | + * |
---|
| 242 | + * @kbdev: Device pointer |
---|
| 243 | + * |
---|
| 244 | + * Note that unless appropriate locks are held when using this function, the |
---|
| 245 | + * state could change immediately afterwards. |
---|
| 246 | + * |
---|
| 247 | + * Return: True if the GPU reset isn't pending. |
---|
| 248 | + */ |
---|
| 249 | +bool kbase_reset_gpu_is_not_pending(struct kbase_device *kbdev); |
---|
| 250 | + |
---|
| 251 | +/** |
---|
238 | 252 | * kbase_reset_gpu_wait - Wait for a GPU reset to complete |
---|
239 | 253 | * @kbdev: Device pointer |
---|
240 | 254 | * |
---|