mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 09:57:08 +03:00
gpu: nvgpu: Abstract kernel_restart()
This function is used in gk20a.c to handle catastrophic error conditions but is Linux specific. As such, implement an abstraction for this in driver_common.c and expose the API in nvgpu_common.h. JIRA NVGPU-525 Signed-off-by: Alex Waterman <alexw@nvidia.com> Change-Id: Ie2e417d30af5ff7db76f4d2d5b97ec96c386bd04 Reviewed-on: https://git-master.nvidia.com/r/1662543 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: Deepak Nibade <dnibade@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
ed36c60545
commit
c991410874
@@ -14,6 +14,7 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <linux/reboot.h>
|
||||||
#include <linux/dma-mapping.h>
|
#include <linux/dma-mapping.h>
|
||||||
#include <linux/mm.h>
|
#include <linux/mm.h>
|
||||||
#include <uapi/linux/nvgpu.h>
|
#include <uapi/linux/nvgpu.h>
|
||||||
@@ -37,6 +38,11 @@
|
|||||||
|
|
||||||
#define EMC3D_DEFAULT_RATIO 750
|
#define EMC3D_DEFAULT_RATIO 750
|
||||||
|
|
||||||
|
void nvgpu_kernel_restart(void *cmd)
|
||||||
|
{
|
||||||
|
kernel_restart(cmd);
|
||||||
|
}
|
||||||
|
|
||||||
static void nvgpu_init_vars(struct gk20a *g)
|
static void nvgpu_init_vars(struct gk20a *g)
|
||||||
{
|
{
|
||||||
struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
|
struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
|
||||||
|
|||||||
@@ -22,8 +22,6 @@
|
|||||||
* DEALINGS IN THE SOFTWARE.
|
* DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <linux/reboot.h>
|
|
||||||
|
|
||||||
#include <nvgpu/nvgpu_common.h>
|
#include <nvgpu/nvgpu_common.h>
|
||||||
#include <nvgpu/kmem.h>
|
#include <nvgpu/kmem.h>
|
||||||
#include <nvgpu/allocator.h>
|
#include <nvgpu/allocator.h>
|
||||||
@@ -61,7 +59,7 @@ void __nvgpu_check_gpu_state(struct gk20a *g)
|
|||||||
if (boot_0 == 0xffffffff) {
|
if (boot_0 == 0xffffffff) {
|
||||||
nvgpu_err(g, "GPU has disappeared from bus!!");
|
nvgpu_err(g, "GPU has disappeared from bus!!");
|
||||||
nvgpu_err(g, "Rebooting system!!");
|
nvgpu_err(g, "Rebooting system!!");
|
||||||
kernel_restart(NULL);
|
nvgpu_kernel_restart(NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,4 +31,6 @@ int nvgpu_probe(struct gk20a *g,
|
|||||||
const char *interface_name,
|
const char *interface_name,
|
||||||
struct class *class);
|
struct class *class);
|
||||||
|
|
||||||
|
void nvgpu_kernel_restart(void *cmd);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user