| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0 |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) 2017 - Cambridge Greys Ltd |
|---|
| 3 | 4 | * Copyright (C) 2011 - 2014 Cisco Systems Inc |
|---|
| 4 | 5 | * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) |
|---|
| 5 | | - * Licensed under the GPL |
|---|
| 6 | 6 | * Derived (i.e. mostly copied) from arch/i386/kernel/irq.c: |
|---|
| 7 | 7 | * Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar |
|---|
| 8 | 8 | */ |
|---|
| .. | .. |
|---|
| 248 | 248 | to_free = NULL; |
|---|
| 249 | 249 | } |
|---|
| 250 | 250 | walk = walk->next; |
|---|
| 251 | | - if (to_free != NULL) |
|---|
| 252 | | - kfree(to_free); |
|---|
| 251 | + kfree(to_free); |
|---|
| 253 | 252 | } |
|---|
| 254 | 253 | } |
|---|
| 255 | 254 | |
|---|
| .. | .. |
|---|
| 355 | 354 | } |
|---|
| 356 | 355 | |
|---|
| 357 | 356 | |
|---|
| 358 | | -void reactivate_fd(int fd, int irqnum) |
|---|
| 359 | | -{ |
|---|
| 360 | | - /** NOP - we do auto-EOI now **/ |
|---|
| 361 | | -} |
|---|
| 362 | | - |
|---|
| 363 | 357 | void deactivate_fd(int fd, int irqnum) |
|---|
| 364 | 358 | { |
|---|
| 365 | 359 | struct irq_entry *to_free; |
|---|
| .. | .. |
|---|
| 390 | 384 | */ |
|---|
| 391 | 385 | int deactivate_all_fds(void) |
|---|
| 392 | 386 | { |
|---|
| 393 | | - unsigned long flags; |
|---|
| 394 | 387 | struct irq_entry *to_free; |
|---|
| 395 | 388 | |
|---|
| 396 | | - spin_lock_irqsave(&irq_lock, flags); |
|---|
| 397 | 389 | /* Stop IO. The IRQ loop has no lock so this is our |
|---|
| 398 | 390 | * only way of making sure we are safe to dispose |
|---|
| 399 | 391 | * of all IRQ handlers |
|---|
| .. | .. |
|---|
| 409 | 401 | ); |
|---|
| 410 | 402 | to_free = to_free->next; |
|---|
| 411 | 403 | } |
|---|
| 412 | | - garbage_collect_irq_entries(); |
|---|
| 413 | | - spin_unlock_irqrestore(&irq_lock, flags); |
|---|
| 404 | + /* don't garbage collect - we can no longer call kfree() here */ |
|---|
| 414 | 405 | os_close_epoll_fd(); |
|---|
| 415 | 406 | return 0; |
|---|
| 416 | 407 | } |
|---|
| .. | .. |
|---|
| 454 | 445 | } |
|---|
| 455 | 446 | |
|---|
| 456 | 447 | EXPORT_SYMBOL(um_request_irq); |
|---|
| 457 | | -EXPORT_SYMBOL(reactivate_fd); |
|---|
| 458 | 448 | |
|---|
| 459 | 449 | /* |
|---|
| 460 | 450 | * irq_chip must define at least enable/disable and ack when |
|---|