904-debloat_dma_buf.patch 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. From e3692cb2fcd5ba1244512a0f43b8118f65f1c375 Mon Sep 17 00:00:00 2001
  2. From: Felix Fietkau <nbd@nbd.name>
  3. Date: Sat, 8 Jul 2017 08:20:43 +0200
  4. Subject: debloat: dmabuf
  5. Signed-off-by: Felix Fietkau <nbd@nbd.name>
  6. ---
  7. drivers/base/Kconfig | 2 +-
  8. drivers/dma-buf/Makefile | 10 +++++++---
  9. drivers/dma-buf/dma-buf.c | 4 +++-
  10. kernel/sched/core.c | 1 +
  11. 4 files changed, 12 insertions(+), 5 deletions(-)
  12. --- a/drivers/base/Kconfig
  13. +++ b/drivers/base/Kconfig
  14. @@ -246,7 +246,7 @@ config SOC_BUS
  15. source "drivers/base/regmap/Kconfig"
  16. config DMA_SHARED_BUFFER
  17. - bool
  18. + tristate
  19. default n
  20. select ANON_INODES
  21. select IRQ_WORK
  22. --- a/drivers/dma-buf/Makefile
  23. +++ b/drivers/dma-buf/Makefile
  24. @@ -1,3 +1,7 @@
  25. -obj-y := dma-buf.o dma-fence.o dma-fence-array.o reservation.o seqno-fence.o
  26. -obj-$(CONFIG_SYNC_FILE) += sync_file.o
  27. -obj-$(CONFIG_SW_SYNC) += sw_sync.o sync_debug.o
  28. +obj-$(CONFIG_DMA_SHARED_BUFFER) := dma-shared-buffer.o
  29. +
  30. +dma-buf-objs-y := dma-buf.o dma-fence.o dma-fence-array.o reservation.o seqno-fence.o
  31. +dma-buf-objs-$(CONFIG_SYNC_FILE) += sync_file.o
  32. +dma-buf-objs-$(CONFIG_SW_SYNC) += sw_sync.o sync_debug.o
  33. +
  34. +dma-shared-buffer-objs := $(dma-buf-objs-y)
  35. --- a/drivers/dma-buf/dma-buf.c
  36. +++ b/drivers/dma-buf/dma-buf.c
  37. @@ -34,6 +34,7 @@
  38. #include <linux/poll.h>
  39. #include <linux/reservation.h>
  40. #include <linux/mm.h>
  41. +#include <linux/module.h>
  42. #include <uapi/linux/dma-buf.h>
  43. @@ -1205,4 +1206,5 @@ static void __exit dma_buf_deinit(void)
  44. {
  45. dma_buf_uninit_debugfs();
  46. }
  47. -__exitcall(dma_buf_deinit);
  48. +module_exit(dma_buf_deinit);
  49. +MODULE_LICENSE("GPL");
  50. --- a/kernel/sched/core.c
  51. +++ b/kernel/sched/core.c
  52. @@ -2164,6 +2164,7 @@ int wake_up_state(struct task_struct *p,
  53. {
  54. return try_to_wake_up(p, state, 0);
  55. }
  56. +EXPORT_SYMBOL_GPL(wake_up_state);
  57. /*
  58. * Perform scheduler related setup for a newly forked process p.