From: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> commit 718632467d88e98816fa01ab12681ef1c2aa56f8 upstream. This reverts commit 3791ea69a4858b81e0277f695ca40f5aae40f312. It was reported to cause boot-time issues, so revert it for now. Reported-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> Fixes: 3791ea69a485 ("serial: sh-sci: Clean sci_ports[0] after at earlycon exit") Cc: stable <stable@xxxxxxxxxx> Cc: Claudiu Beznea <claudiu.beznea.uj@xxxxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/tty/serial/sh-sci.c | 28 ---------------------------- 1 file changed, 28 deletions(-) --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -3535,32 +3535,6 @@ sh_early_platform_init_buffer("earlyprin #ifdef CONFIG_SERIAL_SH_SCI_EARLYCON static struct plat_sci_port port_cfg __initdata; -static int early_console_exit(struct console *co) -{ - struct sci_port *sci_port = &sci_ports[0]; - struct uart_port *port = &sci_port->port; - unsigned long flags; - int locked = 1; - - if (port->sysrq) - locked = 0; - else if (oops_in_progress) - locked = uart_port_trylock_irqsave(port, &flags); - else - uart_port_lock_irqsave(port, &flags); - - /* - * Clean the slot used by earlycon. A new SCI device might - * map to this slot. - */ - memset(sci_ports, 0, sizeof(*sci_port)); - - if (locked) - uart_port_unlock_irqrestore(port, flags); - - return 0; -} - static int __init early_console_setup(struct earlycon_device *device, int type) { @@ -3577,8 +3551,6 @@ static int __init early_console_setup(st SCSCR_RE | SCSCR_TE | port_cfg.scscr); device->con->write = serial_console_write; - device->con->exit = early_console_exit; - return 0; } static int __init sci_early_console_setup(struct earlycon_device *device, Patches currently in stable-queue which might be from gregkh@xxxxxxxxxxxxxxxxxxx are queue-6.12/usb-chaoskey-fail-open-after-removal.patch queue-6.12/kvm-arm64-vgic-v3-sanitise-guest-writes-to-gicr_invlpir.patch queue-6.12/xhci-don-t-issue-reset-device-command-to-etron-xhci-host.patch queue-6.12/io_uring-fix-corner-case-forgetting-to-vunmap.patch queue-6.12/asoc-amd-yc-add-a-quirk-for-microfone-on-lenovo-thinkpad-p14s-gen-5-21mes00b00.patch queue-6.12/pci-fix-use-after-free-of-slot-bus-on-hot-remove.patch queue-6.12/spi-fix-acpi-deferred-irq-probe.patch queue-6.12/dt-bindings-pinctrl-samsung-fix-interrupt-constraint-for-variants-with-fallbacks.patch queue-6.12/kvm-x86-switch-hugepage-recovery-thread-to-vhost_task.patch queue-6.12/clk-clk-loongson2-fix-memory-corruption-bug-in-struct-loongson2_clk_provider.patch queue-6.12/apparmor-test-fix-memory-leak-for-aa_unpack_strdup.patch queue-6.12/xen-fix-the-issue-of-resource-not-being-properly-released-in-xenbus_dev_probe.patch queue-6.12/bluetooth-fix-type-of-len-in-rfcomm_sock_getsockopt-_old.patch queue-6.12/dt-bindings-iio-dac-ad3552r-fix-maximum-spi-speed.patch queue-6.12/net_sched-sch_fq-don-t-follow-the-fast-path-if-tx-is-behind-now.patch queue-6.12/parisc-ftrace-fix-function-graph-tracing-disablement.patch queue-6.12/ext4-fix-fs_ioc_getfsmap-handling.patch queue-6.12/ext4-supress-data-race-warnings-in-ext4_free_inodes_-count-set.patch queue-6.12/wifi-brcmfmac-release-root-node-in-all-execution-paths.patch queue-6.12/asoc-codecs-fix-atomicity-violation-in-snd_soc_component_get_drvdata.patch queue-6.12/usb-yurex-make-waiting-on-yurex_write-interruptible.patch queue-6.12/wifi-nl80211-fix-bounds-checker-error-in-nl80211_parse_sched_scan.patch queue-6.12/usb-typec-fix-potential-array-underflow-in-ucsi_ccg_.patch queue-6.12/mtd-spi-nor-core-replace-dummy-buswidth-from-addr-to-data.patch queue-6.12/comedi-flush-partial-mappings-in-error-case.patch queue-6.12/exfat-fix-uninit-value-in-__exfat_get_dentry_set.patch queue-6.12/arm-dts-omap36xx-declare-1ghz-opp-as-turbo-again.patch queue-6.12/kvm-arm64-ignore-pmcntenset_el0-while-checking-for-overflow-status.patch queue-6.12/wifi-ath12k-fix-crash-when-unbinding.patch queue-6.12/kvm-arm64-get-rid-of-userspace_irqchip_in_use.patch queue-6.12/serial-sh-sci-clean-sci_ports-after-at-earlycon-exit.patch queue-6.12/loongarch-explicitly-specify-code-model-in-makefile.patch queue-6.12/asoc-da7213-populate-max_register-to-regmap_config.patch queue-6.12/usb-ehci-spear-fix-call-balance-of-sehci-clk-handling-routines.patch queue-6.12/rust-kernel-fix-this_module-header-path-in-thismodul.patch queue-6.12/clk-clk-loongson2-fix-potential-buffer-overflow-in-flexible-array-member-access.patch queue-6.12/revert-usb-gadget-composite-fix-os-descriptors-w_value-logic.patch queue-6.12/kvm-arm64-vgic-its-clear-dte-when-mapd-unmaps-a-device.patch queue-6.12/blk-settings-round-down-io_opt-to-physical_block_size.patch queue-6.12/usb-chaoskey-fix-possible-deadlock-chaoskey_list_loc.patch queue-6.12/usb-xhci-limit-stop-endpoint-retries.patch queue-6.12/usb-gadget-uvc-wake-pump-everytime-we-update-the-fre.patch queue-6.12/usb-using-mutex-lock-and-supporting-o_nonblock-flag-.patch queue-6.12/crypto-x86-aegis128-access-32-bit-arguments-as-32-bit.patch queue-6.12/cpufreq-mediatek-hw-fix-wrong-return-value-in-mtk_cpufreq_get_cpu_power.patch queue-6.12/wifi-ath12k-fix-warning-when-unbinding.patch queue-6.12/kvm-x86-mmu-skip-the-try-unsync-path-iff-the-old-spte-was-a-leaf-spte.patch queue-6.12/iio-dac-adi-axi-dac-fix-wrong-register-bitfield.patch queue-6.12/tools-nolibc-s390-include-std.h.patch queue-6.12/phy-realtek-usb-fix-null-deref-in-rtk_usb2phy_probe.patch queue-6.12/jfs-xattr-check-invalid-xattr-size-more-strictly.patch queue-6.12/fsnotify-fix-sending-inotify-event-with-unexpected-filename.patch queue-6.12/docs-media-update-location-of-the-media-patches.patch queue-6.12/powerpc-pseries-fix-kvm-guest-detection-for-disabling-hardlockup-detector.patch queue-6.12/xhci-don-t-perform-soft-retry-for-etron-xhci-host.patch queue-6.12/revert-serial-sh-sci-clean-sci_ports-after-at-earlycon-exit.patch queue-6.12/kvm-arm64-don-t-retire-aborted-mmio-instruction.patch queue-6.12/f2fs-fix-fiemap-failure-issue-when-page-size-is-16kb.patch queue-6.12/smb-client-fix-null-ptr-deref-in-crypto_aead_setkey.patch queue-6.12/locking-lockdep-avoid-creating-new-name-string-literals-in-lockdep_set_subclass.patch queue-6.12/pinctrl-qcom-spmi-fix-debugfs-drive-strength.patch queue-6.12/kvm-arm64-vgic-its-add-a-data-length-check-in-vgic_its_save_.patch queue-6.12/firmware_loader-fix-possible-resource-leak-in-fw_log.patch queue-6.12/ksmbd-fix-use-after-free-in-smb-request-handling.patch queue-6.12/wifi-rtlwifi-drastically-reduce-the-attempts-to-read-efuse-in-case-of-failures.patch queue-6.12/fcntl-make-f_dupfd_query-associative.patch queue-6.12/tty-ldsic-fix-tty_ldisc_autoload-sysctl-s-proc_handler.patch queue-6.12/gpio-exar-set-value-when-external-pull-up-or-pull-down-is-present.patch queue-6.12/netfilter-ipset-add-missing-range-check-in-bitmap_ip_uadt.patch queue-6.12/alsa-usb-audio-fix-out-of-bounds-reads-when-finding-clock-sources.patch queue-6.12/exfat-fix-out-of-bounds-access-of-directory-entries.patch queue-6.12/io_uring-check-for-overflows-in-io_pin_pages.patch queue-6.12/revert-fs-don-t-block-i_writecount-during-exec.patch queue-6.12/alsa-usb-audio-fix-potential-out-of-bound-accesses-for-extigy-and-mbox-devices.patch queue-6.12/xhci-fix-control-transfer-error-on-etron-xhci-host.patch queue-6.12/risc-v-scalar-unaligned-access-emulated-on-hotplug-cpus.patch queue-6.12/revert-kvm-vmx-move-load_ia32_perf_global_ctrl-errata-handling-out-of-setup_vmcs_config.patch queue-6.12/compiler-attributes-disable-__counted_by-for-clang-19.1.3.patch queue-6.12/cifs-support-mounting-with-alternate-password-to-allow-password-rotation.patch queue-6.12/maintainers-update-location-of-media-main-tree.patch queue-6.12/mfd-intel_soc_pmic_bxtwc-use-irq-domain-for-usb-type.patch queue-6.12/perf-x86-intel-pt-fix-buffer-full-but-size-is-0-case.patch queue-6.12/usb-typec-ucsi-glink-fix-off-by-one-in-connector_status.patch queue-6.12/misc-apds990x-fix-missing-pm_runtime_disable.patch queue-6.12/revert-f2fs-remove-unreachable-lazytime-mount-option-parsing.patch queue-6.12/risc-v-check-scalar-unaligned-access-on-all-cpus.patch queue-6.12/xhci-combine-two-if-statements-for-etron-xhci-host.patch queue-6.12/usb-xhci-fix-td-invalidation-under-pending-set-tr-dequeue.patch queue-6.12/kvm-arm64-vgic-its-clear-ite-when-discard-frees-an-ite.patch queue-6.12/fsnotify-fix-ordering-of-iput-and-watched_objects-decrement.patch queue-6.12/kvm-x86-break-config_kvm_x86-s-direct-dependency-on-kvm_intel-kvm_amd.patch queue-6.12/usb-xhci-avoid-queuing-redundant-stop-endpoint-commands.patch queue-6.12/kvm-x86-add-back-x86_local_apic-dependency.patch queue-6.12/xfs-fix-simplify-extent-lookup-in-xfs_can_free_eofblocks.patch queue-6.12/devres-fix-page-faults-when-tracing-devres-from-unlo.patch queue-6.12/phy-realtek-usb-fix-null-deref-in-rtk_usb3phy_probe.patch