Commit b5d6d263 authored by Linus Torvalds's avatar Linus Torvalds

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
parents aa829778 7b7cec47
# SPDX-License-Identifier: GPL-2.0-only # SPDX-License-Identifier: GPL-2.0-only
obj-y += kernel/ mm/ platforms/ boot/dts/
...@@ -31,7 +31,7 @@ config XTENSA ...@@ -31,7 +31,7 @@ config XTENSA
select HAVE_DMA_CONTIGUOUS select HAVE_DMA_CONTIGUOUS
select HAVE_EXIT_THREAD select HAVE_EXIT_THREAD
select HAVE_FUNCTION_TRACER select HAVE_FUNCTION_TRACER
select HAVE_FUTEX_CMPXCHG if !MMU select HAVE_FUTEX_CMPXCHG if !MMU && FUTEX
select HAVE_HW_BREAKPOINT if PERF_EVENTS select HAVE_HW_BREAKPOINT if PERF_EVENTS
select HAVE_IRQ_TIME_ACCOUNTING select HAVE_IRQ_TIME_ACCOUNTING
select HAVE_PCI select HAVE_PCI
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
variant-y := $(patsubst "%",%,$(CONFIG_XTENSA_VARIANT_NAME)) variant-y := $(patsubst "%",%,$(CONFIG_XTENSA_VARIANT_NAME))
VARIANT = $(variant-y) VARIANT = $(variant-y)
export VARIANT
ifneq ($(VARIANT),) ifneq ($(VARIANT),)
ifdef cross_compiling ifdef cross_compiling
...@@ -33,9 +32,6 @@ platform-$(CONFIG_XTENSA_PLATFORM_XT2000) := xt2000 ...@@ -33,9 +32,6 @@ platform-$(CONFIG_XTENSA_PLATFORM_XT2000) := xt2000
platform-$(CONFIG_XTENSA_PLATFORM_ISS) := iss platform-$(CONFIG_XTENSA_PLATFORM_ISS) := iss
platform-$(CONFIG_XTENSA_PLATFORM_XTFPGA) := xtfpga platform-$(CONFIG_XTENSA_PLATFORM_XTFPGA) := xtfpga
PLATFORM = $(platform-y)
export PLATFORM
# temporarily until string.h is fixed # temporarily until string.h is fixed
KBUILD_CFLAGS += -ffreestanding -D__linux__ KBUILD_CFLAGS += -ffreestanding -D__linux__
KBUILD_CFLAGS += -pipe -mlongcalls -mtext-section-literals KBUILD_CFLAGS += -pipe -mlongcalls -mtext-section-literals
...@@ -57,19 +53,11 @@ KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(vardirs) $(plfdirs)) ...@@ -57,19 +53,11 @@ KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(vardirs) $(plfdirs))
KBUILD_DEFCONFIG := iss_defconfig KBUILD_DEFCONFIG := iss_defconfig
# Only build variant and/or platform if it includes a Makefile
buildvar := $(shell test -e $(srctree)/arch/xtensa/variants/$(VARIANT)/Makefile && echo arch/xtensa/variants/$(VARIANT)/)
buildplf := $(shell test -e $(srctree)/arch/xtensa/platforms/$(PLATFORM)/Makefile && echo arch/xtensa/platforms/$(PLATFORM)/)
# Find libgcc.a # Find libgcc.a
LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
head-y := arch/xtensa/kernel/head.o head-y := arch/xtensa/kernel/head.o
core-y += arch/xtensa/kernel/ arch/xtensa/mm/
core-y += $(buildvar) $(buildplf)
core-y += arch/xtensa/boot/dts/
libs-y += arch/xtensa/lib/ $(LIBGCC) libs-y += arch/xtensa/lib/ $(LIBGCC)
......
...@@ -268,6 +268,7 @@ void do_interrupt(struct pt_regs *regs) ...@@ -268,6 +268,7 @@ void do_interrupt(struct pt_regs *regs)
XCHAL_INTLEVEL7_MASK, XCHAL_INTLEVEL7_MASK,
}; };
struct pt_regs *old_regs; struct pt_regs *old_regs;
unsigned unhandled = ~0u;
trace_hardirqs_off(); trace_hardirqs_off();
...@@ -283,6 +284,10 @@ void do_interrupt(struct pt_regs *regs) ...@@ -283,6 +284,10 @@ void do_interrupt(struct pt_regs *regs)
for (level = LOCKLEVEL; level > 0; --level) { for (level = LOCKLEVEL; level > 0; --level) {
if (int_at_level & int_level_mask[level]) { if (int_at_level & int_level_mask[level]) {
int_at_level &= int_level_mask[level]; int_at_level &= int_level_mask[level];
if (int_at_level & unhandled)
int_at_level &= unhandled;
else
unhandled |= int_level_mask[level];
break; break;
} }
} }
...@@ -290,6 +295,8 @@ void do_interrupt(struct pt_regs *regs) ...@@ -290,6 +295,8 @@ void do_interrupt(struct pt_regs *regs)
if (level == 0) if (level == 0)
break; break;
/* clear lowest pending irq in the unhandled mask */
unhandled ^= (int_at_level & -int_at_level);
do_IRQ(__ffs(int_at_level), regs); do_IRQ(__ffs(int_at_level), regs);
} }
......
# SPDX-License-Identifier: GPL-2.0-only
obj-$(CONFIG_XTENSA_PLATFORM_XT2000) += xt2000/
obj-$(CONFIG_XTENSA_PLATFORM_ISS) += iss/
obj-$(CONFIG_XTENSA_PLATFORM_XTFPGA) += xtfpga/
...@@ -199,10 +199,10 @@ late_initcall(rs_init); ...@@ -199,10 +199,10 @@ late_initcall(rs_init);
static void iss_console_write(struct console *co, const char *s, unsigned count) static void iss_console_write(struct console *co, const char *s, unsigned count)
{ {
int len = strlen(s); if (s && *s != 0) {
int len = strlen(s);
if (s != 0 && *s != 0)
simc_write(1, s, count < len ? count : len); simc_write(1, s, count < len ? count : len);
}
} }
static struct tty_driver* iss_console_device(struct console *c, int *index) static struct tty_driver* iss_console_device(struct console *c, int *index)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment