.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * SN Platform GRU Driver |
---|
3 | 4 | * |
---|
.. | .. |
---|
6 | 7 | * This file supports the user system call for file open, close, mmap, etc. |
---|
7 | 8 | * This also incudes the driver initialization code. |
---|
8 | 9 | * |
---|
| 10 | + * (C) Copyright 2020 Hewlett Packard Enterprise Development LP |
---|
9 | 11 | * Copyright (c) 2008-2014 Silicon Graphics, Inc. All Rights Reserved. |
---|
10 | | - * |
---|
11 | | - * This program is free software; you can redistribute it and/or modify |
---|
12 | | - * it under the terms of the GNU General Public License as published by |
---|
13 | | - * the Free Software Foundation; either version 2 of the License, or |
---|
14 | | - * (at your option) any later version. |
---|
15 | | - * |
---|
16 | | - * This program is distributed in the hope that it will be useful, |
---|
17 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
18 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
19 | | - * GNU General Public License for more details. |
---|
20 | | - * |
---|
21 | | - * You should have received a copy of the GNU General Public License |
---|
22 | | - * along with this program; if not, write to the Free Software |
---|
23 | | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
24 | 12 | */ |
---|
25 | 13 | |
---|
26 | 14 | #include <linux/module.h> |
---|
.. | .. |
---|
148 | 136 | if (!(req.options & GRU_OPT_MISS_MASK)) |
---|
149 | 137 | req.options |= GRU_OPT_MISS_FMM_INTR; |
---|
150 | 138 | |
---|
151 | | - down_write(¤t->mm->mmap_sem); |
---|
| 139 | + mmap_write_lock(current->mm); |
---|
152 | 140 | vma = gru_find_vma(req.gseg); |
---|
153 | 141 | if (vma) { |
---|
154 | 142 | vdata = vma->vm_private_data; |
---|
.. | .. |
---|
159 | 147 | vdata->vd_tlb_preload_count = req.tlb_preload_count; |
---|
160 | 148 | ret = 0; |
---|
161 | 149 | } |
---|
162 | | - up_write(¤t->mm->mmap_sem); |
---|
| 150 | + mmap_write_unlock(current->mm); |
---|
163 | 151 | |
---|
164 | 152 | return ret; |
---|
165 | 153 | } |
---|
.. | .. |
---|
529 | 517 | #if defined CONFIG_IA64 |
---|
530 | 518 | gru_start_paddr = 0xd000000000UL; /* ZZZZZZZZZZZZZZZZZZZ fixme */ |
---|
531 | 519 | #else |
---|
532 | | - gru_start_paddr = uv_read_local_mmr(UVH_RH_GAM_GRU_OVERLAY_CONFIG_MMR) & |
---|
| 520 | + gru_start_paddr = uv_read_local_mmr(UVH_RH_GAM_GRU_OVERLAY_CONFIG) & |
---|
533 | 521 | 0x7fffffffffffUL; |
---|
534 | 522 | #endif |
---|
535 | 523 | gru_start_vaddr = __va(gru_start_paddr); |
---|
.. | .. |
---|
586 | 574 | gru_free_tables(); |
---|
587 | 575 | misc_deregister(&gru_miscdev); |
---|
588 | 576 | gru_proc_exit(); |
---|
| 577 | + mmu_notifier_synchronize(); |
---|
589 | 578 | } |
---|
590 | 579 | |
---|
591 | 580 | static const struct file_operations gru_fops = { |
---|