| .. | .. |
|---|
| 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-2023 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 |
|---|
| .. | .. |
|---|
| 63 | 63 | u32 const exception_data = (status >> 8) & 0xFFFFFF; |
|---|
| 64 | 64 | int const as_no = as->number; |
|---|
| 65 | 65 | unsigned long flags; |
|---|
| 66 | + const uintptr_t fault_addr = fault->addr; |
|---|
| 66 | 67 | |
|---|
| 67 | 68 | /* terminal fault, print info about the fault */ |
|---|
| 68 | 69 | dev_err(kbdev->dev, |
|---|
| 69 | | - "GPU bus fault in AS%d at VA 0x%016llX\n" |
|---|
| 70 | + "GPU bus fault in AS%d at PA %pK\n" |
|---|
| 70 | 71 | "raw fault status: 0x%X\n" |
|---|
| 71 | 72 | "exception type 0x%X: %s\n" |
|---|
| 72 | 73 | "exception data 0x%X\n" |
|---|
| 73 | 74 | "pid: %d\n", |
|---|
| 74 | | - as_no, fault->addr, |
|---|
| 75 | + as_no, (void *)fault_addr, |
|---|
| 75 | 76 | status, |
|---|
| 76 | 77 | exception_type, kbase_gpu_exception_name(exception_type), |
|---|
| 77 | 78 | exception_data, |
|---|
| .. | .. |
|---|
| 94 | 95 | KBASE_MMU_FAULT_TYPE_BUS_UNEXPECTED); |
|---|
| 95 | 96 | kbase_mmu_hw_enable_fault(kbdev, as, |
|---|
| 96 | 97 | KBASE_MMU_FAULT_TYPE_BUS_UNEXPECTED); |
|---|
| 98 | + |
|---|
| 97 | 99 | } |
|---|
| 98 | 100 | |
|---|
| 99 | 101 | /* |
|---|
| .. | .. |
|---|
| 185 | 187 | KBASE_MMU_FAULT_TYPE_PAGE_UNEXPECTED); |
|---|
| 186 | 188 | kbase_mmu_hw_enable_fault(kbdev, as, |
|---|
| 187 | 189 | KBASE_MMU_FAULT_TYPE_PAGE_UNEXPECTED); |
|---|
| 190 | + |
|---|
| 188 | 191 | } |
|---|
| 189 | 192 | |
|---|
| 190 | 193 | /** |
|---|
| .. | .. |
|---|
| 240 | 243 | * hw counters dumping in progress, signal the |
|---|
| 241 | 244 | * other thread that it failed |
|---|
| 242 | 245 | */ |
|---|
| 243 | | - spin_lock_irqsave(&kbdev->hwcnt.lock, flags); |
|---|
| 246 | + spin_lock_irqsave(&kbdev->hwcnt.lock, flags); |
|---|
| 244 | 247 | if ((kbdev->hwcnt.kctx == kctx) && |
|---|
| 245 | 248 | (kbdev->hwcnt.backend.state == |
|---|
| 246 | 249 | KBASE_INSTR_STATE_DUMPING)) |
|---|
| 247 | | - kbdev->hwcnt.backend.state = |
|---|
| 248 | | - KBASE_INSTR_STATE_FAULT; |
|---|
| 249 | | - spin_unlock_irqrestore(&kbdev->hwcnt.lock, flags); |
|---|
| 250 | + kbdev->hwcnt.backend.state = KBASE_INSTR_STATE_FAULT; |
|---|
| 251 | + |
|---|
| 252 | + spin_unlock_irqrestore(&kbdev->hwcnt.lock, flags); |
|---|
| 250 | 253 | |
|---|
| 251 | 254 | /* |
|---|
| 252 | 255 | * Stop the kctx from submitting more jobs and cause it |
|---|
| .. | .. |
|---|
| 326 | 329 | |
|---|
| 327 | 330 | while (bf_bits | pf_bits) { |
|---|
| 328 | 331 | struct kbase_as *as; |
|---|
| 329 | | - int as_no; |
|---|
| 332 | + unsigned int as_no; |
|---|
| 330 | 333 | struct kbase_context *kctx; |
|---|
| 331 | 334 | struct kbase_fault *fault; |
|---|
| 332 | 335 | |
|---|
| .. | .. |
|---|
| 421 | 424 | return kbase_job_slot_softstop_start_rp(kctx, reg); |
|---|
| 422 | 425 | } |
|---|
| 423 | 426 | |
|---|
| 424 | | -int kbase_mmu_as_init(struct kbase_device *kbdev, int i) |
|---|
| 427 | +int kbase_mmu_as_init(struct kbase_device *kbdev, unsigned int i) |
|---|
| 425 | 428 | { |
|---|
| 426 | 429 | kbdev->as[i].number = i; |
|---|
| 427 | 430 | kbdev->as[i].bf_data.addr = 0ULL; |
|---|
| 428 | 431 | kbdev->as[i].pf_data.addr = 0ULL; |
|---|
| 432 | + kbdev->as[i].is_unresponsive = false; |
|---|
| 429 | 433 | |
|---|
| 430 | | - kbdev->as[i].pf_wq = alloc_workqueue("mali_mmu%d", 0, 1, i); |
|---|
| 434 | + kbdev->as[i].pf_wq = alloc_workqueue("mali_mmu%u", 0, 1, i); |
|---|
| 431 | 435 | if (!kbdev->as[i].pf_wq) |
|---|
| 432 | 436 | return -ENOMEM; |
|---|
| 433 | 437 | |
|---|