Gentoo Archives: gentoo-commits

From: "Tom Wijsman (tomwij)" <tomwij@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] linux-patches r2582 - in genpatches-2.6/trunk: 3.10 3.11 3.12 3.4
Date: Thu, 21 Nov 2013 00:37:08
Message-Id: 20131121003701.433E92004B@flycatcher.gentoo.org
1 Author: tomwij
2 Date: 2013-11-21 00:37:00 +0000 (Thu, 21 Nov 2013)
3 New Revision: 2582
4
5 Added:
6 genpatches-2.6/trunk/3.10/1019_linux-3.10.20.patch
7 genpatches-2.6/trunk/3.11/1008_linux-3.11.9.patch
8 genpatches-2.6/trunk/3.12/1000_linux-3.12.1.patch
9 genpatches-2.6/trunk/3.4/1069_linux-3.4.70.patch
10 Modified:
11 genpatches-2.6/trunk/3.10/0000_README
12 genpatches-2.6/trunk/3.11/0000_README
13 genpatches-2.6/trunk/3.12/0000_README
14 genpatches-2.6/trunk/3.4/0000_README
15 Log:
16 Linux patches 3.4.70, 3.10.20, 3.11.9 and 3.12.1.
17
18 Modified: genpatches-2.6/trunk/3.10/0000_README
19 ===================================================================
20 --- genpatches-2.6/trunk/3.10/0000_README 2013-11-14 16:37:35 UTC (rev 2581)
21 +++ genpatches-2.6/trunk/3.10/0000_README 2013-11-21 00:37:00 UTC (rev 2582)
22 @@ -118,6 +118,10 @@
23 From: http://www.kernel.org
24 Desc: Linux 3.10.19
25
26 +Patch: 1019_linux-3.10.20.patch
27 +From: http://www.kernel.org
28 +Desc: Linux 3.10.20
29 +
30 Patch: 1500_XATTR_USER_PREFIX.patch
31 From: https://bugs.gentoo.org/show_bug.cgi?id=470644
32 Desc: Support for namespace user.pax.* on tmpfs.
33
34 Added: genpatches-2.6/trunk/3.10/1019_linux-3.10.20.patch
35 ===================================================================
36 --- genpatches-2.6/trunk/3.10/1019_linux-3.10.20.patch (rev 0)
37 +++ genpatches-2.6/trunk/3.10/1019_linux-3.10.20.patch 2013-11-21 00:37:00 UTC (rev 2582)
38 @@ -0,0 +1,1143 @@
39 +diff --git a/Makefile b/Makefile
40 +index 83a02f5b2c00..ba784b7b0f51 100644
41 +--- a/Makefile
42 ++++ b/Makefile
43 +@@ -1,6 +1,6 @@
44 + VERSION = 3
45 + PATCHLEVEL = 10
46 +-SUBLEVEL = 19
47 ++SUBLEVEL = 20
48 + EXTRAVERSION =
49 + NAME = TOSSUG Baby Fish
50 +
51 +diff --git a/drivers/media/platform/sh_vou.c b/drivers/media/platform/sh_vou.c
52 +index 7d0235069c87..5d538e7cd1bb 100644
53 +--- a/drivers/media/platform/sh_vou.c
54 ++++ b/drivers/media/platform/sh_vou.c
55 +@@ -776,7 +776,7 @@ static int sh_vou_try_fmt_vid_out(struct file *file, void *priv,
56 + v4l_bound_align_image(&pix->width, 0, VOU_MAX_IMAGE_WIDTH, 1,
57 + &pix->height, 0, VOU_MAX_IMAGE_HEIGHT, 1, 0);
58 +
59 +- for (i = 0; ARRAY_SIZE(vou_fmt); i++)
60 ++ for (i = 0; i < ARRAY_SIZE(vou_fmt); i++)
61 + if (vou_fmt[i].pfmt == pix->pixelformat)
62 + return 0;
63 +
64 +diff --git a/drivers/misc/atmel_pwm.c b/drivers/misc/atmel_pwm.c
65 +index 494d0500bda6..a6dc56e1bc58 100644
66 +--- a/drivers/misc/atmel_pwm.c
67 ++++ b/drivers/misc/atmel_pwm.c
68 +@@ -90,8 +90,10 @@ int pwm_channel_alloc(int index, struct pwm_channel *ch)
69 + unsigned long flags;
70 + int status = 0;
71 +
72 +- /* insist on PWM init, with this signal pinned out */
73 +- if (!pwm || !(pwm->mask & 1 << index))
74 ++ if (!pwm)
75 ++ return -EPROBE_DEFER;
76 ++
77 ++ if (!(pwm->mask & 1 << index))
78 + return -ENODEV;
79 +
80 + if (index < 0 || index >= PWM_NCHAN || !ch)
81 +diff --git a/drivers/net/ethernet/chelsio/cxgb3/sge.c b/drivers/net/ethernet/chelsio/cxgb3/sge.c
82 +index f12e6b85a653..f057a189d975 100644
83 +--- a/drivers/net/ethernet/chelsio/cxgb3/sge.c
84 ++++ b/drivers/net/ethernet/chelsio/cxgb3/sge.c
85 +@@ -1600,7 +1600,8 @@ static void write_ofld_wr(struct adapter *adap, struct sk_buff *skb,
86 + flits = skb_transport_offset(skb) / 8;
87 + sgp = ndesc == 1 ? (struct sg_ent *)&d->flit[flits] : sgl;
88 + sgl_flits = make_sgl(skb, sgp, skb_transport_header(skb),
89 +- skb->tail - skb->transport_header,
90 ++ skb_tail_pointer(skb) -
91 ++ skb_transport_header(skb),
92 + adap->pdev);
93 + if (need_skb_unmap()) {
94 + setup_deferred_unmapping(skb, adap->pdev, sgp, sgl_flits);
95 +diff --git a/drivers/net/ethernet/mellanox/mlx4/cmd.c b/drivers/net/ethernet/mellanox/mlx4/cmd.c
96 +index 0e572a527154..28d706bd12eb 100644
97 +--- a/drivers/net/ethernet/mellanox/mlx4/cmd.c
98 ++++ b/drivers/net/ethernet/mellanox/mlx4/cmd.c
99 +@@ -1544,7 +1544,7 @@ static void mlx4_master_deactivate_admin_state(struct mlx4_priv *priv, int slave
100 + vp_oper->vlan_idx = NO_INDX;
101 + }
102 + if (NO_INDX != vp_oper->mac_idx) {
103 +- __mlx4_unregister_mac(&priv->dev, port, vp_oper->mac_idx);
104 ++ __mlx4_unregister_mac(&priv->dev, port, vp_oper->state.mac);
105 + vp_oper->mac_idx = NO_INDX;
106 + }
107 + }
108 +diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
109 +index 1d01534c2020..64cf70247048 100644
110 +--- a/drivers/net/virtio_net.c
111 ++++ b/drivers/net/virtio_net.c
112 +@@ -1096,11 +1096,6 @@ static int virtnet_cpu_callback(struct notifier_block *nfb,
113 + {
114 + struct virtnet_info *vi = container_of(nfb, struct virtnet_info, nb);
115 +
116 +- mutex_lock(&vi->config_lock);
117 +-
118 +- if (!vi->config_enable)
119 +- goto done;
120 +-
121 + switch(action & ~CPU_TASKS_FROZEN) {
122 + case CPU_ONLINE:
123 + case CPU_DOWN_FAILED:
124 +@@ -1114,8 +1109,6 @@ static int virtnet_cpu_callback(struct notifier_block *nfb,
125 + break;
126 + }
127 +
128 +-done:
129 +- mutex_unlock(&vi->config_lock);
130 + return NOTIFY_OK;
131 + }
132 +
133 +@@ -1672,6 +1665,8 @@ static int virtnet_freeze(struct virtio_device *vdev)
134 + struct virtnet_info *vi = vdev->priv;
135 + int i;
136 +
137 ++ unregister_hotcpu_notifier(&vi->nb);
138 ++
139 + /* Prevent config work handler from accessing the device */
140 + mutex_lock(&vi->config_lock);
141 + vi->config_enable = false;
142 +@@ -1720,6 +1715,10 @@ static int virtnet_restore(struct virtio_device *vdev)
143 + virtnet_set_queues(vi, vi->curr_queue_pairs);
144 + rtnl_unlock();
145 +
146 ++ err = register_hotcpu_notifier(&vi->nb);
147 ++ if (err)
148 ++ return err;
149 ++
150 + return 0;
151 + }
152 + #endif
153 +diff --git a/drivers/net/wireless/iwlwifi/iwl-7000.c b/drivers/net/wireless/iwlwifi/iwl-7000.c
154 +index dc94d44d95cd..822443c5a3b5 100644
155 +--- a/drivers/net/wireless/iwlwifi/iwl-7000.c
156 ++++ b/drivers/net/wireless/iwlwifi/iwl-7000.c
157 +@@ -125,7 +125,7 @@ static const struct iwl_ht_params iwl7000_ht_params = {
158 +
159 +
160 + const struct iwl_cfg iwl7260_2ac_cfg = {
161 +- .name = "Intel(R) Dual Band Wireless AC7260",
162 ++ .name = "Intel(R) Dual Band Wireless AC 7260",
163 + .fw_name_pre = IWL7260_FW_PRE,
164 + IWL_DEVICE_7000,
165 + .ht_params = &iwl7000_ht_params,
166 +@@ -133,8 +133,44 @@ const struct iwl_cfg iwl7260_2ac_cfg = {
167 + .nvm_calib_ver = IWL7260_TX_POWER_VERSION,
168 + };
169 +
170 +-const struct iwl_cfg iwl3160_ac_cfg = {
171 +- .name = "Intel(R) Dual Band Wireless AC3160",
172 ++const struct iwl_cfg iwl7260_2n_cfg = {
173 ++ .name = "Intel(R) Dual Band Wireless N 7260",
174 ++ .fw_name_pre = IWL7260_FW_PRE,
175 ++ IWL_DEVICE_7000,
176 ++ .ht_params = &iwl7000_ht_params,
177 ++ .nvm_ver = IWL7260_NVM_VERSION,
178 ++ .nvm_calib_ver = IWL7260_TX_POWER_VERSION,
179 ++};
180 ++
181 ++const struct iwl_cfg iwl7260_n_cfg = {
182 ++ .name = "Intel(R) Wireless N 7260",
183 ++ .fw_name_pre = IWL7260_FW_PRE,
184 ++ IWL_DEVICE_7000,
185 ++ .ht_params = &iwl7000_ht_params,
186 ++ .nvm_ver = IWL7260_NVM_VERSION,
187 ++ .nvm_calib_ver = IWL7260_TX_POWER_VERSION,
188 ++};
189 ++
190 ++const struct iwl_cfg iwl3160_2ac_cfg = {
191 ++ .name = "Intel(R) Dual Band Wireless AC 3160",
192 ++ .fw_name_pre = IWL3160_FW_PRE,
193 ++ IWL_DEVICE_7000,
194 ++ .ht_params = &iwl7000_ht_params,
195 ++ .nvm_ver = IWL3160_NVM_VERSION,
196 ++ .nvm_calib_ver = IWL3160_TX_POWER_VERSION,
197 ++};
198 ++
199 ++const struct iwl_cfg iwl3160_2n_cfg = {
200 ++ .name = "Intel(R) Dual Band Wireless N 3160",
201 ++ .fw_name_pre = IWL3160_FW_PRE,
202 ++ IWL_DEVICE_7000,
203 ++ .ht_params = &iwl7000_ht_params,
204 ++ .nvm_ver = IWL3160_NVM_VERSION,
205 ++ .nvm_calib_ver = IWL3160_TX_POWER_VERSION,
206 ++};
207 ++
208 ++const struct iwl_cfg iwl3160_n_cfg = {
209 ++ .name = "Intel(R) Wireless N 3160",
210 + .fw_name_pre = IWL3160_FW_PRE,
211 + IWL_DEVICE_7000,
212 + .ht_params = &iwl7000_ht_params,
213 +diff --git a/drivers/net/wireless/iwlwifi/iwl-config.h b/drivers/net/wireless/iwlwifi/iwl-config.h
214 +index c67e29655b2d..44e3370ce343 100644
215 +--- a/drivers/net/wireless/iwlwifi/iwl-config.h
216 ++++ b/drivers/net/wireless/iwlwifi/iwl-config.h
217 +@@ -321,6 +321,10 @@ extern const struct iwl_cfg iwl105_bgn_cfg;
218 + extern const struct iwl_cfg iwl105_bgn_d_cfg;
219 + extern const struct iwl_cfg iwl135_bgn_cfg;
220 + extern const struct iwl_cfg iwl7260_2ac_cfg;
221 +-extern const struct iwl_cfg iwl3160_ac_cfg;
222 ++extern const struct iwl_cfg iwl7260_2n_cfg;
223 ++extern const struct iwl_cfg iwl7260_n_cfg;
224 ++extern const struct iwl_cfg iwl3160_2ac_cfg;
225 ++extern const struct iwl_cfg iwl3160_2n_cfg;
226 ++extern const struct iwl_cfg iwl3160_n_cfg;
227 +
228 + #endif /* __IWL_CONFIG_H__ */
229 +diff --git a/drivers/net/wireless/iwlwifi/pcie/drv.c b/drivers/net/wireless/iwlwifi/pcie/drv.c
230 +index b7858a595973..b53e5c3f403b 100644
231 +--- a/drivers/net/wireless/iwlwifi/pcie/drv.c
232 ++++ b/drivers/net/wireless/iwlwifi/pcie/drv.c
233 +@@ -267,10 +267,83 @@ static DEFINE_PCI_DEVICE_TABLE(iwl_hw_card_ids) = {
234 +
235 + /* 7000 Series */
236 + {IWL_PCI_DEVICE(0x08B1, 0x4070, iwl7260_2ac_cfg)},
237 +- {IWL_PCI_DEVICE(0x08B1, 0x4062, iwl7260_2ac_cfg)},
238 ++ {IWL_PCI_DEVICE(0x08B1, 0x4072, iwl7260_2ac_cfg)},
239 ++ {IWL_PCI_DEVICE(0x08B1, 0x4170, iwl7260_2ac_cfg)},
240 ++ {IWL_PCI_DEVICE(0x08B1, 0x4060, iwl7260_2n_cfg)},
241 ++ {IWL_PCI_DEVICE(0x08B1, 0x406A, iwl7260_2n_cfg)},
242 ++ {IWL_PCI_DEVICE(0x08B1, 0x4160, iwl7260_2n_cfg)},
243 ++ {IWL_PCI_DEVICE(0x08B1, 0x4062, iwl7260_n_cfg)},
244 ++ {IWL_PCI_DEVICE(0x08B1, 0x4162, iwl7260_n_cfg)},
245 ++ {IWL_PCI_DEVICE(0x08B2, 0x4270, iwl7260_2ac_cfg)},
246 ++ {IWL_PCI_DEVICE(0x08B2, 0x4272, iwl7260_2ac_cfg)},
247 ++ {IWL_PCI_DEVICE(0x08B2, 0x4260, iwl7260_2n_cfg)},
248 ++ {IWL_PCI_DEVICE(0x08B2, 0x426A, iwl7260_2n_cfg)},
249 ++ {IWL_PCI_DEVICE(0x08B2, 0x4262, iwl7260_n_cfg)},
250 ++ {IWL_PCI_DEVICE(0x08B1, 0x4470, iwl7260_2ac_cfg)},
251 ++ {IWL_PCI_DEVICE(0x08B1, 0x4472, iwl7260_2ac_cfg)},
252 ++ {IWL_PCI_DEVICE(0x08B1, 0x4460, iwl7260_2n_cfg)},
253 ++ {IWL_PCI_DEVICE(0x08B1, 0x446A, iwl7260_2n_cfg)},
254 ++ {IWL_PCI_DEVICE(0x08B1, 0x4462, iwl7260_n_cfg)},
255 ++ {IWL_PCI_DEVICE(0x08B1, 0x4870, iwl7260_2ac_cfg)},
256 ++ {IWL_PCI_DEVICE(0x08B1, 0x486E, iwl7260_2ac_cfg)},
257 ++ {IWL_PCI_DEVICE(0x08B1, 0x4570, iwl7260_2ac_cfg)},
258 ++ {IWL_PCI_DEVICE(0x08B1, 0x4560, iwl7260_2n_cfg)},
259 ++ {IWL_PCI_DEVICE(0x08B2, 0x4370, iwl7260_2ac_cfg)},
260 ++ {IWL_PCI_DEVICE(0x08B2, 0x4360, iwl7260_2n_cfg)},
261 ++ {IWL_PCI_DEVICE(0x08B1, 0x5070, iwl7260_2ac_cfg)},
262 ++ {IWL_PCI_DEVICE(0x08B1, 0x4020, iwl7260_2n_cfg)},
263 ++ {IWL_PCI_DEVICE(0x08B1, 0x402A, iwl7260_2n_cfg)},
264 ++ {IWL_PCI_DEVICE(0x08B2, 0x4220, iwl7260_2n_cfg)},
265 ++ {IWL_PCI_DEVICE(0x08B1, 0x4420, iwl7260_2n_cfg)},
266 + {IWL_PCI_DEVICE(0x08B1, 0xC070, iwl7260_2ac_cfg)},
267 +- {IWL_PCI_DEVICE(0x08B3, 0x0070, iwl3160_ac_cfg)},
268 +- {IWL_PCI_DEVICE(0x08B3, 0x8070, iwl3160_ac_cfg)},
269 ++ {IWL_PCI_DEVICE(0x08B1, 0xC072, iwl7260_2ac_cfg)},
270 ++ {IWL_PCI_DEVICE(0x08B1, 0xC170, iwl7260_2ac_cfg)},
271 ++ {IWL_PCI_DEVICE(0x08B1, 0xC060, iwl7260_2n_cfg)},
272 ++ {IWL_PCI_DEVICE(0x08B1, 0xC06A, iwl7260_2n_cfg)},
273 ++ {IWL_PCI_DEVICE(0x08B1, 0xC160, iwl7260_2n_cfg)},
274 ++ {IWL_PCI_DEVICE(0x08B1, 0xC062, iwl7260_n_cfg)},
275 ++ {IWL_PCI_DEVICE(0x08B1, 0xC162, iwl7260_n_cfg)},
276 ++ {IWL_PCI_DEVICE(0x08B1, 0xC770, iwl7260_2ac_cfg)},
277 ++ {IWL_PCI_DEVICE(0x08B1, 0xC760, iwl7260_2n_cfg)},
278 ++ {IWL_PCI_DEVICE(0x08B2, 0xC270, iwl7260_2ac_cfg)},
279 ++ {IWL_PCI_DEVICE(0x08B2, 0xC272, iwl7260_2ac_cfg)},
280 ++ {IWL_PCI_DEVICE(0x08B2, 0xC260, iwl7260_2n_cfg)},
281 ++ {IWL_PCI_DEVICE(0x08B2, 0xC26A, iwl7260_n_cfg)},
282 ++ {IWL_PCI_DEVICE(0x08B2, 0xC262, iwl7260_n_cfg)},
283 ++ {IWL_PCI_DEVICE(0x08B1, 0xC470, iwl7260_2ac_cfg)},
284 ++ {IWL_PCI_DEVICE(0x08B1, 0xC472, iwl7260_2ac_cfg)},
285 ++ {IWL_PCI_DEVICE(0x08B1, 0xC460, iwl7260_2n_cfg)},
286 ++ {IWL_PCI_DEVICE(0x08B1, 0xC462, iwl7260_n_cfg)},
287 ++ {IWL_PCI_DEVICE(0x08B1, 0xC570, iwl7260_2ac_cfg)},
288 ++ {IWL_PCI_DEVICE(0x08B1, 0xC560, iwl7260_2n_cfg)},
289 ++ {IWL_PCI_DEVICE(0x08B2, 0xC370, iwl7260_2ac_cfg)},
290 ++ {IWL_PCI_DEVICE(0x08B1, 0xC360, iwl7260_2n_cfg)},
291 ++ {IWL_PCI_DEVICE(0x08B1, 0xC020, iwl7260_2n_cfg)},
292 ++ {IWL_PCI_DEVICE(0x08B1, 0xC02A, iwl7260_2n_cfg)},
293 ++ {IWL_PCI_DEVICE(0x08B2, 0xC220, iwl7260_2n_cfg)},
294 ++ {IWL_PCI_DEVICE(0x08B1, 0xC420, iwl7260_2n_cfg)},
295 ++
296 ++/* 3160 Series */
297 ++ {IWL_PCI_DEVICE(0x08B3, 0x0070, iwl3160_2ac_cfg)},
298 ++ {IWL_PCI_DEVICE(0x08B3, 0x0072, iwl3160_2ac_cfg)},
299 ++ {IWL_PCI_DEVICE(0x08B3, 0x0170, iwl3160_2ac_cfg)},
300 ++ {IWL_PCI_DEVICE(0x08B3, 0x0172, iwl3160_2ac_cfg)},
301 ++ {IWL_PCI_DEVICE(0x08B3, 0x0060, iwl3160_2n_cfg)},
302 ++ {IWL_PCI_DEVICE(0x08B3, 0x0062, iwl3160_n_cfg)},
303 ++ {IWL_PCI_DEVICE(0x08B4, 0x0270, iwl3160_2ac_cfg)},
304 ++ {IWL_PCI_DEVICE(0x08B4, 0x0272, iwl3160_2ac_cfg)},
305 ++ {IWL_PCI_DEVICE(0x08B3, 0x0470, iwl3160_2ac_cfg)},
306 ++ {IWL_PCI_DEVICE(0x08B3, 0x0472, iwl3160_2ac_cfg)},
307 ++ {IWL_PCI_DEVICE(0x08B4, 0x0370, iwl3160_2ac_cfg)},
308 ++ {IWL_PCI_DEVICE(0x08B3, 0x8070, iwl3160_2ac_cfg)},
309 ++ {IWL_PCI_DEVICE(0x08B3, 0x8072, iwl3160_2ac_cfg)},
310 ++ {IWL_PCI_DEVICE(0x08B3, 0x8170, iwl3160_2ac_cfg)},
311 ++ {IWL_PCI_DEVICE(0x08B3, 0x8172, iwl3160_2ac_cfg)},
312 ++ {IWL_PCI_DEVICE(0x08B3, 0x8060, iwl3160_2n_cfg)},
313 ++ {IWL_PCI_DEVICE(0x08B3, 0x8062, iwl3160_n_cfg)},
314 ++ {IWL_PCI_DEVICE(0x08B4, 0x8270, iwl3160_2ac_cfg)},
315 ++ {IWL_PCI_DEVICE(0x08B3, 0x8470, iwl3160_2ac_cfg)},
316 ++ {IWL_PCI_DEVICE(0x08B3, 0x8570, iwl3160_2ac_cfg)},
317 +
318 + {0}
319 + };
320 +diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h
321 +index 1a285083d24a..f2faa779e3fe 100644
322 +--- a/drivers/net/xen-netback/common.h
323 ++++ b/drivers/net/xen-netback/common.h
324 +@@ -88,6 +88,7 @@ struct xenvif {
325 + unsigned long credit_usec;
326 + unsigned long remaining_credit;
327 + struct timer_list credit_timeout;
328 ++ u64 credit_window_start;
329 +
330 + /* Statistics */
331 + unsigned long rx_gso_checksum_fixup;
332 +diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c
333 +index 3a294c2528d5..c4a2eb2cd8a0 100644
334 +--- a/drivers/net/xen-netback/interface.c
335 ++++ b/drivers/net/xen-netback/interface.c
336 +@@ -275,8 +275,7 @@ struct xenvif *xenvif_alloc(struct device *parent, domid_t domid,
337 + vif->credit_bytes = vif->remaining_credit = ~0UL;
338 + vif->credit_usec = 0UL;
339 + init_timer(&vif->credit_timeout);
340 +- /* Initialize 'expires' now: it's used to track the credit window. */
341 +- vif->credit_timeout.expires = jiffies;
342 ++ vif->credit_window_start = get_jiffies_64();
343 +
344 + dev->netdev_ops = &xenvif_netdev_ops;
345 + dev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO;
346 +diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
347 +index 0071f211a08a..36efb418c26f 100644
348 +--- a/drivers/net/xen-netback/netback.c
349 ++++ b/drivers/net/xen-netback/netback.c
350 +@@ -1423,9 +1423,8 @@ out:
351 +
352 + static bool tx_credit_exceeded(struct xenvif *vif, unsigned size)
353 + {
354 +- unsigned long now = jiffies;
355 +- unsigned long next_credit =
356 +- vif->credit_timeout.expires +
357 ++ u64 now = get_jiffies_64();
358 ++ u64 next_credit = vif->credit_window_start +
359 + msecs_to_jiffies(vif->credit_usec / 1000);
360 +
361 + /* Timer could already be pending in rare cases. */
362 +@@ -1433,8 +1432,8 @@ static bool tx_credit_exceeded(struct xenvif *vif, unsigned size)
363 + return true;
364 +
365 + /* Passed the point where we can replenish credit? */
366 +- if (time_after_eq(now, next_credit)) {
367 +- vif->credit_timeout.expires = now;
368 ++ if (time_after_eq64(now, next_credit)) {
369 ++ vif->credit_window_start = now;
370 + tx_add_credit(vif);
371 + }
372 +
373 +@@ -1446,6 +1445,7 @@ static bool tx_credit_exceeded(struct xenvif *vif, unsigned size)
374 + tx_credit_callback;
375 + mod_timer(&vif->credit_timeout,
376 + next_credit);
377 ++ vif->credit_window_start = next_credit;
378 +
379 + return true;
380 + }
381 +diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c
382 +index abe24ff000f0..8a9e8750703f 100644
383 +--- a/drivers/net/xen-netback/xenbus.c
384 ++++ b/drivers/net/xen-netback/xenbus.c
385 +@@ -24,6 +24,12 @@
386 + struct backend_info {
387 + struct xenbus_device *dev;
388 + struct xenvif *vif;
389 ++
390 ++ /* This is the state that will be reflected in xenstore when any
391 ++ * active hotplug script completes.
392 ++ */
393 ++ enum xenbus_state state;
394 ++
395 + enum xenbus_state frontend_state;
396 + struct xenbus_watch hotplug_status_watch;
397 + u8 have_hotplug_status_watch:1;
398 +@@ -33,11 +39,15 @@ static int connect_rings(struct backend_info *);
399 + static void connect(struct backend_info *);
400 + static void backend_create_xenvif(struct backend_info *be);
401 + static void unregister_hotplug_status_watch(struct backend_info *be);
402 ++static void set_backend_state(struct backend_info *be,
403 ++ enum xenbus_state state);
404 +
405 + static int netback_remove(struct xenbus_device *dev)
406 + {
407 + struct backend_info *be = dev_get_drvdata(&dev->dev);
408 +
409 ++ set_backend_state(be, XenbusStateClosed);
410 ++
411 + unregister_hotplug_status_watch(be);
412 + if (be->vif) {
413 + kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE);
414 +@@ -126,6 +136,8 @@ static int netback_probe(struct xenbus_device *dev,
415 + if (err)
416 + goto fail;
417 +
418 ++ be->state = XenbusStateInitWait;
419 ++
420 + /* This kicks hotplug scripts, so do it immediately. */
421 + backend_create_xenvif(be);
422 +
423 +@@ -198,24 +210,113 @@ static void backend_create_xenvif(struct backend_info *be)
424 + kobject_uevent(&dev->dev.kobj, KOBJ_ONLINE);
425 + }
426 +
427 +-
428 +-static void disconnect_backend(struct xenbus_device *dev)
429 ++static void backend_disconnect(struct backend_info *be)
430 + {
431 +- struct backend_info *be = dev_get_drvdata(&dev->dev);
432 +-
433 + if (be->vif)
434 + xenvif_disconnect(be->vif);
435 + }
436 +
437 +-static void destroy_backend(struct xenbus_device *dev)
438 ++static void backend_connect(struct backend_info *be)
439 + {
440 +- struct backend_info *be = dev_get_drvdata(&dev->dev);
441 ++ if (be->vif)
442 ++ connect(be);
443 ++}
444 +
445 +- if (be->vif) {
446 +- kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE);
447 +- xenbus_rm(XBT_NIL, dev->nodename, "hotplug-status");
448 +- xenvif_free(be->vif);
449 +- be->vif = NULL;
450 ++static inline void backend_switch_state(struct backend_info *be,
451 ++ enum xenbus_state state)
452 ++{
453 ++ struct xenbus_device *dev = be->dev;
454 ++
455 ++ pr_debug("%s -> %s\n", dev->nodename, xenbus_strstate(state));
456 ++ be->state = state;
457 ++
458 ++ /* If we are waiting for a hotplug script then defer the
459 ++ * actual xenbus state change.
460 ++ */
461 ++ if (!be->have_hotplug_status_watch)
462 ++ xenbus_switch_state(dev, state);
463 ++}
464 ++
465 ++/* Handle backend state transitions:
466 ++ *
467 ++ * The backend state starts in InitWait and the following transitions are
468 ++ * allowed.
469 ++ *
470 ++ * InitWait -> Connected
471 ++ *
472 ++ * ^ \ |
473 ++ * | \ |
474 ++ * | \ |
475 ++ * | \ |
476 ++ * | \ |
477 ++ * | \ |
478 ++ * | V V
479 ++ *
480 ++ * Closed <-> Closing
481 ++ *
482 ++ * The state argument specifies the eventual state of the backend and the
483 ++ * function transitions to that state via the shortest path.
484 ++ */
485 ++static void set_backend_state(struct backend_info *be,
486 ++ enum xenbus_state state)
487 ++{
488 ++ while (be->state != state) {
489 ++ switch (be->state) {
490 ++ case XenbusStateClosed:
491 ++ switch (state) {
492 ++ case XenbusStateInitWait:
493 ++ case XenbusStateConnected:
494 ++ pr_info("%s: prepare for reconnect\n",
495 ++ be->dev->nodename);
496 ++ backend_switch_state(be, XenbusStateInitWait);
497 ++ break;
498 ++ case XenbusStateClosing:
499 ++ backend_switch_state(be, XenbusStateClosing);
500 ++ break;
501 ++ default:
502 ++ BUG();
503 ++ }
504 ++ break;
505 ++ case XenbusStateInitWait:
506 ++ switch (state) {
507 ++ case XenbusStateConnected:
508 ++ backend_connect(be);
509 ++ backend_switch_state(be, XenbusStateConnected);
510 ++ break;
511 ++ case XenbusStateClosing:
512 ++ case XenbusStateClosed:
513 ++ backend_switch_state(be, XenbusStateClosing);
514 ++ break;
515 ++ default:
516 ++ BUG();
517 ++ }
518 ++ break;
519 ++ case XenbusStateConnected:
520 ++ switch (state) {
521 ++ case XenbusStateInitWait:
522 ++ case XenbusStateClosing:
523 ++ case XenbusStateClosed:
524 ++ backend_disconnect(be);
525 ++ backend_switch_state(be, XenbusStateClosing);
526 ++ break;
527 ++ default:
528 ++ BUG();
529 ++ }
530 ++ break;
531 ++ case XenbusStateClosing:
532 ++ switch (state) {
533 ++ case XenbusStateInitWait:
534 ++ case XenbusStateConnected:
535 ++ case XenbusStateClosed:
536 ++ backend_switch_state(be, XenbusStateClosed);
537 ++ break;
538 ++ default:
539 ++ BUG();
540 ++ }
541 ++ break;
542 ++ default:
543 ++ BUG();
544 ++ }
545 + }
546 + }
547 +
548 +@@ -227,41 +328,33 @@ static void frontend_changed(struct xenbus_device *dev,
549 + {
550 + struct backend_info *be = dev_get_drvdata(&dev->dev);
551 +
552 +- pr_debug("frontend state %s", xenbus_strstate(frontend_state));
553 ++ pr_debug("%s -> %s\n", dev->otherend, xenbus_strstate(frontend_state));
554 +
555 + be->frontend_state = frontend_state;
556 +
557 + switch (frontend_state) {
558 + case XenbusStateInitialising:
559 +- if (dev->state == XenbusStateClosed) {
560 +- printk(KERN_INFO "%s: %s: prepare for reconnect\n",
561 +- __func__, dev->nodename);
562 +- xenbus_switch_state(dev, XenbusStateInitWait);
563 +- }
564 ++ set_backend_state(be, XenbusStateInitWait);
565 + break;
566 +
567 + case XenbusStateInitialised:
568 + break;
569 +
570 + case XenbusStateConnected:
571 +- if (dev->state == XenbusStateConnected)
572 +- break;
573 +- if (be->vif)
574 +- connect(be);
575 ++ set_backend_state(be, XenbusStateConnected);
576 + break;
577 +
578 + case XenbusStateClosing:
579 +- disconnect_backend(dev);
580 +- xenbus_switch_state(dev, XenbusStateClosing);
581 ++ set_backend_state(be, XenbusStateClosing);
582 + break;
583 +
584 + case XenbusStateClosed:
585 +- xenbus_switch_state(dev, XenbusStateClosed);
586 ++ set_backend_state(be, XenbusStateClosed);
587 + if (xenbus_dev_is_online(dev))
588 + break;
589 +- destroy_backend(dev);
590 + /* fall through if not online */
591 + case XenbusStateUnknown:
592 ++ set_backend_state(be, XenbusStateClosed);
593 + device_unregister(&dev->dev);
594 + break;
595 +
596 +@@ -354,7 +447,9 @@ static void hotplug_status_changed(struct xenbus_watch *watch,
597 + if (IS_ERR(str))
598 + return;
599 + if (len == sizeof("connected")-1 && !memcmp(str, "connected", len)) {
600 +- xenbus_switch_state(be->dev, XenbusStateConnected);
601 ++ /* Complete any pending state change */
602 ++ xenbus_switch_state(be->dev, be->state);
603 ++
604 + /* Not interested in this watch anymore. */
605 + unregister_hotplug_status_watch(be);
606 + }
607 +@@ -384,12 +479,8 @@ static void connect(struct backend_info *be)
608 + err = xenbus_watch_pathfmt(dev, &be->hotplug_status_watch,
609 + hotplug_status_changed,
610 + "%s/%s", dev->nodename, "hotplug-status");
611 +- if (err) {
612 +- /* Switch now, since we can't do a watch. */
613 +- xenbus_switch_state(dev, XenbusStateConnected);
614 +- } else {
615 ++ if (!err)
616 + be->have_hotplug_status_watch = 1;
617 +- }
618 +
619 + netif_wake_queue(be->vif->dev);
620 + }
621 +diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
622 +index d53547d2e4c7..d3aa353908aa 100644
623 +--- a/drivers/usb/core/hcd.c
624 ++++ b/drivers/usb/core/hcd.c
625 +@@ -1010,6 +1010,7 @@ static int register_root_hub(struct usb_hcd *hcd)
626 + dev_name(&usb_dev->dev), retval);
627 + return retval;
628 + }
629 ++ usb_dev->lpm_capable = usb_device_supports_lpm(usb_dev);
630 + }
631 +
632 + retval = usb_new_device (usb_dev);
633 +diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
634 +index 6cf2ae0aa1f7..c8b9fa0e9275 100644
635 +--- a/drivers/usb/core/hub.c
636 ++++ b/drivers/usb/core/hub.c
637 +@@ -135,7 +135,7 @@ struct usb_hub *usb_hub_to_struct_hub(struct usb_device *hdev)
638 + return usb_get_intfdata(hdev->actconfig->interface[0]);
639 + }
640 +
641 +-static int usb_device_supports_lpm(struct usb_device *udev)
642 ++int usb_device_supports_lpm(struct usb_device *udev)
643 + {
644 + /* USB 2.1 (and greater) devices indicate LPM support through
645 + * their USB 2.0 Extended Capabilities BOS descriptor.
646 +@@ -156,6 +156,11 @@ static int usb_device_supports_lpm(struct usb_device *udev)
647 + "Power management will be impacted.\n");
648 + return 0;
649 + }
650 ++
651 ++ /* udev is root hub */
652 ++ if (!udev->parent)
653 ++ return 1;
654 ++
655 + if (udev->parent->lpm_capable)
656 + return 1;
657 +
658 +@@ -1557,10 +1562,15 @@ static int hub_configure(struct usb_hub *hub,
659 + if (hub->has_indicators && blinkenlights)
660 + hub->indicator [0] = INDICATOR_CYCLE;
661 +
662 +- for (i = 0; i < hdev->maxchild; i++)
663 +- if (usb_hub_create_port_device(hub, i + 1) < 0)
664 ++ for (i = 0; i < hdev->maxchild; i++) {
665 ++ ret = usb_hub_create_port_device(hub, i + 1);
666 ++ if (ret < 0) {
667 + dev_err(hub->intfdev,
668 + "couldn't create port%d device.\n", i + 1);
669 ++ hdev->maxchild = i;
670 ++ goto fail_keep_maxchild;
671 ++ }
672 ++ }
673 +
674 + usb_hub_adjust_deviceremovable(hdev, hub->descriptor);
675 +
676 +@@ -1568,6 +1578,8 @@ static int hub_configure(struct usb_hub *hub,
677 + return 0;
678 +
679 + fail:
680 ++ hdev->maxchild = 0;
681 ++fail_keep_maxchild:
682 + dev_err (hub_dev, "config failed, %s (err %d)\n",
683 + message, ret);
684 + /* hub_disconnect() frees urb and descriptor */
685 +diff --git a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h
686 +index 823857767a16..c49383669cd8 100644
687 +--- a/drivers/usb/core/usb.h
688 ++++ b/drivers/usb/core/usb.h
689 +@@ -35,6 +35,7 @@ extern int usb_get_device_descriptor(struct usb_device *dev,
690 + unsigned int size);
691 + extern int usb_get_bos_descriptor(struct usb_device *dev);
692 + extern void usb_release_bos_descriptor(struct usb_device *dev);
693 ++extern int usb_device_supports_lpm(struct usb_device *udev);
694 + extern char *usb_cache_string(struct usb_device *udev, int index);
695 + extern int usb_set_configuration(struct usb_device *dev, int configuration);
696 + extern int usb_choose_configuration(struct usb_device *udev);
697 +diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
698 +index acaee066b99a..c3d94853b4ab 100644
699 +--- a/drivers/usb/serial/option.c
700 ++++ b/drivers/usb/serial/option.c
701 +@@ -1376,6 +1376,23 @@ static const struct usb_device_id option_ids[] = {
702 + .driver_info = (kernel_ulong_t)&net_intf2_blacklist },
703 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1426, 0xff, 0xff, 0xff), /* ZTE MF91 */
704 + .driver_info = (kernel_ulong_t)&net_intf2_blacklist },
705 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1533, 0xff, 0xff, 0xff) },
706 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1534, 0xff, 0xff, 0xff) },
707 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1535, 0xff, 0xff, 0xff) },
708 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1545, 0xff, 0xff, 0xff) },
709 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1546, 0xff, 0xff, 0xff) },
710 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1547, 0xff, 0xff, 0xff) },
711 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1565, 0xff, 0xff, 0xff) },
712 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1566, 0xff, 0xff, 0xff) },
713 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1567, 0xff, 0xff, 0xff) },
714 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1589, 0xff, 0xff, 0xff) },
715 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1590, 0xff, 0xff, 0xff) },
716 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1591, 0xff, 0xff, 0xff) },
717 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1592, 0xff, 0xff, 0xff) },
718 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1594, 0xff, 0xff, 0xff) },
719 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1596, 0xff, 0xff, 0xff) },
720 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1598, 0xff, 0xff, 0xff) },
721 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1600, 0xff, 0xff, 0xff) },
722 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2002, 0xff,
723 + 0xff, 0xff), .driver_info = (kernel_ulong_t)&zte_k3765_z_blacklist },
724 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2003, 0xff, 0xff, 0xff) },
725 +diff --git a/drivers/video/backlight/atmel-pwm-bl.c b/drivers/video/backlight/atmel-pwm-bl.c
726 +index a60d6afca97c..30e4ed52d701 100644
727 +--- a/drivers/video/backlight/atmel-pwm-bl.c
728 ++++ b/drivers/video/backlight/atmel-pwm-bl.c
729 +@@ -118,7 +118,7 @@ static const struct backlight_ops atmel_pwm_bl_ops = {
730 + .update_status = atmel_pwm_bl_set_intensity,
731 + };
732 +
733 +-static int __init atmel_pwm_bl_probe(struct platform_device *pdev)
734 ++static int atmel_pwm_bl_probe(struct platform_device *pdev)
735 + {
736 + struct backlight_properties props;
737 + const struct atmel_pwm_bl_platform_data *pdata;
738 +@@ -203,7 +203,7 @@ err_free_mem:
739 + return retval;
740 + }
741 +
742 +-static int __exit atmel_pwm_bl_remove(struct platform_device *pdev)
743 ++static int atmel_pwm_bl_remove(struct platform_device *pdev)
744 + {
745 + struct atmel_pwm_bl *pwmbl = platform_get_drvdata(pdev);
746 +
747 +@@ -222,10 +222,11 @@ static struct platform_driver atmel_pwm_bl_driver = {
748 + .name = "atmel-pwm-bl",
749 + },
750 + /* REVISIT add suspend() and resume() */
751 +- .remove = __exit_p(atmel_pwm_bl_remove),
752 ++ .probe = atmel_pwm_bl_probe,
753 ++ .remove = atmel_pwm_bl_remove,
754 + };
755 +
756 +-module_platform_driver_probe(atmel_pwm_bl_driver, atmel_pwm_bl_probe);
757 ++module_platform_driver(atmel_pwm_bl_driver);
758 +
759 + MODULE_AUTHOR("Hans-Christian egtvedt <hans-christian.egtvedt@×××××.com>");
760 + MODULE_DESCRIPTION("Atmel PWM backlight driver");
761 +diff --git a/drivers/video/hyperv_fb.c b/drivers/video/hyperv_fb.c
762 +index d4d2c5fe2488..0f3b33cf13ef 100644
763 +--- a/drivers/video/hyperv_fb.c
764 ++++ b/drivers/video/hyperv_fb.c
765 +@@ -795,12 +795,21 @@ static int hvfb_remove(struct hv_device *hdev)
766 + }
767 +
768 +
769 ++static DEFINE_PCI_DEVICE_TABLE(pci_stub_id_table) = {
770 ++ {
771 ++ .vendor = PCI_VENDOR_ID_MICROSOFT,
772 ++ .device = PCI_DEVICE_ID_HYPERV_VIDEO,
773 ++ },
774 ++ { /* end of list */ }
775 ++};
776 ++
777 + static const struct hv_vmbus_device_id id_table[] = {
778 + /* Synthetic Video Device GUID */
779 + {HV_SYNTHVID_GUID},
780 + {}
781 + };
782 +
783 ++MODULE_DEVICE_TABLE(pci, pci_stub_id_table);
784 + MODULE_DEVICE_TABLE(vmbus, id_table);
785 +
786 + static struct hv_driver hvfb_drv = {
787 +@@ -810,14 +819,43 @@ static struct hv_driver hvfb_drv = {
788 + .remove = hvfb_remove,
789 + };
790 +
791 ++static int hvfb_pci_stub_probe(struct pci_dev *pdev,
792 ++ const struct pci_device_id *ent)
793 ++{
794 ++ return 0;
795 ++}
796 ++
797 ++static void hvfb_pci_stub_remove(struct pci_dev *pdev)
798 ++{
799 ++}
800 ++
801 ++static struct pci_driver hvfb_pci_stub_driver = {
802 ++ .name = KBUILD_MODNAME,
803 ++ .id_table = pci_stub_id_table,
804 ++ .probe = hvfb_pci_stub_probe,
805 ++ .remove = hvfb_pci_stub_remove,
806 ++};
807 +
808 + static int __init hvfb_drv_init(void)
809 + {
810 +- return vmbus_driver_register(&hvfb_drv);
811 ++ int ret;
812 ++
813 ++ ret = vmbus_driver_register(&hvfb_drv);
814 ++ if (ret != 0)
815 ++ return ret;
816 ++
817 ++ ret = pci_register_driver(&hvfb_pci_stub_driver);
818 ++ if (ret != 0) {
819 ++ vmbus_driver_unregister(&hvfb_drv);
820 ++ return ret;
821 ++ }
822 ++
823 ++ return 0;
824 + }
825 +
826 + static void __exit hvfb_drv_exit(void)
827 + {
828 ++ pci_unregister_driver(&hvfb_pci_stub_driver);
829 + vmbus_driver_unregister(&hvfb_drv);
830 + }
831 +
832 +diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
833 +index 2a601e7da1bf..665e0cee59bd 100644
834 +--- a/include/net/ip6_fib.h
835 ++++ b/include/net/ip6_fib.h
836 +@@ -165,6 +165,7 @@ static inline struct inet6_dev *ip6_dst_idev(struct dst_entry *dst)
837 + static inline void rt6_clean_expires(struct rt6_info *rt)
838 + {
839 + rt->rt6i_flags &= ~RTF_EXPIRES;
840 ++ rt->dst.expires = 0;
841 + }
842 +
843 + static inline void rt6_set_expires(struct rt6_info *rt, unsigned long expires)
844 +diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h
845 +index a9942e1faefb..7ac7f91f0242 100644
846 +--- a/include/net/ip_tunnels.h
847 ++++ b/include/net/ip_tunnels.h
848 +@@ -113,7 +113,7 @@ struct ip_tunnel *ip_tunnel_lookup(struct ip_tunnel_net *itn,
849 + __be32 key);
850 +
851 + int ip_tunnel_rcv(struct ip_tunnel *tunnel, struct sk_buff *skb,
852 +- const struct tnl_ptk_info *tpi, bool log_ecn_error);
853 ++ const struct tnl_ptk_info *tpi, int hdr_len, bool log_ecn_error);
854 + int ip_tunnel_changelink(struct net_device *dev, struct nlattr *tb[],
855 + struct ip_tunnel_parm *p);
856 + int ip_tunnel_newlink(struct net_device *dev, struct nlattr *tb[],
857 +diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
858 +index fb104e51496e..9e59950f55cf 100644
859 +--- a/include/uapi/linux/perf_event.h
860 ++++ b/include/uapi/linux/perf_event.h
861 +@@ -425,13 +425,15 @@ struct perf_event_mmap_page {
862 + /*
863 + * Control data for the mmap() data buffer.
864 + *
865 +- * User-space reading the @data_head value should issue an rmb(), on
866 +- * SMP capable platforms, after reading this value -- see
867 +- * perf_event_wakeup().
868 ++ * User-space reading the @data_head value should issue an smp_rmb(),
869 ++ * after reading this value.
870 + *
871 + * When the mapping is PROT_WRITE the @data_tail value should be
872 +- * written by userspace to reflect the last read data. In this case
873 +- * the kernel will not over-write unread data.
874 ++ * written by userspace to reflect the last read data, after issueing
875 ++ * an smp_mb() to separate the data read from the ->data_tail store.
876 ++ * In this case the kernel will not over-write unread data.
877 ++ *
878 ++ * See perf_output_put_handle() for the data ordering.
879 + */
880 + __u64 data_head; /* head in the data section */
881 + __u64 data_tail; /* user-space written tail */
882 +diff --git a/kernel/events/ring_buffer.c b/kernel/events/ring_buffer.c
883 +index cd55144270b5..9c2ddfbf4525 100644
884 +--- a/kernel/events/ring_buffer.c
885 ++++ b/kernel/events/ring_buffer.c
886 +@@ -87,10 +87,31 @@ again:
887 + goto out;
888 +
889 + /*
890 +- * Publish the known good head. Rely on the full barrier implied
891 +- * by atomic_dec_and_test() order the rb->head read and this
892 +- * write.
893 ++ * Since the mmap() consumer (userspace) can run on a different CPU:
894 ++ *
895 ++ * kernel user
896 ++ *
897 ++ * READ ->data_tail READ ->data_head
898 ++ * smp_mb() (A) smp_rmb() (C)
899 ++ * WRITE $data READ $data
900 ++ * smp_wmb() (B) smp_mb() (D)
901 ++ * STORE ->data_head WRITE ->data_tail
902 ++ *
903 ++ * Where A pairs with D, and B pairs with C.
904 ++ *
905 ++ * I don't think A needs to be a full barrier because we won't in fact
906 ++ * write data until we see the store from userspace. So we simply don't
907 ++ * issue the data WRITE until we observe it. Be conservative for now.
908 ++ *
909 ++ * OTOH, D needs to be a full barrier since it separates the data READ
910 ++ * from the tail WRITE.
911 ++ *
912 ++ * For B a WMB is sufficient since it separates two WRITEs, and for C
913 ++ * an RMB is sufficient since it separates two READs.
914 ++ *
915 ++ * See perf_output_begin().
916 + */
917 ++ smp_wmb();
918 + rb->user_page->data_head = head;
919 +
920 + /*
921 +@@ -154,9 +175,11 @@ int perf_output_begin(struct perf_output_handle *handle,
922 + * Userspace could choose to issue a mb() before updating the
923 + * tail pointer. So that all reads will be completed before the
924 + * write is issued.
925 ++ *
926 ++ * See perf_output_put_handle().
927 + */
928 + tail = ACCESS_ONCE(rb->user_page->data_tail);
929 +- smp_rmb();
930 ++ smp_mb();
931 + offset = head = local_read(&rb->head);
932 + head += size;
933 + if (unlikely(!perf_output_space(rb, tail, offset, head)))
934 +diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
935 +index 0582a01a81e3..5546ae9c84f9 100644
936 +--- a/kernel/trace/trace.c
937 ++++ b/kernel/trace/trace.c
938 +@@ -826,9 +826,12 @@ int trace_get_user(struct trace_parser *parser, const char __user *ubuf,
939 + if (isspace(ch)) {
940 + parser->buffer[parser->idx] = 0;
941 + parser->cont = false;
942 +- } else {
943 ++ } else if (parser->idx < parser->size - 1) {
944 + parser->cont = true;
945 + parser->buffer[parser->idx++] = ch;
946 ++ } else {
947 ++ ret = -EINVAL;
948 ++ goto out;
949 + }
950 +
951 + *ppos += read;
952 +diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c
953 +index 51aafd669cbb..f1cb1f56cda9 100644
954 +--- a/net/batman-adv/main.c
955 ++++ b/net/batman-adv/main.c
956 +@@ -61,6 +61,7 @@ static int __init batadv_init(void)
957 + batadv_recv_handler_init();
958 +
959 + batadv_iv_init();
960 ++ batadv_nc_init();
961 +
962 + batadv_event_workqueue = create_singlethread_workqueue("bat_events");
963 +
964 +@@ -138,7 +139,7 @@ int batadv_mesh_init(struct net_device *soft_iface)
965 + if (ret < 0)
966 + goto err;
967 +
968 +- ret = batadv_nc_init(bat_priv);
969 ++ ret = batadv_nc_mesh_init(bat_priv);
970 + if (ret < 0)
971 + goto err;
972 +
973 +@@ -163,7 +164,7 @@ void batadv_mesh_free(struct net_device *soft_iface)
974 + batadv_vis_quit(bat_priv);
975 +
976 + batadv_gw_node_purge(bat_priv);
977 +- batadv_nc_free(bat_priv);
978 ++ batadv_nc_mesh_free(bat_priv);
979 + batadv_dat_free(bat_priv);
980 + batadv_bla_free(bat_priv);
981 +
982 +diff --git a/net/batman-adv/network-coding.c b/net/batman-adv/network-coding.c
983 +index e84629ece9b7..f97aeee2201c 100644
984 +--- a/net/batman-adv/network-coding.c
985 ++++ b/net/batman-adv/network-coding.c
986 +@@ -35,6 +35,20 @@ static int batadv_nc_recv_coded_packet(struct sk_buff *skb,
987 + struct batadv_hard_iface *recv_if);
988 +
989 + /**
990 ++ * batadv_nc_init - one-time initialization for network coding
991 ++ */
992 ++int __init batadv_nc_init(void)
993 ++{
994 ++ int ret;
995 ++
996 ++ /* Register our packet type */
997 ++ ret = batadv_recv_handler_register(BATADV_CODED,
998 ++ batadv_nc_recv_coded_packet);
999 ++
1000 ++ return ret;
1001 ++}
1002 ++
1003 ++/**
1004 + * batadv_nc_start_timer - initialise the nc periodic worker
1005 + * @bat_priv: the bat priv with all the soft interface information
1006 + */
1007 +@@ -45,10 +59,10 @@ static void batadv_nc_start_timer(struct batadv_priv *bat_priv)
1008 + }
1009 +
1010 + /**
1011 +- * batadv_nc_init - initialise coding hash table and start house keeping
1012 ++ * batadv_nc_mesh_init - initialise coding hash table and start house keeping
1013 + * @bat_priv: the bat priv with all the soft interface information
1014 + */
1015 +-int batadv_nc_init(struct batadv_priv *bat_priv)
1016 ++int batadv_nc_mesh_init(struct batadv_priv *bat_priv)
1017 + {
1018 + bat_priv->nc.timestamp_fwd_flush = jiffies;
1019 + bat_priv->nc.timestamp_sniffed_purge = jiffies;
1020 +@@ -70,11 +84,6 @@ int batadv_nc_init(struct batadv_priv *bat_priv)
1021 + batadv_hash_set_lock_class(bat_priv->nc.coding_hash,
1022 + &batadv_nc_decoding_hash_lock_class_key);
1023 +
1024 +- /* Register our packet type */
1025 +- if (batadv_recv_handler_register(BATADV_CODED,
1026 +- batadv_nc_recv_coded_packet) < 0)
1027 +- goto err;
1028 +-
1029 + INIT_DELAYED_WORK(&bat_priv->nc.work, batadv_nc_worker);
1030 + batadv_nc_start_timer(bat_priv);
1031 +
1032 +@@ -1722,12 +1731,11 @@ free_nc_packet:
1033 + }
1034 +
1035 + /**
1036 +- * batadv_nc_free - clean up network coding memory
1037 ++ * batadv_nc_mesh_free - clean up network coding memory
1038 + * @bat_priv: the bat priv with all the soft interface information
1039 + */
1040 +-void batadv_nc_free(struct batadv_priv *bat_priv)
1041 ++void batadv_nc_mesh_free(struct batadv_priv *bat_priv)
1042 + {
1043 +- batadv_recv_handler_unregister(BATADV_CODED);
1044 + cancel_delayed_work_sync(&bat_priv->nc.work);
1045 +
1046 + batadv_nc_purge_paths(bat_priv, bat_priv->nc.coding_hash, NULL);
1047 +diff --git a/net/batman-adv/network-coding.h b/net/batman-adv/network-coding.h
1048 +index 4fa6d0caddbd..bd4295fb960f 100644
1049 +--- a/net/batman-adv/network-coding.h
1050 ++++ b/net/batman-adv/network-coding.h
1051 +@@ -22,8 +22,9 @@
1052 +
1053 + #ifdef CONFIG_BATMAN_ADV_NC
1054 +
1055 +-int batadv_nc_init(struct batadv_priv *bat_priv);
1056 +-void batadv_nc_free(struct batadv_priv *bat_priv);
1057 ++int batadv_nc_init(void);
1058 ++int batadv_nc_mesh_init(struct batadv_priv *bat_priv);
1059 ++void batadv_nc_mesh_free(struct batadv_priv *bat_priv);
1060 + void batadv_nc_update_nc_node(struct batadv_priv *bat_priv,
1061 + struct batadv_orig_node *orig_node,
1062 + struct batadv_orig_node *orig_neigh_node,
1063 +@@ -47,12 +48,17 @@ int batadv_nc_init_debugfs(struct batadv_priv *bat_priv);
1064 +
1065 + #else /* ifdef CONFIG_BATMAN_ADV_NC */
1066 +
1067 +-static inline int batadv_nc_init(struct batadv_priv *bat_priv)
1068 ++static inline int batadv_nc_init(void)
1069 + {
1070 + return 0;
1071 + }
1072 +
1073 +-static inline void batadv_nc_free(struct batadv_priv *bat_priv)
1074 ++static inline int batadv_nc_mesh_init(struct batadv_priv *bat_priv)
1075 ++{
1076 ++ return 0;
1077 ++}
1078 ++
1079 ++static inline void batadv_nc_mesh_free(struct batadv_priv *bat_priv)
1080 + {
1081 + return;
1082 + }
1083 +diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
1084 +index 44db78ae6a65..f97101b4d373 100644
1085 +--- a/net/core/flow_dissector.c
1086 ++++ b/net/core/flow_dissector.c
1087 +@@ -40,7 +40,7 @@ again:
1088 + struct iphdr _iph;
1089 + ip:
1090 + iph = skb_header_pointer(skb, nhoff, sizeof(_iph), &_iph);
1091 +- if (!iph)
1092 ++ if (!iph || iph->ihl < 5)
1093 + return false;
1094 +
1095 + if (ip_is_fragment(iph))
1096 +diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
1097 +index c52fee0976da..64e4e98c8786 100644
1098 +--- a/net/ipv4/ip_gre.c
1099 ++++ b/net/ipv4/ip_gre.c
1100 +@@ -335,7 +335,7 @@ static int ipgre_rcv(struct sk_buff *skb)
1101 + iph->saddr, iph->daddr, tpi.key);
1102 +
1103 + if (tunnel) {
1104 +- ip_tunnel_rcv(tunnel, skb, &tpi, log_ecn_error);
1105 ++ ip_tunnel_rcv(tunnel, skb, &tpi, hdr_len, log_ecn_error);
1106 + return 0;
1107 + }
1108 + icmp_send(skb, ICMP_DEST_UNREACH, ICMP_PORT_UNREACH, 0);
1109 +diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
1110 +index 92d2f0f5d7bf..46dcf32c012e 100644
1111 +--- a/net/ipv4/ip_tunnel.c
1112 ++++ b/net/ipv4/ip_tunnel.c
1113 +@@ -402,7 +402,7 @@ static struct ip_tunnel *ip_tunnel_create(struct net *net,
1114 + }
1115 +
1116 + int ip_tunnel_rcv(struct ip_tunnel *tunnel, struct sk_buff *skb,
1117 +- const struct tnl_ptk_info *tpi, bool log_ecn_error)
1118 ++ const struct tnl_ptk_info *tpi, int hdr_len, bool log_ecn_error)
1119 + {
1120 + struct pcpu_tstats *tstats;
1121 + const struct iphdr *iph = ip_hdr(skb);
1122 +@@ -413,7 +413,7 @@ int ip_tunnel_rcv(struct ip_tunnel *tunnel, struct sk_buff *skb,
1123 + skb->protocol = tpi->proto;
1124 +
1125 + skb->mac_header = skb->network_header;
1126 +- __pskb_pull(skb, tunnel->hlen);
1127 ++ __pskb_pull(skb, hdr_len);
1128 + skb_postpull_rcsum(skb, skb_transport_header(skb), tunnel->hlen);
1129 + #ifdef CONFIG_NET_IPGRE_BROADCAST
1130 + if (ipv4_is_multicast(iph->daddr)) {
1131 +diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
1132 +index 7cfc45624b6d..f5cc7b331511 100644
1133 +--- a/net/ipv4/ipip.c
1134 ++++ b/net/ipv4/ipip.c
1135 +@@ -195,7 +195,7 @@ static int ipip_rcv(struct sk_buff *skb)
1136 + if (tunnel) {
1137 + if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb))
1138 + goto drop;
1139 +- return ip_tunnel_rcv(tunnel, skb, &tpi, log_ecn_error);
1140 ++ return ip_tunnel_rcv(tunnel, skb, &tpi, 0, log_ecn_error);
1141 + }
1142 +
1143 + return -1;
1144 +diff --git a/net/ipv6/route.c b/net/ipv6/route.c
1145 +index 3c1f493ccc63..548a1f7c1a29 100644
1146 +--- a/net/ipv6/route.c
1147 ++++ b/net/ipv6/route.c
1148 +@@ -1084,10 +1084,13 @@ static struct dst_entry *ip6_dst_check(struct dst_entry *dst, u32 cookie)
1149 + if (rt->rt6i_genid != rt_genid(dev_net(rt->dst.dev)))
1150 + return NULL;
1151 +
1152 +- if (rt->rt6i_node && (rt->rt6i_node->fn_sernum == cookie))
1153 +- return dst;
1154 ++ if (!rt->rt6i_node || (rt->rt6i_node->fn_sernum != cookie))
1155 ++ return NULL;
1156 +
1157 +- return NULL;
1158 ++ if (rt6_check_expired(rt))
1159 ++ return NULL;
1160 ++
1161 ++ return dst;
1162 + }
1163 +
1164 + static struct dst_entry *ip6_negative_advice(struct dst_entry *dst)
1165 +diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
1166 +index aecf088f40af..b93799201578 100644
1167 +--- a/sound/pci/hda/patch_hdmi.c
1168 ++++ b/sound/pci/hda/patch_hdmi.c
1169 +@@ -738,9 +738,10 @@ static int hdmi_manual_setup_channel_mapping(struct hda_codec *codec,
1170 + static void hdmi_setup_fake_chmap(unsigned char *map, int ca)
1171 + {
1172 + int i;
1173 ++ int ordered_ca = get_channel_allocation_order(ca);
1174 + for (i = 0; i < 8; i++) {
1175 +- if (i < channel_allocations[ca].channels)
1176 +- map[i] = from_cea_slot((hdmi_channel_mapping[ca][i] >> 4) & 0x0f);
1177 ++ if (i < channel_allocations[ordered_ca].channels)
1178 ++ map[i] = from_cea_slot(hdmi_channel_mapping[ca][i] & 0x0f);
1179 + else
1180 + map[i] = 0;
1181 + }
1182
1183 Modified: genpatches-2.6/trunk/3.11/0000_README
1184 ===================================================================
1185 --- genpatches-2.6/trunk/3.11/0000_README 2013-11-14 16:37:35 UTC (rev 2581)
1186 +++ genpatches-2.6/trunk/3.11/0000_README 2013-11-21 00:37:00 UTC (rev 2582)
1187 @@ -74,6 +74,10 @@
1188 From: http://www.kernel.org
1189 Desc: Linux 3.11.8
1190
1191 +Patch: 1008_linux-3.11.9.patch
1192 +From: http://www.kernel.org
1193 +Desc: Linux 3.11.9
1194 +
1195 Patch: 1500_XATTR_USER_PREFIX.patch
1196 From: https://bugs.gentoo.org/show_bug.cgi?id=470644
1197 Desc: Support for namespace user.pax.* on tmpfs.
1198
1199 Added: genpatches-2.6/trunk/3.11/1008_linux-3.11.9.patch
1200 ===================================================================
1201 --- genpatches-2.6/trunk/3.11/1008_linux-3.11.9.patch (rev 0)
1202 +++ genpatches-2.6/trunk/3.11/1008_linux-3.11.9.patch 2013-11-21 00:37:00 UTC (rev 2582)
1203 @@ -0,0 +1,1013 @@
1204 +diff --git a/Makefile b/Makefile
1205 +index 7521adbea135..06379bd78b64 100644
1206 +--- a/Makefile
1207 ++++ b/Makefile
1208 +@@ -1,6 +1,6 @@
1209 + VERSION = 3
1210 + PATCHLEVEL = 11
1211 +-SUBLEVEL = 8
1212 ++SUBLEVEL = 9
1213 + EXTRAVERSION =
1214 + NAME = Linux for Workgroups
1215 +
1216 +diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
1217 +index 3a0f3a2d1666..96a410eb43c0 100644
1218 +--- a/drivers/gpu/drm/i915/intel_dp.c
1219 ++++ b/drivers/gpu/drm/i915/intel_dp.c
1220 +@@ -1389,6 +1389,26 @@ static void intel_dp_get_config(struct intel_encoder *encoder,
1221 + }
1222 +
1223 + pipe_config->adjusted_mode.flags |= flags;
1224 ++
1225 ++ if (is_edp(intel_dp) && dev_priv->vbt.edp_bpp &&
1226 ++ pipe_config->pipe_bpp > dev_priv->vbt.edp_bpp) {
1227 ++ /*
1228 ++ * This is a big fat ugly hack.
1229 ++ *
1230 ++ * Some machines in UEFI boot mode provide us a VBT that has 18
1231 ++ * bpp and 1.62 GHz link bandwidth for eDP, which for reasons
1232 ++ * unknown we fail to light up. Yet the same BIOS boots up with
1233 ++ * 24 bpp and 2.7 GHz link. Use the same bpp as the BIOS uses as
1234 ++ * max, not what it tells us to use.
1235 ++ *
1236 ++ * Note: This will still be broken if the eDP panel is not lit
1237 ++ * up by the BIOS, and thus we can't get the mode at module
1238 ++ * load.
1239 ++ */
1240 ++ DRM_DEBUG_KMS("pipe has %d bpp for eDP panel, overriding BIOS-provided max %d bpp\n",
1241 ++ pipe_config->pipe_bpp, dev_priv->vbt.edp_bpp);
1242 ++ dev_priv->vbt.edp_bpp = pipe_config->pipe_bpp;
1243 ++ }
1244 + }
1245 +
1246 + static void intel_disable_dp(struct intel_encoder *encoder)
1247 +diff --git a/drivers/media/platform/sh_vou.c b/drivers/media/platform/sh_vou.c
1248 +index 7a9c5e9329f2..4f30341dc2ab 100644
1249 +--- a/drivers/media/platform/sh_vou.c
1250 ++++ b/drivers/media/platform/sh_vou.c
1251 +@@ -776,7 +776,7 @@ static int sh_vou_try_fmt_vid_out(struct file *file, void *priv,
1252 + v4l_bound_align_image(&pix->width, 0, VOU_MAX_IMAGE_WIDTH, 1,
1253 + &pix->height, 0, VOU_MAX_IMAGE_HEIGHT, 1, 0);
1254 +
1255 +- for (i = 0; ARRAY_SIZE(vou_fmt); i++)
1256 ++ for (i = 0; i < ARRAY_SIZE(vou_fmt); i++)
1257 + if (vou_fmt[i].pfmt == pix->pixelformat)
1258 + return 0;
1259 +
1260 +diff --git a/drivers/misc/atmel_pwm.c b/drivers/misc/atmel_pwm.c
1261 +index 494d0500bda6..a6dc56e1bc58 100644
1262 +--- a/drivers/misc/atmel_pwm.c
1263 ++++ b/drivers/misc/atmel_pwm.c
1264 +@@ -90,8 +90,10 @@ int pwm_channel_alloc(int index, struct pwm_channel *ch)
1265 + unsigned long flags;
1266 + int status = 0;
1267 +
1268 +- /* insist on PWM init, with this signal pinned out */
1269 +- if (!pwm || !(pwm->mask & 1 << index))
1270 ++ if (!pwm)
1271 ++ return -EPROBE_DEFER;
1272 ++
1273 ++ if (!(pwm->mask & 1 << index))
1274 + return -ENODEV;
1275 +
1276 + if (index < 0 || index >= PWM_NCHAN || !ch)
1277 +diff --git a/drivers/net/ethernet/chelsio/cxgb3/sge.c b/drivers/net/ethernet/chelsio/cxgb3/sge.c
1278 +index 9c89dc8fe105..632b318eb38a 100644
1279 +--- a/drivers/net/ethernet/chelsio/cxgb3/sge.c
1280 ++++ b/drivers/net/ethernet/chelsio/cxgb3/sge.c
1281 +@@ -1599,7 +1599,8 @@ static void write_ofld_wr(struct adapter *adap, struct sk_buff *skb,
1282 + flits = skb_transport_offset(skb) / 8;
1283 + sgp = ndesc == 1 ? (struct sg_ent *)&d->flit[flits] : sgl;
1284 + sgl_flits = make_sgl(skb, sgp, skb_transport_header(skb),
1285 +- skb->tail - skb->transport_header,
1286 ++ skb_tail_pointer(skb) -
1287 ++ skb_transport_header(skb),
1288 + adap->pdev);
1289 + if (need_skb_unmap()) {
1290 + setup_deferred_unmapping(skb, adap->pdev, sgp, sgl_flits);
1291 +diff --git a/drivers/net/ethernet/mellanox/mlx4/cmd.c b/drivers/net/ethernet/mellanox/mlx4/cmd.c
1292 +index 299d0184f983..e5f6bf4dc8a3 100644
1293 +--- a/drivers/net/ethernet/mellanox/mlx4/cmd.c
1294 ++++ b/drivers/net/ethernet/mellanox/mlx4/cmd.c
1295 +@@ -1673,7 +1673,7 @@ static void mlx4_master_deactivate_admin_state(struct mlx4_priv *priv, int slave
1296 + vp_oper->vlan_idx = NO_INDX;
1297 + }
1298 + if (NO_INDX != vp_oper->mac_idx) {
1299 +- __mlx4_unregister_mac(&priv->dev, port, vp_oper->mac_idx);
1300 ++ __mlx4_unregister_mac(&priv->dev, port, vp_oper->state.mac);
1301 + vp_oper->mac_idx = NO_INDX;
1302 + }
1303 + }
1304 +diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
1305 +index 1d01534c2020..64cf70247048 100644
1306 +--- a/drivers/net/virtio_net.c
1307 ++++ b/drivers/net/virtio_net.c
1308 +@@ -1096,11 +1096,6 @@ static int virtnet_cpu_callback(struct notifier_block *nfb,
1309 + {
1310 + struct virtnet_info *vi = container_of(nfb, struct virtnet_info, nb);
1311 +
1312 +- mutex_lock(&vi->config_lock);
1313 +-
1314 +- if (!vi->config_enable)
1315 +- goto done;
1316 +-
1317 + switch(action & ~CPU_TASKS_FROZEN) {
1318 + case CPU_ONLINE:
1319 + case CPU_DOWN_FAILED:
1320 +@@ -1114,8 +1109,6 @@ static int virtnet_cpu_callback(struct notifier_block *nfb,
1321 + break;
1322 + }
1323 +
1324 +-done:
1325 +- mutex_unlock(&vi->config_lock);
1326 + return NOTIFY_OK;
1327 + }
1328 +
1329 +@@ -1672,6 +1665,8 @@ static int virtnet_freeze(struct virtio_device *vdev)
1330 + struct virtnet_info *vi = vdev->priv;
1331 + int i;
1332 +
1333 ++ unregister_hotcpu_notifier(&vi->nb);
1334 ++
1335 + /* Prevent config work handler from accessing the device */
1336 + mutex_lock(&vi->config_lock);
1337 + vi->config_enable = false;
1338 +@@ -1720,6 +1715,10 @@ static int virtnet_restore(struct virtio_device *vdev)
1339 + virtnet_set_queues(vi, vi->curr_queue_pairs);
1340 + rtnl_unlock();
1341 +
1342 ++ err = register_hotcpu_notifier(&vi->nb);
1343 ++ if (err)
1344 ++ return err;
1345 ++
1346 + return 0;
1347 + }
1348 + #endif
1349 +diff --git a/drivers/net/wireless/iwlwifi/pcie/drv.c b/drivers/net/wireless/iwlwifi/pcie/drv.c
1350 +index 058c6aa58b7a..e2272ba37656 100644
1351 +--- a/drivers/net/wireless/iwlwifi/pcie/drv.c
1352 ++++ b/drivers/net/wireless/iwlwifi/pcie/drv.c
1353 +@@ -270,54 +270,83 @@ static DEFINE_PCI_DEVICE_TABLE(iwl_hw_card_ids) = {
1354 + #if IS_ENABLED(CONFIG_IWLMVM)
1355 + /* 7000 Series */
1356 + {IWL_PCI_DEVICE(0x08B1, 0x4070, iwl7260_2ac_cfg)},
1357 ++ {IWL_PCI_DEVICE(0x08B1, 0x4072, iwl7260_2ac_cfg)},
1358 + {IWL_PCI_DEVICE(0x08B1, 0x4170, iwl7260_2ac_cfg)},
1359 + {IWL_PCI_DEVICE(0x08B1, 0x4060, iwl7260_2n_cfg)},
1360 ++ {IWL_PCI_DEVICE(0x08B1, 0x406A, iwl7260_2n_cfg)},
1361 + {IWL_PCI_DEVICE(0x08B1, 0x4160, iwl7260_2n_cfg)},
1362 + {IWL_PCI_DEVICE(0x08B1, 0x4062, iwl7260_n_cfg)},
1363 + {IWL_PCI_DEVICE(0x08B1, 0x4162, iwl7260_n_cfg)},
1364 + {IWL_PCI_DEVICE(0x08B2, 0x4270, iwl7260_2ac_cfg)},
1365 ++ {IWL_PCI_DEVICE(0x08B2, 0x4272, iwl7260_2ac_cfg)},
1366 + {IWL_PCI_DEVICE(0x08B2, 0x4260, iwl7260_2n_cfg)},
1367 ++ {IWL_PCI_DEVICE(0x08B2, 0x426A, iwl7260_2n_cfg)},
1368 + {IWL_PCI_DEVICE(0x08B2, 0x4262, iwl7260_n_cfg)},
1369 + {IWL_PCI_DEVICE(0x08B1, 0x4470, iwl7260_2ac_cfg)},
1370 ++ {IWL_PCI_DEVICE(0x08B1, 0x4472, iwl7260_2ac_cfg)},
1371 + {IWL_PCI_DEVICE(0x08B1, 0x4460, iwl7260_2n_cfg)},
1372 ++ {IWL_PCI_DEVICE(0x08B1, 0x446A, iwl7260_2n_cfg)},
1373 + {IWL_PCI_DEVICE(0x08B1, 0x4462, iwl7260_n_cfg)},
1374 + {IWL_PCI_DEVICE(0x08B1, 0x4870, iwl7260_2ac_cfg)},
1375 + {IWL_PCI_DEVICE(0x08B1, 0x486E, iwl7260_2ac_cfg)},
1376 +- {IWL_PCI_DEVICE(0x08B1, 0x4A70, iwl7260_2ac_cfg)},
1377 +- {IWL_PCI_DEVICE(0x08B1, 0x4A6E, iwl7260_2ac_cfg)},
1378 +- {IWL_PCI_DEVICE(0x08B1, 0x4A6C, iwl7260_2ac_cfg)},
1379 ++ {IWL_PCI_DEVICE(0x08B1, 0x4570, iwl7260_2ac_cfg)},
1380 ++ {IWL_PCI_DEVICE(0x08B1, 0x4560, iwl7260_2n_cfg)},
1381 ++ {IWL_PCI_DEVICE(0x08B2, 0x4370, iwl7260_2ac_cfg)},
1382 ++ {IWL_PCI_DEVICE(0x08B2, 0x4360, iwl7260_2n_cfg)},
1383 ++ {IWL_PCI_DEVICE(0x08B1, 0x5070, iwl7260_2ac_cfg)},
1384 + {IWL_PCI_DEVICE(0x08B1, 0x4020, iwl7260_2n_cfg)},
1385 ++ {IWL_PCI_DEVICE(0x08B1, 0x402A, iwl7260_2n_cfg)},
1386 + {IWL_PCI_DEVICE(0x08B2, 0x4220, iwl7260_2n_cfg)},
1387 + {IWL_PCI_DEVICE(0x08B1, 0x4420, iwl7260_2n_cfg)},
1388 + {IWL_PCI_DEVICE(0x08B1, 0xC070, iwl7260_2ac_cfg)},
1389 ++ {IWL_PCI_DEVICE(0x08B1, 0xC072, iwl7260_2ac_cfg)},
1390 + {IWL_PCI_DEVICE(0x08B1, 0xC170, iwl7260_2ac_cfg)},
1391 + {IWL_PCI_DEVICE(0x08B1, 0xC060, iwl7260_2n_cfg)},
1392 ++ {IWL_PCI_DEVICE(0x08B1, 0xC06A, iwl7260_2n_cfg)},
1393 + {IWL_PCI_DEVICE(0x08B1, 0xC160, iwl7260_2n_cfg)},
1394 + {IWL_PCI_DEVICE(0x08B1, 0xC062, iwl7260_n_cfg)},
1395 + {IWL_PCI_DEVICE(0x08B1, 0xC162, iwl7260_n_cfg)},
1396 ++ {IWL_PCI_DEVICE(0x08B1, 0xC770, iwl7260_2ac_cfg)},
1397 ++ {IWL_PCI_DEVICE(0x08B1, 0xC760, iwl7260_2n_cfg)},
1398 + {IWL_PCI_DEVICE(0x08B2, 0xC270, iwl7260_2ac_cfg)},
1399 ++ {IWL_PCI_DEVICE(0x08B2, 0xC272, iwl7260_2ac_cfg)},
1400 + {IWL_PCI_DEVICE(0x08B2, 0xC260, iwl7260_2n_cfg)},
1401 ++ {IWL_PCI_DEVICE(0x08B2, 0xC26A, iwl7260_n_cfg)},
1402 + {IWL_PCI_DEVICE(0x08B2, 0xC262, iwl7260_n_cfg)},
1403 + {IWL_PCI_DEVICE(0x08B1, 0xC470, iwl7260_2ac_cfg)},
1404 ++ {IWL_PCI_DEVICE(0x08B1, 0xC472, iwl7260_2ac_cfg)},
1405 + {IWL_PCI_DEVICE(0x08B1, 0xC460, iwl7260_2n_cfg)},
1406 + {IWL_PCI_DEVICE(0x08B1, 0xC462, iwl7260_n_cfg)},
1407 ++ {IWL_PCI_DEVICE(0x08B1, 0xC570, iwl7260_2ac_cfg)},
1408 ++ {IWL_PCI_DEVICE(0x08B1, 0xC560, iwl7260_2n_cfg)},
1409 ++ {IWL_PCI_DEVICE(0x08B2, 0xC370, iwl7260_2ac_cfg)},
1410 ++ {IWL_PCI_DEVICE(0x08B1, 0xC360, iwl7260_2n_cfg)},
1411 + {IWL_PCI_DEVICE(0x08B1, 0xC020, iwl7260_2n_cfg)},
1412 ++ {IWL_PCI_DEVICE(0x08B1, 0xC02A, iwl7260_2n_cfg)},
1413 + {IWL_PCI_DEVICE(0x08B2, 0xC220, iwl7260_2n_cfg)},
1414 + {IWL_PCI_DEVICE(0x08B1, 0xC420, iwl7260_2n_cfg)},
1415 +
1416 + /* 3160 Series */
1417 + {IWL_PCI_DEVICE(0x08B3, 0x0070, iwl3160_2ac_cfg)},
1418 ++ {IWL_PCI_DEVICE(0x08B3, 0x0072, iwl3160_2ac_cfg)},
1419 + {IWL_PCI_DEVICE(0x08B3, 0x0170, iwl3160_2ac_cfg)},
1420 ++ {IWL_PCI_DEVICE(0x08B3, 0x0172, iwl3160_2ac_cfg)},
1421 + {IWL_PCI_DEVICE(0x08B3, 0x0060, iwl3160_2n_cfg)},
1422 + {IWL_PCI_DEVICE(0x08B3, 0x0062, iwl3160_n_cfg)},
1423 + {IWL_PCI_DEVICE(0x08B4, 0x0270, iwl3160_2ac_cfg)},
1424 ++ {IWL_PCI_DEVICE(0x08B4, 0x0272, iwl3160_2ac_cfg)},
1425 + {IWL_PCI_DEVICE(0x08B3, 0x0470, iwl3160_2ac_cfg)},
1426 ++ {IWL_PCI_DEVICE(0x08B3, 0x0472, iwl3160_2ac_cfg)},
1427 ++ {IWL_PCI_DEVICE(0x08B4, 0x0370, iwl3160_2ac_cfg)},
1428 + {IWL_PCI_DEVICE(0x08B3, 0x8070, iwl3160_2ac_cfg)},
1429 ++ {IWL_PCI_DEVICE(0x08B3, 0x8072, iwl3160_2ac_cfg)},
1430 + {IWL_PCI_DEVICE(0x08B3, 0x8170, iwl3160_2ac_cfg)},
1431 ++ {IWL_PCI_DEVICE(0x08B3, 0x8172, iwl3160_2ac_cfg)},
1432 + {IWL_PCI_DEVICE(0x08B3, 0x8060, iwl3160_2n_cfg)},
1433 + {IWL_PCI_DEVICE(0x08B3, 0x8062, iwl3160_n_cfg)},
1434 + {IWL_PCI_DEVICE(0x08B4, 0x8270, iwl3160_2ac_cfg)},
1435 + {IWL_PCI_DEVICE(0x08B3, 0x8470, iwl3160_2ac_cfg)},
1436 ++ {IWL_PCI_DEVICE(0x08B3, 0x8570, iwl3160_2ac_cfg)},
1437 + #endif /* CONFIG_IWLMVM */
1438 +
1439 + {0}
1440 +diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h
1441 +index 4d9a5e70c992..b2d442f102da 100644
1442 +--- a/drivers/net/xen-netback/common.h
1443 ++++ b/drivers/net/xen-netback/common.h
1444 +@@ -92,6 +92,7 @@ struct xenvif {
1445 + unsigned long credit_usec;
1446 + unsigned long remaining_credit;
1447 + struct timer_list credit_timeout;
1448 ++ u64 credit_window_start;
1449 +
1450 + /* Statistics */
1451 + unsigned long rx_gso_checksum_fixup;
1452 +diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c
1453 +index 73336c144d92..d28324a87231 100644
1454 +--- a/drivers/net/xen-netback/interface.c
1455 ++++ b/drivers/net/xen-netback/interface.c
1456 +@@ -297,8 +297,7 @@ struct xenvif *xenvif_alloc(struct device *parent, domid_t domid,
1457 + vif->credit_bytes = vif->remaining_credit = ~0UL;
1458 + vif->credit_usec = 0UL;
1459 + init_timer(&vif->credit_timeout);
1460 +- /* Initialize 'expires' now: it's used to track the credit window. */
1461 +- vif->credit_timeout.expires = jiffies;
1462 ++ vif->credit_window_start = get_jiffies_64();
1463 +
1464 + dev->netdev_ops = &xenvif_netdev_ops;
1465 + dev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO;
1466 +diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
1467 +index fc7867ce90e5..ac55997bd90e 100644
1468 +--- a/drivers/net/xen-netback/netback.c
1469 ++++ b/drivers/net/xen-netback/netback.c
1470 +@@ -1430,9 +1430,8 @@ out:
1471 +
1472 + static bool tx_credit_exceeded(struct xenvif *vif, unsigned size)
1473 + {
1474 +- unsigned long now = jiffies;
1475 +- unsigned long next_credit =
1476 +- vif->credit_timeout.expires +
1477 ++ u64 now = get_jiffies_64();
1478 ++ u64 next_credit = vif->credit_window_start +
1479 + msecs_to_jiffies(vif->credit_usec / 1000);
1480 +
1481 + /* Timer could already be pending in rare cases. */
1482 +@@ -1440,8 +1439,8 @@ static bool tx_credit_exceeded(struct xenvif *vif, unsigned size)
1483 + return true;
1484 +
1485 + /* Passed the point where we can replenish credit? */
1486 +- if (time_after_eq(now, next_credit)) {
1487 +- vif->credit_timeout.expires = now;
1488 ++ if (time_after_eq64(now, next_credit)) {
1489 ++ vif->credit_window_start = now;
1490 + tx_add_credit(vif);
1491 + }
1492 +
1493 +@@ -1453,6 +1452,7 @@ static bool tx_credit_exceeded(struct xenvif *vif, unsigned size)
1494 + tx_credit_callback;
1495 + mod_timer(&vif->credit_timeout,
1496 + next_credit);
1497 ++ vif->credit_window_start = next_credit;
1498 +
1499 + return true;
1500 + }
1501 +diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c
1502 +index a53782ef1540..1b08d8798372 100644
1503 +--- a/drivers/net/xen-netback/xenbus.c
1504 ++++ b/drivers/net/xen-netback/xenbus.c
1505 +@@ -24,6 +24,12 @@
1506 + struct backend_info {
1507 + struct xenbus_device *dev;
1508 + struct xenvif *vif;
1509 ++
1510 ++ /* This is the state that will be reflected in xenstore when any
1511 ++ * active hotplug script completes.
1512 ++ */
1513 ++ enum xenbus_state state;
1514 ++
1515 + enum xenbus_state frontend_state;
1516 + struct xenbus_watch hotplug_status_watch;
1517 + u8 have_hotplug_status_watch:1;
1518 +@@ -33,11 +39,15 @@ static int connect_rings(struct backend_info *);
1519 + static void connect(struct backend_info *);
1520 + static void backend_create_xenvif(struct backend_info *be);
1521 + static void unregister_hotplug_status_watch(struct backend_info *be);
1522 ++static void set_backend_state(struct backend_info *be,
1523 ++ enum xenbus_state state);
1524 +
1525 + static int netback_remove(struct xenbus_device *dev)
1526 + {
1527 + struct backend_info *be = dev_get_drvdata(&dev->dev);
1528 +
1529 ++ set_backend_state(be, XenbusStateClosed);
1530 ++
1531 + unregister_hotplug_status_watch(be);
1532 + if (be->vif) {
1533 + kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE);
1534 +@@ -136,6 +146,8 @@ static int netback_probe(struct xenbus_device *dev,
1535 + if (err)
1536 + goto fail;
1537 +
1538 ++ be->state = XenbusStateInitWait;
1539 ++
1540 + /* This kicks hotplug scripts, so do it immediately. */
1541 + backend_create_xenvif(be);
1542 +
1543 +@@ -208,24 +220,113 @@ static void backend_create_xenvif(struct backend_info *be)
1544 + kobject_uevent(&dev->dev.kobj, KOBJ_ONLINE);
1545 + }
1546 +
1547 +-
1548 +-static void disconnect_backend(struct xenbus_device *dev)
1549 ++static void backend_disconnect(struct backend_info *be)
1550 + {
1551 +- struct backend_info *be = dev_get_drvdata(&dev->dev);
1552 +-
1553 + if (be->vif)
1554 + xenvif_disconnect(be->vif);
1555 + }
1556 +
1557 +-static void destroy_backend(struct xenbus_device *dev)
1558 ++static void backend_connect(struct backend_info *be)
1559 + {
1560 +- struct backend_info *be = dev_get_drvdata(&dev->dev);
1561 ++ if (be->vif)
1562 ++ connect(be);
1563 ++}
1564 +
1565 +- if (be->vif) {
1566 +- kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE);
1567 +- xenbus_rm(XBT_NIL, dev->nodename, "hotplug-status");
1568 +- xenvif_free(be->vif);
1569 +- be->vif = NULL;
1570 ++static inline void backend_switch_state(struct backend_info *be,
1571 ++ enum xenbus_state state)
1572 ++{
1573 ++ struct xenbus_device *dev = be->dev;
1574 ++
1575 ++ pr_debug("%s -> %s\n", dev->nodename, xenbus_strstate(state));
1576 ++ be->state = state;
1577 ++
1578 ++ /* If we are waiting for a hotplug script then defer the
1579 ++ * actual xenbus state change.
1580 ++ */
1581 ++ if (!be->have_hotplug_status_watch)
1582 ++ xenbus_switch_state(dev, state);
1583 ++}
1584 ++
1585 ++/* Handle backend state transitions:
1586 ++ *
1587 ++ * The backend state starts in InitWait and the following transitions are
1588 ++ * allowed.
1589 ++ *
1590 ++ * InitWait -> Connected
1591 ++ *
1592 ++ * ^ \ |
1593 ++ * | \ |
1594 ++ * | \ |
1595 ++ * | \ |
1596 ++ * | \ |
1597 ++ * | \ |
1598 ++ * | V V
1599 ++ *
1600 ++ * Closed <-> Closing
1601 ++ *
1602 ++ * The state argument specifies the eventual state of the backend and the
1603 ++ * function transitions to that state via the shortest path.
1604 ++ */
1605 ++static void set_backend_state(struct backend_info *be,
1606 ++ enum xenbus_state state)
1607 ++{
1608 ++ while (be->state != state) {
1609 ++ switch (be->state) {
1610 ++ case XenbusStateClosed:
1611 ++ switch (state) {
1612 ++ case XenbusStateInitWait:
1613 ++ case XenbusStateConnected:
1614 ++ pr_info("%s: prepare for reconnect\n",
1615 ++ be->dev->nodename);
1616 ++ backend_switch_state(be, XenbusStateInitWait);
1617 ++ break;
1618 ++ case XenbusStateClosing:
1619 ++ backend_switch_state(be, XenbusStateClosing);
1620 ++ break;
1621 ++ default:
1622 ++ BUG();
1623 ++ }
1624 ++ break;
1625 ++ case XenbusStateInitWait:
1626 ++ switch (state) {
1627 ++ case XenbusStateConnected:
1628 ++ backend_connect(be);
1629 ++ backend_switch_state(be, XenbusStateConnected);
1630 ++ break;
1631 ++ case XenbusStateClosing:
1632 ++ case XenbusStateClosed:
1633 ++ backend_switch_state(be, XenbusStateClosing);
1634 ++ break;
1635 ++ default:
1636 ++ BUG();
1637 ++ }
1638 ++ break;
1639 ++ case XenbusStateConnected:
1640 ++ switch (state) {
1641 ++ case XenbusStateInitWait:
1642 ++ case XenbusStateClosing:
1643 ++ case XenbusStateClosed:
1644 ++ backend_disconnect(be);
1645 ++ backend_switch_state(be, XenbusStateClosing);
1646 ++ break;
1647 ++ default:
1648 ++ BUG();
1649 ++ }
1650 ++ break;
1651 ++ case XenbusStateClosing:
1652 ++ switch (state) {
1653 ++ case XenbusStateInitWait:
1654 ++ case XenbusStateConnected:
1655 ++ case XenbusStateClosed:
1656 ++ backend_switch_state(be, XenbusStateClosed);
1657 ++ break;
1658 ++ default:
1659 ++ BUG();
1660 ++ }
1661 ++ break;
1662 ++ default:
1663 ++ BUG();
1664 ++ }
1665 + }
1666 + }
1667 +
1668 +@@ -237,40 +338,33 @@ static void frontend_changed(struct xenbus_device *dev,
1669 + {
1670 + struct backend_info *be = dev_get_drvdata(&dev->dev);
1671 +
1672 +- pr_debug("frontend state %s\n", xenbus_strstate(frontend_state));
1673 ++ pr_debug("%s -> %s\n", dev->otherend, xenbus_strstate(frontend_state));
1674 +
1675 + be->frontend_state = frontend_state;
1676 +
1677 + switch (frontend_state) {
1678 + case XenbusStateInitialising:
1679 +- if (dev->state == XenbusStateClosed) {
1680 +- pr_info("%s: prepare for reconnect\n", dev->nodename);
1681 +- xenbus_switch_state(dev, XenbusStateInitWait);
1682 +- }
1683 ++ set_backend_state(be, XenbusStateInitWait);
1684 + break;
1685 +
1686 + case XenbusStateInitialised:
1687 + break;
1688 +
1689 + case XenbusStateConnected:
1690 +- if (dev->state == XenbusStateConnected)
1691 +- break;
1692 +- if (be->vif)
1693 +- connect(be);
1694 ++ set_backend_state(be, XenbusStateConnected);
1695 + break;
1696 +
1697 + case XenbusStateClosing:
1698 +- disconnect_backend(dev);
1699 +- xenbus_switch_state(dev, XenbusStateClosing);
1700 ++ set_backend_state(be, XenbusStateClosing);
1701 + break;
1702 +
1703 + case XenbusStateClosed:
1704 +- xenbus_switch_state(dev, XenbusStateClosed);
1705 ++ set_backend_state(be, XenbusStateClosed);
1706 + if (xenbus_dev_is_online(dev))
1707 + break;
1708 +- destroy_backend(dev);
1709 + /* fall through if not online */
1710 + case XenbusStateUnknown:
1711 ++ set_backend_state(be, XenbusStateClosed);
1712 + device_unregister(&dev->dev);
1713 + break;
1714 +
1715 +@@ -363,7 +457,9 @@ static void hotplug_status_changed(struct xenbus_watch *watch,
1716 + if (IS_ERR(str))
1717 + return;
1718 + if (len == sizeof("connected")-1 && !memcmp(str, "connected", len)) {
1719 +- xenbus_switch_state(be->dev, XenbusStateConnected);
1720 ++ /* Complete any pending state change */
1721 ++ xenbus_switch_state(be->dev, be->state);
1722 ++
1723 + /* Not interested in this watch anymore. */
1724 + unregister_hotplug_status_watch(be);
1725 + }
1726 +@@ -393,12 +489,8 @@ static void connect(struct backend_info *be)
1727 + err = xenbus_watch_pathfmt(dev, &be->hotplug_status_watch,
1728 + hotplug_status_changed,
1729 + "%s/%s", dev->nodename, "hotplug-status");
1730 +- if (err) {
1731 +- /* Switch now, since we can't do a watch. */
1732 +- xenbus_switch_state(dev, XenbusStateConnected);
1733 +- } else {
1734 ++ if (!err)
1735 + be->have_hotplug_status_watch = 1;
1736 +- }
1737 +
1738 + netif_wake_queue(be->vif->dev);
1739 + }
1740 +diff --git a/drivers/thermal/x86_pkg_temp_thermal.c b/drivers/thermal/x86_pkg_temp_thermal.c
1741 +index f36950e4134f..7722cb9d5a80 100644
1742 +--- a/drivers/thermal/x86_pkg_temp_thermal.c
1743 ++++ b/drivers/thermal/x86_pkg_temp_thermal.c
1744 +@@ -316,18 +316,19 @@ static void pkg_temp_thermal_threshold_work_fn(struct work_struct *work)
1745 + int phy_id = topology_physical_package_id(cpu);
1746 + struct phy_dev_entry *phdev = pkg_temp_thermal_get_phy_entry(cpu);
1747 + bool notify = false;
1748 ++ unsigned long flags;
1749 +
1750 + if (!phdev)
1751 + return;
1752 +
1753 +- spin_lock(&pkg_work_lock);
1754 ++ spin_lock_irqsave(&pkg_work_lock, flags);
1755 + ++pkg_work_cnt;
1756 + if (unlikely(phy_id > max_phy_id)) {
1757 +- spin_unlock(&pkg_work_lock);
1758 ++ spin_unlock_irqrestore(&pkg_work_lock, flags);
1759 + return;
1760 + }
1761 + pkg_work_scheduled[phy_id] = 0;
1762 +- spin_unlock(&pkg_work_lock);
1763 ++ spin_unlock_irqrestore(&pkg_work_lock, flags);
1764 +
1765 + enable_pkg_thres_interrupt();
1766 + rdmsrl(MSR_IA32_PACKAGE_THERM_STATUS, msr_val);
1767 +@@ -397,6 +398,7 @@ static int pkg_temp_thermal_device_add(unsigned int cpu)
1768 + int thres_count;
1769 + u32 eax, ebx, ecx, edx;
1770 + u8 *temp;
1771 ++ unsigned long flags;
1772 +
1773 + cpuid(6, &eax, &ebx, &ecx, &edx);
1774 + thres_count = ebx & 0x07;
1775 +@@ -420,19 +422,19 @@ static int pkg_temp_thermal_device_add(unsigned int cpu)
1776 + goto err_ret_unlock;
1777 + }
1778 +
1779 +- spin_lock(&pkg_work_lock);
1780 ++ spin_lock_irqsave(&pkg_work_lock, flags);
1781 + if (topology_physical_package_id(cpu) > max_phy_id)
1782 + max_phy_id = topology_physical_package_id(cpu);
1783 + temp = krealloc(pkg_work_scheduled,
1784 + (max_phy_id+1) * sizeof(u8), GFP_ATOMIC);
1785 + if (!temp) {
1786 +- spin_unlock(&pkg_work_lock);
1787 ++ spin_unlock_irqrestore(&pkg_work_lock, flags);
1788 + err = -ENOMEM;
1789 + goto err_ret_free;
1790 + }
1791 + pkg_work_scheduled = temp;
1792 + pkg_work_scheduled[topology_physical_package_id(cpu)] = 0;
1793 +- spin_unlock(&pkg_work_lock);
1794 ++ spin_unlock_irqrestore(&pkg_work_lock, flags);
1795 +
1796 + phy_dev_entry->phys_proc_id = topology_physical_package_id(cpu);
1797 + phy_dev_entry->first_cpu = cpu;
1798 +diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
1799 +index 014dc996b4f6..7b8bc0bdc5da 100644
1800 +--- a/drivers/usb/core/hcd.c
1801 ++++ b/drivers/usb/core/hcd.c
1802 +@@ -1035,6 +1035,7 @@ static int register_root_hub(struct usb_hcd *hcd)
1803 + dev_name(&usb_dev->dev), retval);
1804 + return retval;
1805 + }
1806 ++ usb_dev->lpm_capable = usb_device_supports_lpm(usb_dev);
1807 + }
1808 +
1809 + retval = usb_new_device (usb_dev);
1810 +diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
1811 +index 17c3785241a4..1c110891fac0 100644
1812 +--- a/drivers/usb/core/hub.c
1813 ++++ b/drivers/usb/core/hub.c
1814 +@@ -135,7 +135,7 @@ struct usb_hub *usb_hub_to_struct_hub(struct usb_device *hdev)
1815 + return usb_get_intfdata(hdev->actconfig->interface[0]);
1816 + }
1817 +
1818 +-static int usb_device_supports_lpm(struct usb_device *udev)
1819 ++int usb_device_supports_lpm(struct usb_device *udev)
1820 + {
1821 + /* USB 2.1 (and greater) devices indicate LPM support through
1822 + * their USB 2.0 Extended Capabilities BOS descriptor.
1823 +@@ -156,6 +156,11 @@ static int usb_device_supports_lpm(struct usb_device *udev)
1824 + "Power management will be impacted.\n");
1825 + return 0;
1826 + }
1827 ++
1828 ++ /* udev is root hub */
1829 ++ if (!udev->parent)
1830 ++ return 1;
1831 ++
1832 + if (udev->parent->lpm_capable)
1833 + return 1;
1834 +
1835 +@@ -1557,10 +1562,15 @@ static int hub_configure(struct usb_hub *hub,
1836 + if (hub->has_indicators && blinkenlights)
1837 + hub->indicator [0] = INDICATOR_CYCLE;
1838 +
1839 +- for (i = 0; i < hdev->maxchild; i++)
1840 +- if (usb_hub_create_port_device(hub, i + 1) < 0)
1841 ++ for (i = 0; i < hdev->maxchild; i++) {
1842 ++ ret = usb_hub_create_port_device(hub, i + 1);
1843 ++ if (ret < 0) {
1844 + dev_err(hub->intfdev,
1845 + "couldn't create port%d device.\n", i + 1);
1846 ++ hdev->maxchild = i;
1847 ++ goto fail_keep_maxchild;
1848 ++ }
1849 ++ }
1850 +
1851 + usb_hub_adjust_deviceremovable(hdev, hub->descriptor);
1852 +
1853 +@@ -1568,6 +1578,8 @@ static int hub_configure(struct usb_hub *hub,
1854 + return 0;
1855 +
1856 + fail:
1857 ++ hdev->maxchild = 0;
1858 ++fail_keep_maxchild:
1859 + dev_err (hub_dev, "config failed, %s (err %d)\n",
1860 + message, ret);
1861 + /* hub_disconnect() frees urb and descriptor */
1862 +diff --git a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h
1863 +index 823857767a16..c49383669cd8 100644
1864 +--- a/drivers/usb/core/usb.h
1865 ++++ b/drivers/usb/core/usb.h
1866 +@@ -35,6 +35,7 @@ extern int usb_get_device_descriptor(struct usb_device *dev,
1867 + unsigned int size);
1868 + extern int usb_get_bos_descriptor(struct usb_device *dev);
1869 + extern void usb_release_bos_descriptor(struct usb_device *dev);
1870 ++extern int usb_device_supports_lpm(struct usb_device *udev);
1871 + extern char *usb_cache_string(struct usb_device *udev, int index);
1872 + extern int usb_set_configuration(struct usb_device *dev, int configuration);
1873 + extern int usb_choose_configuration(struct usb_device *udev);
1874 +diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
1875 +index acaee066b99a..c3d94853b4ab 100644
1876 +--- a/drivers/usb/serial/option.c
1877 ++++ b/drivers/usb/serial/option.c
1878 +@@ -1376,6 +1376,23 @@ static const struct usb_device_id option_ids[] = {
1879 + .driver_info = (kernel_ulong_t)&net_intf2_blacklist },
1880 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1426, 0xff, 0xff, 0xff), /* ZTE MF91 */
1881 + .driver_info = (kernel_ulong_t)&net_intf2_blacklist },
1882 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1533, 0xff, 0xff, 0xff) },
1883 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1534, 0xff, 0xff, 0xff) },
1884 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1535, 0xff, 0xff, 0xff) },
1885 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1545, 0xff, 0xff, 0xff) },
1886 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1546, 0xff, 0xff, 0xff) },
1887 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1547, 0xff, 0xff, 0xff) },
1888 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1565, 0xff, 0xff, 0xff) },
1889 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1566, 0xff, 0xff, 0xff) },
1890 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1567, 0xff, 0xff, 0xff) },
1891 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1589, 0xff, 0xff, 0xff) },
1892 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1590, 0xff, 0xff, 0xff) },
1893 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1591, 0xff, 0xff, 0xff) },
1894 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1592, 0xff, 0xff, 0xff) },
1895 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1594, 0xff, 0xff, 0xff) },
1896 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1596, 0xff, 0xff, 0xff) },
1897 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1598, 0xff, 0xff, 0xff) },
1898 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1600, 0xff, 0xff, 0xff) },
1899 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2002, 0xff,
1900 + 0xff, 0xff), .driver_info = (kernel_ulong_t)&zte_k3765_z_blacklist },
1901 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2003, 0xff, 0xff, 0xff) },
1902 +diff --git a/drivers/video/backlight/atmel-pwm-bl.c b/drivers/video/backlight/atmel-pwm-bl.c
1903 +index 0393d827dd44..f7447f7004fb 100644
1904 +--- a/drivers/video/backlight/atmel-pwm-bl.c
1905 ++++ b/drivers/video/backlight/atmel-pwm-bl.c
1906 +@@ -118,7 +118,7 @@ static const struct backlight_ops atmel_pwm_bl_ops = {
1907 + .update_status = atmel_pwm_bl_set_intensity,
1908 + };
1909 +
1910 +-static int __init atmel_pwm_bl_probe(struct platform_device *pdev)
1911 ++static int atmel_pwm_bl_probe(struct platform_device *pdev)
1912 + {
1913 + struct backlight_properties props;
1914 + const struct atmel_pwm_bl_platform_data *pdata;
1915 +@@ -202,7 +202,7 @@ err_free_mem:
1916 + return retval;
1917 + }
1918 +
1919 +-static int __exit atmel_pwm_bl_remove(struct platform_device *pdev)
1920 ++static int atmel_pwm_bl_remove(struct platform_device *pdev)
1921 + {
1922 + struct atmel_pwm_bl *pwmbl = platform_get_drvdata(pdev);
1923 +
1924 +@@ -220,10 +220,11 @@ static struct platform_driver atmel_pwm_bl_driver = {
1925 + .name = "atmel-pwm-bl",
1926 + },
1927 + /* REVISIT add suspend() and resume() */
1928 +- .remove = __exit_p(atmel_pwm_bl_remove),
1929 ++ .probe = atmel_pwm_bl_probe,
1930 ++ .remove = atmel_pwm_bl_remove,
1931 + };
1932 +
1933 +-module_platform_driver_probe(atmel_pwm_bl_driver, atmel_pwm_bl_probe);
1934 ++module_platform_driver(atmel_pwm_bl_driver);
1935 +
1936 + MODULE_AUTHOR("Hans-Christian egtvedt <hans-christian.egtvedt@×××××.com>");
1937 + MODULE_DESCRIPTION("Atmel PWM backlight driver");
1938 +diff --git a/drivers/video/hyperv_fb.c b/drivers/video/hyperv_fb.c
1939 +index d4d2c5fe2488..0f3b33cf13ef 100644
1940 +--- a/drivers/video/hyperv_fb.c
1941 ++++ b/drivers/video/hyperv_fb.c
1942 +@@ -795,12 +795,21 @@ static int hvfb_remove(struct hv_device *hdev)
1943 + }
1944 +
1945 +
1946 ++static DEFINE_PCI_DEVICE_TABLE(pci_stub_id_table) = {
1947 ++ {
1948 ++ .vendor = PCI_VENDOR_ID_MICROSOFT,
1949 ++ .device = PCI_DEVICE_ID_HYPERV_VIDEO,
1950 ++ },
1951 ++ { /* end of list */ }
1952 ++};
1953 ++
1954 + static const struct hv_vmbus_device_id id_table[] = {
1955 + /* Synthetic Video Device GUID */
1956 + {HV_SYNTHVID_GUID},
1957 + {}
1958 + };
1959 +
1960 ++MODULE_DEVICE_TABLE(pci, pci_stub_id_table);
1961 + MODULE_DEVICE_TABLE(vmbus, id_table);
1962 +
1963 + static struct hv_driver hvfb_drv = {
1964 +@@ -810,14 +819,43 @@ static struct hv_driver hvfb_drv = {
1965 + .remove = hvfb_remove,
1966 + };
1967 +
1968 ++static int hvfb_pci_stub_probe(struct pci_dev *pdev,
1969 ++ const struct pci_device_id *ent)
1970 ++{
1971 ++ return 0;
1972 ++}
1973 ++
1974 ++static void hvfb_pci_stub_remove(struct pci_dev *pdev)
1975 ++{
1976 ++}
1977 ++
1978 ++static struct pci_driver hvfb_pci_stub_driver = {
1979 ++ .name = KBUILD_MODNAME,
1980 ++ .id_table = pci_stub_id_table,
1981 ++ .probe = hvfb_pci_stub_probe,
1982 ++ .remove = hvfb_pci_stub_remove,
1983 ++};
1984 +
1985 + static int __init hvfb_drv_init(void)
1986 + {
1987 +- return vmbus_driver_register(&hvfb_drv);
1988 ++ int ret;
1989 ++
1990 ++ ret = vmbus_driver_register(&hvfb_drv);
1991 ++ if (ret != 0)
1992 ++ return ret;
1993 ++
1994 ++ ret = pci_register_driver(&hvfb_pci_stub_driver);
1995 ++ if (ret != 0) {
1996 ++ vmbus_driver_unregister(&hvfb_drv);
1997 ++ return ret;
1998 ++ }
1999 ++
2000 ++ return 0;
2001 + }
2002 +
2003 + static void __exit hvfb_drv_exit(void)
2004 + {
2005 ++ pci_unregister_driver(&hvfb_pci_stub_driver);
2006 + vmbus_driver_unregister(&hvfb_drv);
2007 + }
2008 +
2009 +diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
2010 +index 48ec25a7fcb6..5e661a979694 100644
2011 +--- a/include/net/ip6_fib.h
2012 ++++ b/include/net/ip6_fib.h
2013 +@@ -165,6 +165,7 @@ static inline struct inet6_dev *ip6_dst_idev(struct dst_entry *dst)
2014 + static inline void rt6_clean_expires(struct rt6_info *rt)
2015 + {
2016 + rt->rt6i_flags &= ~RTF_EXPIRES;
2017 ++ rt->dst.expires = 0;
2018 + }
2019 +
2020 + static inline void rt6_set_expires(struct rt6_info *rt, unsigned long expires)
2021 +diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
2022 +index 0b1df41691e8..1517442595d3 100644
2023 +--- a/include/uapi/linux/perf_event.h
2024 ++++ b/include/uapi/linux/perf_event.h
2025 +@@ -428,13 +428,15 @@ struct perf_event_mmap_page {
2026 + /*
2027 + * Control data for the mmap() data buffer.
2028 + *
2029 +- * User-space reading the @data_head value should issue an rmb(), on
2030 +- * SMP capable platforms, after reading this value -- see
2031 +- * perf_event_wakeup().
2032 ++ * User-space reading the @data_head value should issue an smp_rmb(),
2033 ++ * after reading this value.
2034 + *
2035 + * When the mapping is PROT_WRITE the @data_tail value should be
2036 +- * written by userspace to reflect the last read data. In this case
2037 +- * the kernel will not over-write unread data.
2038 ++ * written by userspace to reflect the last read data, after issueing
2039 ++ * an smp_mb() to separate the data read from the ->data_tail store.
2040 ++ * In this case the kernel will not over-write unread data.
2041 ++ *
2042 ++ * See perf_output_put_handle() for the data ordering.
2043 + */
2044 + __u64 data_head; /* head in the data section */
2045 + __u64 data_tail; /* user-space written tail */
2046 +diff --git a/kernel/events/ring_buffer.c b/kernel/events/ring_buffer.c
2047 +index cd55144270b5..9c2ddfbf4525 100644
2048 +--- a/kernel/events/ring_buffer.c
2049 ++++ b/kernel/events/ring_buffer.c
2050 +@@ -87,10 +87,31 @@ again:
2051 + goto out;
2052 +
2053 + /*
2054 +- * Publish the known good head. Rely on the full barrier implied
2055 +- * by atomic_dec_and_test() order the rb->head read and this
2056 +- * write.
2057 ++ * Since the mmap() consumer (userspace) can run on a different CPU:
2058 ++ *
2059 ++ * kernel user
2060 ++ *
2061 ++ * READ ->data_tail READ ->data_head
2062 ++ * smp_mb() (A) smp_rmb() (C)
2063 ++ * WRITE $data READ $data
2064 ++ * smp_wmb() (B) smp_mb() (D)
2065 ++ * STORE ->data_head WRITE ->data_tail
2066 ++ *
2067 ++ * Where A pairs with D, and B pairs with C.
2068 ++ *
2069 ++ * I don't think A needs to be a full barrier because we won't in fact
2070 ++ * write data until we see the store from userspace. So we simply don't
2071 ++ * issue the data WRITE until we observe it. Be conservative for now.
2072 ++ *
2073 ++ * OTOH, D needs to be a full barrier since it separates the data READ
2074 ++ * from the tail WRITE.
2075 ++ *
2076 ++ * For B a WMB is sufficient since it separates two WRITEs, and for C
2077 ++ * an RMB is sufficient since it separates two READs.
2078 ++ *
2079 ++ * See perf_output_begin().
2080 + */
2081 ++ smp_wmb();
2082 + rb->user_page->data_head = head;
2083 +
2084 + /*
2085 +@@ -154,9 +175,11 @@ int perf_output_begin(struct perf_output_handle *handle,
2086 + * Userspace could choose to issue a mb() before updating the
2087 + * tail pointer. So that all reads will be completed before the
2088 + * write is issued.
2089 ++ *
2090 ++ * See perf_output_put_handle().
2091 + */
2092 + tail = ACCESS_ONCE(rb->user_page->data_tail);
2093 +- smp_rmb();
2094 ++ smp_mb();
2095 + offset = head = local_read(&rb->head);
2096 + head += size;
2097 + if (unlikely(!perf_output_space(rb, tail, offset, head)))
2098 +diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
2099 +index 496f94d57698..207f5fc61ec8 100644
2100 +--- a/kernel/trace/trace.c
2101 ++++ b/kernel/trace/trace.c
2102 +@@ -843,9 +843,12 @@ int trace_get_user(struct trace_parser *parser, const char __user *ubuf,
2103 + if (isspace(ch)) {
2104 + parser->buffer[parser->idx] = 0;
2105 + parser->cont = false;
2106 +- } else {
2107 ++ } else if (parser->idx < parser->size - 1) {
2108 + parser->cont = true;
2109 + parser->buffer[parser->idx++] = ch;
2110 ++ } else {
2111 ++ ret = -EINVAL;
2112 ++ goto out;
2113 + }
2114 +
2115 + *ppos += read;
2116 +diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
2117 +index 52d0f8356071..4a1d06488082 100644
2118 +--- a/net/core/flow_dissector.c
2119 ++++ b/net/core/flow_dissector.c
2120 +@@ -40,7 +40,7 @@ again:
2121 + struct iphdr _iph;
2122 + ip:
2123 + iph = skb_header_pointer(skb, nhoff, sizeof(_iph), &_iph);
2124 +- if (!iph)
2125 ++ if (!iph || iph->ihl < 5)
2126 + return false;
2127 +
2128 + if (ip_is_fragment(iph))
2129 +diff --git a/net/ipv4/tcp_offload.c b/net/ipv4/tcp_offload.c
2130 +index 3a7525e6c086..533c58a5cfb7 100644
2131 +--- a/net/ipv4/tcp_offload.c
2132 ++++ b/net/ipv4/tcp_offload.c
2133 +@@ -18,6 +18,7 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb,
2134 + netdev_features_t features)
2135 + {
2136 + struct sk_buff *segs = ERR_PTR(-EINVAL);
2137 ++ unsigned int sum_truesize = 0;
2138 + struct tcphdr *th;
2139 + unsigned int thlen;
2140 + unsigned int seq;
2141 +@@ -102,13 +103,7 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb,
2142 + if (copy_destructor) {
2143 + skb->destructor = gso_skb->destructor;
2144 + skb->sk = gso_skb->sk;
2145 +- /* {tcp|sock}_wfree() use exact truesize accounting :
2146 +- * sum(skb->truesize) MUST be exactly be gso_skb->truesize
2147 +- * So we account mss bytes of 'true size' for each segment.
2148 +- * The last segment will contain the remaining.
2149 +- */
2150 +- skb->truesize = mss;
2151 +- gso_skb->truesize -= mss;
2152 ++ sum_truesize += skb->truesize;
2153 + }
2154 + skb = skb->next;
2155 + th = tcp_hdr(skb);
2156 +@@ -125,7 +120,9 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb,
2157 + if (copy_destructor) {
2158 + swap(gso_skb->sk, skb->sk);
2159 + swap(gso_skb->destructor, skb->destructor);
2160 +- swap(gso_skb->truesize, skb->truesize);
2161 ++ sum_truesize += skb->truesize;
2162 ++ atomic_add(sum_truesize - gso_skb->truesize,
2163 ++ &skb->sk->sk_wmem_alloc);
2164 + }
2165 +
2166 + delta = htonl(oldlen + (skb_tail_pointer(skb) -
2167 +diff --git a/net/ipv6/route.c b/net/ipv6/route.c
2168 +index 1e32d5c0b615..c9bd97bfd855 100644
2169 +--- a/net/ipv6/route.c
2170 ++++ b/net/ipv6/route.c
2171 +@@ -1088,10 +1088,13 @@ static struct dst_entry *ip6_dst_check(struct dst_entry *dst, u32 cookie)
2172 + if (rt->rt6i_genid != rt_genid(dev_net(rt->dst.dev)))
2173 + return NULL;
2174 +
2175 +- if (rt->rt6i_node && (rt->rt6i_node->fn_sernum == cookie))
2176 +- return dst;
2177 ++ if (!rt->rt6i_node || (rt->rt6i_node->fn_sernum != cookie))
2178 ++ return NULL;
2179 +
2180 +- return NULL;
2181 ++ if (rt6_check_expired(rt))
2182 ++ return NULL;
2183 ++
2184 ++ return dst;
2185 + }
2186 +
2187 + static struct dst_entry *ip6_negative_advice(struct dst_entry *dst)
2188 +diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c
2189 +index 9da68852ee94..8b5b4b7b9941 100644
2190 +--- a/net/sctp/sm_sideeffect.c
2191 ++++ b/net/sctp/sm_sideeffect.c
2192 +@@ -866,7 +866,6 @@ static void sctp_cmd_delete_tcb(sctp_cmd_seq_t *cmds,
2193 + (!asoc->temp) && (sk->sk_shutdown != SHUTDOWN_MASK))
2194 + return;
2195 +
2196 +- BUG_ON(asoc->peer.primary_path == NULL);
2197 + sctp_unhash_established(asoc);
2198 + sctp_association_free(asoc);
2199 + }
2200 +diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
2201 +index 48657565265e..4fb8bc30333a 100644
2202 +--- a/sound/pci/hda/patch_hdmi.c
2203 ++++ b/sound/pci/hda/patch_hdmi.c
2204 +@@ -738,9 +738,10 @@ static int hdmi_manual_setup_channel_mapping(struct hda_codec *codec,
2205 + static void hdmi_setup_fake_chmap(unsigned char *map, int ca)
2206 + {
2207 + int i;
2208 ++ int ordered_ca = get_channel_allocation_order(ca);
2209 + for (i = 0; i < 8; i++) {
2210 +- if (i < channel_allocations[ca].channels)
2211 +- map[i] = from_cea_slot((hdmi_channel_mapping[ca][i] >> 4) & 0x0f);
2212 ++ if (i < channel_allocations[ordered_ca].channels)
2213 ++ map[i] = from_cea_slot(hdmi_channel_mapping[ca][i] & 0x0f);
2214 + else
2215 + map[i] = 0;
2216 + }
2217
2218 Modified: genpatches-2.6/trunk/3.12/0000_README
2219 ===================================================================
2220 --- genpatches-2.6/trunk/3.12/0000_README 2013-11-14 16:37:35 UTC (rev 2581)
2221 +++ genpatches-2.6/trunk/3.12/0000_README 2013-11-21 00:37:00 UTC (rev 2582)
2222 @@ -42,6 +42,10 @@
2223
2224 Individual Patch Descriptions:
2225 --------------------------------------------------------------------------
2226 +Patch: 1000_linux-3.12.1.patch
2227 +From: http://www.kernel.org
2228 +Desc: Linux 3.12.1
2229 +
2230 Patch: 1500_XATTR_USER_PREFIX.patch
2231 From: https://bugs.gentoo.org/show_bug.cgi?id=470644
2232 Desc: Support for namespace user.pax.* on tmpfs.
2233
2234 Added: genpatches-2.6/trunk/3.12/1000_linux-3.12.1.patch
2235 ===================================================================
2236 --- genpatches-2.6/trunk/3.12/1000_linux-3.12.1.patch (rev 0)
2237 +++ genpatches-2.6/trunk/3.12/1000_linux-3.12.1.patch 2013-11-21 00:37:00 UTC (rev 2582)
2238 @@ -0,0 +1,583 @@
2239 +diff --git a/Makefile b/Makefile
2240 +index 67077ad..eb29ec7 100644
2241 +--- a/Makefile
2242 ++++ b/Makefile
2243 +@@ -1,6 +1,6 @@
2244 + VERSION = 3
2245 + PATCHLEVEL = 12
2246 +-SUBLEVEL = 0
2247 ++SUBLEVEL = 1
2248 + EXTRAVERSION =
2249 + NAME = One Giant Leap for Frogkind
2250 +
2251 +diff --git a/drivers/misc/atmel_pwm.c b/drivers/misc/atmel_pwm.c
2252 +index 494d050..a6dc56e 100644
2253 +--- a/drivers/misc/atmel_pwm.c
2254 ++++ b/drivers/misc/atmel_pwm.c
2255 +@@ -90,8 +90,10 @@ int pwm_channel_alloc(int index, struct pwm_channel *ch)
2256 + unsigned long flags;
2257 + int status = 0;
2258 +
2259 +- /* insist on PWM init, with this signal pinned out */
2260 +- if (!pwm || !(pwm->mask & 1 << index))
2261 ++ if (!pwm)
2262 ++ return -EPROBE_DEFER;
2263 ++
2264 ++ if (!(pwm->mask & 1 << index))
2265 + return -ENODEV;
2266 +
2267 + if (index < 0 || index >= PWM_NCHAN || !ch)
2268 +diff --git a/drivers/net/ethernet/chelsio/cxgb3/sge.c b/drivers/net/ethernet/chelsio/cxgb3/sge.c
2269 +index 9c89dc8..632b318 100644
2270 +--- a/drivers/net/ethernet/chelsio/cxgb3/sge.c
2271 ++++ b/drivers/net/ethernet/chelsio/cxgb3/sge.c
2272 +@@ -1599,7 +1599,8 @@ static void write_ofld_wr(struct adapter *adap, struct sk_buff *skb,
2273 + flits = skb_transport_offset(skb) / 8;
2274 + sgp = ndesc == 1 ? (struct sg_ent *)&d->flit[flits] : sgl;
2275 + sgl_flits = make_sgl(skb, sgp, skb_transport_header(skb),
2276 +- skb->tail - skb->transport_header,
2277 ++ skb_tail_pointer(skb) -
2278 ++ skb_transport_header(skb),
2279 + adap->pdev);
2280 + if (need_skb_unmap()) {
2281 + setup_deferred_unmapping(skb, adap->pdev, sgp, sgl_flits);
2282 +diff --git a/drivers/net/ethernet/mellanox/mlx4/cmd.c b/drivers/net/ethernet/mellanox/mlx4/cmd.c
2283 +index ea20182..bb11624 100644
2284 +--- a/drivers/net/ethernet/mellanox/mlx4/cmd.c
2285 ++++ b/drivers/net/ethernet/mellanox/mlx4/cmd.c
2286 +@@ -1691,7 +1691,7 @@ static void mlx4_master_deactivate_admin_state(struct mlx4_priv *priv, int slave
2287 + vp_oper->vlan_idx = NO_INDX;
2288 + }
2289 + if (NO_INDX != vp_oper->mac_idx) {
2290 +- __mlx4_unregister_mac(&priv->dev, port, vp_oper->mac_idx);
2291 ++ __mlx4_unregister_mac(&priv->dev, port, vp_oper->state.mac);
2292 + vp_oper->mac_idx = NO_INDX;
2293 + }
2294 + }
2295 +diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
2296 +index 9fbdfcd..bbc9cb8 100644
2297 +--- a/drivers/net/virtio_net.c
2298 ++++ b/drivers/net/virtio_net.c
2299 +@@ -1118,11 +1118,6 @@ static int virtnet_cpu_callback(struct notifier_block *nfb,
2300 + {
2301 + struct virtnet_info *vi = container_of(nfb, struct virtnet_info, nb);
2302 +
2303 +- mutex_lock(&vi->config_lock);
2304 +-
2305 +- if (!vi->config_enable)
2306 +- goto done;
2307 +-
2308 + switch(action & ~CPU_TASKS_FROZEN) {
2309 + case CPU_ONLINE:
2310 + case CPU_DOWN_FAILED:
2311 +@@ -1136,8 +1131,6 @@ static int virtnet_cpu_callback(struct notifier_block *nfb,
2312 + break;
2313 + }
2314 +
2315 +-done:
2316 +- mutex_unlock(&vi->config_lock);
2317 + return NOTIFY_OK;
2318 + }
2319 +
2320 +@@ -1699,6 +1692,8 @@ static int virtnet_freeze(struct virtio_device *vdev)
2321 + struct virtnet_info *vi = vdev->priv;
2322 + int i;
2323 +
2324 ++ unregister_hotcpu_notifier(&vi->nb);
2325 ++
2326 + /* Prevent config work handler from accessing the device */
2327 + mutex_lock(&vi->config_lock);
2328 + vi->config_enable = false;
2329 +@@ -1747,6 +1742,10 @@ static int virtnet_restore(struct virtio_device *vdev)
2330 + virtnet_set_queues(vi, vi->curr_queue_pairs);
2331 + rtnl_unlock();
2332 +
2333 ++ err = register_hotcpu_notifier(&vi->nb);
2334 ++ if (err)
2335 ++ return err;
2336 ++
2337 + return 0;
2338 + }
2339 + #endif
2340 +diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h
2341 +index 5715318..400fea1 100644
2342 +--- a/drivers/net/xen-netback/common.h
2343 ++++ b/drivers/net/xen-netback/common.h
2344 +@@ -163,6 +163,7 @@ struct xenvif {
2345 + unsigned long credit_usec;
2346 + unsigned long remaining_credit;
2347 + struct timer_list credit_timeout;
2348 ++ u64 credit_window_start;
2349 +
2350 + /* Statistics */
2351 + unsigned long rx_gso_checksum_fixup;
2352 +diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c
2353 +index 01bb854..459935a 100644
2354 +--- a/drivers/net/xen-netback/interface.c
2355 ++++ b/drivers/net/xen-netback/interface.c
2356 +@@ -312,8 +312,7 @@ struct xenvif *xenvif_alloc(struct device *parent, domid_t domid,
2357 + vif->credit_bytes = vif->remaining_credit = ~0UL;
2358 + vif->credit_usec = 0UL;
2359 + init_timer(&vif->credit_timeout);
2360 +- /* Initialize 'expires' now: it's used to track the credit window. */
2361 +- vif->credit_timeout.expires = jiffies;
2362 ++ vif->credit_window_start = get_jiffies_64();
2363 +
2364 + dev->netdev_ops = &xenvif_netdev_ops;
2365 + dev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO;
2366 +diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
2367 +index f3e591c..900da4b 100644
2368 +--- a/drivers/net/xen-netback/netback.c
2369 ++++ b/drivers/net/xen-netback/netback.c
2370 +@@ -1185,9 +1185,8 @@ out:
2371 +
2372 + static bool tx_credit_exceeded(struct xenvif *vif, unsigned size)
2373 + {
2374 +- unsigned long now = jiffies;
2375 +- unsigned long next_credit =
2376 +- vif->credit_timeout.expires +
2377 ++ u64 now = get_jiffies_64();
2378 ++ u64 next_credit = vif->credit_window_start +
2379 + msecs_to_jiffies(vif->credit_usec / 1000);
2380 +
2381 + /* Timer could already be pending in rare cases. */
2382 +@@ -1195,8 +1194,8 @@ static bool tx_credit_exceeded(struct xenvif *vif, unsigned size)
2383 + return true;
2384 +
2385 + /* Passed the point where we can replenish credit? */
2386 +- if (time_after_eq(now, next_credit)) {
2387 +- vif->credit_timeout.expires = now;
2388 ++ if (time_after_eq64(now, next_credit)) {
2389 ++ vif->credit_window_start = now;
2390 + tx_add_credit(vif);
2391 + }
2392 +
2393 +@@ -1208,6 +1207,7 @@ static bool tx_credit_exceeded(struct xenvif *vif, unsigned size)
2394 + tx_credit_callback;
2395 + mod_timer(&vif->credit_timeout,
2396 + next_credit);
2397 ++ vif->credit_window_start = next_credit;
2398 +
2399 + return true;
2400 + }
2401 +diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
2402 +index d6a8d23..f20a044 100644
2403 +--- a/drivers/usb/core/hcd.c
2404 ++++ b/drivers/usb/core/hcd.c
2405 +@@ -1033,6 +1033,7 @@ static int register_root_hub(struct usb_hcd *hcd)
2406 + dev_name(&usb_dev->dev), retval);
2407 + return retval;
2408 + }
2409 ++ usb_dev->lpm_capable = usb_device_supports_lpm(usb_dev);
2410 + }
2411 +
2412 + retval = usb_new_device (usb_dev);
2413 +diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
2414 +index e6b682c..879651c 100644
2415 +--- a/drivers/usb/core/hub.c
2416 ++++ b/drivers/usb/core/hub.c
2417 +@@ -135,7 +135,7 @@ struct usb_hub *usb_hub_to_struct_hub(struct usb_device *hdev)
2418 + return usb_get_intfdata(hdev->actconfig->interface[0]);
2419 + }
2420 +
2421 +-static int usb_device_supports_lpm(struct usb_device *udev)
2422 ++int usb_device_supports_lpm(struct usb_device *udev)
2423 + {
2424 + /* USB 2.1 (and greater) devices indicate LPM support through
2425 + * their USB 2.0 Extended Capabilities BOS descriptor.
2426 +@@ -156,6 +156,11 @@ static int usb_device_supports_lpm(struct usb_device *udev)
2427 + "Power management will be impacted.\n");
2428 + return 0;
2429 + }
2430 ++
2431 ++ /* udev is root hub */
2432 ++ if (!udev->parent)
2433 ++ return 1;
2434 ++
2435 + if (udev->parent->lpm_capable)
2436 + return 1;
2437 +
2438 +diff --git a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h
2439 +index 8238577..c493836 100644
2440 +--- a/drivers/usb/core/usb.h
2441 ++++ b/drivers/usb/core/usb.h
2442 +@@ -35,6 +35,7 @@ extern int usb_get_device_descriptor(struct usb_device *dev,
2443 + unsigned int size);
2444 + extern int usb_get_bos_descriptor(struct usb_device *dev);
2445 + extern void usb_release_bos_descriptor(struct usb_device *dev);
2446 ++extern int usb_device_supports_lpm(struct usb_device *udev);
2447 + extern char *usb_cache_string(struct usb_device *udev, int index);
2448 + extern int usb_set_configuration(struct usb_device *dev, int configuration);
2449 + extern int usb_choose_configuration(struct usb_device *udev);
2450 +diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
2451 +index acaee06..c3d9485 100644
2452 +--- a/drivers/usb/serial/option.c
2453 ++++ b/drivers/usb/serial/option.c
2454 +@@ -1376,6 +1376,23 @@ static const struct usb_device_id option_ids[] = {
2455 + .driver_info = (kernel_ulong_t)&net_intf2_blacklist },
2456 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1426, 0xff, 0xff, 0xff), /* ZTE MF91 */
2457 + .driver_info = (kernel_ulong_t)&net_intf2_blacklist },
2458 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1533, 0xff, 0xff, 0xff) },
2459 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1534, 0xff, 0xff, 0xff) },
2460 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1535, 0xff, 0xff, 0xff) },
2461 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1545, 0xff, 0xff, 0xff) },
2462 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1546, 0xff, 0xff, 0xff) },
2463 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1547, 0xff, 0xff, 0xff) },
2464 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1565, 0xff, 0xff, 0xff) },
2465 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1566, 0xff, 0xff, 0xff) },
2466 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1567, 0xff, 0xff, 0xff) },
2467 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1589, 0xff, 0xff, 0xff) },
2468 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1590, 0xff, 0xff, 0xff) },
2469 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1591, 0xff, 0xff, 0xff) },
2470 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1592, 0xff, 0xff, 0xff) },
2471 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1594, 0xff, 0xff, 0xff) },
2472 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1596, 0xff, 0xff, 0xff) },
2473 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1598, 0xff, 0xff, 0xff) },
2474 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1600, 0xff, 0xff, 0xff) },
2475 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2002, 0xff,
2476 + 0xff, 0xff), .driver_info = (kernel_ulong_t)&zte_k3765_z_blacklist },
2477 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2003, 0xff, 0xff, 0xff) },
2478 +diff --git a/drivers/video/backlight/atmel-pwm-bl.c b/drivers/video/backlight/atmel-pwm-bl.c
2479 +index 0393d82..f7447f7 100644
2480 +--- a/drivers/video/backlight/atmel-pwm-bl.c
2481 ++++ b/drivers/video/backlight/atmel-pwm-bl.c
2482 +@@ -118,7 +118,7 @@ static const struct backlight_ops atmel_pwm_bl_ops = {
2483 + .update_status = atmel_pwm_bl_set_intensity,
2484 + };
2485 +
2486 +-static int __init atmel_pwm_bl_probe(struct platform_device *pdev)
2487 ++static int atmel_pwm_bl_probe(struct platform_device *pdev)
2488 + {
2489 + struct backlight_properties props;
2490 + const struct atmel_pwm_bl_platform_data *pdata;
2491 +@@ -202,7 +202,7 @@ err_free_mem:
2492 + return retval;
2493 + }
2494 +
2495 +-static int __exit atmel_pwm_bl_remove(struct platform_device *pdev)
2496 ++static int atmel_pwm_bl_remove(struct platform_device *pdev)
2497 + {
2498 + struct atmel_pwm_bl *pwmbl = platform_get_drvdata(pdev);
2499 +
2500 +@@ -220,10 +220,11 @@ static struct platform_driver atmel_pwm_bl_driver = {
2501 + .name = "atmel-pwm-bl",
2502 + },
2503 + /* REVISIT add suspend() and resume() */
2504 +- .remove = __exit_p(atmel_pwm_bl_remove),
2505 ++ .probe = atmel_pwm_bl_probe,
2506 ++ .remove = atmel_pwm_bl_remove,
2507 + };
2508 +
2509 +-module_platform_driver_probe(atmel_pwm_bl_driver, atmel_pwm_bl_probe);
2510 ++module_platform_driver(atmel_pwm_bl_driver);
2511 +
2512 + MODULE_AUTHOR("Hans-Christian egtvedt <hans-christian.egtvedt@×××××.com>");
2513 + MODULE_DESCRIPTION("Atmel PWM backlight driver");
2514 +diff --git a/drivers/video/hyperv_fb.c b/drivers/video/hyperv_fb.c
2515 +index 8ac99b8..8d456dc 100644
2516 +--- a/drivers/video/hyperv_fb.c
2517 ++++ b/drivers/video/hyperv_fb.c
2518 +@@ -795,12 +795,21 @@ static int hvfb_remove(struct hv_device *hdev)
2519 + }
2520 +
2521 +
2522 ++static DEFINE_PCI_DEVICE_TABLE(pci_stub_id_table) = {
2523 ++ {
2524 ++ .vendor = PCI_VENDOR_ID_MICROSOFT,
2525 ++ .device = PCI_DEVICE_ID_HYPERV_VIDEO,
2526 ++ },
2527 ++ { /* end of list */ }
2528 ++};
2529 ++
2530 + static const struct hv_vmbus_device_id id_table[] = {
2531 + /* Synthetic Video Device GUID */
2532 + {HV_SYNTHVID_GUID},
2533 + {}
2534 + };
2535 +
2536 ++MODULE_DEVICE_TABLE(pci, pci_stub_id_table);
2537 + MODULE_DEVICE_TABLE(vmbus, id_table);
2538 +
2539 + static struct hv_driver hvfb_drv = {
2540 +@@ -810,14 +819,43 @@ static struct hv_driver hvfb_drv = {
2541 + .remove = hvfb_remove,
2542 + };
2543 +
2544 ++static int hvfb_pci_stub_probe(struct pci_dev *pdev,
2545 ++ const struct pci_device_id *ent)
2546 ++{
2547 ++ return 0;
2548 ++}
2549 ++
2550 ++static void hvfb_pci_stub_remove(struct pci_dev *pdev)
2551 ++{
2552 ++}
2553 ++
2554 ++static struct pci_driver hvfb_pci_stub_driver = {
2555 ++ .name = KBUILD_MODNAME,
2556 ++ .id_table = pci_stub_id_table,
2557 ++ .probe = hvfb_pci_stub_probe,
2558 ++ .remove = hvfb_pci_stub_remove,
2559 ++};
2560 +
2561 + static int __init hvfb_drv_init(void)
2562 + {
2563 +- return vmbus_driver_register(&hvfb_drv);
2564 ++ int ret;
2565 ++
2566 ++ ret = vmbus_driver_register(&hvfb_drv);
2567 ++ if (ret != 0)
2568 ++ return ret;
2569 ++
2570 ++ ret = pci_register_driver(&hvfb_pci_stub_driver);
2571 ++ if (ret != 0) {
2572 ++ vmbus_driver_unregister(&hvfb_drv);
2573 ++ return ret;
2574 ++ }
2575 ++
2576 ++ return 0;
2577 + }
2578 +
2579 + static void __exit hvfb_drv_exit(void)
2580 + {
2581 ++ pci_unregister_driver(&hvfb_pci_stub_driver);
2582 + vmbus_driver_unregister(&hvfb_drv);
2583 + }
2584 +
2585 +diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
2586 +index 48ec25a..5e661a9 100644
2587 +--- a/include/net/ip6_fib.h
2588 ++++ b/include/net/ip6_fib.h
2589 +@@ -165,6 +165,7 @@ static inline struct inet6_dev *ip6_dst_idev(struct dst_entry *dst)
2590 + static inline void rt6_clean_expires(struct rt6_info *rt)
2591 + {
2592 + rt->rt6i_flags &= ~RTF_EXPIRES;
2593 ++ rt->dst.expires = 0;
2594 + }
2595 +
2596 + static inline void rt6_set_expires(struct rt6_info *rt, unsigned long expires)
2597 +diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
2598 +index 7974ba2..b778e96 100644
2599 +--- a/kernel/trace/trace.c
2600 ++++ b/kernel/trace/trace.c
2601 +@@ -843,9 +843,12 @@ int trace_get_user(struct trace_parser *parser, const char __user *ubuf,
2602 + if (isspace(ch)) {
2603 + parser->buffer[parser->idx] = 0;
2604 + parser->cont = false;
2605 +- } else {
2606 ++ } else if (parser->idx < parser->size - 1) {
2607 + parser->cont = true;
2608 + parser->buffer[parser->idx++] = ch;
2609 ++ } else {
2610 ++ ret = -EINVAL;
2611 ++ goto out;
2612 + }
2613 +
2614 + *ppos += read;
2615 +diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
2616 +index 8d7d0dd..143b6fd 100644
2617 +--- a/net/core/flow_dissector.c
2618 ++++ b/net/core/flow_dissector.c
2619 +@@ -40,7 +40,7 @@ again:
2620 + struct iphdr _iph;
2621 + ip:
2622 + iph = skb_header_pointer(skb, nhoff, sizeof(_iph), &_iph);
2623 +- if (!iph)
2624 ++ if (!iph || iph->ihl < 5)
2625 + return false;
2626 +
2627 + if (ip_is_fragment(iph))
2628 +diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
2629 +index a16b01b..068c8fb 100644
2630 +--- a/net/ipv4/tcp_input.c
2631 ++++ b/net/ipv4/tcp_input.c
2632 +@@ -2856,7 +2856,8 @@ static inline bool tcp_ack_update_rtt(struct sock *sk, const int flag,
2633 + * left edge of the send window.
2634 + * See draft-ietf-tcplw-high-performance-00, section 3.3.
2635 + */
2636 +- if (seq_rtt < 0 && tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr)
2637 ++ if (seq_rtt < 0 && tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr &&
2638 ++ flag & FLAG_ACKED)
2639 + seq_rtt = tcp_time_stamp - tp->rx_opt.rcv_tsecr;
2640 +
2641 + if (seq_rtt < 0)
2642 +@@ -2871,14 +2872,19 @@ static inline bool tcp_ack_update_rtt(struct sock *sk, const int flag,
2643 + }
2644 +
2645 + /* Compute time elapsed between (last) SYNACK and the ACK completing 3WHS. */
2646 +-static void tcp_synack_rtt_meas(struct sock *sk, struct request_sock *req)
2647 ++static void tcp_synack_rtt_meas(struct sock *sk, const u32 synack_stamp)
2648 + {
2649 + struct tcp_sock *tp = tcp_sk(sk);
2650 + s32 seq_rtt = -1;
2651 +
2652 +- if (tp->lsndtime && !tp->total_retrans)
2653 +- seq_rtt = tcp_time_stamp - tp->lsndtime;
2654 +- tcp_ack_update_rtt(sk, FLAG_SYN_ACKED, seq_rtt, -1);
2655 ++ if (synack_stamp && !tp->total_retrans)
2656 ++ seq_rtt = tcp_time_stamp - synack_stamp;
2657 ++
2658 ++ /* If the ACK acks both the SYNACK and the (Fast Open'd) data packets
2659 ++ * sent in SYN_RECV, SYNACK RTT is the smooth RTT computed in tcp_ack()
2660 ++ */
2661 ++ if (!tp->srtt)
2662 ++ tcp_ack_update_rtt(sk, FLAG_SYN_ACKED, seq_rtt, -1);
2663 + }
2664 +
2665 + static void tcp_cong_avoid(struct sock *sk, u32 ack, u32 in_flight)
2666 +@@ -2981,6 +2987,7 @@ static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets,
2667 + s32 seq_rtt = -1;
2668 + s32 ca_seq_rtt = -1;
2669 + ktime_t last_ackt = net_invalid_timestamp();
2670 ++ bool rtt_update;
2671 +
2672 + while ((skb = tcp_write_queue_head(sk)) && skb != tcp_send_head(sk)) {
2673 + struct tcp_skb_cb *scb = TCP_SKB_CB(skb);
2674 +@@ -3057,14 +3064,13 @@ static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets,
2675 + if (skb && (TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED))
2676 + flag |= FLAG_SACK_RENEGING;
2677 +
2678 +- if (tcp_ack_update_rtt(sk, flag, seq_rtt, sack_rtt) ||
2679 +- (flag & FLAG_ACKED))
2680 +- tcp_rearm_rto(sk);
2681 ++ rtt_update = tcp_ack_update_rtt(sk, flag, seq_rtt, sack_rtt);
2682 +
2683 + if (flag & FLAG_ACKED) {
2684 + const struct tcp_congestion_ops *ca_ops
2685 + = inet_csk(sk)->icsk_ca_ops;
2686 +
2687 ++ tcp_rearm_rto(sk);
2688 + if (unlikely(icsk->icsk_mtup.probe_size &&
2689 + !after(tp->mtu_probe.probe_seq_end, tp->snd_una))) {
2690 + tcp_mtup_probe_success(sk);
2691 +@@ -3103,6 +3109,13 @@ static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets,
2692 +
2693 + ca_ops->pkts_acked(sk, pkts_acked, rtt_us);
2694 + }
2695 ++ } else if (skb && rtt_update && sack_rtt >= 0 &&
2696 ++ sack_rtt > (s32)(now - TCP_SKB_CB(skb)->when)) {
2697 ++ /* Do not re-arm RTO if the sack RTT is measured from data sent
2698 ++ * after when the head was last (re)transmitted. Otherwise the
2699 ++ * timeout may continue to extend in loss recovery.
2700 ++ */
2701 ++ tcp_rearm_rto(sk);
2702 + }
2703 +
2704 + #if FASTRETRANS_DEBUG > 0
2705 +@@ -5587,6 +5600,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
2706 + struct request_sock *req;
2707 + int queued = 0;
2708 + bool acceptable;
2709 ++ u32 synack_stamp;
2710 +
2711 + tp->rx_opt.saw_tstamp = 0;
2712 +
2713 +@@ -5669,9 +5683,11 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
2714 + * so release it.
2715 + */
2716 + if (req) {
2717 ++ synack_stamp = tcp_rsk(req)->snt_synack;
2718 + tp->total_retrans = req->num_retrans;
2719 + reqsk_fastopen_remove(sk, req, false);
2720 + } else {
2721 ++ synack_stamp = tp->lsndtime;
2722 + /* Make sure socket is routed, for correct metrics. */
2723 + icsk->icsk_af_ops->rebuild_header(sk);
2724 + tcp_init_congestion_control(sk);
2725 +@@ -5694,7 +5710,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
2726 + tp->snd_una = TCP_SKB_CB(skb)->ack_seq;
2727 + tp->snd_wnd = ntohs(th->window) << tp->rx_opt.snd_wscale;
2728 + tcp_init_wl(tp, TCP_SKB_CB(skb)->seq);
2729 +- tcp_synack_rtt_meas(sk, req);
2730 ++ tcp_synack_rtt_meas(sk, synack_stamp);
2731 +
2732 + if (tp->rx_opt.tstamp_ok)
2733 + tp->advmss -= TCPOLEN_TSTAMP_ALIGNED;
2734 +diff --git a/net/ipv4/tcp_offload.c b/net/ipv4/tcp_offload.c
2735 +index 3a7525e..533c58a 100644
2736 +--- a/net/ipv4/tcp_offload.c
2737 ++++ b/net/ipv4/tcp_offload.c
2738 +@@ -18,6 +18,7 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb,
2739 + netdev_features_t features)
2740 + {
2741 + struct sk_buff *segs = ERR_PTR(-EINVAL);
2742 ++ unsigned int sum_truesize = 0;
2743 + struct tcphdr *th;
2744 + unsigned int thlen;
2745 + unsigned int seq;
2746 +@@ -102,13 +103,7 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb,
2747 + if (copy_destructor) {
2748 + skb->destructor = gso_skb->destructor;
2749 + skb->sk = gso_skb->sk;
2750 +- /* {tcp|sock}_wfree() use exact truesize accounting :
2751 +- * sum(skb->truesize) MUST be exactly be gso_skb->truesize
2752 +- * So we account mss bytes of 'true size' for each segment.
2753 +- * The last segment will contain the remaining.
2754 +- */
2755 +- skb->truesize = mss;
2756 +- gso_skb->truesize -= mss;
2757 ++ sum_truesize += skb->truesize;
2758 + }
2759 + skb = skb->next;
2760 + th = tcp_hdr(skb);
2761 +@@ -125,7 +120,9 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb,
2762 + if (copy_destructor) {
2763 + swap(gso_skb->sk, skb->sk);
2764 + swap(gso_skb->destructor, skb->destructor);
2765 +- swap(gso_skb->truesize, skb->truesize);
2766 ++ sum_truesize += skb->truesize;
2767 ++ atomic_add(sum_truesize - gso_skb->truesize,
2768 ++ &skb->sk->sk_wmem_alloc);
2769 + }
2770 +
2771 + delta = htonl(oldlen + (skb_tail_pointer(skb) -
2772 +diff --git a/net/ipv6/route.c b/net/ipv6/route.c
2773 +index f54e3a1..04e17b3 100644
2774 +--- a/net/ipv6/route.c
2775 ++++ b/net/ipv6/route.c
2776 +@@ -1087,10 +1087,13 @@ static struct dst_entry *ip6_dst_check(struct dst_entry *dst, u32 cookie)
2777 + if (rt->rt6i_genid != rt_genid_ipv6(dev_net(rt->dst.dev)))
2778 + return NULL;
2779 +
2780 +- if (rt->rt6i_node && (rt->rt6i_node->fn_sernum == cookie))
2781 +- return dst;
2782 ++ if (!rt->rt6i_node || (rt->rt6i_node->fn_sernum != cookie))
2783 ++ return NULL;
2784 +
2785 +- return NULL;
2786 ++ if (rt6_check_expired(rt))
2787 ++ return NULL;
2788 ++
2789 ++ return dst;
2790 + }
2791 +
2792 + static struct dst_entry *ip6_negative_advice(struct dst_entry *dst)
2793 +diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c
2794 +index 666c668..1a6eef3 100644
2795 +--- a/net/sctp/sm_sideeffect.c
2796 ++++ b/net/sctp/sm_sideeffect.c
2797 +@@ -860,7 +860,6 @@ static void sctp_cmd_delete_tcb(sctp_cmd_seq_t *cmds,
2798 + (!asoc->temp) && (sk->sk_shutdown != SHUTDOWN_MASK))
2799 + return;
2800 +
2801 +- BUG_ON(asoc->peer.primary_path == NULL);
2802 + sctp_unhash_established(asoc);
2803 + sctp_association_free(asoc);
2804 + }
2805 +diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
2806 +index 50173d4..8d2d01b 100644
2807 +--- a/sound/pci/hda/patch_hdmi.c
2808 ++++ b/sound/pci/hda/patch_hdmi.c
2809 +@@ -740,9 +740,10 @@ static int hdmi_manual_setup_channel_mapping(struct hda_codec *codec,
2810 + static void hdmi_setup_fake_chmap(unsigned char *map, int ca)
2811 + {
2812 + int i;
2813 ++ int ordered_ca = get_channel_allocation_order(ca);
2814 + for (i = 0; i < 8; i++) {
2815 +- if (i < channel_allocations[ca].channels)
2816 +- map[i] = from_cea_slot((hdmi_channel_mapping[ca][i] >> 4) & 0x0f);
2817 ++ if (i < channel_allocations[ordered_ca].channels)
2818 ++ map[i] = from_cea_slot(hdmi_channel_mapping[ca][i] & 0x0f);
2819 + else
2820 + map[i] = 0;
2821 + }
2822
2823 Modified: genpatches-2.6/trunk/3.4/0000_README
2824 ===================================================================
2825 --- genpatches-2.6/trunk/3.4/0000_README 2013-11-14 16:37:35 UTC (rev 2581)
2826 +++ genpatches-2.6/trunk/3.4/0000_README 2013-11-21 00:37:00 UTC (rev 2582)
2827 @@ -315,6 +315,10 @@
2828 From: http://www.kernel.org
2829 Desc: Linux 3.4.69
2830
2831 +Patch: 1069_linux-3.4.70.patch
2832 +From: http://www.kernel.org
2833 +Desc: Linux 3.4.70
2834 +
2835 Patch: 1500_XATTR_USER_PREFIX.patch
2836 From: https://bugs.gentoo.org/show_bug.cgi?id=470644
2837 Desc: Support for namespace user.pax.* on tmpfs.
2838
2839 Added: genpatches-2.6/trunk/3.4/1069_linux-3.4.70.patch
2840 ===================================================================
2841 --- genpatches-2.6/trunk/3.4/1069_linux-3.4.70.patch (rev 0)
2842 +++ genpatches-2.6/trunk/3.4/1069_linux-3.4.70.patch 2013-11-21 00:37:00 UTC (rev 2582)
2843 @@ -0,0 +1,424 @@
2844 +diff --git a/Makefile b/Makefile
2845 +index 2f9a0467..d7c0a383 100644
2846 +--- a/Makefile
2847 ++++ b/Makefile
2848 +@@ -1,6 +1,6 @@
2849 + VERSION = 3
2850 + PATCHLEVEL = 4
2851 +-SUBLEVEL = 69
2852 ++SUBLEVEL = 70
2853 + EXTRAVERSION =
2854 + NAME = Saber-toothed Squirrel
2855 +
2856 +diff --git a/arch/arm/lib/memset.S b/arch/arm/lib/memset.S
2857 +index 650d5923..94b0650e 100644
2858 +--- a/arch/arm/lib/memset.S
2859 ++++ b/arch/arm/lib/memset.S
2860 +@@ -14,27 +14,15 @@
2861 +
2862 + .text
2863 + .align 5
2864 +- .word 0
2865 +-
2866 +-1: subs r2, r2, #4 @ 1 do we have enough
2867 +- blt 5f @ 1 bytes to align with?
2868 +- cmp r3, #2 @ 1
2869 +- strltb r1, [r0], #1 @ 1
2870 +- strleb r1, [r0], #1 @ 1
2871 +- strb r1, [r0], #1 @ 1
2872 +- add r2, r2, r3 @ 1 (r2 = r2 - (4 - r3))
2873 +-/*
2874 +- * The pointer is now aligned and the length is adjusted. Try doing the
2875 +- * memset again.
2876 +- */
2877 +
2878 + ENTRY(memset)
2879 + ands r3, r0, #3 @ 1 unaligned?
2880 +- bne 1b @ 1
2881 ++ mov ip, r0 @ preserve r0 as return value
2882 ++ bne 6f @ 1
2883 + /*
2884 +- * we know that the pointer in r0 is aligned to a word boundary.
2885 ++ * we know that the pointer in ip is aligned to a word boundary.
2886 + */
2887 +- orr r1, r1, r1, lsl #8
2888 ++1: orr r1, r1, r1, lsl #8
2889 + orr r1, r1, r1, lsl #16
2890 + mov r3, r1
2891 + cmp r2, #16
2892 +@@ -43,29 +31,28 @@ ENTRY(memset)
2893 + #if ! CALGN(1)+0
2894 +
2895 + /*
2896 +- * We need an extra register for this loop - save the return address and
2897 +- * use the LR
2898 ++ * We need 2 extra registers for this loop - use r8 and the LR
2899 + */
2900 +- str lr, [sp, #-4]!
2901 +- mov ip, r1
2902 ++ stmfd sp!, {r8, lr}
2903 ++ mov r8, r1
2904 + mov lr, r1
2905 +
2906 + 2: subs r2, r2, #64
2907 +- stmgeia r0!, {r1, r3, ip, lr} @ 64 bytes at a time.
2908 +- stmgeia r0!, {r1, r3, ip, lr}
2909 +- stmgeia r0!, {r1, r3, ip, lr}
2910 +- stmgeia r0!, {r1, r3, ip, lr}
2911 ++ stmgeia ip!, {r1, r3, r8, lr} @ 64 bytes at a time.
2912 ++ stmgeia ip!, {r1, r3, r8, lr}
2913 ++ stmgeia ip!, {r1, r3, r8, lr}
2914 ++ stmgeia ip!, {r1, r3, r8, lr}
2915 + bgt 2b
2916 +- ldmeqfd sp!, {pc} @ Now <64 bytes to go.
2917 ++ ldmeqfd sp!, {r8, pc} @ Now <64 bytes to go.
2918 + /*
2919 + * No need to correct the count; we're only testing bits from now on
2920 + */
2921 + tst r2, #32
2922 +- stmneia r0!, {r1, r3, ip, lr}
2923 +- stmneia r0!, {r1, r3, ip, lr}
2924 ++ stmneia ip!, {r1, r3, r8, lr}
2925 ++ stmneia ip!, {r1, r3, r8, lr}
2926 + tst r2, #16
2927 +- stmneia r0!, {r1, r3, ip, lr}
2928 +- ldr lr, [sp], #4
2929 ++ stmneia ip!, {r1, r3, r8, lr}
2930 ++ ldmfd sp!, {r8, lr}
2931 +
2932 + #else
2933 +
2934 +@@ -74,54 +61,63 @@ ENTRY(memset)
2935 + * whole cache lines at once.
2936 + */
2937 +
2938 +- stmfd sp!, {r4-r7, lr}
2939 ++ stmfd sp!, {r4-r8, lr}
2940 + mov r4, r1
2941 + mov r5, r1
2942 + mov r6, r1
2943 + mov r7, r1
2944 +- mov ip, r1
2945 ++ mov r8, r1
2946 + mov lr, r1
2947 +
2948 + cmp r2, #96
2949 +- tstgt r0, #31
2950 ++ tstgt ip, #31
2951 + ble 3f
2952 +
2953 +- and ip, r0, #31
2954 +- rsb ip, ip, #32
2955 +- sub r2, r2, ip
2956 +- movs ip, ip, lsl #(32 - 4)
2957 +- stmcsia r0!, {r4, r5, r6, r7}
2958 +- stmmiia r0!, {r4, r5}
2959 +- tst ip, #(1 << 30)
2960 +- mov ip, r1
2961 +- strne r1, [r0], #4
2962 ++ and r8, ip, #31
2963 ++ rsb r8, r8, #32
2964 ++ sub r2, r2, r8
2965 ++ movs r8, r8, lsl #(32 - 4)
2966 ++ stmcsia ip!, {r4, r5, r6, r7}
2967 ++ stmmiia ip!, {r4, r5}
2968 ++ tst r8, #(1 << 30)
2969 ++ mov r8, r1
2970 ++ strne r1, [ip], #4
2971 +
2972 + 3: subs r2, r2, #64
2973 +- stmgeia r0!, {r1, r3-r7, ip, lr}
2974 +- stmgeia r0!, {r1, r3-r7, ip, lr}
2975 ++ stmgeia ip!, {r1, r3-r8, lr}
2976 ++ stmgeia ip!, {r1, r3-r8, lr}
2977 + bgt 3b
2978 +- ldmeqfd sp!, {r4-r7, pc}
2979 ++ ldmeqfd sp!, {r4-r8, pc}
2980 +
2981 + tst r2, #32
2982 +- stmneia r0!, {r1, r3-r7, ip, lr}
2983 ++ stmneia ip!, {r1, r3-r8, lr}
2984 + tst r2, #16
2985 +- stmneia r0!, {r4-r7}
2986 +- ldmfd sp!, {r4-r7, lr}
2987 ++ stmneia ip!, {r4-r7}
2988 ++ ldmfd sp!, {r4-r8, lr}
2989 +
2990 + #endif
2991 +
2992 + 4: tst r2, #8
2993 +- stmneia r0!, {r1, r3}
2994 ++ stmneia ip!, {r1, r3}
2995 + tst r2, #4
2996 +- strne r1, [r0], #4
2997 ++ strne r1, [ip], #4
2998 + /*
2999 + * When we get here, we've got less than 4 bytes to zero. We
3000 + * may have an unaligned pointer as well.
3001 + */
3002 + 5: tst r2, #2
3003 +- strneb r1, [r0], #1
3004 +- strneb r1, [r0], #1
3005 ++ strneb r1, [ip], #1
3006 ++ strneb r1, [ip], #1
3007 + tst r2, #1
3008 +- strneb r1, [r0], #1
3009 ++ strneb r1, [ip], #1
3010 + mov pc, lr
3011 ++
3012 ++6: subs r2, r2, #4 @ 1 do we have enough
3013 ++ blt 5b @ 1 bytes to align with?
3014 ++ cmp r3, #2 @ 1
3015 ++ strltb r1, [ip], #1 @ 1
3016 ++ strleb r1, [ip], #1 @ 1
3017 ++ strb r1, [ip], #1 @ 1
3018 ++ add r2, r2, r3 @ 1 (r2 = r2 - (4 - r3))
3019 ++ b 1b
3020 + ENDPROC(memset)
3021 +diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h
3022 +index 9d7f1723..093bf0a2 100644
3023 +--- a/drivers/net/xen-netback/common.h
3024 ++++ b/drivers/net/xen-netback/common.h
3025 +@@ -88,6 +88,7 @@ struct xenvif {
3026 + unsigned long credit_usec;
3027 + unsigned long remaining_credit;
3028 + struct timer_list credit_timeout;
3029 ++ u64 credit_window_start;
3030 +
3031 + /* Statistics */
3032 + unsigned long rx_gso_checksum_fixup;
3033 +diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c
3034 +index 221f4265..cfaaf685 100644
3035 +--- a/drivers/net/xen-netback/interface.c
3036 ++++ b/drivers/net/xen-netback/interface.c
3037 +@@ -273,8 +273,7 @@ struct xenvif *xenvif_alloc(struct device *parent, domid_t domid,
3038 + vif->credit_bytes = vif->remaining_credit = ~0UL;
3039 + vif->credit_usec = 0UL;
3040 + init_timer(&vif->credit_timeout);
3041 +- /* Initialize 'expires' now: it's used to track the credit window. */
3042 +- vif->credit_timeout.expires = jiffies;
3043 ++ vif->credit_window_start = get_jiffies_64();
3044 +
3045 + dev->netdev_ops = &xenvif_netdev_ops;
3046 + dev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO;
3047 +diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
3048 +index 0d22cff0..d8ffbf84 100644
3049 +--- a/drivers/net/xen-netback/netback.c
3050 ++++ b/drivers/net/xen-netback/netback.c
3051 +@@ -1197,9 +1197,8 @@ out:
3052 +
3053 + static bool tx_credit_exceeded(struct xenvif *vif, unsigned size)
3054 + {
3055 +- unsigned long now = jiffies;
3056 +- unsigned long next_credit =
3057 +- vif->credit_timeout.expires +
3058 ++ u64 now = get_jiffies_64();
3059 ++ u64 next_credit = vif->credit_window_start +
3060 + msecs_to_jiffies(vif->credit_usec / 1000);
3061 +
3062 + /* Timer could already be pending in rare cases. */
3063 +@@ -1207,8 +1206,8 @@ static bool tx_credit_exceeded(struct xenvif *vif, unsigned size)
3064 + return true;
3065 +
3066 + /* Passed the point where we can replenish credit? */
3067 +- if (time_after_eq(now, next_credit)) {
3068 +- vif->credit_timeout.expires = now;
3069 ++ if (time_after_eq64(now, next_credit)) {
3070 ++ vif->credit_window_start = now;
3071 + tx_add_credit(vif);
3072 + }
3073 +
3074 +@@ -1220,6 +1219,7 @@ static bool tx_credit_exceeded(struct xenvif *vif, unsigned size)
3075 + tx_credit_callback;
3076 + mod_timer(&vif->credit_timeout,
3077 + next_credit);
3078 ++ vif->credit_window_start = next_credit;
3079 +
3080 + return true;
3081 + }
3082 +diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
3083 +index 54fc9880..21b9ed1d 100644
3084 +--- a/drivers/pci/pci-driver.c
3085 ++++ b/drivers/pci/pci-driver.c
3086 +@@ -680,6 +680,7 @@ static int pci_pm_suspend(struct device *dev)
3087 + goto Fixup;
3088 + }
3089 +
3090 ++ pci_dev->state_saved = false;
3091 + if (pm->suspend) {
3092 + pci_power_t prev = pci_dev->current_state;
3093 + int error;
3094 +@@ -826,6 +827,7 @@ static int pci_pm_freeze(struct device *dev)
3095 + return 0;
3096 + }
3097 +
3098 ++ pci_dev->state_saved = false;
3099 + if (pm->freeze) {
3100 + int error;
3101 +
3102 +@@ -914,6 +916,7 @@ static int pci_pm_poweroff(struct device *dev)
3103 + goto Fixup;
3104 + }
3105 +
3106 ++ pci_dev->state_saved = false;
3107 + if (pm->poweroff) {
3108 + int error;
3109 +
3110 +@@ -1032,6 +1035,7 @@ static int pci_pm_runtime_suspend(struct device *dev)
3111 + if (!pm || !pm->runtime_suspend)
3112 + return -ENOSYS;
3113 +
3114 ++ pci_dev->state_saved = false;
3115 + error = pm->runtime_suspend(dev);
3116 + suspend_report_result(pm->runtime_suspend, error);
3117 + if (error)
3118 +diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c
3119 +index eea85daf..be76ebac 100644
3120 +--- a/drivers/pci/setup-res.c
3121 ++++ b/drivers/pci/setup-res.c
3122 +@@ -206,7 +206,8 @@ static int pci_revert_fw_address(struct resource *res, struct pci_dev *dev,
3123 + return ret;
3124 + }
3125 +
3126 +-static int _pci_assign_resource(struct pci_dev *dev, int resno, int size, resource_size_t min_align)
3127 ++static int _pci_assign_resource(struct pci_dev *dev, int resno,
3128 ++ resource_size_t size, resource_size_t min_align)
3129 + {
3130 + struct resource *res = dev->resource + resno;
3131 + struct pci_bus *bus;
3132 +diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
3133 +index aa54fad7..82fce32c 100644
3134 +--- a/drivers/usb/core/hub.c
3135 ++++ b/drivers/usb/core/hub.c
3136 +@@ -1335,6 +1335,7 @@ static int hub_configure(struct usb_hub *hub,
3137 + return 0;
3138 +
3139 + fail:
3140 ++ hdev->maxchild = 0;
3141 + dev_err (hub_dev, "config failed, %s (err %d)\n",
3142 + message, ret);
3143 + /* hub_disconnect() frees urb and descriptor */
3144 +diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
3145 +index 57277bcc..a5477554 100644
3146 +--- a/drivers/usb/serial/option.c
3147 ++++ b/drivers/usb/serial/option.c
3148 +@@ -1391,6 +1391,23 @@ static const struct usb_device_id option_ids[] = {
3149 + .driver_info = (kernel_ulong_t)&net_intf2_blacklist },
3150 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1426, 0xff, 0xff, 0xff), /* ZTE MF91 */
3151 + .driver_info = (kernel_ulong_t)&net_intf2_blacklist },
3152 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1533, 0xff, 0xff, 0xff) },
3153 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1534, 0xff, 0xff, 0xff) },
3154 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1535, 0xff, 0xff, 0xff) },
3155 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1545, 0xff, 0xff, 0xff) },
3156 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1546, 0xff, 0xff, 0xff) },
3157 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1547, 0xff, 0xff, 0xff) },
3158 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1565, 0xff, 0xff, 0xff) },
3159 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1566, 0xff, 0xff, 0xff) },
3160 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1567, 0xff, 0xff, 0xff) },
3161 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1589, 0xff, 0xff, 0xff) },
3162 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1590, 0xff, 0xff, 0xff) },
3163 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1591, 0xff, 0xff, 0xff) },
3164 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1592, 0xff, 0xff, 0xff) },
3165 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1594, 0xff, 0xff, 0xff) },
3166 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1596, 0xff, 0xff, 0xff) },
3167 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1598, 0xff, 0xff, 0xff) },
3168 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1600, 0xff, 0xff, 0xff) },
3169 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2002, 0xff,
3170 + 0xff, 0xff), .driver_info = (kernel_ulong_t)&zte_k3765_z_blacklist },
3171 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2003, 0xff, 0xff, 0xff) },
3172 +diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
3173 +index 5dd96266..022940f0 100644
3174 +--- a/kernel/trace/trace.c
3175 ++++ b/kernel/trace/trace.c
3176 +@@ -590,9 +590,12 @@ int trace_get_user(struct trace_parser *parser, const char __user *ubuf,
3177 + if (isspace(ch)) {
3178 + parser->buffer[parser->idx] = 0;
3179 + parser->cont = false;
3180 +- } else {
3181 ++ } else if (parser->idx < parser->size - 1) {
3182 + parser->cont = true;
3183 + parser->buffer[parser->idx++] = ch;
3184 ++ } else {
3185 ++ ret = -EINVAL;
3186 ++ goto out;
3187 + }
3188 +
3189 + *ppos += read;
3190 +diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
3191 +index 27747881..200707c6 100644
3192 +--- a/net/core/flow_dissector.c
3193 ++++ b/net/core/flow_dissector.c
3194 +@@ -35,7 +35,7 @@ again:
3195 + struct iphdr _iph;
3196 + ip:
3197 + iph = skb_header_pointer(skb, nhoff, sizeof(_iph), &_iph);
3198 +- if (!iph)
3199 ++ if (!iph || iph->ihl < 5)
3200 + return false;
3201 +
3202 + if (ip_is_fragment(iph))
3203 +diff --git a/net/netfilter/nf_conntrack_sip.c b/net/netfilter/nf_conntrack_sip.c
3204 +index 93faf6a3..4a8c55bd 100644
3205 +--- a/net/netfilter/nf_conntrack_sip.c
3206 ++++ b/net/netfilter/nf_conntrack_sip.c
3207 +@@ -1468,7 +1468,7 @@ static int sip_help_tcp(struct sk_buff *skb, unsigned int protoff,
3208 +
3209 + msglen = origlen = end - dptr;
3210 + if (msglen > datalen)
3211 +- return NF_DROP;
3212 ++ return NF_ACCEPT;
3213 +
3214 + ret = process_sip_msg(skb, ct, dataoff, &dptr, &msglen);
3215 + if (ret != NF_ACCEPT)
3216 +diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
3217 +index 02a6e3f4..ef917bf2 100644
3218 +--- a/sound/pci/hda/patch_hdmi.c
3219 ++++ b/sound/pci/hda/patch_hdmi.c
3220 +@@ -1282,23 +1282,34 @@ static int generic_hdmi_build_controls(struct hda_codec *codec)
3221 + return 0;
3222 + }
3223 +
3224 +-static int generic_hdmi_init(struct hda_codec *codec)
3225 ++static int generic_hdmi_init_per_pins(struct hda_codec *codec)
3226 + {
3227 + struct hdmi_spec *spec = codec->spec;
3228 + int pin_idx;
3229 +
3230 + for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) {
3231 + struct hdmi_spec_per_pin *per_pin = &spec->pins[pin_idx];
3232 +- hda_nid_t pin_nid = per_pin->pin_nid;
3233 + struct hdmi_eld *eld = &per_pin->sink_eld;
3234 +
3235 +- hdmi_init_pin(codec, pin_nid);
3236 +- snd_hda_jack_detect_enable(codec, pin_nid, pin_nid);
3237 +-
3238 + per_pin->codec = codec;
3239 + INIT_DELAYED_WORK(&per_pin->work, hdmi_repoll_eld);
3240 + snd_hda_eld_proc_new(codec, eld, pin_idx);
3241 + }
3242 ++ return 0;
3243 ++}
3244 ++
3245 ++static int generic_hdmi_init(struct hda_codec *codec)
3246 ++{
3247 ++ struct hdmi_spec *spec = codec->spec;
3248 ++ int pin_idx;
3249 ++
3250 ++ for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) {
3251 ++ struct hdmi_spec_per_pin *per_pin = &spec->pins[pin_idx];
3252 ++ hda_nid_t pin_nid = per_pin->pin_nid;
3253 ++
3254 ++ hdmi_init_pin(codec, pin_nid);
3255 ++ snd_hda_jack_detect_enable(codec, pin_nid, pin_nid);
3256 ++ }
3257 + snd_hda_jack_report_sync(codec);
3258 + return 0;
3259 + }
3260 +@@ -1343,6 +1354,7 @@ static int patch_generic_hdmi(struct hda_codec *codec)
3261 + return -EINVAL;
3262 + }
3263 + codec->patch_ops = generic_hdmi_patch_ops;
3264 ++ generic_hdmi_init_per_pins(codec);
3265 +
3266 + init_channel_allocations();
3267 +