[SRU][F/linux-raspi][PATCH] UBUNTU: [Config] Switch from PREEMPT_VOLUNTARY to PREEMPT

Juerg Haefliger juerg.haefliger at canonical.com
Fri Aug 7 12:20:05 UTC 2020


BugLink: https://bugs.launchpad.net/bugs/1890808
BugLink: https://bugs.launchpad.net/bugs/1880388
BugLink: https://bugs.launchpad.net/bugs/1887831

CONFIG_PREEMPT was accidentially disabled (and CONFIG_PREEMPT_VOLUNTARY
enabled instead) with the Disco release of the raspi kernel. That should not
have happened and is by itself reason enough to change it back.

Furthermore, this change uncovered a locking issue in the dwc_otg driver.
With CONFIG_PROVE_LOCKING=y:

[  197.032171] ================================
[  197.039097] WARNING: inconsistent lock state
[  197.046003] 5.4.44 #7 Not tainted
[  197.051856] --------------------------------
[  197.058617] inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage.
[  197.067139] minicom/823 [HC0[0]:SC0[0]:HE1:SE1] takes:
[  197.074711] ffff00003530f098 (&((spinlock_t *)hcd->lock)->rlock){?.-.}, at: DWC_SPINLOCK_IRQSAVE+0x24/0x38
[  197.089460] {IN-HARDIRQ-W} state was registered at:
[  197.096982]   lock_acquire+0xd0/0x210
[  197.103208]   _raw_spin_lock+0x3c/0x50
[  197.109427]   DWC_SPINLOCK+0x20/0x30
[  197.115370]   dwc_otg_handle_common_intr+0x5c/0xdc0
[  197.122589]   dwc_otg_common_irq+0x20/0x38
[  197.128917]   __handle_irq_event_percpu+0xb8/0x360
[  197.135970]   handle_irq_event_percpu+0x3c/0x98
[  197.142737]   handle_irq_event+0x4c/0x80
[  197.148784]   handle_level_irq+0xbc/0x140
[  197.154867]   generic_handle_irq+0x34/0x50
[  197.161024]   bcm2836_chained_handle_irq+0x50/0x70
[  197.167903]   generic_handle_irq+0x34/0x50
[  197.174047]   __handle_domain_irq+0x6c/0xc0
[  197.180277]   bcm2836_arm_irqchip_handle_irq+0x74/0xe0
[  197.187517]   el1_irq+0x108/0x200
[  197.192874]   arch_cpu_idle+0x3c/0x1c8
[  197.198624]   default_idle_call+0x24/0x48
[  197.204593]   do_idle+0x210/0x2a0
[  197.209757]   cpu_startup_entry+0x2c/0x30
[  197.215545]   secondary_start_kernel+0x134/0x1b8
[  197.221929] irq event stamp: 11518
[  197.227047] hardirqs last  enabled at (11517): [<ffffadd6fac9b954>] el0_svc_common.constprop.0+0x10c/0x1e8
[  197.240513] hardirqs last disabled at (11518): [<ffffadd6fb7e4078>] _raw_spin_lock_irqsave+0x30/0x78
[  197.253784] softirqs last  enabled at (11506): [<ffffadd6fac824f8>] __do_softirq+0x400/0x488
[  197.266666] softirqs last disabled at (11481): [<ffffadd6facfa4ac>] irq_exit+0xfc/0x130
<SNIP>

So reenable CONFIG_PREEMPT which gets rid of the above warning and brings us
back in line with Bionic (and upstream raspberrypi as well).

Signed-off-by: Juerg Haefliger <juergh at canonical.com>
---
 debian.raspi/config/config.common.ubuntu | 63 ++++--------------------
 1 file changed, 9 insertions(+), 54 deletions(-)

diff --git a/debian.raspi/config/config.common.ubuntu b/debian.raspi/config/config.common.ubuntu
index df7a4c6cf3cf..4f8355ed3f67 100644
--- a/debian.raspi/config/config.common.ubuntu
+++ b/debian.raspi/config/config.common.ubuntu
@@ -250,32 +250,6 @@ CONFIG_ARCH_HIBERNATION_HEADER=y
 CONFIG_ARCH_HIBERNATION_POSSIBLE=y
 # CONFIG_ARCH_HIGHBANK is not set
 # CONFIG_ARCH_HISI is not set
-CONFIG_ARCH_INLINE_READ_LOCK=y
-CONFIG_ARCH_INLINE_READ_LOCK_BH=y
-CONFIG_ARCH_INLINE_READ_LOCK_IRQ=y
-CONFIG_ARCH_INLINE_READ_LOCK_IRQSAVE=y
-CONFIG_ARCH_INLINE_READ_UNLOCK=y
-CONFIG_ARCH_INLINE_READ_UNLOCK_BH=y
-CONFIG_ARCH_INLINE_READ_UNLOCK_IRQ=y
-CONFIG_ARCH_INLINE_READ_UNLOCK_IRQRESTORE=y
-CONFIG_ARCH_INLINE_SPIN_LOCK=y
-CONFIG_ARCH_INLINE_SPIN_LOCK_BH=y
-CONFIG_ARCH_INLINE_SPIN_LOCK_IRQ=y
-CONFIG_ARCH_INLINE_SPIN_LOCK_IRQSAVE=y
-CONFIG_ARCH_INLINE_SPIN_TRYLOCK=y
-CONFIG_ARCH_INLINE_SPIN_TRYLOCK_BH=y
-CONFIG_ARCH_INLINE_SPIN_UNLOCK=y
-CONFIG_ARCH_INLINE_SPIN_UNLOCK_BH=y
-CONFIG_ARCH_INLINE_SPIN_UNLOCK_IRQ=y
-CONFIG_ARCH_INLINE_SPIN_UNLOCK_IRQRESTORE=y
-CONFIG_ARCH_INLINE_WRITE_LOCK=y
-CONFIG_ARCH_INLINE_WRITE_LOCK_BH=y
-CONFIG_ARCH_INLINE_WRITE_LOCK_IRQ=y
-CONFIG_ARCH_INLINE_WRITE_LOCK_IRQSAVE=y
-CONFIG_ARCH_INLINE_WRITE_UNLOCK=y
-CONFIG_ARCH_INLINE_WRITE_UNLOCK_BH=y
-CONFIG_ARCH_INLINE_WRITE_UNLOCK_IRQ=y
-CONFIG_ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE=y
 # CONFIG_ARCH_IOP32X is not set
 # CONFIG_ARCH_IXP4XX is not set
 # CONFIG_ARCH_K3 is not set
@@ -1093,6 +1067,7 @@ CONFIG_CDROM_PKTCDVD=m
 CONFIG_CDROM_PKTCDVD_BUFFERS=8
 # CONFIG_CDROM_PKTCDVD_WCACHE is not set
 CONFIG_CEC_CORE=y
+# CONFIG_CEC_GPIO is not set
 CONFIG_CEC_NOTIFIER=y
 CONFIG_CEC_PLATFORM_DRIVERS=y
 CONFIG_CEPH_FS=m
@@ -1594,6 +1569,7 @@ CONFIG_DEBUG_MISC=y
 # CONFIG_DEBUG_PER_CPU_MAPS is not set
 # CONFIG_DEBUG_PINCTRL is not set
 # CONFIG_DEBUG_PLIST is not set
+# CONFIG_DEBUG_PREEMPT is not set
 # CONFIG_DEBUG_RODATA_TEST is not set
 # CONFIG_DEBUG_RSEQ is not set
 # CONFIG_DEBUG_RT_MUTEXES is not set
@@ -3095,31 +3071,6 @@ CONFIG_INIT_ENV_ARG_LIMIT=32
 # CONFIG_INIT_ON_ALLOC_DEFAULT_ON is not set
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
 CONFIG_INIT_STACK_NONE=y
-CONFIG_INLINE_READ_LOCK=y
-CONFIG_INLINE_READ_LOCK_BH=y
-CONFIG_INLINE_READ_LOCK_IRQ=y
-CONFIG_INLINE_READ_LOCK_IRQSAVE=y
-CONFIG_INLINE_READ_UNLOCK=y
-CONFIG_INLINE_READ_UNLOCK_BH=y
-CONFIG_INLINE_READ_UNLOCK_IRQ=y
-CONFIG_INLINE_READ_UNLOCK_IRQRESTORE=y
-CONFIG_INLINE_SPIN_LOCK=y
-CONFIG_INLINE_SPIN_LOCK_BH=y
-CONFIG_INLINE_SPIN_LOCK_IRQ=y
-CONFIG_INLINE_SPIN_LOCK_IRQSAVE=y
-CONFIG_INLINE_SPIN_TRYLOCK=y
-CONFIG_INLINE_SPIN_TRYLOCK_BH=y
-CONFIG_INLINE_SPIN_UNLOCK_BH=y
-CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
-CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE=y
-CONFIG_INLINE_WRITE_LOCK=y
-CONFIG_INLINE_WRITE_LOCK_BH=y
-CONFIG_INLINE_WRITE_LOCK_IRQ=y
-CONFIG_INLINE_WRITE_LOCK_IRQSAVE=y
-CONFIG_INLINE_WRITE_UNLOCK=y
-CONFIG_INLINE_WRITE_UNLOCK_BH=y
-CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
-CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE=y
 CONFIG_INOTIFY_USER=y
 CONFIG_INPUT=y
 CONFIG_INPUT_88PM80X_ONKEY=m
@@ -5342,13 +5293,17 @@ CONFIG_PPS_CLIENT_LDISC=m
 CONFIG_PPS_CLIENT_PARPORT=m
 # CONFIG_PPS_DEBUG is not set
 CONFIG_PPTP=m
-# CONFIG_PREEMPT is not set
+CONFIG_PREEMPT=y
+CONFIG_PREEMPTION=y
 # CONFIG_PREEMPTIRQ_DELAY_TEST is not set
 # CONFIG_PREEMPTIRQ_EVENTS is not set
 CONFIG_PREEMPTIRQ_TRACEPOINTS=y
+CONFIG_PREEMPT_COUNT=y
 # CONFIG_PREEMPT_NONE is not set
 CONFIG_PREEMPT_NOTIFIERS=y
-CONFIG_PREEMPT_VOLUNTARY=y
+CONFIG_PREEMPT_RCU=y
+# CONFIG_PREEMPT_TRACER is not set
+# CONFIG_PREEMPT_VOLUNTARY is not set
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_PRINTER=m
 CONFIG_PRINTK=y
@@ -7161,7 +7116,6 @@ CONFIG_TRACING=y
 CONFIG_TRACING_MAP=y
 CONFIG_TRACING_SUPPORT=y
 # CONFIG_TRANSPARENT_HUGEPAGE is not set
-CONFIG_TREE_RCU=y
 CONFIG_TREE_SRCU=y
 CONFIG_TRUSTED_FOUNDATIONS=y
 CONFIG_TRUSTED_KEYS=y
@@ -7234,6 +7188,7 @@ CONFIG_ULTRIX_PARTITION=y
 CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h"
 CONFIG_UNICODE=y
 # CONFIG_UNICODE_NORMALIZATION_SELFTEST is not set
+CONFIG_UNINLINE_SPIN_UNLOCK=y
 CONFIG_UNISYSSPAR=y
 CONFIG_UNIX=y
 CONFIG_UNIX98_PTYS=y
-- 
2.25.1




More information about the kernel-team mailing list