From b4afe7018c5784d249a43834017a65b19d21054b Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sat, 4 May 2019 23:30:41 +0100 Subject: [rt] Update to 5.0.10-rt7 and re-enable --- debian/changelog | 2 +- debian/config/defines | 2 +- ...ve-SoC-specific-definitions-to-SoC-folder.patch | 19 +- ...ff-and-zone-lock-while-freeing-pages-from.patch | 2 +- ...k-rb-add-printk-ring-buffer-documentation.patch | 2 +- ...ove-fpu-initialized-usage-in-__fpu__resto.patch | 2 +- ...ff-and-zone-lock-while-freeing-pages-from.patch | 2 +- ...-drivers-tcb_clksrc-stop-depending-on-atm.patch | 252 ++++++ .../0002-misc-atmel_tclib-drop-AVR32-support.patch | 34 - .../0002-printk-rb-add-prb-locking-functions.patch | 2 +- .../0002-x86-fpu-Remove-fpu__restore.patch | 2 +- ...-drivers-tcb_clksrc-Use-tcb-as-sched_cloc.patch | 74 ++ ...mel_tclib-move-definitions-to-header-file.patch | 86 -- ...m-SLxB-change-list_lock-to-raw_spinlock_t.patch | 2 +- ...define-ring-buffer-struct-and-initializer.patch | 2 +- ...-fpu-Remove-preempt_disable-in-fpu__clear.patch | 2 +- ...-ARM-at91-Implement-clocksource-selection.patch | 46 + ...-drivers-tcb_clksrc-stop-depending-on-atm.patch | 242 ----- ...ay-giving-back-empty-slubs-to-IRQ-enabled.patch | 2 +- .../0004-printk-rb-add-writer-interface.patch | 2 +- ...6-fpu-Always-init-the-state-in-fpu__clear.patch | 2 +- ...-drivers-tcb_clksrc-Use-tcb-as-sched_cloc.patch | 74 -- ...ce-drivers-tcb_clksrc-move-Kconfig-option.patch | 55 ++ ...-add-basic-non-blocking-reading-interface.patch | 2 +- ...ove-fpu-initialized-usage-in-copy_fpstate.patch | 2 +- ...-ARM-at91-Implement-clocksource-selection.patch | 46 - ...-drivers-timer-atmel-pit-rework-Kconfig-o.patch | 30 + ...006-printk-rb-add-blocking-reader-support.patch | 2 +- ...-t-save-fxregs-for-ia32-frames-in-copy_fp.patch | 2 +- ...-drivers-tcb_clksrc-Rename-the-file-for-c.patch | 990 +++++++++++++++++++++ ...ce-drivers-tcb_clksrc-move-Kconfig-option.patch | 54 -- ...k-rb-add-functionality-required-by-printk.patch | 2 +- .../0007-x86-fpu-Remove-fpu-initialized.patch | 2 +- ...-drivers-timer-atmel-pit-rework-Kconfig-o.patch | 30 - ...-drivers-timer-atmel-tcb-tc_clksrc_suspen.patch | 35 + .../0008-printk-add-ring-buffer-and-kthread.patch | 2 +- .../0008-x86-fpu-Remove-user_fpu_begin.patch | 2 +- ...-drivers-tcb_clksrc-Rename-the-file-for-c.patch | 985 -------------------- ...tmel_tclib-do-not-probe-already-used-TCBs.patch | 27 + ...0009-printk-remove-exclusive-console-hack.patch | 2 +- ...x86-fpu-Add-__-make_fpregs_active-helpers.patch | 2 +- .../0010-ARM-configs-at91-unselect-PIT.patch | 36 - ...ntk-redirect-emit-store-to-new-ringbuffer.patch | 2 +- ...e-__raw_xsave_addr-use-feature-number-ins.patch | 2 +- ...tmel_tclib-do-not-probe-already-used-TCBs.patch | 26 - .../0011-printk_safe-remove-printk-safe-code.patch | 2 +- ...e-get_xsave_field_ptr-and-get_xsave_addr-.patch | 10 +- ...-drivers-timer-atmel-tcb-Use-ARRAY_SIZE-i.patch | 26 - ...k-minimize-console-locking-implementation.patch | 2 +- ...12-x86-pkru-Provide-.-_pkru_ins-functions.patch | 4 +- .../0013-printk-track-seq-per-console.patch | 2 +- ...y-write-PKRU-if-it-is-different-from-curr.patch | 2 +- ...tk-do-boot_delay_msec-inside-printk_delay.patch | 2 +- ...on-t-check-if-PKRU-is-zero-before-writtin.patch | 2 +- ...015-printk-print-history-for-new-consoles.patch | 2 +- .../0015-x86-fpu-Eager-switch-PKRU-state.patch | 2 +- .../0016-printk-implement-CON_PRINTBUFFER.patch | 2 +- .../0016-x86-entry-Add-TIF_NEED_FPU_LOAD.patch | 2 +- ...017-printk-add-processor-number-to-output.patch | 2 +- ...ays-store-the-registers-in-copy_fpstate_t.patch | 2 +- .../0018-console-add-write_atomic-interface.patch | 2 +- ...pare-copy_fpstate_to_sigframe-for-TIF_NEE.patch | 2 +- .../0019-printk-introduce-emergency-messages.patch | 2 +- ...-Update-xstate-s-PKRU-value-on-write_pkru.patch | 2 +- .../0020-serial-8250-implement-write_atomic.patch | 2 +- ...86-fpu-Inline-copy_user_to_fpregs_zeroing.patch | 2 +- .../0021-printk-implement-KERN_CONT.patch | 2 +- ...-__fpu__restore_sig-restore-the-32bit-fxs.patch | 2 +- .../0022-printk-implement-dev-kmsg.patch | 2 +- ...ge-the-two-code-paths-in-__fpu__restore_s.patch | 2 +- .../patches-rt/0023-printk-implement-syslog.patch | 2 +- ...er-FPU-state-load-until-return-to-userspa.patch | 4 +- .../0024-printk-implement-kmsg_dump.patch | 2 +- ...-fpu-Add-a-fastpath-to-__fpu__restore_sig.patch | 2 +- .../0025-printk-remove-unused-code.patch | 2 +- ...dd-a-fastpath-to-copy_fpstate_to_sigframe.patch | 2 +- ...tore-FPU-register-in-copy_fpstate_to_sigf.patch | 2 +- ...-x86-pkeys-add-PKRU-value-to-init_fpstate.patch | 2 +- ...lt-in-user-stack-if-copy_fpstate_to_sigfr.patch | 105 +++ ...ove-unnecessary-saving-of-FPU-registers-i.patch | 67 ++ ...irq-in-translation-section-permission-fau.patch | 2 +- ...-hv-vmbus-include-header-for-get_irq_regs.patch | 2 +- debian/patches-rt/EXP-rcu-skip_workqueue.patch | 2 +- ...64-downgrade-preempt_disable-d-region-to-.patch | 2 +- ...NFSv4-replace-seqcount_t-with-a-seqlock_t.patch | 2 +- debian/patches-rt/add_migrate_disable.patch | 2 +- ...r-use-a-locallock-instead-preempt_disable.patch | 2 +- .../arch-arm64-Add-lazy-preempt-support.patch | 2 +- .../arm-disable-NEON-in-kernel-mode.patch | 2 +- debian/patches-rt/arm-enable-highmem-for-rt.patch | 2 +- .../arm-highmem-flush-tlb-on-unmap.patch | 2 +- .../arm-include-definition-for-cpumask_t.patch | 2 +- ...arm-kprobe-replace-patch_lock-to-raw-lock.patch | 70 -- debian/patches-rt/arm-preempt-lazy-support.patch | 2 +- debian/patches-rt/arm-remove-printk_nmi_.patch | 2 +- ...ompute_layout-before-altenates-are-applie.patch | 2 +- ...d-use-preemp_disable-in-addition-to-local.patch | 2 +- .../at91_dont_enable_disable_clock.patch | 2 +- ...q-move-blk_queue_usage_counter_release-in.patch | 2 +- .../block-mq-don-t-complete-requests-via-IPI.patch | 2 +- .../patches-rt/block-mq-drop-preempt-disable.patch | 2 +- debian/patches-rt/block-mq-use-cpu_light.patch | 4 +- debian/patches-rt/block-use-cpu-chill.patch | 2 +- ...-use-irqsave-in-cgroup_rstat_flush_locked.patch | 2 +- .../cgroups-use-simple-wait-in-css_release.patch | 2 +- ...clocksource-tclib-allow-higher-clockrates.patch | 4 +- .../completion-use-simple-wait-queues.patch | 2 +- debian/patches-rt/cond-resched-lock-rt-tweak.patch | 2 +- ...n_proc-Protect-send_msg-with-a-local-lock.patch | 2 +- .../cpu-hotplug--Implement-CPU-pinning.patch | 2 +- ...req-drop-K8-s-driver-from-beeing-selected.patch | 2 +- .../cpumask-disable-offstack-on-rt.patch | 2 +- ...t-Convert-callback_lock-to-raw_spinlock_t.patch | 2 +- ...educe-preempt-disabled-regions-more-algos.patch | 2 +- .../crypto-chtls-remove-cdev_list_lock.patch | 2 +- ...td-add-a-lock-instead-preempt_disable-loc.patch | 2 +- .../crypto-limit-more-FPU-enabled-sections.patch | 2 +- ...press-serialize-RT-percpu-scratch-buffer-.patch | 2 +- .../crypto-user-remove-crypto_cfg_mutex.patch | 2 +- debian/patches-rt/debugobjects-rt.patch | 2 +- ...ck-zram-Replace-bit-spinlocks-with-rtmute.patch | 2 +- .../drivers-tty-fix-omap-lock-crap.patch | 2 +- .../drivers-tty-pl011-irq-disable-madness.patch | 2 +- ...m-Don-t-disable-preemption-in-zcomp_strea.patch | 2 +- ...n-t-disable-interrupts-independently-of-t.patch | 2 +- .../drm-i915-disable-tracing-on-RT.patch | 2 +- .../drm-i915-fence-Do-not-use-TIMER_IRQSAFE.patch | 2 +- ...ip-DRM_I915_LOW_LEVEL_TRACEPOINTS-with-NO.patch | 2 +- ...ock_irq()_in_intel_pipe_update_startend().patch | 2 +- ...empt_disableenable_rt()_where_recommended.patch | 2 +- debian/patches-rt/efi-Allow-efi-runtime.patch | 2 +- .../efi-Disable-runtime-services-on-RT.patch | 2 +- debian/patches-rt/epoll-use-get-cpu-light.patch | 2 +- debian/patches-rt/fs-aio-simple-simple-work.patch | 2 +- ...bring-back-explicit-INIT_HLIST_BL_HEAD-in.patch | 2 +- ...isable-preemption-on-i_dir_seq-s-write-si.patch | 2 +- .../fs-dcache-use-cpu-chill-in-trylock-loops.patch | 2 +- ...ache-use-swait_queue-instead-of-waitqueue.patch | 2 +- .../patches-rt/fs-jbd-replace-bh_state-lock.patch | 2 +- .../fs-nfs-turn-rmdir_sem-into-a-semaphore.patch | 2 +- .../fs-replace-bh_uptodate_lock-for-rt.patch | 2 +- ...nitialize-cookie-hash-table-raw-spinlocks.patch | 2 +- .../ftrace-Fix-trace-header-alignment.patch | 2 +- .../ftrace-migrate-disable-tracing.patch | 2 +- ...e-lock-unlock-symetry-versus-pi_lock-and-.patch | 2 +- debian/patches-rt/futex-requeue-pi-fix.patch | 2 +- ...round-migrate_disable-enable-in-different.patch | 2 +- .../patches-rt/genirq-disable-irqpoll-on-rt.patch | 2 +- ...ot-invoke-the-affinity-callback-via-a-wor.patch | 2 +- debian/patches-rt/genirq-force-threading.patch | 2 +- ...pdate-irq_set_irqchip_state-documentation.patch | 2 +- ...plug-duct-tape-RT-rwlock-usage-for-non-RT.patch | 2 +- .../patches-rt/hotplug-light-get-online-cpus.patch | 2 +- ...-Move-schedule_work-call-to-helper-thread.patch | 2 +- ...imers-by-default-into-the-softirq-context.patch | 6 +- ...solidate-hrtimer_init-hrtimer_init_sleepe.patch | 4 +- ...e-state-change-before-hrtimer_cancel-in-d.patch | 2 +- .../hrtimers-prepare-full-preemption.patch | 2 +- ...-softirq-processing-in-irq-thread-context.patch | 2 +- ...qwork-push_most_work_into_softirq_context.patch | 2 +- debian/patches-rt/jump-label-rt.patch | 2 +- .../kconfig-disable-a-few-options-rt.patch | 2 +- debian/patches-rt/kconfig-preempt-rt-full.patch | 2 +- ...d-Provide-a-pointer-to-the-valid-CPU-mask.patch | 30 +- ...d-move-stack-kprobe-clean-up-to-__put_tas.patch | 2 +- ...-Turn-kmemleak_lock-to-raw-spinlock-on-RT.patch | 2 +- .../kthread-Do-not-use-TIMER_IRQSAFE.patch | 2 +- .../kthread-add-a-global-worker-thread.patch | 2 +- ...hread-convert-worker-lock-to-raw-spinlock.patch | 2 +- .../leds-trigger-disable-CPU-trigger-on-RT.patch | 2 +- .../list_bl-fixup-bogus-lockdep-warning.patch | 2 +- .../list_bl.h-make-list-head-locking-RT-safe.patch | 2 +- ...lock-provide-get-put-_locked_ptr-variants.patch | 2 +- debian/patches-rt/localversion.patch | 4 +- debian/patches-rt/lockdep-disable-self-test.patch | 2 +- .../lockdep-no-softirq-accounting-on-rt.patch | 2 +- ...ftest-fix-warnings-due-to-missing-PREEMPT.patch | 2 +- ...-do-hardirq-context-test-for-raw-spinlock.patch | 2 +- ...-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch | 2 +- ...ktorture-Do-NOT-include-rwlock.h-directly.patch | 2 +- ...-rt-mutex-Flush-block-plug-on-__down_read.patch | 2 +- ...mutex-fix-deadlock-in-device-mapper-block.patch | 2 +- ...utex-re-init-the-wait_lock-in-rt_mutex_in.patch | 2 +- debian/patches-rt/md-disable-bcache.patch | 2 +- .../md-raid5-percpu-handling-rt-aware.patch | 2 +- debian/patches-rt/mips-disable-highmem-on-rt.patch | 2 +- .../mm-convert-swap-to-percpu-locked.patch | 2 +- debian/patches-rt/mm-disable-sloub-rt.patch | 2 +- debian/patches-rt/mm-enable-slub.patch | 2 +- debian/patches-rt/mm-make-vmstat-rt-aware.patch | 2 +- ...ol-Don-t-call-schedule_work_on-in-preempt.patch | 2 +- .../mm-memcontrol-do_not_disable_irq.patch | 16 +- .../mm-page_alloc-rt-friendly-per-cpu-pages.patch | 2 +- .../mm-perform-lru_add_drain_all-remotely.patch | 2 +- .../patches-rt/mm-protect-activate-switch-mm.patch | 2 +- .../patches-rt/mm-rt-kmap-atomic-scheduling.patch | 2 +- .../mm-scatterlist-dont-disable-irqs-on-RT.patch | 2 +- .../patches-rt/mm-vmalloc-use-get-cpu-light.patch | 2 +- ...et-replace-IRQ-off-check-with-a-lockdep-a.patch | 2 +- ...smalloc_copy_with_get_cpu_var_and_locking.patch | 2 +- debian/patches-rt/mutex-no-spin-on-rt.patch | 2 +- ...napi_schedule_irqoff-disable-interrupts-o.patch | 6 +- .../net-Qdisc-use-a-seqlock-instead-seqcount.patch | 2 +- .../patches-rt/net-add-a-lock-around-icmp_sk.patch | 2 +- ...k-the-missing-serialization-in-ip_send_un.patch | 2 +- ...r-local-irq-disable-alloc-atomic-headache.patch | 2 +- ...otect-users-of-napi_alloc_cache-against-r.patch | 2 +- ...-core-use-local_bh_disable-in-netif_rx_ni.patch | 4 +- ...ays-take-qdisc-s-busylock-in-__dev_xmit_s.patch | 4 +- ...-iptable-xt-write-recseq-begin-rt-fallout.patch | 2 +- .../net-make-devnet_rename_seq-a-mutex.patch | 12 +- ...xmit_recursion-to-per-task-variable-on-RT.patch | 16 +- ...-a-way-to-delegate-processing-a-softirq-t.patch | 4 +- ...ev_deactivate_many-use-msleep-1-instead-o.patch | 2 +- debian/patches-rt/net-use-cpu-chill.patch | 2 +- .../patches-rt/net_disable_NET_RX_BUSY_POLL.patch | 2 +- ...-free-phandle-cache-outside-of-the-devtre.patch | 2 +- debian/patches-rt/oleg-signal-rt-fix.patch | 2 +- debian/patches-rt/panic-disable-random-on-rt.patch | 2 +- ...itchtec-Don-t-use-completion-s-wait-queue.patch | 2 +- ...include-irqflags.h-for-raw_local_irq_save.patch | 2 +- debian/patches-rt/peterz-percpu-rwsem-rt.patch | 2 +- debian/patches-rt/pid.h-include-atomic.h.patch | 2 +- ...osix-timers-thread-posix-cpu-timers-on-rt.patch | 2 +- .../patches-rt/power-disable-highmem-on-rt.patch | 2 +- .../patches-rt/power-use-generic-rwsem-on-rt.patch | 2 +- ...-Disable-in-kernel-MPIC-emulation-for-PRE.patch | 2 +- .../patches-rt/powerpc-preempt-lazy-support.patch | 2 +- ...es-iommu-Use-a-locallock-instead-local_ir.patch | 2 +- ...ckprotector-work-around-stack-guard-init-.patch | 2 +- debian/patches-rt/preempt-lazy-support.patch | 10 +- debian/patches-rt/preempt-nort-rt-variants.patch | 2 +- ...-devkmsg-llseek-reset-clear-if-it-is-lost.patch | 2 +- .../printk-kmsg_dump-remove-mutex-usage.patch | 85 ++ ...tk-only-allow-kernel-to-emergency-message.patch | 2 +- ...rintk-print-rate-limitted-message-as-info.patch | 2 +- ...deferred-to-default-loglevel-enforce-mask.patch | 2 +- .../psi-replace-delayed-work-with-timer-work.patch | 2 +- .../ptrace-fix-ptrace-vs-tasklist_lock-race.patch | 2 +- debian/patches-rt/radix-tree-use-local-locks.patch | 2 +- .../random-avoid-preempt_disable-ed-section.patch | 2 +- debian/patches-rt/random-make-it-work-on-rt.patch | 2 +- ...Eliminate-softirq-processing-from-rcutree.patch | 2 +- .../rcu-disable-rcu-fast-no-hz-on-rt.patch | 2 +- ...e-rcu_normal_after_boot-by-default-for-RT.patch | 2 +- .../rcu-make-RCU_BOOST-default-on-RT.patch | 2 +- ...t_full-arm-coredump-fails-for-cpu-3e-3d-4.patch | 2 +- ...-decrease-the-nr-of-migratory-tasks-when-.patch | 2 +- debian/patches-rt/rt-introduce-cpu-chill.patch | 2 +- debian/patches-rt/rt-local-irq-lock.patch | 2 +- debian/patches-rt/rt-preempt-base-config.patch | 2 +- debian/patches-rt/rt-serial-warn-fix.patch | 2 +- .../rtmutex-Make-lock_killable-work.patch | 2 +- .../rtmutex-Provide-rt_mutex_slowlock_locked.patch | 2 +- ...add-mutex-implementation-based-on-rtmutex.patch | 2 +- ...dd-rwlock-implementation-based-on-rtmutex.patch | 2 +- ...add-rwsem-implementation-based-on-rtmutex.patch | 8 +- .../rtmutex-add-sleeping-lock-implementation.patch | 2 +- .../rtmutex-add-ww_mutex-addon-for-mutex-rt.patch | 2 +- .../rtmutex-annotate-sleeping-lock-context.patch | 2 +- debian/patches-rt/rtmutex-avoid-include-hell.patch | 2 +- ...ort-lockdep-less-version-of-rt_mutex-s-lo.patch | 2 +- debian/patches-rt/rtmutex-futex-prepare-rt.patch | 2 +- debian/patches-rt/rtmutex-lock-killable.patch | 2 +- .../patches-rt/rtmutex-trylock-is-okay-on-RT.patch | 2 +- .../patches-rt/rtmutex-wire-up-RT-s-locking.patch | 4 +- debian/patches-rt/rtmutex_dont_include_rcu.patch | 2 +- ...-pinned-user-tasks-to-be-awakened-to-the-.patch | 2 +- debian/patches-rt/sched-delay-put-task.patch | 2 +- .../sched-disable-rt-group-sched-on-rt.patch | 2 +- debian/patches-rt/sched-disable-ttwu-queue.patch | 2 +- ...hed-fair-Make-the-hrtimers-non-hard-again.patch | 4 +- ...air-Robustify-CFS-bandwidth-timer-locking.patch | 9 +- debian/patches-rt/sched-limit-nr-migrate.patch | 2 +- ...ched-might-sleep-do-not-account-rcu-depth.patch | 2 +- ...te_disable-Add-export_symbol_gpl-for-__mi.patch | 2 +- ...te_disable-fallback-to-preempt_disable-in.patch | 2 +- debian/patches-rt/sched-mmdrop-delayed.patch | 8 +- debian/patches-rt/sched-rt-mutex-wakeup.patch | 2 +- ...ueue-Only-wake-up-idle-workers-if-not-blo.patch | 2 +- debian/patches-rt/scsi-fcoe-rt-aware.patch | 2 +- .../patches-rt/seqlock-prevent-rt-starvation.patch | 2 +- ...-export-symbols-which-are-used-by-symbols.patch | 2 +- ...-remove-that-trylock-in-serial8250_consol.patch | 2 +- debian/patches-rt/series | 28 +- .../signal-revert-ptrace-preempt-magic.patch | 2 +- ...low-rt-tasks-to-cache-one-sigqueue-struct.patch | 2 +- debian/patches-rt/skbufhead-raw-lock.patch | 18 +- .../patches-rt/slub-disable-SLUB_CPU_PARTIAL.patch | 2 +- .../patches-rt/slub-enable-irqs-for-no-wait.patch | 2 +- .../softirq-disable-softirq-stacks-for-rt.patch | 2 +- debian/patches-rt/softirq-preempt-fix-3-re.patch | 14 +- debian/patches-rt/softirq-split-locks.patch | 2 +- ...irq-split-timer-softirqs-out-of-ksoftirqd.patch | 2 +- .../patches-rt/spinlock-types-separate-raw.patch | 2 +- ...ke-use-of-local-lock-in-multi_cpu-decompr.patch | 2 +- .../srcu-Remove-srcu_queue_delayed_work_on.patch | 2 +- ...cu-replace-local_irqsave-with-a-locallock.patch | 2 +- ...ake-svc_xprt_do_enqueue-use-get_cpu_light.patch | 2 +- debian/patches-rt/sysfs-realtime-entry.patch | 2 +- ...klets-from-going-into-infinite-spin-in-rt.patch | 2 +- .../thermal-Defer-thermal-wakups-to-threads.patch | 2 +- ...r-avoid-schedule_work-with-interrupts-dis.patch | 2 +- .../timekeeping-split-jiffies-lock.patch | 4 +- .../timers-prepare-for-full-preemption.patch | 2 +- debian/patches-rt/tpm-remove-tpm_dev_wq_lock.patch | 2 +- .../tpm_tis-fix-stall-after-iowrite-s.patch | 2 +- ...-serial-pl011-warning-about-uninitialized.patch | 2 +- ...sysrq-Convert-show_lock-to-raw_spinlock_t.patch | 2 +- ...t-remove-preemption-disabling-in-netif_rx.patch | 6 +- debian/patches-rt/wait.h-include-atomic.h.patch | 2 +- ...revent-deferral-of-watchdogd-wakeup-on-RT.patch | 2 +- ...ue-work-around-irqsafe-timer-optimization.patch | 2 +- .../workqueue-distangle-from-rq-lock.patch | 2 +- .../workqueue-prevent-deadlock-stall.patch | 2 +- debian/patches-rt/workqueue-use-locallock.patch | 2 +- debian/patches-rt/workqueue-use-rcu.patch | 2 +- ...86-crypto-reduce-preempt-disabled-regions.patch | 2 +- .../x86-highmem-add-a-already-used-pte-check.patch | 2 +- ...a-Check-EFI_RUNTIME_SERVICES-before-using.patch | 32 + ...Don-t-let-setaffinity-unmask-threaded-EOI.patch | 2 +- .../x86-kvm-require-const-tsc-for-rt.patch | 4 +- debian/patches-rt/x86-preempt-lazy.patch | 2 +- ...x86-signal-delay-calling-signals-on-32bit.patch | 2 +- .../patches-rt/x86-stackprot-no-random-on-rt.patch | 2 +- .../x86-use-gen-rwsem-spinlocks-rt.patch | 2 +- 326 files changed, 2209 insertions(+), 2112 deletions(-) create mode 100644 debian/patches-rt/0002-clocksource-drivers-tcb_clksrc-stop-depending-on-atm.patch delete mode 100644 debian/patches-rt/0002-misc-atmel_tclib-drop-AVR32-support.patch create mode 100644 debian/patches-rt/0003-clocksource-drivers-tcb_clksrc-Use-tcb-as-sched_cloc.patch delete mode 100644 debian/patches-rt/0003-misc-atmel_tclib-move-definitions-to-header-file.patch create mode 100644 debian/patches-rt/0004-ARM-at91-Implement-clocksource-selection.patch delete mode 100644 debian/patches-rt/0004-clocksource-drivers-tcb_clksrc-stop-depending-on-atm.patch delete mode 100644 debian/patches-rt/0005-clocksource-drivers-tcb_clksrc-Use-tcb-as-sched_cloc.patch create mode 100644 debian/patches-rt/0005-clocksource-drivers-tcb_clksrc-move-Kconfig-option.patch delete mode 100644 debian/patches-rt/0006-ARM-at91-Implement-clocksource-selection.patch create mode 100644 debian/patches-rt/0006-clocksource-drivers-timer-atmel-pit-rework-Kconfig-o.patch create mode 100644 debian/patches-rt/0007-clocksource-drivers-tcb_clksrc-Rename-the-file-for-c.patch delete mode 100644 debian/patches-rt/0007-clocksource-drivers-tcb_clksrc-move-Kconfig-option.patch delete mode 100644 debian/patches-rt/0008-clocksource-drivers-timer-atmel-pit-rework-Kconfig-o.patch create mode 100644 debian/patches-rt/0008-clocksource-drivers-timer-atmel-tcb-tc_clksrc_suspen.patch delete mode 100644 debian/patches-rt/0009-clocksource-drivers-tcb_clksrc-Rename-the-file-for-c.patch create mode 100644 debian/patches-rt/0009-misc-atmel_tclib-do-not-probe-already-used-TCBs.patch delete mode 100644 debian/patches-rt/0010-ARM-configs-at91-unselect-PIT.patch delete mode 100644 debian/patches-rt/0011-misc-atmel_tclib-do-not-probe-already-used-TCBs.patch delete mode 100644 debian/patches-rt/0012-clocksource-drivers-timer-atmel-tcb-Use-ARRAY_SIZE-i.patch create mode 100644 debian/patches-rt/0028-x86-fpu-Fault-in-user-stack-if-copy_fpstate_to_sigfr.patch create mode 100644 debian/patches-rt/0029-x86-fpu-Remove-unnecessary-saving-of-FPU-registers-i.patch delete mode 100644 debian/patches-rt/arm-kprobe-replace-patch_lock-to-raw-lock.patch create mode 100644 debian/patches-rt/printk-kmsg_dump-remove-mutex-usage.patch create mode 100644 debian/patches-rt/x86-ima-Check-EFI_RUNTIME_SERVICES-before-using.patch diff --git a/debian/changelog b/debian/changelog index 51bde550d..2c87fbe7b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,7 +11,7 @@ linux (5.0.10-1~exp1) UNRELEASED; urgency=medium https://www.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.0.10 [ Ben Hutchings ] - * [rt] Update to 5.0.3-rt1 and re-enable + * [rt] Update to 5.0.10-rt7 and re-enable [ Vagrant Cascadian ] * [arm64] Add patch fixing AXP803 regulator, used by LCD backlight in diff --git a/debian/config/defines b/debian/config/defines index 7720f7552..b43c6ef4e 100644 --- a/debian/config/defines +++ b/debian/config/defines @@ -128,7 +128,7 @@ debug-info: true signed-code: false [featureset-rt_base] -enabled: false +enabled: true [description] part-long-up: This kernel is not suitable for SMP (multi-processor, diff --git a/debian/patches-rt/0001-ARM-at91-move-SoC-specific-definitions-to-SoC-folder.patch b/debian/patches-rt/0001-ARM-at91-move-SoC-specific-definitions-to-SoC-folder.patch index 060f876a6..31fe0f698 100644 --- a/debian/patches-rt/0001-ARM-at91-move-SoC-specific-definitions-to-SoC-folder.patch +++ b/debian/patches-rt/0001-ARM-at91-move-SoC-specific-definitions-to-SoC-folder.patch @@ -1,12 +1,13 @@ From: Alexandre Belloni -Date: Wed, 3 Apr 2019 16:11:09 +0200 -Subject: [PATCH 01/12] ARM: at91: move SoC specific definitions to SoC folder -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Date: Fri, 26 Apr 2019 23:47:10 +0200 +Subject: [PATCH 01/10] ARM: at91: move SoC specific definitions to SoC folder +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Move linux/atmel_tc.h to the SoC specific folder include/soc/at91. -Cc: Thierry Reding Signed-off-by: Alexandre Belloni +Acked-by: Thierry Reding +Acked-by: Arnd Bergmann Signed-off-by: Sebastian Andrzej Siewior --- drivers/clocksource/tcb_clksrc.c | 2 @@ -15,7 +16,8 @@ Signed-off-by: Sebastian Andrzej Siewior include/linux/atmel_tc.h | 270 --------------------------------------- include/soc/at91/atmel_tcb.h | 270 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 273 insertions(+), 273 deletions(-) - rename include/{linux/atmel_tc.h => soc/at91/atmel_tcb.h} (99%) + delete mode 100644 include/linux/atmel_tc.h + create mode 100644 include/soc/at91/atmel_tcb.h --- a/drivers/clocksource/tcb_clksrc.c +++ b/drivers/clocksource/tcb_clksrc.c @@ -45,15 +47,18 @@ Signed-off-by: Sebastian Andrzej Siewior * This is a thin library to solve the problem of how to portably allocate --- a/drivers/pwm/pwm-atmel-tcb.c +++ b/drivers/pwm/pwm-atmel-tcb.c -@@ -17,7 +17,7 @@ +@@ -17,10 +17,10 @@ #include #include #include -#include -+#include #include #include #include ++#include + + #define NPWM 6 + --- a/include/linux/atmel_tc.h +++ /dev/null @@ -1,270 +0,0 @@ diff --git a/debian/patches-rt/0001-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch b/debian/patches-rt/0001-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch index 98f6d072f..ce4e148c7 100644 --- a/debian/patches-rt/0001-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch +++ b/debian/patches-rt/0001-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch @@ -2,7 +2,7 @@ From: Peter Zijlstra Date: Mon, 28 May 2018 15:24:20 +0200 Subject: [PATCH 1/4] Split IRQ-off and zone->lock while freeing pages from PCP list #1 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Split the IRQ-off section while accessing the PCP list from zone->lock while freeing pages. diff --git a/debian/patches-rt/0001-printk-rb-add-printk-ring-buffer-documentation.patch b/debian/patches-rt/0001-printk-rb-add-printk-ring-buffer-documentation.patch index f9a64cd37..36654c391 100644 --- a/debian/patches-rt/0001-printk-rb-add-printk-ring-buffer-documentation.patch +++ b/debian/patches-rt/0001-printk-rb-add-printk-ring-buffer-documentation.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:29:39 +0100 Subject: [PATCH 01/25] printk-rb: add printk ring buffer documentation -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The full documentation file for the printk ring buffer. diff --git a/debian/patches-rt/0001-x86-fpu-Remove-fpu-initialized-usage-in-__fpu__resto.patch b/debian/patches-rt/0001-x86-fpu-Remove-fpu-initialized-usage-in-__fpu__resto.patch index a8bd1cb17..6810e5362 100644 --- a/debian/patches-rt/0001-x86-fpu-Remove-fpu-initialized-usage-in-__fpu__resto.patch +++ b/debian/patches-rt/0001-x86-fpu-Remove-fpu-initialized-usage-in-__fpu__resto.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Tue, 16 Oct 2018 11:08:14 +0200 Subject: [PATCH 01/27] x86/fpu: Remove fpu->initialized usage in __fpu__restore_sig() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz This is a preparation for the removal of the ->initialized member in the fpu struct. diff --git a/debian/patches-rt/0002-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch b/debian/patches-rt/0002-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch index 0e6fff850..3f391f1a7 100644 --- a/debian/patches-rt/0002-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch +++ b/debian/patches-rt/0002-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch @@ -2,7 +2,7 @@ From: Peter Zijlstra Date: Mon, 28 May 2018 15:24:21 +0200 Subject: [PATCH 2/4] Split IRQ-off and zone->lock while freeing pages from PCP list #2 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Split the IRQ-off section while accessing the PCP list from zone->lock while freeing pages. diff --git a/debian/patches-rt/0002-clocksource-drivers-tcb_clksrc-stop-depending-on-atm.patch b/debian/patches-rt/0002-clocksource-drivers-tcb_clksrc-stop-depending-on-atm.patch new file mode 100644 index 000000000..2c30b1591 --- /dev/null +++ b/debian/patches-rt/0002-clocksource-drivers-tcb_clksrc-stop-depending-on-atm.patch @@ -0,0 +1,252 @@ +From: Alexandre Belloni +Date: Fri, 26 Apr 2019 23:47:11 +0200 +Subject: [PATCH 02/10] clocksource/drivers/tcb_clksrc: stop depending on + atmel_tclib +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz + +atmel_tclib is probed too late in the boot process to be able to use the +TCB as the boot clocksource. This is an issue for SoCs without the PIT +(sams70, samv70 and samv71 families) as they simply currently can't boot. + +Get rid of the atmel_tclib dependency and probe everything on our own using +the correct device tree binding. + +This also allows getting rid of ATMEL_TCB_CLKSRC_BLOCK and makes the driver +a bit more flexible as the TCB is not hardcoded in the kernel anymore. + +Signed-off-by: Alexandre Belloni +Signed-off-by: Sebastian Andrzej Siewior +--- + drivers/clocksource/tcb_clksrc.c | 108 ++++++++++++++++++++++++--------------- + drivers/misc/Kconfig | 14 ----- + 2 files changed, 70 insertions(+), 52 deletions(-) + +--- a/drivers/clocksource/tcb_clksrc.c ++++ b/drivers/clocksource/tcb_clksrc.c +@@ -9,7 +9,8 @@ + #include + #include + #include +-#include ++#include ++#include + #include + #include + +@@ -28,13 +29,6 @@ + * source, used in either periodic or oneshot mode. This runs + * at 32 KiHZ, and can handle delays of up to two seconds. + * +- * A boot clocksource and clockevent source are also currently needed, +- * unless the relevant platforms (ARM/AT91, AVR32/AT32) are changed so +- * this code can be used when init_timers() is called, well before most +- * devices are set up. (Some low end AT91 parts, which can run uClinux, +- * have only the timers in one TC block... they currently don't support +- * the tclib code, because of that initialization issue.) +- * + * REVISIT behavior during system suspend states... we should disable + * all clocks and save the power. Easily done for clockevent devices, + * but clocksources won't necessarily get the needed notifications. +@@ -112,7 +106,6 @@ void tc_clksrc_resume(struct clocksource + } + + static struct clocksource clksrc = { +- .name = "tcb_clksrc", + .rating = 200, + .read = tc_get_cycles, + .mask = CLOCKSOURCE_MASK(32), +@@ -214,7 +207,6 @@ static int tc_next_event(unsigned long d + + static struct tc_clkevt_device clkevt = { + .clkevt = { +- .name = "tc_clkevt", + .features = CLOCK_EVT_FEAT_PERIODIC | + CLOCK_EVT_FEAT_ONESHOT, + /* Should be lower than at91rm9200's system timer */ +@@ -330,39 +322,73 @@ static void __init tcb_setup_single_chan + writel(ATMEL_TC_SYNC, tcaddr + ATMEL_TC_BCR); + } + +-static int __init tcb_clksrc_init(void) +-{ +- static char bootinfo[] __initdata +- = KERN_DEBUG "%s: tc%d at %d.%03d MHz\n"; ++static const u8 atmel_tcb_divisors[5] = { 2, 8, 32, 128, 0, }; ++ ++static const struct of_device_id atmel_tcb_of_match[] = { ++ { .compatible = "atmel,at91rm9200-tcb", .data = (void *)16, }, ++ { .compatible = "atmel,at91sam9x5-tcb", .data = (void *)32, }, ++ { /* sentinel */ } ++}; + +- struct platform_device *pdev; +- struct atmel_tc *tc; ++static int __init tcb_clksrc_init(struct device_node *node) ++{ ++ struct atmel_tc tc; + struct clk *t0_clk; ++ const struct of_device_id *match; + u32 rate, divided_rate = 0; + int best_divisor_idx = -1; + int clk32k_divisor_idx = -1; ++ int bits; + int i; + int ret; + +- tc = atmel_tc_alloc(CONFIG_ATMEL_TCB_CLKSRC_BLOCK); +- if (!tc) { +- pr_debug("can't alloc TC for clocksource\n"); +- return -ENODEV; ++ /* Protect against multiple calls */ ++ if (tcaddr) ++ return 0; ++ ++ tc.regs = of_iomap(node->parent, 0); ++ if (!tc.regs) ++ return -ENXIO; ++ ++ t0_clk = of_clk_get_by_name(node->parent, "t0_clk"); ++ if (IS_ERR(t0_clk)) ++ return PTR_ERR(t0_clk); ++ ++ tc.slow_clk = of_clk_get_by_name(node->parent, "slow_clk"); ++ if (IS_ERR(tc.slow_clk)) ++ return PTR_ERR(tc.slow_clk); ++ ++ tc.clk[0] = t0_clk; ++ tc.clk[1] = of_clk_get_by_name(node->parent, "t1_clk"); ++ if (IS_ERR(tc.clk[1])) ++ tc.clk[1] = t0_clk; ++ tc.clk[2] = of_clk_get_by_name(node->parent, "t2_clk"); ++ if (IS_ERR(tc.clk[2])) ++ tc.clk[2] = t0_clk; ++ ++ tc.irq[2] = of_irq_get(node->parent, 2); ++ if (tc.irq[2] <= 0) { ++ tc.irq[2] = of_irq_get(node->parent, 0); ++ if (tc.irq[2] <= 0) ++ return -EINVAL; + } +- tcaddr = tc->regs; +- pdev = tc->pdev; + +- t0_clk = tc->clk[0]; ++ match = of_match_node(atmel_tcb_of_match, node->parent); ++ bits = (uintptr_t)match->data; ++ ++ for (i = 0; i < ARRAY_SIZE(tc.irq); i++) ++ writel(ATMEL_TC_ALL_IRQ, tc.regs + ATMEL_TC_REG(i, IDR)); ++ + ret = clk_prepare_enable(t0_clk); + if (ret) { + pr_debug("can't enable T0 clk\n"); +- goto err_free_tc; ++ return ret; + } + + /* How fast will we be counting? Pick something over 5 MHz. */ + rate = (u32) clk_get_rate(t0_clk); +- for (i = 0; i < 5; i++) { +- unsigned divisor = atmel_tc_divisors[i]; ++ for (i = 0; i < ARRAY_SIZE(atmel_tcb_divisors); i++) { ++ unsigned divisor = atmel_tcb_divisors[i]; + unsigned tmp; + + /* remember 32 KiHz clock for later */ +@@ -381,27 +407,29 @@ static int __init tcb_clksrc_init(void) + best_divisor_idx = i; + } + +- +- printk(bootinfo, clksrc.name, CONFIG_ATMEL_TCB_CLKSRC_BLOCK, +- divided_rate / 1000000, ++ clksrc.name = kbasename(node->parent->full_name); ++ clkevt.clkevt.name = kbasename(node->parent->full_name); ++ pr_debug("%s at %d.%03d MHz\n", clksrc.name, divided_rate / 1000000, + ((divided_rate % 1000000) + 500) / 1000); + +- if (tc->tcb_config && tc->tcb_config->counter_width == 32) { ++ tcaddr = tc.regs; ++ ++ if (bits == 32) { + /* use apropriate function to read 32 bit counter */ + clksrc.read = tc_get_cycles32; + /* setup ony channel 0 */ +- tcb_setup_single_chan(tc, best_divisor_idx); ++ tcb_setup_single_chan(&tc, best_divisor_idx); + } else { +- /* tclib will give us three clocks no matter what the ++ /* we have three clocks no matter what the + * underlying platform supports. + */ +- ret = clk_prepare_enable(tc->clk[1]); ++ ret = clk_prepare_enable(tc.clk[1]); + if (ret) { + pr_debug("can't enable T1 clk\n"); + goto err_disable_t0; + } + /* setup both channel 0 & 1 */ +- tcb_setup_dual_chan(tc, best_divisor_idx); ++ tcb_setup_dual_chan(&tc, best_divisor_idx); + } + + /* and away we go! */ +@@ -410,7 +438,7 @@ static int __init tcb_clksrc_init(void) + goto err_disable_t1; + + /* channel 2: periodic and oneshot timer support */ +- ret = setup_clkevents(tc, clk32k_divisor_idx); ++ ret = setup_clkevents(&tc, clk32k_divisor_idx); + if (ret) + goto err_unregister_clksrc; + +@@ -420,14 +448,14 @@ static int __init tcb_clksrc_init(void) + clocksource_unregister(&clksrc); + + err_disable_t1: +- if (!tc->tcb_config || tc->tcb_config->counter_width != 32) +- clk_disable_unprepare(tc->clk[1]); ++ if (bits != 32) ++ clk_disable_unprepare(tc.clk[1]); + + err_disable_t0: + clk_disable_unprepare(t0_clk); + +-err_free_tc: +- atmel_tc_free(tc); ++ tcaddr = NULL; ++ + return ret; + } +-arch_initcall(tcb_clksrc_init); ++TIMER_OF_DECLARE(atmel_tcb_clksrc, "atmel,tcb-timer", tcb_clksrc_init); +--- a/drivers/misc/Kconfig ++++ b/drivers/misc/Kconfig +@@ -61,7 +61,8 @@ config ATMEL_TCLIB + + config ATMEL_TCB_CLKSRC + bool "TC Block Clocksource" +- depends on ATMEL_TCLIB ++ depends on ARCH_AT91 ++ select TIMER_OF if OF + default y + help + Select this to get a high precision clocksource based on a +@@ -72,17 +73,6 @@ config ATMEL_TCB_CLKSRC + may be used as a clock event device supporting oneshot mode + (delays of up to two seconds) based on the 32 KiHz clock. + +-config ATMEL_TCB_CLKSRC_BLOCK +- int +- depends on ATMEL_TCB_CLKSRC +- default 0 +- range 0 1 +- help +- Some chips provide more than one TC block, so you have the +- choice of which one to use for the clock framework. The other +- TC can be used for other purposes, such as PWM generation and +- interval timing. +- + config DUMMY_IRQ + tristate "Dummy IRQ handler" + default n diff --git a/debian/patches-rt/0002-misc-atmel_tclib-drop-AVR32-support.patch b/debian/patches-rt/0002-misc-atmel_tclib-drop-AVR32-support.patch deleted file mode 100644 index 02f0c402e..000000000 --- a/debian/patches-rt/0002-misc-atmel_tclib-drop-AVR32-support.patch +++ /dev/null @@ -1,34 +0,0 @@ -From: Alexandre Belloni -Date: Wed, 3 Apr 2019 16:11:10 +0200 -Subject: [PATCH 02/12] misc: atmel_tclib: drop AVR32 support -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz - -AVR32 is gone from the kernel, remove its support from tclib. - -Signed-off-by: Alexandre Belloni -Signed-off-by: Sebastian Andrzej Siewior ---- - drivers/misc/atmel_tclib.c | 8 -------- - 1 file changed, 8 deletions(-) - ---- a/drivers/misc/atmel_tclib.c -+++ b/drivers/misc/atmel_tclib.c -@@ -17,18 +17,10 @@ - * share individual timers between different drivers. - */ - --#if defined(CONFIG_AVR32) --/* AVR32 has these divide PBB */ --const u8 atmel_tc_divisors[5] = { 0, 4, 8, 16, 32, }; --EXPORT_SYMBOL(atmel_tc_divisors); -- --#elif defined(CONFIG_ARCH_AT91) - /* AT91 has these divide MCK */ - const u8 atmel_tc_divisors[5] = { 2, 8, 32, 128, 0, }; - EXPORT_SYMBOL(atmel_tc_divisors); - --#endif -- - static DEFINE_SPINLOCK(tc_list_lock); - static LIST_HEAD(tc_list); - diff --git a/debian/patches-rt/0002-printk-rb-add-prb-locking-functions.patch b/debian/patches-rt/0002-printk-rb-add-prb-locking-functions.patch index 6f9388976..b54f85fa6 100644 --- a/debian/patches-rt/0002-printk-rb-add-prb-locking-functions.patch +++ b/debian/patches-rt/0002-printk-rb-add-prb-locking-functions.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:29:40 +0100 Subject: [PATCH 02/25] printk-rb: add prb locking functions -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Add processor-reentrant spin locking functions. These allow restricting the number of possible contexts to 2, which can simplify diff --git a/debian/patches-rt/0002-x86-fpu-Remove-fpu__restore.patch b/debian/patches-rt/0002-x86-fpu-Remove-fpu__restore.patch index 53ec782b9..2dd0e9fad 100644 --- a/debian/patches-rt/0002-x86-fpu-Remove-fpu__restore.patch +++ b/debian/patches-rt/0002-x86-fpu-Remove-fpu__restore.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 17 Oct 2018 16:10:45 +0200 Subject: [PATCH 02/27] x86/fpu: Remove fpu__restore() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz There are no users of fpu__restore() so it is time to remove it. The comment regarding fpu__restore() and TS bit is stale since commit diff --git a/debian/patches-rt/0003-clocksource-drivers-tcb_clksrc-Use-tcb-as-sched_cloc.patch b/debian/patches-rt/0003-clocksource-drivers-tcb_clksrc-Use-tcb-as-sched_cloc.patch new file mode 100644 index 000000000..890df637b --- /dev/null +++ b/debian/patches-rt/0003-clocksource-drivers-tcb_clksrc-Use-tcb-as-sched_cloc.patch @@ -0,0 +1,74 @@ +From: Alexandre Belloni +Date: Fri, 26 Apr 2019 23:47:12 +0200 +Subject: [PATCH 03/10] clocksource/drivers/tcb_clksrc: Use tcb as sched_clock +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz + +Now that the driver is registered early enough, use the TCB as the +sched_clock which is much more accurate than the jiffies implementation. + +Signed-off-by: Alexandre Belloni +Signed-off-by: Sebastian Andrzej Siewior +--- + drivers/clocksource/tcb_clksrc.c | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +--- a/drivers/clocksource/tcb_clksrc.c ++++ b/drivers/clocksource/tcb_clksrc.c +@@ -11,6 +11,7 @@ + #include + #include + #include ++#include + #include + #include + +@@ -114,6 +115,16 @@ static struct clocksource clksrc = { + .resume = tc_clksrc_resume, + }; + ++static u64 notrace tc_sched_clock_read(void) ++{ ++ return tc_get_cycles(&clksrc); ++} ++ ++static u64 notrace tc_sched_clock_read32(void) ++{ ++ return tc_get_cycles32(&clksrc); ++} ++ + #ifdef CONFIG_GENERIC_CLOCKEVENTS + + struct tc_clkevt_device { +@@ -335,6 +346,7 @@ static int __init tcb_clksrc_init(struct + struct atmel_tc tc; + struct clk *t0_clk; + const struct of_device_id *match; ++ u64 (*tc_sched_clock)(void); + u32 rate, divided_rate = 0; + int best_divisor_idx = -1; + int clk32k_divisor_idx = -1; +@@ -419,6 +431,7 @@ static int __init tcb_clksrc_init(struct + clksrc.read = tc_get_cycles32; + /* setup ony channel 0 */ + tcb_setup_single_chan(&tc, best_divisor_idx); ++ tc_sched_clock = tc_sched_clock_read32; + } else { + /* we have three clocks no matter what the + * underlying platform supports. +@@ -430,6 +443,7 @@ static int __init tcb_clksrc_init(struct + } + /* setup both channel 0 & 1 */ + tcb_setup_dual_chan(&tc, best_divisor_idx); ++ tc_sched_clock = tc_sched_clock_read; + } + + /* and away we go! */ +@@ -442,6 +456,8 @@ static int __init tcb_clksrc_init(struct + if (ret) + goto err_unregister_clksrc; + ++ sched_clock_register(tc_sched_clock, 32, divided_rate); ++ + return 0; + + err_unregister_clksrc: diff --git a/debian/patches-rt/0003-misc-atmel_tclib-move-definitions-to-header-file.patch b/debian/patches-rt/0003-misc-atmel_tclib-move-definitions-to-header-file.patch deleted file mode 100644 index e0de9e2ab..000000000 --- a/debian/patches-rt/0003-misc-atmel_tclib-move-definitions-to-header-file.patch +++ /dev/null @@ -1,86 +0,0 @@ -From: Alexandre Belloni -Date: Wed, 3 Apr 2019 16:11:11 +0200 -Subject: [PATCH 03/12] misc: atmel_tclib: move definitions to header file -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz - -Move atmel_tc_divisors and atmel_tcb_dt_ids definitions to the header file -so they can be used without using tclib. - -Signed-off-by: Alexandre Belloni -Signed-off-by: Sebastian Andrzej Siewior ---- - drivers/misc/atmel_tclib.c | 24 ------------------------ - include/soc/at91/atmel_tcb.h | 21 ++++++++++++++++++++- - 2 files changed, 20 insertions(+), 25 deletions(-) - ---- a/drivers/misc/atmel_tclib.c -+++ b/drivers/misc/atmel_tclib.c -@@ -17,10 +17,6 @@ - * share individual timers between different drivers. - */ - --/* AT91 has these divide MCK */ --const u8 atmel_tc_divisors[5] = { 2, 8, 32, 128, 0, }; --EXPORT_SYMBOL(atmel_tc_divisors); -- - static DEFINE_SPINLOCK(tc_list_lock); - static LIST_HEAD(tc_list); - -@@ -72,26 +68,6 @@ void atmel_tc_free(struct atmel_tc *tc) - EXPORT_SYMBOL_GPL(atmel_tc_free); - - #if defined(CONFIG_OF) --static struct atmel_tcb_config tcb_rm9200_config = { -- .counter_width = 16, --}; -- --static struct atmel_tcb_config tcb_sam9x5_config = { -- .counter_width = 32, --}; -- --static const struct of_device_id atmel_tcb_dt_ids[] = { -- { -- .compatible = "atmel,at91rm9200-tcb", -- .data = &tcb_rm9200_config, -- }, { -- .compatible = "atmel,at91sam9x5-tcb", -- .data = &tcb_sam9x5_config, -- }, { -- /* sentinel */ -- } --}; -- - MODULE_DEVICE_TABLE(of, atmel_tcb_dt_ids); - #endif - ---- a/include/soc/at91/atmel_tcb.h -+++ b/include/soc/at91/atmel_tcb.h -@@ -76,8 +76,27 @@ extern struct atmel_tc *atmel_tc_alloc(u - extern void atmel_tc_free(struct atmel_tc *tc); - - /* platform-specific ATMEL_TC_TIMER_CLOCKx divisors (0 means 32KiHz) */ --extern const u8 atmel_tc_divisors[5]; -+static const u8 atmel_tc_divisors[] = { 2, 8, 32, 128, 0, }; - -+static const struct atmel_tcb_config tcb_rm9200_config = { -+ .counter_width = 16, -+}; -+ -+static const struct atmel_tcb_config tcb_sam9x5_config = { -+ .counter_width = 32, -+}; -+ -+static const struct of_device_id atmel_tcb_dt_ids[] = { -+ { -+ .compatible = "atmel,at91rm9200-tcb", -+ .data = &tcb_rm9200_config, -+ }, { -+ .compatible = "atmel,at91sam9x5-tcb", -+ .data = &tcb_sam9x5_config, -+ }, { -+ /* sentinel */ -+ } -+}; - - /* - * Two registers have block-wide controls. These are: configuring the three diff --git a/debian/patches-rt/0003-mm-SLxB-change-list_lock-to-raw_spinlock_t.patch b/debian/patches-rt/0003-mm-SLxB-change-list_lock-to-raw_spinlock_t.patch index 948aa2fdc..c10fcc141 100644 --- a/debian/patches-rt/0003-mm-SLxB-change-list_lock-to-raw_spinlock_t.patch +++ b/debian/patches-rt/0003-mm-SLxB-change-list_lock-to-raw_spinlock_t.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Mon, 28 May 2018 15:24:22 +0200 Subject: [PATCH 3/4] mm/SLxB: change list_lock to raw_spinlock_t -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The list_lock is used with used with IRQs off on RT. Make it a raw_spinlock_t otherwise the interrupts won't be disabled on -RT. The locking rules remain diff --git a/debian/patches-rt/0003-printk-rb-define-ring-buffer-struct-and-initializer.patch b/debian/patches-rt/0003-printk-rb-define-ring-buffer-struct-and-initializer.patch index e8bdaba76..c2da97cac 100644 --- a/debian/patches-rt/0003-printk-rb-define-ring-buffer-struct-and-initializer.patch +++ b/debian/patches-rt/0003-printk-rb-define-ring-buffer-struct-and-initializer.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:29:41 +0100 Subject: [PATCH 03/25] printk-rb: define ring buffer struct and initializer -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz See Documentation/printk-ringbuffer.txt for details about the initializer arguments. diff --git a/debian/patches-rt/0003-x86-fpu-Remove-preempt_disable-in-fpu__clear.patch b/debian/patches-rt/0003-x86-fpu-Remove-preempt_disable-in-fpu__clear.patch index ae1d0eb68..ba4cb872d 100644 --- a/debian/patches-rt/0003-x86-fpu-Remove-preempt_disable-in-fpu__clear.patch +++ b/debian/patches-rt/0003-x86-fpu-Remove-preempt_disable-in-fpu__clear.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 17 Oct 2018 14:58:28 +0200 Subject: [PATCH 03/27] x86/fpu: Remove preempt_disable() in fpu__clear() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The preempt_disable() section was introduced in commit diff --git a/debian/patches-rt/0004-ARM-at91-Implement-clocksource-selection.patch b/debian/patches-rt/0004-ARM-at91-Implement-clocksource-selection.patch new file mode 100644 index 000000000..4becaf254 --- /dev/null +++ b/debian/patches-rt/0004-ARM-at91-Implement-clocksource-selection.patch @@ -0,0 +1,46 @@ +From: Alexandre Belloni +Date: Fri, 26 Apr 2019 23:47:13 +0200 +Subject: [PATCH 04/10] ARM: at91: Implement clocksource selection +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz + +Allow selecting and unselecting the PIT clocksource driver so it doesn't +have to be compiled when unused. + +Signed-off-by: Alexandre Belloni +Signed-off-by: Sebastian Andrzej Siewior +--- + arch/arm/mach-at91/Kconfig | 23 +++++++++++++++++++++++ + 1 file changed, 23 insertions(+) + +--- a/arch/arm/mach-at91/Kconfig ++++ b/arch/arm/mach-at91/Kconfig +@@ -107,6 +107,29 @@ config SOC_AT91SAM9 + AT91SAM9X35 + AT91SAM9XE + ++comment "Clocksource driver selection" ++ ++config ATMEL_CLOCKSOURCE_PIT ++ bool "Periodic Interval Timer (PIT) support" ++ depends on SOC_AT91SAM9 || SOC_SAMA5 ++ default SOC_AT91SAM9 || SOC_SAMA5 ++ select ATMEL_PIT ++ help ++ Select this to get a clocksource based on the Atmel Periodic Interval ++ Timer. It has a relatively low resolution and the TC Block clocksource ++ should be preferred. ++ ++config ATMEL_CLOCKSOURCE_TCB ++ bool "Timer Counter Blocks (TCB) support" ++ default SOC_AT91RM9200 || SOC_AT91SAM9 || SOC_SAMA5 ++ select ATMEL_TCB_CLKSRC ++ help ++ Select this to get a high precision clocksource based on a ++ TC block with a 5+ MHz base clock rate. ++ On platforms with 16-bit counters, two timer channels are combined ++ to make a single 32-bit timer. ++ It can also be used as a clock event device supporting oneshot mode. ++ + config HAVE_AT91_UTMI + bool + diff --git a/debian/patches-rt/0004-clocksource-drivers-tcb_clksrc-stop-depending-on-atm.patch b/debian/patches-rt/0004-clocksource-drivers-tcb_clksrc-stop-depending-on-atm.patch deleted file mode 100644 index f33c6d10f..000000000 --- a/debian/patches-rt/0004-clocksource-drivers-tcb_clksrc-stop-depending-on-atm.patch +++ /dev/null @@ -1,242 +0,0 @@ -From: Alexandre Belloni -Date: Wed, 3 Apr 2019 16:11:12 +0200 -Subject: [PATCH 04/12] clocksource/drivers/tcb_clksrc: stop depending on - atmel_tclib -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz - -atmel_tclib is probed too late in the boot process to be able to use the -TCB as the boot clocksource. This is an issue for SoCs without the PIT -(sams70, samv70 and samv71 families) as they simply currently can't boot. - -Get rid of the atmel_tclib dependency and probe everything on our own using -the correct device tree binding. - -This also allows getting rid of ATMEL_TCB_CLKSRC_BLOCK and makes the driver -a bit more flexible as the TCB is not hardcoded in the kernel anymore. - -Signed-off-by: Alexandre Belloni -Signed-off-by: Sebastian Andrzej Siewior ---- - drivers/clocksource/tcb_clksrc.c | 103 ++++++++++++++++++++++++--------------- - drivers/misc/Kconfig | 14 ----- - 2 files changed, 66 insertions(+), 51 deletions(-) - ---- a/drivers/clocksource/tcb_clksrc.c -+++ b/drivers/clocksource/tcb_clksrc.c -@@ -9,7 +9,8 @@ - #include - #include - #include --#include -+#include -+#include - #include - #include - -@@ -28,13 +29,6 @@ - * source, used in either periodic or oneshot mode. This runs - * at 32 KiHZ, and can handle delays of up to two seconds. - * -- * A boot clocksource and clockevent source are also currently needed, -- * unless the relevant platforms (ARM/AT91, AVR32/AT32) are changed so -- * this code can be used when init_timers() is called, well before most -- * devices are set up. (Some low end AT91 parts, which can run uClinux, -- * have only the timers in one TC block... they currently don't support -- * the tclib code, because of that initialization issue.) -- * - * REVISIT behavior during system suspend states... we should disable - * all clocks and save the power. Easily done for clockevent devices, - * but clocksources won't necessarily get the needed notifications. -@@ -112,7 +106,6 @@ void tc_clksrc_resume(struct clocksource - } - - static struct clocksource clksrc = { -- .name = "tcb_clksrc", - .rating = 200, - .read = tc_get_cycles, - .mask = CLOCKSOURCE_MASK(32), -@@ -214,7 +207,6 @@ static int tc_next_event(unsigned long d - - static struct tc_clkevt_device clkevt = { - .clkevt = { -- .name = "tc_clkevt", - .features = CLOCK_EVT_FEAT_PERIODIC | - CLOCK_EVT_FEAT_ONESHOT, - /* Should be lower than at91rm9200's system timer */ -@@ -330,33 +322,64 @@ static void __init tcb_setup_single_chan - writel(ATMEL_TC_SYNC, tcaddr + ATMEL_TC_BCR); - } - --static int __init tcb_clksrc_init(void) -+static int __init tcb_clksrc_init(struct device_node *node) - { -- static char bootinfo[] __initdata -- = KERN_DEBUG "%s: tc%d at %d.%03d MHz\n"; -- -- struct platform_device *pdev; -- struct atmel_tc *tc; -+ struct atmel_tc tc; - struct clk *t0_clk; -+ const struct of_device_id *match; -+ int irq; - u32 rate, divided_rate = 0; - int best_divisor_idx = -1; - int clk32k_divisor_idx = -1; - int i; - int ret; - -- tc = atmel_tc_alloc(CONFIG_ATMEL_TCB_CLKSRC_BLOCK); -- if (!tc) { -- pr_debug("can't alloc TC for clocksource\n"); -- return -ENODEV; -- } -- tcaddr = tc->regs; -- pdev = tc->pdev; -+ /* Protect against multiple calls */ -+ if (tcaddr) -+ return 0; -+ -+ tc.regs = of_iomap(node->parent, 0); -+ if (!tc.regs) -+ return -ENXIO; -+ -+ t0_clk = of_clk_get_by_name(node->parent, "t0_clk"); -+ if (IS_ERR(t0_clk)) -+ return PTR_ERR(t0_clk); -+ -+ tc.slow_clk = of_clk_get_by_name(node->parent, "slow_clk"); -+ if (IS_ERR(tc.slow_clk)) -+ return PTR_ERR(tc.slow_clk); -+ -+ irq = of_irq_get(node->parent, 0); -+ if (irq <= 0) -+ return -EINVAL; -+ -+ tc.clk[0] = t0_clk; -+ tc.clk[1] = of_clk_get_by_name(node->parent, "t1_clk"); -+ if (IS_ERR(tc.clk[1])) -+ tc.clk[1] = t0_clk; -+ tc.clk[2] = of_clk_get_by_name(node->parent, "t2_clk"); -+ if (IS_ERR(tc.clk[2])) -+ tc.clk[2] = t0_clk; -+ -+ tc.irq[0] = irq; -+ tc.irq[1] = of_irq_get(node->parent, 1); -+ if (tc.irq[1] <= 0) -+ tc.irq[1] = irq; -+ tc.irq[2] = of_irq_get(node->parent, 2); -+ if (tc.irq[2] <= 0) -+ tc.irq[2] = irq; -+ -+ match = of_match_node(atmel_tcb_dt_ids, node->parent); -+ tc.tcb_config = match->data; -+ -+ for (i = 0; i < ARRAY_SIZE(tc.irq); i++) -+ writel(ATMEL_TC_ALL_IRQ, tc.regs + ATMEL_TC_REG(i, IDR)); - -- t0_clk = tc->clk[0]; - ret = clk_prepare_enable(t0_clk); - if (ret) { - pr_debug("can't enable T0 clk\n"); -- goto err_free_tc; -+ return ret; - } - - /* How fast will we be counting? Pick something over 5 MHz. */ -@@ -381,27 +404,29 @@ static int __init tcb_clksrc_init(void) - best_divisor_idx = i; - } - -- -- printk(bootinfo, clksrc.name, CONFIG_ATMEL_TCB_CLKSRC_BLOCK, -- divided_rate / 1000000, -+ clksrc.name = kbasename(node->parent->full_name); -+ clkevt.clkevt.name = kbasename(node->parent->full_name); -+ pr_debug("%s at %d.%03d MHz\n", clksrc.name, divided_rate / 1000000, - ((divided_rate % 1000000) + 500) / 1000); - -- if (tc->tcb_config && tc->tcb_config->counter_width == 32) { -+ tcaddr = tc.regs; -+ -+ if (tc.tcb_config->counter_width == 32) { - /* use apropriate function to read 32 bit counter */ - clksrc.read = tc_get_cycles32; - /* setup ony channel 0 */ -- tcb_setup_single_chan(tc, best_divisor_idx); -+ tcb_setup_single_chan(&tc, best_divisor_idx); - } else { -- /* tclib will give us three clocks no matter what the -+ /* we have three clocks no matter what the - * underlying platform supports. - */ -- ret = clk_prepare_enable(tc->clk[1]); -+ ret = clk_prepare_enable(tc.clk[1]); - if (ret) { - pr_debug("can't enable T1 clk\n"); - goto err_disable_t0; - } - /* setup both channel 0 & 1 */ -- tcb_setup_dual_chan(tc, best_divisor_idx); -+ tcb_setup_dual_chan(&tc, best_divisor_idx); - } - - /* and away we go! */ -@@ -410,7 +435,7 @@ static int __init tcb_clksrc_init(void) - goto err_disable_t1; - - /* channel 2: periodic and oneshot timer support */ -- ret = setup_clkevents(tc, clk32k_divisor_idx); -+ ret = setup_clkevents(&tc, clk32k_divisor_idx); - if (ret) - goto err_unregister_clksrc; - -@@ -420,14 +445,14 @@ static int __init tcb_clksrc_init(void) - clocksource_unregister(&clksrc); - - err_disable_t1: -- if (!tc->tcb_config || tc->tcb_config->counter_width != 32) -- clk_disable_unprepare(tc->clk[1]); -+ if (tc.tcb_config->counter_width != 32) -+ clk_disable_unprepare(tc.clk[1]); - - err_disable_t0: - clk_disable_unprepare(t0_clk); - --err_free_tc: -- atmel_tc_free(tc); -+ tcaddr = NULL; -+ - return ret; - } --arch_initcall(tcb_clksrc_init); -+TIMER_OF_DECLARE(atmel_tcb_clksrc, "atmel,tcb-timer", tcb_clksrc_init); ---- a/drivers/misc/Kconfig -+++ b/drivers/misc/Kconfig -@@ -61,7 +61,8 @@ config ATMEL_TCLIB - - config ATMEL_TCB_CLKSRC - bool "TC Block Clocksource" -- depends on ATMEL_TCLIB -+ depends on ARCH_AT91 -+ select TIMER_OF if OF - default y - help - Select this to get a high precision clocksource based on a -@@ -72,17 +73,6 @@ config ATMEL_TCB_CLKSRC - may be used as a clock event device supporting oneshot mode - (delays of up to two seconds) based on the 32 KiHz clock. - --config ATMEL_TCB_CLKSRC_BLOCK -- int -- depends on ATMEL_TCB_CLKSRC -- default 0 -- range 0 1 -- help -- Some chips provide more than one TC block, so you have the -- choice of which one to use for the clock framework. The other -- TC can be used for other purposes, such as PWM generation and -- interval timing. -- - config DUMMY_IRQ - tristate "Dummy IRQ handler" - default n diff --git a/debian/patches-rt/0004-mm-SLUB-delay-giving-back-empty-slubs-to-IRQ-enabled.patch b/debian/patches-rt/0004-mm-SLUB-delay-giving-back-empty-slubs-to-IRQ-enabled.patch index b3120c8a3..8d4248c37 100644 --- a/debian/patches-rt/0004-mm-SLUB-delay-giving-back-empty-slubs-to-IRQ-enabled.patch +++ b/debian/patches-rt/0004-mm-SLUB-delay-giving-back-empty-slubs-to-IRQ-enabled.patch @@ -2,7 +2,7 @@ From: Thomas Gleixner Date: Thu, 21 Jun 2018 17:29:19 +0200 Subject: [PATCH 4/4] mm/SLUB: delay giving back empty slubs to IRQ enabled regions -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz __free_slab() is invoked with disabled interrupts which increases the irq-off time while __free_pages() is doing the work. diff --git a/debian/patches-rt/0004-printk-rb-add-writer-interface.patch b/debian/patches-rt/0004-printk-rb-add-writer-interface.patch index 82e274446..7fdbcd4ee 100644 --- a/debian/patches-rt/0004-printk-rb-add-writer-interface.patch +++ b/debian/patches-rt/0004-printk-rb-add-writer-interface.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:29:42 +0100 Subject: [PATCH 04/25] printk-rb: add writer interface -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Add the writer functions prb_reserve() and prb_commit(). These make use of processor-reentrant spin locks to limit the number of possible diff --git a/debian/patches-rt/0004-x86-fpu-Always-init-the-state-in-fpu__clear.patch b/debian/patches-rt/0004-x86-fpu-Always-init-the-state-in-fpu__clear.patch index 7b0d34397..3226a450b 100644 --- a/debian/patches-rt/0004-x86-fpu-Always-init-the-state-in-fpu__clear.patch +++ b/debian/patches-rt/0004-x86-fpu-Always-init-the-state-in-fpu__clear.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 17 Oct 2018 15:27:34 +0200 Subject: [PATCH 04/27] x86/fpu: Always init the `state' in fpu__clear() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz fpu__clear() only initializes the `state' if the FPU is present. This initialisation is also required for the FPU-less system and takes place diff --git a/debian/patches-rt/0005-clocksource-drivers-tcb_clksrc-Use-tcb-as-sched_cloc.patch b/debian/patches-rt/0005-clocksource-drivers-tcb_clksrc-Use-tcb-as-sched_cloc.patch deleted file mode 100644 index 7ad0cc695..000000000 --- a/debian/patches-rt/0005-clocksource-drivers-tcb_clksrc-Use-tcb-as-sched_cloc.patch +++ /dev/null @@ -1,74 +0,0 @@ -From: Alexandre Belloni -Date: Wed, 3 Apr 2019 16:11:13 +0200 -Subject: [PATCH 05/12] clocksource/drivers/tcb_clksrc: Use tcb as sched_clock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz - -Now that the driver is registered early enough, use the TCB as the -sched_clock which is much more accurate than the jiffies implementation. - -Signed-off-by: Alexandre Belloni -Signed-off-by: Sebastian Andrzej Siewior ---- - drivers/clocksource/tcb_clksrc.c | 16 ++++++++++++++++ - 1 file changed, 16 insertions(+) - ---- a/drivers/clocksource/tcb_clksrc.c -+++ b/drivers/clocksource/tcb_clksrc.c -@@ -11,6 +11,7 @@ - #include - #include - #include -+#include - #include - #include - -@@ -114,6 +115,16 @@ static struct clocksource clksrc = { - .resume = tc_clksrc_resume, - }; - -+static u64 notrace tc_sched_clock_read(void) -+{ -+ return tc_get_cycles(&clksrc); -+} -+ -+static u64 notrace tc_sched_clock_read32(void) -+{ -+ return tc_get_cycles32(&clksrc); -+} -+ - #ifdef CONFIG_GENERIC_CLOCKEVENTS - - struct tc_clkevt_device { -@@ -327,6 +338,7 @@ static int __init tcb_clksrc_init(struct - struct atmel_tc tc; - struct clk *t0_clk; - const struct of_device_id *match; -+ u64 (*tc_sched_clock)(void); - int irq; - u32 rate, divided_rate = 0; - int best_divisor_idx = -1; -@@ -416,6 +428,7 @@ static int __init tcb_clksrc_init(struct - clksrc.read = tc_get_cycles32; - /* setup ony channel 0 */ - tcb_setup_single_chan(&tc, best_divisor_idx); -+ tc_sched_clock = tc_sched_clock_read32; - } else { - /* we have three clocks no matter what the - * underlying platform supports. -@@ -427,6 +440,7 @@ static int __init tcb_clksrc_init(struct - } - /* setup both channel 0 & 1 */ - tcb_setup_dual_chan(&tc, best_divisor_idx); -+ tc_sched_clock = tc_sched_clock_read; - } - - /* and away we go! */ -@@ -439,6 +453,8 @@ static int __init tcb_clksrc_init(struct - if (ret) - goto err_unregister_clksrc; - -+ sched_clock_register(tc_sched_clock, 32, divided_rate); -+ - return 0; - - err_unregister_clksrc: diff --git a/debian/patches-rt/0005-clocksource-drivers-tcb_clksrc-move-Kconfig-option.patch b/debian/patches-rt/0005-clocksource-drivers-tcb_clksrc-move-Kconfig-option.patch new file mode 100644 index 000000000..374831628 --- /dev/null +++ b/debian/patches-rt/0005-clocksource-drivers-tcb_clksrc-move-Kconfig-option.patch @@ -0,0 +1,55 @@ +From: Alexandre Belloni +Date: Fri, 26 Apr 2019 23:47:14 +0200 +Subject: [PATCH 05/10] clocksource/drivers/tcb_clksrc: move Kconfig option +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz + +Move the ATMEL_TCB_CLKSRC option to drivers/clocksource and make it silent +if COMPILE_TEST is not selected. + +Cc: Arnd Bergmann +Signed-off-by: Alexandre Belloni +Signed-off-by: Sebastian Andrzej Siewior +--- + drivers/clocksource/Kconfig | 7 +++++++ + drivers/misc/Kconfig | 14 -------------- + 2 files changed, 7 insertions(+), 14 deletions(-) + +--- a/drivers/clocksource/Kconfig ++++ b/drivers/clocksource/Kconfig +@@ -409,6 +409,13 @@ config ATMEL_ST + help + Support for the Atmel ST timer. + ++config ATMEL_TCB_CLKSRC ++ bool "Atmel TC Block timer driver" if COMPILE_TEST ++ depends on HAS_IOMEM ++ select TIMER_OF if OF ++ help ++ Support for Timer Counter Blocks on Atmel SoCs. ++ + config CLKSRC_EXYNOS_MCT + bool "Exynos multi core timer driver" if COMPILE_TEST + depends on ARM || ARM64 +--- a/drivers/misc/Kconfig ++++ b/drivers/misc/Kconfig +@@ -59,20 +59,6 @@ config ATMEL_TCLIB + blocks found on many Atmel processors. This facilitates using + these blocks by different drivers despite processor differences. + +-config ATMEL_TCB_CLKSRC +- bool "TC Block Clocksource" +- depends on ARCH_AT91 +- select TIMER_OF if OF +- default y +- help +- Select this to get a high precision clocksource based on a +- TC block with a 5+ MHz base clock rate. Two timer channels +- are combined to make a single 32-bit timer. +- +- When GENERIC_CLOCKEVENTS is defined, the third timer channel +- may be used as a clock event device supporting oneshot mode +- (delays of up to two seconds) based on the 32 KiHz clock. +- + config DUMMY_IRQ + tristate "Dummy IRQ handler" + default n diff --git a/debian/patches-rt/0005-printk-rb-add-basic-non-blocking-reading-interface.patch b/debian/patches-rt/0005-printk-rb-add-basic-non-blocking-reading-interface.patch index 647e3693d..cd1d05181 100644 --- a/debian/patches-rt/0005-printk-rb-add-basic-non-blocking-reading-interface.patch +++ b/debian/patches-rt/0005-printk-rb-add-basic-non-blocking-reading-interface.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:29:43 +0100 Subject: [PATCH 05/25] printk-rb: add basic non-blocking reading interface -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Add reader iterator static declaration/initializer, dynamic initializer, and functions to iterate and retrieve ring buffer data. diff --git a/debian/patches-rt/0005-x86-fpu-Remove-fpu-initialized-usage-in-copy_fpstate.patch b/debian/patches-rt/0005-x86-fpu-Remove-fpu-initialized-usage-in-copy_fpstate.patch index 9e7f93ee0..5d6049d5e 100644 --- a/debian/patches-rt/0005-x86-fpu-Remove-fpu-initialized-usage-in-copy_fpstate.patch +++ b/debian/patches-rt/0005-x86-fpu-Remove-fpu-initialized-usage-in-copy_fpstate.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 19 Oct 2018 16:57:14 +0200 Subject: [PATCH 05/27] x86/fpu: Remove fpu->initialized usage in copy_fpstate_to_sigframe() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz With lazy-FPU support the (now named variable) ->initialized was set to true if the CPU's FPU registers were holding the a valid state of the FPU registers for diff --git a/debian/patches-rt/0006-ARM-at91-Implement-clocksource-selection.patch b/debian/patches-rt/0006-ARM-at91-Implement-clocksource-selection.patch deleted file mode 100644 index 4a613e0cf..000000000 --- a/debian/patches-rt/0006-ARM-at91-Implement-clocksource-selection.patch +++ /dev/null @@ -1,46 +0,0 @@ -From: Alexandre Belloni -Date: Wed, 3 Apr 2019 16:11:14 +0200 -Subject: [PATCH 06/12] ARM: at91: Implement clocksource selection -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz - -Allow selecting and unselecting the PIT clocksource driver so it doesn't -have to be compiled when unused. - -Signed-off-by: Alexandre Belloni -Signed-off-by: Sebastian Andrzej Siewior ---- - arch/arm/mach-at91/Kconfig | 23 +++++++++++++++++++++++ - 1 file changed, 23 insertions(+) - ---- a/arch/arm/mach-at91/Kconfig -+++ b/arch/arm/mach-at91/Kconfig -@@ -107,6 +107,29 @@ config SOC_AT91SAM9 - AT91SAM9X35 - AT91SAM9XE - -+comment "Clocksource driver selection" -+ -+config ATMEL_CLOCKSOURCE_PIT -+ bool "Periodic Interval Timer (PIT) support" -+ depends on SOC_AT91SAM9 || SOC_SAMA5 -+ default SOC_AT91SAM9 || SOC_SAMA5 -+ select ATMEL_PIT -+ help -+ Select this to get a clocksource based on the Atmel Periodic Interval -+ Timer. It has a relatively low resolution and the TC Block clocksource -+ should be preferred. -+ -+config ATMEL_CLOCKSOURCE_TCB -+ bool "Timer Counter Blocks (TCB) support" -+ default SOC_AT91RM9200 || SOC_AT91SAM9 || SOC_SAMA5 -+ select ATMEL_TCB_CLKSRC -+ help -+ Select this to get a high precision clocksource based on a -+ TC block with a 5+ MHz base clock rate. -+ On platforms with 16-bit counters, two timer channels are combined -+ to make a single 32-bit timer. -+ It can also be used as a clock event device supporting oneshot mode. -+ - config HAVE_AT91_UTMI - bool - diff --git a/debian/patches-rt/0006-clocksource-drivers-timer-atmel-pit-rework-Kconfig-o.patch b/debian/patches-rt/0006-clocksource-drivers-timer-atmel-pit-rework-Kconfig-o.patch new file mode 100644 index 000000000..fb589262d --- /dev/null +++ b/debian/patches-rt/0006-clocksource-drivers-timer-atmel-pit-rework-Kconfig-o.patch @@ -0,0 +1,30 @@ +From: Alexandre Belloni +Date: Fri, 26 Apr 2019 23:47:15 +0200 +Subject: [PATCH 06/10] clocksource/drivers/timer-atmel-pit: rework Kconfig + option +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz + +Allow building the PIT driver when COMPILE_TEST is enabled. Also remove its +default value so it can be disabled. + +Signed-off-by: Alexandre Belloni +Signed-off-by: Sebastian Andrzej Siewior +--- + drivers/clocksource/Kconfig | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/drivers/clocksource/Kconfig ++++ b/drivers/clocksource/Kconfig +@@ -398,8 +398,11 @@ config ARMV7M_SYSTICK + This options enables support for the ARMv7M system timer unit + + config ATMEL_PIT ++ bool "Atmel PIT support" if COMPILE_TEST ++ depends on HAS_IOMEM + select TIMER_OF if OF +- def_bool SOC_AT91SAM9 || SOC_SAMA5 ++ help ++ Support for the Periodic Interval Timer found on Atmel SoCs. + + config ATMEL_ST + bool "Atmel ST timer support" if COMPILE_TEST diff --git a/debian/patches-rt/0006-printk-rb-add-blocking-reader-support.patch b/debian/patches-rt/0006-printk-rb-add-blocking-reader-support.patch index 41378d01e..13b219cc5 100644 --- a/debian/patches-rt/0006-printk-rb-add-blocking-reader-support.patch +++ b/debian/patches-rt/0006-printk-rb-add-blocking-reader-support.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:29:44 +0100 Subject: [PATCH 06/25] printk-rb: add blocking reader support -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Add a blocking read function for readers. An irq_work function is used to signal the wait queue so that write notification can diff --git a/debian/patches-rt/0006-x86-fpu-Don-t-save-fxregs-for-ia32-frames-in-copy_fp.patch b/debian/patches-rt/0006-x86-fpu-Don-t-save-fxregs-for-ia32-frames-in-copy_fp.patch index 34ad4c236..983c3cb79 100644 --- a/debian/patches-rt/0006-x86-fpu-Don-t-save-fxregs-for-ia32-frames-in-copy_fp.patch +++ b/debian/patches-rt/0006-x86-fpu-Don-t-save-fxregs-for-ia32-frames-in-copy_fp.patch @@ -5,7 +5,7 @@ Subject: [PATCH 06/27] x86/fpu: Don't save fxregs for ia32 frames in MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz In commit diff --git a/debian/patches-rt/0007-clocksource-drivers-tcb_clksrc-Rename-the-file-for-c.patch b/debian/patches-rt/0007-clocksource-drivers-tcb_clksrc-Rename-the-file-for-c.patch new file mode 100644 index 000000000..7e24c64c6 --- /dev/null +++ b/debian/patches-rt/0007-clocksource-drivers-tcb_clksrc-Rename-the-file-for-c.patch @@ -0,0 +1,990 @@ +From: Alexandre Belloni +Date: Fri, 26 Apr 2019 23:47:16 +0200 +Subject: [PATCH 07/10] clocksource/drivers/tcb_clksrc: Rename the file for + consistency +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz + +For the sake of consistency, let's rename the file to a name similar +to other file names in this directory. + +Signed-off-by: Alexandre Belloni +Signed-off-by: Sebastian Andrzej Siewior +--- + drivers/clocksource/Makefile | 2 + drivers/clocksource/tcb_clksrc.c | 477 ---------------------------------- + drivers/clocksource/timer-atmel-tcb.c | 477 ++++++++++++++++++++++++++++++++++ + 3 files changed, 478 insertions(+), 478 deletions(-) + delete mode 100644 drivers/clocksource/tcb_clksrc.c + create mode 100644 drivers/clocksource/timer-atmel-tcb.c + +--- a/drivers/clocksource/Makefile ++++ b/drivers/clocksource/Makefile +@@ -3,7 +3,7 @@ obj-$(CONFIG_TIMER_OF) += timer-of.o + obj-$(CONFIG_TIMER_PROBE) += timer-probe.o + obj-$(CONFIG_ATMEL_PIT) += timer-atmel-pit.o + obj-$(CONFIG_ATMEL_ST) += timer-atmel-st.o +-obj-$(CONFIG_ATMEL_TCB_CLKSRC) += tcb_clksrc.o ++obj-$(CONFIG_ATMEL_TCB_CLKSRC) += timer-atmel-tcb.o + obj-$(CONFIG_X86_PM_TIMER) += acpi_pm.o + obj-$(CONFIG_SCx200HR_TIMER) += scx200_hrt.o + obj-$(CONFIG_CS5535_CLOCK_EVENT_SRC) += cs5535-clockevt.o +--- a/drivers/clocksource/tcb_clksrc.c ++++ /dev/null +@@ -1,477 +0,0 @@ +-// SPDX-License-Identifier: GPL-2.0 +-#include +-#include +-#include +-#include +-#include +- +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +- +- +-/* +- * We're configured to use a specific TC block, one that's not hooked +- * up to external hardware, to provide a time solution: +- * +- * - Two channels combine to create a free-running 32 bit counter +- * with a base rate of 5+ MHz, packaged as a clocksource (with +- * resolution better than 200 nsec). +- * - Some chips support 32 bit counter. A single channel is used for +- * this 32 bit free-running counter. the second channel is not used. +- * +- * - The third channel may be used to provide a 16-bit clockevent +- * source, used in either periodic or oneshot mode. This runs +- * at 32 KiHZ, and can handle delays of up to two seconds. +- * +- * REVISIT behavior during system suspend states... we should disable +- * all clocks and save the power. Easily done for clockevent devices, +- * but clocksources won't necessarily get the needed notifications. +- * For deeper system sleep states, this will be mandatory... +- */ +- +-static void __iomem *tcaddr; +-static struct +-{ +- u32 cmr; +- u32 imr; +- u32 rc; +- bool clken; +-} tcb_cache[3]; +-static u32 bmr_cache; +- +-static u64 tc_get_cycles(struct clocksource *cs) +-{ +- unsigned long flags; +- u32 lower, upper; +- +- raw_local_irq_save(flags); +- do { +- upper = readl_relaxed(tcaddr + ATMEL_TC_REG(1, CV)); +- lower = readl_relaxed(tcaddr + ATMEL_TC_REG(0, CV)); +- } while (upper != readl_relaxed(tcaddr + ATMEL_TC_REG(1, CV))); +- +- raw_local_irq_restore(flags); +- return (upper << 16) | lower; +-} +- +-static u64 tc_get_cycles32(struct clocksource *cs) +-{ +- return readl_relaxed(tcaddr + ATMEL_TC_REG(0, CV)); +-} +- +-void tc_clksrc_suspend(struct clocksource *cs) +-{ +- int i; +- +- for (i = 0; i < ARRAY_SIZE(tcb_cache); i++) { +- tcb_cache[i].cmr = readl(tcaddr + ATMEL_TC_REG(i, CMR)); +- tcb_cache[i].imr = readl(tcaddr + ATMEL_TC_REG(i, IMR)); +- tcb_cache[i].rc = readl(tcaddr + ATMEL_TC_REG(i, RC)); +- tcb_cache[i].clken = !!(readl(tcaddr + ATMEL_TC_REG(i, SR)) & +- ATMEL_TC_CLKSTA); +- } +- +- bmr_cache = readl(tcaddr + ATMEL_TC_BMR); +-} +- +-void tc_clksrc_resume(struct clocksource *cs) +-{ +- int i; +- +- for (i = 0; i < ARRAY_SIZE(tcb_cache); i++) { +- /* Restore registers for the channel, RA and RB are not used */ +- writel(tcb_cache[i].cmr, tcaddr + ATMEL_TC_REG(i, CMR)); +- writel(tcb_cache[i].rc, tcaddr + ATMEL_TC_REG(i, RC)); +- writel(0, tcaddr + ATMEL_TC_REG(i, RA)); +- writel(0, tcaddr + ATMEL_TC_REG(i, RB)); +- /* Disable all the interrupts */ +- writel(0xff, tcaddr + ATMEL_TC_REG(i, IDR)); +- /* Reenable interrupts that were enabled before suspending */ +- writel(tcb_cache[i].imr, tcaddr + ATMEL_TC_REG(i, IER)); +- /* Start the clock if it was used */ +- if (tcb_cache[i].clken) +- writel(ATMEL_TC_CLKEN, tcaddr + ATMEL_TC_REG(i, CCR)); +- } +- +- /* Dual channel, chain channels */ +- writel(bmr_cache, tcaddr + ATMEL_TC_BMR); +- /* Finally, trigger all the channels*/ +- writel(ATMEL_TC_SYNC, tcaddr + ATMEL_TC_BCR); +-} +- +-static struct clocksource clksrc = { +- .rating = 200, +- .read = tc_get_cycles, +- .mask = CLOCKSOURCE_MASK(32), +- .flags = CLOCK_SOURCE_IS_CONTINUOUS, +- .suspend = tc_clksrc_suspend, +- .resume = tc_clksrc_resume, +-}; +- +-static u64 notrace tc_sched_clock_read(void) +-{ +- return tc_get_cycles(&clksrc); +-} +- +-static u64 notrace tc_sched_clock_read32(void) +-{ +- return tc_get_cycles32(&clksrc); +-} +- +-#ifdef CONFIG_GENERIC_CLOCKEVENTS +- +-struct tc_clkevt_device { +- struct clock_event_device clkevt; +- struct clk *clk; +- void __iomem *regs; +-}; +- +-static struct tc_clkevt_device *to_tc_clkevt(struct clock_event_device *clkevt) +-{ +- return container_of(clkevt, struct tc_clkevt_device, clkevt); +-} +- +-/* For now, we always use the 32K clock ... this optimizes for NO_HZ, +- * because using one of the divided clocks would usually mean the +- * tick rate can never be less than several dozen Hz (vs 0.5 Hz). +- * +- * A divided clock could be good for high resolution timers, since +- * 30.5 usec resolution can seem "low". +- */ +-static u32 timer_clock; +- +-static int tc_shutdown(struct clock_event_device *d) +-{ +- struct tc_clkevt_device *tcd = to_tc_clkevt(d); +- void __iomem *regs = tcd->regs; +- +- writel(0xff, regs + ATMEL_TC_REG(2, IDR)); +- writel(ATMEL_TC_CLKDIS, regs + ATMEL_TC_REG(2, CCR)); +- if (!clockevent_state_detached(d)) +- clk_disable(tcd->clk); +- +- return 0; +-} +- +-static int tc_set_oneshot(struct clock_event_device *d) +-{ +- struct tc_clkevt_device *tcd = to_tc_clkevt(d); +- void __iomem *regs = tcd->regs; +- +- if (clockevent_state_oneshot(d) || clockevent_state_periodic(d)) +- tc_shutdown(d); +- +- clk_enable(tcd->clk); +- +- /* slow clock, count up to RC, then irq and stop */ +- writel(timer_clock | ATMEL_TC_CPCSTOP | ATMEL_TC_WAVE | +- ATMEL_TC_WAVESEL_UP_AUTO, regs + ATMEL_TC_REG(2, CMR)); +- writel(ATMEL_TC_CPCS, regs + ATMEL_TC_REG(2, IER)); +- +- /* set_next_event() configures and starts the timer */ +- return 0; +-} +- +-static int tc_set_periodic(struct clock_event_device *d) +-{ +- struct tc_clkevt_device *tcd = to_tc_clkevt(d); +- void __iomem *regs = tcd->regs; +- +- if (clockevent_state_oneshot(d) || clockevent_state_periodic(d)) +- tc_shutdown(d); +- +- /* By not making the gentime core emulate periodic mode on top +- * of oneshot, we get lower overhead and improved accuracy. +- */ +- clk_enable(tcd->clk); +- +- /* slow clock, count up to RC, then irq and restart */ +- writel(timer_clock | ATMEL_TC_WAVE | ATMEL_TC_WAVESEL_UP_AUTO, +- regs + ATMEL_TC_REG(2, CMR)); +- writel((32768 + HZ / 2) / HZ, tcaddr + ATMEL_TC_REG(2, RC)); +- +- /* Enable clock and interrupts on RC compare */ +- writel(ATMEL_TC_CPCS, regs + ATMEL_TC_REG(2, IER)); +- +- /* go go gadget! */ +- writel(ATMEL_TC_CLKEN | ATMEL_TC_SWTRG, regs + +- ATMEL_TC_REG(2, CCR)); +- return 0; +-} +- +-static int tc_next_event(unsigned long delta, struct clock_event_device *d) +-{ +- writel_relaxed(delta, tcaddr + ATMEL_TC_REG(2, RC)); +- +- /* go go gadget! */ +- writel_relaxed(ATMEL_TC_CLKEN | ATMEL_TC_SWTRG, +- tcaddr + ATMEL_TC_REG(2, CCR)); +- return 0; +-} +- +-static struct tc_clkevt_device clkevt = { +- .clkevt = { +- .features = CLOCK_EVT_FEAT_PERIODIC | +- CLOCK_EVT_FEAT_ONESHOT, +- /* Should be lower than at91rm9200's system timer */ +- .rating = 125, +- .set_next_event = tc_next_event, +- .set_state_shutdown = tc_shutdown, +- .set_state_periodic = tc_set_periodic, +- .set_state_oneshot = tc_set_oneshot, +- }, +-}; +- +-static irqreturn_t ch2_irq(int irq, void *handle) +-{ +- struct tc_clkevt_device *dev = handle; +- unsigned int sr; +- +- sr = readl_relaxed(dev->regs + ATMEL_TC_REG(2, SR)); +- if (sr & ATMEL_TC_CPCS) { +- dev->clkevt.event_handler(&dev->clkevt); +- return IRQ_HANDLED; +- } +- +- return IRQ_NONE; +-} +- +-static int __init setup_clkevents(struct atmel_tc *tc, int clk32k_divisor_idx) +-{ +- int ret; +- struct clk *t2_clk = tc->clk[2]; +- int irq = tc->irq[2]; +- +- ret = clk_prepare_enable(tc->slow_clk); +- if (ret) +- return ret; +- +- /* try to enable t2 clk to avoid future errors in mode change */ +- ret = clk_prepare_enable(t2_clk); +- if (ret) { +- clk_disable_unprepare(tc->slow_clk); +- return ret; +- } +- +- clk_disable(t2_clk); +- +- clkevt.regs = tc->regs; +- clkevt.clk = t2_clk; +- +- timer_clock = clk32k_divisor_idx; +- +- clkevt.clkevt.cpumask = cpumask_of(0); +- +- ret = request_irq(irq, ch2_irq, IRQF_TIMER, "tc_clkevt", &clkevt); +- if (ret) { +- clk_unprepare(t2_clk); +- clk_disable_unprepare(tc->slow_clk); +- return ret; +- } +- +- clockevents_config_and_register(&clkevt.clkevt, 32768, 1, 0xffff); +- +- return ret; +-} +- +-#else /* !CONFIG_GENERIC_CLOCKEVENTS */ +- +-static int __init setup_clkevents(struct atmel_tc *tc, int clk32k_divisor_idx) +-{ +- /* NOTHING */ +- return 0; +-} +- +-#endif +- +-static void __init tcb_setup_dual_chan(struct atmel_tc *tc, int mck_divisor_idx) +-{ +- /* channel 0: waveform mode, input mclk/8, clock TIOA0 on overflow */ +- writel(mck_divisor_idx /* likely divide-by-8 */ +- | ATMEL_TC_WAVE +- | ATMEL_TC_WAVESEL_UP /* free-run */ +- | ATMEL_TC_ACPA_SET /* TIOA0 rises at 0 */ +- | ATMEL_TC_ACPC_CLEAR, /* (duty cycle 50%) */ +- tcaddr + ATMEL_TC_REG(0, CMR)); +- writel(0x0000, tcaddr + ATMEL_TC_REG(0, RA)); +- writel(0x8000, tcaddr + ATMEL_TC_REG(0, RC)); +- writel(0xff, tcaddr + ATMEL_TC_REG(0, IDR)); /* no irqs */ +- writel(ATMEL_TC_CLKEN, tcaddr + ATMEL_TC_REG(0, CCR)); +- +- /* channel 1: waveform mode, input TIOA0 */ +- writel(ATMEL_TC_XC1 /* input: TIOA0 */ +- | ATMEL_TC_WAVE +- | ATMEL_TC_WAVESEL_UP, /* free-run */ +- tcaddr + ATMEL_TC_REG(1, CMR)); +- writel(0xff, tcaddr + ATMEL_TC_REG(1, IDR)); /* no irqs */ +- writel(ATMEL_TC_CLKEN, tcaddr + ATMEL_TC_REG(1, CCR)); +- +- /* chain channel 0 to channel 1*/ +- writel(ATMEL_TC_TC1XC1S_TIOA0, tcaddr + ATMEL_TC_BMR); +- /* then reset all the timers */ +- writel(ATMEL_TC_SYNC, tcaddr + ATMEL_TC_BCR); +-} +- +-static void __init tcb_setup_single_chan(struct atmel_tc *tc, int mck_divisor_idx) +-{ +- /* channel 0: waveform mode, input mclk/8 */ +- writel(mck_divisor_idx /* likely divide-by-8 */ +- | ATMEL_TC_WAVE +- | ATMEL_TC_WAVESEL_UP, /* free-run */ +- tcaddr + ATMEL_TC_REG(0, CMR)); +- writel(0xff, tcaddr + ATMEL_TC_REG(0, IDR)); /* no irqs */ +- writel(ATMEL_TC_CLKEN, tcaddr + ATMEL_TC_REG(0, CCR)); +- +- /* then reset all the timers */ +- writel(ATMEL_TC_SYNC, tcaddr + ATMEL_TC_BCR); +-} +- +-static const u8 atmel_tcb_divisors[5] = { 2, 8, 32, 128, 0, }; +- +-static const struct of_device_id atmel_tcb_of_match[] = { +- { .compatible = "atmel,at91rm9200-tcb", .data = (void *)16, }, +- { .compatible = "atmel,at91sam9x5-tcb", .data = (void *)32, }, +- { /* sentinel */ } +-}; +- +-static int __init tcb_clksrc_init(struct device_node *node) +-{ +- struct atmel_tc tc; +- struct clk *t0_clk; +- const struct of_device_id *match; +- u64 (*tc_sched_clock)(void); +- u32 rate, divided_rate = 0; +- int best_divisor_idx = -1; +- int clk32k_divisor_idx = -1; +- int bits; +- int i; +- int ret; +- +- /* Protect against multiple calls */ +- if (tcaddr) +- return 0; +- +- tc.regs = of_iomap(node->parent, 0); +- if (!tc.regs) +- return -ENXIO; +- +- t0_clk = of_clk_get_by_name(node->parent, "t0_clk"); +- if (IS_ERR(t0_clk)) +- return PTR_ERR(t0_clk); +- +- tc.slow_clk = of_clk_get_by_name(node->parent, "slow_clk"); +- if (IS_ERR(tc.slow_clk)) +- return PTR_ERR(tc.slow_clk); +- +- tc.clk[0] = t0_clk; +- tc.clk[1] = of_clk_get_by_name(node->parent, "t1_clk"); +- if (IS_ERR(tc.clk[1])) +- tc.clk[1] = t0_clk; +- tc.clk[2] = of_clk_get_by_name(node->parent, "t2_clk"); +- if (IS_ERR(tc.clk[2])) +- tc.clk[2] = t0_clk; +- +- tc.irq[2] = of_irq_get(node->parent, 2); +- if (tc.irq[2] <= 0) { +- tc.irq[2] = of_irq_get(node->parent, 0); +- if (tc.irq[2] <= 0) +- return -EINVAL; +- } +- +- match = of_match_node(atmel_tcb_of_match, node->parent); +- bits = (uintptr_t)match->data; +- +- for (i = 0; i < ARRAY_SIZE(tc.irq); i++) +- writel(ATMEL_TC_ALL_IRQ, tc.regs + ATMEL_TC_REG(i, IDR)); +- +- ret = clk_prepare_enable(t0_clk); +- if (ret) { +- pr_debug("can't enable T0 clk\n"); +- return ret; +- } +- +- /* How fast will we be counting? Pick something over 5 MHz. */ +- rate = (u32) clk_get_rate(t0_clk); +- for (i = 0; i < ARRAY_SIZE(atmel_tcb_divisors); i++) { +- unsigned divisor = atmel_tcb_divisors[i]; +- unsigned tmp; +- +- /* remember 32 KiHz clock for later */ +- if (!divisor) { +- clk32k_divisor_idx = i; +- continue; +- } +- +- tmp = rate / divisor; +- pr_debug("TC: %u / %-3u [%d] --> %u\n", rate, divisor, i, tmp); +- if (best_divisor_idx > 0) { +- if (tmp < 5 * 1000 * 1000) +- continue; +- } +- divided_rate = tmp; +- best_divisor_idx = i; +- } +- +- clksrc.name = kbasename(node->parent->full_name); +- clkevt.clkevt.name = kbasename(node->parent->full_name); +- pr_debug("%s at %d.%03d MHz\n", clksrc.name, divided_rate / 1000000, +- ((divided_rate % 1000000) + 500) / 1000); +- +- tcaddr = tc.regs; +- +- if (bits == 32) { +- /* use apropriate function to read 32 bit counter */ +- clksrc.read = tc_get_cycles32; +- /* setup ony channel 0 */ +- tcb_setup_single_chan(&tc, best_divisor_idx); +- tc_sched_clock = tc_sched_clock_read32; +- } else { +- /* we have three clocks no matter what the +- * underlying platform supports. +- */ +- ret = clk_prepare_enable(tc.clk[1]); +- if (ret) { +- pr_debug("can't enable T1 clk\n"); +- goto err_disable_t0; +- } +- /* setup both channel 0 & 1 */ +- tcb_setup_dual_chan(&tc, best_divisor_idx); +- tc_sched_clock = tc_sched_clock_read; +- } +- +- /* and away we go! */ +- ret = clocksource_register_hz(&clksrc, divided_rate); +- if (ret) +- goto err_disable_t1; +- +- /* channel 2: periodic and oneshot timer support */ +- ret = setup_clkevents(&tc, clk32k_divisor_idx); +- if (ret) +- goto err_unregister_clksrc; +- +- sched_clock_register(tc_sched_clock, 32, divided_rate); +- +- return 0; +- +-err_unregister_clksrc: +- clocksource_unregister(&clksrc); +- +-err_disable_t1: +- if (bits != 32) +- clk_disable_unprepare(tc.clk[1]); +- +-err_disable_t0: +- clk_disable_unprepare(t0_clk); +- +- tcaddr = NULL; +- +- return ret; +-} +-TIMER_OF_DECLARE(atmel_tcb_clksrc, "atmel,tcb-timer", tcb_clksrc_init); +--- /dev/null ++++ b/drivers/clocksource/timer-atmel-tcb.c +@@ -0,0 +1,477 @@ ++// SPDX-License-Identifier: GPL-2.0 ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++ ++/* ++ * We're configured to use a specific TC block, one that's not hooked ++ * up to external hardware, to provide a time solution: ++ * ++ * - Two channels combine to create a free-running 32 bit counter ++ * with a base rate of 5+ MHz, packaged as a clocksource (with ++ * resolution better than 200 nsec). ++ * - Some chips support 32 bit counter. A single channel is used for ++ * this 32 bit free-running counter. the second channel is not used. ++ * ++ * - The third channel may be used to provide a 16-bit clockevent ++ * source, used in either periodic or oneshot mode. This runs ++ * at 32 KiHZ, and can handle delays of up to two seconds. ++ * ++ * REVISIT behavior during system suspend states... we should disable ++ * all clocks and save the power. Easily done for clockevent devices, ++ * but clocksources won't necessarily get the needed notifications. ++ * For deeper system sleep states, this will be mandatory... ++ */ ++ ++static void __iomem *tcaddr; ++static struct ++{ ++ u32 cmr; ++ u32 imr; ++ u32 rc; ++ bool clken; ++} tcb_cache[3]; ++static u32 bmr_cache; ++ ++static u64 tc_get_cycles(struct clocksource *cs) ++{ ++ unsigned long flags; ++ u32 lower, upper; ++ ++ raw_local_irq_save(flags); ++ do { ++ upper = readl_relaxed(tcaddr + ATMEL_TC_REG(1, CV)); ++ lower = readl_relaxed(tcaddr + ATMEL_TC_REG(0, CV)); ++ } while (upper != readl_relaxed(tcaddr + ATMEL_TC_REG(1, CV))); ++ ++ raw_local_irq_restore(flags); ++ return (upper << 16) | lower; ++} ++ ++static u64 tc_get_cycles32(struct clocksource *cs) ++{ ++ return readl_relaxed(tcaddr + ATMEL_TC_REG(0, CV)); ++} ++ ++void tc_clksrc_suspend(struct clocksource *cs) ++{ ++ int i; ++ ++ for (i = 0; i < ARRAY_SIZE(tcb_cache); i++) { ++ tcb_cache[i].cmr = readl(tcaddr + ATMEL_TC_REG(i, CMR)); ++ tcb_cache[i].imr = readl(tcaddr + ATMEL_TC_REG(i, IMR)); ++ tcb_cache[i].rc = readl(tcaddr + ATMEL_TC_REG(i, RC)); ++ tcb_cache[i].clken = !!(readl(tcaddr + ATMEL_TC_REG(i, SR)) & ++ ATMEL_TC_CLKSTA); ++ } ++ ++ bmr_cache = readl(tcaddr + ATMEL_TC_BMR); ++} ++ ++void tc_clksrc_resume(struct clocksource *cs) ++{ ++ int i; ++ ++ for (i = 0; i < ARRAY_SIZE(tcb_cache); i++) { ++ /* Restore registers for the channel, RA and RB are not used */ ++ writel(tcb_cache[i].cmr, tcaddr + ATMEL_TC_REG(i, CMR)); ++ writel(tcb_cache[i].rc, tcaddr + ATMEL_TC_REG(i, RC)); ++ writel(0, tcaddr + ATMEL_TC_REG(i, RA)); ++ writel(0, tcaddr + ATMEL_TC_REG(i, RB)); ++ /* Disable all the interrupts */ ++ writel(0xff, tcaddr + ATMEL_TC_REG(i, IDR)); ++ /* Reenable interrupts that were enabled before suspending */ ++ writel(tcb_cache[i].imr, tcaddr + ATMEL_TC_REG(i, IER)); ++ /* Start the clock if it was used */ ++ if (tcb_cache[i].clken) ++ writel(ATMEL_TC_CLKEN, tcaddr + ATMEL_TC_REG(i, CCR)); ++ } ++ ++ /* Dual channel, chain channels */ ++ writel(bmr_cache, tcaddr + ATMEL_TC_BMR); ++ /* Finally, trigger all the channels*/ ++ writel(ATMEL_TC_SYNC, tcaddr + ATMEL_TC_BCR); ++} ++ ++static struct clocksource clksrc = { ++ .rating = 200, ++ .read = tc_get_cycles, ++ .mask = CLOCKSOURCE_MASK(32), ++ .flags = CLOCK_SOURCE_IS_CONTINUOUS, ++ .suspend = tc_clksrc_suspend, ++ .resume = tc_clksrc_resume, ++}; ++ ++static u64 notrace tc_sched_clock_read(void) ++{ ++ return tc_get_cycles(&clksrc); ++} ++ ++static u64 notrace tc_sched_clock_read32(void) ++{ ++ return tc_get_cycles32(&clksrc); ++} ++ ++#ifdef CONFIG_GENERIC_CLOCKEVENTS ++ ++struct tc_clkevt_device { ++ struct clock_event_device clkevt; ++ struct clk *clk; ++ void __iomem *regs; ++}; ++ ++static struct tc_clkevt_device *to_tc_clkevt(struct clock_event_device *clkevt) ++{ ++ return container_of(clkevt, struct tc_clkevt_device, clkevt); ++} ++ ++/* For now, we always use the 32K clock ... this optimizes for NO_HZ, ++ * because using one of the divided clocks would usually mean the ++ * tick rate can never be less than several dozen Hz (vs 0.5 Hz). ++ * ++ * A divided clock could be good for high resolution timers, since ++ * 30.5 usec resolution can seem "low". ++ */ ++static u32 timer_clock; ++ ++static int tc_shutdown(struct clock_event_device *d) ++{ ++ struct tc_clkevt_device *tcd = to_tc_clkevt(d); ++ void __iomem *regs = tcd->regs; ++ ++ writel(0xff, regs + ATMEL_TC_REG(2, IDR)); ++ writel(ATMEL_TC_CLKDIS, regs + ATMEL_TC_REG(2, CCR)); ++ if (!clockevent_state_detached(d)) ++ clk_disable(tcd->clk); ++ ++ return 0; ++} ++ ++static int tc_set_oneshot(struct clock_event_device *d) ++{ ++ struct tc_clkevt_device *tcd = to_tc_clkevt(d); ++ void __iomem *regs = tcd->regs; ++ ++ if (clockevent_state_oneshot(d) || clockevent_state_periodic(d)) ++ tc_shutdown(d); ++ ++ clk_enable(tcd->clk); ++ ++ /* slow clock, count up to RC, then irq and stop */ ++ writel(timer_clock | ATMEL_TC_CPCSTOP | ATMEL_TC_WAVE | ++ ATMEL_TC_WAVESEL_UP_AUTO, regs + ATMEL_TC_REG(2, CMR)); ++ writel(ATMEL_TC_CPCS, regs + ATMEL_TC_REG(2, IER)); ++ ++ /* set_next_event() configures and starts the timer */ ++ return 0; ++} ++ ++static int tc_set_periodic(struct clock_event_device *d) ++{ ++ struct tc_clkevt_device *tcd = to_tc_clkevt(d); ++ void __iomem *regs = tcd->regs; ++ ++ if (clockevent_state_oneshot(d) || clockevent_state_periodic(d)) ++ tc_shutdown(d); ++ ++ /* By not making the gentime core emulate periodic mode on top ++ * of oneshot, we get lower overhead and improved accuracy. ++ */ ++ clk_enable(tcd->clk); ++ ++ /* slow clock, count up to RC, then irq and restart */ ++ writel(timer_clock | ATMEL_TC_WAVE | ATMEL_TC_WAVESEL_UP_AUTO, ++ regs + ATMEL_TC_REG(2, CMR)); ++ writel((32768 + HZ / 2) / HZ, tcaddr + ATMEL_TC_REG(2, RC)); ++ ++ /* Enable clock and interrupts on RC compare */ ++ writel(ATMEL_TC_CPCS, regs + ATMEL_TC_REG(2, IER)); ++ ++ /* go go gadget! */ ++ writel(ATMEL_TC_CLKEN | ATMEL_TC_SWTRG, regs + ++ ATMEL_TC_REG(2, CCR)); ++ return 0; ++} ++ ++static int tc_next_event(unsigned long delta, struct clock_event_device *d) ++{ ++ writel_relaxed(delta, tcaddr + ATMEL_TC_REG(2, RC)); ++ ++ /* go go gadget! */ ++ writel_relaxed(ATMEL_TC_CLKEN | ATMEL_TC_SWTRG, ++ tcaddr + ATMEL_TC_REG(2, CCR)); ++ return 0; ++} ++ ++static struct tc_clkevt_device clkevt = { ++ .clkevt = { ++ .features = CLOCK_EVT_FEAT_PERIODIC | ++ CLOCK_EVT_FEAT_ONESHOT, ++ /* Should be lower than at91rm9200's system timer */ ++ .rating = 125, ++ .set_next_event = tc_next_event, ++ .set_state_shutdown = tc_shutdown, ++ .set_state_periodic = tc_set_periodic, ++ .set_state_oneshot = tc_set_oneshot, ++ }, ++}; ++ ++static irqreturn_t ch2_irq(int irq, void *handle) ++{ ++ struct tc_clkevt_device *dev = handle; ++ unsigned int sr; ++ ++ sr = readl_relaxed(dev->regs + ATMEL_TC_REG(2, SR)); ++ if (sr & ATMEL_TC_CPCS) { ++ dev->clkevt.event_handler(&dev->clkevt); ++ return IRQ_HANDLED; ++ } ++ ++ return IRQ_NONE; ++} ++ ++static int __init setup_clkevents(struct atmel_tc *tc, int clk32k_divisor_idx) ++{ ++ int ret; ++ struct clk *t2_clk = tc->clk[2]; ++ int irq = tc->irq[2]; ++ ++ ret = clk_prepare_enable(tc->slow_clk); ++ if (ret) ++ return ret; ++ ++ /* try to enable t2 clk to avoid future errors in mode change */ ++ ret = clk_prepare_enable(t2_clk); ++ if (ret) { ++ clk_disable_unprepare(tc->slow_clk); ++ return ret; ++ } ++ ++ clk_disable(t2_clk); ++ ++ clkevt.regs = tc->regs; ++ clkevt.clk = t2_clk; ++ ++ timer_clock = clk32k_divisor_idx; ++ ++ clkevt.clkevt.cpumask = cpumask_of(0); ++ ++ ret = request_irq(irq, ch2_irq, IRQF_TIMER, "tc_clkevt", &clkevt); ++ if (ret) { ++ clk_unprepare(t2_clk); ++ clk_disable_unprepare(tc->slow_clk); ++ return ret; ++ } ++ ++ clockevents_config_and_register(&clkevt.clkevt, 32768, 1, 0xffff); ++ ++ return ret; ++} ++ ++#else /* !CONFIG_GENERIC_CLOCKEVENTS */ ++ ++static int __init setup_clkevents(struct atmel_tc *tc, int clk32k_divisor_idx) ++{ ++ /* NOTHING */ ++ return 0; ++} ++ ++#endif ++ ++static void __init tcb_setup_dual_chan(struct atmel_tc *tc, int mck_divisor_idx) ++{ ++ /* channel 0: waveform mode, input mclk/8, clock TIOA0 on overflow */ ++ writel(mck_divisor_idx /* likely divide-by-8 */ ++ | ATMEL_TC_WAVE ++ | ATMEL_TC_WAVESEL_UP /* free-run */ ++ | ATMEL_TC_ACPA_SET /* TIOA0 rises at 0 */ ++ | ATMEL_TC_ACPC_CLEAR, /* (duty cycle 50%) */ ++ tcaddr + ATMEL_TC_REG(0, CMR)); ++ writel(0x0000, tcaddr + ATMEL_TC_REG(0, RA)); ++ writel(0x8000, tcaddr + ATMEL_TC_REG(0, RC)); ++ writel(0xff, tcaddr + ATMEL_TC_REG(0, IDR)); /* no irqs */ ++ writel(ATMEL_TC_CLKEN, tcaddr + ATMEL_TC_REG(0, CCR)); ++ ++ /* channel 1: waveform mode, input TIOA0 */ ++ writel(ATMEL_TC_XC1 /* input: TIOA0 */ ++ | ATMEL_TC_WAVE ++ | ATMEL_TC_WAVESEL_UP, /* free-run */ ++ tcaddr + ATMEL_TC_REG(1, CMR)); ++ writel(0xff, tcaddr + ATMEL_TC_REG(1, IDR)); /* no irqs */ ++ writel(ATMEL_TC_CLKEN, tcaddr + ATMEL_TC_REG(1, CCR)); ++ ++ /* chain channel 0 to channel 1*/ ++ writel(ATMEL_TC_TC1XC1S_TIOA0, tcaddr + ATMEL_TC_BMR); ++ /* then reset all the timers */ ++ writel(ATMEL_TC_SYNC, tcaddr + ATMEL_TC_BCR); ++} ++ ++static void __init tcb_setup_single_chan(struct atmel_tc *tc, int mck_divisor_idx) ++{ ++ /* channel 0: waveform mode, input mclk/8 */ ++ writel(mck_divisor_idx /* likely divide-by-8 */ ++ | ATMEL_TC_WAVE ++ | ATMEL_TC_WAVESEL_UP, /* free-run */ ++ tcaddr + ATMEL_TC_REG(0, CMR)); ++ writel(0xff, tcaddr + ATMEL_TC_REG(0, IDR)); /* no irqs */ ++ writel(ATMEL_TC_CLKEN, tcaddr + ATMEL_TC_REG(0, CCR)); ++ ++ /* then reset all the timers */ ++ writel(ATMEL_TC_SYNC, tcaddr + ATMEL_TC_BCR); ++} ++ ++static const u8 atmel_tcb_divisors[5] = { 2, 8, 32, 128, 0, }; ++ ++static const struct of_device_id atmel_tcb_of_match[] = { ++ { .compatible = "atmel,at91rm9200-tcb", .data = (void *)16, }, ++ { .compatible = "atmel,at91sam9x5-tcb", .data = (void *)32, }, ++ { /* sentinel */ } ++}; ++ ++static int __init tcb_clksrc_init(struct device_node *node) ++{ ++ struct atmel_tc tc; ++ struct clk *t0_clk; ++ const struct of_device_id *match; ++ u64 (*tc_sched_clock)(void); ++ u32 rate, divided_rate = 0; ++ int best_divisor_idx = -1; ++ int clk32k_divisor_idx = -1; ++ int bits; ++ int i; ++ int ret; ++ ++ /* Protect against multiple calls */ ++ if (tcaddr) ++ return 0; ++ ++ tc.regs = of_iomap(node->parent, 0); ++ if (!tc.regs) ++ return -ENXIO; ++ ++ t0_clk = of_clk_get_by_name(node->parent, "t0_clk"); ++ if (IS_ERR(t0_clk)) ++ return PTR_ERR(t0_clk); ++ ++ tc.slow_clk = of_clk_get_by_name(node->parent, "slow_clk"); ++ if (IS_ERR(tc.slow_clk)) ++ return PTR_ERR(tc.slow_clk); ++ ++ tc.clk[0] = t0_clk; ++ tc.clk[1] = of_clk_get_by_name(node->parent, "t1_clk"); ++ if (IS_ERR(tc.clk[1])) ++ tc.clk[1] = t0_clk; ++ tc.clk[2] = of_clk_get_by_name(node->parent, "t2_clk"); ++ if (IS_ERR(tc.clk[2])) ++ tc.clk[2] = t0_clk; ++ ++ tc.irq[2] = of_irq_get(node->parent, 2); ++ if (tc.irq[2] <= 0) { ++ tc.irq[2] = of_irq_get(node->parent, 0); ++ if (tc.irq[2] <= 0) ++ return -EINVAL; ++ } ++ ++ match = of_match_node(atmel_tcb_of_match, node->parent); ++ bits = (uintptr_t)match->data; ++ ++ for (i = 0; i < ARRAY_SIZE(tc.irq); i++) ++ writel(ATMEL_TC_ALL_IRQ, tc.regs + ATMEL_TC_REG(i, IDR)); ++ ++ ret = clk_prepare_enable(t0_clk); ++ if (ret) { ++ pr_debug("can't enable T0 clk\n"); ++ return ret; ++ } ++ ++ /* How fast will we be counting? Pick something over 5 MHz. */ ++ rate = (u32) clk_get_rate(t0_clk); ++ for (i = 0; i < ARRAY_SIZE(atmel_tcb_divisors); i++) { ++ unsigned divisor = atmel_tcb_divisors[i]; ++ unsigned tmp; ++ ++ /* remember 32 KiHz clock for later */ ++ if (!divisor) { ++ clk32k_divisor_idx = i; ++ continue; ++ } ++ ++ tmp = rate / divisor; ++ pr_debug("TC: %u / %-3u [%d] --> %u\n", rate, divisor, i, tmp); ++ if (best_divisor_idx > 0) { ++ if (tmp < 5 * 1000 * 1000) ++ continue; ++ } ++ divided_rate = tmp; ++ best_divisor_idx = i; ++ } ++ ++ clksrc.name = kbasename(node->parent->full_name); ++ clkevt.clkevt.name = kbasename(node->parent->full_name); ++ pr_debug("%s at %d.%03d MHz\n", clksrc.name, divided_rate / 1000000, ++ ((divided_rate % 1000000) + 500) / 1000); ++ ++ tcaddr = tc.regs; ++ ++ if (bits == 32) { ++ /* use apropriate function to read 32 bit counter */ ++ clksrc.read = tc_get_cycles32; ++ /* setup ony channel 0 */ ++ tcb_setup_single_chan(&tc, best_divisor_idx); ++ tc_sched_clock = tc_sched_clock_read32; ++ } else { ++ /* we have three clocks no matter what the ++ * underlying platform supports. ++ */ ++ ret = clk_prepare_enable(tc.clk[1]); ++ if (ret) { ++ pr_debug("can't enable T1 clk\n"); ++ goto err_disable_t0; ++ } ++ /* setup both channel 0 & 1 */ ++ tcb_setup_dual_chan(&tc, best_divisor_idx); ++ tc_sched_clock = tc_sched_clock_read; ++ } ++ ++ /* and away we go! */ ++ ret = clocksource_register_hz(&clksrc, divided_rate); ++ if (ret) ++ goto err_disable_t1; ++ ++ /* channel 2: periodic and oneshot timer support */ ++ ret = setup_clkevents(&tc, clk32k_divisor_idx); ++ if (ret) ++ goto err_unregister_clksrc; ++ ++ sched_clock_register(tc_sched_clock, 32, divided_rate); ++ ++ return 0; ++ ++err_unregister_clksrc: ++ clocksource_unregister(&clksrc); ++ ++err_disable_t1: ++ if (bits != 32) ++ clk_disable_unprepare(tc.clk[1]); ++ ++err_disable_t0: ++ clk_disable_unprepare(t0_clk); ++ ++ tcaddr = NULL; ++ ++ return ret; ++} ++TIMER_OF_DECLARE(atmel_tcb_clksrc, "atmel,tcb-timer", tcb_clksrc_init); diff --git a/debian/patches-rt/0007-clocksource-drivers-tcb_clksrc-move-Kconfig-option.patch b/debian/patches-rt/0007-clocksource-drivers-tcb_clksrc-move-Kconfig-option.patch deleted file mode 100644 index 6ba787297..000000000 --- a/debian/patches-rt/0007-clocksource-drivers-tcb_clksrc-move-Kconfig-option.patch +++ /dev/null @@ -1,54 +0,0 @@ -From: Alexandre Belloni -Date: Wed, 3 Apr 2019 16:11:15 +0200 -Subject: [PATCH 07/12] clocksource/drivers/tcb_clksrc: move Kconfig option -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz - -Move the ATMEL_TCB_CLKSRC option to drivers/clocksource and make it silent -if COMPILE_TEST is not selected. - -Signed-off-by: Alexandre Belloni -Signed-off-by: Sebastian Andrzej Siewior ---- - drivers/clocksource/Kconfig | 7 +++++++ - drivers/misc/Kconfig | 14 -------------- - 2 files changed, 7 insertions(+), 14 deletions(-) - ---- a/drivers/clocksource/Kconfig -+++ b/drivers/clocksource/Kconfig -@@ -409,6 +409,13 @@ config ATMEL_ST - help - Support for the Atmel ST timer. - -+config ATMEL_TCB_CLKSRC -+ bool "Atmel TC Block timer driver" if COMPILE_TEST -+ depends on HAS_IOMEM -+ select TIMER_OF if OF -+ help -+ Support for Timer Counter Blocks on Atmel SoCs. -+ - config CLKSRC_EXYNOS_MCT - bool "Exynos multi core timer driver" if COMPILE_TEST - depends on ARM || ARM64 ---- a/drivers/misc/Kconfig -+++ b/drivers/misc/Kconfig -@@ -59,20 +59,6 @@ config ATMEL_TCLIB - blocks found on many Atmel processors. This facilitates using - these blocks by different drivers despite processor differences. - --config ATMEL_TCB_CLKSRC -- bool "TC Block Clocksource" -- depends on ARCH_AT91 -- select TIMER_OF if OF -- default y -- help -- Select this to get a high precision clocksource based on a -- TC block with a 5+ MHz base clock rate. Two timer channels -- are combined to make a single 32-bit timer. -- -- When GENERIC_CLOCKEVENTS is defined, the third timer channel -- may be used as a clock event device supporting oneshot mode -- (delays of up to two seconds) based on the 32 KiHz clock. -- - config DUMMY_IRQ - tristate "Dummy IRQ handler" - default n diff --git a/debian/patches-rt/0007-printk-rb-add-functionality-required-by-printk.patch b/debian/patches-rt/0007-printk-rb-add-functionality-required-by-printk.patch index dab326959..5be3c8977 100644 --- a/debian/patches-rt/0007-printk-rb-add-functionality-required-by-printk.patch +++ b/debian/patches-rt/0007-printk-rb-add-functionality-required-by-printk.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:29:45 +0100 Subject: [PATCH 07/25] printk-rb: add functionality required by printk -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The printk subsystem needs to be able to query the size of the ring buffer, seek to specific entries within the ring buffer, and track diff --git a/debian/patches-rt/0007-x86-fpu-Remove-fpu-initialized.patch b/debian/patches-rt/0007-x86-fpu-Remove-fpu-initialized.patch index 73e493fa9..0073d26ff 100644 --- a/debian/patches-rt/0007-x86-fpu-Remove-fpu-initialized.patch +++ b/debian/patches-rt/0007-x86-fpu-Remove-fpu-initialized.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 17 Oct 2018 18:08:35 +0200 Subject: [PATCH 07/27] x86/fpu: Remove fpu->initialized -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The `initialized' member of the fpu struct is always set to one for user tasks and zero for kernel tasks. This avoids saving/restoring the FPU diff --git a/debian/patches-rt/0008-clocksource-drivers-timer-atmel-pit-rework-Kconfig-o.patch b/debian/patches-rt/0008-clocksource-drivers-timer-atmel-pit-rework-Kconfig-o.patch deleted file mode 100644 index 26840d9cb..000000000 --- a/debian/patches-rt/0008-clocksource-drivers-timer-atmel-pit-rework-Kconfig-o.patch +++ /dev/null @@ -1,30 +0,0 @@ -From: Alexandre Belloni -Date: Wed, 3 Apr 2019 16:11:16 +0200 -Subject: [PATCH 08/12] clocksource/drivers/timer-atmel-pit: rework Kconfig - option -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz - -Allow building the PIT driver when COMPILE_TEST is enabled. Also remove its -default value so it can be disabled. - -Signed-off-by: Alexandre Belloni -Signed-off-by: Sebastian Andrzej Siewior ---- - drivers/clocksource/Kconfig | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - ---- a/drivers/clocksource/Kconfig -+++ b/drivers/clocksource/Kconfig -@@ -398,8 +398,11 @@ config ARMV7M_SYSTICK - This options enables support for the ARMv7M system timer unit - - config ATMEL_PIT -+ bool "Atmel PIT support" if COMPILE_TEST -+ depends on HAS_IOMEM - select TIMER_OF if OF -- def_bool SOC_AT91SAM9 || SOC_SAMA5 -+ help -+ Support for the Periodic Interval Timer found on Atmel SoCs. - - config ATMEL_ST - bool "Atmel ST timer support" if COMPILE_TEST diff --git a/debian/patches-rt/0008-clocksource-drivers-timer-atmel-tcb-tc_clksrc_suspen.patch b/debian/patches-rt/0008-clocksource-drivers-timer-atmel-tcb-tc_clksrc_suspen.patch new file mode 100644 index 000000000..457838441 --- /dev/null +++ b/debian/patches-rt/0008-clocksource-drivers-timer-atmel-tcb-tc_clksrc_suspen.patch @@ -0,0 +1,35 @@ +From: kbuild test robot +Date: Fri, 26 Apr 2019 23:47:17 +0200 +Subject: [PATCH 08/10] clocksource/drivers/timer-atmel-tcb: + tc_clksrc_suspend() can be static +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz + +Statisticize tc_clksrc_suspend and tc_clksrc_resume. + +Signed-off-by: kbuild test robot +Signed-off-by: Alexandre Belloni +Signed-off-by: Sebastian Andrzej Siewior +--- + drivers/clocksource/timer-atmel-tcb.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/clocksource/timer-atmel-tcb.c ++++ b/drivers/clocksource/timer-atmel-tcb.c +@@ -66,7 +66,7 @@ static u64 tc_get_cycles32(struct clocks + return readl_relaxed(tcaddr + ATMEL_TC_REG(0, CV)); + } + +-void tc_clksrc_suspend(struct clocksource *cs) ++static void tc_clksrc_suspend(struct clocksource *cs) + { + int i; + +@@ -81,7 +81,7 @@ void tc_clksrc_suspend(struct clocksourc + bmr_cache = readl(tcaddr + ATMEL_TC_BMR); + } + +-void tc_clksrc_resume(struct clocksource *cs) ++static void tc_clksrc_resume(struct clocksource *cs) + { + int i; + diff --git a/debian/patches-rt/0008-printk-add-ring-buffer-and-kthread.patch b/debian/patches-rt/0008-printk-add-ring-buffer-and-kthread.patch index e2b7d96fa..f5557dd3c 100644 --- a/debian/patches-rt/0008-printk-add-ring-buffer-and-kthread.patch +++ b/debian/patches-rt/0008-printk-add-ring-buffer-and-kthread.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:29:46 +0100 Subject: [PATCH 08/25] printk: add ring buffer and kthread -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The printk ring buffer provides an NMI-safe interface for writing messages to a ring buffer. Using such a buffer for alleviates printk diff --git a/debian/patches-rt/0008-x86-fpu-Remove-user_fpu_begin.patch b/debian/patches-rt/0008-x86-fpu-Remove-user_fpu_begin.patch index b84e88550..bcab836ce 100644 --- a/debian/patches-rt/0008-x86-fpu-Remove-user_fpu_begin.patch +++ b/debian/patches-rt/0008-x86-fpu-Remove-user_fpu_begin.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 18 Oct 2018 18:34:11 +0200 Subject: [PATCH 08/27] x86/fpu: Remove user_fpu_begin() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz user_fpu_begin() sets fpu_fpregs_owner_ctx to task's fpu struct. This is always the case since there is no lazy FPU anymore. diff --git a/debian/patches-rt/0009-clocksource-drivers-tcb_clksrc-Rename-the-file-for-c.patch b/debian/patches-rt/0009-clocksource-drivers-tcb_clksrc-Rename-the-file-for-c.patch deleted file mode 100644 index 63ba61168..000000000 --- a/debian/patches-rt/0009-clocksource-drivers-tcb_clksrc-Rename-the-file-for-c.patch +++ /dev/null @@ -1,985 +0,0 @@ -From: Alexandre Belloni -Date: Wed, 3 Apr 2019 16:11:17 +0200 -Subject: [PATCH 09/12] clocksource/drivers/tcb_clksrc: Rename the file for - consistency -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz - -For the sake of consistency, let's rename the file to a name similar -to other file names in this directory. - -Signed-off-by: Alexandre Belloni -Signed-off-by: Sebastian Andrzej Siewior ---- - drivers/clocksource/Makefile | 2 +- - drivers/clocksource/{tcb_clksrc.c => timer-atmel-tcb.c} | 0 - drivers/clocksource/Makefile | 2 - drivers/clocksource/tcb_clksrc.c | 474 ---------------------------------- - drivers/clocksource/timer-atmel-tcb.c | 474 ++++++++++++++++++++++++++++++++++ - 3 files changed, 475 insertions(+), 475 deletions(-) - rename drivers/clocksource/{tcb_clksrc.c => timer-atmel-tcb.c} (100%) - ---- a/drivers/clocksource/Makefile -+++ b/drivers/clocksource/Makefile -@@ -3,7 +3,7 @@ obj-$(CONFIG_TIMER_OF) += timer-of.o - obj-$(CONFIG_TIMER_PROBE) += timer-probe.o - obj-$(CONFIG_ATMEL_PIT) += timer-atmel-pit.o - obj-$(CONFIG_ATMEL_ST) += timer-atmel-st.o --obj-$(CONFIG_ATMEL_TCB_CLKSRC) += tcb_clksrc.o -+obj-$(CONFIG_ATMEL_TCB_CLKSRC) += timer-atmel-tcb.o - obj-$(CONFIG_X86_PM_TIMER) += acpi_pm.o - obj-$(CONFIG_SCx200HR_TIMER) += scx200_hrt.o - obj-$(CONFIG_CS5535_CLOCK_EVENT_SRC) += cs5535-clockevt.o ---- a/drivers/clocksource/tcb_clksrc.c -+++ /dev/null -@@ -1,474 +0,0 @@ --// SPDX-License-Identifier: GPL-2.0 --#include --#include --#include --#include --#include -- --#include --#include --#include --#include --#include --#include --#include --#include --#include -- -- --/* -- * We're configured to use a specific TC block, one that's not hooked -- * up to external hardware, to provide a time solution: -- * -- * - Two channels combine to create a free-running 32 bit counter -- * with a base rate of 5+ MHz, packaged as a clocksource (with -- * resolution better than 200 nsec). -- * - Some chips support 32 bit counter. A single channel is used for -- * this 32 bit free-running counter. the second channel is not used. -- * -- * - The third channel may be used to provide a 16-bit clockevent -- * source, used in either periodic or oneshot mode. This runs -- * at 32 KiHZ, and can handle delays of up to two seconds. -- * -- * REVISIT behavior during system suspend states... we should disable -- * all clocks and save the power. Easily done for clockevent devices, -- * but clocksources won't necessarily get the needed notifications. -- * For deeper system sleep states, this will be mandatory... -- */ -- --static void __iomem *tcaddr; --static struct --{ -- u32 cmr; -- u32 imr; -- u32 rc; -- bool clken; --} tcb_cache[3]; --static u32 bmr_cache; -- --static u64 tc_get_cycles(struct clocksource *cs) --{ -- unsigned long flags; -- u32 lower, upper; -- -- raw_local_irq_save(flags); -- do { -- upper = readl_relaxed(tcaddr + ATMEL_TC_REG(1, CV)); -- lower = readl_relaxed(tcaddr + ATMEL_TC_REG(0, CV)); -- } while (upper != readl_relaxed(tcaddr + ATMEL_TC_REG(1, CV))); -- -- raw_local_irq_restore(flags); -- return (upper << 16) | lower; --} -- --static u64 tc_get_cycles32(struct clocksource *cs) --{ -- return readl_relaxed(tcaddr + ATMEL_TC_REG(0, CV)); --} -- --void tc_clksrc_suspend(struct clocksource *cs) --{ -- int i; -- -- for (i = 0; i < ARRAY_SIZE(tcb_cache); i++) { -- tcb_cache[i].cmr = readl(tcaddr + ATMEL_TC_REG(i, CMR)); -- tcb_cache[i].imr = readl(tcaddr + ATMEL_TC_REG(i, IMR)); -- tcb_cache[i].rc = readl(tcaddr + ATMEL_TC_REG(i, RC)); -- tcb_cache[i].clken = !!(readl(tcaddr + ATMEL_TC_REG(i, SR)) & -- ATMEL_TC_CLKSTA); -- } -- -- bmr_cache = readl(tcaddr + ATMEL_TC_BMR); --} -- --void tc_clksrc_resume(struct clocksource *cs) --{ -- int i; -- -- for (i = 0; i < ARRAY_SIZE(tcb_cache); i++) { -- /* Restore registers for the channel, RA and RB are not used */ -- writel(tcb_cache[i].cmr, tcaddr + ATMEL_TC_REG(i, CMR)); -- writel(tcb_cache[i].rc, tcaddr + ATMEL_TC_REG(i, RC)); -- writel(0, tcaddr + ATMEL_TC_REG(i, RA)); -- writel(0, tcaddr + ATMEL_TC_REG(i, RB)); -- /* Disable all the interrupts */ -- writel(0xff, tcaddr + ATMEL_TC_REG(i, IDR)); -- /* Reenable interrupts that were enabled before suspending */ -- writel(tcb_cache[i].imr, tcaddr + ATMEL_TC_REG(i, IER)); -- /* Start the clock if it was used */ -- if (tcb_cache[i].clken) -- writel(ATMEL_TC_CLKEN, tcaddr + ATMEL_TC_REG(i, CCR)); -- } -- -- /* Dual channel, chain channels */ -- writel(bmr_cache, tcaddr + ATMEL_TC_BMR); -- /* Finally, trigger all the channels*/ -- writel(ATMEL_TC_SYNC, tcaddr + ATMEL_TC_BCR); --} -- --static struct clocksource clksrc = { -- .rating = 200, -- .read = tc_get_cycles, -- .mask = CLOCKSOURCE_MASK(32), -- .flags = CLOCK_SOURCE_IS_CONTINUOUS, -- .suspend = tc_clksrc_suspend, -- .resume = tc_clksrc_resume, --}; -- --static u64 notrace tc_sched_clock_read(void) --{ -- return tc_get_cycles(&clksrc); --} -- --static u64 notrace tc_sched_clock_read32(void) --{ -- return tc_get_cycles32(&clksrc); --} -- --#ifdef CONFIG_GENERIC_CLOCKEVENTS -- --struct tc_clkevt_device { -- struct clock_event_device clkevt; -- struct clk *clk; -- void __iomem *regs; --}; -- --static struct tc_clkevt_device *to_tc_clkevt(struct clock_event_device *clkevt) --{ -- return container_of(clkevt, struct tc_clkevt_device, clkevt); --} -- --/* For now, we always use the 32K clock ... this optimizes for NO_HZ, -- * because using one of the divided clocks would usually mean the -- * tick rate can never be less than several dozen Hz (vs 0.5 Hz). -- * -- * A divided clock could be good for high resolution timers, since -- * 30.5 usec resolution can seem "low". -- */ --static u32 timer_clock; -- --static int tc_shutdown(struct clock_event_device *d) --{ -- struct tc_clkevt_device *tcd = to_tc_clkevt(d); -- void __iomem *regs = tcd->regs; -- -- writel(0xff, regs + ATMEL_TC_REG(2, IDR)); -- writel(ATMEL_TC_CLKDIS, regs + ATMEL_TC_REG(2, CCR)); -- if (!clockevent_state_detached(d)) -- clk_disable(tcd->clk); -- -- return 0; --} -- --static int tc_set_oneshot(struct clock_event_device *d) --{ -- struct tc_clkevt_device *tcd = to_tc_clkevt(d); -- void __iomem *regs = tcd->regs; -- -- if (clockevent_state_oneshot(d) || clockevent_state_periodic(d)) -- tc_shutdown(d); -- -- clk_enable(tcd->clk); -- -- /* slow clock, count up to RC, then irq and stop */ -- writel(timer_clock | ATMEL_TC_CPCSTOP | ATMEL_TC_WAVE | -- ATMEL_TC_WAVESEL_UP_AUTO, regs + ATMEL_TC_REG(2, CMR)); -- writel(ATMEL_TC_CPCS, regs + ATMEL_TC_REG(2, IER)); -- -- /* set_next_event() configures and starts the timer */ -- return 0; --} -- --static int tc_set_periodic(struct clock_event_device *d) --{ -- struct tc_clkevt_device *tcd = to_tc_clkevt(d); -- void __iomem *regs = tcd->regs; -- -- if (clockevent_state_oneshot(d) || clockevent_state_periodic(d)) -- tc_shutdown(d); -- -- /* By not making the gentime core emulate periodic mode on top -- * of oneshot, we get lower overhead and improved accuracy. -- */ -- clk_enable(tcd->clk); -- -- /* slow clock, count up to RC, then irq and restart */ -- writel(timer_clock | ATMEL_TC_WAVE | ATMEL_TC_WAVESEL_UP_AUTO, -- regs + ATMEL_TC_REG(2, CMR)); -- writel((32768 + HZ / 2) / HZ, tcaddr + ATMEL_TC_REG(2, RC)); -- -- /* Enable clock and interrupts on RC compare */ -- writel(ATMEL_TC_CPCS, regs + ATMEL_TC_REG(2, IER)); -- -- /* go go gadget! */ -- writel(ATMEL_TC_CLKEN | ATMEL_TC_SWTRG, regs + -- ATMEL_TC_REG(2, CCR)); -- return 0; --} -- --static int tc_next_event(unsigned long delta, struct clock_event_device *d) --{ -- writel_relaxed(delta, tcaddr + ATMEL_TC_REG(2, RC)); -- -- /* go go gadget! */ -- writel_relaxed(ATMEL_TC_CLKEN | ATMEL_TC_SWTRG, -- tcaddr + ATMEL_TC_REG(2, CCR)); -- return 0; --} -- --static struct tc_clkevt_device clkevt = { -- .clkevt = { -- .features = CLOCK_EVT_FEAT_PERIODIC | -- CLOCK_EVT_FEAT_ONESHOT, -- /* Should be lower than at91rm9200's system timer */ -- .rating = 125, -- .set_next_event = tc_next_event, -- .set_state_shutdown = tc_shutdown, -- .set_state_periodic = tc_set_periodic, -- .set_state_oneshot = tc_set_oneshot, -- }, --}; -- --static irqreturn_t ch2_irq(int irq, void *handle) --{ -- struct tc_clkevt_device *dev = handle; -- unsigned int sr; -- -- sr = readl_relaxed(dev->regs + ATMEL_TC_REG(2, SR)); -- if (sr & ATMEL_TC_CPCS) { -- dev->clkevt.event_handler(&dev->clkevt); -- return IRQ_HANDLED; -- } -- -- return IRQ_NONE; --} -- --static int __init setup_clkevents(struct atmel_tc *tc, int clk32k_divisor_idx) --{ -- int ret; -- struct clk *t2_clk = tc->clk[2]; -- int irq = tc->irq[2]; -- -- ret = clk_prepare_enable(tc->slow_clk); -- if (ret) -- return ret; -- -- /* try to enable t2 clk to avoid future errors in mode change */ -- ret = clk_prepare_enable(t2_clk); -- if (ret) { -- clk_disable_unprepare(tc->slow_clk); -- return ret; -- } -- -- clk_disable(t2_clk); -- -- clkevt.regs = tc->regs; -- clkevt.clk = t2_clk; -- -- timer_clock = clk32k_divisor_idx; -- -- clkevt.clkevt.cpumask = cpumask_of(0); -- -- ret = request_irq(irq, ch2_irq, IRQF_TIMER, "tc_clkevt", &clkevt); -- if (ret) { -- clk_unprepare(t2_clk); -- clk_disable_unprepare(tc->slow_clk); -- return ret; -- } -- -- clockevents_config_and_register(&clkevt.clkevt, 32768, 1, 0xffff); -- -- return ret; --} -- --#else /* !CONFIG_GENERIC_CLOCKEVENTS */ -- --static int __init setup_clkevents(struct atmel_tc *tc, int clk32k_divisor_idx) --{ -- /* NOTHING */ -- return 0; --} -- --#endif -- --static void __init tcb_setup_dual_chan(struct atmel_tc *tc, int mck_divisor_idx) --{ -- /* channel 0: waveform mode, input mclk/8, clock TIOA0 on overflow */ -- writel(mck_divisor_idx /* likely divide-by-8 */ -- | ATMEL_TC_WAVE -- | ATMEL_TC_WAVESEL_UP /* free-run */ -- | ATMEL_TC_ACPA_SET /* TIOA0 rises at 0 */ -- | ATMEL_TC_ACPC_CLEAR, /* (duty cycle 50%) */ -- tcaddr + ATMEL_TC_REG(0, CMR)); -- writel(0x0000, tcaddr + ATMEL_TC_REG(0, RA)); -- writel(0x8000, tcaddr + ATMEL_TC_REG(0, RC)); -- writel(0xff, tcaddr + ATMEL_TC_REG(0, IDR)); /* no irqs */ -- writel(ATMEL_TC_CLKEN, tcaddr + ATMEL_TC_REG(0, CCR)); -- -- /* channel 1: waveform mode, input TIOA0 */ -- writel(ATMEL_TC_XC1 /* input: TIOA0 */ -- | ATMEL_TC_WAVE -- | ATMEL_TC_WAVESEL_UP, /* free-run */ -- tcaddr + ATMEL_TC_REG(1, CMR)); -- writel(0xff, tcaddr + ATMEL_TC_REG(1, IDR)); /* no irqs */ -- writel(ATMEL_TC_CLKEN, tcaddr + ATMEL_TC_REG(1, CCR)); -- -- /* chain channel 0 to channel 1*/ -- writel(ATMEL_TC_TC1XC1S_TIOA0, tcaddr + ATMEL_TC_BMR); -- /* then reset all the timers */ -- writel(ATMEL_TC_SYNC, tcaddr + ATMEL_TC_BCR); --} -- --static void __init tcb_setup_single_chan(struct atmel_tc *tc, int mck_divisor_idx) --{ -- /* channel 0: waveform mode, input mclk/8 */ -- writel(mck_divisor_idx /* likely divide-by-8 */ -- | ATMEL_TC_WAVE -- | ATMEL_TC_WAVESEL_UP, /* free-run */ -- tcaddr + ATMEL_TC_REG(0, CMR)); -- writel(0xff, tcaddr + ATMEL_TC_REG(0, IDR)); /* no irqs */ -- writel(ATMEL_TC_CLKEN, tcaddr + ATMEL_TC_REG(0, CCR)); -- -- /* then reset all the timers */ -- writel(ATMEL_TC_SYNC, tcaddr + ATMEL_TC_BCR); --} -- --static int __init tcb_clksrc_init(struct device_node *node) --{ -- struct atmel_tc tc; -- struct clk *t0_clk; -- const struct of_device_id *match; -- u64 (*tc_sched_clock)(void); -- int irq; -- u32 rate, divided_rate = 0; -- int best_divisor_idx = -1; -- int clk32k_divisor_idx = -1; -- int i; -- int ret; -- -- /* Protect against multiple calls */ -- if (tcaddr) -- return 0; -- -- tc.regs = of_iomap(node->parent, 0); -- if (!tc.regs) -- return -ENXIO; -- -- t0_clk = of_clk_get_by_name(node->parent, "t0_clk"); -- if (IS_ERR(t0_clk)) -- return PTR_ERR(t0_clk); -- -- tc.slow_clk = of_clk_get_by_name(node->parent, "slow_clk"); -- if (IS_ERR(tc.slow_clk)) -- return PTR_ERR(tc.slow_clk); -- -- irq = of_irq_get(node->parent, 0); -- if (irq <= 0) -- return -EINVAL; -- -- tc.clk[0] = t0_clk; -- tc.clk[1] = of_clk_get_by_name(node->parent, "t1_clk"); -- if (IS_ERR(tc.clk[1])) -- tc.clk[1] = t0_clk; -- tc.clk[2] = of_clk_get_by_name(node->parent, "t2_clk"); -- if (IS_ERR(tc.clk[2])) -- tc.clk[2] = t0_clk; -- -- tc.irq[0] = irq; -- tc.irq[1] = of_irq_get(node->parent, 1); -- if (tc.irq[1] <= 0) -- tc.irq[1] = irq; -- tc.irq[2] = of_irq_get(node->parent, 2); -- if (tc.irq[2] <= 0) -- tc.irq[2] = irq; -- -- match = of_match_node(atmel_tcb_dt_ids, node->parent); -- tc.tcb_config = match->data; -- -- for (i = 0; i < ARRAY_SIZE(tc.irq); i++) -- writel(ATMEL_TC_ALL_IRQ, tc.regs + ATMEL_TC_REG(i, IDR)); -- -- ret = clk_prepare_enable(t0_clk); -- if (ret) { -- pr_debug("can't enable T0 clk\n"); -- return ret; -- } -- -- /* How fast will we be counting? Pick something over 5 MHz. */ -- rate = (u32) clk_get_rate(t0_clk); -- for (i = 0; i < 5; i++) { -- unsigned divisor = atmel_tc_divisors[i]; -- unsigned tmp; -- -- /* remember 32 KiHz clock for later */ -- if (!divisor) { -- clk32k_divisor_idx = i; -- continue; -- } -- -- tmp = rate / divisor; -- pr_debug("TC: %u / %-3u [%d] --> %u\n", rate, divisor, i, tmp); -- if (best_divisor_idx > 0) { -- if (tmp < 5 * 1000 * 1000) -- continue; -- } -- divided_rate = tmp; -- best_divisor_idx = i; -- } -- -- clksrc.name = kbasename(node->parent->full_name); -- clkevt.clkevt.name = kbasename(node->parent->full_name); -- pr_debug("%s at %d.%03d MHz\n", clksrc.name, divided_rate / 1000000, -- ((divided_rate % 1000000) + 500) / 1000); -- -- tcaddr = tc.regs; -- -- if (tc.tcb_config->counter_width == 32) { -- /* use apropriate function to read 32 bit counter */ -- clksrc.read = tc_get_cycles32; -- /* setup ony channel 0 */ -- tcb_setup_single_chan(&tc, best_divisor_idx); -- tc_sched_clock = tc_sched_clock_read32; -- } else { -- /* we have three clocks no matter what the -- * underlying platform supports. -- */ -- ret = clk_prepare_enable(tc.clk[1]); -- if (ret) { -- pr_debug("can't enable T1 clk\n"); -- goto err_disable_t0; -- } -- /* setup both channel 0 & 1 */ -- tcb_setup_dual_chan(&tc, best_divisor_idx); -- tc_sched_clock = tc_sched_clock_read; -- } -- -- /* and away we go! */ -- ret = clocksource_register_hz(&clksrc, divided_rate); -- if (ret) -- goto err_disable_t1; -- -- /* channel 2: periodic and oneshot timer support */ -- ret = setup_clkevents(&tc, clk32k_divisor_idx); -- if (ret) -- goto err_unregister_clksrc; -- -- sched_clock_register(tc_sched_clock, 32, divided_rate); -- -- return 0; -- --err_unregister_clksrc: -- clocksource_unregister(&clksrc); -- --err_disable_t1: -- if (tc.tcb_config->counter_width != 32) -- clk_disable_unprepare(tc.clk[1]); -- --err_disable_t0: -- clk_disable_unprepare(t0_clk); -- -- tcaddr = NULL; -- -- return ret; --} --TIMER_OF_DECLARE(atmel_tcb_clksrc, "atmel,tcb-timer", tcb_clksrc_init); ---- /dev/null -+++ b/drivers/clocksource/timer-atmel-tcb.c -@@ -0,0 +1,474 @@ -+// SPDX-License-Identifier: GPL-2.0 -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+ -+/* -+ * We're configured to use a specific TC block, one that's not hooked -+ * up to external hardware, to provide a time solution: -+ * -+ * - Two channels combine to create a free-running 32 bit counter -+ * with a base rate of 5+ MHz, packaged as a clocksource (with -+ * resolution better than 200 nsec). -+ * - Some chips support 32 bit counter. A single channel is used for -+ * this 32 bit free-running counter. the second channel is not used. -+ * -+ * - The third channel may be used to provide a 16-bit clockevent -+ * source, used in either periodic or oneshot mode. This runs -+ * at 32 KiHZ, and can handle delays of up to two seconds. -+ * -+ * REVISIT behavior during system suspend states... we should disable -+ * all clocks and save the power. Easily done for clockevent devices, -+ * but clocksources won't necessarily get the needed notifications. -+ * For deeper system sleep states, this will be mandatory... -+ */ -+ -+static void __iomem *tcaddr; -+static struct -+{ -+ u32 cmr; -+ u32 imr; -+ u32 rc; -+ bool clken; -+} tcb_cache[3]; -+static u32 bmr_cache; -+ -+static u64 tc_get_cycles(struct clocksource *cs) -+{ -+ unsigned long flags; -+ u32 lower, upper; -+ -+ raw_local_irq_save(flags); -+ do { -+ upper = readl_relaxed(tcaddr + ATMEL_TC_REG(1, CV)); -+ lower = readl_relaxed(tcaddr + ATMEL_TC_REG(0, CV)); -+ } while (upper != readl_relaxed(tcaddr + ATMEL_TC_REG(1, CV))); -+ -+ raw_local_irq_restore(flags); -+ return (upper << 16) | lower; -+} -+ -+static u64 tc_get_cycles32(struct clocksource *cs) -+{ -+ return readl_relaxed(tcaddr + ATMEL_TC_REG(0, CV)); -+} -+ -+void tc_clksrc_suspend(struct clocksource *cs) -+{ -+ int i; -+ -+ for (i = 0; i < ARRAY_SIZE(tcb_cache); i++) { -+ tcb_cache[i].cmr = readl(tcaddr + ATMEL_TC_REG(i, CMR)); -+ tcb_cache[i].imr = readl(tcaddr + ATMEL_TC_REG(i, IMR)); -+ tcb_cache[i].rc = readl(tcaddr + ATMEL_TC_REG(i, RC)); -+ tcb_cache[i].clken = !!(readl(tcaddr + ATMEL_TC_REG(i, SR)) & -+ ATMEL_TC_CLKSTA); -+ } -+ -+ bmr_cache = readl(tcaddr + ATMEL_TC_BMR); -+} -+ -+void tc_clksrc_resume(struct clocksource *cs) -+{ -+ int i; -+ -+ for (i = 0; i < ARRAY_SIZE(tcb_cache); i++) { -+ /* Restore registers for the channel, RA and RB are not used */ -+ writel(tcb_cache[i].cmr, tcaddr + ATMEL_TC_REG(i, CMR)); -+ writel(tcb_cache[i].rc, tcaddr + ATMEL_TC_REG(i, RC)); -+ writel(0, tcaddr + ATMEL_TC_REG(i, RA)); -+ writel(0, tcaddr + ATMEL_TC_REG(i, RB)); -+ /* Disable all the interrupts */ -+ writel(0xff, tcaddr + ATMEL_TC_REG(i, IDR)); -+ /* Reenable interrupts that were enabled before suspending */ -+ writel(tcb_cache[i].imr, tcaddr + ATMEL_TC_REG(i, IER)); -+ /* Start the clock if it was used */ -+ if (tcb_cache[i].clken) -+ writel(ATMEL_TC_CLKEN, tcaddr + ATMEL_TC_REG(i, CCR)); -+ } -+ -+ /* Dual channel, chain channels */ -+ writel(bmr_cache, tcaddr + ATMEL_TC_BMR); -+ /* Finally, trigger all the channels*/ -+ writel(ATMEL_TC_SYNC, tcaddr + ATMEL_TC_BCR); -+} -+ -+static struct clocksource clksrc = { -+ .rating = 200, -+ .read = tc_get_cycles, -+ .mask = CLOCKSOURCE_MASK(32), -+ .flags = CLOCK_SOURCE_IS_CONTINUOUS, -+ .suspend = tc_clksrc_suspend, -+ .resume = tc_clksrc_resume, -+}; -+ -+static u64 notrace tc_sched_clock_read(void) -+{ -+ return tc_get_cycles(&clksrc); -+} -+ -+static u64 notrace tc_sched_clock_read32(void) -+{ -+ return tc_get_cycles32(&clksrc); -+} -+ -+#ifdef CONFIG_GENERIC_CLOCKEVENTS -+ -+struct tc_clkevt_device { -+ struct clock_event_device clkevt; -+ struct clk *clk; -+ void __iomem *regs; -+}; -+ -+static struct tc_clkevt_device *to_tc_clkevt(struct clock_event_device *clkevt) -+{ -+ return container_of(clkevt, struct tc_clkevt_device, clkevt); -+} -+ -+/* For now, we always use the 32K clock ... this optimizes for NO_HZ, -+ * because using one of the divided clocks would usually mean the -+ * tick rate can never be less than several dozen Hz (vs 0.5 Hz). -+ * -+ * A divided clock could be good for high resolution timers, since -+ * 30.5 usec resolution can seem "low". -+ */ -+static u32 timer_clock; -+ -+static int tc_shutdown(struct clock_event_device *d) -+{ -+ struct tc_clkevt_device *tcd = to_tc_clkevt(d); -+ void __iomem *regs = tcd->regs; -+ -+ writel(0xff, regs + ATMEL_TC_REG(2, IDR)); -+ writel(ATMEL_TC_CLKDIS, regs + ATMEL_TC_REG(2, CCR)); -+ if (!clockevent_state_detached(d)) -+ clk_disable(tcd->clk); -+ -+ return 0; -+} -+ -+static int tc_set_oneshot(struct clock_event_device *d) -+{ -+ struct tc_clkevt_device *tcd = to_tc_clkevt(d); -+ void __iomem *regs = tcd->regs; -+ -+ if (clockevent_state_oneshot(d) || clockevent_state_periodic(d)) -+ tc_shutdown(d); -+ -+ clk_enable(tcd->clk); -+ -+ /* slow clock, count up to RC, then irq and stop */ -+ writel(timer_clock | ATMEL_TC_CPCSTOP | ATMEL_TC_WAVE | -+ ATMEL_TC_WAVESEL_UP_AUTO, regs + ATMEL_TC_REG(2, CMR)); -+ writel(ATMEL_TC_CPCS, regs + ATMEL_TC_REG(2, IER)); -+ -+ /* set_next_event() configures and starts the timer */ -+ return 0; -+} -+ -+static int tc_set_periodic(struct clock_event_device *d) -+{ -+ struct tc_clkevt_device *tcd = to_tc_clkevt(d); -+ void __iomem *regs = tcd->regs; -+ -+ if (clockevent_state_oneshot(d) || clockevent_state_periodic(d)) -+ tc_shutdown(d); -+ -+ /* By not making the gentime core emulate periodic mode on top -+ * of oneshot, we get lower overhead and improved accuracy. -+ */ -+ clk_enable(tcd->clk); -+ -+ /* slow clock, count up to RC, then irq and restart */ -+ writel(timer_clock | ATMEL_TC_WAVE | ATMEL_TC_WAVESEL_UP_AUTO, -+ regs + ATMEL_TC_REG(2, CMR)); -+ writel((32768 + HZ / 2) / HZ, tcaddr + ATMEL_TC_REG(2, RC)); -+ -+ /* Enable clock and interrupts on RC compare */ -+ writel(ATMEL_TC_CPCS, regs + ATMEL_TC_REG(2, IER)); -+ -+ /* go go gadget! */ -+ writel(ATMEL_TC_CLKEN | ATMEL_TC_SWTRG, regs + -+ ATMEL_TC_REG(2, CCR)); -+ return 0; -+} -+ -+static int tc_next_event(unsigned long delta, struct clock_event_device *d) -+{ -+ writel_relaxed(delta, tcaddr + ATMEL_TC_REG(2, RC)); -+ -+ /* go go gadget! */ -+ writel_relaxed(ATMEL_TC_CLKEN | ATMEL_TC_SWTRG, -+ tcaddr + ATMEL_TC_REG(2, CCR)); -+ return 0; -+} -+ -+static struct tc_clkevt_device clkevt = { -+ .clkevt = { -+ .features = CLOCK_EVT_FEAT_PERIODIC | -+ CLOCK_EVT_FEAT_ONESHOT, -+ /* Should be lower than at91rm9200's system timer */ -+ .rating = 125, -+ .set_next_event = tc_next_event, -+ .set_state_shutdown = tc_shutdown, -+ .set_state_periodic = tc_set_periodic, -+ .set_state_oneshot = tc_set_oneshot, -+ }, -+}; -+ -+static irqreturn_t ch2_irq(int irq, void *handle) -+{ -+ struct tc_clkevt_device *dev = handle; -+ unsigned int sr; -+ -+ sr = readl_relaxed(dev->regs + ATMEL_TC_REG(2, SR)); -+ if (sr & ATMEL_TC_CPCS) { -+ dev->clkevt.event_handler(&dev->clkevt); -+ return IRQ_HANDLED; -+ } -+ -+ return IRQ_NONE; -+} -+ -+static int __init setup_clkevents(struct atmel_tc *tc, int clk32k_divisor_idx) -+{ -+ int ret; -+ struct clk *t2_clk = tc->clk[2]; -+ int irq = tc->irq[2]; -+ -+ ret = clk_prepare_enable(tc->slow_clk); -+ if (ret) -+ return ret; -+ -+ /* try to enable t2 clk to avoid future errors in mode change */ -+ ret = clk_prepare_enable(t2_clk); -+ if (ret) { -+ clk_disable_unprepare(tc->slow_clk); -+ return ret; -+ } -+ -+ clk_disable(t2_clk); -+ -+ clkevt.regs = tc->regs; -+ clkevt.clk = t2_clk; -+ -+ timer_clock = clk32k_divisor_idx; -+ -+ clkevt.clkevt.cpumask = cpumask_of(0); -+ -+ ret = request_irq(irq, ch2_irq, IRQF_TIMER, "tc_clkevt", &clkevt); -+ if (ret) { -+ clk_unprepare(t2_clk); -+ clk_disable_unprepare(tc->slow_clk); -+ return ret; -+ } -+ -+ clockevents_config_and_register(&clkevt.clkevt, 32768, 1, 0xffff); -+ -+ return ret; -+} -+ -+#else /* !CONFIG_GENERIC_CLOCKEVENTS */ -+ -+static int __init setup_clkevents(struct atmel_tc *tc, int clk32k_divisor_idx) -+{ -+ /* NOTHING */ -+ return 0; -+} -+ -+#endif -+ -+static void __init tcb_setup_dual_chan(struct atmel_tc *tc, int mck_divisor_idx) -+{ -+ /* channel 0: waveform mode, input mclk/8, clock TIOA0 on overflow */ -+ writel(mck_divisor_idx /* likely divide-by-8 */ -+ | ATMEL_TC_WAVE -+ | ATMEL_TC_WAVESEL_UP /* free-run */ -+ | ATMEL_TC_ACPA_SET /* TIOA0 rises at 0 */ -+ | ATMEL_TC_ACPC_CLEAR, /* (duty cycle 50%) */ -+ tcaddr + ATMEL_TC_REG(0, CMR)); -+ writel(0x0000, tcaddr + ATMEL_TC_REG(0, RA)); -+ writel(0x8000, tcaddr + ATMEL_TC_REG(0, RC)); -+ writel(0xff, tcaddr + ATMEL_TC_REG(0, IDR)); /* no irqs */ -+ writel(ATMEL_TC_CLKEN, tcaddr + ATMEL_TC_REG(0, CCR)); -+ -+ /* channel 1: waveform mode, input TIOA0 */ -+ writel(ATMEL_TC_XC1 /* input: TIOA0 */ -+ | ATMEL_TC_WAVE -+ | ATMEL_TC_WAVESEL_UP, /* free-run */ -+ tcaddr + ATMEL_TC_REG(1, CMR)); -+ writel(0xff, tcaddr + ATMEL_TC_REG(1, IDR)); /* no irqs */ -+ writel(ATMEL_TC_CLKEN, tcaddr + ATMEL_TC_REG(1, CCR)); -+ -+ /* chain channel 0 to channel 1*/ -+ writel(ATMEL_TC_TC1XC1S_TIOA0, tcaddr + ATMEL_TC_BMR); -+ /* then reset all the timers */ -+ writel(ATMEL_TC_SYNC, tcaddr + ATMEL_TC_BCR); -+} -+ -+static void __init tcb_setup_single_chan(struct atmel_tc *tc, int mck_divisor_idx) -+{ -+ /* channel 0: waveform mode, input mclk/8 */ -+ writel(mck_divisor_idx /* likely divide-by-8 */ -+ | ATMEL_TC_WAVE -+ | ATMEL_TC_WAVESEL_UP, /* free-run */ -+ tcaddr + ATMEL_TC_REG(0, CMR)); -+ writel(0xff, tcaddr + ATMEL_TC_REG(0, IDR)); /* no irqs */ -+ writel(ATMEL_TC_CLKEN, tcaddr + ATMEL_TC_REG(0, CCR)); -+ -+ /* then reset all the timers */ -+ writel(ATMEL_TC_SYNC, tcaddr + ATMEL_TC_BCR); -+} -+ -+static int __init tcb_clksrc_init(struct device_node *node) -+{ -+ struct atmel_tc tc; -+ struct clk *t0_clk; -+ const struct of_device_id *match; -+ u64 (*tc_sched_clock)(void); -+ int irq; -+ u32 rate, divided_rate = 0; -+ int best_divisor_idx = -1; -+ int clk32k_divisor_idx = -1; -+ int i; -+ int ret; -+ -+ /* Protect against multiple calls */ -+ if (tcaddr) -+ return 0; -+ -+ tc.regs = of_iomap(node->parent, 0); -+ if (!tc.regs) -+ return -ENXIO; -+ -+ t0_clk = of_clk_get_by_name(node->parent, "t0_clk"); -+ if (IS_ERR(t0_clk)) -+ return PTR_ERR(t0_clk); -+ -+ tc.slow_clk = of_clk_get_by_name(node->parent, "slow_clk"); -+ if (IS_ERR(tc.slow_clk)) -+ return PTR_ERR(tc.slow_clk); -+ -+ irq = of_irq_get(node->parent, 0); -+ if (irq <= 0) -+ return -EINVAL; -+ -+ tc.clk[0] = t0_clk; -+ tc.clk[1] = of_clk_get_by_name(node->parent, "t1_clk"); -+ if (IS_ERR(tc.clk[1])) -+ tc.clk[1] = t0_clk; -+ tc.clk[2] = of_clk_get_by_name(node->parent, "t2_clk"); -+ if (IS_ERR(tc.clk[2])) -+ tc.clk[2] = t0_clk; -+ -+ tc.irq[0] = irq; -+ tc.irq[1] = of_irq_get(node->parent, 1); -+ if (tc.irq[1] <= 0) -+ tc.irq[1] = irq; -+ tc.irq[2] = of_irq_get(node->parent, 2); -+ if (tc.irq[2] <= 0) -+ tc.irq[2] = irq; -+ -+ match = of_match_node(atmel_tcb_dt_ids, node->parent); -+ tc.tcb_config = match->data; -+ -+ for (i = 0; i < ARRAY_SIZE(tc.irq); i++) -+ writel(ATMEL_TC_ALL_IRQ, tc.regs + ATMEL_TC_REG(i, IDR)); -+ -+ ret = clk_prepare_enable(t0_clk); -+ if (ret) { -+ pr_debug("can't enable T0 clk\n"); -+ return ret; -+ } -+ -+ /* How fast will we be counting? Pick something over 5 MHz. */ -+ rate = (u32) clk_get_rate(t0_clk); -+ for (i = 0; i < 5; i++) { -+ unsigned divisor = atmel_tc_divisors[i]; -+ unsigned tmp; -+ -+ /* remember 32 KiHz clock for later */ -+ if (!divisor) { -+ clk32k_divisor_idx = i; -+ continue; -+ } -+ -+ tmp = rate / divisor; -+ pr_debug("TC: %u / %-3u [%d] --> %u\n", rate, divisor, i, tmp); -+ if (best_divisor_idx > 0) { -+ if (tmp < 5 * 1000 * 1000) -+ continue; -+ } -+ divided_rate = tmp; -+ best_divisor_idx = i; -+ } -+ -+ clksrc.name = kbasename(node->parent->full_name); -+ clkevt.clkevt.name = kbasename(node->parent->full_name); -+ pr_debug("%s at %d.%03d MHz\n", clksrc.name, divided_rate / 1000000, -+ ((divided_rate % 1000000) + 500) / 1000); -+ -+ tcaddr = tc.regs; -+ -+ if (tc.tcb_config->counter_width == 32) { -+ /* use apropriate function to read 32 bit counter */ -+ clksrc.read = tc_get_cycles32; -+ /* setup ony channel 0 */ -+ tcb_setup_single_chan(&tc, best_divisor_idx); -+ tc_sched_clock = tc_sched_clock_read32; -+ } else { -+ /* we have three clocks no matter what the -+ * underlying platform supports. -+ */ -+ ret = clk_prepare_enable(tc.clk[1]); -+ if (ret) { -+ pr_debug("can't enable T1 clk\n"); -+ goto err_disable_t0; -+ } -+ /* setup both channel 0 & 1 */ -+ tcb_setup_dual_chan(&tc, best_divisor_idx); -+ tc_sched_clock = tc_sched_clock_read; -+ } -+ -+ /* and away we go! */ -+ ret = clocksource_register_hz(&clksrc, divided_rate); -+ if (ret) -+ goto err_disable_t1; -+ -+ /* channel 2: periodic and oneshot timer support */ -+ ret = setup_clkevents(&tc, clk32k_divisor_idx); -+ if (ret) -+ goto err_unregister_clksrc; -+ -+ sched_clock_register(tc_sched_clock, 32, divided_rate); -+ -+ return 0; -+ -+err_unregister_clksrc: -+ clocksource_unregister(&clksrc); -+ -+err_disable_t1: -+ if (tc.tcb_config->counter_width != 32) -+ clk_disable_unprepare(tc.clk[1]); -+ -+err_disable_t0: -+ clk_disable_unprepare(t0_clk); -+ -+ tcaddr = NULL; -+ -+ return ret; -+} -+TIMER_OF_DECLARE(atmel_tcb_clksrc, "atmel,tcb-timer", tcb_clksrc_init); diff --git a/debian/patches-rt/0009-misc-atmel_tclib-do-not-probe-already-used-TCBs.patch b/debian/patches-rt/0009-misc-atmel_tclib-do-not-probe-already-used-TCBs.patch new file mode 100644 index 000000000..310baa7de --- /dev/null +++ b/debian/patches-rt/0009-misc-atmel_tclib-do-not-probe-already-used-TCBs.patch @@ -0,0 +1,27 @@ +From: Alexandre Belloni +Date: Fri, 26 Apr 2019 23:47:18 +0200 +Subject: [PATCH 09/10] misc: atmel_tclib: do not probe already used TCBs +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz + +The TCBs that have children are using the proper DT bindings and don't need +to be handled by tclib. + +Acked-by: Greg Kroah-Hartman +Signed-off-by: Alexandre Belloni +Signed-off-by: Sebastian Andrzej Siewior +--- + drivers/misc/atmel_tclib.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/misc/atmel_tclib.c ++++ b/drivers/misc/atmel_tclib.c +@@ -111,6 +111,9 @@ static int __init tc_probe(struct platfo + struct resource *r; + unsigned int i; + ++ if (of_get_child_count(pdev->dev.of_node)) ++ return -EBUSY; ++ + irq = platform_get_irq(pdev, 0); + if (irq < 0) + return -EINVAL; diff --git a/debian/patches-rt/0009-printk-remove-exclusive-console-hack.patch b/debian/patches-rt/0009-printk-remove-exclusive-console-hack.patch index 439cc8430..5f6ffe1e9 100644 --- a/debian/patches-rt/0009-printk-remove-exclusive-console-hack.patch +++ b/debian/patches-rt/0009-printk-remove-exclusive-console-hack.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:29:47 +0100 Subject: [PATCH 09/25] printk: remove exclusive console hack -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz In order to support printing the printk log history when new consoles are registered, a global exclusive_console variable is diff --git a/debian/patches-rt/0009-x86-fpu-Add-__-make_fpregs_active-helpers.patch b/debian/patches-rt/0009-x86-fpu-Add-__-make_fpregs_active-helpers.patch index b02af7bc5..e0f829ae6 100644 --- a/debian/patches-rt/0009-x86-fpu-Add-__-make_fpregs_active-helpers.patch +++ b/debian/patches-rt/0009-x86-fpu-Add-__-make_fpregs_active-helpers.patch @@ -1,7 +1,7 @@ From: Rik van Riel Date: Sun, 9 Sep 2018 18:30:45 +0200 Subject: [PATCH 09/27] x86/fpu: Add (__)make_fpregs_active helpers -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Add helper function that ensures the floating point registers for the current task are active. Use with preemption disabled. diff --git a/debian/patches-rt/0010-ARM-configs-at91-unselect-PIT.patch b/debian/patches-rt/0010-ARM-configs-at91-unselect-PIT.patch deleted file mode 100644 index 4d42c3926..000000000 --- a/debian/patches-rt/0010-ARM-configs-at91-unselect-PIT.patch +++ /dev/null @@ -1,36 +0,0 @@ -From: Alexandre Belloni -Date: Wed, 3 Apr 2019 16:11:18 +0200 -Subject: [PATCH 10/12] ARM: configs: at91: unselect PIT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz - -The PIT is not required anymore to successfully boot and may actually harm -in case preempt-rt is used because the PIT interrupt is shared. -Disable it so the TCB clocksource is used. - -Signed-off-by: Alexandre Belloni -Signed-off-by: Sebastian Andrzej Siewior ---- - arch/arm/configs/at91_dt_defconfig | 1 + - arch/arm/configs/sama5_defconfig | 1 + - 2 files changed, 2 insertions(+) - ---- a/arch/arm/configs/at91_dt_defconfig -+++ b/arch/arm/configs/at91_dt_defconfig -@@ -19,6 +19,7 @@ CONFIG_ARCH_MULTI_V5=y - CONFIG_ARCH_AT91=y - CONFIG_SOC_AT91RM9200=y - CONFIG_SOC_AT91SAM9=y -+# CONFIG_ATMEL_CLOCKSOURCE_PIT is not set - CONFIG_AEABI=y - CONFIG_UACCESS_WITH_MEMCPY=y - CONFIG_ZBOOT_ROM_TEXT=0x0 ---- a/arch/arm/configs/sama5_defconfig -+++ b/arch/arm/configs/sama5_defconfig -@@ -20,6 +20,7 @@ CONFIG_ARCH_AT91=y - CONFIG_SOC_SAMA5D2=y - CONFIG_SOC_SAMA5D3=y - CONFIG_SOC_SAMA5D4=y -+# CONFIG_ATMEL_CLOCKSOURCE_PIT is not set - CONFIG_AEABI=y - CONFIG_UACCESS_WITH_MEMCPY=y - CONFIG_ZBOOT_ROM_TEXT=0x0 diff --git a/debian/patches-rt/0010-printk-redirect-emit-store-to-new-ringbuffer.patch b/debian/patches-rt/0010-printk-redirect-emit-store-to-new-ringbuffer.patch index e4e9a907a..397f8d152 100644 --- a/debian/patches-rt/0010-printk-redirect-emit-store-to-new-ringbuffer.patch +++ b/debian/patches-rt/0010-printk-redirect-emit-store-to-new-ringbuffer.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:29:48 +0100 Subject: [PATCH 10/25] printk: redirect emit/store to new ringbuffer -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz vprintk_emit and vprintk_store are the main functions that all printk variants eventually go through. Change these to store the message in diff --git a/debian/patches-rt/0010-x86-fpu-Make-__raw_xsave_addr-use-feature-number-ins.patch b/debian/patches-rt/0010-x86-fpu-Make-__raw_xsave_addr-use-feature-number-ins.patch index eee1813b7..7e4c8ec88 100644 --- a/debian/patches-rt/0010-x86-fpu-Make-__raw_xsave_addr-use-feature-number-ins.patch +++ b/debian/patches-rt/0010-x86-fpu-Make-__raw_xsave_addr-use-feature-number-ins.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Tue, 2 Oct 2018 10:28:15 +0200 Subject: [PATCH 10/27] x86/fpu: Make __raw_xsave_addr() use feature number instead of mask -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Most users of __raw_xsave_addr() use a feature number, shift it to a mask and then __raw_xsave_addr() shifts it back to the feature number. diff --git a/debian/patches-rt/0011-misc-atmel_tclib-do-not-probe-already-used-TCBs.patch b/debian/patches-rt/0011-misc-atmel_tclib-do-not-probe-already-used-TCBs.patch deleted file mode 100644 index f643819d9..000000000 --- a/debian/patches-rt/0011-misc-atmel_tclib-do-not-probe-already-used-TCBs.patch +++ /dev/null @@ -1,26 +0,0 @@ -From: Alexandre Belloni -Date: Wed, 3 Apr 2019 16:11:19 +0200 -Subject: [PATCH 11/12] misc: atmel_tclib: do not probe already used TCBs -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz - -The TCBs that have children are using the new (proper) DT bindings and -don't need to be handled by tclib. - -Signed-off-by: Alexandre Belloni -Signed-off-by: Sebastian Andrzej Siewior ---- - drivers/misc/atmel_tclib.c | 3 +++ - 1 file changed, 3 insertions(+) - ---- a/drivers/misc/atmel_tclib.c -+++ b/drivers/misc/atmel_tclib.c -@@ -79,6 +79,9 @@ static int __init tc_probe(struct platfo - struct resource *r; - unsigned int i; - -+ if (of_get_child_count(pdev->dev.of_node)) -+ return 0; -+ - irq = platform_get_irq(pdev, 0); - if (irq < 0) - return -EINVAL; diff --git a/debian/patches-rt/0011-printk_safe-remove-printk-safe-code.patch b/debian/patches-rt/0011-printk_safe-remove-printk-safe-code.patch index 14e9b1d5c..8edbecc4e 100644 --- a/debian/patches-rt/0011-printk_safe-remove-printk-safe-code.patch +++ b/debian/patches-rt/0011-printk_safe-remove-printk-safe-code.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:29:49 +0100 Subject: [PATCH 11/25] printk_safe: remove printk safe code -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz vprintk variants are now NMI-safe so there is no longer a need for the "safe" calls. diff --git a/debian/patches-rt/0011-x86-fpu-Make-get_xsave_field_ptr-and-get_xsave_addr-.patch b/debian/patches-rt/0011-x86-fpu-Make-get_xsave_field_ptr-and-get_xsave_addr-.patch index dccf225d2..5dc7b4dbc 100644 --- a/debian/patches-rt/0011-x86-fpu-Make-get_xsave_field_ptr-and-get_xsave_addr-.patch +++ b/debian/patches-rt/0011-x86-fpu-Make-get_xsave_field_ptr-and-get_xsave_addr-.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 18 Oct 2018 12:58:06 +0200 Subject: [PATCH 11/27] x86/fpu: Make get_xsave_field_ptr() and get_xsave_addr() use feature number instead of mask -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz After changing the argument of __raw_xsave_addr() from a mask to number Dave suggested to check if it makes sense to do the same for @@ -128,7 +128,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c -@@ -3673,15 +3673,15 @@ static void fill_xsave(u8 *dest, struct +@@ -3675,15 +3675,15 @@ static void fill_xsave(u8 *dest, struct */ valid = xstate_bv & ~XFEATURE_MASK_FPSSE; while (valid) { @@ -149,7 +149,7 @@ Signed-off-by: Sebastian Andrzej Siewior memcpy(dest + offset, &vcpu->arch.pkru, sizeof(vcpu->arch.pkru)); else -@@ -3689,7 +3689,7 @@ static void fill_xsave(u8 *dest, struct +@@ -3691,7 +3691,7 @@ static void fill_xsave(u8 *dest, struct } @@ -158,7 +158,7 @@ Signed-off-by: Sebastian Andrzej Siewior } } -@@ -3716,22 +3716,22 @@ static void load_xsave(struct kvm_vcpu * +@@ -3718,22 +3718,22 @@ static void load_xsave(struct kvm_vcpu * */ valid = xstate_bv & ~XFEATURE_MASK_FPSSE; while (valid) { @@ -187,7 +187,7 @@ Signed-off-by: Sebastian Andrzej Siewior } } -@@ -8841,11 +8841,11 @@ void kvm_vcpu_reset(struct kvm_vcpu *vcp +@@ -8839,11 +8839,11 @@ void kvm_vcpu_reset(struct kvm_vcpu *vcp if (init_event) kvm_put_guest_fpu(vcpu); mpx_state_buffer = get_xsave_addr(&vcpu->arch.guest_fpu->state.xsave, diff --git a/debian/patches-rt/0012-clocksource-drivers-timer-atmel-tcb-Use-ARRAY_SIZE-i.patch b/debian/patches-rt/0012-clocksource-drivers-timer-atmel-tcb-Use-ARRAY_SIZE-i.patch deleted file mode 100644 index 9d1a799d7..000000000 --- a/debian/patches-rt/0012-clocksource-drivers-timer-atmel-tcb-Use-ARRAY_SIZE-i.patch +++ /dev/null @@ -1,26 +0,0 @@ -From: Alexandre Belloni -Date: Wed, 3 Apr 2019 16:11:20 +0200 -Subject: [PATCH 12/12] clocksource/drivers/timer-atmel-tcb: Use ARRAY_SIZE - instead of hardcoded size -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz - -Use ARRAY_SIZE to replace the hardcoded size so we will never have a -mismatch. - -Signed-off-by: Alexandre Belloni -Signed-off-by: Sebastian Andrzej Siewior ---- - drivers/clocksource/timer-atmel-tcb.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/clocksource/timer-atmel-tcb.c -+++ b/drivers/clocksource/timer-atmel-tcb.c -@@ -396,7 +396,7 @@ static int __init tcb_clksrc_init(struct - - /* How fast will we be counting? Pick something over 5 MHz. */ - rate = (u32) clk_get_rate(t0_clk); -- for (i = 0; i < 5; i++) { -+ for (i = 0; i < ARRAY_SIZE(atmel_tc_divisors); i++) { - unsigned divisor = atmel_tc_divisors[i]; - unsigned tmp; - diff --git a/debian/patches-rt/0012-printk-minimize-console-locking-implementation.patch b/debian/patches-rt/0012-printk-minimize-console-locking-implementation.patch index 685bd60be..e518fe03a 100644 --- a/debian/patches-rt/0012-printk-minimize-console-locking-implementation.patch +++ b/debian/patches-rt/0012-printk-minimize-console-locking-implementation.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:29:50 +0100 Subject: [PATCH 12/25] printk: minimize console locking implementation -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Since printing of the printk buffer is now handled by the printk kthread, minimize the console locking functions to just handle diff --git a/debian/patches-rt/0012-x86-pkru-Provide-.-_pkru_ins-functions.patch b/debian/patches-rt/0012-x86-pkru-Provide-.-_pkru_ins-functions.patch index 828bc964a..13b427d23 100644 --- a/debian/patches-rt/0012-x86-pkru-Provide-.-_pkru_ins-functions.patch +++ b/debian/patches-rt/0012-x86-pkru-Provide-.-_pkru_ins-functions.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 21 Mar 2019 13:15:32 +0100 Subject: [PATCH 12/27] x86/pkru: Provide .*_pkru_ins() functions -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Dave Hansen has asked for __read_pkru() and __write_pkru() to be symmetrical. As part of the series __write_pkru() will read back the value and only write it @@ -67,7 +67,7 @@ Signed-off-by: Sebastian Andrzej Siewior } --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c -@@ -6630,7 +6630,7 @@ static void vmx_vcpu_run(struct kvm_vcpu +@@ -6632,7 +6632,7 @@ static void vmx_vcpu_run(struct kvm_vcpu */ if (static_cpu_has(X86_FEATURE_PKU) && kvm_read_cr4_bits(vcpu, X86_CR4_PKE)) { diff --git a/debian/patches-rt/0013-printk-track-seq-per-console.patch b/debian/patches-rt/0013-printk-track-seq-per-console.patch index 5f7de080d..c7622d2d6 100644 --- a/debian/patches-rt/0013-printk-track-seq-per-console.patch +++ b/debian/patches-rt/0013-printk-track-seq-per-console.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:29:51 +0100 Subject: [PATCH 13/25] printk: track seq per console -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Allow each console to track which seq record was last printed. This simplifies identifying dropped records. diff --git a/debian/patches-rt/0013-x86-fpu-Only-write-PKRU-if-it-is-different-from-curr.patch b/debian/patches-rt/0013-x86-fpu-Only-write-PKRU-if-it-is-different-from-curr.patch index fee9d72a0..b94b29e2c 100644 --- a/debian/patches-rt/0013-x86-fpu-Only-write-PKRU-if-it-is-different-from-curr.patch +++ b/debian/patches-rt/0013-x86-fpu-Only-write-PKRU-if-it-is-different-from-curr.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 19 Oct 2018 12:46:53 +0200 Subject: [PATCH 13/27] x86/fpu: Only write PKRU if it is different from current -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Dave Hansen says that the `wrpkru' is more expensive than `rdpkru'. It has a higher cycle cost and it's also practically a (light) speculation diff --git a/debian/patches-rt/0014-printk-do-boot_delay_msec-inside-printk_delay.patch b/debian/patches-rt/0014-printk-do-boot_delay_msec-inside-printk_delay.patch index dda98527e..5e9543a2c 100644 --- a/debian/patches-rt/0014-printk-do-boot_delay_msec-inside-printk_delay.patch +++ b/debian/patches-rt/0014-printk-do-boot_delay_msec-inside-printk_delay.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:29:52 +0100 Subject: [PATCH 14/25] printk: do boot_delay_msec inside printk_delay -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Both functions needed to be called one after the other, so just integrate boot_delay_msec into printk_delay for simplification. diff --git a/debian/patches-rt/0014-x86-pkeys-Don-t-check-if-PKRU-is-zero-before-writtin.patch b/debian/patches-rt/0014-x86-pkeys-Don-t-check-if-PKRU-is-zero-before-writtin.patch index 485f409cc..4e932e097 100644 --- a/debian/patches-rt/0014-x86-pkeys-Don-t-check-if-PKRU-is-zero-before-writtin.patch +++ b/debian/patches-rt/0014-x86-pkeys-Don-t-check-if-PKRU-is-zero-before-writtin.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 19 Oct 2018 13:59:26 +0200 Subject: [PATCH 14/27] x86/pkeys: Don't check if PKRU is zero before writting it -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz write_pkru() checks if the current value is the same as the expected value. So instead just checking if the current and new value is zero diff --git a/debian/patches-rt/0015-printk-print-history-for-new-consoles.patch b/debian/patches-rt/0015-printk-print-history-for-new-consoles.patch index a3555db4f..fe4b6b3db 100644 --- a/debian/patches-rt/0015-printk-print-history-for-new-consoles.patch +++ b/debian/patches-rt/0015-printk-print-history-for-new-consoles.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:29:53 +0100 Subject: [PATCH 15/25] printk: print history for new consoles -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz When new consoles register, they currently print how many messages they have missed. However, many (or all) of those messages may still diff --git a/debian/patches-rt/0015-x86-fpu-Eager-switch-PKRU-state.patch b/debian/patches-rt/0015-x86-fpu-Eager-switch-PKRU-state.patch index 7e74a0ec0..4b74f9936 100644 --- a/debian/patches-rt/0015-x86-fpu-Eager-switch-PKRU-state.patch +++ b/debian/patches-rt/0015-x86-fpu-Eager-switch-PKRU-state.patch @@ -1,7 +1,7 @@ From: Rik van Riel Date: Sun, 9 Sep 2018 18:30:47 +0200 Subject: [PATCH 15/27] x86/fpu: Eager switch PKRU state -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz While most of a task's FPU state is only needed in user space, the protection keys need to be in place immediately after a context switch. diff --git a/debian/patches-rt/0016-printk-implement-CON_PRINTBUFFER.patch b/debian/patches-rt/0016-printk-implement-CON_PRINTBUFFER.patch index 250839475..7990eaef7 100644 --- a/debian/patches-rt/0016-printk-implement-CON_PRINTBUFFER.patch +++ b/debian/patches-rt/0016-printk-implement-CON_PRINTBUFFER.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:29:54 +0100 Subject: [PATCH 16/25] printk: implement CON_PRINTBUFFER -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz If the CON_PRINTBUFFER flag is not set, do not replay the history for that console. diff --git a/debian/patches-rt/0016-x86-entry-Add-TIF_NEED_FPU_LOAD.patch b/debian/patches-rt/0016-x86-entry-Add-TIF_NEED_FPU_LOAD.patch index fce6b38ab..6d48413dd 100644 --- a/debian/patches-rt/0016-x86-entry-Add-TIF_NEED_FPU_LOAD.patch +++ b/debian/patches-rt/0016-x86-entry-Add-TIF_NEED_FPU_LOAD.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 5 Sep 2018 18:34:47 +0200 Subject: [PATCH 16/27] x86/entry: Add TIF_NEED_FPU_LOAD -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Add TIF_NEED_FPU_LOAD. This is reserved for loading the FPU registers before returning to userland. This flag must not be set for systems diff --git a/debian/patches-rt/0017-printk-add-processor-number-to-output.patch b/debian/patches-rt/0017-printk-add-processor-number-to-output.patch index e8234421c..3c17a6dda 100644 --- a/debian/patches-rt/0017-printk-add-processor-number-to-output.patch +++ b/debian/patches-rt/0017-printk-add-processor-number-to-output.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:29:55 +0100 Subject: [PATCH 17/25] printk: add processor number to output -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz It can be difficult to sort printk out if multiple processors are printing simultaneously. Add the processor number to the printk diff --git a/debian/patches-rt/0017-x86-fpu-Always-store-the-registers-in-copy_fpstate_t.patch b/debian/patches-rt/0017-x86-fpu-Always-store-the-registers-in-copy_fpstate_t.patch index 504c87e52..bf990ae4b 100644 --- a/debian/patches-rt/0017-x86-fpu-Always-store-the-registers-in-copy_fpstate_t.patch +++ b/debian/patches-rt/0017-x86-fpu-Always-store-the-registers-in-copy_fpstate_t.patch @@ -5,7 +5,7 @@ Subject: [PATCH 17/27] x86/fpu: Always store the registers in MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz copy_fpstate_to_sigframe() stores the registers directly to user space. This is okay because the FPU register are valid and saving it directly diff --git a/debian/patches-rt/0018-console-add-write_atomic-interface.patch b/debian/patches-rt/0018-console-add-write_atomic-interface.patch index 941d4670c..4cc9210d3 100644 --- a/debian/patches-rt/0018-console-add-write_atomic-interface.patch +++ b/debian/patches-rt/0018-console-add-write_atomic-interface.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:29:56 +0100 Subject: [PATCH 18/25] console: add write_atomic interface -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Add a write_atomic callback to the console. This is an optional function for console drivers. The function must be atomic (including diff --git a/debian/patches-rt/0018-x86-fpu-Prepare-copy_fpstate_to_sigframe-for-TIF_NEE.patch b/debian/patches-rt/0018-x86-fpu-Prepare-copy_fpstate_to_sigframe-for-TIF_NEE.patch index 541dc9473..775aed89a 100644 --- a/debian/patches-rt/0018-x86-fpu-Prepare-copy_fpstate_to_sigframe-for-TIF_NEE.patch +++ b/debian/patches-rt/0018-x86-fpu-Prepare-copy_fpstate_to_sigframe-for-TIF_NEE.patch @@ -2,7 +2,7 @@ From: Rik van Riel Date: Sun, 9 Sep 2018 18:30:51 +0200 Subject: [PATCH 18/27] x86/fpu: Prepare copy_fpstate_to_sigframe() for TIF_NEED_FPU_LOAD -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The FPU registers need only to be saved if TIF_NEED_FPU_LOAD is not set. Otherwise this has been already done and can be skipped. diff --git a/debian/patches-rt/0019-printk-introduce-emergency-messages.patch b/debian/patches-rt/0019-printk-introduce-emergency-messages.patch index 42cb021ea..cb44efdfe 100644 --- a/debian/patches-rt/0019-printk-introduce-emergency-messages.patch +++ b/debian/patches-rt/0019-printk-introduce-emergency-messages.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:29:57 +0100 Subject: [PATCH 19/25] printk: introduce emergency messages -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Console messages are generally either critical or non-critical. Critical messages are messages such as crashes or sysrq output. diff --git a/debian/patches-rt/0019-x86-fpu-Update-xstate-s-PKRU-value-on-write_pkru.patch b/debian/patches-rt/0019-x86-fpu-Update-xstate-s-PKRU-value-on-write_pkru.patch index 5f531cb5a..024381676 100644 --- a/debian/patches-rt/0019-x86-fpu-Update-xstate-s-PKRU-value-on-write_pkru.patch +++ b/debian/patches-rt/0019-x86-fpu-Update-xstate-s-PKRU-value-on-write_pkru.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 19 Oct 2018 23:50:27 +0200 Subject: [PATCH 19/27] x86/fpu: Update xstate's PKRU value on write_pkru() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz During the context switch the xstate is loaded which also includes the PKRU value. diff --git a/debian/patches-rt/0020-serial-8250-implement-write_atomic.patch b/debian/patches-rt/0020-serial-8250-implement-write_atomic.patch index 0201b80a4..0a153748f 100644 --- a/debian/patches-rt/0020-serial-8250-implement-write_atomic.patch +++ b/debian/patches-rt/0020-serial-8250-implement-write_atomic.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:29:58 +0100 Subject: [PATCH 20/25] serial: 8250: implement write_atomic -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Implement a non-sleeping NMI-safe write_atomic console function in order to support emergency printk messages. diff --git a/debian/patches-rt/0020-x86-fpu-Inline-copy_user_to_fpregs_zeroing.patch b/debian/patches-rt/0020-x86-fpu-Inline-copy_user_to_fpregs_zeroing.patch index a12e24c1e..bab5d6bab 100644 --- a/debian/patches-rt/0020-x86-fpu-Inline-copy_user_to_fpregs_zeroing.patch +++ b/debian/patches-rt/0020-x86-fpu-Inline-copy_user_to_fpregs_zeroing.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 7 Nov 2018 15:06:06 +0100 Subject: [PATCH 20/27] x86/fpu: Inline copy_user_to_fpregs_zeroing() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Start refactoring __fpu__restore_sig() by inlining copy_user_to_fpregs_zeroing(). The orignal function remains and will be diff --git a/debian/patches-rt/0021-printk-implement-KERN_CONT.patch b/debian/patches-rt/0021-printk-implement-KERN_CONT.patch index bb713e1dd..fe2be0051 100644 --- a/debian/patches-rt/0021-printk-implement-KERN_CONT.patch +++ b/debian/patches-rt/0021-printk-implement-KERN_CONT.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:29:59 +0100 Subject: [PATCH 21/25] printk: implement KERN_CONT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Implement KERN_CONT based on the printing CPU rather than on the printing task. As long as the KERN_CONT messages are coming from the diff --git a/debian/patches-rt/0021-x86-fpu-Let-__fpu__restore_sig-restore-the-32bit-fxs.patch b/debian/patches-rt/0021-x86-fpu-Let-__fpu__restore_sig-restore-the-32bit-fxs.patch index a3ab714ce..8f43994f5 100644 --- a/debian/patches-rt/0021-x86-fpu-Let-__fpu__restore_sig-restore-the-32bit-fxs.patch +++ b/debian/patches-rt/0021-x86-fpu-Let-__fpu__restore_sig-restore-the-32bit-fxs.patch @@ -5,7 +5,7 @@ Subject: [PATCH 21/27] x86/fpu: Let __fpu__restore_sig() restore the MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The !32bit+fxsr case loads the new state from user memory. In case we restore the FPU state on return to userland we can't do this. It would diff --git a/debian/patches-rt/0022-printk-implement-dev-kmsg.patch b/debian/patches-rt/0022-printk-implement-dev-kmsg.patch index f20ac5eff..09b21ff4e 100644 --- a/debian/patches-rt/0022-printk-implement-dev-kmsg.patch +++ b/debian/patches-rt/0022-printk-implement-dev-kmsg.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:30:00 +0100 Subject: [PATCH 22/25] printk: implement /dev/kmsg -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Since printk messages are now logged to a new ring buffer, update the /dev/kmsg functions to pull the messages from there. diff --git a/debian/patches-rt/0022-x86-fpu-Merge-the-two-code-paths-in-__fpu__restore_s.patch b/debian/patches-rt/0022-x86-fpu-Merge-the-two-code-paths-in-__fpu__restore_s.patch index 7e2d98efe..84889e202 100644 --- a/debian/patches-rt/0022-x86-fpu-Merge-the-two-code-paths-in-__fpu__restore_s.patch +++ b/debian/patches-rt/0022-x86-fpu-Merge-the-two-code-paths-in-__fpu__restore_s.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Tue, 27 Nov 2018 21:08:01 +0100 Subject: [PATCH 22/27] x86/fpu: Merge the two code paths in __fpu__restore_sig() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The ia32_fxstate case (32bit with fxsr) and the other (64bit, 32bit without fxsr) restore both from kernel memory and sanitize the content. diff --git a/debian/patches-rt/0023-printk-implement-syslog.patch b/debian/patches-rt/0023-printk-implement-syslog.patch index 0eb52c270..95321e759 100644 --- a/debian/patches-rt/0023-printk-implement-syslog.patch +++ b/debian/patches-rt/0023-printk-implement-syslog.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:30:01 +0100 Subject: [PATCH 23/25] printk: implement syslog -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Since printk messages are now logged to a new ring buffer, update the syslog functions to pull the messages from there. diff --git a/debian/patches-rt/0023-x86-fpu-Defer-FPU-state-load-until-return-to-userspa.patch b/debian/patches-rt/0023-x86-fpu-Defer-FPU-state-load-until-return-to-userspa.patch index 58c987961..a0b30e568 100644 --- a/debian/patches-rt/0023-x86-fpu-Defer-FPU-state-load-until-return-to-userspa.patch +++ b/debian/patches-rt/0023-x86-fpu-Defer-FPU-state-load-until-return-to-userspa.patch @@ -1,7 +1,7 @@ From: Rik van Riel Date: Sun, 9 Sep 2018 18:30:53 +0200 Subject: [PATCH 23/27] x86/fpu: Defer FPU state load until return to userspace -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Defer loading of FPU state until return to userspace. This gives the kernel the potential to skip loading FPU state for tasks that @@ -554,7 +554,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (unlikely(vcpu->arch.switch_db_regs)) { set_debugreg(0, 7); set_debugreg(vcpu->arch.eff_db[0], 0); -@@ -8128,22 +8132,30 @@ static int complete_emulated_mmio(struct +@@ -8126,22 +8130,30 @@ static int complete_emulated_mmio(struct /* Swap (qemu) user FPU context for the guest FPU context. */ static void kvm_load_guest_fpu(struct kvm_vcpu *vcpu) { diff --git a/debian/patches-rt/0024-printk-implement-kmsg_dump.patch b/debian/patches-rt/0024-printk-implement-kmsg_dump.patch index 401ad38cf..35bb5effb 100644 --- a/debian/patches-rt/0024-printk-implement-kmsg_dump.patch +++ b/debian/patches-rt/0024-printk-implement-kmsg_dump.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:30:02 +0100 Subject: [PATCH 24/25] printk: implement kmsg_dump -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Since printk messages are now logged to a new ring buffer, update the kmsg_dump functions to pull the messages from there. diff --git a/debian/patches-rt/0024-x86-fpu-Add-a-fastpath-to-__fpu__restore_sig.patch b/debian/patches-rt/0024-x86-fpu-Add-a-fastpath-to-__fpu__restore_sig.patch index 1b5a8d71f..11691160a 100644 --- a/debian/patches-rt/0024-x86-fpu-Add-a-fastpath-to-__fpu__restore_sig.patch +++ b/debian/patches-rt/0024-x86-fpu-Add-a-fastpath-to-__fpu__restore_sig.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Tue, 2 Apr 2019 13:02:25 +0200 Subject: [PATCH 24/27] x86/fpu: Add a fastpath to __fpu__restore_sig() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The previous commits refactor the restoration of the FPU registers so that they can be loaded from in-kernel memory. This overhead can be diff --git a/debian/patches-rt/0025-printk-remove-unused-code.patch b/debian/patches-rt/0025-printk-remove-unused-code.patch index 6b817723f..721617d8f 100644 --- a/debian/patches-rt/0025-printk-remove-unused-code.patch +++ b/debian/patches-rt/0025-printk-remove-unused-code.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:30:03 +0100 Subject: [PATCH 25/25] printk: remove unused code -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Code relating to the safe context and anything dealing with the previous log buffer implementation is no longer in use. Remove it. diff --git a/debian/patches-rt/0025-x86-fpu-Add-a-fastpath-to-copy_fpstate_to_sigframe.patch b/debian/patches-rt/0025-x86-fpu-Add-a-fastpath-to-copy_fpstate_to_sigframe.patch index 834d6a416..3d4f1df09 100644 --- a/debian/patches-rt/0025-x86-fpu-Add-a-fastpath-to-copy_fpstate_to_sigframe.patch +++ b/debian/patches-rt/0025-x86-fpu-Add-a-fastpath-to-copy_fpstate_to_sigframe.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 3 Apr 2019 15:59:12 +0200 Subject: [PATCH 25/27] x86/fpu: Add a fastpath to copy_fpstate_to_sigframe() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz If the CPU holds the FPU register for the current task then we can try to save them directly to the userland stack frame. This has to be done with the diff --git a/debian/patches-rt/0026-x86-fpu-Restore-FPU-register-in-copy_fpstate_to_sigf.patch b/debian/patches-rt/0026-x86-fpu-Restore-FPU-register-in-copy_fpstate_to_sigf.patch index 5c5ecbca2..b2e94d328 100644 --- a/debian/patches-rt/0026-x86-fpu-Restore-FPU-register-in-copy_fpstate_to_sigf.patch +++ b/debian/patches-rt/0026-x86-fpu-Restore-FPU-register-in-copy_fpstate_to_sigf.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 3 Apr 2019 15:59:13 +0200 Subject: [PATCH 26/27] x86/fpu: Restore FPU register in copy_fpstate_to_sigframe() in order to use the fastpath -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz If a task is scheduled out and receives a signal then it won't be able to take the fastpath because the register aren't available. The slowpath is more diff --git a/debian/patches-rt/0027-x86-pkeys-add-PKRU-value-to-init_fpstate.patch b/debian/patches-rt/0027-x86-pkeys-add-PKRU-value-to-init_fpstate.patch index 5ddd56422..6995613e9 100644 --- a/debian/patches-rt/0027-x86-pkeys-add-PKRU-value-to-init_fpstate.patch +++ b/debian/patches-rt/0027-x86-pkeys-add-PKRU-value-to-init_fpstate.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 21 Mar 2019 17:24:27 +0100 Subject: [PATCH 27/27] x86/pkeys: add PKRU value to init_fpstate -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The task's initiall PKRU value is set part for fpu__clear()/ copy_init_pkru_to_fpregs(). It is not part of init_fpstate.xsave and diff --git a/debian/patches-rt/0028-x86-fpu-Fault-in-user-stack-if-copy_fpstate_to_sigfr.patch b/debian/patches-rt/0028-x86-fpu-Fault-in-user-stack-if-copy_fpstate_to_sigfr.patch new file mode 100644 index 000000000..5e3e058c0 --- /dev/null +++ b/debian/patches-rt/0028-x86-fpu-Fault-in-user-stack-if-copy_fpstate_to_sigfr.patch @@ -0,0 +1,105 @@ +From: Sebastian Andrzej Siewior +Date: Mon, 29 Apr 2019 18:39:53 +0200 +Subject: [PATCH] x86/fpu: Fault-in user stack if copy_fpstate_to_sigframe() + fails +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz + +In the compacted form, XSAVES may save only the XMM+SSE state but skip +FP (x87 state). + +This is denoted by header->xfeatures = 6. The fastpath +(copy_fpregs_to_sigframe()) does that but _also_ initialises the FP +state (cwd to 0x37f, mxcsr as we do, remaining fields to 0). + +The slowpath (copy_xstate_to_user()) leaves most of the FP +state untouched. Only mxcsr and mxcsr_flags are set due to +xfeatures_mxcsr_quirk(). Now that XFEATURE_MASK_FP is set +unconditionally, see + + 04944b793e18 ("x86: xsave: set FP, SSE bits in the xsave header in the user sigcontext"), + +on return from the signal, random garbage is loaded as the FP state. + +Instead of utilizing copy_xstate_to_user(), fault-in the user memory +and retry the fast path. Ideally, the fast path succeeds on the second +attempt but may be retried again if the memory is swapped out due +to memory pressure. If the user memory can not be faulted-in then +get_user_pages() returns an error so we don't loop forever. + +Fault in memory via get_user_pages() so copy_fpregs_to_sigframe() +succeeds without a fault. + +Fixes: 69277c98f5eef ("x86/fpu: Always store the registers in copy_fpstate_to_sigframe()") +Reported-by: Kurt Kanzenbach +Suggested-by: Dave Hansen +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Borislav Petkov +Acked-by: Thomas Gleixner +Cc: Andy Lutomirski +Cc: Dave Hansen +Cc: "H. Peter Anvin" +Cc: Ingo Molnar +Cc: Jann Horn +Cc: Jason@zx2c4.com +Cc: kvm ML +Cc: Paolo Bonzini +Cc: Rik van Riel +Cc: rkrcmar@redhat.com +Cc: x86-ml +Link: https://lkml.kernel.org/r/20190429163953.gqxgsc5okqxp4olv@linutronix.de +--- + arch/x86/kernel/fpu/signal.c | 25 ++++++++++++++----------- + 1 file changed, 14 insertions(+), 11 deletions(-) + +--- a/arch/x86/kernel/fpu/signal.c ++++ b/arch/x86/kernel/fpu/signal.c +@@ -158,7 +158,6 @@ static inline int copy_fpregs_to_sigfram + int copy_fpstate_to_sigframe(void __user *buf, void __user *buf_fx, int size) + { + struct fpu *fpu = ¤t->thread.fpu; +- struct xregs_state *xsave = &fpu->state.xsave; + struct task_struct *tsk = current; + int ia32_fxstate = (buf != buf_fx); + int ret = -EFAULT; +@@ -174,12 +173,13 @@ int copy_fpstate_to_sigframe(void __user + sizeof(struct user_i387_ia32_struct), NULL, + (struct _fpstate_32 __user *) buf) ? -1 : 1; + ++retry: + fpregs_lock(); + /* + * Load the FPU register if they are not valid for the current task. + * With a valid FPU state we can attempt to save the state directly to +- * userland's stack frame which will likely succeed. If it does not, do +- * the slowpath. ++ * userland's stack frame which will likely succeed. If it does not, ++ * resolve the fault in the user memory and try again. + */ + if (test_thread_flag(TIF_NEED_FPU_LOAD)) + __fpregs_load_activate(); +@@ -193,14 +193,17 @@ int copy_fpstate_to_sigframe(void __user + fpregs_unlock(); + + if (ret) { +- if (using_compacted_format()) { +- if (copy_xstate_to_user(buf_fx, xsave, 0, size)) +- return -1; +- } else { +- fpstate_sanitize_xstate(fpu); +- if (__copy_to_user(buf_fx, xsave, fpu_user_xstate_size)) +- return -1; +- } ++ int aligned_size; ++ int nr_pages; ++ ++ aligned_size = offset_in_page(buf_fx) + fpu_user_xstate_size; ++ nr_pages = DIV_ROUND_UP(aligned_size, PAGE_SIZE); ++ ++ ret = get_user_pages((unsigned long)buf_fx, nr_pages, ++ FOLL_WRITE, NULL, NULL); ++ if (ret == nr_pages) ++ goto retry; ++ return -EFAULT; + } + + /* Save the fsave header for the 32-bit frames. */ diff --git a/debian/patches-rt/0029-x86-fpu-Remove-unnecessary-saving-of-FPU-registers-i.patch b/debian/patches-rt/0029-x86-fpu-Remove-unnecessary-saving-of-FPU-registers-i.patch new file mode 100644 index 000000000..9749a3a67 --- /dev/null +++ b/debian/patches-rt/0029-x86-fpu-Remove-unnecessary-saving-of-FPU-registers-i.patch @@ -0,0 +1,67 @@ +From: Sebastian Andrzej Siewior +Date: Tue, 30 Apr 2019 10:31:26 +0200 +Subject: [PATCH] x86/fpu: Remove unnecessary saving of FPU registers in + copy_fpstate_to_sigframe() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz + +Since commit: + + eeec00d73be2e ("x86/fpu: Fault-in user stack if copy_fpstate_to_sigframe() fails") + +there is no need to have FPU registers saved if +copy_fpregs_to_sigframe() fails, because we retry it after we resolved +the fault condition. + +Saving the registers is not wrong but it is not necessary and it forces us +to load the FPU registers on the retry attempt. + +Don't save the FPU registers if copy_fpstate_to_sigframe() fails. + +Signed-off-by: Sebastian Andrzej Siewior +Cc: Andy Lutomirski +Cc: Borislav Petkov +Cc: Dave Hansen +Cc: Fenghua Yu +Cc: H. Peter Anvin +Cc: Jason@zx2c4.com +Cc: Linus Torvalds +Cc: Oleg Nesterov +Cc: Peter Zijlstra +Cc: Thomas Gleixner +Cc: bp@suse.de +Cc: jannh@google.com +Cc: kurt.kanzenbach@linutronix.de +Cc: kvm@vger.kernel.org +Cc: pbonzini@redhat.com +Cc: riel@surriel.com +Cc: rkrcmar@redhat.com +Link: http://lkml.kernel.org/r/20190430083126.rilbb76yc27vrem5@linutronix.de +Signed-off-by: Ingo Molnar +--- + arch/x86/kernel/fpu/signal.c | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +--- a/arch/x86/kernel/fpu/signal.c ++++ b/arch/x86/kernel/fpu/signal.c +@@ -157,10 +157,9 @@ static inline int copy_fpregs_to_sigfram + */ + int copy_fpstate_to_sigframe(void __user *buf, void __user *buf_fx, int size) + { +- struct fpu *fpu = ¤t->thread.fpu; + struct task_struct *tsk = current; + int ia32_fxstate = (buf != buf_fx); +- int ret = -EFAULT; ++ int ret; + + ia32_fxstate &= (IS_ENABLED(CONFIG_X86_32) || + IS_ENABLED(CONFIG_IA32_EMULATION)); +@@ -187,9 +186,6 @@ int copy_fpstate_to_sigframe(void __user + pagefault_disable(); + ret = copy_fpregs_to_sigframe(buf_fx); + pagefault_enable(); +- if (ret && !test_thread_flag(TIF_NEED_FPU_LOAD)) +- copy_fpregs_to_fpstate(fpu); +- set_thread_flag(TIF_NEED_FPU_LOAD); + fpregs_unlock(); + + if (ret) { diff --git a/debian/patches-rt/ARM-enable-irq-in-translation-section-permission-fau.patch b/debian/patches-rt/ARM-enable-irq-in-translation-section-permission-fau.patch index 190bd6d3d..4cffc970f 100644 --- a/debian/patches-rt/ARM-enable-irq-in-translation-section-permission-fau.patch +++ b/debian/patches-rt/ARM-enable-irq-in-translation-section-permission-fau.patch @@ -1,7 +1,7 @@ From: "Yadi.hu" Date: Wed, 10 Dec 2014 10:32:09 +0800 Subject: ARM: enable irq in translation/section permission fault handlers -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Probably happens on all ARM, with CONFIG_PREEMPT_RT_FULL diff --git a/debian/patches-rt/Drivers-hv-vmbus-include-header-for-get_irq_regs.patch b/debian/patches-rt/Drivers-hv-vmbus-include-header-for-get_irq_regs.patch index 1fa13900f..560d10b7c 100644 --- a/debian/patches-rt/Drivers-hv-vmbus-include-header-for-get_irq_regs.patch +++ b/debian/patches-rt/Drivers-hv-vmbus-include-header-for-get_irq_regs.patch @@ -4,7 +4,7 @@ Subject: [PATCH] Drivers: hv: vmbus: include header for get_irq_regs() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz On !RT the header file get_irq_regs() gets pulled in via other header files. On RT it does not and the build fails: diff --git a/debian/patches-rt/EXP-rcu-skip_workqueue.patch b/debian/patches-rt/EXP-rcu-skip_workqueue.patch index efdfa6417..04b56aaab 100644 --- a/debian/patches-rt/EXP-rcu-skip_workqueue.patch +++ b/debian/patches-rt/EXP-rcu-skip_workqueue.patch @@ -1,7 +1,7 @@ From: Paul E. McKenney Date: Mon, 29 Oct 2018 11:53:01 +0100 Subject: [PATCH] EXP rcu: skip the workqueue path on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The function sync_rcu_exp_select_cpus() is only invoked once on boot because the "force expedite" is not enabled on RT. In that case on RT we have like we diff --git a/debian/patches-rt/KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch b/debian/patches-rt/KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch index 84ba9a51e..8216eb5ec 100644 --- a/debian/patches-rt/KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch +++ b/debian/patches-rt/KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch @@ -1,7 +1,7 @@ From: Josh Cartwright Date: Thu, 11 Feb 2016 11:54:01 -0600 Subject: KVM: arm/arm64: downgrade preempt_disable()d region to migrate_disable() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz kvm_arch_vcpu_ioctl_run() disables the use of preemption when updating the vgic and timer states to prevent the calling task from migrating to diff --git a/debian/patches-rt/NFSv4-replace-seqcount_t-with-a-seqlock_t.patch b/debian/patches-rt/NFSv4-replace-seqcount_t-with-a-seqlock_t.patch index 382c03a93..7b7049d7a 100644 --- a/debian/patches-rt/NFSv4-replace-seqcount_t-with-a-seqlock_t.patch +++ b/debian/patches-rt/NFSv4-replace-seqcount_t-with-a-seqlock_t.patch @@ -5,7 +5,7 @@ Cc: Anna Schumaker , linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de Subject: NFSv4: replace seqcount_t with a seqlock_t -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The raw_write_seqcount_begin() in nfs4_reclaim_open_state() bugs me because it maps to preempt_disable() in -RT which I can't have at this diff --git a/debian/patches-rt/add_migrate_disable.patch b/debian/patches-rt/add_migrate_disable.patch index f3a15eb88..474f574ef 100644 --- a/debian/patches-rt/add_migrate_disable.patch +++ b/debian/patches-rt/add_migrate_disable.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Sat, 27 May 2017 19:02:06 +0200 Subject: kernel/sched/core: add migrate_disable() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz --- include/linux/preempt.h | 23 ++++++++ diff --git a/debian/patches-rt/apparmor-use-a-locallock-instead-preempt_disable.patch b/debian/patches-rt/apparmor-use-a-locallock-instead-preempt_disable.patch index 45fa05969..7a4f992eb 100644 --- a/debian/patches-rt/apparmor-use-a-locallock-instead-preempt_disable.patch +++ b/debian/patches-rt/apparmor-use-a-locallock-instead-preempt_disable.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 11 Oct 2017 17:43:49 +0200 Subject: apparmor: use a locallock instead preempt_disable() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz get_buffers() disables preemption which acts as a lock for the per-CPU variable. Since we can't disable preemption here on RT, a local_lock is diff --git a/debian/patches-rt/arch-arm64-Add-lazy-preempt-support.patch b/debian/patches-rt/arch-arm64-Add-lazy-preempt-support.patch index 21ce2958e..f44679a13 100644 --- a/debian/patches-rt/arch-arm64-Add-lazy-preempt-support.patch +++ b/debian/patches-rt/arch-arm64-Add-lazy-preempt-support.patch @@ -1,7 +1,7 @@ From: Anders Roxell Date: Thu, 14 May 2015 17:52:17 +0200 Subject: arch/arm64: Add lazy preempt support -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz arm64 is missing support for PREEMPT_RT. The main feature which is lacking is support for lazy preemption. The arch-specific entry code, diff --git a/debian/patches-rt/arm-disable-NEON-in-kernel-mode.patch b/debian/patches-rt/arm-disable-NEON-in-kernel-mode.patch index bd8b7b602..b4becf160 100644 --- a/debian/patches-rt/arm-disable-NEON-in-kernel-mode.patch +++ b/debian/patches-rt/arm-disable-NEON-in-kernel-mode.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 1 Dec 2017 10:42:03 +0100 Subject: [PATCH] arm*: disable NEON in kernel mode -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz NEON in kernel mode is used by the crypto algorithms and raid6 code. While the raid6 code looks okay, the crypto algorithms do not: NEON diff --git a/debian/patches-rt/arm-enable-highmem-for-rt.patch b/debian/patches-rt/arm-enable-highmem-for-rt.patch index 51e2cd709..8ce184c9d 100644 --- a/debian/patches-rt/arm-enable-highmem-for-rt.patch +++ b/debian/patches-rt/arm-enable-highmem-for-rt.patch @@ -1,7 +1,7 @@ Subject: arm: Enable highmem for rt From: Thomas Gleixner Date: Wed, 13 Feb 2013 11:03:11 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz fixup highmem for ARM. diff --git a/debian/patches-rt/arm-highmem-flush-tlb-on-unmap.patch b/debian/patches-rt/arm-highmem-flush-tlb-on-unmap.patch index 8d6a36960..e5d57856b 100644 --- a/debian/patches-rt/arm-highmem-flush-tlb-on-unmap.patch +++ b/debian/patches-rt/arm-highmem-flush-tlb-on-unmap.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Mon, 11 Mar 2013 21:37:27 +0100 Subject: arm/highmem: Flush tlb on unmap -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The tlb should be flushed on unmap and thus make the mapping entry invalid. This is only done in the non-debug case which does not look diff --git a/debian/patches-rt/arm-include-definition-for-cpumask_t.patch b/debian/patches-rt/arm-include-definition-for-cpumask_t.patch index d4954802e..2c46f6820 100644 --- a/debian/patches-rt/arm-include-definition-for-cpumask_t.patch +++ b/debian/patches-rt/arm-include-definition-for-cpumask_t.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 22 Dec 2016 17:28:33 +0100 Subject: [PATCH] arm: include definition for cpumask_t -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz This definition gets pulled in by other files. With the (later) split of RCU and spinlock.h it won't compile anymore. diff --git a/debian/patches-rt/arm-kprobe-replace-patch_lock-to-raw-lock.patch b/debian/patches-rt/arm-kprobe-replace-patch_lock-to-raw-lock.patch deleted file mode 100644 index d30f16ca8..000000000 --- a/debian/patches-rt/arm-kprobe-replace-patch_lock-to-raw-lock.patch +++ /dev/null @@ -1,70 +0,0 @@ -From: Yang Shi -Date: Thu, 10 Nov 2016 16:17:55 -0800 -Subject: [PATCH] arm: kprobe: replace patch_lock to raw lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz - -When running kprobe on -rt kernel, the below bug is caught: - -BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:931 -in_atomic(): 1, irqs_disabled(): 128, pid: 14, name: migration/0 -INFO: lockdep is turned off. -irq event stamp: 238 -hardirqs last enabled at (237): [<80b5aecc>] _raw_spin_unlock_irqrestore+0x88/0x90 -hardirqs last disabled at (238): [<80b56d88>] __schedule+0xec/0x94c -softirqs last enabled at (0): [<80225584>] copy_process.part.5+0x30c/0x1994 -softirqs last disabled at (0): [< (null)>] (null) -Preemption disabled at:[<802f2b98>] cpu_stopper_thread+0xc0/0x140 - -CPU: 0 PID: 14 Comm: migration/0 Tainted: G O 4.8.3-rt2 #1 -Hardware name: Freescale LS1021A -[<80212e7c>] (unwind_backtrace) from [<8020cd2c>] (show_stack+0x20/0x24) -[<8020cd2c>] (show_stack) from [<80689e14>] (dump_stack+0xa0/0xcc) -[<80689e14>] (dump_stack) from [<8025a43c>] (___might_sleep+0x1b8/0x2a4) -[<8025a43c>] (___might_sleep) from [<80b5b324>] (rt_spin_lock+0x34/0x74) -[<80b5b324>] (rt_spin_lock) from [<80b5c31c>] (__patch_text_real+0x70/0xe8) -[<80b5c31c>] (__patch_text_real) from [<80b5c3ac>] (patch_text_stop_machine+0x18/0x20) -[<80b5c3ac>] (patch_text_stop_machine) from [<802f2920>] (multi_cpu_stop+0xfc/0x134) -[<802f2920>] (multi_cpu_stop) from [<802f2ba0>] (cpu_stopper_thread+0xc8/0x140) -[<802f2ba0>] (cpu_stopper_thread) from [<802563a4>] (smpboot_thread_fn+0x1a4/0x354) -[<802563a4>] (smpboot_thread_fn) from [<80251d38>] (kthread+0x104/0x11c) -[<80251d38>] (kthread) from [<80207f70>] (ret_from_fork+0x14/0x24) - -Since patch_text_stop_machine() is called in stop_machine() which disables IRQ, -sleepable lock should be not used in this atomic context, so replace patch_lock -to raw lock. - -Signed-off-by: Yang Shi -Signed-off-by: Sebastian Andrzej Siewior ---- - arch/arm/kernel/patch.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - ---- a/arch/arm/kernel/patch.c -+++ b/arch/arm/kernel/patch.c -@@ -16,7 +16,7 @@ struct patch { - unsigned int insn; - }; - --static DEFINE_SPINLOCK(patch_lock); -+static DEFINE_RAW_SPINLOCK(patch_lock); - - static void __kprobes *patch_map(void *addr, int fixmap, unsigned long *flags) - __acquires(&patch_lock) -@@ -33,7 +33,7 @@ static void __kprobes *patch_map(void *a - return addr; - - if (flags) -- spin_lock_irqsave(&patch_lock, *flags); -+ raw_spin_lock_irqsave(&patch_lock, *flags); - else - __acquire(&patch_lock); - -@@ -48,7 +48,7 @@ static void __kprobes patch_unmap(int fi - clear_fixmap(fixmap); - - if (flags) -- spin_unlock_irqrestore(&patch_lock, *flags); -+ raw_spin_unlock_irqrestore(&patch_lock, *flags); - else - __release(&patch_lock); - } diff --git a/debian/patches-rt/arm-preempt-lazy-support.patch b/debian/patches-rt/arm-preempt-lazy-support.patch index 0adf902ef..6cf830683 100644 --- a/debian/patches-rt/arm-preempt-lazy-support.patch +++ b/debian/patches-rt/arm-preempt-lazy-support.patch @@ -1,7 +1,7 @@ Subject: arm: Add support for lazy preemption From: Thomas Gleixner Date: Wed, 31 Oct 2012 12:04:11 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Implement the arm pieces for lazy preempt. diff --git a/debian/patches-rt/arm-remove-printk_nmi_.patch b/debian/patches-rt/arm-remove-printk_nmi_.patch index 16d97fe00..3fd7e09a0 100644 --- a/debian/patches-rt/arm-remove-printk_nmi_.patch +++ b/debian/patches-rt/arm-remove-printk_nmi_.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 15 Feb 2019 14:34:20 +0100 Subject: [PATCH] arm: remove printk_nmi_.*() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz It is no longer provided by the printk core code. diff --git a/debian/patches-rt/arm64-KVM-compute_layout-before-altenates-are-applie.patch b/debian/patches-rt/arm64-KVM-compute_layout-before-altenates-are-applie.patch index 02599af91..bcbb85923 100644 --- a/debian/patches-rt/arm64-KVM-compute_layout-before-altenates-are-applie.patch +++ b/debian/patches-rt/arm64-KVM-compute_layout-before-altenates-are-applie.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 26 Jul 2018 09:13:42 +0200 Subject: [PATCH] arm64: KVM: compute_layout before altenates are applied -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz compute_layout() is invoked as part of an alternative fixup under stop_machine() and needs a sleeping lock as part of get_random_long(). diff --git a/debian/patches-rt/arm64-fpsimd-use-preemp_disable-in-addition-to-local.patch b/debian/patches-rt/arm64-fpsimd-use-preemp_disable-in-addition-to-local.patch index b680582b6..e37cd5f6a 100644 --- a/debian/patches-rt/arm64-fpsimd-use-preemp_disable-in-addition-to-local.patch +++ b/debian/patches-rt/arm64-fpsimd-use-preemp_disable-in-addition-to-local.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 25 Jul 2018 14:02:38 +0200 Subject: [PATCH] arm64: fpsimd: use preemp_disable in addition to local_bh_disable() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz In v4.16-RT I noticed a number of warnings from task_fpsimd_load(). The code disables BH and expects that it is not preemptible. On -RT the diff --git a/debian/patches-rt/at91_dont_enable_disable_clock.patch b/debian/patches-rt/at91_dont_enable_disable_clock.patch index 2bb374a21..c5e20c755 100644 --- a/debian/patches-rt/at91_dont_enable_disable_clock.patch +++ b/debian/patches-rt/at91_dont_enable_disable_clock.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 09 Mar 2016 10:51:06 +0100 Subject: arm: at91: do not disable/enable clocks in a row -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Currently the driver will disable the clock and enable it one line later if it is switching from periodic mode into one shot. diff --git a/debian/patches-rt/block-blk-mq-move-blk_queue_usage_counter_release-in.patch b/debian/patches-rt/block-blk-mq-move-blk_queue_usage_counter_release-in.patch index 6fa2e9d80..4b81dfe8a 100644 --- a/debian/patches-rt/block-blk-mq-move-blk_queue_usage_counter_release-in.patch +++ b/debian/patches-rt/block-blk-mq-move-blk_queue_usage_counter_release-in.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Tue, 13 Mar 2018 13:49:16 +0100 Subject: [PATCH] block: blk-mq: move blk_queue_usage_counter_release() into process context -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz | BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:914 | in_atomic(): 1, irqs_disabled(): 0, pid: 255, name: kworker/u257:6 diff --git a/debian/patches-rt/block-mq-don-t-complete-requests-via-IPI.patch b/debian/patches-rt/block-mq-don-t-complete-requests-via-IPI.patch index 8bfc47a8c..aaa0ad678 100644 --- a/debian/patches-rt/block-mq-don-t-complete-requests-via-IPI.patch +++ b/debian/patches-rt/block-mq-don-t-complete-requests-via-IPI.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 29 Jan 2015 15:10:08 +0100 Subject: block/mq: don't complete requests via IPI -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The IPI runs in hardirq context and there are sleeping locks. Assume caches are shared and complete them on the local CPU. diff --git a/debian/patches-rt/block-mq-drop-preempt-disable.patch b/debian/patches-rt/block-mq-drop-preempt-disable.patch index 94ee624f8..ed61c2bf2 100644 --- a/debian/patches-rt/block-mq-drop-preempt-disable.patch +++ b/debian/patches-rt/block-mq-drop-preempt-disable.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Tue, 14 Jul 2015 14:26:34 +0200 Subject: block/mq: do not invoke preempt_disable() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz preempt_disable() and get_cpu() don't play well together with the sleeping locks it tries to allocate later. diff --git a/debian/patches-rt/block-mq-use-cpu_light.patch b/debian/patches-rt/block-mq-use-cpu_light.patch index 013a3485f..a757ad3b2 100644 --- a/debian/patches-rt/block-mq-use-cpu_light.patch +++ b/debian/patches-rt/block-mq-use-cpu_light.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 9 Apr 2014 10:37:23 +0200 Subject: block: mq: use cpu_light() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz there is a might sleep splat because get_cpu() disables preemption and later we grab a lock. As a workaround for this we use get_cpu_light(). @@ -13,7 +13,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/block/blk-mq.h +++ b/block/blk-mq.h -@@ -153,12 +153,12 @@ static inline struct blk_mq_ctx *__blk_m +@@ -151,12 +151,12 @@ static inline struct blk_mq_ctx *__blk_m */ static inline struct blk_mq_ctx *blk_mq_get_ctx(struct request_queue *q) { diff --git a/debian/patches-rt/block-use-cpu-chill.patch b/debian/patches-rt/block-use-cpu-chill.patch index 846be4bea..ed17fc9a9 100644 --- a/debian/patches-rt/block-use-cpu-chill.patch +++ b/debian/patches-rt/block-use-cpu-chill.patch @@ -1,7 +1,7 @@ Subject: block: Use cpu_chill() for retry loops From: Thomas Gleixner Date: Thu, 20 Dec 2012 18:28:26 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Retry loops on RT might loop forever when the modifying side was preempted. Steven also observed a live lock when there was a diff --git a/debian/patches-rt/cgroup-use-irqsave-in-cgroup_rstat_flush_locked.patch b/debian/patches-rt/cgroup-use-irqsave-in-cgroup_rstat_flush_locked.patch index 8ef4062ac..2534034e3 100644 --- a/debian/patches-rt/cgroup-use-irqsave-in-cgroup_rstat_flush_locked.patch +++ b/debian/patches-rt/cgroup-use-irqsave-in-cgroup_rstat_flush_locked.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Tue, 3 Jul 2018 18:19:48 +0200 Subject: [PATCH] cgroup: use irqsave in cgroup_rstat_flush_locked() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz All callers of cgroup_rstat_flush_locked() acquire cgroup_rstat_lock either with spin_lock_irq() or spin_lock_irqsave(). diff --git a/debian/patches-rt/cgroups-use-simple-wait-in-css_release.patch b/debian/patches-rt/cgroups-use-simple-wait-in-css_release.patch index fe06ce1a1..8d66b4122 100644 --- a/debian/patches-rt/cgroups-use-simple-wait-in-css_release.patch +++ b/debian/patches-rt/cgroups-use-simple-wait-in-css_release.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 13 Feb 2015 15:52:24 +0100 Subject: cgroups: use simple wait in css_release() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz To avoid: |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:914 diff --git a/debian/patches-rt/clocksource-tclib-allow-higher-clockrates.patch b/debian/patches-rt/clocksource-tclib-allow-higher-clockrates.patch index a8b398047..3cab457a4 100644 --- a/debian/patches-rt/clocksource-tclib-allow-higher-clockrates.patch +++ b/debian/patches-rt/clocksource-tclib-allow-higher-clockrates.patch @@ -1,7 +1,7 @@ From: Benedikt Spranger Date: Mon, 8 Mar 2010 18:57:04 +0100 Subject: clocksource: TCLIB: Allow higher clock rates for clock events -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz As default the TCLIB uses the 32KiHz base clock rate for clock events. Add a compile time selection to allow higher clock resulution. @@ -132,7 +132,7 @@ Signed-off-by: Thomas Gleixner return ret; } -@@ -474,7 +476,11 @@ static int __init tcb_clksrc_init(struct +@@ -477,7 +479,11 @@ static int __init tcb_clksrc_init(struct goto err_disable_t1; /* channel 2: periodic and oneshot timer support */ diff --git a/debian/patches-rt/completion-use-simple-wait-queues.patch b/debian/patches-rt/completion-use-simple-wait-queues.patch index ba5969828..ae7307097 100644 --- a/debian/patches-rt/completion-use-simple-wait-queues.patch +++ b/debian/patches-rt/completion-use-simple-wait-queues.patch @@ -1,7 +1,7 @@ Subject: completion: Use simple wait queues From: Thomas Gleixner Date: Fri, 11 Jan 2013 11:23:51 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Completions have no long lasting callbacks and therefor do not need the complex waitqueue variant. Use simple waitqueues which reduces the diff --git a/debian/patches-rt/cond-resched-lock-rt-tweak.patch b/debian/patches-rt/cond-resched-lock-rt-tweak.patch index 5c7334f0e..3a75143ee 100644 --- a/debian/patches-rt/cond-resched-lock-rt-tweak.patch +++ b/debian/patches-rt/cond-resched-lock-rt-tweak.patch @@ -1,7 +1,7 @@ Subject: sched: Use the proper LOCK_OFFSET for cond_resched() From: Thomas Gleixner Date: Sun, 17 Jul 2011 22:51:33 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz RT does not increment preempt count when a 'sleeping' spinlock is locked. Update PREEMPT_LOCK_OFFSET for that case. diff --git a/debian/patches-rt/connector-cn_proc-Protect-send_msg-with-a-local-lock.patch b/debian/patches-rt/connector-cn_proc-Protect-send_msg-with-a-local-lock.patch index f2f067b2b..4d43347db 100644 --- a/debian/patches-rt/connector-cn_proc-Protect-send_msg-with-a-local-lock.patch +++ b/debian/patches-rt/connector-cn_proc-Protect-send_msg-with-a-local-lock.patch @@ -2,7 +2,7 @@ From: Mike Galbraith Date: Sun, 16 Oct 2016 05:11:54 +0200 Subject: [PATCH] connector/cn_proc: Protect send_msg() with a local lock on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:931 |in_atomic(): 1, irqs_disabled(): 0, pid: 31807, name: sleep diff --git a/debian/patches-rt/cpu-hotplug--Implement-CPU-pinning.patch b/debian/patches-rt/cpu-hotplug--Implement-CPU-pinning.patch index aa4d673f6..79f379d45 100644 --- a/debian/patches-rt/cpu-hotplug--Implement-CPU-pinning.patch +++ b/debian/patches-rt/cpu-hotplug--Implement-CPU-pinning.patch @@ -1,7 +1,7 @@ Subject: cpu/hotplug: Implement CPU pinning From: Thomas Gleixner Date: Wed, 19 Jul 2017 17:31:20 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Signed-off-by: Thomas Gleixner --- diff --git a/debian/patches-rt/cpufreq-drop-K8-s-driver-from-beeing-selected.patch b/debian/patches-rt/cpufreq-drop-K8-s-driver-from-beeing-selected.patch index 9b489039d..68fcf2158 100644 --- a/debian/patches-rt/cpufreq-drop-K8-s-driver-from-beeing-selected.patch +++ b/debian/patches-rt/cpufreq-drop-K8-s-driver-from-beeing-selected.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 9 Apr 2015 15:23:01 +0200 Subject: cpufreq: drop K8's driver from beeing selected -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Ralf posted a picture of a backtrace from diff --git a/debian/patches-rt/cpumask-disable-offstack-on-rt.patch b/debian/patches-rt/cpumask-disable-offstack-on-rt.patch index dd840b410..89663a612 100644 --- a/debian/patches-rt/cpumask-disable-offstack-on-rt.patch +++ b/debian/patches-rt/cpumask-disable-offstack-on-rt.patch @@ -1,7 +1,7 @@ Subject: cpumask: Disable CONFIG_CPUMASK_OFFSTACK for RT From: Thomas Gleixner Date: Wed, 14 Dec 2011 01:03:49 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz There are "valid" GFP_ATOMIC allocations such as diff --git a/debian/patches-rt/cpuset-Convert-callback_lock-to-raw_spinlock_t.patch b/debian/patches-rt/cpuset-Convert-callback_lock-to-raw_spinlock_t.patch index 99ba1fbf1..4f408d677 100644 --- a/debian/patches-rt/cpuset-Convert-callback_lock-to-raw_spinlock_t.patch +++ b/debian/patches-rt/cpuset-Convert-callback_lock-to-raw_spinlock_t.patch @@ -1,7 +1,7 @@ From: Mike Galbraith Date: Sun, 8 Jan 2017 09:32:25 +0100 Subject: [PATCH] cpuset: Convert callback_lock to raw_spinlock_t -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The two commits below add up to a cpuset might_sleep() splat for RT: diff --git a/debian/patches-rt/crypto-Reduce-preempt-disabled-regions-more-algos.patch b/debian/patches-rt/crypto-Reduce-preempt-disabled-regions-more-algos.patch index e14ca616d..bfe7c7f1f 100644 --- a/debian/patches-rt/crypto-Reduce-preempt-disabled-regions-more-algos.patch +++ b/debian/patches-rt/crypto-Reduce-preempt-disabled-regions-more-algos.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 21 Feb 2014 17:24:04 +0100 Subject: crypto: Reduce preempt disabled regions, more algos -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Don Estabrook reported | kernel: WARNING: CPU: 2 PID: 858 at kernel/sched/core.c:2428 migrate_disable+0xed/0x100() diff --git a/debian/patches-rt/crypto-chtls-remove-cdev_list_lock.patch b/debian/patches-rt/crypto-chtls-remove-cdev_list_lock.patch index 25a15abb7..84eceffb4 100644 --- a/debian/patches-rt/crypto-chtls-remove-cdev_list_lock.patch +++ b/debian/patches-rt/crypto-chtls-remove-cdev_list_lock.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Mon, 11 Feb 2019 11:06:11 +0100 Subject: [PATCH] crypto: chtls: remove cdev_list_lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Last user of cdev_list_lock was removed in commit diff --git a/debian/patches-rt/crypto-cryptd-add-a-lock-instead-preempt_disable-loc.patch b/debian/patches-rt/crypto-cryptd-add-a-lock-instead-preempt_disable-loc.patch index d61cde492..05610184e 100644 --- a/debian/patches-rt/crypto-cryptd-add-a-lock-instead-preempt_disable-loc.patch +++ b/debian/patches-rt/crypto-cryptd-add-a-lock-instead-preempt_disable-loc.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 26 Jul 2018 18:52:00 +0200 Subject: [PATCH] crypto: cryptd - add a lock instead preempt_disable/local_bh_disable -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz cryptd has a per-CPU lock which protected with local_bh_disable() and preempt_disable(). diff --git a/debian/patches-rt/crypto-limit-more-FPU-enabled-sections.patch b/debian/patches-rt/crypto-limit-more-FPU-enabled-sections.patch index 3af192e38..f7433ecf9 100644 --- a/debian/patches-rt/crypto-limit-more-FPU-enabled-sections.patch +++ b/debian/patches-rt/crypto-limit-more-FPU-enabled-sections.patch @@ -4,7 +4,7 @@ Subject: [PATCH] crypto: limit more FPU-enabled sections MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Those crypto drivers use SSE/AVX/… for their crypto work and in order to do so in kernel they need to enable the "FPU" in kernel mode which diff --git a/debian/patches-rt/crypto-scompress-serialize-RT-percpu-scratch-buffer-.patch b/debian/patches-rt/crypto-scompress-serialize-RT-percpu-scratch-buffer-.patch index c39eaeb47..279579609 100644 --- a/debian/patches-rt/crypto-scompress-serialize-RT-percpu-scratch-buffer-.patch +++ b/debian/patches-rt/crypto-scompress-serialize-RT-percpu-scratch-buffer-.patch @@ -2,7 +2,7 @@ From: Mike Galbraith Date: Wed, 11 Jul 2018 17:14:47 +0200 Subject: [PATCH] crypto: scompress - serialize RT percpu scratch buffer access with a local lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz | BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:974 | in_atomic(): 1, irqs_disabled(): 0, pid: 1401, name: cryptomgr_test diff --git a/debian/patches-rt/crypto-user-remove-crypto_cfg_mutex.patch b/debian/patches-rt/crypto-user-remove-crypto_cfg_mutex.patch index ee9166ee9..5d1a065ac 100644 --- a/debian/patches-rt/crypto-user-remove-crypto_cfg_mutex.patch +++ b/debian/patches-rt/crypto-user-remove-crypto_cfg_mutex.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Mon, 11 Feb 2019 11:52:38 +0100 Subject: [PATCH] crypto: user: remove crypto_cfg_mutex -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz crypto_cfg_mutex was never used since it got introduced in commit diff --git a/debian/patches-rt/debugobjects-rt.patch b/debian/patches-rt/debugobjects-rt.patch index df691edc4..9fe1b7363 100644 --- a/debian/patches-rt/debugobjects-rt.patch +++ b/debian/patches-rt/debugobjects-rt.patch @@ -1,7 +1,7 @@ Subject: debugobjects: Make RT aware From: Thomas Gleixner Date: Sun, 17 Jul 2011 21:41:35 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Avoid filling the pool / allocating memory with irqs off(). diff --git a/debian/patches-rt/drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch b/debian/patches-rt/drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch index 1d53a6632..168ddb736 100644 --- a/debian/patches-rt/drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch +++ b/debian/patches-rt/drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch @@ -2,7 +2,7 @@ From: Mike Galbraith Date: Thu, 31 Mar 2016 04:08:28 +0200 Subject: [PATCH] drivers/block/zram: Replace bit spinlocks with rtmutex for -rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz They're nondeterministic, and lead to ___might_sleep() splats in -rt. OTOH, they're a lot less wasteful than an rtmutex per page. diff --git a/debian/patches-rt/drivers-tty-fix-omap-lock-crap.patch b/debian/patches-rt/drivers-tty-fix-omap-lock-crap.patch index 01950179e..077846afb 100644 --- a/debian/patches-rt/drivers-tty-fix-omap-lock-crap.patch +++ b/debian/patches-rt/drivers-tty-fix-omap-lock-crap.patch @@ -1,7 +1,7 @@ Subject: tty/serial/omap: Make the locking RT aware From: Thomas Gleixner Date: Thu, 28 Jul 2011 13:32:57 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The lock is a sleeping lock and local_irq_save() is not the optimsation we are looking for. Redo it to make it work on -RT and diff --git a/debian/patches-rt/drivers-tty-pl011-irq-disable-madness.patch b/debian/patches-rt/drivers-tty-pl011-irq-disable-madness.patch index 2d15bad47..2157b3ac7 100644 --- a/debian/patches-rt/drivers-tty-pl011-irq-disable-madness.patch +++ b/debian/patches-rt/drivers-tty-pl011-irq-disable-madness.patch @@ -1,7 +1,7 @@ Subject: tty/serial/pl011: Make the locking work on RT From: Thomas Gleixner Date: Tue, 08 Jan 2013 21:36:51 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The lock is a sleeping lock and local_irq_save() is not the optimsation we are looking for. Redo it to make it work on -RT and non-RT. diff --git a/debian/patches-rt/drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch b/debian/patches-rt/drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch index 52749938d..729cd8cfd 100644 --- a/debian/patches-rt/drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch +++ b/debian/patches-rt/drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch @@ -2,7 +2,7 @@ From: Mike Galbraith Date: Thu, 20 Oct 2016 11:15:22 +0200 Subject: [PATCH] drivers/zram: Don't disable preemption in zcomp_stream_get/put() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz In v4.7, the driver switched to percpu compression streams, disabling preemption via get/put_cpu_ptr(). Use a per-zcomp_strm lock here. We diff --git a/debian/patches-rt/drm-i915-Don-t-disable-interrupts-independently-of-t.patch b/debian/patches-rt/drm-i915-Don-t-disable-interrupts-independently-of-t.patch index 8f874a4a9..1c8bd8771 100644 --- a/debian/patches-rt/drm-i915-Don-t-disable-interrupts-independently-of-t.patch +++ b/debian/patches-rt/drm-i915-Don-t-disable-interrupts-independently-of-t.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 10 Apr 2019 11:01:37 +0200 Subject: [PATCH] drm/i915: Don't disable interrupts independently of the lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The locks (timeline->lock and rq->lock) need to be taken with disabled interrupts. This is done in __retire_engine_request() by disabling the diff --git a/debian/patches-rt/drm-i915-disable-tracing-on-RT.patch b/debian/patches-rt/drm-i915-disable-tracing-on-RT.patch index 6c9fc9913..d53862a57 100644 --- a/debian/patches-rt/drm-i915-disable-tracing-on-RT.patch +++ b/debian/patches-rt/drm-i915-disable-tracing-on-RT.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 6 Dec 2018 09:52:20 +0100 Subject: [PATCH] drm/i915: disable tracing on -RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Luca Abeni reported this: | BUG: scheduling while atomic: kworker/u8:2/15203/0x00000003 diff --git a/debian/patches-rt/drm-i915-fence-Do-not-use-TIMER_IRQSAFE.patch b/debian/patches-rt/drm-i915-fence-Do-not-use-TIMER_IRQSAFE.patch index 2e376f96a..6997f680f 100644 --- a/debian/patches-rt/drm-i915-fence-Do-not-use-TIMER_IRQSAFE.patch +++ b/debian/patches-rt/drm-i915-fence-Do-not-use-TIMER_IRQSAFE.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Tue, 12 Feb 2019 12:45:19 +0100 Subject: [PATCH] drm/i915/fence: Do not use TIMER_IRQSAFE -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The timer is initialized with TIMER_IRQSAFE flag. It does look like the timer callback requires this flag at all. Its sole purpose is to ensure diff --git a/debian/patches-rt/drm-i915-skip-DRM_I915_LOW_LEVEL_TRACEPOINTS-with-NO.patch b/debian/patches-rt/drm-i915-skip-DRM_I915_LOW_LEVEL_TRACEPOINTS-with-NO.patch index 40ef0e0dc..3ea18ebb6 100644 --- a/debian/patches-rt/drm-i915-skip-DRM_I915_LOW_LEVEL_TRACEPOINTS-with-NO.patch +++ b/debian/patches-rt/drm-i915-skip-DRM_I915_LOW_LEVEL_TRACEPOINTS-with-NO.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 19 Dec 2018 10:47:02 +0100 Subject: [PATCH] drm/i915: skip DRM_I915_LOW_LEVEL_TRACEPOINTS with NOTRACE -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The order of the header files is important. If this header file is included after tracepoint.h was included then the NOTRACE here becomes a diff --git a/debian/patches-rt/drmi915_Use_local_lockunlock_irq()_in_intel_pipe_update_startend().patch b/debian/patches-rt/drmi915_Use_local_lockunlock_irq()_in_intel_pipe_update_startend().patch index 997314740..860a5a52a 100644 --- a/debian/patches-rt/drmi915_Use_local_lockunlock_irq()_in_intel_pipe_update_startend().patch +++ b/debian/patches-rt/drmi915_Use_local_lockunlock_irq()_in_intel_pipe_update_startend().patch @@ -1,7 +1,7 @@ Subject: drm,i915: Use local_lock/unlock_irq() in intel_pipe_update_start/end() From: Mike Galbraith Date: Sat, 27 Feb 2016 09:01:42 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz [ 8.014039] BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:918 diff --git a/debian/patches-rt/drmradeoni915_Use_preempt_disableenable_rt()_where_recommended.patch b/debian/patches-rt/drmradeoni915_Use_preempt_disableenable_rt()_where_recommended.patch index 27941353f..c921f819a 100644 --- a/debian/patches-rt/drmradeoni915_Use_preempt_disableenable_rt()_where_recommended.patch +++ b/debian/patches-rt/drmradeoni915_Use_preempt_disableenable_rt()_where_recommended.patch @@ -1,7 +1,7 @@ Subject: drm,radeon,i915: Use preempt_disable/enable_rt() where recommended From: Mike Galbraith Date: Sat, 27 Feb 2016 08:09:11 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz DRM folks identified the spots, so use them. diff --git a/debian/patches-rt/efi-Allow-efi-runtime.patch b/debian/patches-rt/efi-Allow-efi-runtime.patch index c12ff59f6..0a03f3f11 100644 --- a/debian/patches-rt/efi-Allow-efi-runtime.patch +++ b/debian/patches-rt/efi-Allow-efi-runtime.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 26 Jul 2018 15:06:10 +0200 Subject: [PATCH] efi: Allow efi=runtime -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz In case the option "efi=noruntime" is default at built-time, the user could overwrite its sate by `efi=runtime' and allow it again. diff --git a/debian/patches-rt/efi-Disable-runtime-services-on-RT.patch b/debian/patches-rt/efi-Disable-runtime-services-on-RT.patch index fbb1d9d67..5010060c2 100644 --- a/debian/patches-rt/efi-Disable-runtime-services-on-RT.patch +++ b/debian/patches-rt/efi-Disable-runtime-services-on-RT.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 26 Jul 2018 15:03:16 +0200 Subject: [PATCH] efi: Disable runtime services on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Based on meassurements the EFI functions get_variable / get_next_variable take up to 2us which looks okay. diff --git a/debian/patches-rt/epoll-use-get-cpu-light.patch b/debian/patches-rt/epoll-use-get-cpu-light.patch index 4bd7b8faa..4c0dc5c56 100644 --- a/debian/patches-rt/epoll-use-get-cpu-light.patch +++ b/debian/patches-rt/epoll-use-get-cpu-light.patch @@ -1,7 +1,7 @@ Subject: fs/epoll: Do not disable preemption on RT From: Thomas Gleixner Date: Fri, 08 Jul 2011 16:35:35 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz ep_call_nested() takes a sleeping lock so we can't disable preemption. The light version is enough since ep_call_nested() doesn't mind beeing diff --git a/debian/patches-rt/fs-aio-simple-simple-work.patch b/debian/patches-rt/fs-aio-simple-simple-work.patch index f44a53bf7..bc9cf33e9 100644 --- a/debian/patches-rt/fs-aio-simple-simple-work.patch +++ b/debian/patches-rt/fs-aio-simple-simple-work.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Mon, 16 Feb 2015 18:49:10 +0100 Subject: fs/aio: simple simple work -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:768 |in_atomic(): 1, irqs_disabled(): 0, pid: 26, name: rcuos/2 diff --git a/debian/patches-rt/fs-dcache-bring-back-explicit-INIT_HLIST_BL_HEAD-in.patch b/debian/patches-rt/fs-dcache-bring-back-explicit-INIT_HLIST_BL_HEAD-in.patch index 229515af4..28f9676ab 100644 --- a/debian/patches-rt/fs-dcache-bring-back-explicit-INIT_HLIST_BL_HEAD-in.patch +++ b/debian/patches-rt/fs-dcache-bring-back-explicit-INIT_HLIST_BL_HEAD-in.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 13 Sep 2017 12:32:34 +0200 Subject: [PATCH] fs/dcache: bring back explicit INIT_HLIST_BL_HEAD init -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Commit 3d375d78593c ("mm: update callers to use HASH_ZERO flag") removed INIT_HLIST_BL_HEAD and uses the ZERO flag instead for the init. However diff --git a/debian/patches-rt/fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch b/debian/patches-rt/fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch index 0e2e793a0..998249e73 100644 --- a/debian/patches-rt/fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch +++ b/debian/patches-rt/fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 20 Oct 2017 11:29:53 +0200 Subject: [PATCH] fs/dcache: disable preemption on i_dir_seq's write side -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz i_dir_seq is an opencoded seqcounter. Based on the code it looks like we could have two writers in parallel despite the fact that the d_lock is diff --git a/debian/patches-rt/fs-dcache-use-cpu-chill-in-trylock-loops.patch b/debian/patches-rt/fs-dcache-use-cpu-chill-in-trylock-loops.patch index 1e506a6d5..47b197bf5 100644 --- a/debian/patches-rt/fs-dcache-use-cpu-chill-in-trylock-loops.patch +++ b/debian/patches-rt/fs-dcache-use-cpu-chill-in-trylock-loops.patch @@ -1,7 +1,7 @@ Subject: fs: dcache: Use cpu_chill() in trylock loops From: Thomas Gleixner Date: Wed, 07 Mar 2012 21:00:34 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Retry loops on RT might loop forever when the modifying side was preempted. Use cpu_chill() instead of cpu_relax() to let the system diff --git a/debian/patches-rt/fs-dcache-use-swait_queue-instead-of-waitqueue.patch b/debian/patches-rt/fs-dcache-use-swait_queue-instead-of-waitqueue.patch index 250189b5e..8b8aa6c48 100644 --- a/debian/patches-rt/fs-dcache-use-swait_queue-instead-of-waitqueue.patch +++ b/debian/patches-rt/fs-dcache-use-swait_queue-instead-of-waitqueue.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 14 Sep 2016 14:35:49 +0200 Subject: [PATCH] fs/dcache: use swait_queue instead of waitqueue -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz __d_lookup_done() invokes wake_up_all() while holding a hlist_bl_lock() which disables preemption. As a workaround convert it to swait. diff --git a/debian/patches-rt/fs-jbd-replace-bh_state-lock.patch b/debian/patches-rt/fs-jbd-replace-bh_state-lock.patch index 703944b80..def0b8000 100644 --- a/debian/patches-rt/fs-jbd-replace-bh_state-lock.patch +++ b/debian/patches-rt/fs-jbd-replace-bh_state-lock.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Fri, 18 Mar 2011 10:11:25 +0100 Subject: fs: jbd/jbd2: Make state lock and journal head lock rt safe -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz bit_spin_locks break under RT. diff --git a/debian/patches-rt/fs-nfs-turn-rmdir_sem-into-a-semaphore.patch b/debian/patches-rt/fs-nfs-turn-rmdir_sem-into-a-semaphore.patch index 732607e7a..91f088a90 100644 --- a/debian/patches-rt/fs-nfs-turn-rmdir_sem-into-a-semaphore.patch +++ b/debian/patches-rt/fs-nfs-turn-rmdir_sem-into-a-semaphore.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 15 Sep 2016 10:51:27 +0200 Subject: [PATCH] fs/nfs: turn rmdir_sem into a semaphore -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The RW semaphore had a reader side which used the _non_owner version because it most likely took the reader lock in one thread and released it diff --git a/debian/patches-rt/fs-replace-bh_uptodate_lock-for-rt.patch b/debian/patches-rt/fs-replace-bh_uptodate_lock-for-rt.patch index 525dc48ea..79b922e47 100644 --- a/debian/patches-rt/fs-replace-bh_uptodate_lock-for-rt.patch +++ b/debian/patches-rt/fs-replace-bh_uptodate_lock-for-rt.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Fri, 18 Mar 2011 09:18:52 +0100 Subject: buffer_head: Replace bh_uptodate_lock for -rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Wrap the bit_spin_lock calls into a separate inline and add the RT replacements with a real spinlock. diff --git a/debian/patches-rt/fscache-initialize-cookie-hash-table-raw-spinlocks.patch b/debian/patches-rt/fscache-initialize-cookie-hash-table-raw-spinlocks.patch index 19aacf635..11ea23fd9 100644 --- a/debian/patches-rt/fscache-initialize-cookie-hash-table-raw-spinlocks.patch +++ b/debian/patches-rt/fscache-initialize-cookie-hash-table-raw-spinlocks.patch @@ -1,7 +1,7 @@ From: Clark Williams Date: Tue, 3 Jul 2018 13:34:30 -0500 Subject: [PATCH] fscache: initialize cookie hash table raw spinlocks -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The fscache cookie mechanism uses a hash table of hlist_bl_head structures. The PREEMPT_RT patcheset adds a raw spinlock to this structure and so on PREEMPT_RT diff --git a/debian/patches-rt/ftrace-Fix-trace-header-alignment.patch b/debian/patches-rt/ftrace-Fix-trace-header-alignment.patch index 5ad261e38..df9dda46b 100644 --- a/debian/patches-rt/ftrace-Fix-trace-header-alignment.patch +++ b/debian/patches-rt/ftrace-Fix-trace-header-alignment.patch @@ -1,7 +1,7 @@ From: Mike Galbraith Date: Sun, 16 Oct 2016 05:08:30 +0200 Subject: [PATCH] ftrace: Fix trace header alignment -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Line up helper arrows to the right column. diff --git a/debian/patches-rt/ftrace-migrate-disable-tracing.patch b/debian/patches-rt/ftrace-migrate-disable-tracing.patch index 7acdde467..f0fbf6984 100644 --- a/debian/patches-rt/ftrace-migrate-disable-tracing.patch +++ b/debian/patches-rt/ftrace-migrate-disable-tracing.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Sun, 17 Jul 2011 21:56:42 +0200 Subject: trace: Add migrate-disabled counter to tracing output -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Signed-off-by: Thomas Gleixner --- diff --git a/debian/patches-rt/futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch b/debian/patches-rt/futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch index ddd898593..35d06e43a 100644 --- a/debian/patches-rt/futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch +++ b/debian/patches-rt/futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Fri, 1 Mar 2013 11:17:42 +0100 Subject: futex: Ensure lock/unlock symetry versus pi_lock and hash bucket lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz In exit_pi_state_list() we have the following locking construct: diff --git a/debian/patches-rt/futex-requeue-pi-fix.patch b/debian/patches-rt/futex-requeue-pi-fix.patch index 0f4bb4cb1..b7ab28303 100644 --- a/debian/patches-rt/futex-requeue-pi-fix.patch +++ b/debian/patches-rt/futex-requeue-pi-fix.patch @@ -1,7 +1,7 @@ From: Steven Rostedt Date: Tue, 14 Jul 2015 14:26:34 +0200 Subject: futex: Fix bug on when a requeued RT task times out -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Requeue with timeout causes a bug with PREEMPT_RT_FULL. diff --git a/debian/patches-rt/futex-workaround-migrate_disable-enable-in-different.patch b/debian/patches-rt/futex-workaround-migrate_disable-enable-in-different.patch index 325c28891..c9f5d342b 100644 --- a/debian/patches-rt/futex-workaround-migrate_disable-enable-in-different.patch +++ b/debian/patches-rt/futex-workaround-migrate_disable-enable-in-different.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Wed, 8 Mar 2017 14:23:35 +0100 Subject: [PATCH] futex: workaround migrate_disable/enable in different context -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz migrate_disable()/migrate_enable() takes a different path in atomic() vs !atomic() context. These little hacks ensure that we don't underflow / overflow diff --git a/debian/patches-rt/genirq-disable-irqpoll-on-rt.patch b/debian/patches-rt/genirq-disable-irqpoll-on-rt.patch index 15b820e4a..799e71619 100644 --- a/debian/patches-rt/genirq-disable-irqpoll-on-rt.patch +++ b/debian/patches-rt/genirq-disable-irqpoll-on-rt.patch @@ -1,7 +1,7 @@ From: Ingo Molnar Date: Fri, 3 Jul 2009 08:29:57 -0500 Subject: genirq: Disable irqpoll on -rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Creates long latencies for no value diff --git a/debian/patches-rt/genirq-do-not-invoke-the-affinity-callback-via-a-wor.patch b/debian/patches-rt/genirq-do-not-invoke-the-affinity-callback-via-a-wor.patch index 57f7870b1..eb00e1ead 100644 --- a/debian/patches-rt/genirq-do-not-invoke-the-affinity-callback-via-a-wor.patch +++ b/debian/patches-rt/genirq-do-not-invoke-the-affinity-callback-via-a-wor.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 21 Aug 2013 17:48:46 +0200 Subject: genirq: Do not invoke the affinity callback via a workqueue on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Joe Korty reported, that __irq_set_affinity_locked() schedules a workqueue while holding a rawlock which results in a might_sleep() diff --git a/debian/patches-rt/genirq-force-threading.patch b/debian/patches-rt/genirq-force-threading.patch index fff4e3af5..bdb979bdd 100644 --- a/debian/patches-rt/genirq-force-threading.patch +++ b/debian/patches-rt/genirq-force-threading.patch @@ -1,7 +1,7 @@ Subject: genirq: Force interrupt thread on RT From: Thomas Gleixner Date: Sun, 03 Apr 2011 11:57:29 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Force threaded_irqs and optimize the code (force_irqthreads) in regard to this. diff --git a/debian/patches-rt/genirq-update-irq_set_irqchip_state-documentation.patch b/debian/patches-rt/genirq-update-irq_set_irqchip_state-documentation.patch index 16b7b7013..8a6f86772 100644 --- a/debian/patches-rt/genirq-update-irq_set_irqchip_state-documentation.patch +++ b/debian/patches-rt/genirq-update-irq_set_irqchip_state-documentation.patch @@ -1,7 +1,7 @@ From: Josh Cartwright Date: Thu, 11 Feb 2016 11:54:00 -0600 Subject: genirq: update irq_set_irqchip_state documentation -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz On -rt kernels, the use of migrate_disable()/migrate_enable() is sufficient to guarantee a task isn't moved to another CPU. Update the diff --git a/debian/patches-rt/hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch b/debian/patches-rt/hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch index 5b349df54..5b6b98ed3 100644 --- a/debian/patches-rt/hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch +++ b/debian/patches-rt/hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 4 Aug 2017 18:31:00 +0200 Subject: [PATCH] hotplug: duct-tape RT-rwlock usage for non-RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz This type is only available on -RT. We need to craft something for non-RT. Since the only migrate_disable() user is -RT only, there is no diff --git a/debian/patches-rt/hotplug-light-get-online-cpus.patch b/debian/patches-rt/hotplug-light-get-online-cpus.patch index 29da76814..297332b6b 100644 --- a/debian/patches-rt/hotplug-light-get-online-cpus.patch +++ b/debian/patches-rt/hotplug-light-get-online-cpus.patch @@ -1,7 +1,7 @@ Subject: hotplug: Lightweight get online cpus From: Thomas Gleixner Date: Wed, 15 Jun 2011 12:36:06 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz get_online_cpus() is a heavy weight function which involves a global mutex. migrate_disable() wants a simpler construct which prevents only diff --git a/debian/patches-rt/hrtimer-Move-schedule_work-call-to-helper-thread.patch b/debian/patches-rt/hrtimer-Move-schedule_work-call-to-helper-thread.patch index 8c5281f7a..df9ada6ce 100644 --- a/debian/patches-rt/hrtimer-Move-schedule_work-call-to-helper-thread.patch +++ b/debian/patches-rt/hrtimer-Move-schedule_work-call-to-helper-thread.patch @@ -1,7 +1,7 @@ From: Yang Shi Date: Mon, 16 Sep 2013 14:09:19 -0700 Subject: hrtimer: Move schedule_work call to helper thread -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz When run ltp leapsec_timer test, the following call trace is caught: diff --git a/debian/patches-rt/hrtimer-by-timers-by-default-into-the-softirq-context.patch b/debian/patches-rt/hrtimer-by-timers-by-default-into-the-softirq-context.patch index bb1c11050..a88c1fa55 100644 --- a/debian/patches-rt/hrtimer-by-timers-by-default-into-the-softirq-context.patch +++ b/debian/patches-rt/hrtimer-by-timers-by-default-into-the-softirq-context.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 3 Jul 2009 08:44:31 -0500 Subject: hrtimer: by timers by default into the softirq context -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz We can't have hrtimers callbacks running in hardirq context on RT. Therefore the timers are deferred to the softirq context by default. @@ -70,7 +70,7 @@ Signed-off-by: Sebastian Andrzej Siewior timer->function = perf_mux_hrtimer_handler; } -@@ -9210,7 +9210,7 @@ static void perf_swevent_init_hrtimer(st +@@ -9212,7 +9212,7 @@ static void perf_swevent_init_hrtimer(st if (!is_sampling_event(event)) return; @@ -103,7 +103,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c -@@ -4891,9 +4891,9 @@ void init_cfs_bandwidth(struct cfs_bandw +@@ -4916,9 +4916,9 @@ void init_cfs_bandwidth(struct cfs_bandw cfs_b->period = ns_to_ktime(default_cfs_period()); INIT_LIST_HEAD(&cfs_b->throttled_cfs_rq); diff --git a/debian/patches-rt/hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch b/debian/patches-rt/hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch index 5be95d054..820f7fe1c 100644 --- a/debian/patches-rt/hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch +++ b/debian/patches-rt/hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Tue, 3 Jul 2018 11:25:41 +0200 Subject: [PATCH v2] hrtimer: consolidate hrtimer_init() + hrtimer_init_sleeper() calls -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz hrtimer_init_sleeper() calls require a prior initialisation of the hrtimer object with hrtimer_init(). Lets make the initialisation of @@ -27,7 +27,7 @@ Signed-off-by: Anna-Maria Gleixner --- a/block/blk-mq.c +++ b/block/blk-mq.c -@@ -3373,10 +3373,9 @@ static bool blk_mq_poll_hybrid_sleep(str +@@ -3377,10 +3377,9 @@ static bool blk_mq_poll_hybrid_sleep(str kt = nsecs; mode = HRTIMER_MODE_REL; diff --git a/debian/patches-rt/hrtimer-move-state-change-before-hrtimer_cancel-in-d.patch b/debian/patches-rt/hrtimer-move-state-change-before-hrtimer_cancel-in-d.patch index fbbf1773e..55ae498fc 100644 --- a/debian/patches-rt/hrtimer-move-state-change-before-hrtimer_cancel-in-d.patch +++ b/debian/patches-rt/hrtimer-move-state-change-before-hrtimer_cancel-in-d.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 6 Dec 2018 10:15:13 +0100 Subject: [PATCH] hrtimer: move state change before hrtimer_cancel in do_nanosleep() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz There is a small window between setting t->task to NULL and waking the task up (which would set TASK_RUNNING). So the timer would fire, run and diff --git a/debian/patches-rt/hrtimers-prepare-full-preemption.patch b/debian/patches-rt/hrtimers-prepare-full-preemption.patch index 3e13466cc..a37bd0a4e 100644 --- a/debian/patches-rt/hrtimers-prepare-full-preemption.patch +++ b/debian/patches-rt/hrtimers-prepare-full-preemption.patch @@ -1,7 +1,7 @@ From: Ingo Molnar Date: Fri, 3 Jul 2009 08:29:34 -0500 Subject: hrtimers: Prepare full preemption -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Make cancellation of a running callback in softirq context safe against preemption. diff --git a/debian/patches-rt/irq-allow-disabling-of-softirq-processing-in-irq-thread-context.patch b/debian/patches-rt/irq-allow-disabling-of-softirq-processing-in-irq-thread-context.patch index 52b2b9f1d..27459290b 100644 --- a/debian/patches-rt/irq-allow-disabling-of-softirq-processing-in-irq-thread-context.patch +++ b/debian/patches-rt/irq-allow-disabling-of-softirq-processing-in-irq-thread-context.patch @@ -1,7 +1,7 @@ Subject: genirq: Allow disabling of softirq processing in irq thread context From: Thomas Gleixner Date: Tue, 31 Jan 2012 13:01:27 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The processing of softirqs in irq thread context is a performance gain for the non-rt workloads of a system, but it's counterproductive for diff --git a/debian/patches-rt/irqwork-push_most_work_into_softirq_context.patch b/debian/patches-rt/irqwork-push_most_work_into_softirq_context.patch index 637ebba42..0096c7452 100644 --- a/debian/patches-rt/irqwork-push_most_work_into_softirq_context.patch +++ b/debian/patches-rt/irqwork-push_most_work_into_softirq_context.patch @@ -1,7 +1,7 @@ Subject: irqwork: push most work into softirq context From: Sebastian Andrzej Siewior Date: Tue, 23 Jun 2015 15:32:51 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Initially we defered all irqwork into softirq because we didn't want the latency spikes if perf or another user was busy and delayed the RT task. diff --git a/debian/patches-rt/jump-label-rt.patch b/debian/patches-rt/jump-label-rt.patch index 1517b881e..486ebb22f 100644 --- a/debian/patches-rt/jump-label-rt.patch +++ b/debian/patches-rt/jump-label-rt.patch @@ -1,7 +1,7 @@ Subject: jump-label: disable if stop_machine() is used From: Thomas Gleixner Date: Wed, 08 Jul 2015 17:14:48 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Some architectures are using stop_machine() while switching the opcode which leads to latency spikes. diff --git a/debian/patches-rt/kconfig-disable-a-few-options-rt.patch b/debian/patches-rt/kconfig-disable-a-few-options-rt.patch index 8832127fd..1d6ecc94a 100644 --- a/debian/patches-rt/kconfig-disable-a-few-options-rt.patch +++ b/debian/patches-rt/kconfig-disable-a-few-options-rt.patch @@ -1,7 +1,7 @@ Subject: kconfig: Disable config options which are not RT compatible From: Thomas Gleixner Date: Sun, 24 Jul 2011 12:11:43 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Disable stuff which is known to have issues on RT diff --git a/debian/patches-rt/kconfig-preempt-rt-full.patch b/debian/patches-rt/kconfig-preempt-rt-full.patch index f3e29d04a..323ebc385 100644 --- a/debian/patches-rt/kconfig-preempt-rt-full.patch +++ b/debian/patches-rt/kconfig-preempt-rt-full.patch @@ -1,7 +1,7 @@ Subject: kconfig: Add PREEMPT_RT_FULL From: Thomas Gleixner Date: Wed, 29 Jun 2011 14:58:57 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Introduce the final symbol for PREEMPT_RT_FULL. diff --git a/debian/patches-rt/kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch b/debian/patches-rt/kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch index cefcdc712..598a3f689 100644 --- a/debian/patches-rt/kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch +++ b/debian/patches-rt/kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch @@ -4,7 +4,7 @@ Subject: [PATCH] kernel: sched: Provide a pointer to the valid CPU mask MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz In commit 4b53a3412d66 ("sched/core: Remove the tsk_nr_cpus_allowed() wrapper") the tsk_nr_cpus_allowed() wrapper was removed. There was not @@ -554,7 +554,7 @@ Signed-off-by: Sebastian Andrzej Siewior continue; env->dst_cpu = cpu; -@@ -5760,7 +5760,7 @@ find_idlest_group(struct sched_domain *s +@@ -5785,7 +5785,7 @@ find_idlest_group(struct sched_domain *s /* Skip over this group if it has no CPUs allowed */ if (!cpumask_intersects(sched_group_span(group), @@ -563,7 +563,7 @@ Signed-off-by: Sebastian Andrzej Siewior continue; local_group = cpumask_test_cpu(this_cpu, -@@ -5892,7 +5892,7 @@ find_idlest_group_cpu(struct sched_group +@@ -5917,7 +5917,7 @@ find_idlest_group_cpu(struct sched_group return cpumask_first(sched_group_span(group)); /* Traverse only the allowed CPUs */ @@ -572,7 +572,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (available_idle_cpu(i)) { struct rq *rq = cpu_rq(i); struct cpuidle_state *idle = idle_get_state(rq); -@@ -5932,7 +5932,7 @@ static inline int find_idlest_cpu(struct +@@ -5957,7 +5957,7 @@ static inline int find_idlest_cpu(struct { int new_cpu = cpu; @@ -581,7 +581,7 @@ Signed-off-by: Sebastian Andrzej Siewior return prev_cpu; /* -@@ -6049,7 +6049,7 @@ static int select_idle_core(struct task_ +@@ -6074,7 +6074,7 @@ static int select_idle_core(struct task_ if (!test_idle_cores(target, false)) return -1; @@ -590,7 +590,7 @@ Signed-off-by: Sebastian Andrzej Siewior for_each_cpu_wrap(core, cpus, target) { bool idle = true; -@@ -6083,7 +6083,7 @@ static int select_idle_smt(struct task_s +@@ -6108,7 +6108,7 @@ static int select_idle_smt(struct task_s return -1; for_each_cpu(cpu, cpu_smt_mask(target)) { @@ -599,7 +599,7 @@ Signed-off-by: Sebastian Andrzej Siewior continue; if (available_idle_cpu(cpu)) return cpu; -@@ -6146,7 +6146,7 @@ static int select_idle_cpu(struct task_s +@@ -6171,7 +6171,7 @@ static int select_idle_cpu(struct task_s for_each_cpu_wrap(cpu, sched_domain_span(sd), target) { if (!--nr) return -1; @@ -608,7 +608,7 @@ Signed-off-by: Sebastian Andrzej Siewior continue; if (available_idle_cpu(cpu)) break; -@@ -6183,7 +6183,7 @@ static int select_idle_sibling(struct ta +@@ -6208,7 +6208,7 @@ static int select_idle_sibling(struct ta recent_used_cpu != target && cpus_share_cache(recent_used_cpu, target) && available_idle_cpu(recent_used_cpu) && @@ -617,7 +617,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * Replace recent_used_cpu with prev as it is a potential * candidate for the next wake: -@@ -6529,7 +6529,7 @@ static int find_energy_efficient_cpu(str +@@ -6554,7 +6554,7 @@ static int find_energy_efficient_cpu(str int max_spare_cap_cpu = -1; for_each_cpu_and(cpu, perf_domain_span(pd), sched_domain_span(sd)) { @@ -626,7 +626,7 @@ Signed-off-by: Sebastian Andrzej Siewior continue; /* Skip CPUs that will be overutilized. */ -@@ -6618,7 +6618,7 @@ select_task_rq_fair(struct task_struct * +@@ -6643,7 +6643,7 @@ select_task_rq_fair(struct task_struct * } want_affine = !wake_wide(p) && !wake_cap(p, cpu, prev_cpu) && @@ -635,7 +635,7 @@ Signed-off-by: Sebastian Andrzej Siewior } rcu_read_lock(); -@@ -7368,14 +7368,14 @@ int can_migrate_task(struct task_struct +@@ -7393,14 +7393,14 @@ int can_migrate_task(struct task_struct /* * We do not migrate tasks that are: * 1) throttled_lb_pair, or @@ -652,7 +652,7 @@ Signed-off-by: Sebastian Andrzej Siewior int cpu; schedstat_inc(p->se.statistics.nr_failed_migrations_affine); -@@ -7395,7 +7395,7 @@ int can_migrate_task(struct task_struct +@@ -7420,7 +7420,7 @@ int can_migrate_task(struct task_struct /* Prevent to re-select dst_cpu via env's CPUs: */ for_each_cpu_and(cpu, env->dst_grpmask, env->cpus) { @@ -661,7 +661,7 @@ Signed-off-by: Sebastian Andrzej Siewior env->flags |= LBF_DST_PINNED; env->new_dst_cpu = cpu; break; -@@ -7992,7 +7992,7 @@ check_cpu_capacity(struct rq *rq, struct +@@ -8017,7 +8017,7 @@ check_cpu_capacity(struct rq *rq, struct /* * Group imbalance indicates (and tries to solve) the problem where balancing @@ -670,7 +670,7 @@ Signed-off-by: Sebastian Andrzej Siewior * * Imagine a situation of two groups of 4 CPUs each and 4 tasks each with a * cpumask covering 1 CPU of the first group and 3 CPUs of the second group. -@@ -8663,7 +8663,7 @@ static struct sched_group *find_busiest_ +@@ -8688,7 +8688,7 @@ static struct sched_group *find_busiest_ /* * If the busiest group is imbalanced the below checks don't * work because they assume all things are equal, which typically @@ -679,7 +679,7 @@ Signed-off-by: Sebastian Andrzej Siewior */ if (busiest->group_type == group_imbalanced) goto force_balance; -@@ -9091,7 +9091,7 @@ static int load_balance(int this_cpu, st +@@ -9116,7 +9116,7 @@ static int load_balance(int this_cpu, st * if the curr task on busiest CPU can't be * moved to this_cpu: */ diff --git a/debian/patches-rt/kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch b/debian/patches-rt/kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch index 1ca71afde..e0b01b2a1 100644 --- a/debian/patches-rt/kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch +++ b/debian/patches-rt/kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Mon, 21 Nov 2016 19:31:08 +0100 Subject: [PATCH] kernel/sched: move stack + kprobe clean up to __put_task_struct() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz There is no need to free the stack before the task struct (except for reasons mentioned in commit 68f24b08ee89 ("sched/core: Free the stack early if diff --git a/debian/patches-rt/kmemleak-Turn-kmemleak_lock-to-raw-spinlock-on-RT.patch b/debian/patches-rt/kmemleak-Turn-kmemleak_lock-to-raw-spinlock-on-RT.patch index 77d9037d2..34730996e 100644 --- a/debian/patches-rt/kmemleak-Turn-kmemleak_lock-to-raw-spinlock-on-RT.patch +++ b/debian/patches-rt/kmemleak-Turn-kmemleak_lock-to-raw-spinlock-on-RT.patch @@ -1,7 +1,7 @@ From: He Zhe Date: Wed, 19 Dec 2018 16:30:57 +0100 Subject: [PATCH] kmemleak: Turn kmemleak_lock to raw spinlock on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz kmemleak_lock, as a rwlock on RT, can possibly be held in atomic context and causes the follow BUG. diff --git a/debian/patches-rt/kthread-Do-not-use-TIMER_IRQSAFE.patch b/debian/patches-rt/kthread-Do-not-use-TIMER_IRQSAFE.patch index acc1fd8bb..be11fca87 100644 --- a/debian/patches-rt/kthread-Do-not-use-TIMER_IRQSAFE.patch +++ b/debian/patches-rt/kthread-Do-not-use-TIMER_IRQSAFE.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Tue, 12 Feb 2019 12:57:45 +0100 Subject: [PATCH] kthread: Do not use TIMER_IRQSAFE -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The TIMER_IRQSAFE was introduced in commit diff --git a/debian/patches-rt/kthread-add-a-global-worker-thread.patch b/debian/patches-rt/kthread-add-a-global-worker-thread.patch index 26f096318..93a90cc6c 100644 --- a/debian/patches-rt/kthread-add-a-global-worker-thread.patch +++ b/debian/patches-rt/kthread-add-a-global-worker-thread.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Tue, 12 Feb 2019 15:09:38 +0100 Subject: [PATCH] kthread: add a global worker thread. -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Add kthread_schedule_work() which uses a global kthread for all its jobs. diff --git a/debian/patches-rt/kthread-convert-worker-lock-to-raw-spinlock.patch b/debian/patches-rt/kthread-convert-worker-lock-to-raw-spinlock.patch index e9c899ab2..85d45f49e 100644 --- a/debian/patches-rt/kthread-convert-worker-lock-to-raw-spinlock.patch +++ b/debian/patches-rt/kthread-convert-worker-lock-to-raw-spinlock.patch @@ -1,7 +1,7 @@ From: Julia Cartwright Date: Fri, 28 Sep 2018 21:03:51 +0000 Subject: [PATCH] kthread: convert worker lock to raw spinlock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz In order to enable the queuing of kthread work items from hardirq context even when PREEMPT_RT_FULL is enabled, convert the worker diff --git a/debian/patches-rt/leds-trigger-disable-CPU-trigger-on-RT.patch b/debian/patches-rt/leds-trigger-disable-CPU-trigger-on-RT.patch index 8ac771afc..60dad335c 100644 --- a/debian/patches-rt/leds-trigger-disable-CPU-trigger-on-RT.patch +++ b/debian/patches-rt/leds-trigger-disable-CPU-trigger-on-RT.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 23 Jan 2014 14:45:59 +0100 Subject: leds: trigger: disable CPU trigger on -RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz as it triggers: |CPU: 0 PID: 0 Comm: swapper Not tainted 3.12.8-rt10 #141 diff --git a/debian/patches-rt/list_bl-fixup-bogus-lockdep-warning.patch b/debian/patches-rt/list_bl-fixup-bogus-lockdep-warning.patch index 7378e8f5b..de125f3e2 100644 --- a/debian/patches-rt/list_bl-fixup-bogus-lockdep-warning.patch +++ b/debian/patches-rt/list_bl-fixup-bogus-lockdep-warning.patch @@ -1,7 +1,7 @@ From: Josh Cartwright Date: Thu, 31 Mar 2016 00:04:25 -0500 Subject: [PATCH] list_bl: fixup bogus lockdep warning -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz At first glance, the use of 'static inline' seems appropriate for INIT_HLIST_BL_HEAD(). diff --git a/debian/patches-rt/list_bl.h-make-list-head-locking-RT-safe.patch b/debian/patches-rt/list_bl.h-make-list-head-locking-RT-safe.patch index cdc6cc72d..37c63205f 100644 --- a/debian/patches-rt/list_bl.h-make-list-head-locking-RT-safe.patch +++ b/debian/patches-rt/list_bl.h-make-list-head-locking-RT-safe.patch @@ -1,7 +1,7 @@ From: Paul Gortmaker Date: Fri, 21 Jun 2013 15:07:25 -0400 Subject: list_bl: Make list head locking RT safe -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz As per changes in include/linux/jbd_common.h for avoiding the bit_spin_locks on RT ("fs: jbd/jbd2: Make state lock and journal diff --git a/debian/patches-rt/locallock-provide-get-put-_locked_ptr-variants.patch b/debian/patches-rt/locallock-provide-get-put-_locked_ptr-variants.patch index ca7b127dc..1b21604fb 100644 --- a/debian/patches-rt/locallock-provide-get-put-_locked_ptr-variants.patch +++ b/debian/patches-rt/locallock-provide-get-put-_locked_ptr-variants.patch @@ -1,7 +1,7 @@ From: Julia Cartwright Date: Mon, 7 May 2018 08:58:56 -0500 Subject: [PATCH] locallock: provide {get,put}_locked_ptr() variants -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Provide a set of locallocked accessors for pointers to per-CPU data; this is useful for dynamically-allocated per-CPU regions, for example. diff --git a/debian/patches-rt/localversion.patch b/debian/patches-rt/localversion.patch index 3362befa5..f3235db74 100644 --- a/debian/patches-rt/localversion.patch +++ b/debian/patches-rt/localversion.patch @@ -1,7 +1,7 @@ Subject: Add localversion for -RT release From: Thomas Gleixner Date: Fri, 08 Jul 2011 20:25:16 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Signed-off-by: Thomas Gleixner --- @@ -11,4 +11,4 @@ Signed-off-by: Thomas Gleixner --- /dev/null +++ b/localversion-rt @@ -0,0 +1 @@ -+-rt5 ++-rt7 diff --git a/debian/patches-rt/lockdep-disable-self-test.patch b/debian/patches-rt/lockdep-disable-self-test.patch index 684adec78..4a515a96f 100644 --- a/debian/patches-rt/lockdep-disable-self-test.patch +++ b/debian/patches-rt/lockdep-disable-self-test.patch @@ -4,7 +4,7 @@ Subject: [PATCH] lockdep: disable self-test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The self-test wasn't always 100% accurate for RT. We disabled a few tests which failed because they had a different semantic for RT. Some diff --git a/debian/patches-rt/lockdep-no-softirq-accounting-on-rt.patch b/debian/patches-rt/lockdep-no-softirq-accounting-on-rt.patch index 65423c599..ea53770cc 100644 --- a/debian/patches-rt/lockdep-no-softirq-accounting-on-rt.patch +++ b/debian/patches-rt/lockdep-no-softirq-accounting-on-rt.patch @@ -1,7 +1,7 @@ Subject: lockdep: Make it RT aware From: Thomas Gleixner Date: Sun, 17 Jul 2011 18:51:23 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz teach lockdep that we don't really do softirqs on -RT. diff --git a/debian/patches-rt/lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch b/debian/patches-rt/lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch index 30a5db891..6bb113a81 100644 --- a/debian/patches-rt/lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch +++ b/debian/patches-rt/lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch @@ -1,7 +1,7 @@ From: Josh Cartwright Date: Wed, 28 Jan 2015 13:08:45 -0600 Subject: lockdep: selftest: fix warnings due to missing PREEMPT_RT conditionals -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz "lockdep: Selftest: Only do hardirq context test for raw spinlock" disabled the execution of certain tests with PREEMPT_RT_FULL, but did diff --git a/debian/patches-rt/lockdep-selftest-only-do-hardirq-context-test-for-raw-spinlock.patch b/debian/patches-rt/lockdep-selftest-only-do-hardirq-context-test-for-raw-spinlock.patch index 1145e812f..f89567444 100644 --- a/debian/patches-rt/lockdep-selftest-only-do-hardirq-context-test-for-raw-spinlock.patch +++ b/debian/patches-rt/lockdep-selftest-only-do-hardirq-context-test-for-raw-spinlock.patch @@ -1,7 +1,7 @@ Subject: lockdep: selftest: Only do hardirq context test for raw spinlock From: Yong Zhang Date: Mon, 16 Apr 2012 15:01:56 +0800 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz From: Yong Zhang diff --git a/debian/patches-rt/locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch b/debian/patches-rt/locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch index 9505e70e6..25beaece5 100644 --- a/debian/patches-rt/locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch +++ b/debian/patches-rt/locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 4 Aug 2017 17:40:42 +0200 Subject: [PATCH 1/2] locking: don't check for __LINUX_SPINLOCK_TYPES_H on -RT archs -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Upstream uses arch_spinlock_t within spinlock_t and requests that spinlock_types.h header file is included first. diff --git a/debian/patches-rt/locking-locktorture-Do-NOT-include-rwlock.h-directly.patch b/debian/patches-rt/locking-locktorture-Do-NOT-include-rwlock.h-directly.patch index 0445b57b8..f3cb62d5a 100644 --- a/debian/patches-rt/locking-locktorture-Do-NOT-include-rwlock.h-directly.patch +++ b/debian/patches-rt/locking-locktorture-Do-NOT-include-rwlock.h-directly.patch @@ -1,7 +1,7 @@ From: "Wolfgang M. Reimer" Date: Tue, 21 Jul 2015 16:20:07 +0200 Subject: locking: locktorture: Do NOT include rwlock.h directly -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Including rwlock.h directly will cause kernel builds to fail if CONFIG_PREEMPT_RT_FULL is defined. The correct header file diff --git a/debian/patches-rt/locking-rt-mutex-Flush-block-plug-on-__down_read.patch b/debian/patches-rt/locking-rt-mutex-Flush-block-plug-on-__down_read.patch index 81e5bf074..e7388bec1 100644 --- a/debian/patches-rt/locking-rt-mutex-Flush-block-plug-on-__down_read.patch +++ b/debian/patches-rt/locking-rt-mutex-Flush-block-plug-on-__down_read.patch @@ -1,7 +1,7 @@ From: Scott Wood Date: Fri, 4 Jan 2019 15:33:21 -0500 Subject: [PATCH] locking/rt-mutex: Flush block plug on __down_read() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz __down_read() bypasses the rtmutex frontend to call rt_mutex_slowlock_locked() directly, and thus it needs to call diff --git a/debian/patches-rt/locking-rt-mutex-fix-deadlock-in-device-mapper-block.patch b/debian/patches-rt/locking-rt-mutex-fix-deadlock-in-device-mapper-block.patch index 9bf4d8dd5..c6af5f5ff 100644 --- a/debian/patches-rt/locking-rt-mutex-fix-deadlock-in-device-mapper-block.patch +++ b/debian/patches-rt/locking-rt-mutex-fix-deadlock-in-device-mapper-block.patch @@ -1,7 +1,7 @@ From: Mikulas Patocka Date: Mon, 13 Nov 2017 12:56:53 -0500 Subject: [PATCH] locking/rt-mutex: fix deadlock in device mapper / block-IO -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz When some block device driver creates a bio and submits it to another block device driver, the bio is added to current->bio_list (in order to diff --git a/debian/patches-rt/locking-rtmutex-re-init-the-wait_lock-in-rt_mutex_in.patch b/debian/patches-rt/locking-rtmutex-re-init-the-wait_lock-in-rt_mutex_in.patch index 0ffbe341e..1b8f6ab4d 100644 --- a/debian/patches-rt/locking-rtmutex-re-init-the-wait_lock-in-rt_mutex_in.patch +++ b/debian/patches-rt/locking-rtmutex-re-init-the-wait_lock-in-rt_mutex_in.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 16 Nov 2017 16:48:48 +0100 Subject: [PATCH] locking/rtmutex: re-init the wait_lock in rt_mutex_init_proxy_locked() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz We could provide a key-class for the lockdep (and fixup all callers) or move the init to all callers (like it was) in order to avoid lockdep diff --git a/debian/patches-rt/md-disable-bcache.patch b/debian/patches-rt/md-disable-bcache.patch index 2c9741f73..6ed3ba6cc 100644 --- a/debian/patches-rt/md-disable-bcache.patch +++ b/debian/patches-rt/md-disable-bcache.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 29 Aug 2013 11:48:57 +0200 Subject: md: disable bcache -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz It uses anon semaphores |drivers/md/bcache/request.c: In function ‘cached_dev_write_complete’: diff --git a/debian/patches-rt/md-raid5-percpu-handling-rt-aware.patch b/debian/patches-rt/md-raid5-percpu-handling-rt-aware.patch index c536c8872..766c365d4 100644 --- a/debian/patches-rt/md-raid5-percpu-handling-rt-aware.patch +++ b/debian/patches-rt/md-raid5-percpu-handling-rt-aware.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Tue, 6 Apr 2010 16:51:31 +0200 Subject: md: raid5: Make raid5_percpu handling RT aware -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz __raid_run_ops() disables preemption with get_cpu() around the access to the raid5_percpu variables. That causes scheduling while atomic diff --git a/debian/patches-rt/mips-disable-highmem-on-rt.patch b/debian/patches-rt/mips-disable-highmem-on-rt.patch index 9686fad70..75b064803 100644 --- a/debian/patches-rt/mips-disable-highmem-on-rt.patch +++ b/debian/patches-rt/mips-disable-highmem-on-rt.patch @@ -1,7 +1,7 @@ Subject: mips: Disable highmem on RT From: Thomas Gleixner Date: Mon, 18 Jul 2011 17:10:12 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The current highmem handling on -RT is not compatible and needs fixups. diff --git a/debian/patches-rt/mm-convert-swap-to-percpu-locked.patch b/debian/patches-rt/mm-convert-swap-to-percpu-locked.patch index 4e76f9391..f3ab16e6b 100644 --- a/debian/patches-rt/mm-convert-swap-to-percpu-locked.patch +++ b/debian/patches-rt/mm-convert-swap-to-percpu-locked.patch @@ -1,7 +1,7 @@ From: Ingo Molnar Date: Fri, 3 Jul 2009 08:29:51 -0500 Subject: mm/swap: Convert to percpu locked -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Replace global locks (get_cpu + local_irq_save) with "local_locks()". Currently there is one of for "rotate" and one for "swap". diff --git a/debian/patches-rt/mm-disable-sloub-rt.patch b/debian/patches-rt/mm-disable-sloub-rt.patch index 3f1b81ee0..751c9def4 100644 --- a/debian/patches-rt/mm-disable-sloub-rt.patch +++ b/debian/patches-rt/mm-disable-sloub-rt.patch @@ -1,7 +1,7 @@ From: Ingo Molnar Date: Fri, 3 Jul 2009 08:44:03 -0500 Subject: mm: Allow only slub on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Disable SLAB and SLOB on -RT. Only SLUB is adopted to -RT needs. diff --git a/debian/patches-rt/mm-enable-slub.patch b/debian/patches-rt/mm-enable-slub.patch index 7e295275d..ca8c555cf 100644 --- a/debian/patches-rt/mm-enable-slub.patch +++ b/debian/patches-rt/mm-enable-slub.patch @@ -1,7 +1,7 @@ Subject: mm: Enable SLUB for RT From: Thomas Gleixner Date: Thu, 25 Oct 2012 10:32:35 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Avoid the memory allocation in IRQ section diff --git a/debian/patches-rt/mm-make-vmstat-rt-aware.patch b/debian/patches-rt/mm-make-vmstat-rt-aware.patch index 3c2db4e94..57a2c6247 100644 --- a/debian/patches-rt/mm-make-vmstat-rt-aware.patch +++ b/debian/patches-rt/mm-make-vmstat-rt-aware.patch @@ -1,7 +1,7 @@ From: Ingo Molnar Date: Fri, 3 Jul 2009 08:30:13 -0500 Subject: mm/vmstat: Protect per cpu variables with preempt disable on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Disable preemption on -RT for the vmstat code. On vanila the code runs in IRQ-off regions while on -RT it is not. "preempt_disable" ensures that the diff --git a/debian/patches-rt/mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch b/debian/patches-rt/mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch index ef6ebfe59..327edaefb 100644 --- a/debian/patches-rt/mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch +++ b/debian/patches-rt/mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch @@ -1,7 +1,7 @@ From: Yang Shi Subject: mm/memcontrol: Don't call schedule_work_on in preemption disabled context Date: Wed, 30 Oct 2013 11:48:33 -0700 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The following trace is triggered when running ltp oom test cases: diff --git a/debian/patches-rt/mm-memcontrol-do_not_disable_irq.patch b/debian/patches-rt/mm-memcontrol-do_not_disable_irq.patch index bd70221f4..bd979c641 100644 --- a/debian/patches-rt/mm-memcontrol-do_not_disable_irq.patch +++ b/debian/patches-rt/mm-memcontrol-do_not_disable_irq.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Subject: mm/memcontrol: Replace local_irq_disable with local locks Date: Wed, 28 Jan 2015 17:14:16 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz There are a few local_irq_disable() which then take sleeping locks. This patch converts them local locks. @@ -30,7 +30,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* Whether legacy memory+swap accounting is active */ static bool do_memsw_account(void) { -@@ -4853,12 +4856,12 @@ static int mem_cgroup_move_account(struc +@@ -4869,12 +4872,12 @@ static int mem_cgroup_move_account(struc ret = 0; @@ -45,7 +45,7 @@ Signed-off-by: Sebastian Andrzej Siewior out_unlock: unlock_page(page); out: -@@ -5977,10 +5980,10 @@ void mem_cgroup_commit_charge(struct pag +@@ -5993,10 +5996,10 @@ void mem_cgroup_commit_charge(struct pag commit_charge(page, memcg, lrucare); @@ -58,7 +58,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (do_memsw_account() && PageSwapCache(page)) { swp_entry_t entry = { .val = page_private(page) }; -@@ -6049,7 +6052,7 @@ static void uncharge_batch(const struct +@@ -6065,7 +6068,7 @@ static void uncharge_batch(const struct memcg_oom_recover(ug->memcg); } @@ -67,7 +67,7 @@ Signed-off-by: Sebastian Andrzej Siewior __mod_memcg_state(ug->memcg, MEMCG_RSS, -ug->nr_anon); __mod_memcg_state(ug->memcg, MEMCG_CACHE, -ug->nr_file); __mod_memcg_state(ug->memcg, MEMCG_RSS_HUGE, -ug->nr_huge); -@@ -6057,7 +6060,7 @@ static void uncharge_batch(const struct +@@ -6073,7 +6076,7 @@ static void uncharge_batch(const struct __count_memcg_events(ug->memcg, PGPGOUT, ug->pgpgout); __this_cpu_add(ug->memcg->stat_cpu->nr_page_events, nr_pages); memcg_check_events(ug->memcg, ug->dummy_page); @@ -76,7 +76,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (!mem_cgroup_is_root(ug->memcg)) css_put_many(&ug->memcg->css, nr_pages); -@@ -6220,10 +6223,10 @@ void mem_cgroup_migrate(struct page *old +@@ -6236,10 +6239,10 @@ void mem_cgroup_migrate(struct page *old commit_charge(newpage, memcg, false); @@ -89,7 +89,7 @@ Signed-off-by: Sebastian Andrzej Siewior } DEFINE_STATIC_KEY_FALSE(memcg_sockets_enabled_key); -@@ -6415,6 +6418,7 @@ void mem_cgroup_swapout(struct page *pag +@@ -6431,6 +6434,7 @@ void mem_cgroup_swapout(struct page *pag struct mem_cgroup *memcg, *swap_memcg; unsigned int nr_entries; unsigned short oldid; @@ -97,7 +97,7 @@ Signed-off-by: Sebastian Andrzej Siewior VM_BUG_ON_PAGE(PageLRU(page), page); VM_BUG_ON_PAGE(page_count(page), page); -@@ -6460,13 +6464,17 @@ void mem_cgroup_swapout(struct page *pag +@@ -6476,13 +6480,17 @@ void mem_cgroup_swapout(struct page *pag * important here to have the interrupts disabled because it is the * only synchronisation we have for updating the per-CPU variables. */ diff --git a/debian/patches-rt/mm-page_alloc-rt-friendly-per-cpu-pages.patch b/debian/patches-rt/mm-page_alloc-rt-friendly-per-cpu-pages.patch index d854ed4e3..5e7b494a1 100644 --- a/debian/patches-rt/mm-page_alloc-rt-friendly-per-cpu-pages.patch +++ b/debian/patches-rt/mm-page_alloc-rt-friendly-per-cpu-pages.patch @@ -1,7 +1,7 @@ From: Ingo Molnar Date: Fri, 3 Jul 2009 08:29:37 -0500 Subject: mm: page_alloc: rt-friendly per-cpu pages -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz rt-friendly per-cpu pages: convert the irqs-off per-cpu locking method into a preemptible, explicit-per-cpu-locks method. diff --git a/debian/patches-rt/mm-perform-lru_add_drain_all-remotely.patch b/debian/patches-rt/mm-perform-lru_add_drain_all-remotely.patch index c85ca9c9c..29d986b2d 100644 --- a/debian/patches-rt/mm-perform-lru_add_drain_all-remotely.patch +++ b/debian/patches-rt/mm-perform-lru_add_drain_all-remotely.patch @@ -1,7 +1,7 @@ From: Luiz Capitulino Date: Fri, 27 May 2016 15:03:28 +0200 Subject: [PATCH] mm: perform lru_add_drain_all() remotely -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz lru_add_drain_all() works by scheduling lru_add_drain_cpu() to run on all CPUs that have non-empty LRU pagevecs and then waiting for diff --git a/debian/patches-rt/mm-protect-activate-switch-mm.patch b/debian/patches-rt/mm-protect-activate-switch-mm.patch index 1e5c1cc92..0e65bf316 100644 --- a/debian/patches-rt/mm-protect-activate-switch-mm.patch +++ b/debian/patches-rt/mm-protect-activate-switch-mm.patch @@ -1,7 +1,7 @@ From: Yong Zhang Date: Tue, 15 May 2012 13:53:56 +0800 Subject: mm: Protect activate_mm() by preempt_[disable&enable]_rt() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz User preempt_*_rt instead of local_irq_*_rt or otherwise there will be warning on ARM like below: diff --git a/debian/patches-rt/mm-rt-kmap-atomic-scheduling.patch b/debian/patches-rt/mm-rt-kmap-atomic-scheduling.patch index 734d38235..71f484563 100644 --- a/debian/patches-rt/mm-rt-kmap-atomic-scheduling.patch +++ b/debian/patches-rt/mm-rt-kmap-atomic-scheduling.patch @@ -1,7 +1,7 @@ Subject: mm, rt: kmap_atomic scheduling From: Peter Zijlstra Date: Thu, 28 Jul 2011 10:43:51 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz In fact, with migrate_disable() existing one could play games with kmap_atomic. You could save/restore the kmap_atomic slots on context diff --git a/debian/patches-rt/mm-scatterlist-dont-disable-irqs-on-RT.patch b/debian/patches-rt/mm-scatterlist-dont-disable-irqs-on-RT.patch index 6503935da..23a8a0640 100644 --- a/debian/patches-rt/mm-scatterlist-dont-disable-irqs-on-RT.patch +++ b/debian/patches-rt/mm-scatterlist-dont-disable-irqs-on-RT.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Fri, 3 Jul 2009 08:44:34 -0500 Subject: mm/scatterlist: Do not disable irqs on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz For -RT it is enough to keep pagefault disabled (which is currently handled by kmap_atomic()). diff --git a/debian/patches-rt/mm-vmalloc-use-get-cpu-light.patch b/debian/patches-rt/mm-vmalloc-use-get-cpu-light.patch index 49f350625..5be89b0cf 100644 --- a/debian/patches-rt/mm-vmalloc-use-get-cpu-light.patch +++ b/debian/patches-rt/mm-vmalloc-use-get-cpu-light.patch @@ -1,7 +1,7 @@ Subject: mm/vmalloc: Another preempt disable region which sucks From: Thomas Gleixner Date: Tue, 12 Jul 2011 11:39:36 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Avoid the preempt disable version of get_cpu_var(). The inner-lock should provide enough serialisation. diff --git a/debian/patches-rt/mm-workingset-replace-IRQ-off-check-with-a-lockdep-a.patch b/debian/patches-rt/mm-workingset-replace-IRQ-off-check-with-a-lockdep-a.patch index 6b5ff56d8..0b96d32fa 100644 --- a/debian/patches-rt/mm-workingset-replace-IRQ-off-check-with-a-lockdep-a.patch +++ b/debian/patches-rt/mm-workingset-replace-IRQ-off-check-with-a-lockdep-a.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Mon, 11 Feb 2019 10:40:46 +0100 Subject: [PATCH] mm: workingset: replace IRQ-off check with a lockdep assert. -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Commit diff --git a/debian/patches-rt/mm_zsmalloc_copy_with_get_cpu_var_and_locking.patch b/debian/patches-rt/mm_zsmalloc_copy_with_get_cpu_var_and_locking.patch index 8bc5c8d23..80c6676c4 100644 --- a/debian/patches-rt/mm_zsmalloc_copy_with_get_cpu_var_and_locking.patch +++ b/debian/patches-rt/mm_zsmalloc_copy_with_get_cpu_var_and_locking.patch @@ -1,7 +1,7 @@ From: Mike Galbraith Date: Tue, 22 Mar 2016 11:16:09 +0100 Subject: [PATCH] mm/zsmalloc: copy with get_cpu_var() and locking -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz get_cpu_var() disables preemption and triggers a might_sleep() splat later. This is replaced with get_locked_var(). diff --git a/debian/patches-rt/mutex-no-spin-on-rt.patch b/debian/patches-rt/mutex-no-spin-on-rt.patch index 6ca0622fb..ade291ba3 100644 --- a/debian/patches-rt/mutex-no-spin-on-rt.patch +++ b/debian/patches-rt/mutex-no-spin-on-rt.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Sun, 17 Jul 2011 21:51:45 +0200 Subject: locking: Disable spin on owner for RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Drop spin on owner for mutex / rwsem. We are most likely not using it but… diff --git a/debian/patches-rt/net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch b/debian/patches-rt/net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch index 7fb4089d9..ce85aa7e8 100644 --- a/debian/patches-rt/net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch +++ b/debian/patches-rt/net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch @@ -2,7 +2,7 @@ From: Steven Rostedt Date: Tue, 6 Dec 2016 17:50:30 -0500 Subject: [PATCH] net: Have __napi_schedule_irqoff() disable interrupts on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz A customer hit a crash where the napi sd->poll_list became corrupted. The customer had the bnx2x driver, which does a @@ -51,7 +51,7 @@ Signed-off-by: Sebastian Andrzej Siewior { --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -6020,6 +6020,7 @@ bool napi_schedule_prep(struct napi_stru +@@ -6036,6 +6036,7 @@ bool napi_schedule_prep(struct napi_stru } EXPORT_SYMBOL(napi_schedule_prep); @@ -59,7 +59,7 @@ Signed-off-by: Sebastian Andrzej Siewior /** * __napi_schedule_irqoff - schedule for receive * @n: entry to schedule -@@ -6031,6 +6032,7 @@ void __napi_schedule_irqoff(struct napi_ +@@ -6047,6 +6048,7 @@ void __napi_schedule_irqoff(struct napi_ ____napi_schedule(this_cpu_ptr(&softnet_data), n); } EXPORT_SYMBOL(__napi_schedule_irqoff); diff --git a/debian/patches-rt/net-Qdisc-use-a-seqlock-instead-seqcount.patch b/debian/patches-rt/net-Qdisc-use-a-seqlock-instead-seqcount.patch index 1dd170bb5..0d1049d93 100644 --- a/debian/patches-rt/net-Qdisc-use-a-seqlock-instead-seqcount.patch +++ b/debian/patches-rt/net-Qdisc-use-a-seqlock-instead-seqcount.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 14 Sep 2016 17:36:35 +0200 Subject: [PATCH] net/Qdisc: use a seqlock instead seqcount -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The seqcount disables preemption on -RT while it is held which can't remove. Also we don't want the reader to spin for ages if the writer is diff --git a/debian/patches-rt/net-add-a-lock-around-icmp_sk.patch b/debian/patches-rt/net-add-a-lock-around-icmp_sk.patch index 10a4256ee..ebf7314bd 100644 --- a/debian/patches-rt/net-add-a-lock-around-icmp_sk.patch +++ b/debian/patches-rt/net-add-a-lock-around-icmp_sk.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 31 Aug 2016 17:54:09 +0200 Subject: [PATCH] net: add a lock around icmp_sk() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz It looks like the this_cpu_ptr() access in icmp_sk() is protected with local_bh_disable(). To avoid missing serialization in -RT I am adding diff --git a/debian/patches-rt/net-add-back-the-missing-serialization-in-ip_send_un.patch b/debian/patches-rt/net-add-back-the-missing-serialization-in-ip_send_un.patch index 1e58a0dfc..fce60c887 100644 --- a/debian/patches-rt/net-add-back-the-missing-serialization-in-ip_send_un.patch +++ b/debian/patches-rt/net-add-back-the-missing-serialization-in-ip_send_un.patch @@ -5,7 +5,7 @@ Subject: [PATCH] net: add back the missing serialization in MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Some time ago Sami Pietikäinen reported a crash on -RT in ip_send_unicast_reply() which was later fixed by Nicholas Mc Guire diff --git a/debian/patches-rt/net-another-local-irq-disable-alloc-atomic-headache.patch b/debian/patches-rt/net-another-local-irq-disable-alloc-atomic-headache.patch index 254f98834..b39f1589f 100644 --- a/debian/patches-rt/net-another-local-irq-disable-alloc-atomic-headache.patch +++ b/debian/patches-rt/net-another-local-irq-disable-alloc-atomic-headache.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Wed, 26 Sep 2012 16:21:08 +0200 Subject: net: Another local_irq_disable/kmalloc headache -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Replace it by a local lock. Though that's pretty inefficient :( diff --git a/debian/patches-rt/net-core-protect-users-of-napi_alloc_cache-against-r.patch b/debian/patches-rt/net-core-protect-users-of-napi_alloc_cache-against-r.patch index 248583b58..816d8ff6f 100644 --- a/debian/patches-rt/net-core-protect-users-of-napi_alloc_cache-against-r.patch +++ b/debian/patches-rt/net-core-protect-users-of-napi_alloc_cache-against-r.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 15 Jan 2016 16:33:34 +0100 Subject: net/core: protect users of napi_alloc_cache against reentrance -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz On -RT the code running in BH can not be moved to another CPU so CPU local variable remain local. However the code can be preempted diff --git a/debian/patches-rt/net-core-use-local_bh_disable-in-netif_rx_ni.patch b/debian/patches-rt/net-core-use-local_bh_disable-in-netif_rx_ni.patch index e09bef5c4..80d174c17 100644 --- a/debian/patches-rt/net-core-use-local_bh_disable-in-netif_rx_ni.patch +++ b/debian/patches-rt/net-core-use-local_bh_disable-in-netif_rx_ni.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 16 Jun 2017 19:03:16 +0200 Subject: [PATCH] net/core: use local_bh_disable() in netif_rx_ni() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz In 2004 netif_rx_ni() gained a preempt_disable() section around netif_rx() and its do_softirq() + testing for it. The do_softirq() part @@ -19,7 +19,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -4566,11 +4566,9 @@ int netif_rx_ni(struct sk_buff *skb) +@@ -4580,11 +4580,9 @@ int netif_rx_ni(struct sk_buff *skb) trace_netif_rx_ni_entry(skb); diff --git a/debian/patches-rt/net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch b/debian/patches-rt/net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch index 639aa1cc6..24de155fd 100644 --- a/debian/patches-rt/net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch +++ b/debian/patches-rt/net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 30 Mar 2016 13:36:29 +0200 Subject: [PATCH] net: dev: always take qdisc's busylock in __dev_xmit_skb() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The root-lock is dropped before dev_hard_start_xmit() is invoked and after setting the __QDISC___STATE_RUNNING bit. If this task is now pushed away @@ -21,7 +21,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -3486,7 +3486,11 @@ static inline int __dev_xmit_skb(struct +@@ -3500,7 +3500,11 @@ static inline int __dev_xmit_skb(struct * This permits qdisc->running owner to get the lock more * often and dequeue packets faster. */ diff --git a/debian/patches-rt/net-fix-iptable-xt-write-recseq-begin-rt-fallout.patch b/debian/patches-rt/net-fix-iptable-xt-write-recseq-begin-rt-fallout.patch index 24995eeb5..a5ee94394 100644 --- a/debian/patches-rt/net-fix-iptable-xt-write-recseq-begin-rt-fallout.patch +++ b/debian/patches-rt/net-fix-iptable-xt-write-recseq-begin-rt-fallout.patch @@ -1,7 +1,7 @@ Subject: net: netfilter: Serialize xt_write_recseq sections on RT From: Thomas Gleixner Date: Sun, 28 Oct 2012 11:18:08 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The netfilter code relies only on the implicit semantics of local_bh_disable() for serializing wt_write_recseq sections. RT breaks diff --git a/debian/patches-rt/net-make-devnet_rename_seq-a-mutex.patch b/debian/patches-rt/net-make-devnet_rename_seq-a-mutex.patch index 7d24fe778..9758e7c6a 100644 --- a/debian/patches-rt/net-make-devnet_rename_seq-a-mutex.patch +++ b/debian/patches-rt/net-make-devnet_rename_seq-a-mutex.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 20 Mar 2013 18:06:20 +0100 Subject: net: Add a mutex around devnet_rename_seq -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz On RT write_seqcount_begin() disables preemption and device_rename() allocates memory with GFP_KERNEL and grabs later the sysfs_mutex @@ -40,8 +40,8 @@ Signed-off-by: Thomas Gleixner goto retry; } -@@ -1187,20 +1189,17 @@ int dev_change_name(struct net_device *d - if (dev->flags & IFF_UP) +@@ -1201,20 +1203,17 @@ int dev_change_name(struct net_device *d + likely(!(dev->priv_flags & IFF_LIVE_RENAME_OK))) return -EBUSY; - write_seqcount_begin(&devnet_rename_seq); @@ -67,7 +67,7 @@ Signed-off-by: Thomas Gleixner if (oldname[0] && !strchr(oldname, '%')) netdev_info(dev, "renamed from %s\n", oldname); -@@ -1213,11 +1212,12 @@ int dev_change_name(struct net_device *d +@@ -1227,11 +1226,12 @@ int dev_change_name(struct net_device *d if (ret) { memcpy(dev->name, oldname, IFNAMSIZ); dev->name_assign_type = old_assign_type; @@ -83,7 +83,7 @@ Signed-off-by: Thomas Gleixner netdev_adjacent_rename_links(dev, oldname); -@@ -1238,7 +1238,8 @@ int dev_change_name(struct net_device *d +@@ -1252,7 +1252,8 @@ int dev_change_name(struct net_device *d /* err >= 0 after dev_alloc_name() or stores the first errno */ if (err >= 0) { err = ret; @@ -93,7 +93,7 @@ Signed-off-by: Thomas Gleixner memcpy(dev->name, oldname, IFNAMSIZ); memcpy(oldname, newname, IFNAMSIZ); dev->name_assign_type = old_assign_type; -@@ -1251,6 +1252,11 @@ int dev_change_name(struct net_device *d +@@ -1265,6 +1266,11 @@ int dev_change_name(struct net_device *d } return err; diff --git a/debian/patches-rt/net-move-xmit_recursion-to-per-task-variable-on-RT.patch b/debian/patches-rt/net-move-xmit_recursion-to-per-task-variable-on-RT.patch index c25fba344..1805e89ff 100644 --- a/debian/patches-rt/net-move-xmit_recursion-to-per-task-variable-on-RT.patch +++ b/debian/patches-rt/net-move-xmit_recursion-to-per-task-variable-on-RT.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 13 Jan 2016 15:55:02 +0100 Subject: net: move xmit_recursion to per-task variable on -RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz A softirq on -RT can be preempted. That means one task is in __dev_queue_xmit(), gets preempted and another task may enter @@ -37,7 +37,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * Time (in jiffies) of last Tx */ -@@ -2648,14 +2652,53 @@ void netdev_freemem(struct net_device *d +@@ -2651,14 +2655,53 @@ void netdev_freemem(struct net_device *d void synchronize_net(void); int init_dummy_netdev(struct net_device *dev); @@ -92,7 +92,7 @@ Signed-off-by: Sebastian Andrzej Siewior struct net_device *dev_get_by_index(struct net *net, int ifindex); struct net_device *__dev_get_by_index(struct net *net, int ifindex); struct net_device *dev_get_by_index_rcu(struct net *net, int ifindex); -@@ -3865,10 +3908,48 @@ static inline u32 netif_msg_init(int deb +@@ -3868,10 +3911,48 @@ static inline u32 netif_msg_init(int deb return (1U << debug_value) - 1; } @@ -142,7 +142,7 @@ Signed-off-by: Sebastian Andrzej Siewior } static inline bool __netif_tx_acquire(struct netdev_queue *txq) -@@ -3885,32 +3966,32 @@ static inline void __netif_tx_release(st +@@ -3888,32 +3969,32 @@ static inline void __netif_tx_release(st static inline void __netif_tx_lock_bh(struct netdev_queue *txq) { spin_lock_bh(&txq->_xmit_lock); @@ -194,7 +194,7 @@ Signed-off-by: Sebastian Andrzej Siewior struct task_struct *oom_reaper_list; --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -3558,8 +3558,10 @@ static void skb_update_prio(struct sk_bu +@@ -3572,8 +3572,10 @@ static void skb_update_prio(struct sk_bu #define skb_update_prio(skb) #endif @@ -205,7 +205,7 @@ Signed-off-by: Sebastian Andrzej Siewior /** * dev_loopback_xmit - loop back @skb -@@ -3850,9 +3852,12 @@ static int __dev_queue_xmit(struct sk_bu +@@ -3864,9 +3866,12 @@ static int __dev_queue_xmit(struct sk_bu if (dev->flags & IFF_UP) { int cpu = smp_processor_id(); /* ok because BHs are off */ @@ -220,7 +220,7 @@ Signed-off-by: Sebastian Andrzej Siewior goto recursion_alert; skb = validate_xmit_skb(skb, dev, &again); -@@ -3862,9 +3867,9 @@ static int __dev_queue_xmit(struct sk_bu +@@ -3876,9 +3881,9 @@ static int __dev_queue_xmit(struct sk_bu HARD_TX_LOCK(dev, txq, cpu); if (!netif_xmit_stopped(txq)) { @@ -232,7 +232,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (dev_xmit_complete(rc)) { HARD_TX_UNLOCK(dev, txq); goto out; -@@ -8485,7 +8490,7 @@ static void netdev_init_one_queue(struct +@@ -8501,7 +8506,7 @@ static void netdev_init_one_queue(struct /* Initialize queue lock */ spin_lock_init(&queue->_xmit_lock); netdev_set_xmit_lockdep_class(&queue->_xmit_lock, dev->type); diff --git a/debian/patches-rt/net-provide-a-way-to-delegate-processing-a-softirq-t.patch b/debian/patches-rt/net-provide-a-way-to-delegate-processing-a-softirq-t.patch index 4f78bf6cc..0b04d3a4c 100644 --- a/debian/patches-rt/net-provide-a-way-to-delegate-processing-a-softirq-t.patch +++ b/debian/patches-rt/net-provide-a-way-to-delegate-processing-a-softirq-t.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 20 Jan 2016 15:39:05 +0100 Subject: net: provide a way to delegate processing a softirq to ksoftirqd -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz If the NET_RX uses up all of his budget it moves the following NAPI invocations into the `ksoftirqd`. On -RT it does not do so. Instead it @@ -68,7 +68,7 @@ Signed-off-by: Sebastian Andrzej Siewior void raise_softirq_irqoff(unsigned int nr) --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -6450,7 +6450,7 @@ static __latent_entropy void net_rx_acti +@@ -6466,7 +6466,7 @@ static __latent_entropy void net_rx_acti list_splice_tail(&repoll, &list); list_splice(&list, &sd->poll_list); if (!list_empty(&sd->poll_list)) diff --git a/debian/patches-rt/net-sched-dev_deactivate_many-use-msleep-1-instead-o.patch b/debian/patches-rt/net-sched-dev_deactivate_many-use-msleep-1-instead-o.patch index 72ba31eeb..f718d0a96 100644 --- a/debian/patches-rt/net-sched-dev_deactivate_many-use-msleep-1-instead-o.patch +++ b/debian/patches-rt/net-sched-dev_deactivate_many-use-msleep-1-instead-o.patch @@ -1,7 +1,7 @@ From: Marc Kleine-Budde Date: Wed, 5 Mar 2014 00:49:47 +0100 Subject: net: sched: Use msleep() instead of yield() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz On PREEMPT_RT enabled systems the interrupt handler run as threads at prio 50 (by default). If a high priority userspace process tries to shut down a busy diff --git a/debian/patches-rt/net-use-cpu-chill.patch b/debian/patches-rt/net-use-cpu-chill.patch index 9267b9aea..11237a164 100644 --- a/debian/patches-rt/net-use-cpu-chill.patch +++ b/debian/patches-rt/net-use-cpu-chill.patch @@ -1,7 +1,7 @@ Subject: net: Use cpu_chill() instead of cpu_relax() From: Thomas Gleixner Date: Wed, 07 Mar 2012 21:10:04 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Retry loops on RT might loop forever when the modifying side was preempted. Use cpu_chill() instead of cpu_relax() to let the system diff --git a/debian/patches-rt/net_disable_NET_RX_BUSY_POLL.patch b/debian/patches-rt/net_disable_NET_RX_BUSY_POLL.patch index 5648c2c9c..df32d63b9 100644 --- a/debian/patches-rt/net_disable_NET_RX_BUSY_POLL.patch +++ b/debian/patches-rt/net_disable_NET_RX_BUSY_POLL.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Sat, 27 May 2017 19:02:06 +0200 Subject: net/core: disable NET_RX_BUSY_POLL -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz sk_busy_loop() does preempt_disable() followed by a few operations which can take sleeping locks and may get long. diff --git a/debian/patches-rt/of-allocate-free-phandle-cache-outside-of-the-devtre.patch b/debian/patches-rt/of-allocate-free-phandle-cache-outside-of-the-devtre.patch index bd7971d8d..6aade76fb 100644 --- a/debian/patches-rt/of-allocate-free-phandle-cache-outside-of-the-devtre.patch +++ b/debian/patches-rt/of-allocate-free-phandle-cache-outside-of-the-devtre.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 31 Aug 2018 14:16:30 +0200 Subject: [PATCH] of: allocate / free phandle cache outside of the devtree_lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The phandle cache code allocates memory while holding devtree_lock which is a raw_spinlock_t. Memory allocation (and free()) is not possible on diff --git a/debian/patches-rt/oleg-signal-rt-fix.patch b/debian/patches-rt/oleg-signal-rt-fix.patch index b914c436b..52c0a2d42 100644 --- a/debian/patches-rt/oleg-signal-rt-fix.patch +++ b/debian/patches-rt/oleg-signal-rt-fix.patch @@ -1,7 +1,7 @@ From: Oleg Nesterov Date: Tue, 14 Jul 2015 14:26:34 +0200 Subject: signal/x86: Delay calling signals in atomic -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz On x86_64 we must disable preemption before we enable interrupts for stack faults, int3 and debugging, because the current task is using diff --git a/debian/patches-rt/panic-disable-random-on-rt.patch b/debian/patches-rt/panic-disable-random-on-rt.patch index a128eae96..21717bac5 100644 --- a/debian/patches-rt/panic-disable-random-on-rt.patch +++ b/debian/patches-rt/panic-disable-random-on-rt.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Tue, 14 Jul 2015 14:26:34 +0200 Subject: panic: skip get_random_bytes for RT_FULL in init_oops_id -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Disable on -RT. If this is invoked from irq-context we will have problems to acquire the sleeping lock. diff --git a/debian/patches-rt/pci-switchtec-Don-t-use-completion-s-wait-queue.patch b/debian/patches-rt/pci-switchtec-Don-t-use-completion-s-wait-queue.patch index 36bbaea8c..fbe545ba4 100644 --- a/debian/patches-rt/pci-switchtec-Don-t-use-completion-s-wait-queue.patch +++ b/debian/patches-rt/pci-switchtec-Don-t-use-completion-s-wait-queue.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 4 Oct 2017 10:24:23 +0200 Subject: [PATCH] pci/switchtec: Don't use completion's wait queue -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The poll callback is using completion's wait_queue_head_t member and puts it in poll_wait() so the poll() caller gets a wakeup after command diff --git a/debian/patches-rt/percpu-include-irqflags.h-for-raw_local_irq_save.patch b/debian/patches-rt/percpu-include-irqflags.h-for-raw_local_irq_save.patch index a6deb2f0d..4bb7feb47 100644 --- a/debian/patches-rt/percpu-include-irqflags.h-for-raw_local_irq_save.patch +++ b/debian/patches-rt/percpu-include-irqflags.h-for-raw_local_irq_save.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 11 Oct 2018 16:39:59 +0200 Subject: [PATCH] percpu: include irqflags.h for raw_local_irq_save() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The header percpu.h header file is using raw_local_irq_save() but does not include irqflags.h for its definition. It compiles because the diff --git a/debian/patches-rt/peterz-percpu-rwsem-rt.patch b/debian/patches-rt/peterz-percpu-rwsem-rt.patch index 6cccd415d..cdd0d0f6e 100644 --- a/debian/patches-rt/peterz-percpu-rwsem-rt.patch +++ b/debian/patches-rt/peterz-percpu-rwsem-rt.patch @@ -1,7 +1,7 @@ Subject: locking/percpu-rwsem: Remove preempt_disable variants From: Peter Zijlstra Date: Wed Nov 23 16:29:32 CET 2016 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Effective revert commit: diff --git a/debian/patches-rt/pid.h-include-atomic.h.patch b/debian/patches-rt/pid.h-include-atomic.h.patch index 73c48bf7d..8f23ca552 100644 --- a/debian/patches-rt/pid.h-include-atomic.h.patch +++ b/debian/patches-rt/pid.h-include-atomic.h.patch @@ -1,7 +1,7 @@ From: Grygorii Strashko Date: Tue, 21 Jul 2015 19:43:56 +0300 Subject: pid.h: include atomic.h -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz This patch fixes build error: CC kernel/pid_namespace.o diff --git a/debian/patches-rt/posix-timers-thread-posix-cpu-timers-on-rt.patch b/debian/patches-rt/posix-timers-thread-posix-cpu-timers-on-rt.patch index 3ebfe7609..bd95e3fdb 100644 --- a/debian/patches-rt/posix-timers-thread-posix-cpu-timers-on-rt.patch +++ b/debian/patches-rt/posix-timers-thread-posix-cpu-timers-on-rt.patch @@ -1,7 +1,7 @@ From: John Stultz Date: Fri, 3 Jul 2009 08:29:58 -0500 Subject: posix-timers: Thread posix-cpu-timers on -rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz posix-cpu-timer code takes non -rt safe locks in hard irq context. Move it to a thread. diff --git a/debian/patches-rt/power-disable-highmem-on-rt.patch b/debian/patches-rt/power-disable-highmem-on-rt.patch index 4f8b87413..4d26856f4 100644 --- a/debian/patches-rt/power-disable-highmem-on-rt.patch +++ b/debian/patches-rt/power-disable-highmem-on-rt.patch @@ -1,7 +1,7 @@ Subject: powerpc: Disable highmem on RT From: Thomas Gleixner Date: Mon, 18 Jul 2011 17:08:34 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The current highmem handling on -RT is not compatible and needs fixups. diff --git a/debian/patches-rt/power-use-generic-rwsem-on-rt.patch b/debian/patches-rt/power-use-generic-rwsem-on-rt.patch index 639e669a4..a5ade7962 100644 --- a/debian/patches-rt/power-use-generic-rwsem-on-rt.patch +++ b/debian/patches-rt/power-use-generic-rwsem-on-rt.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Tue, 14 Jul 2015 14:26:34 +0200 Subject: powerpc: Use generic rwsem on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Use generic code which uses rtmutex diff --git a/debian/patches-rt/powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch b/debian/patches-rt/powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch index 145807331..43d65e0c5 100644 --- a/debian/patches-rt/powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch +++ b/debian/patches-rt/powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch @@ -1,7 +1,7 @@ From: Bogdan Purcareata Date: Fri, 24 Apr 2015 15:53:13 +0000 Subject: powerpc/kvm: Disable in-kernel MPIC emulation for PREEMPT_RT_FULL -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz While converting the openpic emulation code to use a raw_spinlock_t enables guests to run on RT, there's still a performance issue. For interrupts sent in diff --git a/debian/patches-rt/powerpc-preempt-lazy-support.patch b/debian/patches-rt/powerpc-preempt-lazy-support.patch index c2662c397..9c92643a3 100644 --- a/debian/patches-rt/powerpc-preempt-lazy-support.patch +++ b/debian/patches-rt/powerpc-preempt-lazy-support.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 1 Nov 2012 10:14:11 +0100 Subject: powerpc: Add support for lazy preemption -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Implement the powerpc pieces for lazy preempt. diff --git a/debian/patches-rt/powerpc-pseries-iommu-Use-a-locallock-instead-local_ir.patch b/debian/patches-rt/powerpc-pseries-iommu-Use-a-locallock-instead-local_ir.patch index b6860cd5e..aa70e602b 100644 --- a/debian/patches-rt/powerpc-pseries-iommu-Use-a-locallock-instead-local_ir.patch +++ b/debian/patches-rt/powerpc-pseries-iommu-Use-a-locallock-instead-local_ir.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Tue, 26 Mar 2019 18:31:54 +0100 Subject: [PATCH] powerpc/pseries/iommu: Use a locallock instead local_irq_save() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The locallock protects the per-CPU variable tce_page. The function attempts to allocate memory while tce_page is protected (by disabling diff --git a/debian/patches-rt/powerpc-stackprotector-work-around-stack-guard-init-.patch b/debian/patches-rt/powerpc-stackprotector-work-around-stack-guard-init-.patch index 8728ed0cf..9444fffc7 100644 --- a/debian/patches-rt/powerpc-stackprotector-work-around-stack-guard-init-.patch +++ b/debian/patches-rt/powerpc-stackprotector-work-around-stack-guard-init-.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Tue, 26 Mar 2019 18:31:29 +0100 Subject: [PATCH ] powerpc/stackprotector: work around stack-guard init from atomic -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz This is invoked from the secondary CPU in atomic context. On x86 we use tsc instead. On Power we XOR it against mftb() so lets use stack address diff --git a/debian/patches-rt/preempt-lazy-support.patch b/debian/patches-rt/preempt-lazy-support.patch index f861e0288..e2f10b6e4 100644 --- a/debian/patches-rt/preempt-lazy-support.patch +++ b/debian/patches-rt/preempt-lazy-support.patch @@ -1,7 +1,7 @@ Subject: sched: Add support for lazy preemption From: Thomas Gleixner Date: Fri, 26 Oct 2012 18:50:54 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz It has become an obsession to mitigate the determinism vs. throughput loss of RT. Looking at the mainline semantics of preemption points @@ -442,7 +442,7 @@ Signed-off-by: Thomas Gleixner } static __always_inline -@@ -5050,7 +5050,7 @@ static void hrtick_start_fair(struct rq +@@ -5075,7 +5075,7 @@ static void hrtick_start_fair(struct rq if (delta < 0) { if (rq->curr == p) @@ -451,7 +451,7 @@ Signed-off-by: Thomas Gleixner return; } hrtick_start(rq, delta); -@@ -6879,7 +6879,7 @@ static void check_preempt_wakeup(struct +@@ -6904,7 +6904,7 @@ static void check_preempt_wakeup(struct return; preempt: @@ -460,7 +460,7 @@ Signed-off-by: Thomas Gleixner /* * Only set the backward buddy when the current task is still * on the rq. This can happen when a wakeup gets interleaved -@@ -10075,7 +10075,7 @@ static void task_fork_fair(struct task_s +@@ -10100,7 +10100,7 @@ static void task_fork_fair(struct task_s * 'current' within the tree based on its new key value. */ swap(curr->vruntime, se->vruntime); @@ -469,7 +469,7 @@ Signed-off-by: Thomas Gleixner } se->vruntime -= cfs_rq->min_vruntime; -@@ -10099,7 +10099,7 @@ prio_changed_fair(struct rq *rq, struct +@@ -10124,7 +10124,7 @@ prio_changed_fair(struct rq *rq, struct */ if (rq->curr == p) { if (p->prio > oldprio) diff --git a/debian/patches-rt/preempt-nort-rt-variants.patch b/debian/patches-rt/preempt-nort-rt-variants.patch index 8703bf7bd..d859f8bbe 100644 --- a/debian/patches-rt/preempt-nort-rt-variants.patch +++ b/debian/patches-rt/preempt-nort-rt-variants.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Fri, 24 Jul 2009 12:38:56 +0200 Subject: preempt: Provide preempt_*_(no)rt variants -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz RT needs a few preempt_disable/enable points which are not necessary otherwise. Implement variants to avoid #ifdeffery. diff --git a/debian/patches-rt/printk-devkmsg-llseek-reset-clear-if-it-is-lost.patch b/debian/patches-rt/printk-devkmsg-llseek-reset-clear-if-it-is-lost.patch index 9baf753f5..4741569ef 100644 --- a/debian/patches-rt/printk-devkmsg-llseek-reset-clear-if-it-is-lost.patch +++ b/debian/patches-rt/printk-devkmsg-llseek-reset-clear-if-it-is-lost.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Fri, 22 Feb 2019 23:02:44 +0100 Subject: [PATCH] printk: devkmsg: llseek: reset clear if it is lost -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz SEEK_DATA will seek to the last clear record. If this clear record is no longer in the ring buffer, devkmsg_llseek() will go into an diff --git a/debian/patches-rt/printk-kmsg_dump-remove-mutex-usage.patch b/debian/patches-rt/printk-kmsg_dump-remove-mutex-usage.patch new file mode 100644 index 000000000..e3d259e7a --- /dev/null +++ b/debian/patches-rt/printk-kmsg_dump-remove-mutex-usage.patch @@ -0,0 +1,85 @@ +From: John Ogness +Date: Wed, 24 Apr 2019 16:36:04 +0200 +Subject: [PATCH] printk: kmsg_dump: remove mutex usage +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz + +The kmsg dumper can be called from any context, but the dumping +helpers were using a mutex to synchronize the iterator against +concurrent dumps. + +Rather than trying to synchronize the iterator, use a local copy +of the iterator during the dump. Then no synchronization is +required. + +Reported-by: Scott Wood +Signed-off-by: John Ogness +Signed-off-by: Sebastian Andrzej Siewior +--- + kernel/printk/printk.c | 23 ++++++++++------------- + 1 file changed, 10 insertions(+), 13 deletions(-) + +--- a/kernel/printk/printk.c ++++ b/kernel/printk/printk.c +@@ -359,8 +359,6 @@ static u64 syslog_seq; + static size_t syslog_partial; + static bool syslog_time; + +-static DEFINE_MUTEX(kmsg_dump_lock); +- + /* the last printk record at the last 'clear' command */ + static u64 clear_seq; + +@@ -2820,6 +2818,7 @@ module_param_named(always_kmsg_dump, alw + */ + void kmsg_dump(enum kmsg_dump_reason reason) + { ++ struct kmsg_dumper dumper_local; + struct kmsg_dumper *dumper; + + if ((reason > KMSG_DUMP_OOPS) && !always_kmsg_dump) +@@ -2830,16 +2829,18 @@ void kmsg_dump(enum kmsg_dump_reason rea + if (dumper->max_reason && reason > dumper->max_reason) + continue; + +- /* initialize iterator with data about the stored records */ +- dumper->active = true; ++ /* ++ * use a local copy to avoid modifying the ++ * iterator used by any other cpus/contexts ++ */ ++ memcpy(&dumper_local, dumper, sizeof(dumper_local)); + +- kmsg_dump_rewind(dumper); ++ /* initialize iterator with data about the stored records */ ++ dumper_local.active = true; ++ kmsg_dump_rewind(&dumper_local); + + /* invoke dumper which will iterate over records */ +- dumper->dump(dumper, reason); +- +- /* reset iterator */ +- dumper->active = false; ++ dumper_local.dump(&dumper_local, reason); + } + rcu_read_unlock(); + } +@@ -2951,9 +2952,7 @@ bool kmsg_dump_get_line(struct kmsg_dump + { + bool ret; + +- mutex_lock(&kmsg_dump_lock); + ret = kmsg_dump_get_line_nolock(dumper, syslog, line, size, len); +- mutex_unlock(&kmsg_dump_lock); + + return ret; + } +@@ -3105,9 +3104,7 @@ void kmsg_dump_rewind_nolock(struct kmsg + */ + void kmsg_dump_rewind(struct kmsg_dumper *dumper) + { +- mutex_lock(&kmsg_dump_lock); + kmsg_dump_rewind_nolock(dumper); +- mutex_unlock(&kmsg_dump_lock); + } + EXPORT_SYMBOL_GPL(kmsg_dump_rewind); + diff --git a/debian/patches-rt/printk-only-allow-kernel-to-emergency-message.patch b/debian/patches-rt/printk-only-allow-kernel-to-emergency-message.patch index 28574ca43..00ef366ac 100644 --- a/debian/patches-rt/printk-only-allow-kernel-to-emergency-message.patch +++ b/debian/patches-rt/printk-only-allow-kernel-to-emergency-message.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Sun, 17 Feb 2019 03:11:20 +0100 Subject: [PATCH] printk: only allow kernel to emergency message -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Emergency messages exist as a mechanism for the kernel to communicate critical information to users. It is not meant for diff --git a/debian/patches-rt/printk-print-rate-limitted-message-as-info.patch b/debian/patches-rt/printk-print-rate-limitted-message-as-info.patch index 882f41865..168832245 100644 --- a/debian/patches-rt/printk-print-rate-limitted-message-as-info.patch +++ b/debian/patches-rt/printk-print-rate-limitted-message-as-info.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 22 Feb 2019 12:47:13 +0100 Subject: [PATCH] printk: print "rate-limitted" message as info -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz If messages which are injected via kmsg are dropped then they don't need to be printed as warnings. This is to avoid latency spikes if the diff --git a/debian/patches-rt/printk-set-deferred-to-default-loglevel-enforce-mask.patch b/debian/patches-rt/printk-set-deferred-to-default-loglevel-enforce-mask.patch index 91802ea7c..69412ad92 100644 --- a/debian/patches-rt/printk-set-deferred-to-default-loglevel-enforce-mask.patch +++ b/debian/patches-rt/printk-set-deferred-to-default-loglevel-enforce-mask.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Thu, 14 Feb 2019 23:13:30 +0100 Subject: [PATCH] printk: set deferred to default loglevel, enforce mask -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz All messages printed via vpritnk_deferred() were being automatically treated as emergency messages. diff --git a/debian/patches-rt/psi-replace-delayed-work-with-timer-work.patch b/debian/patches-rt/psi-replace-delayed-work-with-timer-work.patch index c0cf3b5e7..947cc16ee 100644 --- a/debian/patches-rt/psi-replace-delayed-work-with-timer-work.patch +++ b/debian/patches-rt/psi-replace-delayed-work-with-timer-work.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Tue, 12 Feb 2019 15:03:03 +0100 Subject: [PATCH] psi: replace delayed work with timer + work -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz psi_task_change() is invoked with disabled interrupts and this does not allow to use schedule_delayed_work(). diff --git a/debian/patches-rt/ptrace-fix-ptrace-vs-tasklist_lock-race.patch b/debian/patches-rt/ptrace-fix-ptrace-vs-tasklist_lock-race.patch index 5194bd92c..e6662baa7 100644 --- a/debian/patches-rt/ptrace-fix-ptrace-vs-tasklist_lock-race.patch +++ b/debian/patches-rt/ptrace-fix-ptrace-vs-tasklist_lock-race.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 29 Aug 2013 18:21:04 +0200 Subject: ptrace: fix ptrace vs tasklist_lock race -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz As explained by Alexander Fyodorov : diff --git a/debian/patches-rt/radix-tree-use-local-locks.patch b/debian/patches-rt/radix-tree-use-local-locks.patch index 33afbb339..1d106f63c 100644 --- a/debian/patches-rt/radix-tree-use-local-locks.patch +++ b/debian/patches-rt/radix-tree-use-local-locks.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 25 Jan 2017 16:34:27 +0100 Subject: [PATCH] radix-tree: use local locks -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The preload functionality uses per-CPU variables and preempt-disable to ensure that it does not switch CPUs during its usage. This patch adds diff --git a/debian/patches-rt/random-avoid-preempt_disable-ed-section.patch b/debian/patches-rt/random-avoid-preempt_disable-ed-section.patch index a7f9fdef3..1ec2654d1 100644 --- a/debian/patches-rt/random-avoid-preempt_disable-ed-section.patch +++ b/debian/patches-rt/random-avoid-preempt_disable-ed-section.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 12 May 2017 15:46:17 +0200 Subject: [PATCH] random: avoid preempt_disable()ed section -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz extract_crng() will use sleeping locks while in a preempt_disable() section due to get_cpu_var(). diff --git a/debian/patches-rt/random-make-it-work-on-rt.patch b/debian/patches-rt/random-make-it-work-on-rt.patch index e6fc463c8..8dfa24b59 100644 --- a/debian/patches-rt/random-make-it-work-on-rt.patch +++ b/debian/patches-rt/random-make-it-work-on-rt.patch @@ -1,7 +1,7 @@ Subject: random: Make it work on rt From: Thomas Gleixner Date: Tue, 21 Aug 2012 20:38:50 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Delegate the random insertion to the forced threaded interrupt handler. Store the return IP of the hard interrupt handler in the irq diff --git a/debian/patches-rt/rcu-Eliminate-softirq-processing-from-rcutree.patch b/debian/patches-rt/rcu-Eliminate-softirq-processing-from-rcutree.patch index b44626848..b37b82d34 100644 --- a/debian/patches-rt/rcu-Eliminate-softirq-processing-from-rcutree.patch +++ b/debian/patches-rt/rcu-Eliminate-softirq-processing-from-rcutree.patch @@ -1,7 +1,7 @@ From: "Paul E. McKenney" Date: Mon, 4 Nov 2013 13:21:10 -0800 Subject: rcu: Eliminate softirq processing from rcutree -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Running RCU out of softirq is a problem for some workloads that would like to manage RCU core processing independently of other softirq work, diff --git a/debian/patches-rt/rcu-disable-rcu-fast-no-hz-on-rt.patch b/debian/patches-rt/rcu-disable-rcu-fast-no-hz-on-rt.patch index 52fa4410b..e08558c8d 100644 --- a/debian/patches-rt/rcu-disable-rcu-fast-no-hz-on-rt.patch +++ b/debian/patches-rt/rcu-disable-rcu-fast-no-hz-on-rt.patch @@ -1,7 +1,7 @@ Subject: rcu: Disable RCU_FAST_NO_HZ on RT From: Thomas Gleixner Date: Sun, 28 Oct 2012 13:26:09 +0000 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz This uses a timer_list timer from the irq disabled guts of the idle code. Disable it for now to prevent wreckage. diff --git a/debian/patches-rt/rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch b/debian/patches-rt/rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch index 4ca3b82aa..700b44f1a 100644 --- a/debian/patches-rt/rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch +++ b/debian/patches-rt/rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch @@ -1,7 +1,7 @@ From: Julia Cartwright Date: Wed, 12 Oct 2016 11:21:14 -0500 Subject: [PATCH] rcu: enable rcu_normal_after_boot by default for RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The forcing of an expedited grace period is an expensive and very RT-application unfriendly operation, as it forcibly preempts all running diff --git a/debian/patches-rt/rcu-make-RCU_BOOST-default-on-RT.patch b/debian/patches-rt/rcu-make-RCU_BOOST-default-on-RT.patch index b1bc3dde7..fb30de188 100644 --- a/debian/patches-rt/rcu-make-RCU_BOOST-default-on-RT.patch +++ b/debian/patches-rt/rcu-make-RCU_BOOST-default-on-RT.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 21 Mar 2014 20:19:05 +0100 Subject: rcu: make RCU_BOOST default on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Since it is no longer invoked from the softirq people run into OOM more often if the priority of the RCU thread is too low. Making boosting diff --git a/debian/patches-rt/re-preempt_rt_full-arm-coredump-fails-for-cpu-3e-3d-4.patch b/debian/patches-rt/re-preempt_rt_full-arm-coredump-fails-for-cpu-3e-3d-4.patch index 773d1ace6..831559f8c 100644 --- a/debian/patches-rt/re-preempt_rt_full-arm-coredump-fails-for-cpu-3e-3d-4.patch +++ b/debian/patches-rt/re-preempt_rt_full-arm-coredump-fails-for-cpu-3e-3d-4.patch @@ -1,7 +1,7 @@ Subject: ARM: Initialize split page table locks for vector page From: Frank Rowand Date: Sat, 1 Oct 2011 18:58:13 -0700 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Without this patch, ARM can not use SPLIT_PTLOCK_CPUS if PREEMPT_RT_FULL=y because vectors_user_mapping() creates a diff --git a/debian/patches-rt/rt-Increase-decrease-the-nr-of-migratory-tasks-when-.patch b/debian/patches-rt/rt-Increase-decrease-the-nr-of-migratory-tasks-when-.patch index c9e15fbdb..d89d679d9 100644 --- a/debian/patches-rt/rt-Increase-decrease-the-nr-of-migratory-tasks-when-.patch +++ b/debian/patches-rt/rt-Increase-decrease-the-nr-of-migratory-tasks-when-.patch @@ -1,7 +1,7 @@ From: Daniel Bristot de Oliveira Date: Mon, 26 Jun 2017 17:07:15 +0200 Subject: rt: Increase/decrease the nr of migratory tasks when enabling/disabling migration -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz There is a problem in the migrate_disable()/enable() implementation regarding the number of migratory tasks in the rt/dl RQs. The problem diff --git a/debian/patches-rt/rt-introduce-cpu-chill.patch b/debian/patches-rt/rt-introduce-cpu-chill.patch index 8f5774f79..ac8a97b1a 100644 --- a/debian/patches-rt/rt-introduce-cpu-chill.patch +++ b/debian/patches-rt/rt-introduce-cpu-chill.patch @@ -1,7 +1,7 @@ Subject: rt: Introduce cpu_chill() From: Thomas Gleixner Date: Wed, 07 Mar 2012 20:51:03 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Retry loops on RT might loop forever when the modifying side was preempted. Add cpu_chill() to replace cpu_relax(). cpu_chill() diff --git a/debian/patches-rt/rt-local-irq-lock.patch b/debian/patches-rt/rt-local-irq-lock.patch index eda05b85b..69e8be224 100644 --- a/debian/patches-rt/rt-local-irq-lock.patch +++ b/debian/patches-rt/rt-local-irq-lock.patch @@ -1,7 +1,7 @@ Subject: rt: Add local irq locks From: Thomas Gleixner Date: Mon, 20 Jun 2011 09:03:47 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Introduce locallock. For !RT this maps to preempt_disable()/ local_irq_disable() so there is not much that changes. For RT this will diff --git a/debian/patches-rt/rt-preempt-base-config.patch b/debian/patches-rt/rt-preempt-base-config.patch index 1562158ef..23395c4f5 100644 --- a/debian/patches-rt/rt-preempt-base-config.patch +++ b/debian/patches-rt/rt-preempt-base-config.patch @@ -1,7 +1,7 @@ Subject: rt: Provide PREEMPT_RT_BASE config switch From: Thomas Gleixner Date: Fri, 17 Jun 2011 12:39:57 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Introduce PREEMPT_RT_BASE which enables parts of PREEMPT_RT_FULL. Forces interrupt threading and enables some of the RT diff --git a/debian/patches-rt/rt-serial-warn-fix.patch b/debian/patches-rt/rt-serial-warn-fix.patch index f6b595626..2c63fe002 100644 --- a/debian/patches-rt/rt-serial-warn-fix.patch +++ b/debian/patches-rt/rt-serial-warn-fix.patch @@ -1,7 +1,7 @@ Subject: rt: Improve the serial console PASS_LIMIT From: Ingo Molnar Date: Wed Dec 14 13:05:54 CET 2011 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Beyond the warning: diff --git a/debian/patches-rt/rtmutex-Make-lock_killable-work.patch b/debian/patches-rt/rtmutex-Make-lock_killable-work.patch index 32076e056..bd8df0aa2 100644 --- a/debian/patches-rt/rtmutex-Make-lock_killable-work.patch +++ b/debian/patches-rt/rtmutex-Make-lock_killable-work.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Sat, 1 Apr 2017 12:50:59 +0200 Subject: [PATCH] rtmutex: Make lock_killable work -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Locking an rt mutex killable does not work because signal handling is restricted to TASK_INTERRUPTIBLE. diff --git a/debian/patches-rt/rtmutex-Provide-rt_mutex_slowlock_locked.patch b/debian/patches-rt/rtmutex-Provide-rt_mutex_slowlock_locked.patch index 06de6908b..a62bc9960 100644 --- a/debian/patches-rt/rtmutex-Provide-rt_mutex_slowlock_locked.patch +++ b/debian/patches-rt/rtmutex-Provide-rt_mutex_slowlock_locked.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 12 Oct 2017 16:14:22 +0200 Subject: rtmutex: Provide rt_mutex_slowlock_locked() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz This is the inner-part of rt_mutex_slowlock(), required for rwsem-rt. diff --git a/debian/patches-rt/rtmutex-add-mutex-implementation-based-on-rtmutex.patch b/debian/patches-rt/rtmutex-add-mutex-implementation-based-on-rtmutex.patch index 857291b21..ce118a0af 100644 --- a/debian/patches-rt/rtmutex-add-mutex-implementation-based-on-rtmutex.patch +++ b/debian/patches-rt/rtmutex-add-mutex-implementation-based-on-rtmutex.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 12 Oct 2017 17:17:03 +0200 Subject: rtmutex: add mutex implementation based on rtmutex -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior diff --git a/debian/patches-rt/rtmutex-add-rwlock-implementation-based-on-rtmutex.patch b/debian/patches-rt/rtmutex-add-rwlock-implementation-based-on-rtmutex.patch index a628b2613..7b4c91fa8 100644 --- a/debian/patches-rt/rtmutex-add-rwlock-implementation-based-on-rtmutex.patch +++ b/debian/patches-rt/rtmutex-add-rwlock-implementation-based-on-rtmutex.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 12 Oct 2017 17:18:06 +0200 Subject: rtmutex: add rwlock implementation based on rtmutex -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The implementation is bias-based, similar to the rwsem implementation. diff --git a/debian/patches-rt/rtmutex-add-rwsem-implementation-based-on-rtmutex.patch b/debian/patches-rt/rtmutex-add-rwsem-implementation-based-on-rtmutex.patch index ef7e2efb1..48906b8b2 100644 --- a/debian/patches-rt/rtmutex-add-rwsem-implementation-based-on-rtmutex.patch +++ b/debian/patches-rt/rtmutex-add-rwsem-implementation-based-on-rtmutex.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 12 Oct 2017 17:28:34 +0200 Subject: rtmutex: add rwsem implementation based on rtmutex -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The RT specific R/W semaphore implementation restricts the number of readers to one because a writer cannot block on multiple readers and inherit its @@ -42,14 +42,14 @@ the approach. Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/rwsem_rt.h | 68 ++++++++++ + include/linux/rwsem-rt.h | 68 ++++++++++ kernel/locking/rwsem-rt.c | 293 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 361 insertions(+) - create mode 100644 include/linux/rwsem_rt.h + create mode 100644 include/linux/rwsem-rt.h create mode 100644 kernel/locking/rwsem-rt.c --- /dev/null -+++ b/include/linux/rwsem_rt.h ++++ b/include/linux/rwsem-rt.h @@ -0,0 +1,68 @@ +#ifndef _LINUX_RWSEM_RT_H +#define _LINUX_RWSEM_RT_H diff --git a/debian/patches-rt/rtmutex-add-sleeping-lock-implementation.patch b/debian/patches-rt/rtmutex-add-sleeping-lock-implementation.patch index 934db4ebc..9d687f5c8 100644 --- a/debian/patches-rt/rtmutex-add-sleeping-lock-implementation.patch +++ b/debian/patches-rt/rtmutex-add-sleeping-lock-implementation.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 12 Oct 2017 17:11:19 +0200 Subject: rtmutex: add sleeping lock implementation -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior diff --git a/debian/patches-rt/rtmutex-add-ww_mutex-addon-for-mutex-rt.patch b/debian/patches-rt/rtmutex-add-ww_mutex-addon-for-mutex-rt.patch index cc2eb78b5..36b86314f 100644 --- a/debian/patches-rt/rtmutex-add-ww_mutex-addon-for-mutex-rt.patch +++ b/debian/patches-rt/rtmutex-add-ww_mutex-addon-for-mutex-rt.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 12 Oct 2017 17:34:38 +0200 Subject: rtmutex: add ww_mutex addon for mutex-rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Signed-off-by: Sebastian Andrzej Siewior --- diff --git a/debian/patches-rt/rtmutex-annotate-sleeping-lock-context.patch b/debian/patches-rt/rtmutex-annotate-sleeping-lock-context.patch index 1f4bcd777..73f2ab036 100644 --- a/debian/patches-rt/rtmutex-annotate-sleeping-lock-context.patch +++ b/debian/patches-rt/rtmutex-annotate-sleeping-lock-context.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 21 Sep 2017 14:25:13 +0200 Subject: [PATCH] rtmutex: annotate sleeping lock context -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The RCU code complains on schedule() within a rcu_readlock() section. The valid scenario on -RT is if a sleeping is held. In order to suppress diff --git a/debian/patches-rt/rtmutex-avoid-include-hell.patch b/debian/patches-rt/rtmutex-avoid-include-hell.patch index 90e10068e..0d696beeb 100644 --- a/debian/patches-rt/rtmutex-avoid-include-hell.patch +++ b/debian/patches-rt/rtmutex-avoid-include-hell.patch @@ -1,7 +1,7 @@ Subject: rtmutex: Avoid include hell From: Thomas Gleixner Date: Wed, 29 Jun 2011 20:06:39 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Include only the required raw types. This avoids pulling in the complete spinlock header which in turn requires rtmutex.h at some point. diff --git a/debian/patches-rt/rtmutex-export-lockdep-less-version-of-rt_mutex-s-lo.patch b/debian/patches-rt/rtmutex-export-lockdep-less-version-of-rt_mutex-s-lo.patch index ca79e3ab2..7a66b5157 100644 --- a/debian/patches-rt/rtmutex-export-lockdep-less-version-of-rt_mutex-s-lo.patch +++ b/debian/patches-rt/rtmutex-export-lockdep-less-version-of-rt_mutex-s-lo.patch @@ -2,7 +2,7 @@ From: Thomas Gleixner Date: Thu, 12 Oct 2017 16:36:39 +0200 Subject: rtmutex: export lockdep-less version of rt_mutex's lock, trylock and unlock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Required for lock implementation ontop of rtmutex. diff --git a/debian/patches-rt/rtmutex-futex-prepare-rt.patch b/debian/patches-rt/rtmutex-futex-prepare-rt.patch index dc28992f7..7aabe5d09 100644 --- a/debian/patches-rt/rtmutex-futex-prepare-rt.patch +++ b/debian/patches-rt/rtmutex-futex-prepare-rt.patch @@ -1,7 +1,7 @@ Subject: rtmutex: Handle the various new futex race conditions From: Thomas Gleixner Date: Fri, 10 Jun 2011 11:04:15 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz RT opens a few new interesting race conditions in the rtmutex/futex combo due to futex hash bucket lock being a 'sleeping' spinlock and diff --git a/debian/patches-rt/rtmutex-lock-killable.patch b/debian/patches-rt/rtmutex-lock-killable.patch index 84249fd87..3fd36b4e3 100644 --- a/debian/patches-rt/rtmutex-lock-killable.patch +++ b/debian/patches-rt/rtmutex-lock-killable.patch @@ -1,7 +1,7 @@ Subject: rtmutex: Add rtmutex_lock_killable() From: Thomas Gleixner Date: Thu, 09 Jun 2011 11:43:52 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Add "killable" type to rtmutex. We need this since rtmutex are used as "normal" mutexes which do use this type. diff --git a/debian/patches-rt/rtmutex-trylock-is-okay-on-RT.patch b/debian/patches-rt/rtmutex-trylock-is-okay-on-RT.patch index 3f80d3848..2581577ed 100644 --- a/debian/patches-rt/rtmutex-trylock-is-okay-on-RT.patch +++ b/debian/patches-rt/rtmutex-trylock-is-okay-on-RT.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed 02 Dec 2015 11:34:07 +0100 Subject: rtmutex: trylock is okay on -RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz non-RT kernel could deadlock on rt_mutex_trylock() in softirq context. On -RT we don't run softirqs in IRQ context but in thread context so it is diff --git a/debian/patches-rt/rtmutex-wire-up-RT-s-locking.patch b/debian/patches-rt/rtmutex-wire-up-RT-s-locking.patch index d4e1613b0..4a00f4091 100644 --- a/debian/patches-rt/rtmutex-wire-up-RT-s-locking.patch +++ b/debian/patches-rt/rtmutex-wire-up-RT-s-locking.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 12 Oct 2017 17:31:14 +0200 Subject: rtmutex: wire up RT's locking -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior @@ -64,7 +64,7 @@ Signed-off-by: Sebastian Andrzej Siewior #endif +#ifdef CONFIG_PREEMPT_RT_FULL -+#include ++#include +#else /* PREEMPT_RT_FULL */ + struct rw_semaphore; diff --git a/debian/patches-rt/rtmutex_dont_include_rcu.patch b/debian/patches-rt/rtmutex_dont_include_rcu.patch index 8e4864a08..df8d9a937 100644 --- a/debian/patches-rt/rtmutex_dont_include_rcu.patch +++ b/debian/patches-rt/rtmutex_dont_include_rcu.patch @@ -1,6 +1,6 @@ From: Sebastian Andrzej Siewior Subject: rbtree: don't include the rcu header -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The RCU header pulls in spinlock.h and fails due not yet defined types: diff --git a/debian/patches-rt/sched-Allow-pinned-user-tasks-to-be-awakened-to-the-.patch b/debian/patches-rt/sched-Allow-pinned-user-tasks-to-be-awakened-to-the-.patch index ff18cc85d..d609b556b 100644 --- a/debian/patches-rt/sched-Allow-pinned-user-tasks-to-be-awakened-to-the-.patch +++ b/debian/patches-rt/sched-Allow-pinned-user-tasks-to-be-awakened-to-the-.patch @@ -2,7 +2,7 @@ From: Mike Galbraith Date: Sun, 19 Aug 2018 08:28:35 +0200 Subject: [PATCH] sched: Allow pinned user tasks to be awakened to the CPU they pinned -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Since commit 7af443ee16976 ("sched/core: Require cpu_active() in select_task_rq(), for user tasks") select_fallback_rq() will BUG() if diff --git a/debian/patches-rt/sched-delay-put-task.patch b/debian/patches-rt/sched-delay-put-task.patch index 693ccf51f..82586434d 100644 --- a/debian/patches-rt/sched-delay-put-task.patch +++ b/debian/patches-rt/sched-delay-put-task.patch @@ -1,7 +1,7 @@ Subject: sched: Move task_struct cleanup to RCU From: Thomas Gleixner Date: Tue, 31 May 2011 16:59:16 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz __put_task_struct() does quite some expensive work. We don't want to burden random tasks with that. diff --git a/debian/patches-rt/sched-disable-rt-group-sched-on-rt.patch b/debian/patches-rt/sched-disable-rt-group-sched-on-rt.patch index daa04fe7b..445466b01 100644 --- a/debian/patches-rt/sched-disable-rt-group-sched-on-rt.patch +++ b/debian/patches-rt/sched-disable-rt-group-sched-on-rt.patch @@ -1,7 +1,7 @@ Subject: sched: Disable CONFIG_RT_GROUP_SCHED on RT From: Thomas Gleixner Date: Mon, 18 Jul 2011 17:03:52 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Carsten reported problems when running: diff --git a/debian/patches-rt/sched-disable-ttwu-queue.patch b/debian/patches-rt/sched-disable-ttwu-queue.patch index 5f50bc8be..414e5b4c9 100644 --- a/debian/patches-rt/sched-disable-ttwu-queue.patch +++ b/debian/patches-rt/sched-disable-ttwu-queue.patch @@ -1,7 +1,7 @@ Subject: sched: Disable TTWU_QUEUE on RT From: Thomas Gleixner Date: Tue, 13 Sep 2011 16:42:35 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The queued remote wakeup mechanism can introduce rather large latencies if the number of migrated tasks is high. Disable it for RT. diff --git a/debian/patches-rt/sched-fair-Make-the-hrtimers-non-hard-again.patch b/debian/patches-rt/sched-fair-Make-the-hrtimers-non-hard-again.patch index ff17afb30..cec2a3c07 100644 --- a/debian/patches-rt/sched-fair-Make-the-hrtimers-non-hard-again.patch +++ b/debian/patches-rt/sched-fair-Make-the-hrtimers-non-hard-again.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Tue, 8 Jan 2019 12:31:06 +0100 Subject: [PATCH] sched/fair: Make the hrtimers non-hard again -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Since commit "sched/fair: Robustify CFS-bandwidth timer locking" both hrtimer can run in softirq context because now interrupts are disabled @@ -14,7 +14,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c -@@ -4891,9 +4891,9 @@ void init_cfs_bandwidth(struct cfs_bandw +@@ -4916,9 +4916,9 @@ void init_cfs_bandwidth(struct cfs_bandw cfs_b->period = ns_to_ktime(default_cfs_period()); INIT_LIST_HEAD(&cfs_b->throttled_cfs_rq); diff --git a/debian/patches-rt/sched-fair-Robustify-CFS-bandwidth-timer-locking.patch b/debian/patches-rt/sched-fair-Robustify-CFS-bandwidth-timer-locking.patch index 1b5239f96..2b55d4721 100644 --- a/debian/patches-rt/sched-fair-Robustify-CFS-bandwidth-timer-locking.patch +++ b/debian/patches-rt/sched-fair-Robustify-CFS-bandwidth-timer-locking.patch @@ -1,7 +1,7 @@ From: Peter Zijlstra Date: Mon, 7 Jan 2019 13:52:31 +0100 Subject: [PATCH] sched/fair: Robustify CFS-bandwidth timer locking -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Traditionally hrtimer callbacks were run with IRQs disabled, but with the introduction of HRTIMER_MODE_SOFT it is possible they run from @@ -115,20 +115,23 @@ Signed-off-by: Sebastian Andrzej Siewior } /* -@@ -4863,20 +4864,21 @@ static enum hrtimer_restart sched_cfs_pe +@@ -4865,11 +4866,12 @@ static enum hrtimer_restart sched_cfs_pe { struct cfs_bandwidth *cfs_b = container_of(timer, struct cfs_bandwidth, period_timer); + unsigned long flags; int overrun; int idle = 0; + int count = 0; - raw_spin_lock(&cfs_b->lock); + raw_spin_lock_irqsave(&cfs_b->lock, flags); for (;;) { overrun = hrtimer_forward_now(timer, cfs_b->period); if (!overrun) - break; +@@ -4897,11 +4899,11 @@ static enum hrtimer_restart sched_cfs_pe + count = 0; + } - idle = do_sched_cfs_period_timer(cfs_b, overrun); + idle = do_sched_cfs_period_timer(cfs_b, overrun, flags); diff --git a/debian/patches-rt/sched-limit-nr-migrate.patch b/debian/patches-rt/sched-limit-nr-migrate.patch index 4a047c6f2..e84dbb6cc 100644 --- a/debian/patches-rt/sched-limit-nr-migrate.patch +++ b/debian/patches-rt/sched-limit-nr-migrate.patch @@ -1,7 +1,7 @@ Subject: sched: Limit the number of task migrations per batch From: Thomas Gleixner Date: Mon, 06 Jun 2011 12:12:51 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Put an upper limit on the number of tasks which are migrated per batch to avoid large latencies. diff --git a/debian/patches-rt/sched-might-sleep-do-not-account-rcu-depth.patch b/debian/patches-rt/sched-might-sleep-do-not-account-rcu-depth.patch index 923e07ff9..ec5b8da3a 100644 --- a/debian/patches-rt/sched-might-sleep-do-not-account-rcu-depth.patch +++ b/debian/patches-rt/sched-might-sleep-do-not-account-rcu-depth.patch @@ -1,7 +1,7 @@ Subject: sched: Do not account rcu_preempt_depth on RT in might_sleep() From: Thomas Gleixner Date: Tue, 07 Jun 2011 09:19:06 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz RT changes the rcu_preempt_depth semantics, so we cannot check for it in might_sleep(). diff --git a/debian/patches-rt/sched-migrate_disable-Add-export_symbol_gpl-for-__mi.patch b/debian/patches-rt/sched-migrate_disable-Add-export_symbol_gpl-for-__mi.patch index 1aa6b9a6f..376f8a3a8 100644 --- a/debian/patches-rt/sched-migrate_disable-Add-export_symbol_gpl-for-__mi.patch +++ b/debian/patches-rt/sched-migrate_disable-Add-export_symbol_gpl-for-__mi.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Tue, 9 Oct 2018 17:34:50 +0200 Subject: [PATCH] sched/migrate_disable: Add export_symbol_gpl for __migrate_disabled -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Jonathan reported that lttng/modules can't use __migrate_disabled(). This function is only used by sched/core itself and the tracing diff --git a/debian/patches-rt/sched-migrate_disable-fallback-to-preempt_disable-in.patch b/debian/patches-rt/sched-migrate_disable-fallback-to-preempt_disable-in.patch index 8699717ce..02d43e0de 100644 --- a/debian/patches-rt/sched-migrate_disable-fallback-to-preempt_disable-in.patch +++ b/debian/patches-rt/sched-migrate_disable-fallback-to-preempt_disable-in.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 5 Jul 2018 14:44:51 +0200 Subject: [PATCH] sched/migrate_disable: fallback to preempt_disable() instead barrier() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz On SMP + !RT migrate_disable() is still around. It is not part of spin_lock() anymore so it has almost no users. However the futex code has a workaround for diff --git a/debian/patches-rt/sched-mmdrop-delayed.patch b/debian/patches-rt/sched-mmdrop-delayed.patch index 51cda64eb..0f4ac466a 100644 --- a/debian/patches-rt/sched-mmdrop-delayed.patch +++ b/debian/patches-rt/sched-mmdrop-delayed.patch @@ -1,7 +1,7 @@ Subject: sched: Move mmdrop to RCU on RT From: Thomas Gleixner Date: Mon, 06 Jun 2011 12:20:33 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Takes sleeping locks and calls into the memory allocator, so nothing we want to do in task switch and oder atomic contexts. @@ -51,9 +51,9 @@ Signed-off-by: Thomas Gleixner +# define mmdrop_delayed(mm) mmdrop(mm) +#endif + - /** - * mmget() - Pin the address space associated with a &struct mm_struct. - * @mm: The address space to pin. + /* + * This has to be called after a get_task_mm()/mmget_not_zero() + * followed by taking the mmap_sem for writing before modifying the --- a/kernel/fork.c +++ b/kernel/fork.c @@ -679,6 +679,19 @@ void __mmdrop(struct mm_struct *mm) diff --git a/debian/patches-rt/sched-rt-mutex-wakeup.patch b/debian/patches-rt/sched-rt-mutex-wakeup.patch index 9118102f2..0d46d9395 100644 --- a/debian/patches-rt/sched-rt-mutex-wakeup.patch +++ b/debian/patches-rt/sched-rt-mutex-wakeup.patch @@ -1,7 +1,7 @@ Subject: sched: Add saved_state for tasks blocked on sleeping locks From: Thomas Gleixner Date: Sat, 25 Jun 2011 09:21:04 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Spinlocks are state preserving in !RT. RT changes the state when a task gets blocked on a lock. So we need to remember the state before diff --git a/debian/patches-rt/sched-workqueue-Only-wake-up-idle-workers-if-not-blo.patch b/debian/patches-rt/sched-workqueue-Only-wake-up-idle-workers-if-not-blo.patch index 0a0c75f4b..33c3fe5f0 100644 --- a/debian/patches-rt/sched-workqueue-Only-wake-up-idle-workers-if-not-blo.patch +++ b/debian/patches-rt/sched-workqueue-Only-wake-up-idle-workers-if-not-blo.patch @@ -1,7 +1,7 @@ From: Steven Rostedt Date: Mon, 18 Mar 2013 15:12:49 -0400 Subject: sched/workqueue: Only wake up idle workers if not blocked on sleeping spin lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz In -rt, most spin_locks() turn into mutexes. One of these spin_lock conversions is performed on the workqueue gcwq->lock. When the idle diff --git a/debian/patches-rt/scsi-fcoe-rt-aware.patch b/debian/patches-rt/scsi-fcoe-rt-aware.patch index 0e59fb1f0..16a14809b 100644 --- a/debian/patches-rt/scsi-fcoe-rt-aware.patch +++ b/debian/patches-rt/scsi-fcoe-rt-aware.patch @@ -1,7 +1,7 @@ Subject: scsi/fcoe: Make RT aware. From: Thomas Gleixner Date: Sat, 12 Nov 2011 14:00:48 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Do not disable preemption while taking sleeping locks. All user look safe for migrate_diable() only. diff --git a/debian/patches-rt/seqlock-prevent-rt-starvation.patch b/debian/patches-rt/seqlock-prevent-rt-starvation.patch index d4fa92ff5..b6f210ec1 100644 --- a/debian/patches-rt/seqlock-prevent-rt-starvation.patch +++ b/debian/patches-rt/seqlock-prevent-rt-starvation.patch @@ -1,7 +1,7 @@ Subject: seqlock: Prevent rt starvation From: Thomas Gleixner Date: Wed, 22 Feb 2012 12:03:30 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz If a low prio writer gets preempted while holding the seqlock write locked, a high prio reader spins forever on RT. diff --git a/debian/patches-rt/serial-8250-export-symbols-which-are-used-by-symbols.patch b/debian/patches-rt/serial-8250-export-symbols-which-are-used-by-symbols.patch index f665d304a..bd2406bb0 100644 --- a/debian/patches-rt/serial-8250-export-symbols-which-are-used-by-symbols.patch +++ b/debian/patches-rt/serial-8250-export-symbols-which-are-used-by-symbols.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Sat, 16 Feb 2019 09:02:00 +0100 Subject: [PATCH] serial: 8250: export symbols which are used by symbols -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Signed-off-by: Sebastian Andrzej Siewior --- diff --git a/debian/patches-rt/serial-8250-remove-that-trylock-in-serial8250_consol.patch b/debian/patches-rt/serial-8250-remove-that-trylock-in-serial8250_consol.patch index f59b10104..98bcd49e6 100644 --- a/debian/patches-rt/serial-8250-remove-that-trylock-in-serial8250_consol.patch +++ b/debian/patches-rt/serial-8250-remove-that-trylock-in-serial8250_consol.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 14 Feb 2019 17:38:24 +0100 Subject: [PATCH] serial: 8250: remove that trylock in serial8250_console_write_atomic() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz This does not work as rtmutex in NMI context. As per John, it is not needed. diff --git a/debian/patches-rt/series b/debian/patches-rt/series index 811f914e0..925859dc5 100644 --- a/debian/patches-rt/series +++ b/debian/patches-rt/series @@ -11,23 +11,21 @@ tty-sysrq-Convert-show_lock-to-raw_spinlock_t.patch # POSTED by others ############################################################ # AT91 -# Alexandre Belloni | [PATCH 00/12] clocksource: improve Atmel TCB timer driver -# Date: Wed, 3 Apr 2019 16:11:08 +0200 +# Alexandre Belloni | [PATCH v3 0/9] clocksource: improve Atmel TCB timer driver +# Date: Fri, 26 Apr 2019 23:47:09 +0200 0001-ARM-at91-move-SoC-specific-definitions-to-SoC-folder.patch -0002-misc-atmel_tclib-drop-AVR32-support.patch -0003-misc-atmel_tclib-move-definitions-to-header-file.patch -0004-clocksource-drivers-tcb_clksrc-stop-depending-on-atm.patch -0005-clocksource-drivers-tcb_clksrc-Use-tcb-as-sched_cloc.patch -0006-ARM-at91-Implement-clocksource-selection.patch -0007-clocksource-drivers-tcb_clksrc-move-Kconfig-option.patch -0008-clocksource-drivers-timer-atmel-pit-rework-Kconfig-o.patch -0009-clocksource-drivers-tcb_clksrc-Rename-the-file-for-c.patch -0010-ARM-configs-at91-unselect-PIT.patch -0011-misc-atmel_tclib-do-not-probe-already-used-TCBs.patch -0012-clocksource-drivers-timer-atmel-tcb-Use-ARRAY_SIZE-i.patch +0002-clocksource-drivers-tcb_clksrc-stop-depending-on-atm.patch +0003-clocksource-drivers-tcb_clksrc-Use-tcb-as-sched_cloc.patch +0004-ARM-at91-Implement-clocksource-selection.patch +0005-clocksource-drivers-tcb_clksrc-move-Kconfig-option.patch +0006-clocksource-drivers-timer-atmel-pit-rework-Kconfig-o.patch +0007-clocksource-drivers-tcb_clksrc-Rename-the-file-for-c.patch +0008-clocksource-drivers-timer-atmel-tcb-tc_clksrc_suspen.patch +0009-misc-atmel_tclib-do-not-probe-already-used-TCBs.patch kthread-convert-worker-lock-to-raw-spinlock.patch sched-fair-Robustify-CFS-bandwidth-timer-locking.patch +x86-ima-Check-EFI_RUNTIME_SERVICES-before-using.patch # John's printk series # [RFC PATCH v1 00/25] printk: new implementation @@ -65,12 +63,12 @@ arm-remove-printk_nmi_.patch printk-only-allow-kernel-to-emergency-message.patch printk-devkmsg-llseek-reset-clear-if-it-is-lost.patch printk-print-rate-limitted-message-as-info.patch +printk-kmsg_dump-remove-mutex-usage.patch ############################################################ # POSTED ############################################################ x86-ioapic-Don-t-let-setaffinity-unmask-threaded-EOI.patch -arm-kprobe-replace-patch_lock-to-raw-lock.patch cgroup-use-irqsave-in-cgroup_rstat_flush_locked.patch fscache-initialize-cookie-hash-table-raw-spinlocks.patch Drivers-hv-vmbus-include-header-for-get_irq_regs.patch @@ -110,6 +108,8 @@ drm-i915-Don-t-disable-interrupts-independently-of-t.patch 0025-x86-fpu-Add-a-fastpath-to-copy_fpstate_to_sigframe.patch 0026-x86-fpu-Restore-FPU-register-in-copy_fpstate_to_sigf.patch 0027-x86-pkeys-add-PKRU-value-to-init_fpstate.patch +0028-x86-fpu-Fault-in-user-stack-if-copy_fpstate_to_sigfr.patch +0029-x86-fpu-Remove-unnecessary-saving-of-FPU-registers-i.patch ############################################################ # Ready for posting diff --git a/debian/patches-rt/signal-revert-ptrace-preempt-magic.patch b/debian/patches-rt/signal-revert-ptrace-preempt-magic.patch index ed8598676..093afdde5 100644 --- a/debian/patches-rt/signal-revert-ptrace-preempt-magic.patch +++ b/debian/patches-rt/signal-revert-ptrace-preempt-magic.patch @@ -1,7 +1,7 @@ Subject: signal: Revert ptrace preempt magic From: Thomas Gleixner Date: Wed, 21 Sep 2011 19:57:12 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Upstream commit '53da1d9456fe7f8 fix ptrace slowness' is nothing more than a bandaid around the ptrace design trainwreck. It's not a diff --git a/debian/patches-rt/signals-allow-rt-tasks-to-cache-one-sigqueue-struct.patch b/debian/patches-rt/signals-allow-rt-tasks-to-cache-one-sigqueue-struct.patch index 5eac618b0..04064e19a 100644 --- a/debian/patches-rt/signals-allow-rt-tasks-to-cache-one-sigqueue-struct.patch +++ b/debian/patches-rt/signals-allow-rt-tasks-to-cache-one-sigqueue-struct.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Fri, 3 Jul 2009 08:44:56 -0500 Subject: signals: Allow rt tasks to cache one sigqueue struct -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz To avoid allocation allow rt tasks to cache one sigqueue struct in task struct. diff --git a/debian/patches-rt/skbufhead-raw-lock.patch b/debian/patches-rt/skbufhead-raw-lock.patch index 3cf53c4c7..9d1285602 100644 --- a/debian/patches-rt/skbufhead-raw-lock.patch +++ b/debian/patches-rt/skbufhead-raw-lock.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Tue, 12 Jul 2011 15:38:34 +0200 Subject: net: Use skbufhead with raw lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Use the rps lock as rawlock so we can keep irq-off regions. It looks low latency. However we can't kfree() from this context therefore we defer this @@ -16,7 +16,7 @@ Signed-off-by: Thomas Gleixner --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h -@@ -3010,6 +3010,7 @@ struct softnet_data { +@@ -3013,6 +3013,7 @@ struct softnet_data { unsigned int dropped; struct sk_buff_head input_pkt_queue; struct napi_struct backlog; @@ -66,7 +66,7 @@ Signed-off-by: Thomas Gleixner #endif } -@@ -5307,7 +5307,7 @@ static void flush_backlog(struct work_st +@@ -5323,7 +5323,7 @@ static void flush_backlog(struct work_st skb_queue_walk_safe(&sd->input_pkt_queue, skb, tmp) { if (skb->dev->reg_state == NETREG_UNREGISTERING) { __skb_unlink(skb, &sd->input_pkt_queue); @@ -75,7 +75,7 @@ Signed-off-by: Thomas Gleixner input_queue_head_incr(sd); } } -@@ -5317,11 +5317,14 @@ static void flush_backlog(struct work_st +@@ -5333,11 +5333,14 @@ static void flush_backlog(struct work_st skb_queue_walk_safe(&sd->process_queue, skb, tmp) { if (skb->dev->reg_state == NETREG_UNREGISTERING) { __skb_unlink(skb, &sd->process_queue); @@ -91,7 +91,7 @@ Signed-off-by: Thomas Gleixner } static void flush_all_backlogs(void) -@@ -5921,7 +5924,9 @@ static int process_backlog(struct napi_s +@@ -5937,7 +5940,9 @@ static int process_backlog(struct napi_s while (again) { struct sk_buff *skb; @@ -101,7 +101,7 @@ Signed-off-by: Thomas Gleixner rcu_read_lock(); __netif_receive_skb(skb); rcu_read_unlock(); -@@ -5929,9 +5934,9 @@ static int process_backlog(struct napi_s +@@ -5945,9 +5950,9 @@ static int process_backlog(struct napi_s if (++work >= quota) return work; @@ -112,7 +112,7 @@ Signed-off-by: Thomas Gleixner rps_lock(sd); if (skb_queue_empty(&sd->input_pkt_queue)) { /* -@@ -6396,13 +6401,21 @@ static __latent_entropy void net_rx_acti +@@ -6412,13 +6417,21 @@ static __latent_entropy void net_rx_acti unsigned long time_limit = jiffies + usecs_to_jiffies(netdev_budget_usecs); int budget = netdev_budget; @@ -134,7 +134,7 @@ Signed-off-by: Thomas Gleixner for (;;) { struct napi_struct *n; -@@ -9420,10 +9433,13 @@ static int dev_cpu_dead(unsigned int old +@@ -9436,10 +9449,13 @@ static int dev_cpu_dead(unsigned int old netif_rx_ni(skb); input_queue_head_incr(oldsd); } @@ -149,7 +149,7 @@ Signed-off-by: Thomas Gleixner return 0; } -@@ -9732,8 +9748,9 @@ static int __init net_dev_init(void) +@@ -9748,8 +9764,9 @@ static int __init net_dev_init(void) INIT_WORK(flush, flush_backlog); diff --git a/debian/patches-rt/slub-disable-SLUB_CPU_PARTIAL.patch b/debian/patches-rt/slub-disable-SLUB_CPU_PARTIAL.patch index 1788cdf52..096c79f84 100644 --- a/debian/patches-rt/slub-disable-SLUB_CPU_PARTIAL.patch +++ b/debian/patches-rt/slub-disable-SLUB_CPU_PARTIAL.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 15 Apr 2015 19:00:47 +0200 Subject: slub: Disable SLUB_CPU_PARTIAL -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:915 |in_atomic(): 1, irqs_disabled(): 0, pid: 87, name: rcuop/7 diff --git a/debian/patches-rt/slub-enable-irqs-for-no-wait.patch b/debian/patches-rt/slub-enable-irqs-for-no-wait.patch index 39e8ef15e..6d01c0e76 100644 --- a/debian/patches-rt/slub-enable-irqs-for-no-wait.patch +++ b/debian/patches-rt/slub-enable-irqs-for-no-wait.patch @@ -1,7 +1,7 @@ Subject: slub: Enable irqs for __GFP_WAIT From: Thomas Gleixner Date: Wed, 09 Jan 2013 12:08:15 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz SYSTEM_RUNNING might be too late for enabling interrupts. Allocations with GFP_WAIT can happen before that. So use this as an indicator. diff --git a/debian/patches-rt/softirq-disable-softirq-stacks-for-rt.patch b/debian/patches-rt/softirq-disable-softirq-stacks-for-rt.patch index f251d05f3..e8cdde176 100644 --- a/debian/patches-rt/softirq-disable-softirq-stacks-for-rt.patch +++ b/debian/patches-rt/softirq-disable-softirq-stacks-for-rt.patch @@ -1,7 +1,7 @@ Subject: softirq: Disable softirq stacks for RT From: Thomas Gleixner Date: Mon, 18 Jul 2011 13:59:17 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Disable extra stacks for softirqs. We want to preempt softirqs and having them on special IRQ-stack does not make this easier. diff --git a/debian/patches-rt/softirq-preempt-fix-3-re.patch b/debian/patches-rt/softirq-preempt-fix-3-re.patch index e90009224..8473da66d 100644 --- a/debian/patches-rt/softirq-preempt-fix-3-re.patch +++ b/debian/patches-rt/softirq-preempt-fix-3-re.patch @@ -1,7 +1,7 @@ Subject: softirq: Check preemption after reenabling interrupts From: Thomas Gleixner Date: Sun, 13 Nov 2011 17:17:09 +0100 (CET) -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz raise_softirq_irqoff() disables interrupts and wakes the softirq daemon, but after reenabling interrupts there is no preemption check, @@ -112,7 +112,7 @@ Signed-off-by: Thomas Gleixner } --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -2740,6 +2740,7 @@ static void __netif_reschedule(struct Qd +@@ -2754,6 +2754,7 @@ static void __netif_reschedule(struct Qd sd->output_queue_tailp = &q->next_sched; raise_softirq_irqoff(NET_TX_SOFTIRQ); local_irq_restore(flags); @@ -120,7 +120,7 @@ Signed-off-by: Thomas Gleixner } void __netif_schedule(struct Qdisc *q) -@@ -2802,6 +2803,7 @@ void __dev_kfree_skb_irq(struct sk_buff +@@ -2816,6 +2817,7 @@ void __dev_kfree_skb_irq(struct sk_buff __this_cpu_write(softnet_data.completion_queue, skb); raise_softirq_irqoff(NET_TX_SOFTIRQ); local_irq_restore(flags); @@ -128,7 +128,7 @@ Signed-off-by: Thomas Gleixner } EXPORT_SYMBOL(__dev_kfree_skb_irq); -@@ -4281,6 +4283,7 @@ static int enqueue_to_backlog(struct sk_ +@@ -4295,6 +4297,7 @@ static int enqueue_to_backlog(struct sk_ rps_unlock(sd); local_irq_restore(flags); @@ -136,7 +136,7 @@ Signed-off-by: Thomas Gleixner atomic_long_inc(&skb->dev->rx_dropped); kfree_skb(skb); -@@ -5883,12 +5886,14 @@ static void net_rps_action_and_irq_enabl +@@ -5899,12 +5902,14 @@ static void net_rps_action_and_irq_enabl sd->rps_ipi_list = NULL; local_irq_enable(); @@ -151,7 +151,7 @@ Signed-off-by: Thomas Gleixner } static bool sd_has_rps_ipi_waiting(struct softnet_data *sd) -@@ -5966,6 +5971,7 @@ void __napi_schedule(struct napi_struct +@@ -5982,6 +5987,7 @@ void __napi_schedule(struct napi_struct local_irq_save(flags); ____napi_schedule(this_cpu_ptr(&softnet_data), n); local_irq_restore(flags); @@ -159,7 +159,7 @@ Signed-off-by: Thomas Gleixner } EXPORT_SYMBOL(__napi_schedule); -@@ -9402,6 +9408,7 @@ static int dev_cpu_dead(unsigned int old +@@ -9418,6 +9424,7 @@ static int dev_cpu_dead(unsigned int old raise_softirq_irqoff(NET_TX_SOFTIRQ); local_irq_enable(); diff --git a/debian/patches-rt/softirq-split-locks.patch b/debian/patches-rt/softirq-split-locks.patch index 5f8713f4a..1a1b86405 100644 --- a/debian/patches-rt/softirq-split-locks.patch +++ b/debian/patches-rt/softirq-split-locks.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 04 Oct 2012 14:20:47 +0100 Subject: softirq: Split softirq locks -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The 3.x RT series removed the split softirq implementation in favour of pushing softirq processing into the context of the thread which diff --git a/debian/patches-rt/softirq-split-timer-softirqs-out-of-ksoftirqd.patch b/debian/patches-rt/softirq-split-timer-softirqs-out-of-ksoftirqd.patch index f85d1c463..d18d6e9ff 100644 --- a/debian/patches-rt/softirq-split-timer-softirqs-out-of-ksoftirqd.patch +++ b/debian/patches-rt/softirq-split-timer-softirqs-out-of-ksoftirqd.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 20 Jan 2016 16:34:17 +0100 Subject: softirq: split timer softirqs out of ksoftirqd -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The softirqd runs in -RT with SCHED_FIFO (prio 1) and deals mostly with timer wakeup which can not happen in hardirq context. The prio has been diff --git a/debian/patches-rt/spinlock-types-separate-raw.patch b/debian/patches-rt/spinlock-types-separate-raw.patch index c6ec98199..241af7c05 100644 --- a/debian/patches-rt/spinlock-types-separate-raw.patch +++ b/debian/patches-rt/spinlock-types-separate-raw.patch @@ -1,7 +1,7 @@ Subject: spinlock: Split the lock types header From: Thomas Gleixner Date: Wed, 29 Jun 2011 19:34:01 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Split raw_spinlock into its own file and the remaining spinlock_t into its own non-RT header. The non-RT header will be replaced later by sleeping diff --git a/debian/patches-rt/squashfs-make-use-of-local-lock-in-multi_cpu-decompr.patch b/debian/patches-rt/squashfs-make-use-of-local-lock-in-multi_cpu-decompr.patch index 3d92d6927..df233f165 100644 --- a/debian/patches-rt/squashfs-make-use-of-local-lock-in-multi_cpu-decompr.patch +++ b/debian/patches-rt/squashfs-make-use-of-local-lock-in-multi_cpu-decompr.patch @@ -2,7 +2,7 @@ From: Julia Cartwright Date: Mon, 7 May 2018 08:58:57 -0500 Subject: [PATCH] squashfs: make use of local lock in multi_cpu decompressor -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Currently, the squashfs multi_cpu decompressor makes use of get_cpu_ptr()/put_cpu_ptr(), which unconditionally disable preemption diff --git a/debian/patches-rt/srcu-Remove-srcu_queue_delayed_work_on.patch b/debian/patches-rt/srcu-Remove-srcu_queue_delayed_work_on.patch index 3a85e6c5e..129a41ad0 100644 --- a/debian/patches-rt/srcu-Remove-srcu_queue_delayed_work_on.patch +++ b/debian/patches-rt/srcu-Remove-srcu_queue_delayed_work_on.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Tue, 11 Dec 2018 12:12:38 +0100 Subject: [PATCH] srcu: Remove srcu_queue_delayed_work_on() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz srcu_queue_delayed_work_on() disables preemption (and therefore CPU hotplug in RCU's case) and then checks based on its own accounting if a diff --git a/debian/patches-rt/srcu-replace-local_irqsave-with-a-locallock.patch b/debian/patches-rt/srcu-replace-local_irqsave-with-a-locallock.patch index 6339cab1a..10f82a27a 100644 --- a/debian/patches-rt/srcu-replace-local_irqsave-with-a-locallock.patch +++ b/debian/patches-rt/srcu-replace-local_irqsave-with-a-locallock.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 12 Oct 2017 18:37:12 +0200 Subject: [PATCH] srcu: replace local_irqsave() with a locallock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz There are two instances which disable interrupts in order to become a stable this_cpu_ptr() pointer. The restore part is coupled with diff --git a/debian/patches-rt/sunrpc-make-svc_xprt_do_enqueue-use-get_cpu_light.patch b/debian/patches-rt/sunrpc-make-svc_xprt_do_enqueue-use-get_cpu_light.patch index e5f217a30..494c8baa2 100644 --- a/debian/patches-rt/sunrpc-make-svc_xprt_do_enqueue-use-get_cpu_light.patch +++ b/debian/patches-rt/sunrpc-make-svc_xprt_do_enqueue-use-get_cpu_light.patch @@ -1,7 +1,7 @@ From: Mike Galbraith Date: Wed, 18 Feb 2015 16:05:28 +0100 Subject: sunrpc: Make svc_xprt_do_enqueue() use get_cpu_light() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:915 |in_atomic(): 1, irqs_disabled(): 0, pid: 3194, name: rpc.nfsd diff --git a/debian/patches-rt/sysfs-realtime-entry.patch b/debian/patches-rt/sysfs-realtime-entry.patch index 202343f56..d06baaf6d 100644 --- a/debian/patches-rt/sysfs-realtime-entry.patch +++ b/debian/patches-rt/sysfs-realtime-entry.patch @@ -1,7 +1,7 @@ Subject: sysfs: Add /sys/kernel/realtime entry From: Clark Williams Date: Sat Jul 30 21:55:53 2011 -0500 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Add a /sys/kernel entry to indicate that the kernel is a realtime kernel. diff --git a/debian/patches-rt/tasklet-rt-prevent-tasklets-from-going-into-infinite-spin-in-rt.patch b/debian/patches-rt/tasklet-rt-prevent-tasklets-from-going-into-infinite-spin-in-rt.patch index 0793e6174..8335a96c4 100644 --- a/debian/patches-rt/tasklet-rt-prevent-tasklets-from-going-into-infinite-spin-in-rt.patch +++ b/debian/patches-rt/tasklet-rt-prevent-tasklets-from-going-into-infinite-spin-in-rt.patch @@ -1,7 +1,7 @@ Subject: tasklet: Prevent tasklets from going into infinite spin in RT From: Ingo Molnar Date: Tue Nov 29 20:18:22 2011 -0500 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz When CONFIG_PREEMPT_RT_FULL is enabled, tasklets run as threads, and spinlocks turn are mutexes. But this can cause issues with diff --git a/debian/patches-rt/thermal-Defer-thermal-wakups-to-threads.patch b/debian/patches-rt/thermal-Defer-thermal-wakups-to-threads.patch index 6c9fc5b63..c6499cb76 100644 --- a/debian/patches-rt/thermal-Defer-thermal-wakups-to-threads.patch +++ b/debian/patches-rt/thermal-Defer-thermal-wakups-to-threads.patch @@ -1,7 +1,7 @@ From: Daniel Wagner Date: Tue, 17 Feb 2015 09:37:44 +0100 Subject: thermal: Defer thermal wakups to threads -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz On RT the spin lock in pkg_temp_thermal_platfrom_thermal_notify will call schedule while we run in irq context. diff --git a/debian/patches-rt/time-hrtimer-avoid-schedule_work-with-interrupts-dis.patch b/debian/patches-rt/time-hrtimer-avoid-schedule_work-with-interrupts-dis.patch index df187a72e..3444bb494 100644 --- a/debian/patches-rt/time-hrtimer-avoid-schedule_work-with-interrupts-dis.patch +++ b/debian/patches-rt/time-hrtimer-avoid-schedule_work-with-interrupts-dis.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 15 Nov 2017 17:29:51 +0100 Subject: [PATCH] time/hrtimer: avoid schedule_work() with interrupts disabled -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz The NOHZ code tries to schedule a workqueue with interrupts disabled. Since this does not work -RT I am switching it to swork instead. diff --git a/debian/patches-rt/timekeeping-split-jiffies-lock.patch b/debian/patches-rt/timekeeping-split-jiffies-lock.patch index f5eb53839..d3d90c586 100644 --- a/debian/patches-rt/timekeeping-split-jiffies-lock.patch +++ b/debian/patches-rt/timekeeping-split-jiffies-lock.patch @@ -1,7 +1,7 @@ Subject: timekeeping: Split jiffies seqlock From: Thomas Gleixner Date: Thu, 14 Feb 2013 22:36:59 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Replace jiffies_lock seqlock with a simple seqcounter and a rawlock so it can be taken in atomic context on RT. @@ -145,7 +145,7 @@ Signed-off-by: Thomas Gleixner } --- a/kernel/time/timekeeping.h +++ b/kernel/time/timekeeping.h -@@ -18,7 +18,8 @@ extern void timekeeping_resume(void); +@@ -25,7 +25,8 @@ static inline void sched_clock_resume(vo extern void do_timer(unsigned long ticks); extern void update_wall_time(void); diff --git a/debian/patches-rt/timers-prepare-for-full-preemption.patch b/debian/patches-rt/timers-prepare-for-full-preemption.patch index 81209be79..3efb2a698 100644 --- a/debian/patches-rt/timers-prepare-for-full-preemption.patch +++ b/debian/patches-rt/timers-prepare-for-full-preemption.patch @@ -1,7 +1,7 @@ From: Ingo Molnar Date: Fri, 3 Jul 2009 08:29:34 -0500 Subject: timers: Prepare for full preemption -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz When softirqs can be preempted we need to make sure that cancelling the timer from the active thread can not deadlock vs. a running timer diff --git a/debian/patches-rt/tpm-remove-tpm_dev_wq_lock.patch b/debian/patches-rt/tpm-remove-tpm_dev_wq_lock.patch index 65e1910f8..78fef73a7 100644 --- a/debian/patches-rt/tpm-remove-tpm_dev_wq_lock.patch +++ b/debian/patches-rt/tpm-remove-tpm_dev_wq_lock.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Mon, 11 Feb 2019 11:33:11 +0100 Subject: [PATCH] tpm: remove tpm_dev_wq_lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Added in commit diff --git a/debian/patches-rt/tpm_tis-fix-stall-after-iowrite-s.patch b/debian/patches-rt/tpm_tis-fix-stall-after-iowrite-s.patch index 28e7e2178..58fcd2539 100644 --- a/debian/patches-rt/tpm_tis-fix-stall-after-iowrite-s.patch +++ b/debian/patches-rt/tpm_tis-fix-stall-after-iowrite-s.patch @@ -1,7 +1,7 @@ From: Haris Okanovic Date: Tue, 15 Aug 2017 15:13:08 -0500 Subject: [PATCH] tpm_tis: fix stall after iowrite*()s -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz ioread8() operations to TPM MMIO addresses can stall the cpu when immediately following a sequence of iowrite*()'s to the same region. diff --git a/debian/patches-rt/tty-serial-pl011-warning-about-uninitialized.patch b/debian/patches-rt/tty-serial-pl011-warning-about-uninitialized.patch index e04c0a3f4..764b09153 100644 --- a/debian/patches-rt/tty-serial-pl011-warning-about-uninitialized.patch +++ b/debian/patches-rt/tty-serial-pl011-warning-about-uninitialized.patch @@ -4,7 +4,7 @@ Subject: [PATCH] tty: serial: pl011: explicitly initialize the flags variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Silence the following gcc warning: diff --git a/debian/patches-rt/tty-sysrq-Convert-show_lock-to-raw_spinlock_t.patch b/debian/patches-rt/tty-sysrq-Convert-show_lock-to-raw_spinlock_t.patch index e152f7bd3..9ff71621a 100644 --- a/debian/patches-rt/tty-sysrq-Convert-show_lock-to-raw_spinlock_t.patch +++ b/debian/patches-rt/tty-sysrq-Convert-show_lock-to-raw_spinlock_t.patch @@ -1,7 +1,7 @@ From: Julien Grall Date: Wed, 13 Mar 2019 11:40:34 +0000 Subject: [PATCH] tty/sysrq: Convert show_lock to raw_spinlock_t -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Systems which don't provide arch_trigger_cpumask_backtrace() will invoke showacpu() from a smp_call_function() function which is invoked diff --git a/debian/patches-rt/upstream-net-rt-remove-preemption-disabling-in-netif_rx.patch b/debian/patches-rt/upstream-net-rt-remove-preemption-disabling-in-netif_rx.patch index 39d193e39..1172edb25 100644 --- a/debian/patches-rt/upstream-net-rt-remove-preemption-disabling-in-netif_rx.patch +++ b/debian/patches-rt/upstream-net-rt-remove-preemption-disabling-in-netif_rx.patch @@ -1,7 +1,7 @@ Subject: net: Remove preemption disabling in netif_rx() From: Priyanka Jain Date: Thu, 17 May 2012 09:35:11 +0530 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz 1)enqueue_to_backlog() (called from netif_rx) should be bind to a particluar CPU. This can be achieved by @@ -38,7 +38,7 @@ Signed-off-by: Thomas Gleixner --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -4519,7 +4519,7 @@ static int netif_rx_internal(struct sk_b +@@ -4533,7 +4533,7 @@ static int netif_rx_internal(struct sk_b struct rps_dev_flow voidflow, *rflow = &voidflow; int cpu; @@ -47,7 +47,7 @@ Signed-off-by: Thomas Gleixner rcu_read_lock(); cpu = get_rps_cpu(skb->dev, skb, &rflow); -@@ -4529,14 +4529,14 @@ static int netif_rx_internal(struct sk_b +@@ -4543,14 +4543,14 @@ static int netif_rx_internal(struct sk_b ret = enqueue_to_backlog(skb, cpu, &rflow->last_qtail); rcu_read_unlock(); diff --git a/debian/patches-rt/wait.h-include-atomic.h.patch b/debian/patches-rt/wait.h-include-atomic.h.patch index 45a9ea9b3..0ac6ae033 100644 --- a/debian/patches-rt/wait.h-include-atomic.h.patch +++ b/debian/patches-rt/wait.h-include-atomic.h.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Mon, 28 Oct 2013 12:19:57 +0100 Subject: wait.h: include atomic.h -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz | CC init/main.o |In file included from include/linux/mmzone.h:9:0, diff --git a/debian/patches-rt/watchdog-prevent-deferral-of-watchdogd-wakeup-on-RT.patch b/debian/patches-rt/watchdog-prevent-deferral-of-watchdogd-wakeup-on-RT.patch index 3e9f24324..6d6149630 100644 --- a/debian/patches-rt/watchdog-prevent-deferral-of-watchdogd-wakeup-on-RT.patch +++ b/debian/patches-rt/watchdog-prevent-deferral-of-watchdogd-wakeup-on-RT.patch @@ -1,7 +1,7 @@ From: Julia Cartwright Date: Fri, 28 Sep 2018 21:03:51 +0000 Subject: [PATCH] watchdog: prevent deferral of watchdogd wakeup on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz When PREEMPT_RT_FULL is enabled, all hrtimer expiry functions are deferred for execution into the context of ktimersoftd unless otherwise diff --git a/debian/patches-rt/work-queue-work-around-irqsafe-timer-optimization.patch b/debian/patches-rt/work-queue-work-around-irqsafe-timer-optimization.patch index 595f25fba..4f92a264b 100644 --- a/debian/patches-rt/work-queue-work-around-irqsafe-timer-optimization.patch +++ b/debian/patches-rt/work-queue-work-around-irqsafe-timer-optimization.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Mon, 01 Jul 2013 11:02:42 +0200 Subject: workqueue: Prevent workqueue versus ata-piix livelock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz An Intel i7 system regularly detected rcu_preempt stalls after the kernel was upgraded from 3.6-rt to 3.8-rt. When the stall happened, disk I/O was no diff --git a/debian/patches-rt/workqueue-distangle-from-rq-lock.patch b/debian/patches-rt/workqueue-distangle-from-rq-lock.patch index 1c0f706cc..68803f543 100644 --- a/debian/patches-rt/workqueue-distangle-from-rq-lock.patch +++ b/debian/patches-rt/workqueue-distangle-from-rq-lock.patch @@ -22,7 +22,7 @@ Cc: Jens Axboe Cc: Linus Torvalds Link: http://lkml.kernel.org/r/20110622174919.135236139@linutronix.de Signed-off-by: Thomas Gleixner -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz [bigeasy: preempt_disable() around wq_worker_sleeping() by Daniel Bristot de Oliveira] diff --git a/debian/patches-rt/workqueue-prevent-deadlock-stall.patch b/debian/patches-rt/workqueue-prevent-deadlock-stall.patch index 7c443d1c2..5d2968675 100644 --- a/debian/patches-rt/workqueue-prevent-deadlock-stall.patch +++ b/debian/patches-rt/workqueue-prevent-deadlock-stall.patch @@ -1,7 +1,7 @@ Subject: workqueue: Prevent deadlock/stall on RT From: Thomas Gleixner Date: Fri, 27 Jun 2014 16:24:52 +0200 (CEST) -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Austin reported a XFS deadlock/stall on RT where scheduled work gets never exececuted and tasks are waiting for each other for ever. diff --git a/debian/patches-rt/workqueue-use-locallock.patch b/debian/patches-rt/workqueue-use-locallock.patch index 1e9f5685a..cb94cc51d 100644 --- a/debian/patches-rt/workqueue-use-locallock.patch +++ b/debian/patches-rt/workqueue-use-locallock.patch @@ -1,7 +1,7 @@ Subject: workqueue: Use local irq lock instead of irq disable regions From: Thomas Gleixner Date: Sun, 17 Jul 2011 21:42:26 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Use a local_irq_lock as a replacement for irq off regions. We keep the semantic of irq-off in regard to the pool->lock and remain preemptible. diff --git a/debian/patches-rt/workqueue-use-rcu.patch b/debian/patches-rt/workqueue-use-rcu.patch index 10c22af99..c5128f81b 100644 --- a/debian/patches-rt/workqueue-use-rcu.patch +++ b/debian/patches-rt/workqueue-use-rcu.patch @@ -1,7 +1,7 @@ Subject: workqueue: Use normal rcu From: Thomas Gleixner Date: Wed, 24 Jul 2013 15:26:54 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz There is no need for sched_rcu. The undocumented reason why sched_rcu is used is to avoid a few explicit rcu_read_lock()/unlock() pairs by diff --git a/debian/patches-rt/x86-crypto-reduce-preempt-disabled-regions.patch b/debian/patches-rt/x86-crypto-reduce-preempt-disabled-regions.patch index e4c8d958c..4ab5e0855 100644 --- a/debian/patches-rt/x86-crypto-reduce-preempt-disabled-regions.patch +++ b/debian/patches-rt/x86-crypto-reduce-preempt-disabled-regions.patch @@ -1,7 +1,7 @@ Subject: x86: crypto: Reduce preempt disabled regions From: Peter Zijlstra Date: Mon, 14 Nov 2011 18:19:27 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Restrict the preempt disabled regions to the actual floating point operations and enable preemption for the administrative actions. diff --git a/debian/patches-rt/x86-highmem-add-a-already-used-pte-check.patch b/debian/patches-rt/x86-highmem-add-a-already-used-pte-check.patch index 31d618d8c..26557a1c5 100644 --- a/debian/patches-rt/x86-highmem-add-a-already-used-pte-check.patch +++ b/debian/patches-rt/x86-highmem-add-a-already-used-pte-check.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Mon, 11 Mar 2013 17:09:55 +0100 Subject: x86/highmem: Add a "already used pte" check -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz This is a copy from kmap_atomic_prot(). diff --git a/debian/patches-rt/x86-ima-Check-EFI_RUNTIME_SERVICES-before-using.patch b/debian/patches-rt/x86-ima-Check-EFI_RUNTIME_SERVICES-before-using.patch new file mode 100644 index 000000000..350fb178d --- /dev/null +++ b/debian/patches-rt/x86-ima-Check-EFI_RUNTIME_SERVICES-before-using.patch @@ -0,0 +1,32 @@ +From: Scott Wood +Date: Tue, 23 Apr 2019 17:48:07 -0500 +Subject: [PATCH] x86/ima: Check EFI_RUNTIME_SERVICES before using +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz + +Checking efi_enabled(EFI_BOOT) is not sufficient to ensure that +EFI runtime services are available, e.g. if efi=noruntime is used. + +Without this, I get an oops on a PREEMPT_RT kernel where efi=noruntime is +the default. + +Fixes: 399574c64eaf94e8 ("x86/ima: retry detecting secure boot mode") +Signed-off-by: Scott Wood +Signed-off-by: Sebastian Andrzej Siewior +--- + arch/x86/kernel/ima_arch.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/arch/x86/kernel/ima_arch.c ++++ b/arch/x86/kernel/ima_arch.c +@@ -17,6 +17,11 @@ static enum efi_secureboot_mode get_sb_m + + size = sizeof(secboot); + ++ if (!efi_enabled(EFI_RUNTIME_SERVICES)) { ++ pr_info("ima: secureboot mode unknown, no efi\n"); ++ return efi_secureboot_mode_unknown; ++ } ++ + /* Get variable contents into buffer */ + status = efi.get_variable(efi_SecureBoot_name, &efi_variable_guid, + NULL, &size, &secboot); diff --git a/debian/patches-rt/x86-ioapic-Don-t-let-setaffinity-unmask-threaded-EOI.patch b/debian/patches-rt/x86-ioapic-Don-t-let-setaffinity-unmask-threaded-EOI.patch index 3f8e471cf..51fc3ba1f 100644 --- a/debian/patches-rt/x86-ioapic-Don-t-let-setaffinity-unmask-threaded-EOI.patch +++ b/debian/patches-rt/x86-ioapic-Don-t-let-setaffinity-unmask-threaded-EOI.patch @@ -2,7 +2,7 @@ From: Thomas Gleixner Date: Tue, 17 Jul 2018 18:25:31 +0200 Subject: [PATCH] x86/ioapic: Don't let setaffinity unmask threaded EOI interrupt too early -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz There is an issue with threaded interrupts which are marked ONESHOT and using the fasteoi handler. diff --git a/debian/patches-rt/x86-kvm-require-const-tsc-for-rt.patch b/debian/patches-rt/x86-kvm-require-const-tsc-for-rt.patch index 8595f6f38..bb02f50c6 100644 --- a/debian/patches-rt/x86-kvm-require-const-tsc-for-rt.patch +++ b/debian/patches-rt/x86-kvm-require-const-tsc-for-rt.patch @@ -1,7 +1,7 @@ Subject: x86: kvm Require const tsc for RT From: Thomas Gleixner Date: Sun, 06 Nov 2011 12:26:18 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Non constant TSC is a nightmare on bare metal already, but with virtualization it becomes a complete disaster because the workarounds @@ -15,7 +15,7 @@ Signed-off-by: Thomas Gleixner --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c -@@ -6934,6 +6934,14 @@ int kvm_arch_init(void *opaque) +@@ -6936,6 +6936,14 @@ int kvm_arch_init(void *opaque) goto out; } diff --git a/debian/patches-rt/x86-preempt-lazy.patch b/debian/patches-rt/x86-preempt-lazy.patch index 7ec9acfdd..767f577fa 100644 --- a/debian/patches-rt/x86-preempt-lazy.patch +++ b/debian/patches-rt/x86-preempt-lazy.patch @@ -1,7 +1,7 @@ Subject: x86: Support for lazy preemption From: Thomas Gleixner Date: Thu, 01 Nov 2012 11:03:47 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Implement the x86 pieces for lazy preempt. diff --git a/debian/patches-rt/x86-signal-delay-calling-signals-on-32bit.patch b/debian/patches-rt/x86-signal-delay-calling-signals-on-32bit.patch index 2e5a03a5f..4360ef02c 100644 --- a/debian/patches-rt/x86-signal-delay-calling-signals-on-32bit.patch +++ b/debian/patches-rt/x86-signal-delay-calling-signals-on-32bit.patch @@ -1,7 +1,7 @@ From: Yang Shi Date: Thu, 10 Dec 2015 10:58:51 -0800 Subject: x86/signal: delay calling signals on 32bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz When running some ptrace single step tests on x86-32 machine, the below problem is triggered: diff --git a/debian/patches-rt/x86-stackprot-no-random-on-rt.patch b/debian/patches-rt/x86-stackprot-no-random-on-rt.patch index ebb12f0d8..a512ba269 100644 --- a/debian/patches-rt/x86-stackprot-no-random-on-rt.patch +++ b/debian/patches-rt/x86-stackprot-no-random-on-rt.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 16 Dec 2010 14:25:18 +0100 Subject: x86: stackprotector: Avoid random pool on rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz CPU bringup calls into the random pool to initialize the stack canary. During boot that works nicely even on RT as the might sleep diff --git a/debian/patches-rt/x86-use-gen-rwsem-spinlocks-rt.patch b/debian/patches-rt/x86-use-gen-rwsem-spinlocks-rt.patch index da41e8c00..718b89769 100644 --- a/debian/patches-rt/x86-use-gen-rwsem-spinlocks-rt.patch +++ b/debian/patches-rt/x86-use-gen-rwsem-spinlocks-rt.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Sun, 26 Jul 2009 02:21:32 +0200 Subject: x86: Use generic rwsem_spinlocks on -rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz Simplifies the separation of anon_rw_semaphores and rw_semaphores for -rt. -- cgit v1.2.3