This is a note to let you know that I've just added the patch titled Revert "regulator: Defer init completion for a while after late_initcall" to the 4.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: revert-regulator-defer-init-completion-for-a-while-after-late_initcall.patch and it can be found in the queue-4.9 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 21f45484a7d1cbfde5f0af2fb9491dda3ba43489 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> Date: Wed, 18 Dec 2019 15:10:24 +0100 Subject: Revert "regulator: Defer init completion for a while after late_initcall" From: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> This reverts commit 8b8c8d69b1a31004517d4c71a490f47bdf3405a2 which is commit 55576cf1853798e86f620766e23b604c9224c19c upstream. It's causing "odd" interactions with older kernels, so it probably isn't a good idea to cause timing changes there. This has been reported to cause oopses on Pixel devices. Reported-by: Siddharth Kapoor <ksiddharth@xxxxxxxxxx> Cc: Mark Brown <broonie@xxxxxxxxxx> Cc: Lee Jones <lee.jones@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/regulator/core.c | 42 +++++++++++------------------------------- 1 file changed, 11 insertions(+), 31 deletions(-) --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -4452,7 +4452,7 @@ static int __init regulator_init(void) /* init early to allow our consumers to complete system booting */ core_initcall(regulator_init); -static int regulator_late_cleanup(struct device *dev, void *data) +static int __init regulator_late_cleanup(struct device *dev, void *data) { struct regulator_dev *rdev = dev_to_rdev(dev); const struct regulator_ops *ops = rdev->desc->ops; @@ -4501,9 +4501,18 @@ unlock: return 0; } -static void regulator_init_complete_work_function(struct work_struct *work) +static int __init regulator_init_complete(void) { /* + * Since DT doesn't provide an idiomatic mechanism for + * enabling full constraints and since it's much more natural + * with DT to provide them just assume that a DT enabled + * system has full constraints. + */ + if (of_have_populated_dt()) + has_full_constraints = true; + + /* * Regulators may had failed to resolve their input supplies * when were registered, either because the input supply was * not registered yet or because its parent device was not @@ -4520,35 +4529,6 @@ static void regulator_init_complete_work */ class_for_each_device(®ulator_class, NULL, NULL, regulator_late_cleanup); -} - -static DECLARE_DELAYED_WORK(regulator_init_complete_work, - regulator_init_complete_work_function); - -static int __init regulator_init_complete(void) -{ - /* - * Since DT doesn't provide an idiomatic mechanism for - * enabling full constraints and since it's much more natural - * with DT to provide them just assume that a DT enabled - * system has full constraints. - */ - if (of_have_populated_dt()) - has_full_constraints = true; - - /* - * We punt completion for an arbitrary amount of time since - * systems like distros will load many drivers from userspace - * so consumers might not always be ready yet, this is - * particularly an issue with laptops where this might bounce - * the display off then on. Ideally we'd get a notification - * from userspace when this happens but we don't so just wait - * a bit and hope we waited long enough. It'd be better if - * we'd only do this on systems that need it, and a kernel - * command line option might be useful. - */ - schedule_delayed_work(®ulator_init_complete_work, - msecs_to_jiffies(30000)); return 0; } Patches currently in stable-queue which might be from gregkh@xxxxxxxxxxxxxxxxxxx are queue-4.9/sched-fair-scale-bandwidth-quota-and-period-without-losing-quota-period-ratio-precision.patch queue-4.9/powerpc-fix-vdso-clock_getres.patch queue-4.9/pinctrl-samsung-fix-device-node-refcount-leaks-in-s3c24xx-wakeup-controller-init.patch queue-4.9/serial-serial_core-perform-null-checks-for-break_ctl-ops.patch queue-4.9/crypto-user-fix-memory-leak-in-crypto_report.patch queue-4.9/media-bdisp-fix-memleak-on-release.patch queue-4.9/tty-serial-msm_serial-fix-flow-control.patch queue-4.9/workqueue-fix-spurious-sanity-check-failures-in-destroy_workqueue.patch queue-4.9/fuse-verify-attributes.patch queue-4.9/iio-humidity-hdc100x-fix-iio_humidityrelative-channel-reporting.patch queue-4.9/media-radio-wl1273-fix-interrupt-masking-on-release.patch queue-4.9/ext2-check-err-when-partial-null.patch queue-4.9/dmaengine-coh901318-remove-unused-variable.patch queue-4.9/xhci-make-sure-interrupts-are-restored-to-correct-st.patch queue-4.9/usb-gadget-configfs-fix-missing-spin_lock_init.patch queue-4.9/cgroup-pids-use-atomic64_t-for-pids-limit.patch queue-4.9/usb-adutux-fix-interface-sanity-check.patch queue-4.9/virtio-balloon-fix-managed-page-counts-when-migrating-pages-between-zones.patch queue-4.9/tcp-md5-fix-potential-overestimation-of-tcp-option-space.patch queue-4.9/btrfs-record-all-roots-for-rename-exchange-on-a-subvol.patch queue-4.9/xhci-increase-sts_halt-timeout-in-xhci_suspend.patch queue-4.9/xhci-Fix-memory-leak-in-xhci_add_in_port.patch queue-4.9/kvm-x86-fix-out-of-bounds-write-in-kvm_get_emulated_cpuid-cve-2019-19332.patch queue-4.9/usb-gadget-u_serial-add-missing-port-entry-locking.patch queue-4.9/staging-rtl8712-fix-interface-sanity-check.patch queue-4.9/revert-regulator-defer-init-completion-for-a-while-after-late_initcall.patch queue-4.9/usb-serial-io_edgeport-fix-epic-endpoint-lookup.patch queue-4.9/rtlwifi-rtl8192de-fix-missing-code-to-retrieve-rx-buffer-address.patch queue-4.9/dmaengine-coh901318-fix-a-double-lock-bug.patch queue-4.9/usb-core-urb-fix-urb-structure-initialization-function.patch queue-4.9/workqueue-fix-pwq-ref-leak-in-rescuer_thread.patch queue-4.9/net-bridge-deny-dev_set_mac_address-when-unregistering.patch queue-4.9/rtlwifi-rtl8192de-fix-missing-callback-that-tests-for-hw-release-of-buffer.patch queue-4.9/usb-idmouse-fix-interface-sanity-checks.patch queue-4.9/crypto-ecdh-fix-big-endian-bug-in-ecc-library.patch queue-4.9/asoc-jack-fix-null-pointer-dereference-in-snd_soc_jack_report.patch queue-4.9/alsa-pcm-oss-avoid-potential-buffer-overflows.patch queue-4.9/tcp-protect-accesses-to-.ts_recent_stamp-with-read-write-_once.patch queue-4.9/kvm-x86-fix-presentation-of-tsx-feature-in-arch_capabilities.patch queue-4.9/usb-uas-honor-flag-to-avoid-capacity16.patch queue-4.9/staging-gigaset-add-endpoint-type-sanity-check.patch queue-4.9/tcp-fix-rejected-syncookies-due-to-stale-timestamps.patch queue-4.9/mtd-spear_smi-fix-write-burst-mode.patch queue-4.9/btrfs-check-page-mapping-when-loading-free-space-cache.patch queue-4.9/serial-imx-fix-error-handling-in-console_setup.patch queue-4.9/rtlwifi-rtl8192de-fix-missing-enable-interrupt-flag.patch queue-4.9/altera-stapl-check-for-a-null-key-before-strcasecmp-.patch queue-4.9/drm-i810-prevent-underflow-in-ioctl.patch queue-4.9/usb-xhci-only-set-d3hot-for-pci-device.patch queue-4.9/quota-check-that-quota-is-not-dirty-before-release.patch queue-4.9/serial-pl011-fix-dma-flush_buffer.patch queue-4.9/usb-allow-usb-device-to-be-warm-reset-in-suspended-state.patch queue-4.9/tty-don-t-block-on-io-when-ldisc-change-is-pending.patch queue-4.9/fuse-verify-nlink.patch queue-4.9/btrfs-remove-btrfs_bio-flags-member.patch queue-4.9/tcp-tighten-acceptance-of-acks-not-matching-a-child-socket.patch queue-4.9/spi-atmel-fix-cs-high-support.patch queue-4.9/mmc-host-omap_hsmmc-add-code-for-special-init-of-wl1251-to-get-rid-of-pandora_wl1251_init_card.patch queue-4.9/serial-ifx6x60-add-missed-pm_runtime_disable.patch queue-4.9/crypto-crypto4xx-fix-double-free-in-crypto4xx_destroy_sdr.patch queue-4.9/kvm-x86-do-not-modify-masked-bits-of-shared-msrs.patch queue-4.9/openvswitch-support-asymmetric-conntrack.patch queue-4.9/staging-gigaset-fix-general-protection-fault-on-probe.patch queue-4.9/can-slcan-fix-use-after-free-read-in-slcan_open.patch queue-4.9/usb-uas-heed-capacity_heuristics.patch queue-4.9/staging-rtl8188eu-fix-interface-sanity-check.patch queue-4.9/pinctrl-samsung-fix-device-node-refcount-leaks-in-init-code.patch queue-4.9/btrfs-send-skip-backreference-walking-for-extents-with-many-references.patch queue-4.9/cpuidle-do-not-unset-the-driver-if-it-is-there-already.patch queue-4.9/appletalk-fix-potential-null-pointer-dereference-in-unregister_snap_client.patch queue-4.9/thermal-fix-deadlock-in-thermal-thermal_zone_device_check.patch queue-4.9/ar5523-check-null-before-memcpy-in-ar5523_cmd.patch queue-4.9/usb-atm-ueagle-atm-add-missing-endpoint-check.patch queue-4.9/crypto-ccp-fix-uninitialized-list-head.patch queue-4.9/tty-vt-keyboard-reject-invalid-keycodes.patch queue-4.9/lib-raid6-fix-awk-build-warnings.patch queue-4.9/usb-mon-fix-a-deadlock-in-usbmon-between-mmap-and-read.patch queue-4.9/acpi-osl-only-free-map-once-in-osl.c.patch queue-4.9/staging-gigaset-fix-illegal-free-on-probe-errors.patch queue-4.9/jbd2-fix-possible-overflow-in-jbd2_log_space_left.patch queue-4.9/net-ethernet-ti-cpsw-fix-extra-rx-interrupt.patch queue-4.9/acpi-bus-fix-null-pointer-check-in-acpi_bus_get_private_data.patch queue-4.9/x86-pci-avoid-amd-fch-xhci-usb-pme-from-d0-defect.patch queue-4.9/cifs-fix-null-pointer-dereference-in-smb2_push_mandatory_locks.patch queue-4.9/quota-fix-livelock-in-dquot_writeback_dquots.patch queue-4.9/video-hdmi-fix-avi-bar-unpack.patch queue-4.9/tipc-fix-ordering-of-tipc-module-init-and-exit-routine.patch queue-4.9/blk-mq-make-sure-that-line-break-can-be-printed.patch queue-4.9/firmware-qcom-scm-ensure-a0-status-code-is-treated-as-signed.patch queue-4.9/arm64-tegra-fix-active-low-warning-for-jetson-tx1-regulator.patch queue-4.9/acpi-pm-avoid-attaching-acpi-pm-domain-to-certain-devices.patch queue-4.9/powerpc-allow-64bit-vdso-__kernel_sync_dicache-to-work-across-ranges-4gb.patch queue-4.9/ext4-fix-a-bug-in-ext4_wait_for_tail_page_commit.patch queue-4.9/cifs-fix-smb2-oplock-break-processing.patch queue-4.9/ppdev-fix-ppgettime-ppsettime-ioctls.patch queue-4.9/input-goodix-add-upside-down-quirk-for-teclast-x89-tablet.patch queue-4.9/inet-protect-against-too-small-mtu-values.patch queue-4.9/mm-shmem.c-cast-the-type-of-unmap_start-to-u64.patch queue-4.9/coresight-etm4x-fix-input-validation-for-sysfs.patch queue-4.9/pm-devfreq-lock-devfreq-in-trans_stat_show.patch queue-4.9/workqueue-fix-missing-kfree-rescuer-in-destroy_workqueue.patch queue-4.9/serial-core-allow-processing-sysrq-at-port-unlock-ti.patch queue-4.9/blk-mq-avoid-sysfs-buffer-overflow-with-too-many-cpu-cores.patch queue-4.9/appletalk-set-error-code-if-register_snap_client-failed.patch queue-4.9/arm-dts-pandora-common-define-wl1251-as-child-node-of-mmc3.patch queue-4.9/rdma-qib-validate-show-store-callbacks-before-calling-them.patch queue-4.9/tty-serial-fsl_lpuart-use-the-sg-count-from-dma_map_sg.patch queue-4.9/nvme-host-core-fix-precedence-of-ternary-operator.patch