Skip to content

Commit b253435

Browse files
committed
Merge tag 'xtensa-20220416' of https://github.com/jcmvbkbc/linux-xtensa
Pull xtensa fixes from Max Filippov: - fix patching CPU selection in patch_text - fix potential deadlock in ISS platform serial driver - fix potential register clobbering in coprocessor exception handler * tag 'xtensa-20220416' of https://github.com/jcmvbkbc/linux-xtensa: xtensa: fix a7 clobbering in coprocessor context load/store arch: xtensa: platforms: Fix deadlock in rs_close() xtensa: patch_text: Fixup last cpu should be master
2 parents 10c5f10 + 839769c commit b253435

File tree

3 files changed

+3
-11
lines changed

3 files changed

+3
-11
lines changed

arch/xtensa/kernel/coprocessor.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
.if XTENSA_HAVE_COPROCESSOR(x); \
3030
.align 4; \
3131
.Lsave_cp_regs_cp##x: \
32-
xchal_cp##x##_store a2 a4 a5 a6 a7; \
32+
xchal_cp##x##_store a2 a3 a4 a5 a6; \
3333
jx a0; \
3434
.endif
3535

@@ -46,7 +46,7 @@
4646
.if XTENSA_HAVE_COPROCESSOR(x); \
4747
.align 4; \
4848
.Lload_cp_regs_cp##x: \
49-
xchal_cp##x##_load a2 a4 a5 a6 a7; \
49+
xchal_cp##x##_load a2 a3 a4 a5 a6; \
5050
jx a0; \
5151
.endif
5252

arch/xtensa/kernel/jump_label.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ static int patch_text_stop_machine(void *data)
4040
{
4141
struct patch *patch = data;
4242

43-
if (atomic_inc_return(&patch->cpu_count) == 1) {
43+
if (atomic_inc_return(&patch->cpu_count) == num_online_cpus()) {
4444
local_patch_text(patch->addr, patch->data, patch->sz);
4545
atomic_inc(&patch->cpu_count);
4646
} else {

arch/xtensa/platforms/iss/console.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,19 @@ static void rs_poll(struct timer_list *);
3636
static struct tty_driver *serial_driver;
3737
static struct tty_port serial_port;
3838
static DEFINE_TIMER(serial_timer, rs_poll);
39-
static DEFINE_SPINLOCK(timer_lock);
4039

4140
static int rs_open(struct tty_struct *tty, struct file * filp)
4241
{
43-
spin_lock_bh(&timer_lock);
4442
if (tty->count == 1)
4543
mod_timer(&serial_timer, jiffies + SERIAL_TIMER_VALUE);
46-
spin_unlock_bh(&timer_lock);
4744

4845
return 0;
4946
}
5047

5148
static void rs_close(struct tty_struct *tty, struct file * filp)
5249
{
53-
spin_lock_bh(&timer_lock);
5450
if (tty->count == 1)
5551
del_timer_sync(&serial_timer);
56-
spin_unlock_bh(&timer_lock);
5752
}
5853

5954

@@ -73,8 +68,6 @@ static void rs_poll(struct timer_list *unused)
7368
int rd = 1;
7469
unsigned char c;
7570

76-
spin_lock(&timer_lock);
77-
7871
while (simc_poll(0)) {
7972
rd = simc_read(0, &c, 1);
8073
if (rd <= 0)
@@ -87,7 +80,6 @@ static void rs_poll(struct timer_list *unused)
8780
tty_flip_buffer_push(port);
8881
if (rd)
8982
mod_timer(&serial_timer, jiffies + SERIAL_TIMER_VALUE);
90-
spin_unlock(&timer_lock);
9183
}
9284

9385

0 commit comments

Comments
 (0)