--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
-@@ -1652,7 +1652,11 @@ int i915_driver_load(struct drm_device *
+@@ -1648,7 +1648,11 @@ int i915_driver_load(struct drm_device *
return 0;
out_gem_unload:
unregister_shrinker(&dev_priv->mm.inactive_shrinker);
if (dev->pdev->msi_enabled)
-@@ -1686,7 +1690,11 @@ int i915_driver_unload(struct drm_device
+@@ -1682,7 +1686,11 @@ int i915_driver_unload(struct drm_device
i915_teardown_sysfs(dev);
mutex_lock(&dev->struct_mutex);
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
-@@ -54,10 +54,15 @@ static void i915_gem_object_update_fence
+@@ -56,10 +56,15 @@ static void i915_gem_object_update_fence
struct drm_i915_fence_reg *fence,
bool enable);
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);
-@@ -4394,8 +4399,12 @@ i915_gem_load(struct drm_device *dev)
+@@ -4464,8 +4469,12 @@ i915_gem_load(struct drm_device *dev)
dev_priv->mm.interruptible = true;
dev_priv->mm.inactive_shrinker.seeks = DEFAULT_SEEKS;
register_shrinker(&dev_priv->mm.inactive_shrinker);
}
-@@ -4618,8 +4627,14 @@ static bool mutex_is_locked_by(struct mu
+@@ -4688,8 +4697,14 @@ static bool mutex_is_locked_by(struct mu
#endif
}
{
struct drm_i915_private *dev_priv =
container_of(shrinker,
-@@ -4629,7 +4644,12 @@ i915_gem_inactive_count(struct shrinker
- struct i915_address_space *vm = &dev_priv->gtt.base;
+@@ -4698,7 +4713,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))
if (!mutex_trylock(&dev->struct_mutex)) {
if (!mutex_is_locked_by(&dev->struct_mutex, current))
-@@ -4641,6 +4661,17 @@ i915_gem_inactive_count(struct shrinker
+@@ -4710,6 +4730,17 @@ i915_gem_inactive_count(struct shrinker
unlock = false;
}
count = 0;
list_for_each_entry(obj, &dev_priv->mm.unbound_list, global_list)
if (obj->pages_pin_count == 0)
-@@ -4654,6 +4685,7 @@ i915_gem_inactive_count(struct shrinker
- return count;
+@@ -4800,6 +4831,7 @@ struct i915_vma *i915_gem_obj_to_vma(str
+ return NULL;
}
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
static unsigned long
i915_gem_inactive_scan(struct shrinker *shrinker, struct shrink_control *sc)
{
-@@ -4687,3 +4719,4 @@ i915_gem_inactive_scan(struct shrinker *
+@@ -4833,3 +4865,4 @@ i915_gem_inactive_scan(struct shrinker *
mutex_unlock(&dev->struct_mutex);
return freed;
}
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
-@@ -1628,7 +1628,7 @@ static int nl80211_dump_wiphy(struct sk_
+@@ -1630,7 +1630,7 @@ static int nl80211_dump_wiphy(struct sk_
/* attempt to fit multiple wiphy data chunks into the skb */
do {
ret = nl80211_send_wiphy(dev, skb,
cb->nlh->nlmsg_seq,
NLM_F_MULTI, state);
if (ret < 0) {
-@@ -1681,7 +1681,7 @@ static int nl80211_get_wiphy(struct sk_b
+@@ -1683,7 +1683,7 @@ static int nl80211_get_wiphy(struct sk_b
if (!msg)
return -ENOMEM;
&state) < 0) {
nlmsg_free(msg);
return -ENOBUFS;
-@@ -2256,7 +2256,7 @@ static int nl80211_dump_interface(struct
+@@ -2258,7 +2258,7 @@ static int nl80211_dump_interface(struct
if_idx++;
continue;
}
cb->nlh->nlmsg_seq, NLM_F_MULTI,
rdev, wdev) < 0) {
goto out;
-@@ -2285,7 +2285,7 @@ static int nl80211_get_interface(struct
+@@ -2287,7 +2287,7 @@ static int nl80211_get_interface(struct
if (!msg)
return -ENOMEM;
dev, wdev) < 0) {
nlmsg_free(msg);
return -ENOBUFS;
-@@ -2518,7 +2518,7 @@ static int nl80211_new_interface(struct
+@@ -2520,7 +2520,7 @@ static int nl80211_new_interface(struct
break;
}
rdev, wdev) < 0) {
nlmsg_free(msg);
return -ENOBUFS;
-@@ -2653,7 +2653,7 @@ static int nl80211_get_key(struct sk_buf
+@@ -2655,7 +2655,7 @@ static int nl80211_get_key(struct sk_buf
if (!msg)
return -ENOMEM;
NL80211_CMD_NEW_KEY);
if (IS_ERR(hdr))
return PTR_ERR(hdr);
-@@ -3622,7 +3622,7 @@ static int nl80211_dump_station(struct s
+@@ -3624,7 +3624,7 @@ static int nl80211_dump_station(struct s
goto out_err;
if (nl80211_send_station(skb,
cb->nlh->nlmsg_seq, NLM_F_MULTI,
dev, wdev->netdev, mac_addr,
&sinfo) < 0)
-@@ -3668,7 +3668,7 @@ static int nl80211_get_station(struct sk
+@@ -3670,7 +3670,7 @@ static int nl80211_get_station(struct sk
if (!msg)
return -ENOMEM;
rdev, dev, mac_addr, &sinfo) < 0) {
nlmsg_free(msg);
return -ENOBUFS;
-@@ -4276,7 +4276,7 @@ static int nl80211_dump_mpath(struct sk_
+@@ -4278,7 +4278,7 @@ static int nl80211_dump_mpath(struct sk_
if (err)
goto out_err;
cb->nlh->nlmsg_seq, NLM_F_MULTI,
wdev->netdev, dst, next_hop,
&pinfo) < 0)
-@@ -4325,7 +4325,7 @@ static int nl80211_get_mpath(struct sk_b
+@@ -4327,7 +4327,7 @@ static int nl80211_get_mpath(struct sk_b
if (!msg)
return -ENOMEM;
dev, dst, next_hop, &pinfo) < 0) {
nlmsg_free(msg);
return -ENOBUFS;
-@@ -4589,7 +4589,7 @@ static int nl80211_get_mesh_config(struc
+@@ -4591,7 +4591,7 @@ static int nl80211_get_mesh_config(struc
msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
if (!msg)
return -ENOMEM;
NL80211_CMD_GET_MESH_CONFIG);
if (!hdr)
goto out;
-@@ -4948,7 +4948,7 @@ static int nl80211_get_reg(struct sk_buf
+@@ -4950,7 +4950,7 @@ static int nl80211_get_reg(struct sk_buf
if (!msg)
return -ENOBUFS;
NL80211_CMD_GET_REG);
if (!hdr)
goto put_failure;
-@@ -5627,7 +5627,7 @@ static int nl80211_send_bss(struct sk_bu
+@@ -5629,7 +5629,7 @@ static int nl80211_send_bss(struct sk_bu
ASSERT_WDEV_LOCK(wdev);
NL80211_CMD_NEW_SCAN_RESULTS);
if (!hdr)
return -1;
-@@ -5864,7 +5864,7 @@ static int nl80211_dump_survey(struct sk
+@@ -5866,7 +5866,7 @@ static int nl80211_dump_survey(struct sk
}
if (nl80211_send_survey(skb,
cb->nlh->nlmsg_seq, NLM_F_MULTI,
wdev->netdev, &survey) < 0)
goto out;
-@@ -6551,7 +6551,7 @@ static int nl80211_testmode_dump(struct
+@@ -6553,7 +6553,7 @@ static int nl80211_testmode_dump(struct
}
while (1) {
cb->nlh->nlmsg_seq, NLM_F_MULTI,
NL80211_CMD_TESTMODE);
struct nlattr *tmdata;
-@@ -6630,7 +6630,7 @@ struct sk_buff *cfg80211_testmode_alloc_
+@@ -6632,7 +6632,7 @@ struct sk_buff *cfg80211_testmode_alloc_
return NULL;
return __cfg80211_testmode_alloc_skb(rdev, approxlen,
rdev->testmode_info->snd_seq,
GFP_KERNEL);
}
-@@ -6998,7 +6998,7 @@ static int nl80211_remain_on_channel(str
+@@ -7000,7 +7000,7 @@ static int nl80211_remain_on_channel(str
if (!msg)
return -ENOMEM;
NL80211_CMD_REMAIN_ON_CHANNEL);
if (IS_ERR(hdr)) {
-@@ -7217,7 +7217,7 @@ static int nl80211_register_mgmt(struct
+@@ -7219,7 +7219,7 @@ static int nl80211_register_mgmt(struct
if (!rdev->ops->mgmt_tx)
return -EOPNOTSUPP;
nla_data(info->attrs[NL80211_ATTR_FRAME_MATCH]),
nla_len(info->attrs[NL80211_ATTR_FRAME_MATCH]));
}
-@@ -7298,7 +7298,7 @@ static int nl80211_tx_mgmt(struct sk_buf
+@@ -7300,7 +7300,7 @@ static int nl80211_tx_mgmt(struct sk_buf
if (!msg)
return -ENOMEM;
NL80211_CMD_FRAME);
if (IS_ERR(hdr)) {
-@@ -7413,7 +7413,7 @@ static int nl80211_get_power_save(struct
+@@ -7415,7 +7415,7 @@ static int nl80211_get_power_save(struct
if (!msg)
return -ENOMEM;
NL80211_CMD_GET_POWER_SAVE);
if (!hdr) {
err = -ENOBUFS;
-@@ -7723,7 +7723,7 @@ static int nl80211_get_wowlan(struct sk_
+@@ -7725,7 +7725,7 @@ static int nl80211_get_wowlan(struct sk_
if (!msg)
return -ENOMEM;
NL80211_CMD_GET_WOWLAN);
if (!hdr)
goto nla_put_failure;
-@@ -8152,7 +8152,7 @@ static int nl80211_get_coalesce(struct s
+@@ -8154,7 +8154,7 @@ static int nl80211_get_coalesce(struct s
if (!msg)
return -ENOMEM;
NL80211_CMD_GET_COALESCE);
if (!hdr)
goto nla_put_failure;
-@@ -8405,7 +8405,7 @@ static int nl80211_register_unexpected_f
+@@ -8407,7 +8407,7 @@ static int nl80211_register_unexpected_f
if (wdev->ap_unexpected_nlportid)
return -EBUSY;
return 0;
}
-@@ -8435,7 +8435,7 @@ static int nl80211_probe_client(struct s
+@@ -8437,7 +8437,7 @@ static int nl80211_probe_client(struct s
if (!msg)
return -ENOMEM;
NL80211_CMD_PROBE_CLIENT);
if (IS_ERR(hdr)) {
-@@ -8479,13 +8479,13 @@ static int nl80211_register_beacons(stru
+@@ -8481,13 +8481,13 @@ static int nl80211_register_beacons(stru
/* First, check if already registered. */
spin_lock_bh(&rdev->beacon_registrations_lock);
list_for_each_entry(reg, &rdev->beacon_registrations, list) {
list_add(&nreg->list, &rdev->beacon_registrations);
spin_unlock_bh(&rdev->beacon_registrations_lock);
-@@ -8552,7 +8552,7 @@ static int nl80211_get_protocol_features
+@@ -8554,7 +8554,7 @@ static int nl80211_get_protocol_features
if (!msg)
return -ENOMEM;
NL80211_CMD_GET_PROTOCOL_FEATURES);
if (!hdr)
goto nla_put_failure;
-@@ -8627,7 +8627,7 @@ static int nl80211_crit_protocol_start(s
+@@ -8629,7 +8629,7 @@ static int nl80211_crit_protocol_start(s
ret = rdev_crit_proto_start(rdev, wdev, proto, duration);
if (!ret)
return ret;
}
-@@ -11018,12 +11018,12 @@ static int nl80211_netlink_notify(struct
+@@ -11020,12 +11020,12 @@ static int nl80211_netlink_notify(struct
list_for_each_entry_rcu(rdev, &cfg80211_rdev_list, list) {
list_for_each_entry_rcu(wdev, &rdev->wdev_list, list)