All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC 00/15] backports: remove DRM drivers
@ 2013-10-05 22:43 Hauke Mehrtens
  2013-10-05 22:43 ` [RFC 01/15] backports: remove DRM driver Hauke Mehrtens
                   ` (15 more replies)
  0 siblings, 16 replies; 18+ messages in thread
From: Hauke Mehrtens @ 2013-10-05 22:43 UTC (permalink / raw)
  To: mcgrof; +Cc: backports, ozancag, Hauke Mehrtens

Maintaining the DRM driver takes a lot of recourses as there they are
depending on many API changes done to the core kernel code and
currently we do not have that many recourses to follow them. On the
other side one needs also new userspace drivers to make use of the new
features added to the DRM kernel drivers and it is not easy to update
the X drivers. Therefore we came to the conclusion to remove the drm
drivers for now.

If someone wants to maintain the DRM drivers I would be very happy with
that and they should not be removed.

There were also some problems with some DRM drivers, like the Intel
i915 driver caused kernel panic on some systems and was probably only
usable on some very recent kernel versions.

1   2.6.25              [  OK  ]
2   2.6.26              [  OK  ]
3   2.6.27              [  OK  ]
4   2.6.28              [  OK  ]
5   2.6.29              [  OK  ]
6   2.6.30              [  OK  ]
7   2.6.31              [  OK  ]
8   2.6.32              [  OK  ]
9   2.6.33              [  OK  ]
10  2.6.34              [  OK  ]
11  2.6.35              [  OK  ]
12  2.6.36              [  OK  ]
13  2.6.37              [  OK  ]
14  2.6.38              [  OK  ]
15  2.6.39              [  OK  ]
16  3.0.98              [  OK  ]
17  3.1.10              [  OK  ]
18  3.10.14             [  OK  ]
19  3.11.3              [  OK  ]
20  3.12-rc3            [  FAIL  ]
21  3.2.51              [  OK  ]
22  3.3.8               [  OK  ]
23  3.4.64              [  OK  ]
24  3.5.7               [  OK  ]
25  3.6.11              [  OK  ]
26  3.7.10              [  OK  ]
27  3.8.13              [  OK  ]
28  3.9.11              [  OK  ]

You can pull it from
https://github.com/hauke/backports/tree/drm-remove

This is based on the "backports: add next-20130822" patch series.

Hauke Mehrtens (15):
  backports: remove DRM driver
  backports: remove platform drivers
  backports: remove BACKPORT_BUILD_CROSS_RESERVATION
  backports: remove CPTCFG_BACKPORT_BUILD_WW_MUTEX
  backports: remove BACKPORT_BUILD_RADIX_HELPERS
  backports: remove BACKPORT_BUILD_HDMI
  backports: remove more hdmi stuff
  backports: remove some stuff related to MTRR
  backports: remove scatterlist
  backports: remove ktime_get_monotonic_offset()
  backports: remove devm_regmap_init_spi()
  backports: remove compat_wake_up_locked()
  backports: remove i2c_bit_algo()
  backports: remove cpufreq_quick_get_max()
  backports: remove shmem_read_mapping_page_gfp()

 backport/Kconfig                                   |    4 -
 backport/Makefile.kernel                           |    3 -
 backport/backport-include/asm/mtrr.h               |   21 -
 backport/backport-include/linux/cpufreq.h          |   13 -
 backport/backport-include/linux/hdmi.h             |   36 --
 backport/backport-include/linux/hrtimer.h          |   11 -
 backport/backport-include/linux/i2c-algo-bit.h     |   12 -
 backport/backport-include/linux/io.h               |   38 --
 backport/backport-include/linux/radix-tree.h       |  218 -------
 backport/backport-include/linux/regmap.h           |    5 -
 backport/backport-include/linux/reservation.h      |   70 --
 backport/backport-include/linux/scatterlist.h      |   69 --
 backport/backport-include/linux/shmem_fs.h         |   39 --
 backport/backport-include/linux/wait.h             |   14 -
 backport/backport-include/linux/ww_mutex.h         |  333 ----------
 backport/compat/Kconfig                            |   41 --
 backport/compat/Makefile                           |    4 -
 backport/compat/backport-3.11.c                    |   92 ---
 backport/compat/backport-3.12.c                    |   51 --
 backport/compat/compat-3.0.c                       |   26 -
 backport/compat/compat-3.1.c                       |   23 -
 backport/compat/compat-3.4.c                       |  543 ----------------
 backport/compat/compat-3.5.c                       |   14 -
 backport/compat/compat-3.9.c                       |   43 --
 backport/compat/drivers-base-reservation.c         |   39 --
 backport/compat/kernel/ww_mutex.c                  |  669 --------------------
 backport/compat/lib-radix-tree-helpers.c           |  266 --------
 backport/defconfigs/drm                            |   49 --
 copy-list                                          |   44 --
 dependencies                                       |   18 -
 .../drm/0001-fb-info-vt_switch/INFO                |   44 --
 .../drivers_gpu_drm_i915_intel_fb.patch            |   11 -
 .../drm/02-revert-vm_mmap/INFO                     |    5 -
 .../drivers_gpu_drm_drm_bufs.patch                 |   31 -
 .../drivers_gpu_drm_i810_i810_dma.patch            |   37 --
 .../10-radeon-revert-acpi-table-size-check/INFO    |    3 -
 .../drivers_gpu_drm_radeon_radeon_bios.patch       |   24 -
 .../drivers_gpu_drm_drm_modes.patch                |   15 -
 .../drm/12-revert-remove_proc_subtree/INFO         |   25 -
 .../drivers_gpu_drm_drm_proc.patch                 |   62 --
 .../drm/13-nouveau-include-fix/INFO                |    2 -
 .../drivers_gpu_drm_nouveau_Makefile.patch         |   11 -
 .../14-shrinkers-api/drivers_gpu_drm_i915.patch    |  116 ----
 .../drm/14-shrinkers-api/drivers_gpu_drm_ttm.patch |  105 ---
 .../drm/15-intel-gtt/drivers_gpu_drm_i915.patch    |   29 -
 .../drm/16-remove-energy-read/i915.patch           |   28 -
 46 files changed, 3356 deletions(-)
 delete mode 100644 backport/backport-include/asm/mtrr.h
 delete mode 100644 backport/backport-include/linux/cpufreq.h
 delete mode 100644 backport/backport-include/linux/hdmi.h
 delete mode 100644 backport/backport-include/linux/hrtimer.h
 delete mode 100644 backport/backport-include/linux/i2c-algo-bit.h
 delete mode 100644 backport/backport-include/linux/io.h
 delete mode 100644 backport/backport-include/linux/radix-tree.h
 delete mode 100644 backport/backport-include/linux/reservation.h
 delete mode 100644 backport/backport-include/linux/shmem_fs.h
 delete mode 100644 backport/backport-include/linux/ww_mutex.h
 delete mode 100644 backport/compat/backport-3.11.c
 delete mode 100644 backport/compat/drivers-base-reservation.c
 delete mode 100644 backport/compat/kernel/ww_mutex.c
 delete mode 100644 backport/compat/lib-radix-tree-helpers.c
 delete mode 100644 backport/defconfigs/drm
 delete mode 100644 patches/collateral-evolutions/drm/0001-fb-info-vt_switch/INFO
 delete mode 100644 patches/collateral-evolutions/drm/0001-fb-info-vt_switch/drivers_gpu_drm_i915_intel_fb.patch
 delete mode 100644 patches/collateral-evolutions/drm/02-revert-vm_mmap/INFO
 delete mode 100644 patches/collateral-evolutions/drm/02-revert-vm_mmap/drivers_gpu_drm_drm_bufs.patch
 delete mode 100644 patches/collateral-evolutions/drm/02-revert-vm_mmap/drivers_gpu_drm_i810_i810_dma.patch
 delete mode 100644 patches/collateral-evolutions/drm/10-radeon-revert-acpi-table-size-check/INFO
 delete mode 100644 patches/collateral-evolutions/drm/10-radeon-revert-acpi-table-size-check/drivers_gpu_drm_radeon_radeon_bios.patch
 delete mode 100644 patches/collateral-evolutions/drm/11-videomode-includes/drivers_gpu_drm_drm_modes.patch
 delete mode 100644 patches/collateral-evolutions/drm/12-revert-remove_proc_subtree/INFO
 delete mode 100644 patches/collateral-evolutions/drm/12-revert-remove_proc_subtree/drivers_gpu_drm_drm_proc.patch
 delete mode 100644 patches/collateral-evolutions/drm/13-nouveau-include-fix/INFO
 delete mode 100644 patches/collateral-evolutions/drm/13-nouveau-include-fix/drivers_gpu_drm_nouveau_Makefile.patch
 delete mode 100644 patches/collateral-evolutions/drm/14-shrinkers-api/drivers_gpu_drm_i915.patch
 delete mode 100644 patches/collateral-evolutions/drm/14-shrinkers-api/drivers_gpu_drm_ttm.patch
 delete mode 100644 patches/collateral-evolutions/drm/15-intel-gtt/drivers_gpu_drm_i915.patch
 delete mode 100644 patches/collateral-evolutions/drm/16-remove-energy-read/i915.patch

-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [RFC 01/15] backports: remove DRM driver
  2013-10-05 22:43 [RFC 00/15] backports: remove DRM drivers Hauke Mehrtens
@ 2013-10-05 22:43 ` Hauke Mehrtens
  2013-10-05 22:43 ` [RFC 02/15] backports: remove platform drivers Hauke Mehrtens
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: Hauke Mehrtens @ 2013-10-05 22:43 UTC (permalink / raw)
  To: mcgrof; +Cc: backports, ozancag, Hauke Mehrtens

Maintaining the DRM driver takes a lot of recourses as there they are
depending on many API changes done to the core kernel code and
currently we do not have that many recourses to follow them. On the
other side one needs also new userspace drivers to make use of the new
features added to the DRM kernel drivers and it is not easy to update
the X drivers. Therefore we came to the conclusion to remove the drm
drivers for now.

There were also some problems with some DRM drivers, like the Intel
i915 driver caused kernel panic on some systems and was probably only
usable on some very recent kernel versions.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/Kconfig                                   |    2 -
 backport/Makefile.kernel                           |    2 -
 backport/defconfigs/drm                            |   49 ---------
 copy-list                                          |   37 -------
 dependencies                                       |   18 ---
 .../drm/0001-fb-info-vt_switch/INFO                |   44 --------
 .../drivers_gpu_drm_i915_intel_fb.patch            |   11 --
 .../drm/02-revert-vm_mmap/INFO                     |    5 -
 .../drivers_gpu_drm_drm_bufs.patch                 |   31 ------
 .../drivers_gpu_drm_i810_i810_dma.patch            |   37 -------
 .../10-radeon-revert-acpi-table-size-check/INFO    |    3 -
 .../drivers_gpu_drm_radeon_radeon_bios.patch       |   24 ----
 .../drivers_gpu_drm_drm_modes.patch                |   15 ---
 .../drm/12-revert-remove_proc_subtree/INFO         |   25 -----
 .../drivers_gpu_drm_drm_proc.patch                 |   62 -----------
 .../drm/13-nouveau-include-fix/INFO                |    2 -
 .../drivers_gpu_drm_nouveau_Makefile.patch         |   11 --
 .../14-shrinkers-api/drivers_gpu_drm_i915.patch    |  116 --------------------
 .../drm/14-shrinkers-api/drivers_gpu_drm_ttm.patch |  105 ------------------
 .../drm/15-intel-gtt/drivers_gpu_drm_i915.patch    |   29 -----
 .../drm/16-remove-energy-read/i915.patch           |   28 -----
 21 files changed, 656 deletions(-)
 delete mode 100644 backport/defconfigs/drm
 delete mode 100644 patches/collateral-evolutions/drm/0001-fb-info-vt_switch/INFO
 delete mode 100644 patches/collateral-evolutions/drm/0001-fb-info-vt_switch/drivers_gpu_drm_i915_intel_fb.patch
 delete mode 100644 patches/collateral-evolutions/drm/02-revert-vm_mmap/INFO
 delete mode 100644 patches/collateral-evolutions/drm/02-revert-vm_mmap/drivers_gpu_drm_drm_bufs.patch
 delete mode 100644 patches/collateral-evolutions/drm/02-revert-vm_mmap/drivers_gpu_drm_i810_i810_dma.patch
 delete mode 100644 patches/collateral-evolutions/drm/10-radeon-revert-acpi-table-size-check/INFO
 delete mode 100644 patches/collateral-evolutions/drm/10-radeon-revert-acpi-table-size-check/drivers_gpu_drm_radeon_radeon_bios.patch
 delete mode 100644 patches/collateral-evolutions/drm/11-videomode-includes/drivers_gpu_drm_drm_modes.patch
 delete mode 100644 patches/collateral-evolutions/drm/12-revert-remove_proc_subtree/INFO
 delete mode 100644 patches/collateral-evolutions/drm/12-revert-remove_proc_subtree/drivers_gpu_drm_drm_proc.patch
 delete mode 100644 patches/collateral-evolutions/drm/13-nouveau-include-fix/INFO
 delete mode 100644 patches/collateral-evolutions/drm/13-nouveau-include-fix/drivers_gpu_drm_nouveau_Makefile.patch
 delete mode 100644 patches/collateral-evolutions/drm/14-shrinkers-api/drivers_gpu_drm_i915.patch
 delete mode 100644 patches/collateral-evolutions/drm/14-shrinkers-api/drivers_gpu_drm_ttm.patch
 delete mode 100644 patches/collateral-evolutions/drm/15-intel-gtt/drivers_gpu_drm_i915.patch
 delete mode 100644 patches/collateral-evolutions/drm/16-remove-energy-read/i915.patch

diff --git a/backport/Kconfig b/backport/Kconfig
index 64a5f8b..0e24c79 100644
--- a/backport/Kconfig
+++ b/backport/Kconfig
@@ -36,8 +36,6 @@ source drivers/net/usb/Kconfig
 source drivers/ssb/Kconfig
 source drivers/bcma/Kconfig
 
-source drivers/gpu/drm/Kconfig
-
 source net/nfc/Kconfig
 
 source drivers/regulator/Kconfig
diff --git a/backport/Makefile.kernel b/backport/Makefile.kernel
index ca75ce1..0a2a569 100644
--- a/backport/Makefile.kernel
+++ b/backport/Makefile.kernel
@@ -8,7 +8,6 @@ NOSTDINC_FLAGS := \
 	-I$(M)/backport-include/uapi \
 	-I$(M)/include/ \
 	-I$(M)/include/uapi \
-	-I$(M)/include/drm \
 	-include $(M)/backport-include/backport/backport.h \
 	$(call backport-cc-disable-warning, unused-but-set-variable) \
 	-DBACKPORTS_VERSION=\"$(BACKPORTS_VERSION)\" \
@@ -30,7 +29,6 @@ obj-$(CPTCFG_SSB) += drivers/ssb/
 obj-$(CPTCFG_BCMA) += drivers/bcma/
 obj-$(CPTCFG_ETHERNET) += drivers/net/ethernet/
 obj-$(CPTCFG_USB_NET_RNDIS_WLAN) += drivers/net/usb/
-obj-$(CPTCFG_DRM) += drivers/gpu/drm/
 obj-$(CPTCFG_NFC) += net/nfc/
 obj-$(CPTCFG_NFC) += drivers/nfc/
 obj-$(CPTCFG_REGULATOR) += drivers/regulator/
diff --git a/backport/defconfigs/drm b/backport/defconfigs/drm
deleted file mode 100644
index 810b9e6..0000000
--- a/backport/defconfigs/drm
+++ /dev/null
@@ -1,49 +0,0 @@
-CPTCFG_DRM=y
-CPTCFG_DRM_USB=y
-CPTCFG_DRM_KMS_HELPER=y
-CPTCFG_DRM_LOAD_EDID_FIRMWARE=y
-CPTCFG_DRM_TTM=y
-CPTCFG_DRM_GEM_CMA_HELPER=y
-CPTCFG_DRM_KMS_CMA_HELPER=y
-CPTCFG_DRM_TDFX=y
-CPTCFG_DRM_R128=y
-CPTCFG_DRM_RADEON=y
-CPTCFG_DRM_I810=y
-CPTCFG_DRM_I915=y
-CPTCFG_DRM_I915_KMS=y
-CPTCFG_DRM_MGA=y
-CPTCFG_DRM_SIS=y
-CPTCFG_DRM_VIA=y
-CPTCFG_DRM_SAVAGE=y
-CPTCFG_DRM_I2C_CH7006=y
-CPTCFG_DRM_I2C_SIL164=y
-CPTCFG_DRM_I2C_NXP_TDA998X=y
-CPTCFG_DRM_RADEON_UMS=y
-CPTCFG_DRM_NOUVEAU=y
-CPTCFG_DRM_NOUVEAU_BACKLIGHT=y
-CPTCFG_DRM_EXYNOS=y
-CPTCFG_DRM_EXYNOS_IOMMU=y
-CPTCFG_DRM_EXYNOS_DMABUF=y
-CPTCFG_DRM_EXYNOS_FIMD=y
-CPTCFG_DRM_EXYNOS_HDMI=y
-CPTCFG_DRM_EXYNOS_VIDI=y
-CPTCFG_DRM_EXYNOS_G2D=y
-CPTCFG_DRM_EXYNOS_IPP=y
-CPTCFG_DRM_EXYNOS_FIMC=y
-CPTCFG_DRM_EXYNOS_ROTATOR=y
-CPTCFG_DRM_EXYNOS_GSC=y
-CPTCFG_DRM_VMWGFX=y
-CPTCFG_DRM_VMWGFX_FBCON=y
-CPTCFG_DRM_GMA500=y
-CPTCFG_DRM_GMA600=y
-CPTCFG_DRM_GMA3600=y
-CPTCFG_DRM_MEDFIELD=y
-CPTCFG_DRM_UDL=y
-CPTCFG_DRM_AST=y
-CPTCFG_DRM_MGAG200=y
-CPTCFG_DRM_CIRRUS_QEMU=y
-CPTCFG_DRM_SHMOBILE=y
-CPTCFG_DRM_TEGRA=y
-CPTCFG_DRM_TEGRA_DEBUG=y
-CPTCFG_DRM_OMAP=y
-CPTCFG_DRM_TILCDC=y
diff --git a/copy-list b/copy-list
index 8f5116a..b741c5d 100644
--- a/copy-list
+++ b/copy-list
@@ -115,43 +115,6 @@ drivers/net/usb/cdc_ncm.c
 drivers/net/usb/sierra_net.c
 drivers/net/usb/qmi_wwan.c
 
-# DRM
-include/drm/drm_agpsupport.h
-include/drm/drm_buffer.h
-include/drm/drm_cache.h
-include/drm/drm_core.h
-include/drm/drm_crtc.h
-include/drm/drm_crtc_helper.h
-include/drm/drm_dp_helper.h
-include/drm/drm_edid.h
-include/drm/drm_encoder_slave.h
-include/drm/drm_flip_work.h
-include/drm/drm_fb_cma_helper.h
-include/drm/drm_fb_helper.h
-include/drm/drm_fixed.h
-include/drm/drm_gem_cma_helper.h
-include/drm/drm_global.h
-include/drm/drm_hashtab.h
-include/drm/drm_memory.h
-include/drm/drm_mem_util.h
-include/drm/drm_mm.h
-include/drm/drm_os_linux.h
-include/drm/drm_pciids.h
-include/drm/drmP.h
-include/drm/drm_rect.h
-include/drm/drm_sysfs.h
-include/drm/drm_usb.h
-include/drm/drm_vma_manager.h
-include/drm/exynos_drm.h
-include/drm/gma_drm.h
-include/drm/i915_drm.h
-include/drm/i915_powerwell.h
-include/drm/i2c/
-include/drm/ttm/
-include/uapi/drm/
-drivers/platform/x86/intel_ips.h
-drivers/gpu/drm/
-
 # NFC core
 net/nfc/
 include/net/nfc/
diff --git a/dependencies b/dependencies
index 142ea6b..dd3428d 100644
--- a/dependencies
+++ b/dependencies
@@ -46,24 +46,6 @@ WL1251 3.0
 
 MWIFIEX 2.6.27
 
-# DRM stuff
-HDMI 3.2
-DRM 3.2
-# As of 3.11 DRM depends on the new ww_mutex which is
-# backported via BACKPORT_BUILD_WW_MUTEX. This backported
-# feature however has does not yet have support for
-# DEBUG_MUTEXES and DEBUG_LOCK_ALLOC.
-DRM kconfig: !BACKPORT_KERNEL_3_11 || !DEBUG_MUTEXES
-DRM kconfig: !BACKPORT_KERNEL_3_11 || !DEBUG_LOCK_ALLOC
-DRM_TTM 3.2
-# See e2bdb933, this was added on v3.3, in order to
-# support DRM_QXL on 3.2 you'd have to backport 78c1d7848
-# to 3.2 on BACKPORT_BUILD_RADIX_HELPERS and that requires
-# taking into consideration the radix_tree_node rcu change
-# on e2bdb933.
-DRM_QXL 3.3
-DRM_I915 3.7
-
 # Regulator
 # Because of -EPROBE_DEFER see commit d1c3414c and note that
 # we can't backport the core regulator as its part of the core
diff --git a/patches/collateral-evolutions/drm/0001-fb-info-vt_switch/INFO b/patches/collateral-evolutions/drm/0001-fb-info-vt_switch/INFO
deleted file mode 100644
index cb9dd67..0000000
--- a/patches/collateral-evolutions/drm/0001-fb-info-vt_switch/INFO
+++ /dev/null
@@ -1,44 +0,0 @@
-Commit 3cf2667 as of next-20130301 extended the struct fb_info
-with a skip_vt_switch to allow drivers to skip the VT switch
-at suspend/resume time. For older kernels we can skip this
-as all this switch does is call pm_vt_switch_required() with true
-or false depending on this new flag and later
-pm_vt_switch_unregister() would not have been made.
-
-This patch cannot be broken down further so I'm pegging
-this as the first one with 4 digits under the DRM folder
-for collateral evolutions. This reflects its as atomic as
-is possible.
-
-Relevant commits below, starting with the first one that
-added this new collateral evolution.
-
-commit 3cf2667b9f8b2c2fe298a427deb399e52321da6b
-Author: Jesse Barnes <jbarnes@virtuousgeek.org>
-Date:   Mon Feb 4 13:37:21 2013 +0000
-
-    fb: add support for drivers not needing VT switch at suspend/resume time
-    
-    Use the new PM routines to indicate whether we need to VT switch at suspend
-    and resume time.  When a new driver is bound, set its flag accordingly,
-    and when unbound, remove it from the PM's console tracking list.
-    
-    Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
-    Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-
-commit 24576d23976746cb52e7700c4cadbf4bc1bc3472
-Author: Jesse Barnes <jbarnes@virtuousgeek.org>
-Date:   Tue Mar 26 09:25:45 2013 -0700
-
-    drm/i915: enable VT switchless resume v3
-    
-    With the other bits in place, we can do this safely.
-    
-    v2: disable backlight on suspend to prevent premature enablement on resume
-    v3: disable CRTCs on suspend to allow RTD3 (Kristen)
-    
-    Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
-    Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
-    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-
diff --git a/patches/collateral-evolutions/drm/0001-fb-info-vt_switch/drivers_gpu_drm_i915_intel_fb.patch b/patches/collateral-evolutions/drm/0001-fb-info-vt_switch/drivers_gpu_drm_i915_intel_fb.patch
deleted file mode 100644
index c0fab51..0000000
--- a/patches/collateral-evolutions/drm/0001-fb-info-vt_switch/drivers_gpu_drm_i915_intel_fb.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/drivers/gpu/drm/i915/intel_fb.c
-+++ b/drivers/gpu/drm/i915/intel_fb.c
-@@ -152,7 +152,7 @@ static int intelfb_create(struct drm_fb_
- 	info->screen_size = size;
- 
- 	/* This driver doesn't need a VT switch to restore the mode on resume */
--	info->skip_vt_switch = true;
-+	fb_enable_skip_vt_switch(info);
- 
- 	drm_fb_helper_fill_fix(info, fb->pitches[0], fb->depth);
- 	drm_fb_helper_fill_var(info, &ifbdev->helper, sizes->fb_width, sizes->fb_height);
diff --git a/patches/collateral-evolutions/drm/02-revert-vm_mmap/INFO b/patches/collateral-evolutions/drm/02-revert-vm_mmap/INFO
deleted file mode 100644
index 977b4b7..0000000
--- a/patches/collateral-evolutions/drm/02-revert-vm_mmap/INFO
+++ /dev/null
@@ -1,5 +0,0 @@
-vm_mmap() and vm_munmap() were introduced in kernels >= 3.4.0. Revert
-those changes for versions older than that.
-
-These can't be backported as they rely on non-exported symbols.
-
diff --git a/patches/collateral-evolutions/drm/02-revert-vm_mmap/drivers_gpu_drm_drm_bufs.patch b/patches/collateral-evolutions/drm/02-revert-vm_mmap/drivers_gpu_drm_drm_bufs.patch
deleted file mode 100644
index c1af648..0000000
--- a/patches/collateral-evolutions/drm/02-revert-vm_mmap/drivers_gpu_drm_drm_bufs.patch
+++ /dev/null
@@ -1,31 +0,0 @@
---- a/drivers/gpu/drm/drm_bufs.c
-+++ b/drivers/gpu/drm/drm_bufs.c
-@@ -1406,6 +1406,20 @@ int drm_mapbufs(struct drm_device *dev,
- 				retcode = -EINVAL;
- 				goto done;
- 			}
-+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0))
-+			down_write(&current->mm->mmap_sem);
-+			virtual = do_mmap(file_priv->filp, 0, map->size,
-+					  PROT_READ | PROT_WRITE,
-+					  MAP_SHARED,
-+					  token);
-+			up_write(&current->mm->mmap_sem);
-+		} else {
-+			down_write(&current->mm->mmap_sem);
-+			virtual = do_mmap(file_priv->filp, 0, dma->byte_count,
-+					  PROT_READ | PROT_WRITE,
-+					  MAP_SHARED, 0);
-+			up_write(&current->mm->mmap_sem);
-+#else
- 			virtual = vm_mmap(file_priv->filp, 0, map->size,
- 					  PROT_READ | PROT_WRITE,
- 					  MAP_SHARED,
-@@ -1414,6 +1428,7 @@ int drm_mapbufs(struct drm_device *dev,
- 			virtual = vm_mmap(file_priv->filp, 0, dma->byte_count,
- 					  PROT_READ | PROT_WRITE,
- 					  MAP_SHARED, 0);
-+#endif
- 		}
- 		if (virtual > -1024UL) {
- 			/* Real error */
diff --git a/patches/collateral-evolutions/drm/02-revert-vm_mmap/drivers_gpu_drm_i810_i810_dma.patch b/patches/collateral-evolutions/drm/02-revert-vm_mmap/drivers_gpu_drm_i810_i810_dma.patch
deleted file mode 100644
index e3d60b3..0000000
--- a/patches/collateral-evolutions/drm/02-revert-vm_mmap/drivers_gpu_drm_i810_i810_dma.patch
+++ /dev/null
@@ -1,37 +0,0 @@
---- a/drivers/gpu/drm/i810/i810_dma.c
-+++ b/drivers/gpu/drm/i810/i810_dma.c
-@@ -134,9 +134,17 @@ static int i810_map_buffer(struct drm_bu
- 	old_fops = file_priv->filp->f_op;
- 	file_priv->filp->f_op = &i810_buffer_fops;
- 	dev_priv->mmap_buffer = buf;
-+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0))
-+	down_write(&current->mm->mmap_sem);
-+	buf_priv->virtual = (void *)do_mmap(file_priv->filp, 0, buf->total,
-+					    PROT_READ | PROT_WRITE,
-+					    MAP_SHARED, buf->bus_address);
-+	up_write(&current->mm->mmap_sem);
-+#else
- 	buf_priv->virtual = (void *)vm_mmap(file_priv->filp, 0, buf->total,
- 					    PROT_READ | PROT_WRITE,
- 					    MAP_SHARED, buf->bus_address);
-+#endif
- 	dev_priv->mmap_buffer = NULL;
- 	file_priv->filp->f_op = old_fops;
- 	if (IS_ERR(buf_priv->virtual)) {
-@@ -157,9 +165,15 @@ static int i810_unmap_buffer(struct drm_
- 	if (buf_priv->currently_mapped != I810_BUF_MAPPED)
- 		return -EINVAL;
- 
-+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0))
-+	down_write(&current->mm->mmap_sem);
-+	retcode = do_munmap(current->mm, (unsigned long)buf_priv->virtual,
-+			    (size_t) buf->total);
-+	up_write(&current->mm->mmap_sem);
-+#else
- 	retcode = vm_munmap((unsigned long)buf_priv->virtual,
- 			    (size_t) buf->total);
--
-+#endif
- 	buf_priv->currently_mapped = I810_BUF_UNMAPPED;
- 	buf_priv->virtual = NULL;
- 
diff --git a/patches/collateral-evolutions/drm/10-radeon-revert-acpi-table-size-check/INFO b/patches/collateral-evolutions/drm/10-radeon-revert-acpi-table-size-check/INFO
deleted file mode 100644
index 28db5d2..0000000
--- a/patches/collateral-evolutions/drm/10-radeon-revert-acpi-table-size-check/INFO
+++ /dev/null
@@ -1,3 +0,0 @@
-acpi_get_table_with_size() was exported with kernels >= 3.6. Revert the
-size checking for kernels < 3.6.
-
diff --git a/patches/collateral-evolutions/drm/10-radeon-revert-acpi-table-size-check/drivers_gpu_drm_radeon_radeon_bios.patch b/patches/collateral-evolutions/drm/10-radeon-revert-acpi-table-size-check/drivers_gpu_drm_radeon_radeon_bios.patch
deleted file mode 100644
index 29c2bb8..0000000
--- a/patches/collateral-evolutions/drm/10-radeon-revert-acpi-table-size-check/drivers_gpu_drm_radeon_radeon_bios.patch
+++ /dev/null
@@ -1,24 +0,0 @@
---- a/drivers/gpu/drm/radeon/radeon_bios.c
-+++ b/drivers/gpu/drm/radeon/radeon_bios.c
-@@ -581,12 +581,21 @@ static bool radeon_acpi_vfct_bios(struct
- {
- 	bool ret = false;
- 	struct acpi_table_header *hdr;
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0))
- 	acpi_size tbl_size;
-+#else
-+	/* acpi_get_table_with_size() not exported on kernels < 3.6 */
-+	acpi_size tbl_size = 0x7fffffff;
-+#endif
- 	UEFI_ACPI_VFCT *vfct;
- 	GOP_VBIOS_CONTENT *vbios;
- 	VFCT_IMAGE_HEADER *vhdr;
- 
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0))
- 	if (!ACPI_SUCCESS(acpi_get_table_with_size("VFCT", 1, &hdr, &tbl_size)))
-+#else
-+	if (!ACPI_SUCCESS(acpi_get_table("VFCT", 1, &hdr)))
-+#endif
- 		return false;
- 	if (tbl_size < sizeof(UEFI_ACPI_VFCT)) {
- 		DRM_ERROR("ACPI VFCT table present but broken (too short #1)\n");
diff --git a/patches/collateral-evolutions/drm/11-videomode-includes/drivers_gpu_drm_drm_modes.patch b/patches/collateral-evolutions/drm/11-videomode-includes/drivers_gpu_drm_drm_modes.patch
deleted file mode 100644
index 1858cc3..0000000
--- a/patches/collateral-evolutions/drm/11-videomode-includes/drivers_gpu_drm_drm_modes.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- a/drivers/gpu/drm/drm_modes.c
-+++ b/drivers/gpu/drm/drm_modes.c
-@@ -35,8 +35,12 @@
- #include <linux/export.h>
- #include <drm/drmP.h>
- #include <drm/drm_crtc.h>
-+#if IS_ENABLED(CONFIG_OF_VIDEOMODE)
- #include <video/of_videomode.h>
-+#endif
-+#if IS_ENABLED(CONFIG_VIDEOMODE)
- #include <video/videomode.h>
-+#endif
- 
- /**
-  * drm_mode_debug_printmodeline - debug print a mode
diff --git a/patches/collateral-evolutions/drm/12-revert-remove_proc_subtree/INFO b/patches/collateral-evolutions/drm/12-revert-remove_proc_subtree/INFO
deleted file mode 100644
index 8dbcf8a..0000000
--- a/patches/collateral-evolutions/drm/12-revert-remove_proc_subtree/INFO
+++ /dev/null
@@ -1,25 +0,0 @@
-We cannot backport remove_proc_subtree() modularly so the
-only thing we can do is revert its usage. This patch reverts
-all of its usage and the commits that added them are listed
-below.
-
-Another thing we could do is look at each driver's usage of
-proc and see if its reasonable to instead covert it to use
-debugfs. This needs to be dealt with on a case by case basis.
-
-From 8bc742e13fb2c9cd64988816749295e9ddf53101 Mon Sep 17 00:00:00 2001
-From: David Howells <dhowells@redhat.com>
-Date: Fri, 12 Apr 2013 16:15:07 +0100
-Subject: [PATCH] drm: proc: Use remove_proc_subtree()
-
-Use remove_proc_subtree() rather than remove_proc_entry() to remove a
-minor-specific drm proc directory and all its children.
-
-Things could theoretically be improved by storing the drm_minor pointer in the
-minor-specific dir proc_dir_entry struct data and then scrapping the list of
-proc files - but that's shared with the debugfs interface where you can't do
-that, so I don't see an easy way of doing it.
-
-Signed-off-by: David Howells <dhowells@redhat.com>
-cc: dri-devel@lists.freedesktop.org
-Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
diff --git a/patches/collateral-evolutions/drm/12-revert-remove_proc_subtree/drivers_gpu_drm_drm_proc.patch b/patches/collateral-evolutions/drm/12-revert-remove_proc_subtree/drivers_gpu_drm_drm_proc.patch
deleted file mode 100644
index 6a578e5..0000000
--- a/patches/collateral-evolutions/drm/12-revert-remove_proc_subtree/drivers_gpu_drm_drm_proc.patch
+++ /dev/null
@@ -1,62 +0,0 @@
---- a/drivers/gpu/drm/drm_proc.c
-+++ b/drivers/gpu/drm/drm_proc.c
-@@ -95,7 +95,7 @@ static int drm_proc_create_files(const s
- 	struct drm_device *dev = minor->dev;
- 	struct proc_dir_entry *ent;
- 	struct drm_info_node *tmp;
--	int i;
-+	int i, ret;
- 
- 	for (i = 0; i < count; i++) {
- 		u32 features = files[i].driver_features;
-@@ -105,9 +105,10 @@ static int drm_proc_create_files(const s
- 			continue;
- 
- 		tmp = kmalloc(sizeof(struct drm_info_node), GFP_KERNEL);
--		if (!tmp)
--			return -1;
--
-+		if (tmp == NULL) {
-+			ret = -1;
-+			goto fail;
-+		}
- 		tmp->minor = minor;
- 		tmp->info_ent = &files[i];
- 		list_add(&tmp->list, &minor->proc_nodes.list);
-@@ -119,10 +120,16 @@ static int drm_proc_create_files(const s
- 				  minor->index, files[i].name);
- 			list_del(&tmp->list);
- 			kfree(tmp);
--			return -1;
-+			ret = -1;
-+			goto fail;
- 		}
- 	}
- 	return 0;
-+
-+fail:
-+	for (i = 0; i < count; i++)
-+		remove_proc_entry(drm_proc_list[i].name, minor->proc_root);
-+	return ret;
- }
- 
- /**
-@@ -153,7 +160,7 @@ int drm_proc_init(struct drm_minor *mino
- 	ret = drm_proc_create_files(drm_proc_list, DRM_PROC_ENTRIES,
- 				    minor->proc_root, minor);
- 	if (ret) {
--		remove_proc_subtree(name, root);
-+		remove_proc_entry(name, root);
- 		minor->proc_root = NULL;
- 		DRM_ERROR("Failed to create core drm proc files\n");
- 		return ret;
-@@ -203,7 +210,8 @@ int drm_proc_cleanup(struct drm_minor *m
- 	drm_proc_remove_files(drm_proc_list, DRM_PROC_ENTRIES, minor);
- 
- 	sprintf(name, "%d", minor->index);
--	remove_proc_subtree(name, root);
-+	remove_proc_entry(name, root);
-+
- 	return 0;
- }
- 
diff --git a/patches/collateral-evolutions/drm/13-nouveau-include-fix/INFO b/patches/collateral-evolutions/drm/13-nouveau-include-fix/INFO
deleted file mode 100644
index 9fda4df..0000000
--- a/patches/collateral-evolutions/drm/13-nouveau-include-fix/INFO
+++ /dev/null
@@ -1,2 +0,0 @@
-The headers are not being picked up and require
-ensuring we are pointing to our backport selection.
diff --git a/patches/collateral-evolutions/drm/13-nouveau-include-fix/drivers_gpu_drm_nouveau_Makefile.patch b/patches/collateral-evolutions/drm/13-nouveau-include-fix/drivers_gpu_drm_nouveau_Makefile.patch
deleted file mode 100644
index dace69b..0000000
--- a/patches/collateral-evolutions/drm/13-nouveau-include-fix/drivers_gpu_drm_nouveau_Makefile.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/drivers/gpu/drm/nouveau/Makefile
-+++ b/drivers/gpu/drm/nouveau/Makefile
-@@ -2,7 +2,7 @@
- # Makefile for the drm device driver.  This driver provides support for the
- # Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher.
- 
--ccflags-y := -Iinclude/drm
-+ccflags-y += -I$(backport_srctree)/include/drm
- ccflags-y += -I$(src)/core/include
- ccflags-y += -I$(src)/core
- ccflags-y += -I$(src)
diff --git a/patches/collateral-evolutions/drm/14-shrinkers-api/drivers_gpu_drm_i915.patch b/patches/collateral-evolutions/drm/14-shrinkers-api/drivers_gpu_drm_i915.patch
deleted file mode 100644
index 1bb5fb2..0000000
--- a/patches/collateral-evolutions/drm/14-shrinkers-api/drivers_gpu_drm_i915.patch
+++ /dev/null
@@ -1,116 +0,0 @@
---- a/drivers/gpu/drm/i915/i915_dma.c
-+++ b/drivers/gpu/drm/i915/i915_dma.c
-@@ -1659,7 +1659,11 @@ int i915_driver_load(struct drm_device *
- 	return 0;
- 
- out_gem_unload:
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
- 	if (dev_priv->mm.inactive_shrinker.scan_objects)
-+#else
-+	if (dev_priv->mm.inactive_shrinker.shrink)
-+#endif
- 		unregister_shrinker(&dev_priv->mm.inactive_shrinker);
- 
- 	if (dev->pdev->msi_enabled)
-@@ -1698,7 +1702,11 @@ int i915_driver_unload(struct drm_device
- 
- 	i915_teardown_sysfs(dev);
- 
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
- 	if (dev_priv->mm.inactive_shrinker.scan_objects)
-+#else
-+	if (dev_priv->mm.inactive_shrinker.shrink)
-+#endif
- 		unregister_shrinker(&dev_priv->mm.inactive_shrinker);
- 
- 	mutex_lock(&dev->struct_mutex);
---- a/drivers/gpu/drm/i915/i915_gem.c
-+++ b/drivers/gpu/drm/i915/i915_gem.c
-@@ -57,10 +57,15 @@ static void i915_gem_object_update_fence
- 					 struct drm_i915_fence_reg *fence,
- 					 bool enable);
- 
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
- static unsigned long i915_gem_inactive_count(struct shrinker *shrinker,
- 					     struct shrink_control *sc);
- static unsigned long i915_gem_inactive_scan(struct shrinker *shrinker,
- 					    struct shrink_control *sc);
-+#else
-+static int i915_gem_inactive_shrink(struct shrinker *shrinker,
-+				    struct shrink_control *sc);
-+#endif
- static long i915_gem_purge(struct drm_i915_private *dev_priv, long target);
- static long i915_gem_shrink_all(struct drm_i915_private *dev_priv);
- static void i915_gem_object_truncate(struct drm_i915_gem_object *obj);
-@@ -4559,8 +4564,12 @@ i915_gem_load(struct drm_device *dev)
- 
- 	dev_priv->mm.interruptible = true;
- 
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
- 	dev_priv->mm.inactive_shrinker.scan_objects = i915_gem_inactive_scan;
- 	dev_priv->mm.inactive_shrinker.count_objects = i915_gem_inactive_count;
-+#else
-+	dev_priv->mm.inactive_shrinker.shrink = i915_gem_inactive_shrink;
-+#endif
- 	dev_priv->mm.inactive_shrinker.seeks = DEFAULT_SEEKS;
- 	register_shrinker(&dev_priv->mm.inactive_shrinker);
- }
-@@ -4783,8 +4792,14 @@ static bool mutex_is_locked_by(struct mu
- #endif
- }
- 
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
- static unsigned long
- i915_gem_inactive_count(struct shrinker *shrinker, struct shrink_control *sc)
-+#else
-+#define SHRINK_STOP -1
-+static int
-+i915_gem_inactive_shrink(struct shrinker *shrinker, struct shrink_control *sc)
-+#endif
- {
- 	struct drm_i915_private *dev_priv =
- 		container_of(shrinker,
-@@ -4793,7 +4808,12 @@ i915_gem_inactive_count(struct shrinker
- 	struct drm_device *dev = dev_priv->dev;
- 	struct drm_i915_gem_object *obj;
- 	bool unlock = true;
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
- 	unsigned long count;
-+#else
-+	int nr_to_scan = sc->nr_to_scan;
-+	int count;
-+#endif
- 
- 	if (!mutex_trylock(&dev->struct_mutex)) {
- 		if (!mutex_is_locked_by(&dev->struct_mutex, current))
-@@ -4805,6 +4825,17 @@ i915_gem_inactive_count(struct shrinker
- 		unlock = false;
- 	}
- 
-+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,12,0))
-+	if (nr_to_scan) {
-+		nr_to_scan -= i915_gem_purge(dev_priv, nr_to_scan);
-+		if (nr_to_scan > 0)
-+			nr_to_scan -= __i915_gem_shrink(dev_priv, nr_to_scan,
-+							false);
-+		if (nr_to_scan > 0)
-+			i915_gem_shrink_all(dev_priv);
-+	}
-+#endif
-+
- 	count = 0;
- 	list_for_each_entry(obj, &dev_priv->mm.unbound_list, global_list)
- 		if (obj->pages_pin_count == 0)
-@@ -4884,6 +4915,7 @@ unsigned long i915_gem_obj_size(struct d
- 	return 0;
- }
- 
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
- static unsigned long
- i915_gem_inactive_scan(struct shrinker *shrinker, struct shrink_control *sc)
- {
-@@ -4917,3 +4949,4 @@ i915_gem_inactive_scan(struct shrinker *
- 		mutex_unlock(&dev->struct_mutex);
- 	return freed;
- }
-+#endif
diff --git a/patches/collateral-evolutions/drm/14-shrinkers-api/drivers_gpu_drm_ttm.patch b/patches/collateral-evolutions/drm/14-shrinkers-api/drivers_gpu_drm_ttm.patch
deleted file mode 100644
index 5a8176d..0000000
--- a/patches/collateral-evolutions/drm/14-shrinkers-api/drivers_gpu_drm_ttm.patch
+++ /dev/null
@@ -1,105 +0,0 @@
---- a/drivers/gpu/drm/ttm/ttm_page_alloc.c
-+++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c
-@@ -377,6 +377,9 @@ out:
- 	return nr_free;
- }
- 
-+static unsigned long
-+ttm_pool_shrink_count(struct shrinker *shrink, struct shrink_control *sc);
-+
- /**
-  * Callback for mm to request pool to reduce number of page held.
-  *
-@@ -388,8 +391,13 @@ out:
-  *
-  * This code is crying out for a shrinker per pool....
-  */
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
- static unsigned long
- ttm_pool_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)
-+#else
-+static int ttm_pool_mm_shrink(struct shrinker *shrink,
-+			      struct shrink_control *sc)
-+#endif
- {
- 	static atomic_t start_pool = ATOMIC_INIT(0);
- 	unsigned i;
-@@ -408,7 +416,12 @@ ttm_pool_shrink_scan(struct shrinker *sh
- 		shrink_pages = ttm_page_pool_free(pool, nr_free);
- 		freed += nr_free - shrink_pages;
- 	}
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
- 	return freed;
-+#else
-+	/* return estimated number of unused pages in pool */
-+	return ttm_pool_shrink_count(shrink, sc);
-+#endif
- }
- 
- 
-@@ -426,8 +439,12 @@ ttm_pool_shrink_count(struct shrinker *s
- 
- static void ttm_pool_mm_shrink_init(struct ttm_pool_manager *manager)
- {
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
- 	manager->mm_shrink.count_objects = ttm_pool_shrink_count;
- 	manager->mm_shrink.scan_objects = ttm_pool_shrink_scan;
-+#else
-+	manager->mm_shrink.shrink = ttm_pool_mm_shrink;
-+#endif
- 	manager->mm_shrink.seeks = 1;
- 	register_shrinker(&manager->mm_shrink);
- }
---- a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
-+++ b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
-@@ -987,6 +987,9 @@ void ttm_dma_unpopulate(struct ttm_dma_t
- }
- EXPORT_SYMBOL_GPL(ttm_dma_unpopulate);
- 
-+static unsigned long
-+ttm_dma_pool_shrink_count(struct shrinker *shrink, struct shrink_control *sc);
-+
- /**
-  * Callback for mm to request pool to reduce number of page held.
-  *
-@@ -1000,8 +1003,14 @@ EXPORT_SYMBOL_GPL(ttm_dma_unpopulate);
-  * I'm getting sadder as I hear more pathetical whimpers about needing per-pool
-  * shrinkers
-  */
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
- static unsigned long
- ttm_dma_pool_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)
-+#else
-+#define SHRINK_STOP 0
-+static int ttm_dma_pool_mm_shrink(struct shrinker *shrink,
-+				  struct shrink_control *sc)
-+#endif
- {
- 	static atomic_t start_pool = ATOMIC_INIT(0);
- 	unsigned idx = 0;
-@@ -1034,7 +1043,12 @@ ttm_dma_pool_shrink_scan(struct shrinker
- 			 nr_free, shrink_pages);
- 	}
- 	mutex_unlock(&_manager->lock);
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
- 	return freed;
-+#else
-+	/* return estimated number of unused pages in pool */
-+	return ttm_dma_pool_shrink_count(shrink, sc);
-+#endif
- }
- 
- static unsigned long
-@@ -1052,8 +1066,12 @@ ttm_dma_pool_shrink_count(struct shrinke
- 
- static void ttm_dma_pool_mm_shrink_init(struct ttm_pool_manager *manager)
- {
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
- 	manager->mm_shrink.count_objects = ttm_dma_pool_shrink_count;
- 	manager->mm_shrink.scan_objects = &ttm_dma_pool_shrink_scan;
-+#else
-+	manager->mm_shrink.shrink = ttm_dma_pool_mm_shrink;
-+#endif
- 	manager->mm_shrink.seeks = 1;
- 	register_shrinker(&manager->mm_shrink);
- }
diff --git a/patches/collateral-evolutions/drm/15-intel-gtt/drivers_gpu_drm_i915.patch b/patches/collateral-evolutions/drm/15-intel-gtt/drivers_gpu_drm_i915.patch
deleted file mode 100644
index 9a3074f..0000000
--- a/patches/collateral-evolutions/drm/15-intel-gtt/drivers_gpu_drm_i915.patch
+++ /dev/null
@@ -1,29 +0,0 @@
---- a/drivers/gpu/drm/i915/i915_gem_gtt.c
-+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
-@@ -881,6 +881,9 @@ static int i915_gmch_probe(struct drm_de
- {
- 	struct drm_i915_private *dev_priv = dev->dev_private;
- 	int ret;
-+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0))
-+	const struct intel_gtt *gtt;
-+#endif
- 
- 	ret = intel_gmch_probe(dev_priv->bridge_dev, dev_priv->dev->pdev, NULL);
- 	if (!ret) {
-@@ -888,7 +891,16 @@ static int i915_gmch_probe(struct drm_de
- 		return -EIO;
- 	}
- 
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
- 	intel_gtt_get(gtt_total, stolen, mappable_base, mappable_end);
-+#else
-+	gtt = intel_gtt_get();
-+
-+	*gtt_total = gtt->gtt_total_entries << PAGE_SHIFT;
-+	*stolen = gtt->stolen_size;
-+	*mappable_base = gtt->gma_bus_addr;
-+	*mappable_end = gtt->gtt_mappable_entries << PAGE_SHIFT;
-+#endif
- 
- 	dev_priv->gtt.do_idle_maps = needs_idle_maps(dev_priv->dev);
- 	dev_priv->gtt.base.clear_range = i915_ggtt_clear_range;
diff --git a/patches/collateral-evolutions/drm/16-remove-energy-read/i915.patch b/patches/collateral-evolutions/drm/16-remove-energy-read/i915.patch
deleted file mode 100644
index 6511b99..0000000
--- a/patches/collateral-evolutions/drm/16-remove-energy-read/i915.patch
+++ /dev/null
@@ -1,28 +0,0 @@
---- a/drivers/gpu/drm/i915/i915_debugfs.c
-+++ b/drivers/gpu/drm/i915/i915_debugfs.c
-@@ -1770,6 +1770,7 @@ static int i915_edp_psr_status(struct se
- 	return 0;
- }
- 
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)
- static int i915_energy_uJ(struct seq_file *m, void *data)
- {
- 	struct drm_info_node *node = m->private;
-@@ -1790,6 +1791,7 @@ static int i915_energy_uJ(struct seq_fil
- 	seq_printf(m, "%llu", (long long unsigned)power);
- 	return 0;
- }
-+#endif
- 
- static int
- i915_wedged_get(void *data, u64 *val)
-@@ -2230,7 +2232,9 @@ static struct drm_info_list i915_debugfs
- 	{"i915_dpio", i915_dpio_info, 0},
- 	{"i915_llc", i915_llc, 0},
- 	{"i915_edp_psr_status", i915_edp_psr_status, 0},
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)
- 	{"i915_energy_uJ", i915_energy_uJ, 0},
-+#endif
- };
- #define I915_DEBUGFS_ENTRIES ARRAY_SIZE(i915_debugfs_list)
- 
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [RFC 02/15] backports: remove platform drivers
  2013-10-05 22:43 [RFC 00/15] backports: remove DRM drivers Hauke Mehrtens
  2013-10-05 22:43 ` [RFC 01/15] backports: remove DRM driver Hauke Mehrtens
@ 2013-10-05 22:43 ` Hauke Mehrtens
  2013-10-05 22:43 ` [RFC 03/15] backports: remove BACKPORT_BUILD_CROSS_RESERVATION Hauke Mehrtens
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: Hauke Mehrtens @ 2013-10-05 22:43 UTC (permalink / raw)
  To: mcgrof; +Cc: backports, ozancag, Hauke Mehrtens

The platform drivers were only needed by some DRM drivers and are not
needed any more with the DRM driver being removed.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/Kconfig         |    2 --
 backport/Makefile.kernel |    1 -
 copy-list                |    7 -------
 3 files changed, 10 deletions(-)

diff --git a/backport/Kconfig b/backport/Kconfig
index 0e24c79..64e9cb9 100644
--- a/backport/Kconfig
+++ b/backport/Kconfig
@@ -41,8 +41,6 @@ source net/nfc/Kconfig
 source drivers/regulator/Kconfig
 source drivers/media/Kconfig
 
-source drivers/platform/x86/Kconfig
-
 source net/ieee802154/Kconfig
 source net/mac802154/Kconfig
 source drivers/net/ieee802154/Kconfig
diff --git a/backport/Makefile.kernel b/backport/Makefile.kernel
index 0a2a569..6a1afc1 100644
--- a/backport/Makefile.kernel
+++ b/backport/Makefile.kernel
@@ -33,7 +33,6 @@ obj-$(CPTCFG_NFC) += net/nfc/
 obj-$(CPTCFG_NFC) += drivers/nfc/
 obj-$(CPTCFG_REGULATOR) += drivers/regulator/
 obj-$(CPTCFG_MEDIA_SUPPORT) += drivers/media/
-obj-$(CPTCFG_INTEL_IPS) += drivers/platform/x86/
 
 obj-$(CPTCFG_IEEE802154) += net/ieee802154/
 obj-$(CPTCFG_MAC802154) += net/mac802154/
diff --git a/copy-list b/copy-list
index b741c5d..6035e36 100644
--- a/copy-list
+++ b/copy-list
@@ -171,13 +171,6 @@ include/uapi/linux/videodev2.h
 
 drivers/media/
 
-# Platform
-drivers/platform/x86/Kconfig
-drivers/platform/x86/Makefile
-drivers/platform/x86/intel_ips.c
-drivers/platform/x86/intel_ips.h
-include/asm-generic/io-64-nonatomic-lo-hi.h
-
 include/net/nl802154.h
 include/net/mac802154.h
 include/net/ieee802154.h
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [RFC 03/15] backports: remove BACKPORT_BUILD_CROSS_RESERVATION
  2013-10-05 22:43 [RFC 00/15] backports: remove DRM drivers Hauke Mehrtens
  2013-10-05 22:43 ` [RFC 01/15] backports: remove DRM driver Hauke Mehrtens
  2013-10-05 22:43 ` [RFC 02/15] backports: remove platform drivers Hauke Mehrtens
@ 2013-10-05 22:43 ` Hauke Mehrtens
  2013-10-05 22:43 ` [RFC 04/15] backports: remove CPTCFG_BACKPORT_BUILD_WW_MUTEX Hauke Mehrtens
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: Hauke Mehrtens @ 2013-10-05 22:43 UTC (permalink / raw)
  To: mcgrof; +Cc: backports, ozancag, Hauke Mehrtens

This was only needed for some of the DRM drivers, remove it.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/reservation.h |   70 -------------------------
 backport/compat/Kconfig                       |    7 ---
 backport/compat/Makefile                      |    1 -
 backport/compat/drivers-base-reservation.c    |   39 --------------
 4 files changed, 117 deletions(-)
 delete mode 100644 backport/backport-include/linux/reservation.h
 delete mode 100644 backport/compat/drivers-base-reservation.c

diff --git a/backport/backport-include/linux/reservation.h b/backport/backport-include/linux/reservation.h
deleted file mode 100644
index ff79ae8..0000000
--- a/backport/backport-include/linux/reservation.h
+++ /dev/null
@@ -1,70 +0,0 @@
-#ifndef _BACKPORT_LINUX_RESERVATION_H
-#define _BACKPORT_LINUX_RESERVATION_H
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)
-#include_next <linux/reservation.h>
-#else
-#ifdef CPTCFG_BACKPORT_BUILD_CROSS_RESERVATION
-/*
- * Header file for reservations for dma-buf and ttm
- *
- * Copyright(C) 2011 Linaro Limited. All rights reserved.
- * Copyright (C) 2012-2013 Canonical Ltd
- * Copyright (C) 2012 Texas Instruments
- *
- * Authors:
- * Rob Clark <rob.clark@linaro.org>
- * Maarten Lankhorst <maarten.lankhorst@canonical.com>
- * Thomas Hellstrom <thellstrom-at-vmware-dot-com>
- *
- * Based on bo.c which bears the following copyright notice,
- * but is dual licensed:
- *
- * Copyright (c) 2006-2009 VMware, Inc., Palo Alto, CA., USA
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-#include <linux/ww_mutex.h>
-
-extern struct ww_class reservation_ww_class;
-
-struct reservation_object {
-	struct ww_mutex lock;
-};
-
-#define reservation_object_init LINUX_BACKPORT(reservation_object_init)
-static inline void
-reservation_object_init(struct reservation_object *obj)
-{
-	ww_mutex_init(&obj->lock, &reservation_ww_class);
-}
-
-#define reservation_object_fini LINUX_BACKPORT(reservation_object_fini)
-static inline void
-reservation_object_fini(struct reservation_object *obj)
-{
-	ww_mutex_destroy(&obj->lock);
-}
-
-#endif /* BACKPORT_BUILD_CROSS_RESERVATION */
-#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0) */
-#endif /* _BACKPORT_LINUX_RESERVATION_H */
diff --git a/backport/compat/Kconfig b/backport/compat/Kconfig
index 8377013..f3c1ab3 100644
--- a/backport/compat/Kconfig
+++ b/backport/compat/Kconfig
@@ -139,13 +139,6 @@ config BACKPORT_BUILD_DMA_SHARED_BUFFER
 	#h-file linux/dma-buf.h
 	#c-file drivers/base/dma-buf.c
 
-config BACKPORT_BUILD_CROSS_RESERVATION
-	bool
-	# not possible on kernel < 3.2
-	depends on !BACKPORT_KERNEL_3_2
-	depends on BACKPORT_BUILD_DMA_SHARED_BUFFER || DMA_SHARED_BUFFER
-	default y if BACKPORT_USERSEL_BUILD_ALL
-
 config BACKPORT_DMA_SHARED_BUFFER
 	bool
 
diff --git a/backport/compat/Makefile b/backport/compat/Makefile
index 14b4076..101d0f3 100644
--- a/backport/compat/Makefile
+++ b/backport/compat/Makefile
@@ -42,4 +42,3 @@ compat-$(CPTCFG_BACKPORT_BUILD_GENERIC_ATOMIC64) += compat_atomic.o
 compat-$(CPTCFG_BACKPORT_BUILD_DMA_SHARED_HELPERS) += dma-shared-helpers.o
 compat-$(CPTCFG_BACKPORT_BUILD_RADIX_HELPERS) += lib-radix-tree-helpers.o
 compat-$(CPTCFG_BACKPORT_BUILD_WW_MUTEX) += kernel/ww_mutex.o
-compat-$(CPTCFG_BACKPORT_BUILD_CROSS_RESERVATION) += drivers-base-reservation.o
diff --git a/backport/compat/drivers-base-reservation.c b/backport/compat/drivers-base-reservation.c
deleted file mode 100644
index 840ca1a..0000000
--- a/backport/compat/drivers-base-reservation.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2012-2013 Canonical Ltd
- *
- * Based on bo.c which bears the following copyright notice,
- * but is dual licensed:
- *
- * Copyright (c) 2006-2009 VMware, Inc., Palo Alto, CA., USA
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-/*
- * Authors: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
- */
-
-#include <linux/reservation.h>
-#include <linux/export.h>
-
-DEFINE_WW_CLASS(reservation_ww_class);
-EXPORT_SYMBOL_GPL(reservation_ww_class);
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [RFC 04/15] backports: remove CPTCFG_BACKPORT_BUILD_WW_MUTEX
  2013-10-05 22:43 [RFC 00/15] backports: remove DRM drivers Hauke Mehrtens
                   ` (2 preceding siblings ...)
  2013-10-05 22:43 ` [RFC 03/15] backports: remove BACKPORT_BUILD_CROSS_RESERVATION Hauke Mehrtens
@ 2013-10-05 22:43 ` Hauke Mehrtens
  2013-10-05 22:43 ` [RFC 05/15] backports: remove BACKPORT_BUILD_RADIX_HELPERS Hauke Mehrtens
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: Hauke Mehrtens @ 2013-10-05 22:43 UTC (permalink / raw)
  To: mcgrof; +Cc: backports, ozancag, Hauke Mehrtens

This was only needed for some of the DRM drivers, remove it.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/ww_mutex.h |  333 --------------
 backport/compat/Kconfig                    |   11 -
 backport/compat/Makefile                   |    1 -
 backport/compat/kernel/ww_mutex.c          |  669 ----------------------------
 4 files changed, 1014 deletions(-)
 delete mode 100644 backport/backport-include/linux/ww_mutex.h
 delete mode 100644 backport/compat/kernel/ww_mutex.c

diff --git a/backport/backport-include/linux/ww_mutex.h b/backport/backport-include/linux/ww_mutex.h
deleted file mode 100644
index 0953939..0000000
--- a/backport/backport-include/linux/ww_mutex.h
+++ /dev/null
@@ -1,333 +0,0 @@
-#ifndef __BACKPORT_LINUX_WW_MUTEX_H
-#define __BACKPORT_LINUX_WW_MUTEX_H
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)
-#include_next <linux/ww_mutex.h>
-#else
-#ifdef CPTCFG_BACKPORT_BUILD_WW_MUTEX
-/*
- * Wound/Wait Mutexes: blocking mutual exclusion locks with deadlock avoidance
- *
- * Original mutex implementation started by Ingo Molnar:
- *
- *  Copyright (C) 2004, 2005, 2006 Red Hat, Inc., Ingo Molnar <mingo@redhat.com>
- *
- * Wound/wait implementation:
- *  Copyright (C) 2013 Canonical Ltd.
- *
- * This file contains the main data structure and API definitions.
- */
-
-#include <linux/mutex.h>
-
-struct ww_class {
-	atomic_long_t stamp;
-	struct lock_class_key acquire_key;
-	struct lock_class_key mutex_key;
-	const char *acquire_name;
-	const char *mutex_name;
-};
-
-struct ww_acquire_ctx {
-	struct task_struct *task;
-	unsigned long stamp;
-	unsigned acquired;
-};
-
-struct ww_mutex {
-	struct mutex base;
-	struct ww_acquire_ctx *ctx;
-};
-
-# define __WW_CLASS_MUTEX_INITIALIZER(lockname, ww_class)
-
-#define __WW_CLASS_INITIALIZER(ww_class) \
-		{ .stamp = ATOMIC_LONG_INIT(0) \
-		, .acquire_name = #ww_class "_acquire" \
-		, .mutex_name = #ww_class "_mutex" }
-
-#define __WW_MUTEX_INITIALIZER(lockname, class) \
-		{ .base = { \__MUTEX_INITIALIZER(lockname) } \
-		__WW_CLASS_MUTEX_INITIALIZER(lockname, class) }
-
-#define DEFINE_WW_CLASS(classname) \
-	struct ww_class classname = __WW_CLASS_INITIALIZER(classname)
-
-#define DEFINE_WW_MUTEX(mutexname, ww_class) \
-	struct ww_mutex mutexname = __WW_MUTEX_INITIALIZER(mutexname, ww_class)
-
-/**
- * ww_mutex_init - initialize the w/w mutex
- * @lock: the mutex to be initialized
- * @ww_class: the w/w class the mutex should belong to
- *
- * Initialize the w/w mutex to unlocked state and associate it with the given
- * class.
- *
- * It is not allowed to initialize an already locked mutex.
- */
-#define ww_mutex_init LINUX_BACKPORT(ww_mutex_init)
-static inline void ww_mutex_init(struct ww_mutex *lock,
-				 struct ww_class *ww_class)
-{
-	__mutex_init(&lock->base, ww_class->mutex_name, &ww_class->mutex_key);
-	lock->ctx = NULL;
-}
-
-/**
- * ww_acquire_init - initialize a w/w acquire context
- * @ctx: w/w acquire context to initialize
- * @ww_class: w/w class of the context
- *
- * Initializes an context to acquire multiple mutexes of the given w/w class.
- *
- * Context-based w/w mutex acquiring can be done in any order whatsoever within
- * a given lock class. Deadlocks will be detected and handled with the
- * wait/wound logic.
- *
- * Mixing of context-based w/w mutex acquiring and single w/w mutex locking can
- * result in undetected deadlocks and is so forbidden. Mixing different contexts
- * for the same w/w class when acquiring mutexes can also result in undetected
- * deadlocks, and is hence also forbidden. Both types of abuse will be caught by
- * enabling CONFIG_PROVE_LOCKING.
- *
- * Nesting of acquire contexts for _different_ w/w classes is possible, subject
- * to the usual locking rules between different lock classes.
- *
- * An acquire context must be released with ww_acquire_fini by the same task
- * before the memory is freed. It is recommended to allocate the context itself
- * on the stack.
- */
-#define ww_acquire_init LINUX_BACKPORT(ww_acquire_init)
-static inline void ww_acquire_init(struct ww_acquire_ctx *ctx,
-				   struct ww_class *ww_class)
-{
-	ctx->task = current;
-	ctx->stamp = atomic_long_inc_return(&ww_class->stamp);
-	ctx->acquired = 0;
-}
-
-/**
- * ww_acquire_done - marks the end of the acquire phase
- * @ctx: the acquire context
- *
- * Marks the end of the acquire phase, any further w/w mutex lock calls using
- * this context are forbidden.
- *
- * Calling this function is optional, it is just useful to document w/w mutex
- * code and clearly designated the acquire phase from actually using the locked
- * data structures.
- */
-#define ww_acquire_done LINUX_BACKPORT(ww_acquire_done)
-static inline void ww_acquire_done(struct ww_acquire_ctx *ctx)
-{
-}
-
-/**
- * ww_acquire_fini - releases a w/w acquire context
- * @ctx: the acquire context to free
- *
- * Releases a w/w acquire context. This must be called _after_ all acquired w/w
- * mutexes have been released with ww_mutex_unlock.
- */
-#define ww_acquire_fini LINUX_BACKPORT(ww_acquire_fini)
-static inline void ww_acquire_fini(struct ww_acquire_ctx *ctx)
-{
-}
-
-#define __ww_mutex_lock LINUX_BACKPORT(__ww_mutex_lock)
-extern int __must_check __ww_mutex_lock(struct ww_mutex *lock,
-					struct ww_acquire_ctx *ctx);
-#define __ww_mutex_lock_interruptible LINUX_BACKPORT(__ww_mutex_lock_interruptible)
-extern int __must_check __ww_mutex_lock_interruptible(struct ww_mutex *lock,
-						      struct ww_acquire_ctx *ctx);
-
-/**
- * ww_mutex_lock - acquire the w/w mutex
- * @lock: the mutex to be acquired
- * @ctx: w/w acquire context, or NULL to acquire only a single lock.
- *
- * Lock the w/w mutex exclusively for this task.
- *
- * Deadlocks within a given w/w class of locks are detected and handled with the
- * wait/wound algorithm. If the lock isn't immediately avaiable this function
- * will either sleep until it is (wait case). Or it selects the current context
- * for backing off by returning -EDEADLK (wound case). Trying to acquire the
- * same lock with the same context twice is also detected and signalled by
- * returning -EALREADY. Returns 0 if the mutex was successfully acquired.
- *
- * In the wound case the caller must release all currently held w/w mutexes for
- * the given context and then wait for this contending lock to be available by
- * calling ww_mutex_lock_slow. Alternatively callers can opt to not acquire this
- * lock and proceed with trying to acquire further w/w mutexes (e.g. when
- * scanning through lru lists trying to free resources).
- *
- * The mutex must later on be released by the same task that
- * acquired it. The task may not exit without first unlocking the mutex. Also,
- * kernel memory where the mutex resides must not be freed with the mutex still
- * locked. The mutex must first be initialized (or statically defined) before it
- * can be locked. memset()-ing the mutex to 0 is not allowed. The mutex must be
- * of the same w/w lock class as was used to initialize the acquire context.
- *
- * A mutex acquired with this function must be released with ww_mutex_unlock.
- */
-#define ww_mutex_lock LINUX_BACKPORT(ww_mutex_lock)
-static inline int ww_mutex_lock(struct ww_mutex *lock, struct ww_acquire_ctx *ctx)
-{
-	if (ctx)
-		return __ww_mutex_lock(lock, ctx);
-
-	mutex_lock(&lock->base);
-	return 0;
-}
-
-/**
- * ww_mutex_lock_interruptible - acquire the w/w mutex, interruptible
- * @lock: the mutex to be acquired
- * @ctx: w/w acquire context
- *
- * Lock the w/w mutex exclusively for this task.
- *
- * Deadlocks within a given w/w class of locks are detected and handled with the
- * wait/wound algorithm. If the lock isn't immediately avaiable this function
- * will either sleep until it is (wait case). Or it selects the current context
- * for backing off by returning -EDEADLK (wound case). Trying to acquire the
- * same lock with the same context twice is also detected and signalled by
- * returning -EALREADY. Returns 0 if the mutex was successfully acquired. If a
- * signal arrives while waiting for the lock then this function returns -EINTR.
- *
- * In the wound case the caller must release all currently held w/w mutexes for
- * the given context and then wait for this contending lock to be available by
- * calling ww_mutex_lock_slow_interruptible. Alternatively callers can opt to
- * not acquire this lock and proceed with trying to acquire further w/w mutexes
- * (e.g. when scanning through lru lists trying to free resources).
- *
- * The mutex must later on be released by the same task that
- * acquired it. The task may not exit without first unlocking the mutex. Also,
- * kernel memory where the mutex resides must not be freed with the mutex still
- * locked. The mutex must first be initialized (or statically defined) before it
- * can be locked. memset()-ing the mutex to 0 is not allowed. The mutex must be
- * of the same w/w lock class as was used to initialize the acquire context.
- *
- * A mutex acquired with this function must be released with ww_mutex_unlock.
- */
-#define ww_mutex_lock_interruptible LINUX_BACKPORT(ww_mutex_lock_interruptible)
-static inline int __must_check ww_mutex_lock_interruptible(struct ww_mutex *lock,
-							   struct ww_acquire_ctx *ctx)
-{
-	if (ctx)
-		return __ww_mutex_lock_interruptible(lock, ctx);
-	else
-		return mutex_lock_interruptible(&lock->base);
-}
-
-/**
- * ww_mutex_lock_slow - slowpath acquiring of the w/w mutex
- * @lock: the mutex to be acquired
- * @ctx: w/w acquire context
- *
- * Acquires a w/w mutex with the given context after a wound case. This function
- * will sleep until the lock becomes available.
- *
- * The caller must have released all w/w mutexes already acquired with the
- * context and then call this function on the contended lock.
- *
- * Afterwards the caller may continue to (re)acquire the other w/w mutexes it
- * needs with ww_mutex_lock. Note that the -EALREADY return code from
- * ww_mutex_lock can be used to avoid locking this contended mutex twice.
- *
- * It is forbidden to call this function with any other w/w mutexes associated
- * with the context held. It is forbidden to call this on anything else than the
- * contending mutex.
- *
- * Note that the slowpath lock acquiring can also be done by calling
- * ww_mutex_lock directly. This function here is simply to help w/w mutex
- * locking code readability by clearly denoting the slowpath.
- */
-#define ww_mutex_lock_slow LINUX_BACKPORT(ww_mutex_lock_slow)
-static inline void
-ww_mutex_lock_slow(struct ww_mutex *lock, struct ww_acquire_ctx *ctx)
-{
-	int ret;
-	ret = ww_mutex_lock(lock, ctx);
-	(void)ret;
-}
-
-/**
- * ww_mutex_lock_slow_interruptible - slowpath acquiring of the w/w mutex, interruptible
- * @lock: the mutex to be acquired
- * @ctx: w/w acquire context
- *
- * Acquires a w/w mutex with the given context after a wound case. This function
- * will sleep until the lock becomes available and returns 0 when the lock has
- * been acquired. If a signal arrives while waiting for the lock then this
- * function returns -EINTR.
- *
- * The caller must have released all w/w mutexes already acquired with the
- * context and then call this function on the contended lock.
- *
- * Afterwards the caller may continue to (re)acquire the other w/w mutexes it
- * needs with ww_mutex_lock. Note that the -EALREADY return code from
- * ww_mutex_lock can be used to avoid locking this contended mutex twice.
- *
- * It is forbidden to call this function with any other w/w mutexes associated
- * with the given context held. It is forbidden to call this on anything else
- * than the contending mutex.
- *
- * Note that the slowpath lock acquiring can also be done by calling
- * ww_mutex_lock_interruptible directly. This function here is simply to help
- * w/w mutex locking code readability by clearly denoting the slowpath.
- */
-#define ww_mutex_lock_slow_interruptible LINUX_BACKPORT(ww_mutex_lock_slow_interruptible)
-static inline int __must_check
-ww_mutex_lock_slow_interruptible(struct ww_mutex *lock,
-				 struct ww_acquire_ctx *ctx)
-{
-	return ww_mutex_lock_interruptible(lock, ctx);
-}
-
-#define ww_mutex_unlock LINUX_BACKPORT(ww_mutex_unlock)
-extern void ww_mutex_unlock(struct ww_mutex *lock);
-
-/**
- * ww_mutex_trylock - tries to acquire the w/w mutex without acquire context
- * @lock: mutex to lock
- *
- * Trylocks a mutex without acquire context, so no deadlock detection is
- * possible. Returns 1 if the mutex has been acquired successfully, 0 otherwise.
- */
-#define ww_mutex_trylock LINUX_BACKPORT(ww_mutex_trylock)
-static inline int __must_check ww_mutex_trylock(struct ww_mutex *lock)
-{
-	return mutex_trylock(&lock->base);
-}
-
-/***
- * ww_mutex_destroy - mark a w/w mutex unusable
- * @lock: the mutex to be destroyed
- *
- * This function marks the mutex uninitialized, and any subsequent
- * use of the mutex is forbidden. The mutex must not be locked when
- * this function is called.
- */
-#define ww_mutex_destroy LINUX_BACKPORT(ww_mutex_destroy)
-static inline void ww_mutex_destroy(struct ww_mutex *lock)
-{
-	mutex_destroy(&lock->base);
-}
-
-/**
- * ww_mutex_is_locked - is the w/w mutex locked
- * @lock: the mutex to be queried
- *
- * Returns 1 if the mutex is locked, 0 if unlocked.
- */
-#define ww_mutex_is_locked LINUX_BACKPORT(ww_mutex_is_locked)
-static inline bool ww_mutex_is_locked(struct ww_mutex *lock)
-{
-	return mutex_is_locked(&lock->base);
-}
-
-#endif /* CPTCFG_BACKPORT_BUILD_WW_MUTEX */
-#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0) */
-#endif /* __BACKPORT_LINUX_WW_MUTEX_H */
diff --git a/backport/compat/Kconfig b/backport/compat/Kconfig
index f3c1ab3..e2f0cdd 100644
--- a/backport/compat/Kconfig
+++ b/backport/compat/Kconfig
@@ -185,17 +185,6 @@ config BACKPORT_LEDS_CLASS
 config BACKPORT_LEDS_TRIGGERS
 	bool
 
-config BACKPORT_BUILD_WW_MUTEX
-	bool
-	# Build only if on kernels < 3.11
-	# For now only DRM drivers use ww mutexes.
-	depends on DRM && BACKPORT_KERNEL_3_11
-	default y if BACKPORT_USERSEL_BUILD_ALL
-	# probably a bad idea if you have these options given we
-	# ripped those options out.
-	depends on !DEBUG_MUTEXES
-	depends on !DEBUG_LOCK_ALLOC
-
 config BACKPORT_BUILD_RADIX_HELPERS
 	bool
 	# You have selected to build backported DRM drivers
diff --git a/backport/compat/Makefile b/backport/compat/Makefile
index 101d0f3..a74507e 100644
--- a/backport/compat/Makefile
+++ b/backport/compat/Makefile
@@ -41,4 +41,3 @@ compat-$(CPTCFG_BACKPORT_BUILD_KFIFO) += kfifo.o
 compat-$(CPTCFG_BACKPORT_BUILD_GENERIC_ATOMIC64) += compat_atomic.o
 compat-$(CPTCFG_BACKPORT_BUILD_DMA_SHARED_HELPERS) += dma-shared-helpers.o
 compat-$(CPTCFG_BACKPORT_BUILD_RADIX_HELPERS) += lib-radix-tree-helpers.o
-compat-$(CPTCFG_BACKPORT_BUILD_WW_MUTEX) += kernel/ww_mutex.o
diff --git a/backport/compat/kernel/ww_mutex.c b/backport/compat/kernel/ww_mutex.c
deleted file mode 100644
index 204ac8f..0000000
--- a/backport/compat/kernel/ww_mutex.c
+++ /dev/null
@@ -1,669 +0,0 @@
-/*
- * Copyright (c) 2013  Luis R. Rodriguez <mcgrof@do-not-panic.com>
- *
- * Backport ww mutex for older kernels. This is not supported when
- * DEBUG_MUTEXES or DEBUG_LOCK_ALLOC is enabled.
- *
- * Taken from: kernel/mutex.c - via linux-stable v3.11-rc2
- *
- * Mutexes: blocking mutual exclusion locks
- *
- * Started by Ingo Molnar:
- *
- *  Copyright (C) 2004, 2005, 2006 Red Hat, Inc., Ingo Molnar <mingo@redhat.com>
- *
- * Many thanks to Arjan van de Ven, Thomas Gleixner, Steven Rostedt and
- * David Howells for suggestions and improvements.
- *
- *  - Adaptive spinning for mutexes by Peter Zijlstra. (Ported to mainline
- *    from the -rt tree, where it was originally implemented for rtmutexes
- *    by Steven Rostedt, based on work by Gregory Haskins, Peter Morreale
- *    and Sven Dietrich.
- *
- * Also see Documentation/mutex-design.txt.
- */
-
-#include <linux/mutex.h>
-#include <linux/ww_mutex.h>
-#include <asm/mutex.h>
-#include <linux/sched.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)
-#include <linux/sched/rt.h>
-#endif
-#include <linux/export.h>
-#include <linux/spinlock.h>
-#include <linux/interrupt.h>
-#include <linux/debug_locks.h>
-#include <linux/version.h>
-
-/*
- * A negative mutex count indicates that waiters are sleeping waiting for the
- * mutex.
- */
-#define	MUTEX_SHOW_NO_WAITER(mutex)	(atomic_read(&(mutex)->count) >= 0)
-
-#define spin_lock_mutex(lock, flags) \
-	do { spin_lock(lock); (void)(flags); } while (0)
-#define spin_unlock_mutex(lock, flags) \
-	do { spin_unlock(lock); (void)(flags); } while (0)
-#define mutex_remove_waiter(lock, waiter, ti) \
-	__list_del((waiter)->list.prev, (waiter)->list.next)
-
-#ifdef CONFIG_SMP
-static inline void mutex_set_owner(struct mutex *lock)
-{
-	lock->owner = current;
-}
-
-static inline void mutex_clear_owner(struct mutex *lock)
-{
-	lock->owner = NULL;
-}
-#else
-static inline void mutex_set_owner(struct mutex *lock)
-{
-}
-
-static inline void mutex_clear_owner(struct mutex *lock)
-{
-}
-#endif
-
-
-#ifdef CONFIG_MUTEX_SPIN_ON_OWNER
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) /* 2bd2c92c and 41fcb9f2 */
-/*
- * In order to avoid a stampede of mutex spinners from acquiring the mutex
- * more or less simultaneously, the spinners need to acquire a MCS lock
- * first before spinning on the owner field.
- *
- * We don't inline mspin_lock() so that perf can correctly account for the
- * time spent in this lock function.
- */
-struct mspin_node {
-	struct mspin_node *next ;
-	int		  locked;	/* 1 if lock acquired */
-};
-#define	MLOCK(mutex)	((struct mspin_node **)&((mutex)->spin_mlock))
-
-static noinline
-void mspin_lock(struct mspin_node **lock, struct mspin_node *node)
-{
-	struct mspin_node *prev;
-
-	/* Init node */
-	node->locked = 0;
-	node->next   = NULL;
-
-	prev = xchg(lock, node);
-	if (likely(prev == NULL)) {
-		/* Lock acquired */
-		node->locked = 1;
-		return;
-	}
-	ACCESS_ONCE(prev->next) = node;
-	smp_wmb();
-	/* Wait until the lock holder passes the lock down */
-	while (!ACCESS_ONCE(node->locked))
-		arch_mutex_cpu_relax();
-}
-
-static void mspin_unlock(struct mspin_node **lock, struct mspin_node *node)
-{
-	struct mspin_node *next = ACCESS_ONCE(node->next);
-
-	if (likely(!next)) {
-		/*
-		 * Release the lock by setting it to NULL
-		 */
-		if (cmpxchg(lock, node, NULL) == node)
-			return;
-		/* Wait until the next pointer is set */
-		while (!(next = ACCESS_ONCE(node->next)))
-			arch_mutex_cpu_relax();
-	}
-	ACCESS_ONCE(next->locked) = 1;
-	smp_wmb();
-}
-
-/*
- * Mutex spinning code migrated from kernel/sched/core.c
- */
-
-static inline bool owner_running(struct mutex *lock, struct task_struct *owner)
-{
-	if (lock->owner != owner)
-		return false;
-
-	/*
-	 * Ensure we emit the owner->on_cpu, dereference _after_ checking
-	 * lock->owner still matches owner, if that fails, owner might
-	 * point to free()d memory, if it still matches, the rcu_read_lock()
-	 * ensures the memory stays valid.
-	 */
-	barrier();
-
-	return owner->on_cpu;
-}
-
-/*
- * Look out! "owner" is an entirely speculative pointer
- * access and not reliable.
- */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
-static noinline
-#endif
-int mutex_spin_on_owner(struct mutex *lock, struct task_struct *owner)
-{
-	rcu_read_lock();
-	while (owner_running(lock, owner)) {
-		if (need_resched())
-			break;
-
-		arch_mutex_cpu_relax();
-	}
-	rcu_read_unlock();
-
-	/*
-	 * We break out the loop above on need_resched() and when the
-	 * owner changed, which is a sign for heavy contention. Return
-	 * success only when lock->owner is NULL.
-	 */
-	return lock->owner == NULL;
-}
-
-/*
- * Initial check for entering the mutex spinning loop
- */
-static inline int mutex_can_spin_on_owner(struct mutex *lock)
-{
-	int retval = 1;
-
-	rcu_read_lock();
-	if (lock->owner)
-		retval = lock->owner->on_cpu;
-	rcu_read_unlock();
-	/*
-	 * if lock->owner is not set, the mutex owner may have just acquired
-	 * it and not set the owner yet or the mutex has been released.
-	 */
-	return retval;
-}
-#else /* Backport 2bd2c92c: help keep backport_mutex_lock_common() clean */
-
-struct mspin_node {
-};
-#define	MLOCK(mutex) NULL
-
-static noinline
-void mspin_lock(struct mspin_node **lock, struct mspin_node *node)
-{
-}
-
-static void mspin_unlock(struct mspin_node **lock, struct mspin_node *node)
-{
-}
-
-static inline bool owner_running(struct mutex *lock, struct task_struct *owner)
-{
-	return false;
-}
-
-int mutex_spin_on_owner(struct mutex *lock, struct task_struct *owner)
-{
-	return 1;
-}
-
-static inline int mutex_can_spin_on_owner(struct mutex *lock)
-{
-	return 1;
-}
-#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) */
-#endif /* CONFIG_MUTEX_SPIN_ON_OWNER */
-
-/*
- * Release the lock, slowpath:
- */
-static inline void
-__mutex_unlock_common_slowpath(atomic_t *lock_count, int nested)
-{
-	struct mutex *lock = container_of(lock_count, struct mutex, count);
-	unsigned long flags;
-
-	spin_lock_mutex(&lock->wait_lock, flags);
-	mutex_release(&lock->dep_map, nested, _RET_IP_);
-	/* debug_mutex_unlock(lock); */
-
-	/*
-	 * some architectures leave the lock unlocked in the fastpath failure
-	 * case, others need to leave it locked. In the later case we have to
-	 * unlock it here
-	 */
-	if (__mutex_slowpath_needs_to_unlock())
-		atomic_set(&lock->count, 1);
-
-	if (!list_empty(&lock->wait_list)) {
-		/* get the first entry from the wait-list: */
-		struct mutex_waiter *waiter =
-				list_entry(lock->wait_list.next,
-					   struct mutex_waiter, list);
-
-		/* debug_mutex_wake_waiter(lock, waiter); */
-
-		wake_up_process(waiter->task);
-	}
-
-	spin_unlock_mutex(&lock->wait_lock, flags);
-}
-
-/*
- * Release the lock, slowpath:
- */
-static __used noinline void
-__mutex_unlock_slowpath(atomic_t *lock_count)
-{
-	__mutex_unlock_common_slowpath(lock_count, 1);
-}
-
-/**
- * ww_mutex_unlock - release the w/w mutex
- * @lock: the mutex to be released
- *
- * Unlock a mutex that has been locked by this task previously with any of the
- * ww_mutex_lock* functions (with or without an acquire context). It is
- * forbidden to release the locks after releasing the acquire context.
- *
- * This function must not be used in interrupt context. Unlocking
- * of a unlocked mutex is not allowed.
- */
-void __sched ww_mutex_unlock(struct ww_mutex *lock)
-{
-	/*
-	 * The unlocking fastpath is the 0->1 transition from 'locked'
-	 * into 'unlocked' state:
-	 */
-	if (lock->ctx) {
-		if (lock->ctx->acquired > 0)
-			lock->ctx->acquired--;
-		lock->ctx = NULL;
-	}
-
-	__mutex_fastpath_unlock(&lock->base.count, __mutex_unlock_slowpath);
-}
-EXPORT_SYMBOL_GPL(ww_mutex_unlock);
-
-static inline int __sched
-__mutex_lock_check_stamp(struct mutex *lock, struct ww_acquire_ctx *ctx)
-{
-	struct ww_mutex *ww = container_of(lock, struct ww_mutex, base);
-	struct ww_acquire_ctx *hold_ctx = ACCESS_ONCE(ww->ctx);
-
-	if (!hold_ctx)
-		return 0;
-
-	if (unlikely(ctx == hold_ctx))
-		return -EALREADY;
-
-	if (ctx->stamp - hold_ctx->stamp <= LONG_MAX &&
-	    (ctx->stamp != hold_ctx->stamp || ctx > hold_ctx)) {
-		return -EDEADLK;
-	}
-
-	return 0;
-}
-
-static __always_inline void ww_mutex_lock_acquired(struct ww_mutex *ww,
-						   struct ww_acquire_ctx *ww_ctx)
-{
-	ww_ctx->acquired++;
-}
-
-/*
- * after acquiring lock with fastpath or when we lost out in contested
- * slowpath, set ctx and wake up any waiters so they can recheck.
- *
- * This function is never called when CONFIG_DEBUG_LOCK_ALLOC is set,
- * as the fastpath and opportunistic spinning are disabled in that case.
- */
-static __always_inline void
-ww_mutex_set_context_fastpath(struct ww_mutex *lock,
-			       struct ww_acquire_ctx *ctx)
-{
-	unsigned long flags;
-	struct mutex_waiter *cur;
-
-	ww_mutex_lock_acquired(lock, ctx);
-
-	lock->ctx = ctx;
-
-	/*
-	 * The lock->ctx update should be visible on all cores before
-	 * the atomic read is done, otherwise contended waiters might be
-	 * missed. The contended waiters will either see ww_ctx == NULL
-	 * and keep spinning, or it will acquire wait_lock, add itself
-	 * to waiter list and sleep.
-	 */
-	smp_mb(); /* ^^^ */
-
-	/*
-	 * Check if lock is contended, if not there is nobody to wake up
-	 */
-	if (likely(atomic_read(&lock->base.count) == 0))
-		return;
-
-	/*
-	 * Uh oh, we raced in fastpath, wake up everyone in this case,
-	 * so they can see the new lock->ctx.
-	 */
-	spin_lock_mutex(&lock->base.wait_lock, flags);
-	list_for_each_entry(cur, &lock->base.wait_list, list) {
-		/* debug_mutex_wake_waiter(&lock->base, cur); */
-		wake_up_process(cur->task);
-	}
-	spin_unlock_mutex(&lock->base.wait_lock, flags);
-}
-
-/**
- * backport_schedule_preempt_disabled - called with preemption disabled
- *
- * Backports c5491ea7. This is not exported so we leave it
- * here as this is the only current core user on backports.
- * Although available on >= 3.4 its only for in-kernel code so
- * we provide our own.
- *
- * Returns with preemption disabled. Note: preempt_count must be 1
- */
-static void __sched backport_schedule_preempt_disabled(void)
-{
-	preempt_enable_no_resched();
-	schedule();
-	preempt_disable();
-}
-
-/*
- * Lock a mutex (possibly interruptible), slowpath:
- */
-static __always_inline int __sched
-__backport_mutex_lock_common(struct mutex *lock, long state,
-			     unsigned int subclass,
-			     struct lockdep_map *nest_lock, unsigned long ip,
-			     struct ww_acquire_ctx *ww_ctx)
-{
-	struct task_struct *task = current;
-	struct mutex_waiter waiter;
-	unsigned long flags;
-	int ret;
-
-	preempt_disable();
-	mutex_acquire_nest(&lock->dep_map, subclass, 0, nest_lock, ip);
-
-#ifdef CONFIG_MUTEX_SPIN_ON_OWNER
-	/*
-	 * Optimistic spinning.
-	 *
-	 * We try to spin for acquisition when we find that there are no
-	 * pending waiters and the lock owner is currently running on a
-	 * (different) CPU.
-	 *
-	 * The rationale is that if the lock owner is running, it is likely to
-	 * release the lock soon.
-	 *
-	 * Since this needs the lock owner, and this mutex implementation
-	 * doesn't track the owner atomically in the lock field, we need to
-	 * track it non-atomically.
-	 *
-	 * We can't do this for DEBUG_MUTEXES because that relies on wait_lock
-	 * to serialize everything.
-	 *
-	 * The mutex spinners are queued up using MCS lock so that only one
-	 * spinner can compete for the mutex. However, if mutex spinning isn't
-	 * going to happen, there is no point in going through the lock/unlock
-	 * overhead.
-	 */
-	if (!mutex_can_spin_on_owner(lock))
-		goto slowpath;
-
-	for (;;) {
-		struct task_struct *owner;
-		struct mspin_node  node;
-
-		if (!__builtin_constant_p(ww_ctx == NULL) && ww_ctx->acquired > 0) {
-			struct ww_mutex *ww;
-
-			ww = container_of(lock, struct ww_mutex, base);
-			/*
-			 * If ww->ctx is set the contents are undefined, only
-			 * by acquiring wait_lock there is a guarantee that
-			 * they are not invalid when reading.
-			 *
-			 * As such, when deadlock detection needs to be
-			 * performed the optimistic spinning cannot be done.
-			 */
-			if (ACCESS_ONCE(ww->ctx))
-				break;
-		}
-
-		/*
-		 * If there's an owner, wait for it to either
-		 * release the lock or go to sleep.
-		 */
-		mspin_lock(MLOCK(lock), &node);
-		owner = ACCESS_ONCE(lock->owner);
-		if (owner && !mutex_spin_on_owner(lock, owner)) {
-			mspin_unlock(MLOCK(lock), &node);
-			break;
-		}
-
-		if ((atomic_read(&lock->count) == 1) &&
-		    (atomic_cmpxchg(&lock->count, 1, 0) == 1)) {
-			lock_acquired(&lock->dep_map, ip);
-			if (!__builtin_constant_p(ww_ctx == NULL)) {
-				struct ww_mutex *ww;
-				ww = container_of(lock, struct ww_mutex, base);
-
-				ww_mutex_set_context_fastpath(ww, ww_ctx);
-			}
-
-			mutex_set_owner(lock);
-			mspin_unlock(MLOCK(lock), &node);
-			preempt_enable();
-			return 0;
-		}
-		mspin_unlock(MLOCK(lock), &node);
-
-		/*
-		 * When there's no owner, we might have preempted between the
-		 * owner acquiring the lock and setting the owner field. If
-		 * we're an RT task that will live-lock because we won't let
-		 * the owner complete.
-		 */
-		if (!owner && (need_resched() || rt_task(task)))
-			break;
-
-		/*
-		 * The cpu_relax() call is a compiler barrier which forces
-		 * everything in this loop to be re-loaded. We don't need
-		 * memory barriers as we'll eventually observe the right
-		 * values at the cost of a few extra spins.
-		 */
-		arch_mutex_cpu_relax();
-	}
-slowpath:
-#endif
-	spin_lock_mutex(&lock->wait_lock, flags);
-
-	/* We don't support DEBUG_MUTEXES on the backport */
-	/* debug_mutex_lock_common(lock, &waiter); */
-	/* debug_mutex_add_waiter(lock, &waiter, task_thread_info(task)); */
-
-	/* add waiting tasks to the end of the waitqueue (FIFO): */
-	list_add_tail(&waiter.list, &lock->wait_list);
-	waiter.task = task;
-
-	if (MUTEX_SHOW_NO_WAITER(lock) && (atomic_xchg(&lock->count, -1) == 1))
-		goto done;
-
-	lock_contended(&lock->dep_map, ip);
-
-	for (;;) {
-		/*
-		 * Lets try to take the lock again - this is needed even if
-		 * we get here for the first time (shortly after failing to
-		 * acquire the lock), to make sure that we get a wakeup once
-		 * it's unlocked. Later on, if we sleep, this is the
-		 * operation that gives us the lock. We xchg it to -1, so
-		 * that when we release the lock, we properly wake up the
-		 * other waiters:
-		 */
-		if (MUTEX_SHOW_NO_WAITER(lock) &&
-		   (atomic_xchg(&lock->count, -1) == 1))
-			break;
-
-		/*
-		 * got a signal? (This code gets eliminated in the
-		 * TASK_UNINTERRUPTIBLE case.)
-		 */
-		if (unlikely(signal_pending_state(state, task))) {
-			ret = -EINTR;
-			goto err;
-		}
-
-		if (!__builtin_constant_p(ww_ctx == NULL) && ww_ctx->acquired > 0) {
-			ret = __mutex_lock_check_stamp(lock, ww_ctx);
-			if (ret)
-				goto err;
-		}
-
-		__set_task_state(task, state);
-
-		/* didn't get the lock, go to sleep: */
-		spin_unlock_mutex(&lock->wait_lock, flags);
-		backport_schedule_preempt_disabled();
-		spin_lock_mutex(&lock->wait_lock, flags);
-	}
-
-done:
-	lock_acquired(&lock->dep_map, ip);
-	/* got the lock - rejoice! */
-	mutex_remove_waiter(lock, &waiter, current_thread_info());
-	mutex_set_owner(lock);
-
-	if (!__builtin_constant_p(ww_ctx == NULL)) {
-		struct ww_mutex *ww = container_of(lock,
-						      struct ww_mutex,
-						      base);
-		struct mutex_waiter *cur;
-
-		/*
-		 * This branch gets optimized out for the common case,
-		 * and is only important for ww_mutex_lock.
-		 */
-
-		ww_mutex_lock_acquired(ww, ww_ctx);
-		ww->ctx = ww_ctx;
-
-		/*
-		 * Give any possible sleeping processes the chance to wake up,
-		 * so they can recheck if they have to back off.
-		 */
-		list_for_each_entry(cur, &lock->wait_list, list) {
-			/* debug_mutex_wake_waiter(lock, cur); */
-			wake_up_process(cur->task);
-		}
-	}
-
-	/* set it to 0 if there are no waiters left: */
-	if (likely(list_empty(&lock->wait_list)))
-		atomic_set(&lock->count, 0);
-
-	spin_unlock_mutex(&lock->wait_lock, flags);
-
-	/* debug_mutex_free_waiter(&waiter); */
-	preempt_enable();
-
-	return 0;
-
-err:
-	mutex_remove_waiter(lock, &waiter, task_thread_info(task));
-	spin_unlock_mutex(&lock->wait_lock, flags);
-	/* debug_mutex_free_waiter(&waiter); */
-	mutex_release(&lock->dep_map, 1, ip);
-	preempt_enable();
-	return ret;
-}
-
-static noinline int __sched
-__ww_mutex_lock_slowpath(struct ww_mutex *lock, struct ww_acquire_ctx *ctx)
-{
-	return __backport_mutex_lock_common(&lock->base, TASK_UNINTERRUPTIBLE, 0,
-					    NULL, _RET_IP_, ctx);
-}
-
-static noinline int __sched
-__ww_mutex_lock_interruptible_slowpath(struct ww_mutex *lock,
-					    struct ww_acquire_ctx *ctx)
-{
-	return __backport_mutex_lock_common(&lock->base, TASK_INTERRUPTIBLE, 0,
-					    NULL, _RET_IP_, ctx);
-}
-
-/**
- * __mutex_fastpath_lock_retval - try to take the lock by moving the count
- *				  from 1 to a 0 value
- * @count: pointer of type atomic_t
- *
- * For backporting purposes we can't use the older kernel's
- * __mutex_fastpath_lock_retval() since upon failure of a fastpath
- * lock we want to call our a failure routine with more than one argument, in
- * this case the context for ww mutexes. Refer to commit a41b56ef the
- * argument increase. It'd be painful to backport all asm code for the
- * supported architectures so instead lets penalize the backport ww mutex
- * fastpath lock with the not so efficient generic atomic_dec_return()
- * implementation.
- *
- * Change the count from 1 to a value lower than 1. This function returns 0
- * if the fastpath succeeds, or -1 otherwise.
- */
-static inline int
-__backport_mutex_fastpath_lock_retval(atomic_t *count)
-{
-	if (unlikely(atomic_dec_return(count) < 0))
-		return -1;
-	return 0;
-}
-
-int __sched
-__ww_mutex_lock(struct ww_mutex *lock, struct ww_acquire_ctx *ctx)
-{
-	int ret;
-
-	might_sleep();
-
-	ret = __backport_mutex_fastpath_lock_retval(&lock->base.count);
-
-	if (likely(!ret)) {
-		ww_mutex_set_context_fastpath(lock, ctx);
-		mutex_set_owner(&lock->base);
-	} else
-		ret = __ww_mutex_lock_slowpath(lock, ctx);
-	return ret;
-}
-EXPORT_SYMBOL_GPL(__ww_mutex_lock);
-
-int __sched
-__ww_mutex_lock_interruptible(struct ww_mutex *lock, struct ww_acquire_ctx *ctx)
-{
-	int ret;
-
-	might_sleep();
-
-	ret = __backport_mutex_fastpath_lock_retval(&lock->base.count);
-
-	if (likely(!ret)) {
-		ww_mutex_set_context_fastpath(lock, ctx);
-		mutex_set_owner(&lock->base);
-	} else
-		ret = __ww_mutex_lock_interruptible_slowpath(lock, ctx);
-	return ret;
-}
-EXPORT_SYMBOL_GPL(__ww_mutex_lock_interruptible);
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [RFC 05/15] backports: remove BACKPORT_BUILD_RADIX_HELPERS
  2013-10-05 22:43 [RFC 00/15] backports: remove DRM drivers Hauke Mehrtens
                   ` (3 preceding siblings ...)
  2013-10-05 22:43 ` [RFC 04/15] backports: remove CPTCFG_BACKPORT_BUILD_WW_MUTEX Hauke Mehrtens
@ 2013-10-05 22:43 ` Hauke Mehrtens
  2013-10-05 22:43 ` [RFC 06/15] backports: remove BACKPORT_BUILD_HDMI Hauke Mehrtens
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: Hauke Mehrtens @ 2013-10-05 22:43 UTC (permalink / raw)
  To: mcgrof; +Cc: backports, ozancag, Hauke Mehrtens

This was only needed for some of the DRM drivers, remove it.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/radix-tree.h |  218 ---------------------
 backport/compat/Kconfig                      |    7 -
 backport/compat/Makefile                     |    1 -
 backport/compat/lib-radix-tree-helpers.c     |  266 --------------------------
 4 files changed, 492 deletions(-)
 delete mode 100644 backport/backport-include/linux/radix-tree.h
 delete mode 100644 backport/compat/lib-radix-tree-helpers.c

diff --git a/backport/backport-include/linux/radix-tree.h b/backport/backport-include/linux/radix-tree.h
deleted file mode 100644
index 6ca7c05..0000000
--- a/backport/backport-include/linux/radix-tree.h
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * Copyright (C) 2013 Konstantin Khlebnikov
- * Copyright (C) 2013 Luis R. Rodriguez <mcgrof@do-not-panic.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2, or (at
- * your option) any later version.
- *
- */
-#ifndef BACKPORT_LINUX_RADIX_TREE_H
-#define BACKPORT_LINUX_RADIX_TREE_H
-
-#include_next <linux/radix-tree.h>
-
-#ifdef CPTCFG_BACKPORT_BUILD_RADIX_HELPERS
-
-/**
- * struct radix_tree_iter - radix tree iterator state
- *
- * @index:	index of current slot
- * @next_index:	next-to-last index for this chunk
- * @tags:	bit-mask for tag-iterating
- *
- * This radix tree iterator works in terms of "chunks" of slots.  A chunk is a
- * subinterval of slots contained within one radix tree leaf node.  It is
- * described by a pointer to its first slot and a struct radix_tree_iter
- * which holds the chunk's position in the tree and its size.  For tagged
- * iteration radix_tree_iter also holds the slots' bit-mask for one chosen
- * radix tree tag.
- */
-struct radix_tree_iter {
-	unsigned long	index;
-	unsigned long	next_index;
-	unsigned long	tags;
-};
-
-#define RADIX_TREE_ITER_TAG_MASK	0x00FF	/* tag index in lower byte */
-#define RADIX_TREE_ITER_TAGGED		0x0100	/* lookup tagged slots */
-#define RADIX_TREE_ITER_CONTIG		0x0200	/* stop at first hole */
-
-/**
- * radix_tree_iter_init - initialize radix tree iterator
- *
- * @iter:	pointer to iterator state
- * @start:	iteration starting index
- * Returns:	NULL
- */
-static __always_inline void **
-radix_tree_iter_init(struct radix_tree_iter *iter, unsigned long start)
-{
-	/*
-	 * Leave iter->tags uninitialized. radix_tree_next_chunk() will fill it
-	 * in the case of a successful tagged chunk lookup.  If the lookup was
-	 * unsuccessful or non-tagged then nobody cares about ->tags.
-	 *
-	 * Set index to zero to bypass next_index overflow protection.
-	 * See the comment in radix_tree_next_chunk() for details.
-	 */
-	iter->index = 0;
-	iter->next_index = start;
-	return NULL;
-}
-
-/**
- * radix_tree_next_chunk - find next chunk of slots for iteration
- *
- * @root:	radix tree root
- * @iter:	iterator state
- * @flags:	RADIX_TREE_ITER_* flags and tag index
- * Returns:	pointer to chunk first slot, or NULL if there no more left
- *
- * This function looks up the next chunk in the radix tree starting from
- * @iter->next_index.  It returns a pointer to the chunk's first slot.
- * Also it fills @iter with data about chunk: position in the tree (index),
- * its end (next_index), and constructs a bit mask for tagged iterating (tags).
- */
-void **radix_tree_next_chunk(struct radix_tree_root *root,
-			     struct radix_tree_iter *iter, unsigned flags);
-
-/**
- * radix_tree_chunk_size - get current chunk size
- *
- * @iter:	pointer to radix tree iterator
- * Returns:	current chunk size
- */
-static __always_inline unsigned
-radix_tree_chunk_size(struct radix_tree_iter *iter)
-{
-	return iter->next_index - iter->index;
-}
-
-/**
- * radix_tree_next_slot - find next slot in chunk
- *
- * @slot:	pointer to current slot
- * @iter:	pointer to interator state
- * @flags:	RADIX_TREE_ITER_*, should be constant
- * Returns:	pointer to next slot, or NULL if there no more left
- *
- * This function updates @iter->index in the case of a successful lookup.
- * For tagged lookup it also eats @iter->tags.
- */
-static __always_inline void **
-radix_tree_next_slot(void **slot, struct radix_tree_iter *iter, unsigned flags)
-{
-	if (flags & RADIX_TREE_ITER_TAGGED) {
-		iter->tags >>= 1;
-		if (likely(iter->tags & 1ul)) {
-			iter->index++;
-			return slot + 1;
-		}
-		if (!(flags & RADIX_TREE_ITER_CONTIG) && likely(iter->tags)) {
-			unsigned offset = __ffs(iter->tags);
-
-			iter->tags >>= offset;
-			iter->index += offset + 1;
-			return slot + offset + 1;
-		}
-	} else {
-		unsigned size = radix_tree_chunk_size(iter) - 1;
-
-		while (size--) {
-			slot++;
-			iter->index++;
-			if (likely(*slot))
-				return slot;
-			if (flags & RADIX_TREE_ITER_CONTIG) {
-				/* forbid switching to the next chunk */
-				iter->next_index = 0;
-				break;
-			}
-		}
-	}
-	return NULL;
-}
-
-/**
- * radix_tree_for_each_chunk - iterate over chunks
- *
- * @slot:	the void** variable for pointer to chunk first slot
- * @root:	the struct radix_tree_root pointer
- * @iter:	the struct radix_tree_iter pointer
- * @start:	iteration starting index
- * @flags:	RADIX_TREE_ITER_* and tag index
- *
- * Locks can be released and reacquired between iterations.
- */
-#define radix_tree_for_each_chunk(slot, root, iter, start, flags)	\
-	for (slot = radix_tree_iter_init(iter, start) ;			\
-	      (slot = radix_tree_next_chunk(root, iter, flags)) ;)
-
-/**
- * radix_tree_for_each_chunk_slot - iterate over slots in one chunk
- *
- * @slot:	the void** variable, at the beginning points to chunk first slot
- * @iter:	the struct radix_tree_iter pointer
- * @flags:	RADIX_TREE_ITER_*, should be constant
- *
- * This macro is designed to be nested inside radix_tree_for_each_chunk().
- * @slot points to the radix tree slot, @iter->index contains its index.
- */
-#define radix_tree_for_each_chunk_slot(slot, iter, flags)		\
-	for (; slot ; slot = radix_tree_next_slot(slot, iter, flags))
-
-/**
- * radix_tree_for_each_slot - iterate over non-empty slots
- *
- * @slot:	the void** variable for pointer to slot
- * @root:	the struct radix_tree_root pointer
- * @iter:	the struct radix_tree_iter pointer
- * @start:	iteration starting index
- *
- * @slot points to radix tree slot, @iter->index contains its index.
- */
-#define radix_tree_for_each_slot(slot, root, iter, start)		\
-	for (slot = radix_tree_iter_init(iter, start) ;			\
-	     slot || (slot = radix_tree_next_chunk(root, iter, 0)) ;	\
-	     slot = radix_tree_next_slot(slot, iter, 0))
-
-/**
- * radix_tree_for_each_contig - iterate over contiguous slots
- *
- * @slot:	the void** variable for pointer to slot
- * @root:	the struct radix_tree_root pointer
- * @iter:	the struct radix_tree_iter pointer
- * @start:	iteration starting index
- *
- * @slot points to radix tree slot, @iter->index contains its index.
- */
-#define radix_tree_for_each_contig(slot, root, iter, start)		\
-	for (slot = radix_tree_iter_init(iter, start) ;			\
-	     slot || (slot = radix_tree_next_chunk(root, iter,		\
-				RADIX_TREE_ITER_CONTIG)) ;		\
-	     slot = radix_tree_next_slot(slot, iter,			\
-				RADIX_TREE_ITER_CONTIG))
-
-/**
- * radix_tree_for_each_tagged - iterate over tagged slots
- *
- * @slot:	the void** variable for pointer to slot
- * @root:	the struct radix_tree_root pointer
- * @iter:	the struct radix_tree_iter pointer
- * @start:	iteration starting index
- * @tag:	tag index
- *
- * @slot points to radix tree slot, @iter->index contains its index.
- */
-#define radix_tree_for_each_tagged(slot, root, iter, start, tag)	\
-	for (slot = radix_tree_iter_init(iter, start) ;			\
-	     slot || (slot = radix_tree_next_chunk(root, iter,		\
-			      RADIX_TREE_ITER_TAGGED | tag)) ;		\
-	     slot = radix_tree_next_slot(slot, iter,			\
-				RADIX_TREE_ITER_TAGGED))
-
-#endif /* CPTCFG_BACKPORT_BUILD_RADIX_HELPERS */
-
-#endif /* BACKPORT_LINUX_RADIX_TREE_H */
diff --git a/backport/compat/Kconfig b/backport/compat/Kconfig
index e2f0cdd..215de8e 100644
--- a/backport/compat/Kconfig
+++ b/backport/compat/Kconfig
@@ -185,13 +185,6 @@ config BACKPORT_LEDS_CLASS
 config BACKPORT_LEDS_TRIGGERS
 	bool
 
-config BACKPORT_BUILD_RADIX_HELPERS
-	bool
-	# You have selected to build backported DRM drivers
-	# Build only if on < 3.4
-	depends on DRM && BACKPORT_KERNEL_3_4
-	default y if BACKPORT_USERSEL_BUILD_ALL
-
 config BACKPORT_USERSEL_BUILD_ALL
 	bool "Build all compat code"
 	help
diff --git a/backport/compat/Makefile b/backport/compat/Makefile
index a74507e..2d4928c 100644
--- a/backport/compat/Makefile
+++ b/backport/compat/Makefile
@@ -40,4 +40,3 @@ compat-$(CPTCFG_BACKPORT_KERNEL_3_12) += backport-3.12.o
 compat-$(CPTCFG_BACKPORT_BUILD_KFIFO) += kfifo.o
 compat-$(CPTCFG_BACKPORT_BUILD_GENERIC_ATOMIC64) += compat_atomic.o
 compat-$(CPTCFG_BACKPORT_BUILD_DMA_SHARED_HELPERS) += dma-shared-helpers.o
-compat-$(CPTCFG_BACKPORT_BUILD_RADIX_HELPERS) += lib-radix-tree-helpers.o
diff --git a/backport/compat/lib-radix-tree-helpers.c b/backport/compat/lib-radix-tree-helpers.c
deleted file mode 100644
index 837de04..0000000
--- a/backport/compat/lib-radix-tree-helpers.c
+++ /dev/null
@@ -1,266 +0,0 @@
-/*
- * Copyright (C) 2013 Konstantin Khlebnikov
- * Copyright (c) 2013 Luis R. Rodriguez <mcgrof@do-not-panic.com>
- *
- * Backports radix_tree_next_chunk()
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2, or (at
- * your option) any later version.
- */
-
-#include <linux/errno.h>
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/export.h>
-#include <linux/radix-tree.h>
-#include <linux/percpu.h>
-#include <linux/slab.h>
-#include <linux/notifier.h>
-#include <linux/cpu.h>
-#include <linux/string.h>
-#include <linux/bitops.h>
-#include <linux/rcupdate.h>
-
-#ifdef __KERNEL__
-#define RADIX_TREE_MAP_SHIFT	(CONFIG_BASE_SMALL ? 4 : 6)
-#else
-#define RADIX_TREE_MAP_SHIFT	3	/* For more stressful testing */
-#endif
-
-#define RADIX_TREE_MAP_SIZE	(1UL << RADIX_TREE_MAP_SHIFT)
-#define RADIX_TREE_MAP_MASK	(RADIX_TREE_MAP_SIZE-1)
-
-#define RADIX_TREE_TAG_LONGS	\
-	((RADIX_TREE_MAP_SIZE + BITS_PER_LONG - 1) / BITS_PER_LONG)
-
-struct radix_tree_node {
-	unsigned int	height;		/* Height from the bottom */
-	unsigned int	count;
-	union {
-		struct radix_tree_node *parent;	/* Used when ascending tree */
-		struct rcu_head	rcu_head;	/* Used when freeing node */
-	};
-	void __rcu	*slots[RADIX_TREE_MAP_SIZE];
-	unsigned long	tags[RADIX_TREE_MAX_TAGS][RADIX_TREE_TAG_LONGS];
-};
-
-static inline void *ptr_to_indirect(void *ptr)
-{
-	return (void *)((unsigned long)ptr | RADIX_TREE_INDIRECT_PTR);
-}
-
-static inline void *indirect_to_ptr(void *ptr)
-{
-	return (void *)((unsigned long)ptr & ~RADIX_TREE_INDIRECT_PTR);
-}
-
-static inline gfp_t root_gfp_mask(struct radix_tree_root *root)
-{
-	return root->gfp_mask & __GFP_BITS_MASK;
-}
-
-static inline void tag_set(struct radix_tree_node *node, unsigned int tag,
-		int offset)
-{
-	__set_bit(offset, node->tags[tag]);
-}
-
-static inline void tag_clear(struct radix_tree_node *node, unsigned int tag,
-		int offset)
-{
-	__clear_bit(offset, node->tags[tag]);
-}
-
-static inline int tag_get(struct radix_tree_node *node, unsigned int tag,
-		int offset)
-{
-	return test_bit(offset, node->tags[tag]);
-}
-
-static inline void root_tag_set(struct radix_tree_root *root, unsigned int tag)
-{
-	root->gfp_mask |= (__force gfp_t)(1 << (tag + __GFP_BITS_SHIFT));
-}
-
-static inline void root_tag_clear(struct radix_tree_root *root, unsigned int tag)
-{
-	root->gfp_mask &= (__force gfp_t)~(1 << (tag + __GFP_BITS_SHIFT));
-}
-
-static inline void root_tag_clear_all(struct radix_tree_root *root)
-{
-	root->gfp_mask &= __GFP_BITS_MASK;
-}
-
-static inline int root_tag_get(struct radix_tree_root *root, unsigned int tag)
-{
-	return (__force unsigned)root->gfp_mask & (1 << (tag + __GFP_BITS_SHIFT));
-}
-
-/*
- * Returns 1 if any slot in the node has this tag set.
- * Otherwise returns 0.
- */
-static inline int any_tag_set(struct radix_tree_node *node, unsigned int tag)
-{
-	int idx;
-	for (idx = 0; idx < RADIX_TREE_TAG_LONGS; idx++) {
-		if (node->tags[tag][idx])
-			return 1;
-	}
-	return 0;
-}
-
-/**
- * radix_tree_find_next_bit - find the next set bit in a memory region
- *
- * @addr: The address to base the search on
- * @size: The bitmap size in bits
- * @offset: The bitnumber to start searching at
- *
- * Unrollable variant of find_next_bit() for constant size arrays.
- * Tail bits starting from size to roundup(size, BITS_PER_LONG) must be zero.
- * Returns next bit offset, or size if nothing found.
- */
-static __always_inline unsigned long
-radix_tree_find_next_bit(const unsigned long *addr,
-			 unsigned long size, unsigned long offset)
-{
-	if (!__builtin_constant_p(size))
-		return find_next_bit(addr, size, offset);
-
-	if (offset < size) {
-		unsigned long tmp;
-
-		addr += offset / BITS_PER_LONG;
-		tmp = *addr >> (offset % BITS_PER_LONG);
-		if (tmp)
-			return __ffs(tmp) + offset;
-		offset = (offset + BITS_PER_LONG) & ~(BITS_PER_LONG - 1);
-		while (offset < size) {
-			tmp = *++addr;
-			if (tmp)
-				return __ffs(tmp) + offset;
-			offset += BITS_PER_LONG;
-		}
-	}
-	return size;
-}
-
-/**
- * radix_tree_next_chunk - find next chunk of slots for iteration
- *
- * @root:	radix tree root
- * @iter:	iterator state
- * @flags:	RADIX_TREE_ITER_* flags and tag index
- * Returns:	pointer to chunk first slot, or NULL if iteration is over
- */
-void **radix_tree_next_chunk(struct radix_tree_root *root,
-			     struct radix_tree_iter *iter, unsigned flags)
-{
-	unsigned shift, tag = flags & RADIX_TREE_ITER_TAG_MASK;
-	struct radix_tree_node *rnode, *node;
-	unsigned long index, offset;
-
-	if ((flags & RADIX_TREE_ITER_TAGGED) && !root_tag_get(root, tag))
-		return NULL;
-
-	/*
-	 * Catch next_index overflow after ~0UL. iter->index never overflows
-	 * during iterating; it can be zero only at the beginning.
-	 * And we cannot overflow iter->next_index in a single step,
-	 * because RADIX_TREE_MAP_SHIFT < BITS_PER_LONG.
-	 *
-	 * This condition also used by radix_tree_next_slot() to stop
-	 * contiguous iterating, and forbid swithing to the next chunk.
-	 */
-	index = iter->next_index;
-	if (!index && iter->index)
-		return NULL;
-
-	rnode = rcu_dereference_raw(root->rnode);
-	if (radix_tree_is_indirect_ptr(rnode)) {
-		rnode = indirect_to_ptr(rnode);
-	} else if (rnode && !index) {
-		/* Single-slot tree */
-		iter->index = 0;
-		iter->next_index = 1;
-		iter->tags = 1;
-		return (void **)&root->rnode;
-	} else
-		return NULL;
-
-restart:
-	shift = (rnode->height - 1) * RADIX_TREE_MAP_SHIFT;
-	offset = index >> shift;
-
-	/* Index outside of the tree */
-	if (offset >= RADIX_TREE_MAP_SIZE)
-		return NULL;
-
-	node = rnode;
-	while (1) {
-		if ((flags & RADIX_TREE_ITER_TAGGED) ?
-				!test_bit(offset, node->tags[tag]) :
-				!node->slots[offset]) {
-			/* Hole detected */
-			if (flags & RADIX_TREE_ITER_CONTIG)
-				return NULL;
-
-			if (flags & RADIX_TREE_ITER_TAGGED)
-				offset = radix_tree_find_next_bit(
-						node->tags[tag],
-						RADIX_TREE_MAP_SIZE,
-						offset + 1);
-			else
-				while (++offset	< RADIX_TREE_MAP_SIZE) {
-					if (node->slots[offset])
-						break;
-				}
-			index &= ~((RADIX_TREE_MAP_SIZE << shift) - 1);
-			index += offset << shift;
-			/* Overflow after ~0UL */
-			if (!index)
-				return NULL;
-			if (offset == RADIX_TREE_MAP_SIZE)
-				goto restart;
-		}
-
-		/* This is leaf-node */
-		if (!shift)
-			break;
-
-		node = rcu_dereference_raw(node->slots[offset]);
-		if (node == NULL)
-			goto restart;
-		shift -= RADIX_TREE_MAP_SHIFT;
-		offset = (index >> shift) & RADIX_TREE_MAP_MASK;
-	}
-
-	/* Update the iterator state */
-	iter->index = index;
-	iter->next_index = (index | RADIX_TREE_MAP_MASK) + 1;
-
-	/* Construct iter->tags bit-mask from node->tags[tag] array */
-	if (flags & RADIX_TREE_ITER_TAGGED) {
-		unsigned tag_long, tag_bit;
-
-		tag_long = offset / BITS_PER_LONG;
-		tag_bit  = offset % BITS_PER_LONG;
-		iter->tags = node->tags[tag][tag_long] >> tag_bit;
-		/* This never happens if RADIX_TREE_TAG_LONGS == 1 */
-		if (tag_long < RADIX_TREE_TAG_LONGS - 1) {
-			/* Pick tags from next element */
-			if (tag_bit)
-				iter->tags |= node->tags[tag][tag_long + 1] <<
-						(BITS_PER_LONG - tag_bit);
-			/* Clip chunk size, here only BITS_PER_LONG tags */
-			iter->next_index = index + BITS_PER_LONG;
-		}
-	}
-
-	return node->slots + offset;
-}
-EXPORT_SYMBOL_GPL(radix_tree_next_chunk);
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [RFC 06/15] backports: remove BACKPORT_BUILD_HDMI
  2013-10-05 22:43 [RFC 00/15] backports: remove DRM drivers Hauke Mehrtens
                   ` (4 preceding siblings ...)
  2013-10-05 22:43 ` [RFC 05/15] backports: remove BACKPORT_BUILD_RADIX_HELPERS Hauke Mehrtens
@ 2013-10-05 22:43 ` Hauke Mehrtens
  2013-10-05 22:43 ` [RFC 07/15] backports: remove more hdmi stuff Hauke Mehrtens
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: Hauke Mehrtens @ 2013-10-05 22:43 UTC (permalink / raw)
  To: mcgrof; +Cc: backports, ozancag, Hauke Mehrtens

This was only needed for some of the DRM drivers, remove it.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/compat/Kconfig |   16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/backport/compat/Kconfig b/backport/compat/Kconfig
index 215de8e..c3e9a04 100644
--- a/backport/compat/Kconfig
+++ b/backport/compat/Kconfig
@@ -142,22 +142,6 @@ config BACKPORT_BUILD_DMA_SHARED_BUFFER
 config BACKPORT_DMA_SHARED_BUFFER
 	bool
 
-config BACKPORT_BUILD_HDMI
-	bool
-	# not possible on kernel < 3.0
-	depends on !BACKPORT_KERNEL_3_0
-	# don't build if base kernel has it, except on kernel < 3.9
-	depends on !HDMI || BACKPORT_KERNEL_3_9
-	# build for testing
-	default y if BACKPORT_USERSEL_BUILD_ALL
-	# build if a driver needs it
-	default y if BACKPORT_HDMI
-	#h-file linux/hdmi.h
-	#c-file drivers/video/hdmi.c
-
-config BACKPORT_HDMI
-	bool
-
 config BACKPORT_BUILD_DMA_SHARED_HELPERS
 	bool
 	depends on HAS_DMA
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [RFC 07/15] backports: remove more hdmi stuff
  2013-10-05 22:43 [RFC 00/15] backports: remove DRM drivers Hauke Mehrtens
                   ` (5 preceding siblings ...)
  2013-10-05 22:43 ` [RFC 06/15] backports: remove BACKPORT_BUILD_HDMI Hauke Mehrtens
@ 2013-10-05 22:43 ` Hauke Mehrtens
  2013-10-05 22:43 ` [RFC 08/15] backports: remove some stuff related to MTRR Hauke Mehrtens
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: Hauke Mehrtens @ 2013-10-05 22:43 UTC (permalink / raw)
  To: mcgrof; +Cc: backports, ozancag, Hauke Mehrtens

This was only needed for some of the DRM drivers, remove it.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/hdmi.h |   36 ----------------------
 backport/compat/backport-3.12.c        |   51 --------------------------------
 2 files changed, 87 deletions(-)
 delete mode 100644 backport/backport-include/linux/hdmi.h

diff --git a/backport/backport-include/linux/hdmi.h b/backport/backport-include/linux/hdmi.h
deleted file mode 100644
index 41a5387..0000000
--- a/backport/backport-include/linux/hdmi.h
+++ /dev/null
@@ -1,36 +0,0 @@
-#ifndef __BACKPORT_LINUX_HDMI_H
-#define __BACKPORT_LINUX_HDMI_H
-#include_next <linux/hdmi.h>
-
-#include <linux/version.h>
-
-/* on kernel < 3.9 hdmi gets backported */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,12,0)
-
-struct hdmi_any_infoframe {
-	enum hdmi_infoframe_type type;
-	unsigned char version;
-	unsigned char length;
-};
-
-union hdmi_infoframe {
-	struct hdmi_any_infoframe any;
-	struct hdmi_avi_infoframe avi;
-	struct hdmi_spd_infoframe spd;
-	struct hdmi_vendor_infoframe vendor;
-	struct hdmi_audio_infoframe audio;
-};
-
-#define hdmi_infoframe_pack LINUX_BACKPORT(hdmi_infoframe_pack)
-ssize_t
-hdmi_infoframe_pack(union hdmi_infoframe *frame, void *buffer, size_t size);
-#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,12,0)*/ 
-#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0) */
-
-#ifndef HDMI_INFOFRAME_SIZE
-#define HDMI_INFOFRAME_SIZE(type)	\
-	(HDMI_INFOFRAME_HEADER_SIZE + HDMI_ ## type ## _INFOFRAME_SIZE)
-#endif
-
-#endif /* __BACKPORT_LINUX_HDMI_H */
diff --git a/backport/compat/backport-3.12.c b/backport/compat/backport-3.12.c
index 44b98f1..7e3dc58 100644
--- a/backport/compat/backport-3.12.c
+++ b/backport/compat/backport-3.12.c
@@ -27,54 +27,3 @@ u8 *hid_alloc_report_buf(struct hid_report *report, gfp_t flags)
 	return kmalloc(len, flags);
 }
 EXPORT_SYMBOL_GPL(hid_alloc_report_buf);
-
-#ifdef CONFIG_HDMI
-
-/* on older kernel versions we backport hdmi completely. */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)
-
-#include <linux/hdmi.h>
-
-/**
- * hdmi_infoframe_pack() - write a HDMI infoframe to binary buffer
- * @frame: HDMI infoframe
- * @buffer: destination buffer
- * @size: size of buffer
- *
- * Packs the information contained in the @frame structure into a binary
- * representation that can be written into the corresponding controller
- * registers. Also computes the checksum as required by section 5.3.5 of
- * the HDMI 1.4 specification.
- *
- * Returns the number of bytes packed into the binary buffer or a negative
- * error code on failure.
- */
-ssize_t
-hdmi_infoframe_pack(union hdmi_infoframe *frame, void *buffer, size_t size)
-{
-	ssize_t length;
-
-	switch (frame->any.type) {
-	case HDMI_INFOFRAME_TYPE_AVI:
-		length = hdmi_avi_infoframe_pack(&frame->avi, buffer, size);
-		break;
-	case HDMI_INFOFRAME_TYPE_SPD:
-		length = hdmi_spd_infoframe_pack(&frame->spd, buffer, size);
-		break;
-	case HDMI_INFOFRAME_TYPE_AUDIO:
-		length = hdmi_audio_infoframe_pack(&frame->audio, buffer, size);
-		break;
-	case HDMI_INFOFRAME_TYPE_VENDOR:
-		length = hdmi_vendor_infoframe_pack(&frame->vendor,
-						    buffer, size);
-		break;
-	default:
-		WARN(1, "Bad infoframe type %d\n", frame->any.type);
-		length = -EINVAL;
-	}
-
-	return length;
-}
-EXPORT_SYMBOL(hdmi_infoframe_pack);
-#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0) */
-#endif /* CONFIG_HDMI*/
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [RFC 08/15] backports: remove some stuff related to MTRR
  2013-10-05 22:43 [RFC 00/15] backports: remove DRM drivers Hauke Mehrtens
                   ` (6 preceding siblings ...)
  2013-10-05 22:43 ` [RFC 07/15] backports: remove more hdmi stuff Hauke Mehrtens
@ 2013-10-05 22:43 ` Hauke Mehrtens
  2013-10-05 22:43 ` [RFC 09/15] backports: remove scatterlist Hauke Mehrtens
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: Hauke Mehrtens @ 2013-10-05 22:43 UTC (permalink / raw)
  To: mcgrof; +Cc: backports, ozancag, Hauke Mehrtens

This was only needed for some of the DRM drivers, remove it.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/asm/mtrr.h |   21 --------
 backport/backport-include/linux/io.h |   38 --------------
 backport/compat/Makefile             |    1 -
 backport/compat/backport-3.11.c      |   92 ----------------------------------
 4 files changed, 152 deletions(-)
 delete mode 100644 backport/backport-include/asm/mtrr.h
 delete mode 100644 backport/backport-include/linux/io.h
 delete mode 100644 backport/compat/backport-3.11.c

diff --git a/backport/backport-include/asm/mtrr.h b/backport/backport-include/asm/mtrr.h
deleted file mode 100644
index 861438a..0000000
--- a/backport/backport-include/asm/mtrr.h
+++ /dev/null
@@ -1,21 +0,0 @@
-#ifndef __BACKPORT_ASM_MTRR_H
-#define __BACKPORT_ASM_MTRR_H
-#include_next <asm/mtrr.h>
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0))
-/*
- * The following functions are for use by other drivers that cannot use
- * arch_phys_wc_add and arch_phys_wc_del.
- */
-#define phys_wc_to_mtrr_index LINUX_BACKPORT(phys_wc_to_mtrr_index)
-#ifdef CONFIG_MTRR
-extern int phys_wc_to_mtrr_index(int handle);
-#else
-static inline int phys_wc_to_mtrr_index(int handle)
-{
-	return -1;
-}
-#endif /* CONFIG_MTRR */
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)) */
-
-#endif /* __BACKPORT_ASM_MTRR_H */
diff --git a/backport/backport-include/linux/io.h b/backport/backport-include/linux/io.h
deleted file mode 100644
index 84a8c21..0000000
--- a/backport/backport-include/linux/io.h
+++ /dev/null
@@ -1,38 +0,0 @@
-#ifndef __BACKPORT_LINUX_IO_H
-#define __BACKPORT_LINUX_IO_H
-#include_next <linux/io.h>
-
-/*
- * Some systems (x86 without PAT) have a somewhat reliable way to mark a
- * physical address range such that uncached mappings will actually
- * end up write-combining.  This facility should be used in conjunction
- * with pgprot_writecombine, ioremap-wc, or set_memory_wc, since it has
- * no effect if the per-page mechanisms are functional.
- * (On x86 without PAT, these functions manipulate MTRRs.)
- *
- * arch_phys_del_wc(0) or arch_phys_del_wc(any error code) is guaranteed
- * to have no effect.
- */
-#ifndef arch_phys_wc_add
-
-#define arch_phys_wc_add LINUX_BACKPORT(arch_phys_wc_add)
-#define arch_phys_wc_del LINUX_BACKPORT(arch_phys_wc_del)
-
-#ifdef CONFIG_MTRR
-extern int __must_check arch_phys_wc_add(unsigned long base,
-					 unsigned long size);
-extern void arch_phys_wc_del(int handle);
-#else
-static inline int __must_check arch_phys_wc_add(unsigned long base,
-						unsigned long size)
-{
-	return 0;  /* It worked (i.e. did nothing). */
-}
-
-static inline void arch_phys_wc_del(int handle)
-{
-}
-#endif /* CONFIG_MTRR */
-#endif
-
-#endif /* __BACKPORT_LINUX_IO_H */
diff --git a/backport/compat/Makefile b/backport/compat/Makefile
index 2d4928c..4485552 100644
--- a/backport/compat/Makefile
+++ b/backport/compat/Makefile
@@ -34,7 +34,6 @@ compat-$(CPTCFG_BACKPORT_KERNEL_3_7) += compat-3.7.o
 compat-$(CPTCFG_BACKPORT_KERNEL_3_8) += compat-3.8.o
 compat-$(CPTCFG_BACKPORT_KERNEL_3_9) += compat-3.9.o
 compat-$(CPTCFG_BACKPORT_KERNEL_3_10) += backport-3.10.o
-compat-$(CPTCFG_BACKPORT_KERNEL_3_11) += backport-3.11.o
 compat-$(CPTCFG_BACKPORT_KERNEL_3_12) += backport-3.12.o
 
 compat-$(CPTCFG_BACKPORT_BUILD_KFIFO) += kfifo.o
diff --git a/backport/compat/backport-3.11.c b/backport/compat/backport-3.11.c
deleted file mode 100644
index e7b93fc..0000000
--- a/backport/compat/backport-3.11.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 2013  Hauke Mehrtens <hauke@hauke-m.de>
- *
- * Backport functionality introduced in Linux 3.11.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#include <linux/export.h>
-
-#ifdef CONFIG_MTRR
-
-#include <asm/mtrr.h>
-#include <asm/cpufeature.h>
-#include <linux/io.h>
-#include <linux/printk.h>
-
-/* arch_phys_wc_add returns an MTRR register index plus this offset. */
-#define MTRR_TO_PHYS_WC_OFFSET 1000
-
-/**
- * arch_phys_wc_add - add a WC MTRR and handle errors if PAT is unavailable
- * @base: Physical base address
- * @size: Size of region
- *
- * If PAT is available, this does nothing.  If PAT is unavailable, it
- * attempts to add a WC MTRR covering size bytes starting at base and
- * logs an error if this fails.
- *
- * Drivers must store the return value to pass to mtrr_del_wc_if_needed,
- * but drivers should not try to interpret that return value.
- */
-int backport_arch_phys_wc_add(unsigned long base, unsigned long size)
-{
-	int ret;
-
-#if defined(CONFIG_X86_PAT)
-	if (cpu_has_pat)
-		return 0;
-#endif
-
-	ret = mtrr_add(base, size, MTRR_TYPE_WRCOMB, true);
-	if (ret < 0) {
-		pr_warn("Failed to add WC MTRR for [%p-%p]; performance may suffer.",
-			(void *)base, (void *)(base + size - 1));
-		return ret;
-	}
-	return ret + MTRR_TO_PHYS_WC_OFFSET;
-}
-EXPORT_SYMBOL_GPL(backport_arch_phys_wc_add);
-
-/*
- * arch_phys_wc_del - undoes arch_phys_wc_add
- * @handle: Return value from arch_phys_wc_add
- *
- * This cleans up after mtrr_add_wc_if_needed.
- *
- * The API guarantees that mtrr_del_wc_if_needed(error code) and
- * mtrr_del_wc_if_needed(0) do nothing.
- */
-void backport_arch_phys_wc_del(int handle)
-{
-	if (handle >= 1) {
-		WARN_ON(handle < MTRR_TO_PHYS_WC_OFFSET);
-		mtrr_del(handle - MTRR_TO_PHYS_WC_OFFSET, 0, 0);
-	}
-}
-EXPORT_SYMBOL_GPL(backport_arch_phys_wc_del);
-
-/*
- * phys_wc_to_mtrr_index - translates arch_phys_wc_add's return value
- * @handle: Return value from arch_phys_wc_add
- *
- * This will turn the return value from arch_phys_wc_add into an mtrr
- * index suitable for debugging.
- *
- * Note: There is no legitimate use for this function, except possibly
- * in printk line.  Alas there is an illegitimate use in some ancient
- * drm ioctls.
- */
-int phys_wc_to_mtrr_index(int handle)
-{
-	if (handle < MTRR_TO_PHYS_WC_OFFSET)
-		return -1;
-	else
-		return handle - MTRR_TO_PHYS_WC_OFFSET;
-}
-EXPORT_SYMBOL_GPL(phys_wc_to_mtrr_index);
-
-#endif /* CONFIG_MTRR */
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [RFC 09/15] backports: remove scatterlist
  2013-10-05 22:43 [RFC 00/15] backports: remove DRM drivers Hauke Mehrtens
                   ` (7 preceding siblings ...)
  2013-10-05 22:43 ` [RFC 08/15] backports: remove some stuff related to MTRR Hauke Mehrtens
@ 2013-10-05 22:43 ` Hauke Mehrtens
  2013-10-05 22:43 ` [RFC 10/15] backports: remove ktime_get_monotonic_offset() Hauke Mehrtens
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: Hauke Mehrtens @ 2013-10-05 22:43 UTC (permalink / raw)
  To: mcgrof; +Cc: backports, ozancag, Hauke Mehrtens

This was only needed for some of the DRM drivers, remove it.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/scatterlist.h |   69 -------------------------
 backport/compat/compat-3.9.c                  |   43 ---------------
 2 files changed, 112 deletions(-)

diff --git a/backport/backport-include/linux/scatterlist.h b/backport/backport-include/linux/scatterlist.h
index bb2b5a4..f939e8c 100644
--- a/backport/backport-include/linux/scatterlist.h
+++ b/backport/backport-include/linux/scatterlist.h
@@ -12,73 +12,4 @@ int sg_alloc_table_from_pages(struct sg_table *sgt,
 			      gfp_t gfp_mask);
 #endif /* < 3.6 */
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)
-
-/* Lets expect distributions might backport this */
-#ifndef for_each_sg_page
-/*
- * sg page iterator
- *
- * Iterates over sg entries page-by-page.  On each successful iteration,
- * @piter->page points to the current page, @piter->sg to the sg holding this
- * page and @piter->sg_pgoffset to the page's page offset within the sg. The
- * iteration will stop either when a maximum number of sg entries was reached
- * or a terminating sg (sg_last(sg) == true) was reached.
- */
-struct sg_page_iter {
-	struct page		*page;		/* current page */
-	struct scatterlist	*sg;		/* sg holding the page */
-	unsigned int		sg_pgoffset;	/* page offset within the sg */
-
-	/* these are internal states, keep away */
-	unsigned int		__nents;	/* remaining sg entries */
-	int			__pg_advance;	/* nr pages to advance at the
-						 * next step */
-};
-
-#define __sg_page_iter_next LINUX_BACKPORT(__sg_page_iter_next)
-bool __sg_page_iter_next(struct sg_page_iter *piter);
-#define __sg_page_iter_start LINUX_BACKPORT(__sg_page_iter_start)
-void __sg_page_iter_start(struct sg_page_iter *piter,
-			  struct scatterlist *sglist, unsigned int nents,
-			  unsigned long pgoffset);
-
-/**
- * for_each_sg_page - iterate over the pages of the given sg list
- * @sglist:	sglist to iterate over
- * @piter:	page iterator to hold current page, sg, sg_pgoffset
- * @nents:	maximum number of sg entries to iterate over
- * @pgoffset:	starting page offset
- */
-#define for_each_sg_page(sglist, piter, nents, pgoffset)		   \
-	for (__sg_page_iter_start((piter), (sglist), (nents), (pgoffset)); \
-	     __sg_page_iter_next(piter);)
-
-#endif /* for_each_sg_page assumption */
-#endif /* version < 3.9 */
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0))
-
-#define sg_page_iter_page LINUX_BACKPORT(sg_page_iter_page)
-/**
- * sg_page_iter_page - get the current page held by the page iterator
- * @piter:     page iterator holding the page
- */
-static inline struct page *sg_page_iter_page(struct sg_page_iter *piter)
-{
-	return nth_page(sg_page(piter->sg), piter->sg_pgoffset);
-}
-
-#define sg_page_iter_dma_address LINUX_BACKPORT(sg_page_iter_dma_address)
-/**
- * sg_page_iter_dma_address - get the dma address of the current page held by
- * the page iterator.
- * @piter:     page iterator holding the page
- */
-static inline dma_addr_t sg_page_iter_dma_address(struct sg_page_iter *piter)
-{
-	return sg_dma_address(piter->sg) + (piter->sg_pgoffset << PAGE_SHIFT);
-}
-#endif /* version < 3.10 */
-
 #endif /* __BACKPORT_SCATTERLIST_H */
diff --git a/backport/compat/compat-3.9.c b/backport/compat/compat-3.9.c
index d85a79f..df10d7d 100644
--- a/backport/compat/compat-3.9.c
+++ b/backport/compat/compat-3.9.c
@@ -9,7 +9,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/scatterlist.h>
 #include <linux/device.h>
 #include <linux/err.h>
 #include <linux/netdevice.h>
@@ -17,46 +16,6 @@
 #include <linux/if_ether.h>
 #include <linux/etherdevice.h>
 
-#ifdef __sg_page_iter_next
-
-void __sg_page_iter_start(struct sg_page_iter *piter,
-			  struct scatterlist *sglist, unsigned int nents,
-			  unsigned long pgoffset)
-{
-	piter->__pg_advance = 0;
-	piter->__nents = nents;
-
-	piter->page = NULL;
-	piter->sg = sglist;
-	piter->sg_pgoffset = pgoffset;
-}
-EXPORT_SYMBOL_GPL(__sg_page_iter_start);
-
-static int sg_page_count(struct scatterlist *sg)
-{
-	return PAGE_ALIGN(sg->offset + sg->length) >> PAGE_SHIFT;
-}
-
-bool __sg_page_iter_next(struct sg_page_iter *piter)
-{
-	if (!piter->__nents || !piter->sg)
-		return false;
-
-	piter->sg_pgoffset += piter->__pg_advance;
-	piter->__pg_advance = 1;
-
-	while (piter->sg_pgoffset >= sg_page_count(piter->sg)) {
-		piter->sg_pgoffset -= sg_page_count(piter->sg);
-		piter->sg = sg_next(piter->sg);
-		if (!--piter->__nents || !piter->sg)
-			return false;
-	}
-	piter->page = nth_page(sg_page(piter->sg), piter->sg_pgoffset);
-
-	return true;
-}
-EXPORT_SYMBOL_GPL(__sg_page_iter_next);
-
 void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res)
 {
 	void __iomem *dest_ptr;
@@ -97,5 +56,3 @@ void eth_commit_mac_addr_change(struct net_device *dev, void *p)
 	memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
 }
 EXPORT_SYMBOL_GPL(eth_commit_mac_addr_change);
-
-#endif /* __sg_page_iter_next */
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [RFC 10/15] backports: remove ktime_get_monotonic_offset()
  2013-10-05 22:43 [RFC 00/15] backports: remove DRM drivers Hauke Mehrtens
                   ` (8 preceding siblings ...)
  2013-10-05 22:43 ` [RFC 09/15] backports: remove scatterlist Hauke Mehrtens
@ 2013-10-05 22:43 ` Hauke Mehrtens
  2013-10-05 22:44 ` [RFC 11/15] backports: remove devm_regmap_init_spi() Hauke Mehrtens
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: Hauke Mehrtens @ 2013-10-05 22:43 UTC (permalink / raw)
  To: mcgrof; +Cc: backports, ozancag, Hauke Mehrtens

This was only needed for some of the DRM drivers, remove it.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/hrtimer.h |   11 -----------
 backport/compat/compat-3.5.c              |   14 --------------
 2 files changed, 25 deletions(-)
 delete mode 100644 backport/backport-include/linux/hrtimer.h

diff --git a/backport/backport-include/linux/hrtimer.h b/backport/backport-include/linux/hrtimer.h
deleted file mode 100644
index c099dd4..0000000
--- a/backport/backport-include/linux/hrtimer.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef __BACKPORT_LINUX_HRTIMER_H
-#define __BACKPORT_LINUX_HRTIMER_H
-#include_next <linux/hrtimer.h>
-#include <linux/version.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)
-#define ktime_get_monotonic_offset LINUX_BACKPORT(ktime_get_monotonic_offset)
-extern ktime_t ktime_get_monotonic_offset(void);
-#endif
-
-#endif /* __BACKPORT_LINUX_HRTIMER_H */
diff --git a/backport/compat/compat-3.5.c b/backport/compat/compat-3.5.c
index 7068cfb..95f52b9 100644
--- a/backport/compat/compat-3.5.c
+++ b/backport/compat/compat-3.5.c
@@ -64,17 +64,3 @@ int overflowgid = DEFAULT_OVERFLOWGID;
 EXPORT_SYMBOL_GPL(overflowuid);
 EXPORT_SYMBOL_GPL(overflowgid);
 #endif
-
-/*
- * We can't access the timekeeper static variable
- * on older kernels so we're shit out of luck and
- * have to rely on time that might jump. Upgrade
- * if you want timestamps that don't jump, this
- * important for DRM vblank and page flip event
- * timestamps.
- */
-ktime_t ktime_get_monotonic_offset(void)
-{
-	return ktime_get();
-}
-EXPORT_SYMBOL_GPL(ktime_get_monotonic_offset);
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [RFC 11/15] backports: remove devm_regmap_init_spi()
  2013-10-05 22:43 [RFC 00/15] backports: remove DRM drivers Hauke Mehrtens
                   ` (9 preceding siblings ...)
  2013-10-05 22:43 ` [RFC 10/15] backports: remove ktime_get_monotonic_offset() Hauke Mehrtens
@ 2013-10-05 22:44 ` Hauke Mehrtens
  2013-10-05 22:44 ` [RFC 12/15] backports: remove compat_wake_up_locked() Hauke Mehrtens
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: Hauke Mehrtens @ 2013-10-05 22:44 UTC (permalink / raw)
  To: mcgrof; +Cc: backports, ozancag, Hauke Mehrtens

This is not used by any code in backports, not even a DRM driver.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/regmap.h |    5 --
 backport/compat/compat-3.4.c             |   73 ------------------------------
 2 files changed, 78 deletions(-)

diff --git a/backport/backport-include/linux/regmap.h b/backport/backport-include/linux/regmap.h
index ac6a3f2..870ea2c 100644
--- a/backport/backport-include/linux/regmap.h
+++ b/backport/backport-include/linux/regmap.h
@@ -25,11 +25,6 @@ struct regmap *devm_regmap_init(struct device *dev,
 struct regmap *devm_regmap_init_i2c(struct i2c_client *i2c,
 				    const struct regmap_config *config);
 #endif /* defined(CONFIG_REGMAP_I2C) */
-#if defined(CONFIG_REGMAP_SPI)
-#define devm_regmap_init_spi LINUX_BACKPORT(devm_regmap_init_spi)
-struct regmap *devm_regmap_init_spi(struct spi_device *dev,
-				    const struct regmap_config *config);
-#endif /* defined(CONFIG_REGMAP_SPI) */
 
 /*
  * We can't backport these unless we try to backport
diff --git a/backport/compat/compat-3.4.c b/backport/compat/compat-3.4.c
index 99dfb0c..f6b826d 100644
--- a/backport/compat/compat-3.4.c
+++ b/backport/compat/compat-3.4.c
@@ -260,79 +260,6 @@ struct regmap *devm_regmap_init_i2c(struct i2c_client *i2c,
 EXPORT_SYMBOL_GPL(devm_regmap_init_i2c);
 #endif /* defined(CONFIG_REGMAP_I2C) */
 
-#if defined(CONFIG_REGMAP_SPI)
-static int regmap_spi_write(
-			    struct device *dev,
-			    const void *data, size_t count)
-{
-	struct spi_device *spi = to_spi_device(dev);
-
-	return spi_write(spi, data, count);
-}
-
-static int regmap_spi_gather_write(
-				   struct device *dev,
-				   const void *reg, size_t reg_len,
-				   const void *val, size_t val_len)
-{
-	struct spi_device *spi = to_spi_device(dev);
-	struct spi_message m;
-	struct spi_transfer t[2] = { { .tx_buf = reg, .len = reg_len, },
-				     { .tx_buf = val, .len = val_len, }, };
-
-	spi_message_init(&m);
-	spi_message_add_tail(&t[0], &m);
-	spi_message_add_tail(&t[1], &m);
-
-	return spi_sync(spi, &m);
-}
-
-static int regmap_spi_read(
-			   struct device *dev,
-			   const void *reg, size_t reg_size,
-			   void *val, size_t val_size)
-{
-	struct spi_device *spi = to_spi_device(dev);
-
-	return spi_write_then_read(spi, reg, reg_size, val, val_size);
-}
-
-static struct regmap_bus regmap_spi = {
-	.write = regmap_spi_write,
-	.gather_write = regmap_spi_gather_write,
-/*
- * See commit 0d509f2b112b
- * only 3.9 kernels have this we'll ignore it
- * given I have not seen drivers use these we
- * are backporting. We'll -EINVAL these.
- */
-#if 0
-	.async_write = regmap_spi_async_write,
-	.async_alloc = regmap_spi_async_alloc,
-#endif
-	.read = regmap_spi_read,
-	.read_flag_mask = 0x80,
-
-};
-
-/**
- * devm_regmap_init_spi(): Initialise register map
- *
- * @spi: Device that will be interacted with
- * @config: Configuration for register map
- *
- * The return value will be an ERR_PTR() on error or a valid pointer
- * to a struct regmap.  The map will be automatically freed by the
- * device management code.
- */
-struct regmap *devm_regmap_init_spi(struct spi_device *spi,
-				    const struct regmap_config *config)
-{
-	return devm_regmap_init(&spi->dev, &regmap_spi, config);
-}
-EXPORT_SYMBOL_GPL(devm_regmap_init_spi);
-#endif /* defined(CONFIG_REGMAP_SPI) */
-
 #endif /* defined(CONFIG_REGMAP) */
 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) */
 
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [RFC 12/15] backports: remove compat_wake_up_locked()
  2013-10-05 22:43 [RFC 00/15] backports: remove DRM drivers Hauke Mehrtens
                   ` (10 preceding siblings ...)
  2013-10-05 22:44 ` [RFC 11/15] backports: remove devm_regmap_init_spi() Hauke Mehrtens
@ 2013-10-05 22:44 ` Hauke Mehrtens
  2013-10-05 22:44 ` [RFC 13/15] backports: remove i2c_bit_algo() Hauke Mehrtens
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: Hauke Mehrtens @ 2013-10-05 22:44 UTC (permalink / raw)
  To: mcgrof; +Cc: backports, ozancag, Hauke Mehrtens

This was only needed for some of the DRM drivers, remove it.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/wait.h |   14 --------------
 backport/compat/compat-3.4.c           |   28 ----------------------------
 2 files changed, 42 deletions(-)

diff --git a/backport/backport-include/linux/wait.h b/backport/backport-include/linux/wait.h
index 7ada8bc..664f24b 100644
--- a/backport/backport-include/linux/wait.h
+++ b/backport/backport-include/linux/wait.h
@@ -2,20 +2,6 @@
 #define __BACKPORT_LINUX_WAIT_H
 #include_next <linux/wait.h>
 
-/* This backports:
- *
- * commit 63b2001169e75cd71e917ec953fdab572e3f944a
- * Author: Thomas Gleixner <tglx@linutronix.de>
- * Date:   Thu Dec 1 00:04:00 2011 +0100
- *
- * 	sched/wait: Add __wake_up_all_locked() API
- */
-
-#ifndef wake_up_all_locked
-extern void compat_wake_up_locked(wait_queue_head_t *q, unsigned int mode, int nr);
-#define wake_up_all_locked(x)	compat_wake_up_locked((x), TASK_NORMAL, 0)
-#endif
-
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
 #define wake_up_interruptible_poll(x, m)			\
 	__wake_up(x, TASK_INTERRUPTIBLE, 1, (void *) (m))
diff --git a/backport/compat/compat-3.4.c b/backport/compat/compat-3.4.c
index f6b826d..43f0c51 100644
--- a/backport/compat/compat-3.4.c
+++ b/backport/compat/compat-3.4.c
@@ -263,34 +263,6 @@ EXPORT_SYMBOL_GPL(devm_regmap_init_i2c);
 #endif /* defined(CONFIG_REGMAP) */
 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) */
 
-/* __wake_up_common was declared as part of the wait.h until
- * 2.6.31 in which they made it private to the scheduler. Prefix it with
- * compat to avoid double declaration issues.
- */
-static void compat_wake_up_common(wait_queue_head_t *q, unsigned int mode,
-			int nr_exclusive, int wake_flags, void *key)
-{
-	wait_queue_t *curr, *next;
-
-	list_for_each_entry_safe(curr, next, &q->task_list, task_list) {
-		unsigned flags = curr->flags;
-
-		if (curr->func(curr, mode, wake_flags, key) &&
-				(flags & WQ_FLAG_EXCLUSIVE) && !--nr_exclusive)
-			break;
-	}
-}
-
-/* The last 'nr' parameter was added to the __wake_up_locked() function
- * in 3.4 kernel. Define a new one prefixed with compat_ for the new API.
- */
-void compat_wake_up_locked(wait_queue_head_t *q, unsigned int mode, int nr)
-{
-	compat_wake_up_common(q, mode, nr, 0, NULL);
-}
-EXPORT_SYMBOL_GPL(compat_wake_up_locked);
-
-
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
 #include <linux/i2c.h>
 #include <linux/i2c-algo-bit.h>
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [RFC 13/15] backports: remove i2c_bit_algo()
  2013-10-05 22:43 [RFC 00/15] backports: remove DRM drivers Hauke Mehrtens
                   ` (11 preceding siblings ...)
  2013-10-05 22:44 ` [RFC 12/15] backports: remove compat_wake_up_locked() Hauke Mehrtens
@ 2013-10-05 22:44 ` Hauke Mehrtens
  2013-10-05 22:44 ` [RFC 14/15] backports: remove cpufreq_quick_get_max() Hauke Mehrtens
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: Hauke Mehrtens @ 2013-10-05 22:44 UTC (permalink / raw)
  To: mcgrof; +Cc: backports, ozancag, Hauke Mehrtens

This was only needed for some of the DRM drivers, remove it.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/i2c-algo-bit.h |   12 -
 backport/compat/compat-3.4.c                   |  442 ------------------------
 2 files changed, 454 deletions(-)
 delete mode 100644 backport/backport-include/linux/i2c-algo-bit.h

diff --git a/backport/backport-include/linux/i2c-algo-bit.h b/backport/backport-include/linux/i2c-algo-bit.h
deleted file mode 100644
index 643e0c7..0000000
--- a/backport/backport-include/linux/i2c-algo-bit.h
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef __BACKPORT_LINUX_I2C_ALGO_BIT_H
-#define __BACKPORT_LINUX_I2C_ALGO_BIT_H
-#include_next <linux/i2c-algo-bit.h>
-#include <linux/version.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0) && \
-    LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)
-#define i2c_bit_algo LINUX_BACKPORT(i2c_bit_algo)
-extern const struct i2c_algorithm i2c_bit_algo;
-#endif
-
-#endif /* __BACKPORT_LINUX_I2C_ALGO_BIT_H */
diff --git a/backport/compat/compat-3.4.c b/backport/compat/compat-3.4.c
index 43f0c51..f1d6178 100644
--- a/backport/compat/compat-3.4.c
+++ b/backport/compat/compat-3.4.c
@@ -263,448 +263,6 @@ EXPORT_SYMBOL_GPL(devm_regmap_init_i2c);
 #endif /* defined(CONFIG_REGMAP) */
 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) */
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
-#include <linux/i2c.h>
-#include <linux/i2c-algo-bit.h>
-#include <linux/delay.h>
-
-#define setsda(adap, val)	adap->setsda(adap->data, val)
-#define setscl(adap, val)	adap->setscl(adap->data, val)
-#define getsda(adap)		adap->getsda(adap->data)
-#define getscl(adap)		adap->getscl(adap->data)
-
-#define bit_dbg(level, dev, format, args...) \
-	do {} while (0)
-
-static inline void sdalo(struct i2c_algo_bit_data *adap)
-{
-	setsda(adap, 0);
-	udelay((adap->udelay + 1) / 2);
-}
-
-static inline void sdahi(struct i2c_algo_bit_data *adap)
-{
-	setsda(adap, 1);
-	udelay((adap->udelay + 1) / 2);
-}
-
-static inline void scllo(struct i2c_algo_bit_data *adap)
-{
-	setscl(adap, 0);
-	udelay(adap->udelay / 2);
-}
-
-static int sclhi(struct i2c_algo_bit_data *adap)
-{
-	unsigned long start;
-
-	setscl(adap, 1);
-
-	/* Not all adapters have scl sense line... */
-	if (!adap->getscl)
-		goto done;
-
-	start = jiffies;
-	while (!getscl(adap)) {
-		/* This hw knows how to read the clock line, so we wait
-		 * until it actually gets high.  This is safer as some
-		 * chips may hold it low ("clock stretching") while they
-		 * are processing data internally.
-		 */
-		if (time_after(jiffies, start + adap->timeout)) {
-			/* Test one last time, as we may have been preempted
-			 * between last check and timeout test.
-			 */
-			if (getscl(adap))
-				break;
-			return -ETIMEDOUT;
-		}
-		cpu_relax();
-	}
-#ifdef DEBUG
-	if (jiffies != start && i2c_debug >= 3)
-		pr_debug("i2c-algo-bit: needed %ld jiffies for SCL to go "
-			 "high\n", jiffies - start);
-#endif
-
-done:
-	udelay(adap->udelay);
-	return 0;
-}
-
-static void i2c_start(struct i2c_algo_bit_data *adap)
-{
-	/* assert: scl, sda are high */
-	setsda(adap, 0);
-	udelay(adap->udelay);
-	scllo(adap);
-}
-
-static void i2c_repstart(struct i2c_algo_bit_data *adap)
-{
-	/* assert: scl is low */
-	sdahi(adap);
-	sclhi(adap);
-	setsda(adap, 0);
-	udelay(adap->udelay);
-	scllo(adap);
-}
-
-
-static void i2c_stop(struct i2c_algo_bit_data *adap)
-{
-	/* assert: scl is low */
-	sdalo(adap);
-	sclhi(adap);
-	setsda(adap, 1);
-	udelay(adap->udelay);
-}
-
-static int i2c_outb(struct i2c_adapter *i2c_adap, unsigned char c)
-{
-	int i;
-	int sb;
-	int ack;
-	struct i2c_algo_bit_data *adap = i2c_adap->algo_data;
-
-	/* assert: scl is low */
-	for (i = 7; i >= 0; i--) {
-		sb = (c >> i) & 1;
-		setsda(adap, sb);
-		udelay((adap->udelay + 1) / 2);
-		if (sclhi(adap) < 0) { /* timed out */
-			bit_dbg(1, &i2c_adap->dev, "i2c_outb: 0x%02x, "
-				"timeout at bit #%d\n", (int)c, i);
-			return -ETIMEDOUT;
-		}
-		/* FIXME do arbitration here:
-		 * if (sb && !getsda(adap)) -> ouch! Get out of here.
-		 *
-		 * Report a unique code, so higher level code can retry
-		 * the whole (combined) message and *NOT* issue STOP.
-		 */
-		scllo(adap);
-	}
-	sdahi(adap);
-	if (sclhi(adap) < 0) { /* timeout */
-		bit_dbg(1, &i2c_adap->dev, "i2c_outb: 0x%02x, "
-			"timeout at ack\n", (int)c);
-		return -ETIMEDOUT;
-	}
-
-	/* read ack: SDA should be pulled down by slave, or it may
-	 * NAK (usually to report problems with the data we wrote).
-	 */
-	ack = !getsda(adap);    /* ack: sda is pulled low -> success */
-	bit_dbg(2, &i2c_adap->dev, "i2c_outb: 0x%02x %s\n", (int)c,
-		ack ? "A" : "NA");
-
-	scllo(adap);
-	return ack;
-	/* assert: scl is low (sda undef) */
-}
-
-static int i2c_inb(struct i2c_adapter *i2c_adap)
-{
-	/* read byte via i2c port, without start/stop sequence	*/
-	/* acknowledge is sent in i2c_read.			*/
-	int i;
-	unsigned char indata = 0;
-	struct i2c_algo_bit_data *adap = i2c_adap->algo_data;
-
-	/* assert: scl is low */
-	sdahi(adap);
-	for (i = 0; i < 8; i++) {
-		if (sclhi(adap) < 0) { /* timeout */
-			bit_dbg(1, &i2c_adap->dev, "i2c_inb: timeout at bit "
-				"#%d\n", 7 - i);
-			return -ETIMEDOUT;
-		}
-		indata *= 2;
-		if (getsda(adap))
-			indata |= 0x01;
-		setscl(adap, 0);
-		udelay(i == 7 ? adap->udelay / 2 : adap->udelay);
-	}
-	/* assert: scl is low */
-	return indata;
-}
-
-static int try_address(struct i2c_adapter *i2c_adap,
-		       unsigned char addr, int retries)
-{
-	struct i2c_algo_bit_data *adap = i2c_adap->algo_data;
-	int i, ret = 0;
-
-	for (i = 0; i <= retries; i++) {
-		ret = i2c_outb(i2c_adap, addr);
-		if (ret == 1 || i == retries)
-			break;
-		bit_dbg(3, &i2c_adap->dev, "emitting stop condition\n");
-		i2c_stop(adap);
-		udelay(adap->udelay);
-		yield();
-		bit_dbg(3, &i2c_adap->dev, "emitting start condition\n");
-		i2c_start(adap);
-	}
-	if (i && ret)
-		bit_dbg(1, &i2c_adap->dev, "Used %d tries to %s client at "
-			"0x%02x: %s\n", i + 1,
-			addr & 1 ? "read from" : "write to", addr >> 1,
-			ret == 1 ? "success" : "failed, timeout?");
-	return ret;
-}
-
-static int bit_doAddress(struct i2c_adapter *i2c_adap, struct i2c_msg *msg)
-{
-	unsigned short flags = msg->flags;
-	unsigned short nak_ok = msg->flags & I2C_M_IGNORE_NAK;
-	struct i2c_algo_bit_data *adap = i2c_adap->algo_data;
-
-	unsigned char addr;
-	int ret, retries;
-
-	retries = nak_ok ? 0 : i2c_adap->retries;
-
-	if (flags & I2C_M_TEN) {
-		/* a ten bit address */
-		addr = 0xf0 | ((msg->addr >> 7) & 0x06);
-		bit_dbg(2, &i2c_adap->dev, "addr0: %d\n", addr);
-		/* try extended address code...*/
-		ret = try_address(i2c_adap, addr, retries);
-		if ((ret != 1) && !nak_ok)  {
-			dev_err(&i2c_adap->dev,
-				"died at extended address code\n");
-			return -ENXIO;
-		}
-		/* the remaining 8 bit address */
-		ret = i2c_outb(i2c_adap, msg->addr & 0xff);
-		if ((ret != 1) && !nak_ok) {
-			/* the chip did not ack / xmission error occurred */
-			dev_err(&i2c_adap->dev, "died at 2nd address code\n");
-			return -ENXIO;
-		}
-		if (flags & I2C_M_RD) {
-			bit_dbg(3, &i2c_adap->dev, "emitting repeated "
-				"start condition\n");
-			i2c_repstart(adap);
-			/* okay, now switch into reading mode */
-			addr |= 0x01;
-			ret = try_address(i2c_adap, addr, retries);
-			if ((ret != 1) && !nak_ok) {
-				dev_err(&i2c_adap->dev,
-					"died at repeated address code\n");
-				return -EIO;
-			}
-		}
-	} else {		/* normal 7bit address	*/
-		addr = msg->addr << 1;
-		if (flags & I2C_M_RD)
-			addr |= 1;
-		if (flags & I2C_M_REV_DIR_ADDR)
-			addr ^= 1;
-		ret = try_address(i2c_adap, addr, retries);
-		if ((ret != 1) && !nak_ok)
-			return -ENXIO;
-	}
-
-	return 0;
-}
-
-static int sendbytes(struct i2c_adapter *i2c_adap, struct i2c_msg *msg)
-{
-	const unsigned char *temp = msg->buf;
-	int count = msg->len;
-	unsigned short nak_ok = msg->flags & I2C_M_IGNORE_NAK;
-	int retval;
-	int wrcount = 0;
-
-	while (count > 0) {
-		retval = i2c_outb(i2c_adap, *temp);
-
-		/* OK/ACK; or ignored NAK */
-		if ((retval > 0) || (nak_ok && (retval == 0))) {
-			count--;
-			temp++;
-			wrcount++;
-
-		/* A slave NAKing the master means the slave didn't like
-		 * something about the data it saw.  For example, maybe
-		 * the SMBus PEC was wrong.
-		 */
-		} else if (retval == 0) {
-			dev_err(&i2c_adap->dev, "sendbytes: NAK bailout.\n");
-			return -EIO;
-
-		/* Timeout; or (someday) lost arbitration
-		 *
-		 * FIXME Lost ARB implies retrying the transaction from
-		 * the first message, after the "winning" master issues
-		 * its STOP.  As a rule, upper layer code has no reason
-		 * to know or care about this ... it is *NOT* an error.
-		 */
-		} else {
-			dev_err(&i2c_adap->dev, "sendbytes: error %d\n",
-					retval);
-			return retval;
-		}
-	}
-	return wrcount;
-}
-
-static int acknak(struct i2c_adapter *i2c_adap, int is_ack)
-{
-	struct i2c_algo_bit_data *adap = i2c_adap->algo_data;
-
-	/* assert: sda is high */
-	if (is_ack)		/* send ack */
-		setsda(adap, 0);
-	udelay((adap->udelay + 1) / 2);
-	if (sclhi(adap) < 0) {	/* timeout */
-		dev_err(&i2c_adap->dev, "readbytes: ack/nak timeout\n");
-		return -ETIMEDOUT;
-	}
-	scllo(adap);
-	return 0;
-}
-
-static int readbytes(struct i2c_adapter *i2c_adap, struct i2c_msg *msg)
-{
-	int inval;
-	int rdcount = 0;	/* counts bytes read */
-	unsigned char *temp = msg->buf;
-	int count = msg->len;
-	const unsigned flags = msg->flags;
-
-	while (count > 0) {
-		inval = i2c_inb(i2c_adap);
-		if (inval >= 0) {
-			*temp = inval;
-			rdcount++;
-		} else {   /* read timed out */
-			break;
-		}
-
-		temp++;
-		count--;
-
-		/* Some SMBus transactions require that we receive the
-		   transaction length as the first read byte. */
-		if (rdcount == 1 && (flags & I2C_M_RECV_LEN)) {
-			if (inval <= 0 || inval > I2C_SMBUS_BLOCK_MAX) {
-				if (!(flags & I2C_M_NO_RD_ACK))
-					acknak(i2c_adap, 0);
-				dev_err(&i2c_adap->dev, "readbytes: invalid "
-					"block length (%d)\n", inval);
-				return -EPROTO;
-			}
-			/* The original count value accounts for the extra
-			   bytes, that is, either 1 for a regular transaction,
-			   or 2 for a PEC transaction. */
-			count += inval;
-			msg->len += inval;
-		}
-
-		bit_dbg(2, &i2c_adap->dev, "readbytes: 0x%02x %s\n",
-			inval,
-			(flags & I2C_M_NO_RD_ACK)
-				? "(no ack/nak)"
-				: (count ? "A" : "NA"));
-
-		if (!(flags & I2C_M_NO_RD_ACK)) {
-			inval = acknak(i2c_adap, count);
-			if (inval < 0)
-				return inval;
-		}
-	}
-	return rdcount;
-}
-
-
-static u32 bit_func(struct i2c_adapter *adap)
-{
-	return I2C_FUNC_I2C | I2C_FUNC_NOSTART | I2C_FUNC_SMBUS_EMUL |
-	       I2C_FUNC_SMBUS_READ_BLOCK_DATA |
-	       I2C_FUNC_SMBUS_BLOCK_PROC_CALL |
-	       I2C_FUNC_10BIT_ADDR | I2C_FUNC_PROTOCOL_MANGLING;
-}
-
-static int bit_xfer(struct i2c_adapter *i2c_adap,
-		    struct i2c_msg msgs[], int num)
-{
-	struct i2c_msg *pmsg;
-	struct i2c_algo_bit_data *adap = i2c_adap->algo_data;
-	int i, ret;
-	unsigned short nak_ok;
-
-	if (adap->pre_xfer) {
-		ret = adap->pre_xfer(i2c_adap);
-		if (ret < 0)
-			return ret;
-	}
-
-	bit_dbg(3, &i2c_adap->dev, "emitting start condition\n");
-	i2c_start(adap);
-	for (i = 0; i < num; i++) {
-		pmsg = &msgs[i];
-		nak_ok = pmsg->flags & I2C_M_IGNORE_NAK;
-		if (!(pmsg->flags & I2C_M_NOSTART)) {
-			if (i) {
-				bit_dbg(3, &i2c_adap->dev, "emitting "
-					"repeated start condition\n");
-				i2c_repstart(adap);
-			}
-			ret = bit_doAddress(i2c_adap, pmsg);
-			if ((ret != 0) && !nak_ok) {
-				bit_dbg(1, &i2c_adap->dev, "NAK from "
-					"device addr 0x%02x msg #%d\n",
-					msgs[i].addr, i);
-				goto bailout;
-			}
-		}
-		if (pmsg->flags & I2C_M_RD) {
-			/* read bytes into buffer*/
-			ret = readbytes(i2c_adap, pmsg);
-			if (ret >= 1)
-				bit_dbg(2, &i2c_adap->dev, "read %d byte%s\n",
-					ret, ret == 1 ? "" : "s");
-			if (ret < pmsg->len) {
-				if (ret >= 0)
-					ret = -EIO;
-				goto bailout;
-			}
-		} else {
-			/* write bytes from buffer */
-			ret = sendbytes(i2c_adap, pmsg);
-			if (ret >= 1)
-				bit_dbg(2, &i2c_adap->dev, "wrote %d byte%s\n",
-					ret, ret == 1 ? "" : "s");
-			if (ret < pmsg->len) {
-				if (ret >= 0)
-					ret = -EIO;
-				goto bailout;
-			}
-		}
-	}
-	ret = i;
-
-bailout:
-	bit_dbg(3, &i2c_adap->dev, "emitting stop condition\n");
-	i2c_stop(adap);
-
-	if (adap->post_xfer)
-		adap->post_xfer(i2c_adap);
-	return ret;
-}
-
-
-const struct i2c_algorithm i2c_bit_algo = {
-        .master_xfer    = bit_xfer,
-	.functionality  = bit_func,
-};
-EXPORT_SYMBOL_GPL(i2c_bit_algo);
-#endif
-
 int simple_open(struct inode *inode, struct file *file)
 {
 	if (inode->i_private)
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [RFC 14/15] backports: remove cpufreq_quick_get_max()
  2013-10-05 22:43 [RFC 00/15] backports: remove DRM drivers Hauke Mehrtens
                   ` (12 preceding siblings ...)
  2013-10-05 22:44 ` [RFC 13/15] backports: remove i2c_bit_algo() Hauke Mehrtens
@ 2013-10-05 22:44 ` Hauke Mehrtens
  2013-10-05 22:44 ` [RFC 15/15] backports: remove shmem_read_mapping_page_gfp() Hauke Mehrtens
  2013-10-20 14:12 ` [RFC 00/15] backports: remove DRM drivers Hauke Mehrtens
  15 siblings, 0 replies; 18+ messages in thread
From: Hauke Mehrtens @ 2013-10-05 22:44 UTC (permalink / raw)
  To: mcgrof; +Cc: backports, ozancag, Hauke Mehrtens

This was only needed for some of the DRM drivers, remove it.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/cpufreq.h |   13 -------------
 backport/compat/compat-3.1.c              |   23 -----------------------
 2 files changed, 36 deletions(-)
 delete mode 100644 backport/backport-include/linux/cpufreq.h

diff --git a/backport/backport-include/linux/cpufreq.h b/backport/backport-include/linux/cpufreq.h
deleted file mode 100644
index dbf234d..0000000
--- a/backport/backport-include/linux/cpufreq.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef __BACKPORT_INCLUDE_CPUFREQ_H
-#define __BACKPORT_INCLUDE_CPUFREQ_H
-#include_next <linux/cpufreq.h>
-#include <linux/version.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)
-#ifdef CONFIG_CPU_FREQ
-#define cpufreq_quick_get_max LINUX_BACKPORT(cpufreq_quick_get_max)
-unsigned int cpufreq_quick_get_max(unsigned int cpu);
-#endif
-#endif
-
-#endif /* __BACKPORT_INCLUDE_CPUFREQ_H */
diff --git a/backport/compat/compat-3.1.c b/backport/compat/compat-3.1.c
index b876329..0d9c3a2 100644
--- a/backport/compat/compat-3.1.c
+++ b/backport/compat/compat-3.1.c
@@ -11,29 +11,6 @@
 #include <linux/idr.h>
 #include <linux/cpufreq.h>
 
-/* This backports:
- * commit 3d73710880afa3d61cf57b5d4eb192e812eb7e4f
- * Author: Jesse Barnes <jbarnes@virtuousgeek.org>
- * Date:   Tue Jun 28 10:59:12 2011 -0700
- *
- * 	cpufreq: expose a cpufreq_quick_get_max routine
- */
-#ifdef CONFIG_CPU_FREQ
-unsigned int cpufreq_quick_get_max(unsigned int cpu)
-{
-	struct cpufreq_policy *policy = cpufreq_cpu_get(cpu);
-	unsigned int ret_freq = 0;
-
-	if (policy) {
-		ret_freq = policy->max;
-		cpufreq_cpu_put(policy);
-	}
-
-	return ret_freq;
-}
-EXPORT_SYMBOL_GPL(cpufreq_quick_get_max);
-#endif
-
 static DEFINE_SPINLOCK(compat_simple_ida_lock);
 
 /**
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [RFC 15/15] backports: remove shmem_read_mapping_page_gfp()
  2013-10-05 22:43 [RFC 00/15] backports: remove DRM drivers Hauke Mehrtens
                   ` (13 preceding siblings ...)
  2013-10-05 22:44 ` [RFC 14/15] backports: remove cpufreq_quick_get_max() Hauke Mehrtens
@ 2013-10-05 22:44 ` Hauke Mehrtens
  2013-10-20 14:12 ` [RFC 00/15] backports: remove DRM drivers Hauke Mehrtens
  15 siblings, 0 replies; 18+ messages in thread
From: Hauke Mehrtens @ 2013-10-05 22:44 UTC (permalink / raw)
  To: mcgrof; +Cc: backports, ozancag, Hauke Mehrtens

This was only needed for some of the DRM drivers, remove it.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/shmem_fs.h |   39 ----------------------------
 backport/compat/compat-3.0.c               |   26 -------------------
 2 files changed, 65 deletions(-)
 delete mode 100644 backport/backport-include/linux/shmem_fs.h

diff --git a/backport/backport-include/linux/shmem_fs.h b/backport/backport-include/linux/shmem_fs.h
deleted file mode 100644
index 4d3964e..0000000
--- a/backport/backport-include/linux/shmem_fs.h
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef __BACKPORT_LINUX_SHMEM_FS_H
-#define __BACKPORT_LINUX_SHMEM_FS_H
-#include_next <linux/shmem_fs.h>
-
-
-#if (RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(6,4))
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0)
-/* This pulls-in a lot of non-exported symbol backports
- * on kernels older than 2.6.32. There's no harm for not
- * making this available on kernels < 2.6.32. */
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32))
-#include <linux/pagemap.h>
-/* This backports the 2nd part of:
- *
- * commit d9d90e5eb70e09903dadff42099b6c948f814050
- * Author: Hugh Dickins <hughd@google.com>
- * Date:   Mon Jun 27 16:18:04 2011 -0700
- *
- *	tmpfs: add shmem_read_mapping_page_gfp
- *
- * First part is in compat-3.0.c.
- */
-#define shmem_read_mapping_page_gfp LINUX_BACKPORT(shmem_read_mapping_page_gfp)
-extern struct page *shmem_read_mapping_page_gfp(struct address_space *mapping,
-						pgoff_t index, gfp_t gfp);
-
-
-#define shmem_read_mapping_page LINUX_BACKPORT(shmem_read_mapping_page)
-static inline struct page *shmem_read_mapping_page(
-                               struct address_space *mapping, pgoff_t index)
-{
-       return shmem_read_mapping_page_gfp(mapping, index,
-                                       mapping_gfp_mask(mapping));
-}
-#endif
-#endif
-#endif
-
-#endif /* __BACKPORT_LINUX_SHMEM_FS_H */
diff --git a/backport/compat/compat-3.0.c b/backport/compat/compat-3.0.c
index 0a993d7..9841019 100644
--- a/backport/compat/compat-3.0.c
+++ b/backport/compat/compat-3.0.c
@@ -12,32 +12,6 @@
 #include <linux/compat.h>
 #include <linux/if_ether.h>
 
-#if (RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(6,4))
-/* This pulls-in a lot of non-exported symbol backports
- * on kernels older than 2.6.32. There's no harm for not
- * making this available on kernels < 2.6.32. */
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32))
-#include <linux/pagemap.h>
-#include <linux/shmem_fs.h>
-
-/* This backports:
- *
- * commit d9d90e5eb70e09903dadff42099b6c948f814050
- * Author: Hugh Dickins <hughd@google.com>
- * Date:   Mon Jun 27 16:18:04 2011 -0700
- *
- *	tmpfs: add shmem_read_mapping_page_gfp
- */
-
-struct page *shmem_read_mapping_page_gfp(struct address_space *mapping,
-                                        pgoff_t index, gfp_t gfp)
-{
-       return read_cache_page_gfp(mapping, index, gfp);
-}
-EXPORT_SYMBOL_GPL(shmem_read_mapping_page_gfp);
-#endif
-#endif
-
 int mac_pton(const char *s, u8 *mac)
 {
 	int i;
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [RFC 00/15] backports: remove DRM drivers
  2013-10-05 22:43 [RFC 00/15] backports: remove DRM drivers Hauke Mehrtens
                   ` (14 preceding siblings ...)
  2013-10-05 22:44 ` [RFC 15/15] backports: remove shmem_read_mapping_page_gfp() Hauke Mehrtens
@ 2013-10-20 14:12 ` Hauke Mehrtens
  2013-10-20 14:39   ` Solomon Peachy
  15 siblings, 1 reply; 18+ messages in thread
From: Hauke Mehrtens @ 2013-10-20 14:12 UTC (permalink / raw)
  To: Hauke Mehrtens, mcgrof; +Cc: backports, ozancag

On 10/06/2013 12:43 AM, Hauke Mehrtens wrote:
> Maintaining the DRM driver takes a lot of recourses as there they are
> depending on many API changes done to the core kernel code and
> currently we do not have that many recourses to follow them. On the
> other side one needs also new userspace drivers to make use of the new
> features added to the DRM kernel drivers and it is not easy to update
> the X drivers. Therefore we came to the conclusion to remove the drm
> drivers for now.
> 
> If someone wants to maintain the DRM drivers I would be very happy with
> that and they should not be removed.
> 
> There were also some problems with some DRM drivers, like the Intel
> i915 driver caused kernel panic on some systems and was probably only
> usable on some very recent kernel versions.
> 
> 1   2.6.25              [  OK  ]
> 2   2.6.26              [  OK  ]
> 3   2.6.27              [  OK  ]
> 4   2.6.28              [  OK  ]
> 5   2.6.29              [  OK  ]
> 6   2.6.30              [  OK  ]
> 7   2.6.31              [  OK  ]
> 8   2.6.32              [  OK  ]
> 9   2.6.33              [  OK  ]
> 10  2.6.34              [  OK  ]
> 11  2.6.35              [  OK  ]
> 12  2.6.36              [  OK  ]
> 13  2.6.37              [  OK  ]
> 14  2.6.38              [  OK  ]
> 15  2.6.39              [  OK  ]
> 16  3.0.98              [  OK  ]
> 17  3.1.10              [  OK  ]
> 18  3.10.14             [  OK  ]
> 19  3.11.3              [  OK  ]
> 20  3.12-rc3            [  FAIL  ]
> 21  3.2.51              [  OK  ]
> 22  3.3.8               [  OK  ]
> 23  3.4.64              [  OK  ]
> 24  3.5.7               [  OK  ]
> 25  3.6.11              [  OK  ]
> 26  3.7.10              [  OK  ]
> 27  3.8.13              [  OK  ]
> 28  3.9.11              [  OK  ]
> 
> You can pull it from
> https://github.com/hauke/backports/tree/drm-remove
> 
> This is based on the "backports: add next-20130822" patch series.
> 
> Hauke Mehrtens (15):
>   backports: remove DRM driver
>   backports: remove platform drivers
>   backports: remove BACKPORT_BUILD_CROSS_RESERVATION
>   backports: remove CPTCFG_BACKPORT_BUILD_WW_MUTEX
>   backports: remove BACKPORT_BUILD_RADIX_HELPERS
>   backports: remove BACKPORT_BUILD_HDMI
>   backports: remove more hdmi stuff
>   backports: remove some stuff related to MTRR
>   backports: remove scatterlist
>   backports: remove ktime_get_monotonic_offset()
>   backports: remove devm_regmap_init_spi()
>   backports: remove compat_wake_up_locked()
>   backports: remove i2c_bit_algo()
>   backports: remove cpufreq_quick_get_max()
>   backports: remove shmem_read_mapping_page_gfp()

Any comments on this?

If nobody has a problem with this series I would like to relabel it into
a patch series so it could be included.

Hauke

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [RFC 00/15] backports: remove DRM drivers
  2013-10-20 14:12 ` [RFC 00/15] backports: remove DRM drivers Hauke Mehrtens
@ 2013-10-20 14:39   ` Solomon Peachy
  0 siblings, 0 replies; 18+ messages in thread
From: Solomon Peachy @ 2013-10-20 14:39 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: mcgrof, backports, ozancag

[-- Attachment #1: Type: text/plain, Size: 470 bytes --]

On Sun, Oct 20, 2013 at 04:12:09PM +0200, Hauke Mehrtens wrote:
> Any comments on this?
> 
> If nobody has a problem with this series I would like to relabel it into
> a patch series so it could be included.

IMNSHO, kill the DRM backports with massive amounts of cleansing fire!

 - Solomon
-- 
Solomon Peachy        		       pizza at shaftnet dot org
Delray Beach, FL                          ^^ (email/xmpp) ^^
Quidquid latine dictum sit, altum viditur.

[-- Attachment #2: Type: application/pgp-signature, Size: 190 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2013-10-20 15:43 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-05 22:43 [RFC 00/15] backports: remove DRM drivers Hauke Mehrtens
2013-10-05 22:43 ` [RFC 01/15] backports: remove DRM driver Hauke Mehrtens
2013-10-05 22:43 ` [RFC 02/15] backports: remove platform drivers Hauke Mehrtens
2013-10-05 22:43 ` [RFC 03/15] backports: remove BACKPORT_BUILD_CROSS_RESERVATION Hauke Mehrtens
2013-10-05 22:43 ` [RFC 04/15] backports: remove CPTCFG_BACKPORT_BUILD_WW_MUTEX Hauke Mehrtens
2013-10-05 22:43 ` [RFC 05/15] backports: remove BACKPORT_BUILD_RADIX_HELPERS Hauke Mehrtens
2013-10-05 22:43 ` [RFC 06/15] backports: remove BACKPORT_BUILD_HDMI Hauke Mehrtens
2013-10-05 22:43 ` [RFC 07/15] backports: remove more hdmi stuff Hauke Mehrtens
2013-10-05 22:43 ` [RFC 08/15] backports: remove some stuff related to MTRR Hauke Mehrtens
2013-10-05 22:43 ` [RFC 09/15] backports: remove scatterlist Hauke Mehrtens
2013-10-05 22:43 ` [RFC 10/15] backports: remove ktime_get_monotonic_offset() Hauke Mehrtens
2013-10-05 22:44 ` [RFC 11/15] backports: remove devm_regmap_init_spi() Hauke Mehrtens
2013-10-05 22:44 ` [RFC 12/15] backports: remove compat_wake_up_locked() Hauke Mehrtens
2013-10-05 22:44 ` [RFC 13/15] backports: remove i2c_bit_algo() Hauke Mehrtens
2013-10-05 22:44 ` [RFC 14/15] backports: remove cpufreq_quick_get_max() Hauke Mehrtens
2013-10-05 22:44 ` [RFC 15/15] backports: remove shmem_read_mapping_page_gfp() Hauke Mehrtens
2013-10-20 14:12 ` [RFC 00/15] backports: remove DRM drivers Hauke Mehrtens
2013-10-20 14:39   ` Solomon Peachy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.