Skip to content

Commit b5d6d26

Browse files
committed
Merge tag 'xtensa-20210902' of git://github.com/jcmvbkbc/linux-xtensa
Pull Xtensa updates from Max Filippov: - fix kconfig unmet dependency warning for HAVE_FUTEX_CMPXCHG - add fairness to handling IRQs of the same priority - fix pointer usage before NULL check in ISS console driver - build system cleanups * tag 'xtensa-20210902' of git://github.com/jcmvbkbc/linux-xtensa: xtensa: move core-y in arch/xtensa/Makefile to arch/xtensa/Kbuild xtensa: build platform directories unconditionally xtensa: do not build variants directory xtensa: remove unneeded exports xtensa: ISS: don't use string pointer before NULL check xtensa: add fairness to IRQ handling xtensa: fix kconfig unmet dependency warning for HAVE_FUTEX_CMPXCHG
2 parents aa82977 + 7b7cec4 commit b5d6d26

6 files changed

Lines changed: 16 additions & 16 deletions

File tree

arch/xtensa/Kbuild

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
# SPDX-License-Identifier: GPL-2.0-only
2+
obj-y += kernel/ mm/ platforms/ boot/dts/

arch/xtensa/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ config XTENSA
3131
select HAVE_DMA_CONTIGUOUS
3232
select HAVE_EXIT_THREAD
3333
select HAVE_FUNCTION_TRACER
34-
select HAVE_FUTEX_CMPXCHG if !MMU
34+
select HAVE_FUTEX_CMPXCHG if !MMU && FUTEX
3535
select HAVE_HW_BREAKPOINT if PERF_EVENTS
3636
select HAVE_IRQ_TIME_ACCOUNTING
3737
select HAVE_PCI

arch/xtensa/Makefile

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
variant-y := $(patsubst "%",%,$(CONFIG_XTENSA_VARIANT_NAME))
1818

1919
VARIANT = $(variant-y)
20-
export VARIANT
2120

2221
ifneq ($(VARIANT),)
2322
ifdef cross_compiling
@@ -33,9 +32,6 @@ platform-$(CONFIG_XTENSA_PLATFORM_XT2000) := xt2000
3332
platform-$(CONFIG_XTENSA_PLATFORM_ISS) := iss
3433
platform-$(CONFIG_XTENSA_PLATFORM_XTFPGA) := xtfpga
3534

36-
PLATFORM = $(platform-y)
37-
export PLATFORM
38-
3935
# temporarily until string.h is fixed
4036
KBUILD_CFLAGS += -ffreestanding -D__linux__
4137
KBUILD_CFLAGS += -pipe -mlongcalls -mtext-section-literals
@@ -57,19 +53,11 @@ KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(vardirs) $(plfdirs))
5753

5854
KBUILD_DEFCONFIG := iss_defconfig
5955

60-
# Only build variant and/or platform if it includes a Makefile
61-
62-
buildvar := $(shell test -e $(srctree)/arch/xtensa/variants/$(VARIANT)/Makefile && echo arch/xtensa/variants/$(VARIANT)/)
63-
buildplf := $(shell test -e $(srctree)/arch/xtensa/platforms/$(PLATFORM)/Makefile && echo arch/xtensa/platforms/$(PLATFORM)/)
64-
6556
# Find libgcc.a
6657

6758
LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
6859

6960
head-y := arch/xtensa/kernel/head.o
70-
core-y += arch/xtensa/kernel/ arch/xtensa/mm/
71-
core-y += $(buildvar) $(buildplf)
72-
core-y += arch/xtensa/boot/dts/
7361

7462
libs-y += arch/xtensa/lib/ $(LIBGCC)
7563

arch/xtensa/kernel/traps.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ void do_interrupt(struct pt_regs *regs)
268268
XCHAL_INTLEVEL7_MASK,
269269
};
270270
struct pt_regs *old_regs;
271+
unsigned unhandled = ~0u;
271272

272273
trace_hardirqs_off();
273274

@@ -283,13 +284,19 @@ void do_interrupt(struct pt_regs *regs)
283284
for (level = LOCKLEVEL; level > 0; --level) {
284285
if (int_at_level & int_level_mask[level]) {
285286
int_at_level &= int_level_mask[level];
287+
if (int_at_level & unhandled)
288+
int_at_level &= unhandled;
289+
else
290+
unhandled |= int_level_mask[level];
286291
break;
287292
}
288293
}
289294

290295
if (level == 0)
291296
break;
292297

298+
/* clear lowest pending irq in the unhandled mask */
299+
unhandled ^= (int_at_level & -int_at_level);
293300
do_IRQ(__ffs(int_at_level), regs);
294301
}
295302

arch/xtensa/platforms/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# SPDX-License-Identifier: GPL-2.0-only
2+
obj-$(CONFIG_XTENSA_PLATFORM_XT2000) += xt2000/
3+
obj-$(CONFIG_XTENSA_PLATFORM_ISS) += iss/
4+
obj-$(CONFIG_XTENSA_PLATFORM_XTFPGA) += xtfpga/

arch/xtensa/platforms/iss/console.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,10 @@ late_initcall(rs_init);
199199

200200
static void iss_console_write(struct console *co, const char *s, unsigned count)
201201
{
202-
int len = strlen(s);
203-
204-
if (s != 0 && *s != 0)
202+
if (s && *s != 0) {
203+
int len = strlen(s);
205204
simc_write(1, s, count < len ? count : len);
205+
}
206206
}
207207

208208
static struct tty_driver* iss_console_device(struct console *c, int *index)

0 commit comments

Comments
 (0)