1 |
commit: d0dbe5f09387abf0f110e5369e17cf8301c8a9fb |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Sep 28 09:17:57 2022 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Sep 28 09:17:57 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=d0dbe5f0 |
7 |
|
8 |
Linux patch 4.19.260 |
9 |
|
10 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1259_linux-4.19.260.patch | 1271 +++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 1275 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index e00dbd74..6bbe74fa 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -1079,6 +1079,10 @@ Patch: 1258_linux-4.19.259.patch |
21 |
From: https://www.kernel.org |
22 |
Desc: Linux 4.19.259 |
23 |
|
24 |
+Patch: 1259_linux-4.19.260.patch |
25 |
+From: https://www.kernel.org |
26 |
+Desc: Linux 4.19.260 |
27 |
+ |
28 |
Patch: 1500_XATTR_USER_PREFIX.patch |
29 |
From: https://bugs.gentoo.org/show_bug.cgi?id=470644 |
30 |
Desc: Support for namespace user.pax.* on tmpfs. |
31 |
|
32 |
diff --git a/1259_linux-4.19.260.patch b/1259_linux-4.19.260.patch |
33 |
new file mode 100644 |
34 |
index 00000000..b6d782ed |
35 |
--- /dev/null |
36 |
+++ b/1259_linux-4.19.260.patch |
37 |
@@ -0,0 +1,1271 @@ |
38 |
+diff --git a/Makefile b/Makefile |
39 |
+index 133683dfc7b89..61971754a74e8 100644 |
40 |
+--- a/Makefile |
41 |
++++ b/Makefile |
42 |
+@@ -1,7 +1,7 @@ |
43 |
+ # SPDX-License-Identifier: GPL-2.0 |
44 |
+ VERSION = 4 |
45 |
+ PATCHLEVEL = 19 |
46 |
+-SUBLEVEL = 259 |
47 |
++SUBLEVEL = 260 |
48 |
+ EXTRAVERSION = |
49 |
+ NAME = "People's Front" |
50 |
+ |
51 |
+diff --git a/arch/arm64/boot/dts/rockchip/rk3399-gru-chromebook.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-gru-chromebook.dtsi |
52 |
+index ff81dfda3b952..3ba927f303479 100644 |
53 |
+--- a/arch/arm64/boot/dts/rockchip/rk3399-gru-chromebook.dtsi |
54 |
++++ b/arch/arm64/boot/dts/rockchip/rk3399-gru-chromebook.dtsi |
55 |
+@@ -232,6 +232,14 @@ |
56 |
+ &edp { |
57 |
+ status = "okay"; |
58 |
+ |
59 |
++ /* |
60 |
++ * eDP PHY/clk don't sync reliably at anything other than 24 MHz. Only |
61 |
++ * set this here, because rk3399-gru.dtsi ensures we can generate this |
62 |
++ * off GPLL=600MHz, whereas some other RK3399 boards may not. |
63 |
++ */ |
64 |
++ assigned-clocks = <&cru PCLK_EDP>; |
65 |
++ assigned-clock-rates = <24000000>; |
66 |
++ |
67 |
+ ports { |
68 |
+ edp_out: port@1 { |
69 |
+ reg = <1>; |
70 |
+diff --git a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi |
71 |
+index ce1320e4c1060..6750b8100421c 100644 |
72 |
+--- a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi |
73 |
++++ b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi |
74 |
+@@ -102,7 +102,6 @@ |
75 |
+ vcc5v0_host: vcc5v0-host-regulator { |
76 |
+ compatible = "regulator-fixed"; |
77 |
+ gpio = <&gpio4 RK_PA3 GPIO_ACTIVE_LOW>; |
78 |
+- enable-active-low; |
79 |
+ pinctrl-names = "default"; |
80 |
+ pinctrl-0 = <&vcc5v0_host_en>; |
81 |
+ regulator-name = "vcc5v0_host"; |
82 |
+diff --git a/arch/mips/cavium-octeon/octeon-irq.c b/arch/mips/cavium-octeon/octeon-irq.c |
83 |
+index 43e4fc1b373ca..3e5cf5515c01f 100644 |
84 |
+--- a/arch/mips/cavium-octeon/octeon-irq.c |
85 |
++++ b/arch/mips/cavium-octeon/octeon-irq.c |
86 |
+@@ -127,6 +127,16 @@ static void octeon_irq_free_cd(struct irq_domain *d, unsigned int irq) |
87 |
+ static int octeon_irq_force_ciu_mapping(struct irq_domain *domain, |
88 |
+ int irq, int line, int bit) |
89 |
+ { |
90 |
++ struct device_node *of_node; |
91 |
++ int ret; |
92 |
++ |
93 |
++ of_node = irq_domain_get_of_node(domain); |
94 |
++ if (!of_node) |
95 |
++ return -EINVAL; |
96 |
++ ret = irq_alloc_desc_at(irq, of_node_to_nid(of_node)); |
97 |
++ if (ret < 0) |
98 |
++ return ret; |
99 |
++ |
100 |
+ return irq_domain_associate(domain, irq, line << 6 | bit); |
101 |
+ } |
102 |
+ |
103 |
+diff --git a/arch/mips/lantiq/clk.c b/arch/mips/lantiq/clk.c |
104 |
+index f5fab99d1751c..851f6bf925a63 100644 |
105 |
+--- a/arch/mips/lantiq/clk.c |
106 |
++++ b/arch/mips/lantiq/clk.c |
107 |
+@@ -52,6 +52,7 @@ struct clk *clk_get_io(void) |
108 |
+ { |
109 |
+ return &cpu_clk_generic[2]; |
110 |
+ } |
111 |
++EXPORT_SYMBOL_GPL(clk_get_io); |
112 |
+ |
113 |
+ struct clk *clk_get_ppe(void) |
114 |
+ { |
115 |
+diff --git a/drivers/firmware/efi/libstub/secureboot.c b/drivers/firmware/efi/libstub/secureboot.c |
116 |
+index 72d9dfbebf08e..ea03096033afc 100644 |
117 |
+--- a/drivers/firmware/efi/libstub/secureboot.c |
118 |
++++ b/drivers/firmware/efi/libstub/secureboot.c |
119 |
+@@ -21,7 +21,7 @@ static const efi_char16_t efi_SetupMode_name[] = L"SetupMode"; |
120 |
+ |
121 |
+ /* SHIM variables */ |
122 |
+ static const efi_guid_t shim_guid = EFI_SHIM_LOCK_GUID; |
123 |
+-static const efi_char16_t shim_MokSBState_name[] = L"MokSBState"; |
124 |
++static const efi_char16_t shim_MokSBState_name[] = L"MokSBStateRT"; |
125 |
+ |
126 |
+ #define get_efi_var(name, vendor, ...) \ |
127 |
+ efi_call_runtime(get_variable, \ |
128 |
+@@ -60,8 +60,8 @@ enum efi_secureboot_mode efi_get_secureboot(efi_system_table_t *sys_table_arg) |
129 |
+ |
130 |
+ /* |
131 |
+ * See if a user has put the shim into insecure mode. If so, and if the |
132 |
+- * variable doesn't have the runtime attribute set, we might as well |
133 |
+- * honor that. |
134 |
++ * variable doesn't have the non-volatile attribute set, we might as |
135 |
++ * well honor that. |
136 |
+ */ |
137 |
+ size = sizeof(moksbstate); |
138 |
+ status = get_efi_var(shim_MokSBState_name, &shim_guid, |
139 |
+@@ -70,7 +70,7 @@ enum efi_secureboot_mode efi_get_secureboot(efi_system_table_t *sys_table_arg) |
140 |
+ /* If it fails, we don't care why. Default to secure */ |
141 |
+ if (status != EFI_SUCCESS) |
142 |
+ goto secure_boot_enabled; |
143 |
+- if (!(attr & EFI_VARIABLE_RUNTIME_ACCESS) && moksbstate == 1) |
144 |
++ if (!(attr & EFI_VARIABLE_NON_VOLATILE) && moksbstate == 1) |
145 |
+ return efi_secureboot_mode_disabled; |
146 |
+ |
147 |
+ secure_boot_enabled: |
148 |
+diff --git a/drivers/gpio/gpio-mpc8xxx.c b/drivers/gpio/gpio-mpc8xxx.c |
149 |
+index 1899d172590b8..546f8c453addb 100644 |
150 |
+--- a/drivers/gpio/gpio-mpc8xxx.c |
151 |
++++ b/drivers/gpio/gpio-mpc8xxx.c |
152 |
+@@ -168,6 +168,7 @@ static int mpc8xxx_irq_set_type(struct irq_data *d, unsigned int flow_type) |
153 |
+ |
154 |
+ switch (flow_type) { |
155 |
+ case IRQ_TYPE_EDGE_FALLING: |
156 |
++ case IRQ_TYPE_LEVEL_LOW: |
157 |
+ raw_spin_lock_irqsave(&mpc8xxx_gc->lock, flags); |
158 |
+ gc->write_reg(mpc8xxx_gc->regs + GPIO_ICR, |
159 |
+ gc->read_reg(mpc8xxx_gc->regs + GPIO_ICR) |
160 |
+diff --git a/drivers/gpu/drm/amd/display/modules/color/color_gamma.c b/drivers/gpu/drm/amd/display/modules/color/color_gamma.c |
161 |
+index 11ea1a0e629bd..4e866317ec250 100644 |
162 |
+--- a/drivers/gpu/drm/amd/display/modules/color/color_gamma.c |
163 |
++++ b/drivers/gpu/drm/amd/display/modules/color/color_gamma.c |
164 |
+@@ -1206,6 +1206,7 @@ static void interpolate_user_regamma(uint32_t hw_points_num, |
165 |
+ struct fixed31_32 lut2; |
166 |
+ struct fixed31_32 delta_lut; |
167 |
+ struct fixed31_32 delta_index; |
168 |
++ const struct fixed31_32 one = dc_fixpt_from_int(1); |
169 |
+ |
170 |
+ i = 0; |
171 |
+ /* fixed_pt library has problems handling too small values */ |
172 |
+@@ -1234,6 +1235,9 @@ static void interpolate_user_regamma(uint32_t hw_points_num, |
173 |
+ } else |
174 |
+ hw_x = coordinates_x[i].x; |
175 |
+ |
176 |
++ if (dc_fixpt_le(one, hw_x)) |
177 |
++ hw_x = one; |
178 |
++ |
179 |
+ norm_x = dc_fixpt_mul(norm_factor, hw_x); |
180 |
+ index = dc_fixpt_floor(norm_x); |
181 |
+ if (index < 0 || index > 255) |
182 |
+diff --git a/drivers/gpu/drm/meson/meson_plane.c b/drivers/gpu/drm/meson/meson_plane.c |
183 |
+index c7daae53fa1f5..26ff2dc564198 100644 |
184 |
+--- a/drivers/gpu/drm/meson/meson_plane.c |
185 |
++++ b/drivers/gpu/drm/meson/meson_plane.c |
186 |
+@@ -101,7 +101,7 @@ static void meson_plane_atomic_update(struct drm_plane *plane, |
187 |
+ |
188 |
+ /* Enable OSD and BLK0, set max global alpha */ |
189 |
+ priv->viu.osd1_ctrl_stat = OSD_ENABLE | |
190 |
+- (0xFF << OSD_GLOBAL_ALPHA_SHIFT) | |
191 |
++ (0x100 << OSD_GLOBAL_ALPHA_SHIFT) | |
192 |
+ OSD_BLK0_ENABLE; |
193 |
+ |
194 |
+ /* Set up BLK0 to point to the right canvas */ |
195 |
+diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c |
196 |
+index 3feab563e50a7..3f992e5a75c97 100644 |
197 |
+--- a/drivers/gpu/drm/rockchip/cdn-dp-core.c |
198 |
++++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c |
199 |
+@@ -284,8 +284,9 @@ static int cdn_dp_connector_get_modes(struct drm_connector *connector) |
200 |
+ return ret; |
201 |
+ } |
202 |
+ |
203 |
+-static int cdn_dp_connector_mode_valid(struct drm_connector *connector, |
204 |
+- struct drm_display_mode *mode) |
205 |
++static enum drm_mode_status |
206 |
++cdn_dp_connector_mode_valid(struct drm_connector *connector, |
207 |
++ struct drm_display_mode *mode) |
208 |
+ { |
209 |
+ struct cdn_dp_device *dp = connector_to_dp(connector); |
210 |
+ struct drm_display_info *display_info = &dp->connector.display_info; |
211 |
+diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c |
212 |
+index fca092cfe2004..9cbe0b00ebf74 100644 |
213 |
+--- a/drivers/hv/vmbus_drv.c |
214 |
++++ b/drivers/hv/vmbus_drv.c |
215 |
+@@ -1846,7 +1846,7 @@ int vmbus_allocate_mmio(struct resource **new, struct hv_device *device_obj, |
216 |
+ bool fb_overlap_ok) |
217 |
+ { |
218 |
+ struct resource *iter, *shadow; |
219 |
+- resource_size_t range_min, range_max, start; |
220 |
++ resource_size_t range_min, range_max, start, end; |
221 |
+ const char *dev_n = dev_name(&device_obj->device); |
222 |
+ int retval; |
223 |
+ |
224 |
+@@ -1881,6 +1881,14 @@ int vmbus_allocate_mmio(struct resource **new, struct hv_device *device_obj, |
225 |
+ range_max = iter->end; |
226 |
+ start = (range_min + align - 1) & ~(align - 1); |
227 |
+ for (; start + size - 1 <= range_max; start += align) { |
228 |
++ end = start + size - 1; |
229 |
++ |
230 |
++ /* Skip the whole fb_mmio region if not fb_overlap_ok */ |
231 |
++ if (!fb_overlap_ok && fb_mmio && |
232 |
++ (((start >= fb_mmio->start) && (start <= fb_mmio->end)) || |
233 |
++ ((end >= fb_mmio->start) && (end <= fb_mmio->end)))) |
234 |
++ continue; |
235 |
++ |
236 |
+ shadow = __request_region(iter, start, size, NULL, |
237 |
+ IORESOURCE_BUSY); |
238 |
+ if (!shadow) |
239 |
+diff --git a/drivers/net/can/usb/gs_usb.c b/drivers/net/can/usb/gs_usb.c |
240 |
+index 2101b2fab7df8..62ca4964a863a 100644 |
241 |
+--- a/drivers/net/can/usb/gs_usb.c |
242 |
++++ b/drivers/net/can/usb/gs_usb.c |
243 |
+@@ -686,6 +686,7 @@ static int gs_can_open(struct net_device *netdev) |
244 |
+ flags |= GS_CAN_MODE_TRIPLE_SAMPLE; |
245 |
+ |
246 |
+ /* finally start device */ |
247 |
++ dev->can.state = CAN_STATE_ERROR_ACTIVE; |
248 |
+ dm->mode = cpu_to_le32(GS_CAN_MODE_START); |
249 |
+ dm->flags = cpu_to_le32(flags); |
250 |
+ rc = usb_control_msg(interface_to_usbdev(dev->iface), |
251 |
+@@ -702,13 +703,12 @@ static int gs_can_open(struct net_device *netdev) |
252 |
+ if (rc < 0) { |
253 |
+ netdev_err(netdev, "Couldn't start device (err=%d)\n", rc); |
254 |
+ kfree(dm); |
255 |
++ dev->can.state = CAN_STATE_STOPPED; |
256 |
+ return rc; |
257 |
+ } |
258 |
+ |
259 |
+ kfree(dm); |
260 |
+ |
261 |
+- dev->can.state = CAN_STATE_ERROR_ACTIVE; |
262 |
+- |
263 |
+ parent->active_channels++; |
264 |
+ if (!(dev->can.ctrlmode & CAN_CTRLMODE_LISTENONLY)) |
265 |
+ netif_start_queue(netdev); |
266 |
+diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c |
267 |
+index 85337806efc75..9669d8c8b6c72 100644 |
268 |
+--- a/drivers/net/ethernet/intel/i40e/i40e_main.c |
269 |
++++ b/drivers/net/ethernet/intel/i40e/i40e_main.c |
270 |
+@@ -5487,6 +5487,26 @@ static int i40e_get_link_speed(struct i40e_vsi *vsi) |
271 |
+ } |
272 |
+ } |
273 |
+ |
274 |
++/** |
275 |
++ * i40e_bw_bytes_to_mbits - Convert max_tx_rate from bytes to mbits |
276 |
++ * @vsi: Pointer to vsi structure |
277 |
++ * @max_tx_rate: max TX rate in bytes to be converted into Mbits |
278 |
++ * |
279 |
++ * Helper function to convert units before send to set BW limit |
280 |
++ **/ |
281 |
++static u64 i40e_bw_bytes_to_mbits(struct i40e_vsi *vsi, u64 max_tx_rate) |
282 |
++{ |
283 |
++ if (max_tx_rate < I40E_BW_MBPS_DIVISOR) { |
284 |
++ dev_warn(&vsi->back->pdev->dev, |
285 |
++ "Setting max tx rate to minimum usable value of 50Mbps.\n"); |
286 |
++ max_tx_rate = I40E_BW_CREDIT_DIVISOR; |
287 |
++ } else { |
288 |
++ do_div(max_tx_rate, I40E_BW_MBPS_DIVISOR); |
289 |
++ } |
290 |
++ |
291 |
++ return max_tx_rate; |
292 |
++} |
293 |
++ |
294 |
+ /** |
295 |
+ * i40e_set_bw_limit - setup BW limit for Tx traffic based on max_tx_rate |
296 |
+ * @vsi: VSI to be configured |
297 |
+@@ -5509,10 +5529,10 @@ int i40e_set_bw_limit(struct i40e_vsi *vsi, u16 seid, u64 max_tx_rate) |
298 |
+ max_tx_rate, seid); |
299 |
+ return -EINVAL; |
300 |
+ } |
301 |
+- if (max_tx_rate && max_tx_rate < 50) { |
302 |
++ if (max_tx_rate && max_tx_rate < I40E_BW_CREDIT_DIVISOR) { |
303 |
+ dev_warn(&pf->pdev->dev, |
304 |
+ "Setting max tx rate to minimum usable value of 50Mbps.\n"); |
305 |
+- max_tx_rate = 50; |
306 |
++ max_tx_rate = I40E_BW_CREDIT_DIVISOR; |
307 |
+ } |
308 |
+ |
309 |
+ /* Tx rate credits are in values of 50Mbps, 0 is disabled */ |
310 |
+@@ -6949,9 +6969,9 @@ config_tc: |
311 |
+ |
312 |
+ if (pf->flags & I40E_FLAG_TC_MQPRIO) { |
313 |
+ if (vsi->mqprio_qopt.max_rate[0]) { |
314 |
+- u64 max_tx_rate = vsi->mqprio_qopt.max_rate[0]; |
315 |
++ u64 max_tx_rate = i40e_bw_bytes_to_mbits(vsi, |
316 |
++ vsi->mqprio_qopt.max_rate[0]); |
317 |
+ |
318 |
+- do_div(max_tx_rate, I40E_BW_MBPS_DIVISOR); |
319 |
+ ret = i40e_set_bw_limit(vsi, vsi->seid, max_tx_rate); |
320 |
+ if (!ret) { |
321 |
+ u64 credits = max_tx_rate; |
322 |
+@@ -9613,10 +9633,10 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired) |
323 |
+ } |
324 |
+ |
325 |
+ if (vsi->mqprio_qopt.max_rate[0]) { |
326 |
+- u64 max_tx_rate = vsi->mqprio_qopt.max_rate[0]; |
327 |
++ u64 max_tx_rate = i40e_bw_bytes_to_mbits(vsi, |
328 |
++ vsi->mqprio_qopt.max_rate[0]); |
329 |
+ u64 credits = 0; |
330 |
+ |
331 |
+- do_div(max_tx_rate, I40E_BW_MBPS_DIVISOR); |
332 |
+ ret = i40e_set_bw_limit(vsi, vsi->seid, max_tx_rate); |
333 |
+ if (ret) |
334 |
+ goto end_unlock; |
335 |
+diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c |
336 |
+index a39a8fe073ca8..973350b34e085 100644 |
337 |
+--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c |
338 |
++++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c |
339 |
+@@ -1712,6 +1712,25 @@ static void i40e_del_qch(struct i40e_vf *vf) |
340 |
+ } |
341 |
+ } |
342 |
+ |
343 |
++/** |
344 |
++ * i40e_vc_get_max_frame_size |
345 |
++ * @vf: pointer to the VF |
346 |
++ * |
347 |
++ * Max frame size is determined based on the current port's max frame size and |
348 |
++ * whether a port VLAN is configured on this VF. The VF is not aware whether |
349 |
++ * it's in a port VLAN so the PF needs to account for this in max frame size |
350 |
++ * checks and sending the max frame size to the VF. |
351 |
++ **/ |
352 |
++static u16 i40e_vc_get_max_frame_size(struct i40e_vf *vf) |
353 |
++{ |
354 |
++ u16 max_frame_size = vf->pf->hw.phy.link_info.max_frame_size; |
355 |
++ |
356 |
++ if (vf->port_vlan_id) |
357 |
++ max_frame_size -= VLAN_HLEN; |
358 |
++ |
359 |
++ return max_frame_size; |
360 |
++} |
361 |
++ |
362 |
+ /** |
363 |
+ * i40e_vc_get_vf_resources_msg |
364 |
+ * @vf: pointer to the VF info |
365 |
+@@ -1814,6 +1833,7 @@ static int i40e_vc_get_vf_resources_msg(struct i40e_vf *vf, u8 *msg) |
366 |
+ vfres->max_vectors = pf->hw.func_caps.num_msix_vectors_vf; |
367 |
+ vfres->rss_key_size = I40E_HKEY_ARRAY_SIZE; |
368 |
+ vfres->rss_lut_size = I40E_VF_HLUT_ARRAY_SIZE; |
369 |
++ vfres->max_mtu = i40e_vc_get_max_frame_size(vf); |
370 |
+ |
371 |
+ if (vf->lan_vsi_idx) { |
372 |
+ vfres->vsi_res[0].vsi_id = vf->lan_vsi_id; |
373 |
+diff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c |
374 |
+index b56d22b530a70..1bf9734ae9cf0 100644 |
375 |
+--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c |
376 |
++++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c |
377 |
+@@ -115,8 +115,11 @@ u32 i40evf_get_tx_pending(struct i40e_ring *ring, bool in_sw) |
378 |
+ { |
379 |
+ u32 head, tail; |
380 |
+ |
381 |
++ /* underlying hardware might not allow access and/or always return |
382 |
++ * 0 for the head/tail registers so just use the cached values |
383 |
++ */ |
384 |
+ head = ring->next_to_clean; |
385 |
+- tail = readl(ring->tail); |
386 |
++ tail = ring->next_to_use; |
387 |
+ |
388 |
+ if (head != tail) |
389 |
+ return (head < tail) ? |
390 |
+diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_debugfs.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_debugfs.c |
391 |
+index f9744a61e5dd6..87d9cbe10cec1 100644 |
392 |
+--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_debugfs.c |
393 |
++++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_debugfs.c |
394 |
+@@ -484,8 +484,6 @@ static int mvpp2_dbgfs_flow_port_init(struct dentry *parent, |
395 |
+ struct dentry *port_dir; |
396 |
+ |
397 |
+ port_dir = debugfs_create_dir(port->dev->name, parent); |
398 |
+- if (IS_ERR(port_dir)) |
399 |
+- return PTR_ERR(port_dir); |
400 |
+ |
401 |
+ /* This will be freed by 'hash_opts' release op */ |
402 |
+ port_entry = kmalloc(sizeof(*port_entry), GFP_KERNEL); |
403 |
+@@ -515,8 +513,6 @@ static int mvpp2_dbgfs_flow_entry_init(struct dentry *parent, |
404 |
+ sprintf(flow_entry_name, "%02d", flow); |
405 |
+ |
406 |
+ flow_entry_dir = debugfs_create_dir(flow_entry_name, parent); |
407 |
+- if (!flow_entry_dir) |
408 |
+- return -ENOMEM; |
409 |
+ |
410 |
+ /* This will be freed by 'type' release op */ |
411 |
+ entry = kmalloc(sizeof(*entry), GFP_KERNEL); |
412 |
+@@ -554,8 +550,6 @@ static int mvpp2_dbgfs_flow_init(struct dentry *parent, struct mvpp2 *priv) |
413 |
+ int i, ret; |
414 |
+ |
415 |
+ flow_dir = debugfs_create_dir("flows", parent); |
416 |
+- if (!flow_dir) |
417 |
+- return -ENOMEM; |
418 |
+ |
419 |
+ for (i = 0; i < MVPP2_N_FLOWS; i++) { |
420 |
+ ret = mvpp2_dbgfs_flow_entry_init(flow_dir, priv, i); |
421 |
+@@ -579,8 +573,6 @@ static int mvpp2_dbgfs_prs_entry_init(struct dentry *parent, |
422 |
+ sprintf(prs_entry_name, "%03d", tid); |
423 |
+ |
424 |
+ prs_entry_dir = debugfs_create_dir(prs_entry_name, parent); |
425 |
+- if (!prs_entry_dir) |
426 |
+- return -ENOMEM; |
427 |
+ |
428 |
+ /* The 'valid' entry's ops will free that */ |
429 |
+ entry = kmalloc(sizeof(*entry), GFP_KERNEL); |
430 |
+@@ -618,8 +610,6 @@ static int mvpp2_dbgfs_prs_init(struct dentry *parent, struct mvpp2 *priv) |
431 |
+ int i, ret; |
432 |
+ |
433 |
+ prs_dir = debugfs_create_dir("parser", parent); |
434 |
+- if (!prs_dir) |
435 |
+- return -ENOMEM; |
436 |
+ |
437 |
+ for (i = 0; i < MVPP2_PRS_TCAM_SRAM_SIZE; i++) { |
438 |
+ ret = mvpp2_dbgfs_prs_entry_init(prs_dir, priv, i); |
439 |
+@@ -636,8 +626,6 @@ static int mvpp2_dbgfs_port_init(struct dentry *parent, |
440 |
+ struct dentry *port_dir; |
441 |
+ |
442 |
+ port_dir = debugfs_create_dir(port->dev->name, parent); |
443 |
+- if (IS_ERR(port_dir)) |
444 |
+- return PTR_ERR(port_dir); |
445 |
+ |
446 |
+ debugfs_create_file("parser_entries", 0444, port_dir, port, |
447 |
+ &mvpp2_dbgfs_port_parser_fops); |
448 |
+@@ -671,15 +659,10 @@ void mvpp2_dbgfs_init(struct mvpp2 *priv, const char *name) |
449 |
+ int ret, i; |
450 |
+ |
451 |
+ mvpp2_root = debugfs_lookup(MVPP2_DRIVER_NAME, NULL); |
452 |
+- if (!mvpp2_root) { |
453 |
++ if (!mvpp2_root) |
454 |
+ mvpp2_root = debugfs_create_dir(MVPP2_DRIVER_NAME, NULL); |
455 |
+- if (IS_ERR(mvpp2_root)) |
456 |
+- return; |
457 |
+- } |
458 |
+ |
459 |
+ mvpp2_dir = debugfs_create_dir(name, mvpp2_root); |
460 |
+- if (IS_ERR(mvpp2_dir)) |
461 |
+- return; |
462 |
+ |
463 |
+ priv->dbgfs_dir = mvpp2_dir; |
464 |
+ |
465 |
+diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c |
466 |
+index 882908e74cc99..a4090163d870c 100644 |
467 |
+--- a/drivers/net/ethernet/sun/sunhme.c |
468 |
++++ b/drivers/net/ethernet/sun/sunhme.c |
469 |
+@@ -2064,9 +2064,9 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev) |
470 |
+ |
471 |
+ skb_reserve(copy_skb, 2); |
472 |
+ skb_put(copy_skb, len); |
473 |
+- dma_sync_single_for_cpu(hp->dma_dev, dma_addr, len, DMA_FROM_DEVICE); |
474 |
++ dma_sync_single_for_cpu(hp->dma_dev, dma_addr, len + 2, DMA_FROM_DEVICE); |
475 |
+ skb_copy_from_linear_data(skb, copy_skb->data, len); |
476 |
+- dma_sync_single_for_device(hp->dma_dev, dma_addr, len, DMA_FROM_DEVICE); |
477 |
++ dma_sync_single_for_device(hp->dma_dev, dma_addr, len + 2, DMA_FROM_DEVICE); |
478 |
+ /* Reuse original ring buffer. */ |
479 |
+ hme_write_rxd(hp, this, |
480 |
+ (RXFLAG_OWN|((RX_BUF_ALLOC_SIZE-RX_OFFSET)<<16)), |
481 |
+diff --git a/drivers/net/ipvlan/ipvlan_core.c b/drivers/net/ipvlan/ipvlan_core.c |
482 |
+index 40ac60904c8dd..63f0226b0a70c 100644 |
483 |
+--- a/drivers/net/ipvlan/ipvlan_core.c |
484 |
++++ b/drivers/net/ipvlan/ipvlan_core.c |
485 |
+@@ -502,7 +502,6 @@ static int ipvlan_process_v6_outbound(struct sk_buff *skb) |
486 |
+ |
487 |
+ static int ipvlan_process_outbound(struct sk_buff *skb) |
488 |
+ { |
489 |
+- struct ethhdr *ethh = eth_hdr(skb); |
490 |
+ int ret = NET_XMIT_DROP; |
491 |
+ |
492 |
+ /* The ipvlan is a pseudo-L2 device, so the packets that we receive |
493 |
+@@ -512,6 +511,8 @@ static int ipvlan_process_outbound(struct sk_buff *skb) |
494 |
+ if (skb_mac_header_was_set(skb)) { |
495 |
+ /* In this mode we dont care about |
496 |
+ * multicast and broadcast traffic */ |
497 |
++ struct ethhdr *ethh = eth_hdr(skb); |
498 |
++ |
499 |
+ if (is_multicast_ether_addr(ethh->h_dest)) { |
500 |
+ pr_debug_ratelimited( |
501 |
+ "Dropped {multi|broad}cast of type=[%x]\n", |
502 |
+@@ -596,7 +597,7 @@ out: |
503 |
+ static int ipvlan_xmit_mode_l2(struct sk_buff *skb, struct net_device *dev) |
504 |
+ { |
505 |
+ const struct ipvl_dev *ipvlan = netdev_priv(dev); |
506 |
+- struct ethhdr *eth = eth_hdr(skb); |
507 |
++ struct ethhdr *eth = skb_eth_hdr(skb); |
508 |
+ struct ipvl_addr *addr; |
509 |
+ void *lyr3h; |
510 |
+ int addr_type; |
511 |
+@@ -626,6 +627,7 @@ static int ipvlan_xmit_mode_l2(struct sk_buff *skb, struct net_device *dev) |
512 |
+ return dev_forward_skb(ipvlan->phy_dev, skb); |
513 |
+ |
514 |
+ } else if (is_multicast_ether_addr(eth->h_dest)) { |
515 |
++ skb_reset_mac_header(skb); |
516 |
+ ipvlan_skb_crossing_ns(skb, NULL); |
517 |
+ ipvlan_multicast_enqueue(ipvlan->port, skb, true); |
518 |
+ return NET_XMIT_SUCCESS; |
519 |
+diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c |
520 |
+index 8a1e9dba1249e..2410f08e2bb5c 100644 |
521 |
+--- a/drivers/net/team/team.c |
522 |
++++ b/drivers/net/team/team.c |
523 |
+@@ -1280,10 +1280,12 @@ static int team_port_add(struct team *team, struct net_device *port_dev, |
524 |
+ } |
525 |
+ } |
526 |
+ |
527 |
+- netif_addr_lock_bh(dev); |
528 |
+- dev_uc_sync_multiple(port_dev, dev); |
529 |
+- dev_mc_sync_multiple(port_dev, dev); |
530 |
+- netif_addr_unlock_bh(dev); |
531 |
++ if (dev->flags & IFF_UP) { |
532 |
++ netif_addr_lock_bh(dev); |
533 |
++ dev_uc_sync_multiple(port_dev, dev); |
534 |
++ dev_mc_sync_multiple(port_dev, dev); |
535 |
++ netif_addr_unlock_bh(dev); |
536 |
++ } |
537 |
+ |
538 |
+ port->index = -1; |
539 |
+ list_add_tail_rcu(&port->list, &team->port_list); |
540 |
+@@ -1354,8 +1356,10 @@ static int team_port_del(struct team *team, struct net_device *port_dev) |
541 |
+ netdev_rx_handler_unregister(port_dev); |
542 |
+ team_port_disable_netpoll(port); |
543 |
+ vlan_vids_del_by_dev(port_dev, dev); |
544 |
+- dev_uc_unsync(port_dev, dev); |
545 |
+- dev_mc_unsync(port_dev, dev); |
546 |
++ if (dev->flags & IFF_UP) { |
547 |
++ dev_uc_unsync(port_dev, dev); |
548 |
++ dev_mc_unsync(port_dev, dev); |
549 |
++ } |
550 |
+ dev_close(port_dev); |
551 |
+ team_port_leave(team, port); |
552 |
+ |
553 |
+@@ -1703,6 +1707,14 @@ static int team_open(struct net_device *dev) |
554 |
+ |
555 |
+ static int team_close(struct net_device *dev) |
556 |
+ { |
557 |
++ struct team *team = netdev_priv(dev); |
558 |
++ struct team_port *port; |
559 |
++ |
560 |
++ list_for_each_entry(port, &team->port_list, list) { |
561 |
++ dev_uc_unsync(port->dev, dev); |
562 |
++ dev_mc_unsync(port->dev, dev); |
563 |
++ } |
564 |
++ |
565 |
+ return 0; |
566 |
+ } |
567 |
+ |
568 |
+diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c |
569 |
+index fcf21a1ca7761..8d10c29ba1763 100644 |
570 |
+--- a/drivers/net/usb/qmi_wwan.c |
571 |
++++ b/drivers/net/usb/qmi_wwan.c |
572 |
+@@ -1049,6 +1049,7 @@ static const struct usb_device_id products[] = { |
573 |
+ {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0512)}, /* Quectel EG12/EM12 */ |
574 |
+ {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0620)}, /* Quectel EM160R-GL */ |
575 |
+ {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0800)}, /* Quectel RM500Q-GL */ |
576 |
++ {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0801)}, /* Quectel RM520N */ |
577 |
+ |
578 |
+ /* 3. Combined interface devices matching on interface number */ |
579 |
+ {QMI_FIXED_INTF(0x0408, 0xea42, 4)}, /* Yota / Megafon M100-1 */ |
580 |
+diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c |
581 |
+index 1a35d73c39c35..80b5aae1bdc9b 100644 |
582 |
+--- a/drivers/nvme/target/core.c |
583 |
++++ b/drivers/nvme/target/core.c |
584 |
+@@ -504,6 +504,7 @@ static void __nvmet_req_complete(struct nvmet_req *req, u16 status) |
585 |
+ { |
586 |
+ u32 old_sqhd, new_sqhd; |
587 |
+ u16 sqhd; |
588 |
++ struct nvmet_ns *ns = req->ns; |
589 |
+ |
590 |
+ if (status) |
591 |
+ nvmet_set_status(req, status); |
592 |
+@@ -520,9 +521,9 @@ static void __nvmet_req_complete(struct nvmet_req *req, u16 status) |
593 |
+ req->rsp->sq_id = cpu_to_le16(req->sq->qid); |
594 |
+ req->rsp->command_id = req->cmd->common.command_id; |
595 |
+ |
596 |
+- if (req->ns) |
597 |
+- nvmet_put_namespace(req->ns); |
598 |
+ req->ops->queue_response(req); |
599 |
++ if (ns) |
600 |
++ nvmet_put_namespace(ns); |
601 |
+ } |
602 |
+ |
603 |
+ void nvmet_req_complete(struct nvmet_req *req, u16 status) |
604 |
+diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c |
605 |
+index 9fecac72c358c..7c284ca0212c5 100644 |
606 |
+--- a/drivers/of/fdt.c |
607 |
++++ b/drivers/of/fdt.c |
608 |
+@@ -392,7 +392,7 @@ static int unflatten_dt_nodes(const void *blob, |
609 |
+ for (offset = 0; |
610 |
+ offset >= 0 && depth >= initial_depth; |
611 |
+ offset = fdt_next_node(blob, offset, &depth)) { |
612 |
+- if (WARN_ON_ONCE(depth >= FDT_MAX_DEPTH)) |
613 |
++ if (WARN_ON_ONCE(depth >= FDT_MAX_DEPTH - 1)) |
614 |
+ continue; |
615 |
+ |
616 |
+ if (!IS_ENABLED(CONFIG_OF_KOBJ) && |
617 |
+diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c |
618 |
+index 100adacfdca94..9031c57aa1b56 100644 |
619 |
+--- a/drivers/of/of_mdio.c |
620 |
++++ b/drivers/of/of_mdio.c |
621 |
+@@ -283,6 +283,7 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np) |
622 |
+ return 0; |
623 |
+ |
624 |
+ unregister: |
625 |
++ of_node_put(child); |
626 |
+ mdiobus_unregister(mdio); |
627 |
+ return rc; |
628 |
+ } |
629 |
+diff --git a/drivers/parisc/ccio-dma.c b/drivers/parisc/ccio-dma.c |
630 |
+index 73ee74d6e7a3d..2c763f9d75df4 100644 |
631 |
+--- a/drivers/parisc/ccio-dma.c |
632 |
++++ b/drivers/parisc/ccio-dma.c |
633 |
+@@ -1555,6 +1555,7 @@ static int __init ccio_probe(struct parisc_device *dev) |
634 |
+ } |
635 |
+ ccio_ioc_init(ioc); |
636 |
+ if (ccio_init_resources(ioc)) { |
637 |
++ iounmap(ioc->ioc_regs); |
638 |
+ kfree(ioc); |
639 |
+ return -ENOMEM; |
640 |
+ } |
641 |
+diff --git a/drivers/regulator/pfuze100-regulator.c b/drivers/regulator/pfuze100-regulator.c |
642 |
+index 8b1940110561a..b1d73a6c7809e 100644 |
643 |
+--- a/drivers/regulator/pfuze100-regulator.c |
644 |
++++ b/drivers/regulator/pfuze100-regulator.c |
645 |
+@@ -710,7 +710,7 @@ static int pfuze100_regulator_probe(struct i2c_client *client, |
646 |
+ ((pfuze_chip->chip_id == PFUZE3000) ? "3000" : "3001")))); |
647 |
+ |
648 |
+ memcpy(pfuze_chip->regulator_descs, pfuze_chip->pfuze_regulators, |
649 |
+- sizeof(pfuze_chip->regulator_descs)); |
650 |
++ regulator_num * sizeof(struct pfuze_regulator)); |
651 |
+ |
652 |
+ ret = pfuze_parse_regulators_dt(pfuze_chip); |
653 |
+ if (ret) |
654 |
+diff --git a/drivers/s390/block/dasd_alias.c b/drivers/s390/block/dasd_alias.c |
655 |
+index dc78a523a69f2..b6b938aa66158 100644 |
656 |
+--- a/drivers/s390/block/dasd_alias.c |
657 |
++++ b/drivers/s390/block/dasd_alias.c |
658 |
+@@ -675,12 +675,12 @@ int dasd_alias_remove_device(struct dasd_device *device) |
659 |
+ struct dasd_device *dasd_alias_get_start_dev(struct dasd_device *base_device) |
660 |
+ { |
661 |
+ struct dasd_eckd_private *alias_priv, *private = base_device->private; |
662 |
+- struct alias_pav_group *group = private->pavgroup; |
663 |
+ struct alias_lcu *lcu = private->lcu; |
664 |
+ struct dasd_device *alias_device; |
665 |
++ struct alias_pav_group *group; |
666 |
+ unsigned long flags; |
667 |
+ |
668 |
+- if (!group || !lcu) |
669 |
++ if (!lcu) |
670 |
+ return NULL; |
671 |
+ if (lcu->pav == NO_PAV || |
672 |
+ lcu->flags & (NEED_UAC_UPDATE | UPDATE_PENDING)) |
673 |
+@@ -697,6 +697,11 @@ struct dasd_device *dasd_alias_get_start_dev(struct dasd_device *base_device) |
674 |
+ } |
675 |
+ |
676 |
+ spin_lock_irqsave(&lcu->lock, flags); |
677 |
++ group = private->pavgroup; |
678 |
++ if (!group) { |
679 |
++ spin_unlock_irqrestore(&lcu->lock, flags); |
680 |
++ return NULL; |
681 |
++ } |
682 |
+ alias_device = group->next; |
683 |
+ if (!alias_device) { |
684 |
+ if (list_empty(&group->aliaslist)) { |
685 |
+diff --git a/drivers/tty/serial/serial-tegra.c b/drivers/tty/serial/serial-tegra.c |
686 |
+index af2a29cfbbe98..ee480a1480e86 100644 |
687 |
+--- a/drivers/tty/serial/serial-tegra.c |
688 |
++++ b/drivers/tty/serial/serial-tegra.c |
689 |
+@@ -398,7 +398,7 @@ static void tegra_uart_tx_dma_complete(void *args) |
690 |
+ count = tup->tx_bytes_requested - state.residue; |
691 |
+ async_tx_ack(tup->tx_dma_desc); |
692 |
+ spin_lock_irqsave(&tup->uport.lock, flags); |
693 |
+- xmit->tail = (xmit->tail + count) & (UART_XMIT_SIZE - 1); |
694 |
++ uart_xmit_advance(&tup->uport, count); |
695 |
+ tup->tx_in_progress = 0; |
696 |
+ if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) |
697 |
+ uart_write_wakeup(&tup->uport); |
698 |
+@@ -482,7 +482,6 @@ static unsigned int tegra_uart_tx_empty(struct uart_port *u) |
699 |
+ static void tegra_uart_stop_tx(struct uart_port *u) |
700 |
+ { |
701 |
+ struct tegra_uart_port *tup = to_tegra_uport(u); |
702 |
+- struct circ_buf *xmit = &tup->uport.state->xmit; |
703 |
+ struct dma_tx_state state; |
704 |
+ unsigned int count; |
705 |
+ |
706 |
+@@ -493,7 +492,7 @@ static void tegra_uart_stop_tx(struct uart_port *u) |
707 |
+ dmaengine_tx_status(tup->tx_dma_chan, tup->tx_cookie, &state); |
708 |
+ count = tup->tx_bytes_requested - state.residue; |
709 |
+ async_tx_ack(tup->tx_dma_desc); |
710 |
+- xmit->tail = (xmit->tail + count) & (UART_XMIT_SIZE - 1); |
711 |
++ uart_xmit_advance(&tup->uport, count); |
712 |
+ tup->tx_in_progress = 0; |
713 |
+ } |
714 |
+ |
715 |
+diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c |
716 |
+index 4d04c75ac3815..d1a7f22cb3a92 100644 |
717 |
+--- a/drivers/usb/core/hub.c |
718 |
++++ b/drivers/usb/core/hub.c |
719 |
+@@ -5852,7 +5852,7 @@ re_enumerate_no_bos: |
720 |
+ * |
721 |
+ * Return: The same as for usb_reset_and_verify_device(). |
722 |
+ * However, if a reset is already in progress (for instance, if a |
723 |
+- * driver doesn't have pre_ or post_reset() callbacks, and while |
724 |
++ * driver doesn't have pre_reset() or post_reset() callbacks, and while |
725 |
+ * being unbound or re-bound during the ongoing reset its disconnect() |
726 |
+ * or probe() routine tries to perform a second, nested reset), the |
727 |
+ * routine returns -EINPROGRESS. |
728 |
+diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c |
729 |
+index 527938eee8461..955bf820f4102 100644 |
730 |
+--- a/drivers/usb/dwc3/dwc3-pci.c |
731 |
++++ b/drivers/usb/dwc3/dwc3-pci.c |
732 |
+@@ -36,6 +36,11 @@ |
733 |
+ #define PCI_DEVICE_ID_INTEL_CNPH 0xa36e |
734 |
+ #define PCI_DEVICE_ID_INTEL_CNPV 0xa3b0 |
735 |
+ #define PCI_DEVICE_ID_INTEL_ICLLP 0x34ee |
736 |
++#define PCI_DEVICE_ID_INTEL_EHLLP 0x4b7e |
737 |
++#define PCI_DEVICE_ID_INTEL_TGPLP 0xa0ee |
738 |
++#define PCI_DEVICE_ID_INTEL_TGPH 0x43ee |
739 |
++#define PCI_DEVICE_ID_INTEL_JSP 0x4dee |
740 |
++#define PCI_DEVICE_ID_INTEL_ADLS 0x7ae1 |
741 |
+ |
742 |
+ #define PCI_INTEL_BXT_DSM_GUID "732b85d5-b7a7-4a1b-9ba0-4bbd00ffd511" |
743 |
+ #define PCI_INTEL_BXT_FUNC_PMU_PWR 4 |
744 |
+@@ -144,7 +149,8 @@ static int dwc3_pci_quirks(struct dwc3_pci *dwc) |
745 |
+ |
746 |
+ if (pdev->vendor == PCI_VENDOR_ID_INTEL) { |
747 |
+ if (pdev->device == PCI_DEVICE_ID_INTEL_BXT || |
748 |
+- pdev->device == PCI_DEVICE_ID_INTEL_BXT_M) { |
749 |
++ pdev->device == PCI_DEVICE_ID_INTEL_BXT_M || |
750 |
++ pdev->device == PCI_DEVICE_ID_INTEL_EHLLP) { |
751 |
+ guid_parse(PCI_INTEL_BXT_DSM_GUID, &dwc->guid); |
752 |
+ dwc->has_dsm_for_pm = true; |
753 |
+ } |
754 |
+@@ -351,6 +357,21 @@ static const struct pci_device_id dwc3_pci_id_table[] = { |
755 |
+ { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ICLLP), |
756 |
+ (kernel_ulong_t) &dwc3_pci_intel_properties, }, |
757 |
+ |
758 |
++ { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_EHLLP), |
759 |
++ (kernel_ulong_t) &dwc3_pci_intel_properties, }, |
760 |
++ |
761 |
++ { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_TGPLP), |
762 |
++ (kernel_ulong_t) &dwc3_pci_intel_properties, }, |
763 |
++ |
764 |
++ { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_TGPH), |
765 |
++ (kernel_ulong_t) &dwc3_pci_intel_properties, }, |
766 |
++ |
767 |
++ { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_JSP), |
768 |
++ (kernel_ulong_t) &dwc3_pci_intel_properties, }, |
769 |
++ |
770 |
++ { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ADLS), |
771 |
++ (kernel_ulong_t) &dwc3_pci_intel_properties, }, |
772 |
++ |
773 |
+ { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_NL_USB), |
774 |
+ (kernel_ulong_t) &dwc3_pci_amd_properties, }, |
775 |
+ { } /* Terminating Entry */ |
776 |
+diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c |
777 |
+index fe4e340ac66ee..560e628912e54 100644 |
778 |
+--- a/drivers/usb/serial/option.c |
779 |
++++ b/drivers/usb/serial/option.c |
780 |
+@@ -256,6 +256,7 @@ static void option_instat_callback(struct urb *urb); |
781 |
+ #define QUECTEL_PRODUCT_EM060K 0x030b |
782 |
+ #define QUECTEL_PRODUCT_EM12 0x0512 |
783 |
+ #define QUECTEL_PRODUCT_RM500Q 0x0800 |
784 |
++#define QUECTEL_PRODUCT_RM520N 0x0801 |
785 |
+ #define QUECTEL_PRODUCT_EC200S_CN 0x6002 |
786 |
+ #define QUECTEL_PRODUCT_EC200T 0x6026 |
787 |
+ #define QUECTEL_PRODUCT_RM500K 0x7001 |
788 |
+@@ -1138,6 +1139,8 @@ static const struct usb_device_id option_ids[] = { |
789 |
+ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EG95, 0xff, 0xff, 0xff), |
790 |
+ .driver_info = NUMEP2 }, |
791 |
+ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EG95, 0xff, 0, 0) }, |
792 |
++ { USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, 0x0203, 0xff), /* BG95-M3 */ |
793 |
++ .driver_info = ZLP }, |
794 |
+ { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96), |
795 |
+ .driver_info = RSVD(4) }, |
796 |
+ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, 0xff, 0xff, 0xff), |
797 |
+@@ -1159,6 +1162,9 @@ static const struct usb_device_id option_ids[] = { |
798 |
+ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0, 0) }, |
799 |
+ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0xff, 0x10), |
800 |
+ .driver_info = ZLP }, |
801 |
++ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM520N, 0xff, 0xff, 0x30) }, |
802 |
++ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM520N, 0xff, 0, 0x40) }, |
803 |
++ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM520N, 0xff, 0, 0) }, |
804 |
+ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200S_CN, 0xff, 0, 0) }, |
805 |
+ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200T, 0xff, 0, 0) }, |
806 |
+ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500K, 0xff, 0x00, 0x00) }, |
807 |
+diff --git a/drivers/video/fbdev/pxa3xx-gcu.c b/drivers/video/fbdev/pxa3xx-gcu.c |
808 |
+index 43695a33f062f..aec0b85db5bf4 100644 |
809 |
+--- a/drivers/video/fbdev/pxa3xx-gcu.c |
810 |
++++ b/drivers/video/fbdev/pxa3xx-gcu.c |
811 |
+@@ -394,7 +394,7 @@ pxa3xx_gcu_write(struct file *file, const char *buff, |
812 |
+ struct pxa3xx_gcu_batch *buffer; |
813 |
+ struct pxa3xx_gcu_priv *priv = to_pxa3xx_gcu_priv(file); |
814 |
+ |
815 |
+- int words = count / 4; |
816 |
++ size_t words = count / 4; |
817 |
+ |
818 |
+ /* Does not need to be atomic. There's a lock in user space, |
819 |
+ * but anyhow, this is just for statistics. */ |
820 |
+diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c |
821 |
+index 59643acb6d679..3f9029cf09fc6 100644 |
822 |
+--- a/fs/cifs/transport.c |
823 |
++++ b/fs/cifs/transport.c |
824 |
+@@ -168,8 +168,8 @@ smb_send_kvec(struct TCP_Server_Info *server, struct msghdr *smb_msg, |
825 |
+ |
826 |
+ *sent = 0; |
827 |
+ |
828 |
+- smb_msg->msg_name = (struct sockaddr *) &server->dstaddr; |
829 |
+- smb_msg->msg_namelen = sizeof(struct sockaddr); |
830 |
++ smb_msg->msg_name = NULL; |
831 |
++ smb_msg->msg_namelen = 0; |
832 |
+ smb_msg->msg_control = NULL; |
833 |
+ smb_msg->msg_controllen = 0; |
834 |
+ if (server->noblocksnd) |
835 |
+diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c |
836 |
+index 5cb19fdf6450c..5dfb34802aed5 100644 |
837 |
+--- a/fs/ext4/ialloc.c |
838 |
++++ b/fs/ext4/ialloc.c |
839 |
+@@ -505,7 +505,7 @@ static int find_group_orlov(struct super_block *sb, struct inode *parent, |
840 |
+ goto fallback; |
841 |
+ } |
842 |
+ |
843 |
+- max_dirs = ndirs / ngroups + inodes_per_group / 16; |
844 |
++ max_dirs = ndirs / ngroups + inodes_per_group*flex_size / 16; |
845 |
+ min_inodes = avefreei - inodes_per_group*flex_size / 4; |
846 |
+ if (min_inodes < 1) |
847 |
+ min_inodes = 1; |
848 |
+diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h |
849 |
+index 3460b15a26078..af8143fb644cc 100644 |
850 |
+--- a/include/linux/serial_core.h |
851 |
++++ b/include/linux/serial_core.h |
852 |
+@@ -306,6 +306,23 @@ struct uart_state { |
853 |
+ /* number of characters left in xmit buffer before we ask for more */ |
854 |
+ #define WAKEUP_CHARS 256 |
855 |
+ |
856 |
++/** |
857 |
++ * uart_xmit_advance - Advance xmit buffer and account Tx'ed chars |
858 |
++ * @up: uart_port structure describing the port |
859 |
++ * @chars: number of characters sent |
860 |
++ * |
861 |
++ * This function advances the tail of circular xmit buffer by the number of |
862 |
++ * @chars transmitted and handles accounting of transmitted bytes (into |
863 |
++ * @up's icount.tx). |
864 |
++ */ |
865 |
++static inline void uart_xmit_advance(struct uart_port *up, unsigned int chars) |
866 |
++{ |
867 |
++ struct circ_buf *xmit = &up->state->xmit; |
868 |
++ |
869 |
++ xmit->tail = (xmit->tail + chars) & (UART_XMIT_SIZE - 1); |
870 |
++ up->icount.tx += chars; |
871 |
++} |
872 |
++ |
873 |
+ struct module; |
874 |
+ struct tty_driver; |
875 |
+ |
876 |
+diff --git a/kernel/workqueue.c b/kernel/workqueue.c |
877 |
+index b1bb6cb5802ec..4ea2f7fd20ceb 100644 |
878 |
+--- a/kernel/workqueue.c |
879 |
++++ b/kernel/workqueue.c |
880 |
+@@ -2917,10 +2917,8 @@ static bool __flush_work(struct work_struct *work, bool from_cancel) |
881 |
+ if (WARN_ON(!work->func)) |
882 |
+ return false; |
883 |
+ |
884 |
+- if (!from_cancel) { |
885 |
+- lock_map_acquire(&work->lockdep_map); |
886 |
+- lock_map_release(&work->lockdep_map); |
887 |
+- } |
888 |
++ lock_map_acquire(&work->lockdep_map); |
889 |
++ lock_map_release(&work->lockdep_map); |
890 |
+ |
891 |
+ if (start_flush_work(work, &barr, from_cancel)) { |
892 |
+ wait_for_completion(&barr.done); |
893 |
+diff --git a/mm/slub.c b/mm/slub.c |
894 |
+index 0fefe0ad8f572..ef730ea8263cb 100644 |
895 |
+--- a/mm/slub.c |
896 |
++++ b/mm/slub.c |
897 |
+@@ -5688,7 +5688,8 @@ static char *create_unique_id(struct kmem_cache *s) |
898 |
+ char *name = kmalloc(ID_STR_LENGTH, GFP_KERNEL); |
899 |
+ char *p = name; |
900 |
+ |
901 |
+- BUG_ON(!name); |
902 |
++ if (!name) |
903 |
++ return ERR_PTR(-ENOMEM); |
904 |
+ |
905 |
+ *p++ = ':'; |
906 |
+ /* |
907 |
+@@ -5770,6 +5771,8 @@ static int sysfs_slab_add(struct kmem_cache *s) |
908 |
+ * for the symlinks. |
909 |
+ */ |
910 |
+ name = create_unique_id(s); |
911 |
++ if (IS_ERR(name)) |
912 |
++ return PTR_ERR(name); |
913 |
+ } |
914 |
+ |
915 |
+ s->kobj.kset = kset; |
916 |
+diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c |
917 |
+index ea27bacbd0057..59d8974ee92b4 100644 |
918 |
+--- a/net/bridge/netfilter/ebtables.c |
919 |
++++ b/net/bridge/netfilter/ebtables.c |
920 |
+@@ -1003,8 +1003,10 @@ static int do_replace_finish(struct net *net, struct ebt_replace *repl, |
921 |
+ goto free_iterate; |
922 |
+ } |
923 |
+ |
924 |
+- if (repl->valid_hooks != t->valid_hooks) |
925 |
++ if (repl->valid_hooks != t->valid_hooks) { |
926 |
++ ret = -EINVAL; |
927 |
+ goto free_unlock; |
928 |
++ } |
929 |
+ |
930 |
+ if (repl->num_counters && repl->num_counters != t->private->nentries) { |
931 |
+ ret = -EINVAL; |
932 |
+diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c |
933 |
+index de42bcfeda9cc..e3d8be4feea50 100644 |
934 |
+--- a/net/mac80211/scan.c |
935 |
++++ b/net/mac80211/scan.c |
936 |
+@@ -412,10 +412,6 @@ static void __ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted) |
937 |
+ scan_req = rcu_dereference_protected(local->scan_req, |
938 |
+ lockdep_is_held(&local->mtx)); |
939 |
+ |
940 |
+- if (scan_req != local->int_scan_req) { |
941 |
+- local->scan_info.aborted = aborted; |
942 |
+- cfg80211_scan_done(scan_req, &local->scan_info); |
943 |
+- } |
944 |
+ RCU_INIT_POINTER(local->scan_req, NULL); |
945 |
+ |
946 |
+ scan_sdata = rcu_dereference_protected(local->scan_sdata, |
947 |
+@@ -425,6 +421,13 @@ static void __ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted) |
948 |
+ local->scanning = 0; |
949 |
+ local->scan_chandef.chan = NULL; |
950 |
+ |
951 |
++ synchronize_rcu(); |
952 |
++ |
953 |
++ if (scan_req != local->int_scan_req) { |
954 |
++ local->scan_info.aborted = aborted; |
955 |
++ cfg80211_scan_done(scan_req, &local->scan_info); |
956 |
++ } |
957 |
++ |
958 |
+ /* Set power back to normal operating levels. */ |
959 |
+ ieee80211_hw_config(local, 0); |
960 |
+ |
961 |
+diff --git a/net/netfilter/nf_conntrack_irc.c b/net/netfilter/nf_conntrack_irc.c |
962 |
+index b7436935b57d0..23ead02c6aa50 100644 |
963 |
+--- a/net/netfilter/nf_conntrack_irc.c |
964 |
++++ b/net/netfilter/nf_conntrack_irc.c |
965 |
+@@ -150,15 +150,37 @@ static int help(struct sk_buff *skb, unsigned int protoff, |
966 |
+ data = ib_ptr; |
967 |
+ data_limit = ib_ptr + skb->len - dataoff; |
968 |
+ |
969 |
+- /* strlen("\1DCC SENT t AAAAAAAA P\1\n")=24 |
970 |
+- * 5+MINMATCHLEN+strlen("t AAAAAAAA P\1\n")=14 */ |
971 |
+- while (data < data_limit - (19 + MINMATCHLEN)) { |
972 |
+- if (memcmp(data, "\1DCC ", 5)) { |
973 |
++ /* Skip any whitespace */ |
974 |
++ while (data < data_limit - 10) { |
975 |
++ if (*data == ' ' || *data == '\r' || *data == '\n') |
976 |
++ data++; |
977 |
++ else |
978 |
++ break; |
979 |
++ } |
980 |
++ |
981 |
++ /* strlen("PRIVMSG x ")=10 */ |
982 |
++ if (data < data_limit - 10) { |
983 |
++ if (strncasecmp("PRIVMSG ", data, 8)) |
984 |
++ goto out; |
985 |
++ data += 8; |
986 |
++ } |
987 |
++ |
988 |
++ /* strlen(" :\1DCC SENT t AAAAAAAA P\1\n")=26 |
989 |
++ * 7+MINMATCHLEN+strlen("t AAAAAAAA P\1\n")=26 |
990 |
++ */ |
991 |
++ while (data < data_limit - (21 + MINMATCHLEN)) { |
992 |
++ /* Find first " :", the start of message */ |
993 |
++ if (memcmp(data, " :", 2)) { |
994 |
+ data++; |
995 |
+ continue; |
996 |
+ } |
997 |
++ data += 2; |
998 |
++ |
999 |
++ /* then check that place only for the DCC command */ |
1000 |
++ if (memcmp(data, "\1DCC ", 5)) |
1001 |
++ goto out; |
1002 |
+ data += 5; |
1003 |
+- /* we have at least (19+MINMATCHLEN)-5 bytes valid data left */ |
1004 |
++ /* we have at least (21+MINMATCHLEN)-(2+5) bytes valid data left */ |
1005 |
+ |
1006 |
+ iph = ip_hdr(skb); |
1007 |
+ pr_debug("DCC found in master %pI4:%u %pI4:%u\n", |
1008 |
+@@ -174,7 +196,7 @@ static int help(struct sk_buff *skb, unsigned int protoff, |
1009 |
+ pr_debug("DCC %s detected\n", dccprotos[i]); |
1010 |
+ |
1011 |
+ /* we have at least |
1012 |
+- * (19+MINMATCHLEN)-5-dccprotos[i].matchlen bytes valid |
1013 |
++ * (21+MINMATCHLEN)-7-dccprotos[i].matchlen bytes valid |
1014 |
+ * data left (== 14/13 bytes) */ |
1015 |
+ if (parse_dcc(data, data_limit, &dcc_ip, |
1016 |
+ &dcc_port, &addr_beg_p, &addr_end_p)) { |
1017 |
+diff --git a/net/netfilter/nf_conntrack_sip.c b/net/netfilter/nf_conntrack_sip.c |
1018 |
+index c8d2b6688a2a0..046f118dea06b 100644 |
1019 |
+--- a/net/netfilter/nf_conntrack_sip.c |
1020 |
++++ b/net/netfilter/nf_conntrack_sip.c |
1021 |
+@@ -471,7 +471,7 @@ static int ct_sip_walk_headers(const struct nf_conn *ct, const char *dptr, |
1022 |
+ return ret; |
1023 |
+ if (ret == 0) |
1024 |
+ break; |
1025 |
+- dataoff += *matchoff; |
1026 |
++ dataoff = *matchoff; |
1027 |
+ } |
1028 |
+ *in_header = 0; |
1029 |
+ } |
1030 |
+@@ -483,7 +483,7 @@ static int ct_sip_walk_headers(const struct nf_conn *ct, const char *dptr, |
1031 |
+ break; |
1032 |
+ if (ret == 0) |
1033 |
+ return ret; |
1034 |
+- dataoff += *matchoff; |
1035 |
++ dataoff = *matchoff; |
1036 |
+ } |
1037 |
+ |
1038 |
+ if (in_header) |
1039 |
+diff --git a/net/rxrpc/local_object.c b/net/rxrpc/local_object.c |
1040 |
+index fe190a6918727..5a01479aae3f3 100644 |
1041 |
+--- a/net/rxrpc/local_object.c |
1042 |
++++ b/net/rxrpc/local_object.c |
1043 |
+@@ -452,6 +452,9 @@ static void rxrpc_local_processor(struct work_struct *work) |
1044 |
+ container_of(work, struct rxrpc_local, processor); |
1045 |
+ bool again; |
1046 |
+ |
1047 |
++ if (local->dead) |
1048 |
++ return; |
1049 |
++ |
1050 |
+ trace_rxrpc_local(local->debug_id, rxrpc_local_processing, |
1051 |
+ atomic_read(&local->usage), NULL); |
1052 |
+ |
1053 |
+diff --git a/scripts/mksysmap b/scripts/mksysmap |
1054 |
+index 9aa23d15862a0..ad8bbc52267d0 100755 |
1055 |
+--- a/scripts/mksysmap |
1056 |
++++ b/scripts/mksysmap |
1057 |
+@@ -41,4 +41,4 @@ |
1058 |
+ # so we just ignore them to let readprofile continue to work. |
1059 |
+ # (At least sparc64 has __crc_ in the middle). |
1060 |
+ |
1061 |
+-$NM -n $1 | grep -v '\( [aNUw] \)\|\(__crc_\)\|\( \$[adt]\)\|\( \.L\)' > $2 |
1062 |
++$NM -n $1 | grep -v '\( [aNUw] \)\|\(__crc_\)\|\( \$[adt]\)\|\( \.L\)\|\( L0\)' > $2 |
1063 |
+diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c |
1064 |
+index 686f0fed6f6e4..d3d26be93cd2d 100644 |
1065 |
+--- a/sound/pci/hda/hda_intel.c |
1066 |
++++ b/sound/pci/hda/hda_intel.c |
1067 |
+@@ -2634,6 +2634,8 @@ static const struct pci_device_id azx_ids[] = { |
1068 |
+ /* 5 Series/3400 */ |
1069 |
+ { PCI_DEVICE(0x8086, 0x3b56), |
1070 |
+ .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_INTEL_PCH_NOPM }, |
1071 |
++ { PCI_DEVICE(0x8086, 0x3b57), |
1072 |
++ .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_INTEL_PCH_NOPM }, |
1073 |
+ /* Poulsbo */ |
1074 |
+ { PCI_DEVICE(0x8086, 0x811b), |
1075 |
+ .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_INTEL_PCH_BASE }, |
1076 |
+diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c |
1077 |
+index d21a4eb1ca492..cbd5118570fd5 100644 |
1078 |
+--- a/sound/pci/hda/patch_hdmi.c |
1079 |
++++ b/sound/pci/hda/patch_hdmi.c |
1080 |
+@@ -3455,6 +3455,7 @@ static int patch_tegra_hdmi(struct hda_codec *codec) |
1081 |
+ if (err) |
1082 |
+ return err; |
1083 |
+ |
1084 |
++ codec->depop_delay = 10; |
1085 |
+ codec->patch_ops.build_pcms = tegra_hdmi_build_pcms; |
1086 |
+ spec = codec->spec; |
1087 |
+ spec->chmap.ops.chmap_cea_alloc_validate_get_type = |
1088 |
+diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c |
1089 |
+index 9670db6ad1e1b..cb556390de229 100644 |
1090 |
+--- a/sound/pci/hda/patch_realtek.c |
1091 |
++++ b/sound/pci/hda/patch_realtek.c |
1092 |
+@@ -7081,6 +7081,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { |
1093 |
+ SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC), |
1094 |
+ SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC), |
1095 |
+ SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB), |
1096 |
++ SND_PCI_QUIRK(0x1028, 0x087d, "Dell Precision 5530", ALC289_FIXUP_DUAL_SPK), |
1097 |
+ SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE), |
1098 |
+ SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE), |
1099 |
+ SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), |
1100 |
+diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c |
1101 |
+index 85c33f528d7b3..8d09312b2e428 100644 |
1102 |
+--- a/sound/pci/hda/patch_sigmatel.c |
1103 |
++++ b/sound/pci/hda/patch_sigmatel.c |
1104 |
+@@ -222,6 +222,7 @@ struct sigmatel_spec { |
1105 |
+ |
1106 |
+ /* beep widgets */ |
1107 |
+ hda_nid_t anabeep_nid; |
1108 |
++ bool beep_power_on; |
1109 |
+ |
1110 |
+ /* SPDIF-out mux */ |
1111 |
+ const char * const *spdif_labels; |
1112 |
+@@ -4463,6 +4464,28 @@ static int stac_suspend(struct hda_codec *codec) |
1113 |
+ stac_shutup(codec); |
1114 |
+ return 0; |
1115 |
+ } |
1116 |
++ |
1117 |
++static int stac_check_power_status(struct hda_codec *codec, hda_nid_t nid) |
1118 |
++{ |
1119 |
++#ifdef CONFIG_SND_HDA_INPUT_BEEP |
1120 |
++ struct sigmatel_spec *spec = codec->spec; |
1121 |
++#endif |
1122 |
++ int ret = snd_hda_gen_check_power_status(codec, nid); |
1123 |
++ |
1124 |
++#ifdef CONFIG_SND_HDA_INPUT_BEEP |
1125 |
++ if (nid == spec->gen.beep_nid && codec->beep) { |
1126 |
++ if (codec->beep->enabled != spec->beep_power_on) { |
1127 |
++ spec->beep_power_on = codec->beep->enabled; |
1128 |
++ if (spec->beep_power_on) |
1129 |
++ snd_hda_power_up_pm(codec); |
1130 |
++ else |
1131 |
++ snd_hda_power_down_pm(codec); |
1132 |
++ } |
1133 |
++ ret |= spec->beep_power_on; |
1134 |
++ } |
1135 |
++#endif |
1136 |
++ return ret; |
1137 |
++} |
1138 |
+ #else |
1139 |
+ #define stac_suspend NULL |
1140 |
+ #endif /* CONFIG_PM */ |
1141 |
+@@ -4475,6 +4498,7 @@ static const struct hda_codec_ops stac_patch_ops = { |
1142 |
+ .unsol_event = snd_hda_jack_unsol_event, |
1143 |
+ #ifdef CONFIG_PM |
1144 |
+ .suspend = stac_suspend, |
1145 |
++ .check_power_status = stac_check_power_status, |
1146 |
+ #endif |
1147 |
+ .reboot_notify = stac_shutup, |
1148 |
+ }; |
1149 |
+diff --git a/sound/soc/codecs/nau8824.c b/sound/soc/codecs/nau8824.c |
1150 |
+index 4af87340b1655..4f18bb272e929 100644 |
1151 |
+--- a/sound/soc/codecs/nau8824.c |
1152 |
++++ b/sound/soc/codecs/nau8824.c |
1153 |
+@@ -1075,6 +1075,7 @@ static int nau8824_hw_params(struct snd_pcm_substream *substream, |
1154 |
+ struct snd_soc_component *component = dai->component; |
1155 |
+ struct nau8824 *nau8824 = snd_soc_component_get_drvdata(component); |
1156 |
+ unsigned int val_len = 0, osr, ctrl_val, bclk_fs, bclk_div; |
1157 |
++ int err = -EINVAL; |
1158 |
+ |
1159 |
+ nau8824_sema_acquire(nau8824, HZ); |
1160 |
+ |
1161 |
+@@ -1091,7 +1092,7 @@ static int nau8824_hw_params(struct snd_pcm_substream *substream, |
1162 |
+ osr &= NAU8824_DAC_OVERSAMPLE_MASK; |
1163 |
+ if (nau8824_clock_check(nau8824, substream->stream, |
1164 |
+ nau8824->fs, osr)) |
1165 |
+- return -EINVAL; |
1166 |
++ goto error; |
1167 |
+ regmap_update_bits(nau8824->regmap, NAU8824_REG_CLK_DIVIDER, |
1168 |
+ NAU8824_CLK_DAC_SRC_MASK, |
1169 |
+ osr_dac_sel[osr].clk_src << NAU8824_CLK_DAC_SRC_SFT); |
1170 |
+@@ -1101,7 +1102,7 @@ static int nau8824_hw_params(struct snd_pcm_substream *substream, |
1171 |
+ osr &= NAU8824_ADC_SYNC_DOWN_MASK; |
1172 |
+ if (nau8824_clock_check(nau8824, substream->stream, |
1173 |
+ nau8824->fs, osr)) |
1174 |
+- return -EINVAL; |
1175 |
++ goto error; |
1176 |
+ regmap_update_bits(nau8824->regmap, NAU8824_REG_CLK_DIVIDER, |
1177 |
+ NAU8824_CLK_ADC_SRC_MASK, |
1178 |
+ osr_adc_sel[osr].clk_src << NAU8824_CLK_ADC_SRC_SFT); |
1179 |
+@@ -1122,7 +1123,7 @@ static int nau8824_hw_params(struct snd_pcm_substream *substream, |
1180 |
+ else if (bclk_fs <= 256) |
1181 |
+ bclk_div = 0; |
1182 |
+ else |
1183 |
+- return -EINVAL; |
1184 |
++ goto error; |
1185 |
+ regmap_update_bits(nau8824->regmap, |
1186 |
+ NAU8824_REG_PORT0_I2S_PCM_CTRL_2, |
1187 |
+ NAU8824_I2S_LRC_DIV_MASK | NAU8824_I2S_BLK_DIV_MASK, |
1188 |
+@@ -1143,15 +1144,17 @@ static int nau8824_hw_params(struct snd_pcm_substream *substream, |
1189 |
+ val_len |= NAU8824_I2S_DL_32; |
1190 |
+ break; |
1191 |
+ default: |
1192 |
+- return -EINVAL; |
1193 |
++ goto error; |
1194 |
+ } |
1195 |
+ |
1196 |
+ regmap_update_bits(nau8824->regmap, NAU8824_REG_PORT0_I2S_PCM_CTRL_1, |
1197 |
+ NAU8824_I2S_DL_MASK, val_len); |
1198 |
++ err = 0; |
1199 |
+ |
1200 |
++ error: |
1201 |
+ nau8824_sema_release(nau8824); |
1202 |
+ |
1203 |
+- return 0; |
1204 |
++ return err; |
1205 |
+ } |
1206 |
+ |
1207 |
+ static int nau8824_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) |
1208 |
+@@ -1160,8 +1163,6 @@ static int nau8824_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) |
1209 |
+ struct nau8824 *nau8824 = snd_soc_component_get_drvdata(component); |
1210 |
+ unsigned int ctrl1_val = 0, ctrl2_val = 0; |
1211 |
+ |
1212 |
+- nau8824_sema_acquire(nau8824, HZ); |
1213 |
+- |
1214 |
+ switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { |
1215 |
+ case SND_SOC_DAIFMT_CBM_CFM: |
1216 |
+ ctrl2_val |= NAU8824_I2S_MS_MASTER; |
1217 |
+@@ -1203,6 +1204,8 @@ static int nau8824_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) |
1218 |
+ return -EINVAL; |
1219 |
+ } |
1220 |
+ |
1221 |
++ nau8824_sema_acquire(nau8824, HZ); |
1222 |
++ |
1223 |
+ regmap_update_bits(nau8824->regmap, NAU8824_REG_PORT0_I2S_PCM_CTRL_1, |
1224 |
+ NAU8824_I2S_DF_MASK | NAU8824_I2S_BP_MASK | |
1225 |
+ NAU8824_I2S_PCMB_EN, ctrl1_val); |
1226 |
+diff --git a/tools/perf/util/genelf.c b/tools/perf/util/genelf.c |
1227 |
+index afb8fe3a8e353..65e41e259af8b 100644 |
1228 |
+--- a/tools/perf/util/genelf.c |
1229 |
++++ b/tools/perf/util/genelf.c |
1230 |
+@@ -256,6 +256,7 @@ jit_write_elf(int fd, uint64_t load_addr, const char *sym, |
1231 |
+ Elf_Data *d; |
1232 |
+ Elf_Scn *scn; |
1233 |
+ Elf_Ehdr *ehdr; |
1234 |
++ Elf_Phdr *phdr; |
1235 |
+ Elf_Shdr *shdr; |
1236 |
+ uint64_t eh_frame_base_offset; |
1237 |
+ char *strsym = NULL; |
1238 |
+@@ -290,6 +291,19 @@ jit_write_elf(int fd, uint64_t load_addr, const char *sym, |
1239 |
+ ehdr->e_version = EV_CURRENT; |
1240 |
+ ehdr->e_shstrndx= unwinding ? 4 : 2; /* shdr index for section name */ |
1241 |
+ |
1242 |
++ /* |
1243 |
++ * setup program header |
1244 |
++ */ |
1245 |
++ phdr = elf_newphdr(e, 1); |
1246 |
++ phdr[0].p_type = PT_LOAD; |
1247 |
++ phdr[0].p_offset = 0; |
1248 |
++ phdr[0].p_vaddr = 0; |
1249 |
++ phdr[0].p_paddr = 0; |
1250 |
++ phdr[0].p_filesz = csize; |
1251 |
++ phdr[0].p_memsz = csize; |
1252 |
++ phdr[0].p_flags = PF_X | PF_R; |
1253 |
++ phdr[0].p_align = 8; |
1254 |
++ |
1255 |
+ /* |
1256 |
+ * setup text section |
1257 |
+ */ |
1258 |
+diff --git a/tools/perf/util/genelf.h b/tools/perf/util/genelf.h |
1259 |
+index de322d51c7fe2..23a7401a63d02 100644 |
1260 |
+--- a/tools/perf/util/genelf.h |
1261 |
++++ b/tools/perf/util/genelf.h |
1262 |
+@@ -41,8 +41,10 @@ int jit_add_debug_info(Elf *e, uint64_t code_addr, void *debug, int nr_debug_ent |
1263 |
+ |
1264 |
+ #if GEN_ELF_CLASS == ELFCLASS64 |
1265 |
+ #define elf_newehdr elf64_newehdr |
1266 |
++#define elf_newphdr elf64_newphdr |
1267 |
+ #define elf_getshdr elf64_getshdr |
1268 |
+ #define Elf_Ehdr Elf64_Ehdr |
1269 |
++#define Elf_Phdr Elf64_Phdr |
1270 |
+ #define Elf_Shdr Elf64_Shdr |
1271 |
+ #define Elf_Sym Elf64_Sym |
1272 |
+ #define ELF_ST_TYPE(a) ELF64_ST_TYPE(a) |
1273 |
+@@ -50,8 +52,10 @@ int jit_add_debug_info(Elf *e, uint64_t code_addr, void *debug, int nr_debug_ent |
1274 |
+ #define ELF_ST_VIS(a) ELF64_ST_VISIBILITY(a) |
1275 |
+ #else |
1276 |
+ #define elf_newehdr elf32_newehdr |
1277 |
++#define elf_newphdr elf32_newphdr |
1278 |
+ #define elf_getshdr elf32_getshdr |
1279 |
+ #define Elf_Ehdr Elf32_Ehdr |
1280 |
++#define Elf_Phdr Elf32_Phdr |
1281 |
+ #define Elf_Shdr Elf32_Shdr |
1282 |
+ #define Elf_Sym Elf32_Sym |
1283 |
+ #define ELF_ST_TYPE(a) ELF32_ST_TYPE(a) |
1284 |
+diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c |
1285 |
+index bd33d66139296..5fba57c10eddc 100644 |
1286 |
+--- a/tools/perf/util/symbol-elf.c |
1287 |
++++ b/tools/perf/util/symbol-elf.c |
1288 |
+@@ -1871,8 +1871,8 @@ static int kcore_copy__compare_file(const char *from_dir, const char *to_dir, |
1289 |
+ * unusual. One significant peculiarity is that the mapping (start -> pgoff) |
1290 |
+ * is not the same for the kernel map and the modules map. That happens because |
1291 |
+ * the data is copied adjacently whereas the original kcore has gaps. Finally, |
1292 |
+- * kallsyms and modules files are compared with their copies to check that |
1293 |
+- * modules have not been loaded or unloaded while the copies were taking place. |
1294 |
++ * kallsyms file is compared with its copy to check that modules have not been |
1295 |
++ * loaded or unloaded while the copies were taking place. |
1296 |
+ * |
1297 |
+ * Return: %0 on success, %-1 on failure. |
1298 |
+ */ |
1299 |
+@@ -1935,9 +1935,6 @@ int kcore_copy(const char *from_dir, const char *to_dir) |
1300 |
+ goto out_extract_close; |
1301 |
+ } |
1302 |
+ |
1303 |
+- if (kcore_copy__compare_file(from_dir, to_dir, "modules")) |
1304 |
+- goto out_extract_close; |
1305 |
+- |
1306 |
+ if (kcore_copy__compare_file(from_dir, to_dir, "kallsyms")) |
1307 |
+ goto out_extract_close; |
1308 |
+ |