1 |
commit: 51ba13cea055f3e6f4021f30f2d6a813139afb4f |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Dec 29 13:07:12 2021 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Dec 29 13:07:12 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=51ba13ce |
7 |
|
8 |
Linux patch 5.4.169 |
9 |
|
10 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1168_linux-5.4.169.patch | 1471 ++++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 1475 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index e5039e81..d8d56e36 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -715,6 +715,10 @@ Patch: 1167_linux-5.4.168.patch |
21 |
From: http://www.kernel.org |
22 |
Desc: Linux 5.4.168 |
23 |
|
24 |
+Patch: 1168_linux-5.4.169.patch |
25 |
+From: http://www.kernel.org |
26 |
+Desc: Linux 5.4.169 |
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/1168_linux-5.4.169.patch b/1168_linux-5.4.169.patch |
33 |
new file mode 100644 |
34 |
index 00000000..4d1e8296 |
35 |
--- /dev/null |
36 |
+++ b/1168_linux-5.4.169.patch |
37 |
@@ -0,0 +1,1471 @@ |
38 |
+diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt |
39 |
+index b11e1fd95ee5f..e7f71df9daf1c 100644 |
40 |
+--- a/Documentation/admin-guide/kernel-parameters.txt |
41 |
++++ b/Documentation/admin-guide/kernel-parameters.txt |
42 |
+@@ -2112,8 +2112,12 @@ |
43 |
+ Default is 1 (enabled) |
44 |
+ |
45 |
+ kvm-intel.emulate_invalid_guest_state= |
46 |
+- [KVM,Intel] Enable emulation of invalid guest states |
47 |
+- Default is 0 (disabled) |
48 |
++ [KVM,Intel] Disable emulation of invalid guest state. |
49 |
++ Ignored if kvm-intel.enable_unrestricted_guest=1, as |
50 |
++ guest state is never invalid for unrestricted guests. |
51 |
++ This param doesn't apply to nested guests (L2), as KVM |
52 |
++ never emulates invalid L2 guest state. |
53 |
++ Default is 1 (enabled) |
54 |
+ |
55 |
+ kvm-intel.flexpriority= |
56 |
+ [KVM,Intel] Disable FlexPriority feature (TPR shadow). |
57 |
+diff --git a/Documentation/hwmon/lm90.rst b/Documentation/hwmon/lm90.rst |
58 |
+index 953315987c06e..03851cbe637ce 100644 |
59 |
+--- a/Documentation/hwmon/lm90.rst |
60 |
++++ b/Documentation/hwmon/lm90.rst |
61 |
+@@ -123,6 +123,18 @@ Supported chips: |
62 |
+ |
63 |
+ http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3497 |
64 |
+ |
65 |
++ * Maxim MAX6654 |
66 |
++ |
67 |
++ Prefix: 'max6654' |
68 |
++ |
69 |
++ Addresses scanned: I2C 0x18, 0x19, 0x1a, 0x29, 0x2a, 0x2b, |
70 |
++ |
71 |
++ 0x4c, 0x4d and 0x4e |
72 |
++ |
73 |
++ Datasheet: Publicly available at the Maxim website |
74 |
++ |
75 |
++ https://www.maximintegrated.com/en/products/sensors/MAX6654.html |
76 |
++ |
77 |
+ * Maxim MAX6657 |
78 |
+ |
79 |
+ Prefix: 'max6657' |
80 |
+@@ -253,6 +265,16 @@ Supported chips: |
81 |
+ |
82 |
+ http://www.ti.com/litv/pdf/sbos686 |
83 |
+ |
84 |
++ * Texas Instruments TMP461 |
85 |
++ |
86 |
++ Prefix: 'tmp461' |
87 |
++ |
88 |
++ Addresses scanned: I2C 0x48 through 0x4F |
89 |
++ |
90 |
++ Datasheet: Publicly available at TI website |
91 |
++ |
92 |
++ https://www.ti.com/lit/gpn/tmp461 |
93 |
++ |
94 |
+ Author: Jean Delvare <jdelvare@××××.de> |
95 |
+ |
96 |
+ |
97 |
+@@ -301,6 +323,13 @@ ADT7461, ADT7461A, NCT1008: |
98 |
+ * Extended temperature range (breaks compatibility) |
99 |
+ * Lower resolution for remote temperature |
100 |
+ |
101 |
++MAX6654: |
102 |
++ * Better local resolution |
103 |
++ * Selectable address |
104 |
++ * Remote sensor type selection |
105 |
++ * Extended temperature range |
106 |
++ * Extended resolution only available when conversion rate <= 1 Hz |
107 |
++ |
108 |
+ MAX6657 and MAX6658: |
109 |
+ * Better local resolution |
110 |
+ * Remote sensor type selection |
111 |
+@@ -336,8 +365,8 @@ SA56004X: |
112 |
+ |
113 |
+ All temperature values are given in degrees Celsius. Resolution |
114 |
+ is 1.0 degree for the local temperature, 0.125 degree for the remote |
115 |
+-temperature, except for the MAX6657, MAX6658 and MAX6659 which have a |
116 |
+-resolution of 0.125 degree for both temperatures. |
117 |
++temperature, except for the MAX6654, MAX6657, MAX6658 and MAX6659 which have |
118 |
++a resolution of 0.125 degree for both temperatures. |
119 |
+ |
120 |
+ Each sensor has its own high and low limits, plus a critical limit. |
121 |
+ Additionally, there is a relative hysteresis value common to both critical |
122 |
+diff --git a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt |
123 |
+index e3abfbd32f71e..b020e6ce6dd49 100644 |
124 |
+--- a/Documentation/networking/bonding.txt |
125 |
++++ b/Documentation/networking/bonding.txt |
126 |
+@@ -191,11 +191,12 @@ ad_actor_sys_prio |
127 |
+ ad_actor_system |
128 |
+ |
129 |
+ In an AD system, this specifies the mac-address for the actor in |
130 |
+- protocol packet exchanges (LACPDUs). The value cannot be NULL or |
131 |
+- multicast. It is preferred to have the local-admin bit set for this |
132 |
+- mac but driver does not enforce it. If the value is not given then |
133 |
+- system defaults to using the masters' mac address as actors' system |
134 |
+- address. |
135 |
++ protocol packet exchanges (LACPDUs). The value cannot be a multicast |
136 |
++ address. If the all-zeroes MAC is specified, bonding will internally |
137 |
++ use the MAC of the bond itself. It is preferred to have the |
138 |
++ local-admin bit set for this mac but driver does not enforce it. If |
139 |
++ the value is not given then system defaults to using the masters' |
140 |
++ mac address as actors' system address. |
141 |
+ |
142 |
+ This parameter has effect only in 802.3ad mode and is available through |
143 |
+ SysFs interface. |
144 |
+diff --git a/Makefile b/Makefile |
145 |
+index c23f5b17d239f..151fd24540125 100644 |
146 |
+--- a/Makefile |
147 |
++++ b/Makefile |
148 |
+@@ -1,7 +1,7 @@ |
149 |
+ # SPDX-License-Identifier: GPL-2.0 |
150 |
+ VERSION = 5 |
151 |
+ PATCHLEVEL = 4 |
152 |
+-SUBLEVEL = 168 |
153 |
++SUBLEVEL = 169 |
154 |
+ EXTRAVERSION = |
155 |
+ NAME = Kleptomaniac Octopus |
156 |
+ |
157 |
+diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S |
158 |
+index b62d74a2c73a5..4937d514318ec 100644 |
159 |
+--- a/arch/arm/kernel/entry-armv.S |
160 |
++++ b/arch/arm/kernel/entry-armv.S |
161 |
+@@ -596,11 +596,9 @@ call_fpe: |
162 |
+ tstne r0, #0x04000000 @ bit 26 set on both ARM and Thumb-2 |
163 |
+ reteq lr |
164 |
+ and r8, r0, #0x00000f00 @ mask out CP number |
165 |
+- THUMB( lsr r8, r8, #8 ) |
166 |
+ mov r7, #1 |
167 |
+- add r6, r10, #TI_USED_CP |
168 |
+- ARM( strb r7, [r6, r8, lsr #8] ) @ set appropriate used_cp[] |
169 |
+- THUMB( strb r7, [r6, r8] ) @ set appropriate used_cp[] |
170 |
++ add r6, r10, r8, lsr #8 @ add used_cp[] array offset first |
171 |
++ strb r7, [r6, #TI_USED_CP] @ set appropriate used_cp[] |
172 |
+ #ifdef CONFIG_IWMMXT |
173 |
+ @ Test if we need to give access to iWMMXt coprocessors |
174 |
+ ldr r5, [r10, #TI_FLAGS] |
175 |
+@@ -609,7 +607,7 @@ call_fpe: |
176 |
+ bcs iwmmxt_task_enable |
177 |
+ #endif |
178 |
+ ARM( add pc, pc, r8, lsr #6 ) |
179 |
+- THUMB( lsl r8, r8, #2 ) |
180 |
++ THUMB( lsr r8, r8, #6 ) |
181 |
+ THUMB( add pc, r8 ) |
182 |
+ nop |
183 |
+ |
184 |
+diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus.dts |
185 |
+index db6ea7b58999b..19f930f43936e 100644 |
186 |
+--- a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus.dts |
187 |
++++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus.dts |
188 |
+@@ -72,7 +72,7 @@ |
189 |
+ pinctrl-0 = <&emac_rgmii_pins>; |
190 |
+ phy-supply = <®_gmac_3v3>; |
191 |
+ phy-handle = <&ext_rgmii_phy>; |
192 |
+- phy-mode = "rgmii"; |
193 |
++ phy-mode = "rgmii-id"; |
194 |
+ status = "okay"; |
195 |
+ }; |
196 |
+ |
197 |
+diff --git a/arch/parisc/kernel/syscall.S b/arch/parisc/kernel/syscall.S |
198 |
+index a37814cb66c76..8b616aada6492 100644 |
199 |
+--- a/arch/parisc/kernel/syscall.S |
200 |
++++ b/arch/parisc/kernel/syscall.S |
201 |
+@@ -478,7 +478,7 @@ lws_start: |
202 |
+ extrd,u %r1,PSW_W_BIT,1,%r1 |
203 |
+ /* sp must be aligned on 4, so deposit the W bit setting into |
204 |
+ * the bottom of sp temporarily */ |
205 |
+- or,ev %r1,%r30,%r30 |
206 |
++ or,od %r1,%r30,%r30 |
207 |
+ |
208 |
+ /* Clip LWS number to a 32-bit value for 32-bit processes */ |
209 |
+ depdi 0, 31, 32, %r20 |
210 |
+diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h |
211 |
+index ea85f23d9e227..1ae7c20f54691 100644 |
212 |
+--- a/arch/x86/include/asm/pgtable.h |
213 |
++++ b/arch/x86/include/asm/pgtable.h |
214 |
+@@ -1375,8 +1375,8 @@ static inline pmd_t pmd_swp_clear_soft_dirty(pmd_t pmd) |
215 |
+ #endif |
216 |
+ #endif |
217 |
+ |
218 |
+-#define PKRU_AD_BIT 0x1 |
219 |
+-#define PKRU_WD_BIT 0x2 |
220 |
++#define PKRU_AD_BIT 0x1u |
221 |
++#define PKRU_WD_BIT 0x2u |
222 |
+ #define PKRU_BITS_PER_PKEY 2 |
223 |
+ |
224 |
+ #ifdef CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS |
225 |
+diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c |
226 |
+index 8a93d5a494fff..ad2e6d55d4a59 100644 |
227 |
+--- a/drivers/char/ipmi/ipmi_msghandler.c |
228 |
++++ b/drivers/char/ipmi/ipmi_msghandler.c |
229 |
+@@ -2938,7 +2938,7 @@ cleanup_bmc_device(struct kref *ref) |
230 |
+ * with removing the device attributes while reading a device |
231 |
+ * attribute. |
232 |
+ */ |
233 |
+- schedule_work(&bmc->remove_work); |
234 |
++ queue_work(remove_work_wq, &bmc->remove_work); |
235 |
+ } |
236 |
+ |
237 |
+ /* |
238 |
+@@ -5156,22 +5156,27 @@ static int ipmi_init_msghandler(void) |
239 |
+ if (initialized) |
240 |
+ goto out; |
241 |
+ |
242 |
+- init_srcu_struct(&ipmi_interfaces_srcu); |
243 |
+- |
244 |
+- timer_setup(&ipmi_timer, ipmi_timeout, 0); |
245 |
+- mod_timer(&ipmi_timer, jiffies + IPMI_TIMEOUT_JIFFIES); |
246 |
+- |
247 |
+- atomic_notifier_chain_register(&panic_notifier_list, &panic_block); |
248 |
++ rv = init_srcu_struct(&ipmi_interfaces_srcu); |
249 |
++ if (rv) |
250 |
++ goto out; |
251 |
+ |
252 |
+ remove_work_wq = create_singlethread_workqueue("ipmi-msghandler-remove-wq"); |
253 |
+ if (!remove_work_wq) { |
254 |
+ pr_err("unable to create ipmi-msghandler-remove-wq workqueue"); |
255 |
+ rv = -ENOMEM; |
256 |
+- goto out; |
257 |
++ goto out_wq; |
258 |
+ } |
259 |
+ |
260 |
++ timer_setup(&ipmi_timer, ipmi_timeout, 0); |
261 |
++ mod_timer(&ipmi_timer, jiffies + IPMI_TIMEOUT_JIFFIES); |
262 |
++ |
263 |
++ atomic_notifier_chain_register(&panic_notifier_list, &panic_block); |
264 |
++ |
265 |
+ initialized = true; |
266 |
+ |
267 |
++out_wq: |
268 |
++ if (rv) |
269 |
++ cleanup_srcu_struct(&ipmi_interfaces_srcu); |
270 |
+ out: |
271 |
+ mutex_unlock(&ipmi_interfaces_mutex); |
272 |
+ return rv; |
273 |
+diff --git a/drivers/char/ipmi/ipmi_ssif.c b/drivers/char/ipmi/ipmi_ssif.c |
274 |
+index 8ac390c2b5147..bb42a1c92cae5 100644 |
275 |
+--- a/drivers/char/ipmi/ipmi_ssif.c |
276 |
++++ b/drivers/char/ipmi/ipmi_ssif.c |
277 |
+@@ -1704,6 +1704,9 @@ static int ssif_probe(struct i2c_client *client, const struct i2c_device_id *id) |
278 |
+ } |
279 |
+ } |
280 |
+ |
281 |
++ ssif_info->client = client; |
282 |
++ i2c_set_clientdata(client, ssif_info); |
283 |
++ |
284 |
+ rv = ssif_check_and_remove(client, ssif_info); |
285 |
+ /* If rv is 0 and addr source is not SI_ACPI, continue probing */ |
286 |
+ if (!rv && ssif_info->addr_source == SI_ACPI) { |
287 |
+@@ -1724,9 +1727,6 @@ static int ssif_probe(struct i2c_client *client, const struct i2c_device_id *id) |
288 |
+ ipmi_addr_src_to_str(ssif_info->addr_source), |
289 |
+ client->addr, client->adapter->name, slave_addr); |
290 |
+ |
291 |
+- ssif_info->client = client; |
292 |
+- i2c_set_clientdata(client, ssif_info); |
293 |
+- |
294 |
+ /* Now check for system interface capabilities */ |
295 |
+ msg[0] = IPMI_NETFN_APP_REQUEST << 2; |
296 |
+ msg[1] = IPMI_GET_SYSTEM_INTERFACE_CAPABILITIES_CMD; |
297 |
+@@ -1926,6 +1926,7 @@ static int ssif_probe(struct i2c_client *client, const struct i2c_device_id *id) |
298 |
+ |
299 |
+ dev_err(&ssif_info->client->dev, |
300 |
+ "Unable to start IPMI SSIF: %d\n", rv); |
301 |
++ i2c_set_clientdata(client, NULL); |
302 |
+ kfree(ssif_info); |
303 |
+ } |
304 |
+ kfree(resp); |
305 |
+diff --git a/drivers/hid/hid-holtek-mouse.c b/drivers/hid/hid-holtek-mouse.c |
306 |
+index b7172c48ef9f0..7c907939bfae1 100644 |
307 |
+--- a/drivers/hid/hid-holtek-mouse.c |
308 |
++++ b/drivers/hid/hid-holtek-mouse.c |
309 |
+@@ -65,8 +65,23 @@ static __u8 *holtek_mouse_report_fixup(struct hid_device *hdev, __u8 *rdesc, |
310 |
+ static int holtek_mouse_probe(struct hid_device *hdev, |
311 |
+ const struct hid_device_id *id) |
312 |
+ { |
313 |
++ int ret; |
314 |
++ |
315 |
+ if (!hid_is_usb(hdev)) |
316 |
+ return -EINVAL; |
317 |
++ |
318 |
++ ret = hid_parse(hdev); |
319 |
++ if (ret) { |
320 |
++ hid_err(hdev, "hid parse failed: %d\n", ret); |
321 |
++ return ret; |
322 |
++ } |
323 |
++ |
324 |
++ ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); |
325 |
++ if (ret) { |
326 |
++ hid_err(hdev, "hw start failed: %d\n", ret); |
327 |
++ return ret; |
328 |
++ } |
329 |
++ |
330 |
+ return 0; |
331 |
+ } |
332 |
+ |
333 |
+diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig |
334 |
+index 13a6b4afb4b36..049563d503b68 100644 |
335 |
+--- a/drivers/hwmon/Kconfig |
336 |
++++ b/drivers/hwmon/Kconfig |
337 |
+@@ -1132,10 +1132,11 @@ config SENSORS_LM90 |
338 |
+ help |
339 |
+ If you say yes here you get support for National Semiconductor LM90, |
340 |
+ LM86, LM89 and LM99, Analog Devices ADM1032, ADT7461, and ADT7461A, |
341 |
+- Maxim MAX6646, MAX6647, MAX6648, MAX6649, MAX6657, MAX6658, MAX6659, |
342 |
+- MAX6680, MAX6681, MAX6692, MAX6695, MAX6696, ON Semiconductor NCT1008, |
343 |
+- Winbond/Nuvoton W83L771W/G/AWG/ASG, Philips SA56004, GMT G781, and |
344 |
+- Texas Instruments TMP451 sensor chips. |
345 |
++ Maxim MAX6646, MAX6647, MAX6648, MAX6649, MAX6654, MAX6657, MAX6658, |
346 |
++ MAX6659, MAX6680, MAX6681, MAX6692, MAX6695, MAX6696, |
347 |
++ ON Semiconductor NCT1008, Winbond/Nuvoton W83L771W/G/AWG/ASG, |
348 |
++ Philips SA56004, GMT G781, Texas Instruments TMP451 and TMP461 |
349 |
++ sensor chips. |
350 |
+ |
351 |
+ This driver can also be built as a module. If so, the module |
352 |
+ will be called lm90. |
353 |
+diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c |
354 |
+index 9b3c9f390ef81..9abb4507f572b 100644 |
355 |
+--- a/drivers/hwmon/lm90.c |
356 |
++++ b/drivers/hwmon/lm90.c |
357 |
+@@ -35,6 +35,15 @@ |
358 |
+ * explicitly as max6659, or if its address is not 0x4c. |
359 |
+ * These chips lack the remote temperature offset feature. |
360 |
+ * |
361 |
++ * This driver also supports the MAX6654 chip made by Maxim. This chip can be |
362 |
++ * at 9 different addresses, similar to MAX6680/MAX6681. The MAX6654 is similar |
363 |
++ * to MAX6657/MAX6658/MAX6659, but does not support critical temperature |
364 |
++ * limits. Extended range is available by setting the configuration register |
365 |
++ * accordingly, and is done during initialization. Extended precision is only |
366 |
++ * available at conversion rates of 1 Hz and slower. Note that extended |
367 |
++ * precision is not enabled by default, as this driver initializes all chips |
368 |
++ * to 2 Hz by design. |
369 |
++ * |
370 |
+ * This driver also supports the MAX6646, MAX6647, MAX6648, MAX6649 and |
371 |
+ * MAX6692 chips made by Maxim. These are again similar to the LM86, |
372 |
+ * but they use unsigned temperature values and can report temperatures |
373 |
+@@ -61,10 +70,10 @@ |
374 |
+ * This driver also supports the G781 from GMT. This device is compatible |
375 |
+ * with the ADM1032. |
376 |
+ * |
377 |
+- * This driver also supports TMP451 from Texas Instruments. This device is |
378 |
+- * supported in both compatibility and extended mode. It's mostly compatible |
379 |
+- * with ADT7461 except for local temperature low byte register and max |
380 |
+- * conversion rate. |
381 |
++ * This driver also supports TMP451 and TMP461 from Texas Instruments. |
382 |
++ * Those devices are supported in both compatibility and extended mode. |
383 |
++ * They are mostly compatible with ADT7461 except for local temperature |
384 |
++ * low byte register and max conversion rate. |
385 |
+ * |
386 |
+ * Since the LM90 was the first chipset supported by this driver, most |
387 |
+ * comments will refer to this chipset, but are actually general and |
388 |
+@@ -94,8 +103,8 @@ |
389 |
+ * have address 0x4d. |
390 |
+ * MAX6647 has address 0x4e. |
391 |
+ * MAX6659 can have address 0x4c, 0x4d or 0x4e. |
392 |
+- * MAX6680 and MAX6681 can have address 0x18, 0x19, 0x1a, 0x29, 0x2a, 0x2b, |
393 |
+- * 0x4c, 0x4d or 0x4e. |
394 |
++ * MAX6654, MAX6680, and MAX6681 can have address 0x18, 0x19, 0x1a, 0x29, |
395 |
++ * 0x2a, 0x2b, 0x4c, 0x4d or 0x4e. |
396 |
+ * SA56004 can have address 0x48 through 0x4F. |
397 |
+ */ |
398 |
+ |
399 |
+@@ -104,7 +113,7 @@ static const unsigned short normal_i2c[] = { |
400 |
+ 0x4d, 0x4e, 0x4f, I2C_CLIENT_END }; |
401 |
+ |
402 |
+ enum chips { lm90, adm1032, lm99, lm86, max6657, max6659, adt7461, max6680, |
403 |
+- max6646, w83l771, max6696, sa56004, g781, tmp451 }; |
404 |
++ max6646, w83l771, max6696, sa56004, g781, tmp451, tmp461, max6654 }; |
405 |
+ |
406 |
+ /* |
407 |
+ * The LM90 registers |
408 |
+@@ -145,7 +154,7 @@ enum chips { lm90, adm1032, lm99, lm86, max6657, max6659, adt7461, max6680, |
409 |
+ #define LM90_REG_R_TCRIT_HYST 0x21 |
410 |
+ #define LM90_REG_W_TCRIT_HYST 0x21 |
411 |
+ |
412 |
+-/* MAX6646/6647/6649/6657/6658/6659/6695/6696 registers */ |
413 |
++/* MAX6646/6647/6649/6654/6657/6658/6659/6695/6696 registers */ |
414 |
+ |
415 |
+ #define MAX6657_REG_R_LOCAL_TEMPL 0x11 |
416 |
+ #define MAX6696_REG_R_STATUS2 0x12 |
417 |
+@@ -160,8 +169,12 @@ enum chips { lm90, adm1032, lm99, lm86, max6657, max6659, adt7461, max6680, |
418 |
+ |
419 |
+ #define LM90_MAX_CONVRATE_MS 16000 /* Maximum conversion rate in ms */ |
420 |
+ |
421 |
+-/* TMP451 registers */ |
422 |
++/* TMP451/TMP461 registers */ |
423 |
+ #define TMP451_REG_R_LOCAL_TEMPL 0x15 |
424 |
++#define TMP451_REG_CONALERT 0x22 |
425 |
++ |
426 |
++#define TMP461_REG_CHEN 0x16 |
427 |
++#define TMP461_REG_DFC 0x24 |
428 |
+ |
429 |
+ /* |
430 |
+ * Device flags |
431 |
+@@ -174,7 +187,10 @@ enum chips { lm90, adm1032, lm99, lm86, max6657, max6659, adt7461, max6680, |
432 |
+ #define LM90_HAVE_EMERGENCY_ALARM (1 << 5)/* emergency alarm */ |
433 |
+ #define LM90_HAVE_TEMP3 (1 << 6) /* 3rd temperature sensor */ |
434 |
+ #define LM90_HAVE_BROKEN_ALERT (1 << 7) /* Broken alert */ |
435 |
+-#define LM90_PAUSE_FOR_CONFIG (1 << 8) /* Pause conversion for config */ |
436 |
++#define LM90_HAVE_EXTENDED_TEMP (1 << 8) /* extended temperature support*/ |
437 |
++#define LM90_PAUSE_FOR_CONFIG (1 << 9) /* Pause conversion for config */ |
438 |
++#define LM90_HAVE_CRIT (1 << 10)/* Chip supports CRIT/OVERT register */ |
439 |
++#define LM90_HAVE_CRIT_ALRM_SWP (1 << 11)/* critical alarm bits swapped */ |
440 |
+ |
441 |
+ /* LM90 status */ |
442 |
+ #define LM90_STATUS_LTHRM (1 << 0) /* local THERM limit tripped */ |
443 |
+@@ -184,6 +200,7 @@ enum chips { lm90, adm1032, lm99, lm86, max6657, max6659, adt7461, max6680, |
444 |
+ #define LM90_STATUS_RHIGH (1 << 4) /* remote high temp limit tripped */ |
445 |
+ #define LM90_STATUS_LLOW (1 << 5) /* local low temp limit tripped */ |
446 |
+ #define LM90_STATUS_LHIGH (1 << 6) /* local high temp limit tripped */ |
447 |
++#define LM90_STATUS_BUSY (1 << 7) /* conversion is ongoing */ |
448 |
+ |
449 |
+ #define MAX6696_STATUS2_R2THRM (1 << 1) /* remote2 THERM limit tripped */ |
450 |
+ #define MAX6696_STATUS2_R2OPEN (1 << 2) /* remote2 is an open circuit */ |
451 |
+@@ -209,6 +226,7 @@ static const struct i2c_device_id lm90_id[] = { |
452 |
+ { "max6646", max6646 }, |
453 |
+ { "max6647", max6646 }, |
454 |
+ { "max6649", max6646 }, |
455 |
++ { "max6654", max6654 }, |
456 |
+ { "max6657", max6657 }, |
457 |
+ { "max6658", max6657 }, |
458 |
+ { "max6659", max6659 }, |
459 |
+@@ -220,6 +238,7 @@ static const struct i2c_device_id lm90_id[] = { |
460 |
+ { "w83l771", w83l771 }, |
461 |
+ { "sa56004", sa56004 }, |
462 |
+ { "tmp451", tmp451 }, |
463 |
++ { "tmp461", tmp461 }, |
464 |
+ { } |
465 |
+ }; |
466 |
+ MODULE_DEVICE_TABLE(i2c, lm90_id); |
467 |
+@@ -269,6 +288,10 @@ static const struct of_device_id __maybe_unused lm90_of_match[] = { |
468 |
+ .compatible = "dallas,max6649", |
469 |
+ .data = (void *)max6646 |
470 |
+ }, |
471 |
++ { |
472 |
++ .compatible = "dallas,max6654", |
473 |
++ .data = (void *)max6654 |
474 |
++ }, |
475 |
+ { |
476 |
+ .compatible = "dallas,max6657", |
477 |
+ .data = (void *)max6657 |
478 |
+@@ -313,6 +336,10 @@ static const struct of_device_id __maybe_unused lm90_of_match[] = { |
479 |
+ .compatible = "ti,tmp451", |
480 |
+ .data = (void *)tmp451 |
481 |
+ }, |
482 |
++ { |
483 |
++ .compatible = "ti,tmp461", |
484 |
++ .data = (void *)tmp461 |
485 |
++ }, |
486 |
+ { }, |
487 |
+ }; |
488 |
+ MODULE_DEVICE_TABLE(of, lm90_of_match); |
489 |
+@@ -331,80 +358,98 @@ struct lm90_params { |
490 |
+ static const struct lm90_params lm90_params[] = { |
491 |
+ [adm1032] = { |
492 |
+ .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT |
493 |
+- | LM90_HAVE_BROKEN_ALERT, |
494 |
++ | LM90_HAVE_BROKEN_ALERT | LM90_HAVE_CRIT, |
495 |
+ .alert_alarms = 0x7c, |
496 |
+ .max_convrate = 10, |
497 |
+ }, |
498 |
+ [adt7461] = { |
499 |
+ .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT |
500 |
+- | LM90_HAVE_BROKEN_ALERT, |
501 |
++ | LM90_HAVE_BROKEN_ALERT | LM90_HAVE_EXTENDED_TEMP |
502 |
++ | LM90_HAVE_CRIT, |
503 |
+ .alert_alarms = 0x7c, |
504 |
+ .max_convrate = 10, |
505 |
+ }, |
506 |
+ [g781] = { |
507 |
+ .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT |
508 |
+- | LM90_HAVE_BROKEN_ALERT, |
509 |
++ | LM90_HAVE_BROKEN_ALERT | LM90_HAVE_CRIT, |
510 |
+ .alert_alarms = 0x7c, |
511 |
+ .max_convrate = 8, |
512 |
+ }, |
513 |
+ [lm86] = { |
514 |
+- .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT, |
515 |
++ .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT |
516 |
++ | LM90_HAVE_CRIT, |
517 |
+ .alert_alarms = 0x7b, |
518 |
+ .max_convrate = 9, |
519 |
+ }, |
520 |
+ [lm90] = { |
521 |
+- .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT, |
522 |
++ .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT |
523 |
++ | LM90_HAVE_CRIT, |
524 |
+ .alert_alarms = 0x7b, |
525 |
+ .max_convrate = 9, |
526 |
+ }, |
527 |
+ [lm99] = { |
528 |
+- .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT, |
529 |
++ .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT |
530 |
++ | LM90_HAVE_CRIT, |
531 |
+ .alert_alarms = 0x7b, |
532 |
+ .max_convrate = 9, |
533 |
+ }, |
534 |
+ [max6646] = { |
535 |
++ .flags = LM90_HAVE_CRIT, |
536 |
+ .alert_alarms = 0x7c, |
537 |
+ .max_convrate = 6, |
538 |
+ .reg_local_ext = MAX6657_REG_R_LOCAL_TEMPL, |
539 |
+ }, |
540 |
++ [max6654] = { |
541 |
++ .alert_alarms = 0x7c, |
542 |
++ .max_convrate = 7, |
543 |
++ .reg_local_ext = MAX6657_REG_R_LOCAL_TEMPL, |
544 |
++ }, |
545 |
+ [max6657] = { |
546 |
+- .flags = LM90_PAUSE_FOR_CONFIG, |
547 |
++ .flags = LM90_PAUSE_FOR_CONFIG | LM90_HAVE_CRIT, |
548 |
+ .alert_alarms = 0x7c, |
549 |
+ .max_convrate = 8, |
550 |
+ .reg_local_ext = MAX6657_REG_R_LOCAL_TEMPL, |
551 |
+ }, |
552 |
+ [max6659] = { |
553 |
+- .flags = LM90_HAVE_EMERGENCY, |
554 |
++ .flags = LM90_HAVE_EMERGENCY | LM90_HAVE_CRIT, |
555 |
+ .alert_alarms = 0x7c, |
556 |
+ .max_convrate = 8, |
557 |
+ .reg_local_ext = MAX6657_REG_R_LOCAL_TEMPL, |
558 |
+ }, |
559 |
+ [max6680] = { |
560 |
+- .flags = LM90_HAVE_OFFSET, |
561 |
++ .flags = LM90_HAVE_OFFSET | LM90_HAVE_CRIT |
562 |
++ | LM90_HAVE_CRIT_ALRM_SWP, |
563 |
+ .alert_alarms = 0x7c, |
564 |
+ .max_convrate = 7, |
565 |
+ }, |
566 |
+ [max6696] = { |
567 |
+ .flags = LM90_HAVE_EMERGENCY |
568 |
+- | LM90_HAVE_EMERGENCY_ALARM | LM90_HAVE_TEMP3, |
569 |
++ | LM90_HAVE_EMERGENCY_ALARM | LM90_HAVE_TEMP3 | LM90_HAVE_CRIT, |
570 |
+ .alert_alarms = 0x1c7c, |
571 |
+ .max_convrate = 6, |
572 |
+ .reg_local_ext = MAX6657_REG_R_LOCAL_TEMPL, |
573 |
+ }, |
574 |
+ [w83l771] = { |
575 |
+- .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT, |
576 |
++ .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT | LM90_HAVE_CRIT, |
577 |
+ .alert_alarms = 0x7c, |
578 |
+ .max_convrate = 8, |
579 |
+ }, |
580 |
+ [sa56004] = { |
581 |
+- .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT, |
582 |
++ .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT | LM90_HAVE_CRIT, |
583 |
+ .alert_alarms = 0x7b, |
584 |
+ .max_convrate = 9, |
585 |
+ .reg_local_ext = SA56004_REG_R_LOCAL_TEMPL, |
586 |
+ }, |
587 |
+ [tmp451] = { |
588 |
+ .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT |
589 |
+- | LM90_HAVE_BROKEN_ALERT, |
590 |
++ | LM90_HAVE_BROKEN_ALERT | LM90_HAVE_EXTENDED_TEMP | LM90_HAVE_CRIT, |
591 |
++ .alert_alarms = 0x7c, |
592 |
++ .max_convrate = 9, |
593 |
++ .reg_local_ext = TMP451_REG_R_LOCAL_TEMPL, |
594 |
++ }, |
595 |
++ [tmp461] = { |
596 |
++ .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT |
597 |
++ | LM90_HAVE_BROKEN_ALERT | LM90_HAVE_EXTENDED_TEMP | LM90_HAVE_CRIT, |
598 |
+ .alert_alarms = 0x7c, |
599 |
+ .max_convrate = 9, |
600 |
+ .reg_local_ext = TMP451_REG_R_LOCAL_TEMPL, |
601 |
+@@ -632,20 +677,22 @@ static int lm90_update_limits(struct device *dev) |
602 |
+ struct i2c_client *client = data->client; |
603 |
+ int val; |
604 |
+ |
605 |
+- val = lm90_read_reg(client, LM90_REG_R_LOCAL_CRIT); |
606 |
+- if (val < 0) |
607 |
+- return val; |
608 |
+- data->temp8[LOCAL_CRIT] = val; |
609 |
++ if (data->flags & LM90_HAVE_CRIT) { |
610 |
++ val = lm90_read_reg(client, LM90_REG_R_LOCAL_CRIT); |
611 |
++ if (val < 0) |
612 |
++ return val; |
613 |
++ data->temp8[LOCAL_CRIT] = val; |
614 |
+ |
615 |
+- val = lm90_read_reg(client, LM90_REG_R_REMOTE_CRIT); |
616 |
+- if (val < 0) |
617 |
+- return val; |
618 |
+- data->temp8[REMOTE_CRIT] = val; |
619 |
++ val = lm90_read_reg(client, LM90_REG_R_REMOTE_CRIT); |
620 |
++ if (val < 0) |
621 |
++ return val; |
622 |
++ data->temp8[REMOTE_CRIT] = val; |
623 |
+ |
624 |
+- val = lm90_read_reg(client, LM90_REG_R_TCRIT_HYST); |
625 |
+- if (val < 0) |
626 |
+- return val; |
627 |
+- data->temp_hyst = val; |
628 |
++ val = lm90_read_reg(client, LM90_REG_R_TCRIT_HYST); |
629 |
++ if (val < 0) |
630 |
++ return val; |
631 |
++ data->temp_hyst = val; |
632 |
++ } |
633 |
+ |
634 |
+ val = lm90_read_reg(client, LM90_REG_R_REMOTE_LOWH); |
635 |
+ if (val < 0) |
636 |
+@@ -773,7 +820,7 @@ static int lm90_update_device(struct device *dev) |
637 |
+ val = lm90_read_reg(client, LM90_REG_R_STATUS); |
638 |
+ if (val < 0) |
639 |
+ return val; |
640 |
+- data->alarms = val; /* lower 8 bit of alarms */ |
641 |
++ data->alarms = val & ~LM90_STATUS_BUSY; |
642 |
+ |
643 |
+ if (data->kind == max6696) { |
644 |
+ val = lm90_select_remote_channel(data, 1); |
645 |
+@@ -979,7 +1026,7 @@ static int lm90_get_temp11(struct lm90_data *data, int index) |
646 |
+ s16 temp11 = data->temp11[index]; |
647 |
+ int temp; |
648 |
+ |
649 |
+- if (data->kind == adt7461 || data->kind == tmp451) |
650 |
++ if (data->flags & LM90_HAVE_EXTENDED_TEMP) |
651 |
+ temp = temp_from_u16_adt7461(data, temp11); |
652 |
+ else if (data->kind == max6646) |
653 |
+ temp = temp_from_u16(temp11); |
654 |
+@@ -1013,7 +1060,7 @@ static int lm90_set_temp11(struct lm90_data *data, int index, long val) |
655 |
+ if (data->kind == lm99 && index <= 2) |
656 |
+ val -= 16000; |
657 |
+ |
658 |
+- if (data->kind == adt7461 || data->kind == tmp451) |
659 |
++ if (data->flags & LM90_HAVE_EXTENDED_TEMP) |
660 |
+ data->temp11[index] = temp_to_u16_adt7461(data, val); |
661 |
+ else if (data->kind == max6646) |
662 |
+ data->temp11[index] = temp_to_u8(val) << 8; |
663 |
+@@ -1040,7 +1087,7 @@ static int lm90_get_temp8(struct lm90_data *data, int index) |
664 |
+ s8 temp8 = data->temp8[index]; |
665 |
+ int temp; |
666 |
+ |
667 |
+- if (data->kind == adt7461 || data->kind == tmp451) |
668 |
++ if (data->flags & LM90_HAVE_EXTENDED_TEMP) |
669 |
+ temp = temp_from_u8_adt7461(data, temp8); |
670 |
+ else if (data->kind == max6646) |
671 |
+ temp = temp_from_u8(temp8); |
672 |
+@@ -1073,7 +1120,7 @@ static int lm90_set_temp8(struct lm90_data *data, int index, long val) |
673 |
+ if (data->kind == lm99 && index == 3) |
674 |
+ val -= 16000; |
675 |
+ |
676 |
+- if (data->kind == adt7461 || data->kind == tmp451) |
677 |
++ if (data->flags & LM90_HAVE_EXTENDED_TEMP) |
678 |
+ data->temp8[index] = temp_to_u8_adt7461(data, val); |
679 |
+ else if (data->kind == max6646) |
680 |
+ data->temp8[index] = temp_to_u8(val); |
681 |
+@@ -1091,7 +1138,7 @@ static int lm90_get_temphyst(struct lm90_data *data, int index) |
682 |
+ { |
683 |
+ int temp; |
684 |
+ |
685 |
+- if (data->kind == adt7461 || data->kind == tmp451) |
686 |
++ if (data->flags & LM90_HAVE_EXTENDED_TEMP) |
687 |
+ temp = temp_from_u8_adt7461(data, data->temp8[index]); |
688 |
+ else if (data->kind == max6646) |
689 |
+ temp = temp_from_u8(data->temp8[index]); |
690 |
+@@ -1111,7 +1158,7 @@ static int lm90_set_temphyst(struct lm90_data *data, long val) |
691 |
+ int temp; |
692 |
+ int err; |
693 |
+ |
694 |
+- if (data->kind == adt7461 || data->kind == tmp451) |
695 |
++ if (data->flags & LM90_HAVE_EXTENDED_TEMP) |
696 |
+ temp = temp_from_u8_adt7461(data, data->temp8[LOCAL_CRIT]); |
697 |
+ else if (data->kind == max6646) |
698 |
+ temp = temp_from_u8(data->temp8[LOCAL_CRIT]); |
699 |
+@@ -1147,6 +1194,7 @@ static const u8 lm90_temp_emerg_index[3] = { |
700 |
+ static const u8 lm90_min_alarm_bits[3] = { 5, 3, 11 }; |
701 |
+ static const u8 lm90_max_alarm_bits[3] = { 6, 4, 12 }; |
702 |
+ static const u8 lm90_crit_alarm_bits[3] = { 0, 1, 9 }; |
703 |
++static const u8 lm90_crit_alarm_bits_swapped[3] = { 1, 0, 9 }; |
704 |
+ static const u8 lm90_emergency_alarm_bits[3] = { 15, 13, 14 }; |
705 |
+ static const u8 lm90_fault_bits[3] = { 0, 2, 10 }; |
706 |
+ |
707 |
+@@ -1172,7 +1220,10 @@ static int lm90_temp_read(struct device *dev, u32 attr, int channel, long *val) |
708 |
+ *val = (data->alarms >> lm90_max_alarm_bits[channel]) & 1; |
709 |
+ break; |
710 |
+ case hwmon_temp_crit_alarm: |
711 |
+- *val = (data->alarms >> lm90_crit_alarm_bits[channel]) & 1; |
712 |
++ if (data->flags & LM90_HAVE_CRIT_ALRM_SWP) |
713 |
++ *val = (data->alarms >> lm90_crit_alarm_bits_swapped[channel]) & 1; |
714 |
++ else |
715 |
++ *val = (data->alarms >> lm90_crit_alarm_bits[channel]) & 1; |
716 |
+ break; |
717 |
+ case hwmon_temp_emergency_alarm: |
718 |
+ *val = (data->alarms >> lm90_emergency_alarm_bits[channel]) & 1; |
719 |
+@@ -1420,12 +1471,11 @@ static int lm90_detect(struct i2c_client *client, |
720 |
+ if (man_id < 0 || chip_id < 0 || config1 < 0 || convrate < 0) |
721 |
+ return -ENODEV; |
722 |
+ |
723 |
+- if (man_id == 0x01 || man_id == 0x5C || man_id == 0x41) { |
724 |
++ if (man_id == 0x01 || man_id == 0x5C || man_id == 0xA1) { |
725 |
+ config2 = i2c_smbus_read_byte_data(client, LM90_REG_R_CONFIG2); |
726 |
+ if (config2 < 0) |
727 |
+ return -ENODEV; |
728 |
+- } else |
729 |
+- config2 = 0; /* Make compiler happy */ |
730 |
++ } |
731 |
+ |
732 |
+ if ((address == 0x4C || address == 0x4D) |
733 |
+ && man_id == 0x01) { /* National Semiconductor */ |
734 |
+@@ -1557,6 +1607,16 @@ static int lm90_detect(struct i2c_client *client, |
735 |
+ && (config1 & 0x3f) == 0x00 |
736 |
+ && convrate <= 0x07) { |
737 |
+ name = "max6646"; |
738 |
++ } else |
739 |
++ /* |
740 |
++ * The chip_id of the MAX6654 holds the revision of the chip. |
741 |
++ * The lowest 3 bits of the config1 register are unused and |
742 |
++ * should return zero when read. |
743 |
++ */ |
744 |
++ if (chip_id == 0x08 |
745 |
++ && (config1 & 0x07) == 0x00 |
746 |
++ && convrate <= 0x07) { |
747 |
++ name = "max6654"; |
748 |
+ } |
749 |
+ } else |
750 |
+ if (address == 0x4C |
751 |
+@@ -1589,18 +1649,26 @@ static int lm90_detect(struct i2c_client *client, |
752 |
+ && convrate <= 0x08) |
753 |
+ name = "g781"; |
754 |
+ } else |
755 |
+- if (address == 0x4C |
756 |
+- && man_id == 0x55) { /* Texas Instruments */ |
757 |
+- int local_ext; |
758 |
++ if (man_id == 0x55 && chip_id == 0x00 && |
759 |
++ (config1 & 0x1B) == 0x00 && convrate <= 0x09) { |
760 |
++ int local_ext, conalert, chen, dfc; |
761 |
+ |
762 |
+ local_ext = i2c_smbus_read_byte_data(client, |
763 |
+ TMP451_REG_R_LOCAL_TEMPL); |
764 |
+- |
765 |
+- if (chip_id == 0x00 /* TMP451 */ |
766 |
+- && (config1 & 0x1B) == 0x00 |
767 |
+- && convrate <= 0x09 |
768 |
+- && (local_ext & 0x0F) == 0x00) |
769 |
+- name = "tmp451"; |
770 |
++ conalert = i2c_smbus_read_byte_data(client, |
771 |
++ TMP451_REG_CONALERT); |
772 |
++ chen = i2c_smbus_read_byte_data(client, TMP461_REG_CHEN); |
773 |
++ dfc = i2c_smbus_read_byte_data(client, TMP461_REG_DFC); |
774 |
++ |
775 |
++ if ((local_ext & 0x0F) == 0x00 && |
776 |
++ (conalert & 0xf1) == 0x01 && |
777 |
++ (chen & 0xfc) == 0x00 && |
778 |
++ (dfc & 0xfc) == 0x00) { |
779 |
++ if (address == 0x4c && !(chen & 0x03)) |
780 |
++ name = "tmp451"; |
781 |
++ else if (address >= 0x48 && address <= 0x4f) |
782 |
++ name = "tmp461"; |
783 |
++ } |
784 |
+ } |
785 |
+ |
786 |
+ if (!name) { /* identification failed */ |
787 |
+@@ -1647,7 +1715,7 @@ static int lm90_init_client(struct i2c_client *client, struct lm90_data *data) |
788 |
+ lm90_set_convrate(client, data, 500); /* 500ms; 2Hz conversion rate */ |
789 |
+ |
790 |
+ /* Check Temperature Range Select */ |
791 |
+- if (data->kind == adt7461 || data->kind == tmp451) { |
792 |
++ if (data->flags & LM90_HAVE_EXTENDED_TEMP) { |
793 |
+ if (config & 0x04) |
794 |
+ data->flags |= LM90_FLAG_ADT7461_EXT; |
795 |
+ } |
796 |
+@@ -1660,6 +1728,15 @@ static int lm90_init_client(struct i2c_client *client, struct lm90_data *data) |
797 |
+ if (data->kind == max6680) |
798 |
+ config |= 0x18; |
799 |
+ |
800 |
++ /* |
801 |
++ * Put MAX6654 into extended range (0x20, extend minimum range from |
802 |
++ * 0 degrees to -64 degrees). Note that extended resolution is not |
803 |
++ * possible on the MAX6654 unless conversion rate is set to 1 Hz or |
804 |
++ * slower, which is intentionally not done by default. |
805 |
++ */ |
806 |
++ if (data->kind == max6654) |
807 |
++ config |= 0x20; |
808 |
++ |
809 |
+ /* |
810 |
+ * Select external channel 0 for max6695/96 |
811 |
+ */ |
812 |
+@@ -1806,11 +1883,14 @@ static int lm90_probe(struct i2c_client *client, |
813 |
+ info->config = data->channel_config; |
814 |
+ |
815 |
+ data->channel_config[0] = HWMON_T_INPUT | HWMON_T_MIN | HWMON_T_MAX | |
816 |
+- HWMON_T_CRIT | HWMON_T_CRIT_HYST | HWMON_T_MIN_ALARM | |
817 |
+- HWMON_T_MAX_ALARM | HWMON_T_CRIT_ALARM; |
818 |
++ HWMON_T_MIN_ALARM | HWMON_T_MAX_ALARM; |
819 |
+ data->channel_config[1] = HWMON_T_INPUT | HWMON_T_MIN | HWMON_T_MAX | |
820 |
+- HWMON_T_CRIT | HWMON_T_CRIT_HYST | HWMON_T_MIN_ALARM | |
821 |
+- HWMON_T_MAX_ALARM | HWMON_T_CRIT_ALARM | HWMON_T_FAULT; |
822 |
++ HWMON_T_MIN_ALARM | HWMON_T_MAX_ALARM | HWMON_T_FAULT; |
823 |
++ |
824 |
++ if (data->flags & LM90_HAVE_CRIT) { |
825 |
++ data->channel_config[0] |= HWMON_T_CRIT | HWMON_T_CRIT_ALARM | HWMON_T_CRIT_HYST; |
826 |
++ data->channel_config[1] |= HWMON_T_CRIT | HWMON_T_CRIT_ALARM | HWMON_T_CRIT_HYST; |
827 |
++ } |
828 |
+ |
829 |
+ if (data->flags & LM90_HAVE_OFFSET) |
830 |
+ data->channel_config[1] |= HWMON_T_OFFSET; |
831 |
+diff --git a/drivers/infiniband/hw/qib/qib_user_sdma.c b/drivers/infiniband/hw/qib/qib_user_sdma.c |
832 |
+index 5fd28574124fb..fde848b00202b 100644 |
833 |
+--- a/drivers/infiniband/hw/qib/qib_user_sdma.c |
834 |
++++ b/drivers/infiniband/hw/qib/qib_user_sdma.c |
835 |
+@@ -941,7 +941,7 @@ static int qib_user_sdma_queue_pkts(const struct qib_devdata *dd, |
836 |
+ &addrlimit) || |
837 |
+ addrlimit > type_max(typeof(pkt->addrlimit))) { |
838 |
+ ret = -EINVAL; |
839 |
+- goto free_pbc; |
840 |
++ goto free_pkt; |
841 |
+ } |
842 |
+ pkt->addrlimit = addrlimit; |
843 |
+ |
844 |
+diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c |
845 |
+index 0b5ed963cb0e1..3e78c26025815 100644 |
846 |
+--- a/drivers/input/mouse/elantech.c |
847 |
++++ b/drivers/input/mouse/elantech.c |
848 |
+@@ -1588,7 +1588,13 @@ static const struct dmi_system_id no_hw_res_dmi_table[] = { |
849 |
+ */ |
850 |
+ static int elantech_change_report_id(struct psmouse *psmouse) |
851 |
+ { |
852 |
+- unsigned char param[2] = { 0x10, 0x03 }; |
853 |
++ /* |
854 |
++ * NOTE: the code is expecting to receive param[] as an array of 3 |
855 |
++ * items (see __ps2_command()), even if in this case only 2 are |
856 |
++ * actually needed. Make sure the array size is 3 to avoid potential |
857 |
++ * stack out-of-bound accesses. |
858 |
++ */ |
859 |
++ unsigned char param[3] = { 0x10, 0x03 }; |
860 |
+ |
861 |
+ if (elantech_write_reg_params(psmouse, 0x7, param) || |
862 |
+ elantech_read_reg_params(psmouse, 0x7, param) || |
863 |
+diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c |
864 |
+index ae60442efda0d..fb31a9d43162b 100644 |
865 |
+--- a/drivers/input/touchscreen/atmel_mxt_ts.c |
866 |
++++ b/drivers/input/touchscreen/atmel_mxt_ts.c |
867 |
+@@ -1794,7 +1794,7 @@ static int mxt_read_info_block(struct mxt_data *data) |
868 |
+ if (error) { |
869 |
+ dev_err(&client->dev, "Error %d parsing object table\n", error); |
870 |
+ mxt_free_object_table(data); |
871 |
+- goto err_free_mem; |
872 |
++ return error; |
873 |
+ } |
874 |
+ |
875 |
+ data->object_table = (struct mxt_object *)(id_buf + MXT_OBJECT_START); |
876 |
+diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c |
877 |
+index 8f94c25395080..d7bda1fa0a6e2 100644 |
878 |
+--- a/drivers/mmc/core/core.c |
879 |
++++ b/drivers/mmc/core/core.c |
880 |
+@@ -2364,7 +2364,7 @@ void mmc_start_host(struct mmc_host *host) |
881 |
+ _mmc_detect_change(host, 0, false); |
882 |
+ } |
883 |
+ |
884 |
+-void mmc_stop_host(struct mmc_host *host) |
885 |
++void __mmc_stop_host(struct mmc_host *host) |
886 |
+ { |
887 |
+ if (host->slot.cd_irq >= 0) { |
888 |
+ mmc_gpio_set_cd_wake(host, false); |
889 |
+@@ -2373,6 +2373,11 @@ void mmc_stop_host(struct mmc_host *host) |
890 |
+ |
891 |
+ host->rescan_disable = 1; |
892 |
+ cancel_delayed_work_sync(&host->detect); |
893 |
++} |
894 |
++ |
895 |
++void mmc_stop_host(struct mmc_host *host) |
896 |
++{ |
897 |
++ __mmc_stop_host(host); |
898 |
+ |
899 |
+ /* clear pm flags now and let card drivers set them as needed */ |
900 |
+ host->pm_flags = 0; |
901 |
+diff --git a/drivers/mmc/core/core.h b/drivers/mmc/core/core.h |
902 |
+index db3c9c68875d8..a6c814fdbf0a9 100644 |
903 |
+--- a/drivers/mmc/core/core.h |
904 |
++++ b/drivers/mmc/core/core.h |
905 |
+@@ -69,6 +69,7 @@ static inline void mmc_delay(unsigned int ms) |
906 |
+ |
907 |
+ void mmc_rescan(struct work_struct *work); |
908 |
+ void mmc_start_host(struct mmc_host *host); |
909 |
++void __mmc_stop_host(struct mmc_host *host); |
910 |
+ void mmc_stop_host(struct mmc_host *host); |
911 |
+ |
912 |
+ void _mmc_detect_change(struct mmc_host *host, unsigned long delay, |
913 |
+diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c |
914 |
+index f7339590a84c8..e955f1ef25643 100644 |
915 |
+--- a/drivers/mmc/core/host.c |
916 |
++++ b/drivers/mmc/core/host.c |
917 |
+@@ -76,9 +76,18 @@ static void mmc_host_classdev_release(struct device *dev) |
918 |
+ kfree(host); |
919 |
+ } |
920 |
+ |
921 |
++static int mmc_host_classdev_shutdown(struct device *dev) |
922 |
++{ |
923 |
++ struct mmc_host *host = cls_dev_to_mmc_host(dev); |
924 |
++ |
925 |
++ __mmc_stop_host(host); |
926 |
++ return 0; |
927 |
++} |
928 |
++ |
929 |
+ static struct class mmc_host_class = { |
930 |
+ .name = "mmc_host", |
931 |
+ .dev_release = mmc_host_classdev_release, |
932 |
++ .shutdown_pre = mmc_host_classdev_shutdown, |
933 |
+ .pm = MMC_HOST_CLASS_DEV_PM_OPS, |
934 |
+ }; |
935 |
+ |
936 |
+diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c |
937 |
+index c105356ad4cb7..65dfe75120ed6 100644 |
938 |
+--- a/drivers/mmc/host/sdhci-tegra.c |
939 |
++++ b/drivers/mmc/host/sdhci-tegra.c |
940 |
+@@ -340,23 +340,6 @@ static void tegra_sdhci_set_tap(struct sdhci_host *host, unsigned int tap) |
941 |
+ } |
942 |
+ } |
943 |
+ |
944 |
+-static void tegra_sdhci_hs400_enhanced_strobe(struct mmc_host *mmc, |
945 |
+- struct mmc_ios *ios) |
946 |
+-{ |
947 |
+- struct sdhci_host *host = mmc_priv(mmc); |
948 |
+- u32 val; |
949 |
+- |
950 |
+- val = sdhci_readl(host, SDHCI_TEGRA_VENDOR_SYS_SW_CTRL); |
951 |
+- |
952 |
+- if (ios->enhanced_strobe) |
953 |
+- val |= SDHCI_TEGRA_SYS_SW_CTRL_ENHANCED_STROBE; |
954 |
+- else |
955 |
+- val &= ~SDHCI_TEGRA_SYS_SW_CTRL_ENHANCED_STROBE; |
956 |
+- |
957 |
+- sdhci_writel(host, val, SDHCI_TEGRA_VENDOR_SYS_SW_CTRL); |
958 |
+- |
959 |
+-} |
960 |
+- |
961 |
+ static void tegra_sdhci_reset(struct sdhci_host *host, u8 mask) |
962 |
+ { |
963 |
+ struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); |
964 |
+@@ -768,6 +751,32 @@ static void tegra_sdhci_set_clock(struct sdhci_host *host, unsigned int clock) |
965 |
+ } |
966 |
+ } |
967 |
+ |
968 |
++static void tegra_sdhci_hs400_enhanced_strobe(struct mmc_host *mmc, |
969 |
++ struct mmc_ios *ios) |
970 |
++{ |
971 |
++ struct sdhci_host *host = mmc_priv(mmc); |
972 |
++ u32 val; |
973 |
++ |
974 |
++ val = sdhci_readl(host, SDHCI_TEGRA_VENDOR_SYS_SW_CTRL); |
975 |
++ |
976 |
++ if (ios->enhanced_strobe) { |
977 |
++ val |= SDHCI_TEGRA_SYS_SW_CTRL_ENHANCED_STROBE; |
978 |
++ /* |
979 |
++ * When CMD13 is sent from mmc_select_hs400es() after |
980 |
++ * switching to HS400ES mode, the bus is operating at |
981 |
++ * either MMC_HIGH_26_MAX_DTR or MMC_HIGH_52_MAX_DTR. |
982 |
++ * To meet Tegra SDHCI requirement at HS400ES mode, force SDHCI |
983 |
++ * interface clock to MMC_HS200_MAX_DTR (200 MHz) so that host |
984 |
++ * controller CAR clock and the interface clock are rate matched. |
985 |
++ */ |
986 |
++ tegra_sdhci_set_clock(host, MMC_HS200_MAX_DTR); |
987 |
++ } else { |
988 |
++ val &= ~SDHCI_TEGRA_SYS_SW_CTRL_ENHANCED_STROBE; |
989 |
++ } |
990 |
++ |
991 |
++ sdhci_writel(host, val, SDHCI_TEGRA_VENDOR_SYS_SW_CTRL); |
992 |
++} |
993 |
++ |
994 |
+ static unsigned int tegra_sdhci_get_max_clock(struct sdhci_host *host) |
995 |
+ { |
996 |
+ struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); |
997 |
+diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c |
998 |
+index 215c109232893..933087d85549a 100644 |
999 |
+--- a/drivers/net/bonding/bond_options.c |
1000 |
++++ b/drivers/net/bonding/bond_options.c |
1001 |
+@@ -1452,7 +1452,7 @@ static int bond_option_ad_actor_system_set(struct bonding *bond, |
1002 |
+ mac = (u8 *)&newval->value; |
1003 |
+ } |
1004 |
+ |
1005 |
+- if (!is_valid_ether_addr(mac)) |
1006 |
++ if (is_multicast_ether_addr(mac)) |
1007 |
+ goto err; |
1008 |
+ |
1009 |
+ netdev_dbg(bond->dev, "Setting ad_actor_system to %pM\n", mac); |
1010 |
+diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov.h |
1011 |
+index 5f327659efa7a..85b688f60b876 100644 |
1012 |
+--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov.h |
1013 |
++++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov.h |
1014 |
+@@ -202,7 +202,7 @@ int qlcnic_sriov_get_vf_vport_info(struct qlcnic_adapter *, |
1015 |
+ struct qlcnic_info *, u16); |
1016 |
+ int qlcnic_sriov_cfg_vf_guest_vlan(struct qlcnic_adapter *, u16, u8); |
1017 |
+ void qlcnic_sriov_free_vlans(struct qlcnic_adapter *); |
1018 |
+-void qlcnic_sriov_alloc_vlans(struct qlcnic_adapter *); |
1019 |
++int qlcnic_sriov_alloc_vlans(struct qlcnic_adapter *); |
1020 |
+ bool qlcnic_sriov_check_any_vlan(struct qlcnic_vf_info *); |
1021 |
+ void qlcnic_sriov_del_vlan_id(struct qlcnic_sriov *, |
1022 |
+ struct qlcnic_vf_info *, u16); |
1023 |
+diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c |
1024 |
+index f7c2f32237cb0..400bc2c3f222e 100644 |
1025 |
+--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c |
1026 |
++++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c |
1027 |
+@@ -433,7 +433,7 @@ static int qlcnic_sriov_set_guest_vlan_mode(struct qlcnic_adapter *adapter, |
1028 |
+ struct qlcnic_cmd_args *cmd) |
1029 |
+ { |
1030 |
+ struct qlcnic_sriov *sriov = adapter->ahw->sriov; |
1031 |
+- int i, num_vlans; |
1032 |
++ int i, num_vlans, ret; |
1033 |
+ u16 *vlans; |
1034 |
+ |
1035 |
+ if (sriov->allowed_vlans) |
1036 |
+@@ -444,7 +444,9 @@ static int qlcnic_sriov_set_guest_vlan_mode(struct qlcnic_adapter *adapter, |
1037 |
+ dev_info(&adapter->pdev->dev, "Number of allowed Guest VLANs = %d\n", |
1038 |
+ sriov->num_allowed_vlans); |
1039 |
+ |
1040 |
+- qlcnic_sriov_alloc_vlans(adapter); |
1041 |
++ ret = qlcnic_sriov_alloc_vlans(adapter); |
1042 |
++ if (ret) |
1043 |
++ return ret; |
1044 |
+ |
1045 |
+ if (!sriov->any_vlan) |
1046 |
+ return 0; |
1047 |
+@@ -2160,7 +2162,7 @@ static int qlcnic_sriov_vf_resume(struct qlcnic_adapter *adapter) |
1048 |
+ return err; |
1049 |
+ } |
1050 |
+ |
1051 |
+-void qlcnic_sriov_alloc_vlans(struct qlcnic_adapter *adapter) |
1052 |
++int qlcnic_sriov_alloc_vlans(struct qlcnic_adapter *adapter) |
1053 |
+ { |
1054 |
+ struct qlcnic_sriov *sriov = adapter->ahw->sriov; |
1055 |
+ struct qlcnic_vf_info *vf; |
1056 |
+@@ -2170,7 +2172,11 @@ void qlcnic_sriov_alloc_vlans(struct qlcnic_adapter *adapter) |
1057 |
+ vf = &sriov->vf_info[i]; |
1058 |
+ vf->sriov_vlans = kcalloc(sriov->num_allowed_vlans, |
1059 |
+ sizeof(*vf->sriov_vlans), GFP_KERNEL); |
1060 |
++ if (!vf->sriov_vlans) |
1061 |
++ return -ENOMEM; |
1062 |
+ } |
1063 |
++ |
1064 |
++ return 0; |
1065 |
+ } |
1066 |
+ |
1067 |
+ void qlcnic_sriov_free_vlans(struct qlcnic_adapter *adapter) |
1068 |
+diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c |
1069 |
+index 5632da05145a5..ed218ed2f466d 100644 |
1070 |
+--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c |
1071 |
++++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c |
1072 |
+@@ -598,7 +598,9 @@ static int __qlcnic_pci_sriov_enable(struct qlcnic_adapter *adapter, |
1073 |
+ if (err) |
1074 |
+ goto del_flr_queue; |
1075 |
+ |
1076 |
+- qlcnic_sriov_alloc_vlans(adapter); |
1077 |
++ err = qlcnic_sriov_alloc_vlans(adapter); |
1078 |
++ if (err) |
1079 |
++ goto del_flr_queue; |
1080 |
+ |
1081 |
+ return err; |
1082 |
+ |
1083 |
+diff --git a/drivers/net/ethernet/sfc/falcon/rx.c b/drivers/net/ethernet/sfc/falcon/rx.c |
1084 |
+index 05ea3523890a9..d516f81ab37a7 100644 |
1085 |
+--- a/drivers/net/ethernet/sfc/falcon/rx.c |
1086 |
++++ b/drivers/net/ethernet/sfc/falcon/rx.c |
1087 |
+@@ -726,7 +726,10 @@ static void ef4_init_rx_recycle_ring(struct ef4_nic *efx, |
1088 |
+ efx->rx_bufs_per_page); |
1089 |
+ rx_queue->page_ring = kcalloc(page_ring_size, |
1090 |
+ sizeof(*rx_queue->page_ring), GFP_KERNEL); |
1091 |
+- rx_queue->page_ptr_mask = page_ring_size - 1; |
1092 |
++ if (!rx_queue->page_ring) |
1093 |
++ rx_queue->page_ptr_mask = 0; |
1094 |
++ else |
1095 |
++ rx_queue->page_ptr_mask = page_ring_size - 1; |
1096 |
+ } |
1097 |
+ |
1098 |
+ void ef4_init_rx_queue(struct ef4_rx_queue *rx_queue) |
1099 |
+diff --git a/drivers/net/ethernet/smsc/smc911x.c b/drivers/net/ethernet/smsc/smc911x.c |
1100 |
+index 7b65e79d6ae91..82ca29b6781b2 100644 |
1101 |
+--- a/drivers/net/ethernet/smsc/smc911x.c |
1102 |
++++ b/drivers/net/ethernet/smsc/smc911x.c |
1103 |
+@@ -2069,6 +2069,11 @@ static int smc911x_drv_probe(struct platform_device *pdev) |
1104 |
+ |
1105 |
+ ndev->dma = (unsigned char)-1; |
1106 |
+ ndev->irq = platform_get_irq(pdev, 0); |
1107 |
++ if (ndev->irq < 0) { |
1108 |
++ ret = ndev->irq; |
1109 |
++ goto release_both; |
1110 |
++ } |
1111 |
++ |
1112 |
+ lp = netdev_priv(ndev); |
1113 |
+ lp->netdev = ndev; |
1114 |
+ #ifdef SMC_DYNAMIC_BUS_CONFIG |
1115 |
+diff --git a/drivers/net/fjes/fjes_main.c b/drivers/net/fjes/fjes_main.c |
1116 |
+index b89b4a3800a4d..bef0133696c31 100644 |
1117 |
+--- a/drivers/net/fjes/fjes_main.c |
1118 |
++++ b/drivers/net/fjes/fjes_main.c |
1119 |
+@@ -1269,6 +1269,11 @@ static int fjes_probe(struct platform_device *plat_dev) |
1120 |
+ hw->hw_res.start = res->start; |
1121 |
+ hw->hw_res.size = resource_size(res); |
1122 |
+ hw->hw_res.irq = platform_get_irq(plat_dev, 0); |
1123 |
++ if (hw->hw_res.irq < 0) { |
1124 |
++ err = hw->hw_res.irq; |
1125 |
++ goto err_free_control_wq; |
1126 |
++ } |
1127 |
++ |
1128 |
+ err = fjes_hw_init(&adapter->hw); |
1129 |
+ if (err) |
1130 |
+ goto err_free_control_wq; |
1131 |
+diff --git a/drivers/net/hamradio/mkiss.c b/drivers/net/hamradio/mkiss.c |
1132 |
+index 352f9e75954ce..d2eb33f53993b 100644 |
1133 |
+--- a/drivers/net/hamradio/mkiss.c |
1134 |
++++ b/drivers/net/hamradio/mkiss.c |
1135 |
+@@ -793,13 +793,14 @@ static void mkiss_close(struct tty_struct *tty) |
1136 |
+ */ |
1137 |
+ netif_stop_queue(ax->dev); |
1138 |
+ |
1139 |
+- /* Free all AX25 frame buffers. */ |
1140 |
++ unregister_netdev(ax->dev); |
1141 |
++ |
1142 |
++ /* Free all AX25 frame buffers after unreg. */ |
1143 |
+ kfree(ax->rbuff); |
1144 |
+ kfree(ax->xbuff); |
1145 |
+ |
1146 |
+ ax->tty = NULL; |
1147 |
+ |
1148 |
+- unregister_netdev(ax->dev); |
1149 |
+ free_netdev(ax->dev); |
1150 |
+ } |
1151 |
+ |
1152 |
+diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c |
1153 |
+index 2d98373f7a71d..ce3c8f476d75c 100644 |
1154 |
+--- a/drivers/net/usb/lan78xx.c |
1155 |
++++ b/drivers/net/usb/lan78xx.c |
1156 |
+@@ -64,6 +64,8 @@ |
1157 |
+ #define LAN7801_USB_PRODUCT_ID (0x7801) |
1158 |
+ #define LAN78XX_EEPROM_MAGIC (0x78A5) |
1159 |
+ #define LAN78XX_OTP_MAGIC (0x78F3) |
1160 |
++#define AT29M2AF_USB_VENDOR_ID (0x07C9) |
1161 |
++#define AT29M2AF_USB_PRODUCT_ID (0x0012) |
1162 |
+ |
1163 |
+ #define MII_READ 1 |
1164 |
+ #define MII_WRITE 0 |
1165 |
+@@ -4153,6 +4155,10 @@ static const struct usb_device_id products[] = { |
1166 |
+ /* LAN7801 USB Gigabit Ethernet Device */ |
1167 |
+ USB_DEVICE(LAN78XX_USB_VENDOR_ID, LAN7801_USB_PRODUCT_ID), |
1168 |
+ }, |
1169 |
++ { |
1170 |
++ /* ATM2-AF USB Gigabit Ethernet Device */ |
1171 |
++ USB_DEVICE(AT29M2AF_USB_VENDOR_ID, AT29M2AF_USB_PRODUCT_ID), |
1172 |
++ }, |
1173 |
+ {}, |
1174 |
+ }; |
1175 |
+ MODULE_DEVICE_TABLE(usb, products); |
1176 |
+diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c |
1177 |
+index 20e1c890e73b3..c3e6f3c1b4743 100644 |
1178 |
+--- a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c |
1179 |
++++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c |
1180 |
+@@ -236,8 +236,12 @@ static int mtk_xt_get_gpio_n(void *data, unsigned long eint_n, |
1181 |
+ desc = (const struct mtk_pin_desc *)hw->soc->pins; |
1182 |
+ *gpio_chip = &hw->chip; |
1183 |
+ |
1184 |
+- /* Be greedy to guess first gpio_n is equal to eint_n */ |
1185 |
+- if (desc[eint_n].eint.eint_n == eint_n) |
1186 |
++ /* |
1187 |
++ * Be greedy to guess first gpio_n is equal to eint_n. |
1188 |
++ * Only eint virtual eint number is greater than gpio number. |
1189 |
++ */ |
1190 |
++ if (hw->soc->npins > eint_n && |
1191 |
++ desc[eint_n].eint.eint_n == eint_n) |
1192 |
+ *gpio_n = eint_n; |
1193 |
+ else |
1194 |
+ *gpio_n = mtk_xt_find_eint_num(hw, eint_n); |
1195 |
+diff --git a/drivers/pinctrl/stm32/pinctrl-stm32.c b/drivers/pinctrl/stm32/pinctrl-stm32.c |
1196 |
+index 138cbc012cd89..f9abd4364fbaa 100644 |
1197 |
+--- a/drivers/pinctrl/stm32/pinctrl-stm32.c |
1198 |
++++ b/drivers/pinctrl/stm32/pinctrl-stm32.c |
1199 |
+@@ -1186,10 +1186,10 @@ static int stm32_gpiolib_register_bank(struct stm32_pinctrl *pctl, |
1200 |
+ bank_nr = args.args[1] / STM32_GPIO_PINS_PER_BANK; |
1201 |
+ bank->gpio_chip.base = args.args[1]; |
1202 |
+ |
1203 |
+- npins = args.args[2]; |
1204 |
+- while (!of_parse_phandle_with_fixed_args(np, "gpio-ranges", 3, |
1205 |
+- ++i, &args)) |
1206 |
+- npins += args.args[2]; |
1207 |
++ /* get the last defined gpio line (offset + nb of pins) */ |
1208 |
++ npins = args.args[0] + args.args[2]; |
1209 |
++ while (!of_parse_phandle_with_fixed_args(np, "gpio-ranges", 3, ++i, &args)) |
1210 |
++ npins = max(npins, (int)(args.args[0] + args.args[2])); |
1211 |
+ } else { |
1212 |
+ bank_nr = pctl->nbanks; |
1213 |
+ bank->gpio_chip.base = bank_nr * STM32_GPIO_PINS_PER_BANK; |
1214 |
+diff --git a/drivers/spi/spi-armada-3700.c b/drivers/spi/spi-armada-3700.c |
1215 |
+index e450ee17787f0..4a4e2877414a1 100644 |
1216 |
+--- a/drivers/spi/spi-armada-3700.c |
1217 |
++++ b/drivers/spi/spi-armada-3700.c |
1218 |
+@@ -906,7 +906,7 @@ static int a3700_spi_probe(struct platform_device *pdev) |
1219 |
+ return 0; |
1220 |
+ |
1221 |
+ error_clk: |
1222 |
+- clk_disable_unprepare(spi->clk); |
1223 |
++ clk_unprepare(spi->clk); |
1224 |
+ error: |
1225 |
+ spi_master_put(master); |
1226 |
+ out: |
1227 |
+diff --git a/drivers/tee/optee/shm_pool.c b/drivers/tee/optee/shm_pool.c |
1228 |
+index c41a9a501a6e9..fa75024f16f7f 100644 |
1229 |
+--- a/drivers/tee/optee/shm_pool.c |
1230 |
++++ b/drivers/tee/optee/shm_pool.c |
1231 |
+@@ -41,10 +41,8 @@ static int pool_op_alloc(struct tee_shm_pool_mgr *poolm, |
1232 |
+ goto err; |
1233 |
+ } |
1234 |
+ |
1235 |
+- for (i = 0; i < nr_pages; i++) { |
1236 |
+- pages[i] = page; |
1237 |
+- page++; |
1238 |
+- } |
1239 |
++ for (i = 0; i < nr_pages; i++) |
1240 |
++ pages[i] = page + i; |
1241 |
+ |
1242 |
+ shm->flags |= TEE_SHM_REGISTER; |
1243 |
+ rc = optee_shm_register(shm->ctx, shm, pages, nr_pages, |
1244 |
+diff --git a/drivers/tty/serial/8250/8250_fintek.c b/drivers/tty/serial/8250/8250_fintek.c |
1245 |
+index 31c91c2f8c6e7..e24161004ddc1 100644 |
1246 |
+--- a/drivers/tty/serial/8250/8250_fintek.c |
1247 |
++++ b/drivers/tty/serial/8250/8250_fintek.c |
1248 |
+@@ -285,24 +285,6 @@ static void fintek_8250_set_max_fifo(struct fintek_8250 *pdata) |
1249 |
+ } |
1250 |
+ } |
1251 |
+ |
1252 |
+-static void fintek_8250_goto_highspeed(struct uart_8250_port *uart, |
1253 |
+- struct fintek_8250 *pdata) |
1254 |
+-{ |
1255 |
+- sio_write_reg(pdata, LDN, pdata->index); |
1256 |
+- |
1257 |
+- switch (pdata->pid) { |
1258 |
+- case CHIP_ID_F81866: /* set uart clock for high speed serial mode */ |
1259 |
+- sio_write_mask_reg(pdata, F81866_UART_CLK, |
1260 |
+- F81866_UART_CLK_MASK, |
1261 |
+- F81866_UART_CLK_14_769MHZ); |
1262 |
+- |
1263 |
+- uart->port.uartclk = 921600 * 16; |
1264 |
+- break; |
1265 |
+- default: /* leave clock speed untouched */ |
1266 |
+- break; |
1267 |
+- } |
1268 |
+-} |
1269 |
+- |
1270 |
+ static void fintek_8250_set_termios(struct uart_port *port, |
1271 |
+ struct ktermios *termios, |
1272 |
+ struct ktermios *old) |
1273 |
+@@ -422,7 +404,6 @@ static int probe_setup_port(struct fintek_8250 *pdata, |
1274 |
+ |
1275 |
+ fintek_8250_set_irq_mode(pdata, level_mode); |
1276 |
+ fintek_8250_set_max_fifo(pdata); |
1277 |
+- fintek_8250_goto_highspeed(uart, pdata); |
1278 |
+ |
1279 |
+ fintek_8250_exit_key(addr[i]); |
1280 |
+ |
1281 |
+diff --git a/drivers/usb/gadget/function/u_ether.c b/drivers/usb/gadget/function/u_ether.c |
1282 |
+index 57da62e331848..271bd08f4a255 100644 |
1283 |
+--- a/drivers/usb/gadget/function/u_ether.c |
1284 |
++++ b/drivers/usb/gadget/function/u_ether.c |
1285 |
+@@ -860,19 +860,23 @@ int gether_register_netdev(struct net_device *net) |
1286 |
+ { |
1287 |
+ struct eth_dev *dev; |
1288 |
+ struct usb_gadget *g; |
1289 |
+- struct sockaddr sa; |
1290 |
+ int status; |
1291 |
+ |
1292 |
+ if (!net->dev.parent) |
1293 |
+ return -EINVAL; |
1294 |
+ dev = netdev_priv(net); |
1295 |
+ g = dev->gadget; |
1296 |
++ |
1297 |
++ memcpy(net->dev_addr, dev->dev_mac, ETH_ALEN); |
1298 |
++ net->addr_assign_type = NET_ADDR_RANDOM; |
1299 |
++ |
1300 |
+ status = register_netdev(net); |
1301 |
+ if (status < 0) { |
1302 |
+ dev_dbg(&g->dev, "register_netdev failed, %d\n", status); |
1303 |
+ return status; |
1304 |
+ } else { |
1305 |
+ INFO(dev, "HOST MAC %pM\n", dev->host_mac); |
1306 |
++ INFO(dev, "MAC %pM\n", dev->dev_mac); |
1307 |
+ |
1308 |
+ /* two kinds of host-initiated state changes: |
1309 |
+ * - iff DATA transfer is active, carrier is "on" |
1310 |
+@@ -880,15 +884,6 @@ int gether_register_netdev(struct net_device *net) |
1311 |
+ */ |
1312 |
+ netif_carrier_off(net); |
1313 |
+ } |
1314 |
+- sa.sa_family = net->type; |
1315 |
+- memcpy(sa.sa_data, dev->dev_mac, ETH_ALEN); |
1316 |
+- rtnl_lock(); |
1317 |
+- status = dev_set_mac_address(net, &sa, NULL); |
1318 |
+- rtnl_unlock(); |
1319 |
+- if (status) |
1320 |
+- pr_warn("cannot set self ethernet address: %d\n", status); |
1321 |
+- else |
1322 |
+- INFO(dev, "MAC %pM\n", dev->dev_mac); |
1323 |
+ |
1324 |
+ return status; |
1325 |
+ } |
1326 |
+diff --git a/fs/f2fs/xattr.c b/fs/f2fs/xattr.c |
1327 |
+index 296b3189448a4..cf1bfed1e6621 100644 |
1328 |
+--- a/fs/f2fs/xattr.c |
1329 |
++++ b/fs/f2fs/xattr.c |
1330 |
+@@ -661,8 +661,17 @@ static int __f2fs_setxattr(struct inode *inode, int index, |
1331 |
+ } |
1332 |
+ |
1333 |
+ last = here; |
1334 |
+- while (!IS_XATTR_LAST_ENTRY(last)) |
1335 |
++ while (!IS_XATTR_LAST_ENTRY(last)) { |
1336 |
++ if ((void *)(last) + sizeof(__u32) > last_base_addr || |
1337 |
++ (void *)XATTR_NEXT_ENTRY(last) > last_base_addr) { |
1338 |
++ f2fs_err(F2FS_I_SB(inode), "inode (%lu) has invalid last xattr entry, entry_size: %zu", |
1339 |
++ inode->i_ino, ENTRY_SIZE(last)); |
1340 |
++ set_sbi_flag(F2FS_I_SB(inode), SBI_NEED_FSCK); |
1341 |
++ error = -EFSCORRUPTED; |
1342 |
++ goto exit; |
1343 |
++ } |
1344 |
+ last = XATTR_NEXT_ENTRY(last); |
1345 |
++ } |
1346 |
+ |
1347 |
+ newsize = XATTR_ALIGN(sizeof(struct f2fs_xattr_entry) + len + size); |
1348 |
+ |
1349 |
+diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h |
1350 |
+index 04e87f4b9417c..a960de68ac69e 100644 |
1351 |
+--- a/include/linux/virtio_net.h |
1352 |
++++ b/include/linux/virtio_net.h |
1353 |
+@@ -7,9 +7,27 @@ |
1354 |
+ #include <uapi/linux/udp.h> |
1355 |
+ #include <uapi/linux/virtio_net.h> |
1356 |
+ |
1357 |
++static inline bool virtio_net_hdr_match_proto(__be16 protocol, __u8 gso_type) |
1358 |
++{ |
1359 |
++ switch (gso_type & ~VIRTIO_NET_HDR_GSO_ECN) { |
1360 |
++ case VIRTIO_NET_HDR_GSO_TCPV4: |
1361 |
++ return protocol == cpu_to_be16(ETH_P_IP); |
1362 |
++ case VIRTIO_NET_HDR_GSO_TCPV6: |
1363 |
++ return protocol == cpu_to_be16(ETH_P_IPV6); |
1364 |
++ case VIRTIO_NET_HDR_GSO_UDP: |
1365 |
++ return protocol == cpu_to_be16(ETH_P_IP) || |
1366 |
++ protocol == cpu_to_be16(ETH_P_IPV6); |
1367 |
++ default: |
1368 |
++ return false; |
1369 |
++ } |
1370 |
++} |
1371 |
++ |
1372 |
+ static inline int virtio_net_hdr_set_proto(struct sk_buff *skb, |
1373 |
+ const struct virtio_net_hdr *hdr) |
1374 |
+ { |
1375 |
++ if (skb->protocol) |
1376 |
++ return 0; |
1377 |
++ |
1378 |
+ switch (hdr->gso_type & ~VIRTIO_NET_HDR_GSO_ECN) { |
1379 |
+ case VIRTIO_NET_HDR_GSO_TCPV4: |
1380 |
+ case VIRTIO_NET_HDR_GSO_UDP: |
1381 |
+@@ -88,9 +106,12 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb, |
1382 |
+ if (!skb->protocol) { |
1383 |
+ __be16 protocol = dev_parse_header_protocol(skb); |
1384 |
+ |
1385 |
+- virtio_net_hdr_set_proto(skb, hdr); |
1386 |
+- if (protocol && protocol != skb->protocol) |
1387 |
++ if (!protocol) |
1388 |
++ virtio_net_hdr_set_proto(skb, hdr); |
1389 |
++ else if (!virtio_net_hdr_match_proto(protocol, hdr->gso_type)) |
1390 |
+ return -EINVAL; |
1391 |
++ else |
1392 |
++ skb->protocol = protocol; |
1393 |
+ } |
1394 |
+ retry: |
1395 |
+ if (!skb_flow_dissect_flow_keys_basic(NULL, skb, &keys, |
1396 |
+diff --git a/mm/mempolicy.c b/mm/mempolicy.c |
1397 |
+index 87d165923fee2..2c4082f71d258 100644 |
1398 |
+--- a/mm/mempolicy.c |
1399 |
++++ b/mm/mempolicy.c |
1400 |
+@@ -2143,8 +2143,9 @@ alloc_pages_vma(gfp_t gfp, int order, struct vm_area_struct *vma, |
1401 |
+ * memory as well. |
1402 |
+ */ |
1403 |
+ if (!page && (gfp & __GFP_DIRECT_RECLAIM)) |
1404 |
+- page = __alloc_pages_node(hpage_node, |
1405 |
+- gfp | __GFP_NORETRY, order); |
1406 |
++ page = __alloc_pages_nodemask(gfp | __GFP_NORETRY, |
1407 |
++ order, hpage_node, |
1408 |
++ nmask); |
1409 |
+ |
1410 |
+ goto out; |
1411 |
+ } |
1412 |
+diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c |
1413 |
+index 2fdb1b573e8c8..1f84d41e22c36 100644 |
1414 |
+--- a/net/ax25/af_ax25.c |
1415 |
++++ b/net/ax25/af_ax25.c |
1416 |
+@@ -85,8 +85,10 @@ static void ax25_kill_by_device(struct net_device *dev) |
1417 |
+ again: |
1418 |
+ ax25_for_each(s, &ax25_list) { |
1419 |
+ if (s->ax25_dev == ax25_dev) { |
1420 |
+- s->ax25_dev = NULL; |
1421 |
+ spin_unlock_bh(&ax25_list_lock); |
1422 |
++ lock_sock(s->sk); |
1423 |
++ s->ax25_dev = NULL; |
1424 |
++ release_sock(s->sk); |
1425 |
+ ax25_disconnect(s, ENETUNREACH); |
1426 |
+ spin_lock_bh(&ax25_list_lock); |
1427 |
+ |
1428 |
+diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c |
1429 |
+index 7ca2ca4bba055..b36af4741ad3c 100644 |
1430 |
+--- a/net/netfilter/nfnetlink_log.c |
1431 |
++++ b/net/netfilter/nfnetlink_log.c |
1432 |
+@@ -557,7 +557,8 @@ __build_packet_message(struct nfnl_log_net *log, |
1433 |
+ goto nla_put_failure; |
1434 |
+ |
1435 |
+ if (indev && skb->dev && |
1436 |
+- skb->mac_header != skb->network_header) { |
1437 |
++ skb_mac_header_was_set(skb) && |
1438 |
++ skb_mac_header_len(skb) != 0) { |
1439 |
+ struct nfulnl_msg_packet_hw phw; |
1440 |
+ int len; |
1441 |
+ |
1442 |
+diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c |
1443 |
+index a8cb562da3fea..ca21f8f4a47c1 100644 |
1444 |
+--- a/net/netfilter/nfnetlink_queue.c |
1445 |
++++ b/net/netfilter/nfnetlink_queue.c |
1446 |
+@@ -562,7 +562,8 @@ nfqnl_build_packet_message(struct net *net, struct nfqnl_instance *queue, |
1447 |
+ goto nla_put_failure; |
1448 |
+ |
1449 |
+ if (indev && entskb->dev && |
1450 |
+- skb_mac_header_was_set(entskb)) { |
1451 |
++ skb_mac_header_was_set(entskb) && |
1452 |
++ skb_mac_header_len(entskb) != 0) { |
1453 |
+ struct nfqnl_msg_packet_hw phw; |
1454 |
+ int len; |
1455 |
+ |
1456 |
+diff --git a/net/phonet/pep.c b/net/phonet/pep.c |
1457 |
+index 4577e43cb7778..a07e13f63332c 100644 |
1458 |
+--- a/net/phonet/pep.c |
1459 |
++++ b/net/phonet/pep.c |
1460 |
+@@ -946,6 +946,8 @@ static int pep_ioctl(struct sock *sk, int cmd, unsigned long arg) |
1461 |
+ ret = -EBUSY; |
1462 |
+ else if (sk->sk_state == TCP_ESTABLISHED) |
1463 |
+ ret = -EISCONN; |
1464 |
++ else if (!pn->pn_sk.sobject) |
1465 |
++ ret = -EADDRNOTAVAIL; |
1466 |
+ else |
1467 |
+ ret = pep_sock_enable(sk, NULL, 0); |
1468 |
+ release_sock(sk); |
1469 |
+diff --git a/sound/core/jack.c b/sound/core/jack.c |
1470 |
+index fb26196571a7c..8b209750c7a9c 100644 |
1471 |
+--- a/sound/core/jack.c |
1472 |
++++ b/sound/core/jack.c |
1473 |
+@@ -220,6 +220,10 @@ int snd_jack_new(struct snd_card *card, const char *id, int type, |
1474 |
+ return -ENOMEM; |
1475 |
+ |
1476 |
+ jack->id = kstrdup(id, GFP_KERNEL); |
1477 |
++ if (jack->id == NULL) { |
1478 |
++ kfree(jack); |
1479 |
++ return -ENOMEM; |
1480 |
++ } |
1481 |
+ |
1482 |
+ /* don't creat input device for phantom jack */ |
1483 |
+ if (!phantom_jack) { |
1484 |
+diff --git a/sound/drivers/opl3/opl3_midi.c b/sound/drivers/opl3/opl3_midi.c |
1485 |
+index 280cc79870cf8..ce38ec09d4087 100644 |
1486 |
+--- a/sound/drivers/opl3/opl3_midi.c |
1487 |
++++ b/sound/drivers/opl3/opl3_midi.c |
1488 |
+@@ -398,7 +398,7 @@ void snd_opl3_note_on(void *p, int note, int vel, struct snd_midi_channel *chan) |
1489 |
+ } |
1490 |
+ if (instr_4op) { |
1491 |
+ vp2 = &opl3->voices[voice + 3]; |
1492 |
+- if (vp->state > 0) { |
1493 |
++ if (vp2->state > 0) { |
1494 |
+ opl3_reg = reg_side | (OPL3_REG_KEYON_BLOCK + |
1495 |
+ voice_offset + 3); |
1496 |
+ reg_val = vp->keyon_reg & ~OPL3_KEYON_BIT; |
1497 |
+diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c |
1498 |
+index 9514db7c2a86d..022799479a722 100644 |
1499 |
+--- a/sound/pci/hda/patch_realtek.c |
1500 |
++++ b/sound/pci/hda/patch_realtek.c |
1501 |
+@@ -8101,6 +8101,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { |
1502 |
+ SND_PCI_QUIRK(0x103c, 0x84da, "HP OMEN dc0019-ur", ALC295_FIXUP_HP_OMEN), |
1503 |
+ SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3), |
1504 |
+ SND_PCI_QUIRK(0x103c, 0x8519, "HP Spectre x360 15-df0xxx", ALC285_FIXUP_HP_SPECTRE_X360), |
1505 |
++ SND_PCI_QUIRK(0x103c, 0x860f, "HP ZBook 15 G6", ALC285_FIXUP_HP_GPIO_AMP_INIT), |
1506 |
+ SND_PCI_QUIRK(0x103c, 0x861f, "HP Elite Dragonfly G1", ALC285_FIXUP_HP_GPIO_AMP_INIT), |
1507 |
+ SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED), |
1508 |
+ SND_PCI_QUIRK(0x103c, 0x8724, "HP EliteBook 850 G7", ALC285_FIXUP_HP_GPIO_LED), |