Skip to content

Commit c7abb12

Browse files
committed
Merge tag 'v5.4.51' into 5.4-1.0.0-imx
This is the 5.4.51 stable release Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
2 parents dc367ae + 1c54d3c commit c7abb12

File tree

66 files changed

+559
-360
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+559
-360
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0
22
VERSION = 5
33
PATCHLEVEL = 4
4-
SUBLEVEL = 50
4+
SUBLEVEL = 51
55
EXTRAVERSION =
66
NAME = Kleptomaniac Octopus
77

arch/mips/kernel/traps.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2126,6 +2126,7 @@ static void configure_status(void)
21262126

21272127
change_c0_status(ST0_CU|ST0_MX|ST0_RE|ST0_FR|ST0_BEV|ST0_TS|ST0_KX|ST0_SX|ST0_UX,
21282128
status_set);
2129+
back_to_back_c0_hazard();
21292130
}
21302131

21312132
unsigned int hwrena;

arch/mips/lantiq/xway/sysctrl.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -514,8 +514,8 @@ void __init ltq_soc_init(void)
514514
clkdev_add_pmu("1e10b308.eth", NULL, 0, 0, PMU_SWITCH |
515515
PMU_PPE_DP | PMU_PPE_TC);
516516
clkdev_add_pmu("1da00000.usif", "NULL", 1, 0, PMU_USIF);
517-
clkdev_add_pmu("1e108000.gswip", "gphy0", 0, 0, PMU_GPHY);
518-
clkdev_add_pmu("1e108000.gswip", "gphy1", 0, 0, PMU_GPHY);
517+
clkdev_add_pmu("1e108000.switch", "gphy0", 0, 0, PMU_GPHY);
518+
clkdev_add_pmu("1e108000.switch", "gphy1", 0, 0, PMU_GPHY);
519519
clkdev_add_pmu("1e103100.deu", NULL, 1, 0, PMU_DEU);
520520
clkdev_add_pmu("1e116000.mei", "afe", 1, 2, PMU_ANALOG_DSL_AFE);
521521
clkdev_add_pmu("1e116000.mei", "dfe", 1, 0, PMU_DFE);
@@ -538,8 +538,8 @@ void __init ltq_soc_init(void)
538538
PMU_SWITCH | PMU_PPE_DPLUS | PMU_PPE_DPLUM |
539539
PMU_PPE_EMA | PMU_PPE_TC | PMU_PPE_SLL01 |
540540
PMU_PPE_QSB | PMU_PPE_TOP);
541-
clkdev_add_pmu("1e108000.gswip", "gphy0", 0, 0, PMU_GPHY);
542-
clkdev_add_pmu("1e108000.gswip", "gphy1", 0, 0, PMU_GPHY);
541+
clkdev_add_pmu("1e108000.switch", "gphy0", 0, 0, PMU_GPHY);
542+
clkdev_add_pmu("1e108000.switch", "gphy1", 0, 0, PMU_GPHY);
543543
clkdev_add_pmu("1e103000.sdio", NULL, 1, 0, PMU_SDIO);
544544
clkdev_add_pmu("1e103100.deu", NULL, 1, 0, PMU_DEU);
545545
clkdev_add_pmu("1e116000.mei", "dfe", 1, 0, PMU_DFE);

arch/s390/kernel/debug.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,10 @@ static debug_entry_t ***debug_areas_alloc(int pages_per_area, int nr_areas)
198198
if (!areas)
199199
goto fail_malloc_areas;
200200
for (i = 0; i < nr_areas; i++) {
201+
/* GFP_NOWARN to avoid user triggerable WARN, we handle fails */
201202
areas[i] = kmalloc_array(pages_per_area,
202203
sizeof(debug_entry_t *),
203-
GFP_KERNEL);
204+
GFP_KERNEL | __GFP_NOWARN);
204205
if (!areas[i])
205206
goto fail_malloc_areas2;
206207
for (j = 0; j < pages_per_area; j++) {

arch/x86/kernel/cpu/resctrl/core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ static bool __get_mem_config_intel(struct rdt_resource *r)
260260
r->num_closid = edx.split.cos_max + 1;
261261
r->membw.max_delay = eax.split.max_delay + 1;
262262
r->default_ctrl = MAX_MBA_BW;
263+
r->membw.mbm_width = MBM_CNTR_WIDTH;
263264
if (ecx & MBA_IS_LINEAR) {
264265
r->membw.delay_linear = true;
265266
r->membw.min_bw = MAX_MBA_BW - r->membw.max_delay;
@@ -289,6 +290,7 @@ static bool __rdt_get_mem_config_amd(struct rdt_resource *r)
289290
/* AMD does not use delay */
290291
r->membw.delay_linear = false;
291292

293+
r->membw.mbm_width = MBM_CNTR_WIDTH_AMD;
292294
r->membw.min_bw = 0;
293295
r->membw.bw_gran = 1;
294296
/* Max value is 2048, Data width should be 4 in decimal */

arch/x86/kernel/cpu/resctrl/internal.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#define CQM_LIMBOCHECK_INTERVAL 1000
3333

3434
#define MBM_CNTR_WIDTH 24
35+
#define MBM_CNTR_WIDTH_AMD 44
3536
#define MBM_OVERFLOW_INTERVAL 1000
3637
#define MAX_MBA_BW 100u
3738
#define MBA_IS_LINEAR 0x4
@@ -368,6 +369,7 @@ struct rdt_cache {
368369
* @min_bw: Minimum memory bandwidth percentage user can request
369370
* @bw_gran: Granularity at which the memory bandwidth is allocated
370371
* @delay_linear: True if memory B/W delay is in linear scale
372+
* @mbm_width: memory B/W monitor counter width
371373
* @mba_sc: True if MBA software controller(mba_sc) is enabled
372374
* @mb_map: Mapping of memory B/W percentage to memory B/W delay
373375
*/
@@ -376,6 +378,7 @@ struct rdt_membw {
376378
u32 min_bw;
377379
u32 bw_gran;
378380
u32 delay_linear;
381+
u32 mbm_width;
379382
bool mba_sc;
380383
u32 *mb_map;
381384
};

arch/x86/kernel/cpu/resctrl/monitor.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,9 @@ void free_rmid(u32 rmid)
216216

217217
static u64 mbm_overflow_count(u64 prev_msr, u64 cur_msr)
218218
{
219-
u64 shift = 64 - MBM_CNTR_WIDTH, chunks;
219+
u64 shift, chunks;
220220

221+
shift = 64 - rdt_resources_all[RDT_RESOURCE_MBA].membw.mbm_width;
221222
chunks = (cur_msr << shift) - (prev_msr << shift);
222223
return chunks >>= shift;
223224
}

crypto/af_alg.c

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -128,21 +128,15 @@ EXPORT_SYMBOL_GPL(af_alg_release);
128128
void af_alg_release_parent(struct sock *sk)
129129
{
130130
struct alg_sock *ask = alg_sk(sk);
131-
unsigned int nokey = ask->nokey_refcnt;
132-
bool last = nokey && !ask->refcnt;
131+
unsigned int nokey = atomic_read(&ask->nokey_refcnt);
133132

134133
sk = ask->parent;
135134
ask = alg_sk(sk);
136135

137-
local_bh_disable();
138-
bh_lock_sock(sk);
139-
ask->nokey_refcnt -= nokey;
140-
if (!last)
141-
last = !--ask->refcnt;
142-
bh_unlock_sock(sk);
143-
local_bh_enable();
136+
if (nokey)
137+
atomic_dec(&ask->nokey_refcnt);
144138

145-
if (last)
139+
if (atomic_dec_and_test(&ask->refcnt))
146140
sock_put(sk);
147141
}
148142
EXPORT_SYMBOL_GPL(af_alg_release_parent);
@@ -187,7 +181,7 @@ static int alg_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
187181

188182
err = -EBUSY;
189183
lock_sock(sk);
190-
if (ask->refcnt | ask->nokey_refcnt)
184+
if (atomic_read(&ask->refcnt))
191185
goto unlock;
192186

193187
swap(ask->type, type);
@@ -236,7 +230,7 @@ static int alg_setsockopt(struct socket *sock, int level, int optname,
236230
int err = -EBUSY;
237231

238232
lock_sock(sk);
239-
if (ask->refcnt)
233+
if (atomic_read(&ask->refcnt) != atomic_read(&ask->nokey_refcnt))
240234
goto unlock;
241235

242236
type = ask->type;
@@ -301,12 +295,14 @@ int af_alg_accept(struct sock *sk, struct socket *newsock, bool kern)
301295
if (err)
302296
goto unlock;
303297

304-
if (nokey || !ask->refcnt++)
298+
if (atomic_inc_return_relaxed(&ask->refcnt) == 1)
305299
sock_hold(sk);
306-
ask->nokey_refcnt += nokey;
300+
if (nokey) {
301+
atomic_inc(&ask->nokey_refcnt);
302+
atomic_set(&alg_sk(sk2)->nokey_refcnt, 1);
303+
}
307304
alg_sk(sk2)->parent = sk;
308305
alg_sk(sk2)->type = type;
309-
alg_sk(sk2)->nokey_refcnt = nokey;
310306

311307
newsock->ops = type->ops;
312308
newsock->state = SS_CONNECTED;

crypto/algif_aead.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ static int aead_check_key(struct socket *sock)
384384
struct alg_sock *ask = alg_sk(sk);
385385

386386
lock_sock(sk);
387-
if (ask->refcnt)
387+
if (!atomic_read(&ask->nokey_refcnt))
388388
goto unlock_child;
389389

390390
psk = ask->parent;
@@ -396,11 +396,8 @@ static int aead_check_key(struct socket *sock)
396396
if (crypto_aead_get_flags(tfm->aead) & CRYPTO_TFM_NEED_KEY)
397397
goto unlock;
398398

399-
if (!pask->refcnt++)
400-
sock_hold(psk);
401-
402-
ask->refcnt = 1;
403-
sock_put(psk);
399+
atomic_dec(&pask->nokey_refcnt);
400+
atomic_set(&ask->nokey_refcnt, 0);
404401

405402
err = 0;
406403

crypto/algif_hash.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ static int hash_check_key(struct socket *sock)
301301
struct alg_sock *ask = alg_sk(sk);
302302

303303
lock_sock(sk);
304-
if (ask->refcnt)
304+
if (!atomic_read(&ask->nokey_refcnt))
305305
goto unlock_child;
306306

307307
psk = ask->parent;
@@ -313,11 +313,8 @@ static int hash_check_key(struct socket *sock)
313313
if (crypto_ahash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY)
314314
goto unlock;
315315

316-
if (!pask->refcnt++)
317-
sock_hold(psk);
318-
319-
ask->refcnt = 1;
320-
sock_put(psk);
316+
atomic_dec(&pask->nokey_refcnt);
317+
atomic_set(&ask->nokey_refcnt, 0);
321318

322319
err = 0;
323320

0 commit comments

Comments
 (0)