| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Cell Broadband Engine OProfile Support |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * (C) Copyright IBM Corporation 2006 |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * Author: Maynard Johnson <maynardj@us.ibm.com> |
|---|
| 7 | | - * |
|---|
| 8 | | - * This program is free software; you can redistribute it and/or |
|---|
| 9 | | - * modify it under the terms of the GNU General Public License |
|---|
| 10 | | - * as published by the Free Software Foundation; either version |
|---|
| 11 | | - * 2 of the License, or (at your option) any later version. |
|---|
| 12 | 8 | */ |
|---|
| 13 | 9 | |
|---|
| 14 | 10 | /* The purpose of this file is to handle SPU event task switching |
|---|
| .. | .. |
|---|
| 336 | 332 | fput(exe_file); |
|---|
| 337 | 333 | } |
|---|
| 338 | 334 | |
|---|
| 339 | | - down_read(&mm->mmap_sem); |
|---|
| 335 | + mmap_read_lock(mm); |
|---|
| 340 | 336 | for (vma = mm->mmap; vma; vma = vma->vm_next) { |
|---|
| 341 | 337 | if (vma->vm_start > spu_ref || vma->vm_end <= spu_ref) |
|---|
| 342 | 338 | continue; |
|---|
| .. | .. |
|---|
| 353 | 349 | *spu_bin_dcookie = fast_get_dcookie(&vma->vm_file->f_path); |
|---|
| 354 | 350 | pr_debug("got dcookie for %pD\n", vma->vm_file); |
|---|
| 355 | 351 | |
|---|
| 356 | | - up_read(&mm->mmap_sem); |
|---|
| 352 | + mmap_read_unlock(mm); |
|---|
| 357 | 353 | |
|---|
| 358 | 354 | out: |
|---|
| 359 | 355 | return app_cookie; |
|---|
| 360 | 356 | |
|---|
| 361 | 357 | fail_no_image_cookie: |
|---|
| 362 | | - up_read(&mm->mmap_sem); |
|---|
| 358 | + mmap_read_unlock(mm); |
|---|
| 363 | 359 | |
|---|
| 364 | 360 | printk(KERN_ERR "SPU_PROF: " |
|---|
| 365 | 361 | "%s, line %d: Cannot find dcookie for SPU binary\n", |
|---|
| .. | .. |
|---|
| 576 | 572 | * samples are recorded. |
|---|
| 577 | 573 | * No big deal -- so we just drop a few samples. |
|---|
| 578 | 574 | */ |
|---|
| 579 | | - pr_debug("SPU_PROF: No cached SPU contex " |
|---|
| 575 | + pr_debug("SPU_PROF: No cached SPU context " |
|---|
| 580 | 576 | "for SPU #%d. Dropping samples.\n", spu_num); |
|---|
| 581 | 577 | goto out; |
|---|
| 582 | 578 | } |
|---|