From 4758c0b1b1248daee5706aaf03c12aeab27e2434 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sun, 3 Jun 2018 10:57:46 +0200 Subject: [PATCH] 4.16-stable patches added patches: drm-i915-disable-lvds-on-radiant-p845.patch drm-i915-lvds-move-acpi-lid-notification-registration-to-registration-phase.patch --- ...rm-i915-disable-lvds-on-radiant-p845.patch | 44 +++++ ...n-registration-to-registration-phase.patch | 152 ++++++++++++++++++ queue-4.16/series | 2 + 3 files changed, 198 insertions(+) create mode 100644 queue-4.16/drm-i915-disable-lvds-on-radiant-p845.patch create mode 100644 queue-4.16/drm-i915-lvds-move-acpi-lid-notification-registration-to-registration-phase.patch diff --git a/queue-4.16/drm-i915-disable-lvds-on-radiant-p845.patch b/queue-4.16/drm-i915-disable-lvds-on-radiant-p845.patch new file mode 100644 index 00000000000..51be26c363c --- /dev/null +++ b/queue-4.16/drm-i915-disable-lvds-on-radiant-p845.patch @@ -0,0 +1,44 @@ +From b3fb22733ae61050f8d10a1d6a8af176c5c5db1a Mon Sep 17 00:00:00 2001 +From: Ondrej Zary +Date: Fri, 9 Mar 2018 23:22:04 +0100 +Subject: drm/i915: Disable LVDS on Radiant P845 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Ondrej Zary + +commit b3fb22733ae61050f8d10a1d6a8af176c5c5db1a upstream. + +Radiant P845 does not have LVDS, only VGA. + +Cc: stable@vger.kernel.org +Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105468 +Signed-off-by: Ondrej Zary +Signed-off-by: Ville Syrjälä +Link: https://patchwork.freedesktop.org/patch/msgid/20180309222204.4771-1-linux@rainbow-software.org +(cherry picked from commit 7f7105f99b75aca4f8c2a748ed6b82c7f8be3293) +Signed-off-by: Joonas Lahtinen +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/i915/intel_lvds.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/drivers/gpu/drm/i915/intel_lvds.c ++++ b/drivers/gpu/drm/i915/intel_lvds.c +@@ -847,6 +847,14 @@ static const struct dmi_system_id intel_ + DMI_EXACT_MATCH(DMI_BOARD_NAME, "D525MW"), + }, + }, ++ { ++ .callback = intel_no_lvds_dmi_callback, ++ .ident = "Radiant P845", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Radiant Systems Inc"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "P845"), ++ }, ++ }, + + { } /* terminating entry */ + }; diff --git a/queue-4.16/drm-i915-lvds-move-acpi-lid-notification-registration-to-registration-phase.patch b/queue-4.16/drm-i915-lvds-move-acpi-lid-notification-registration-to-registration-phase.patch new file mode 100644 index 00000000000..44660573fe6 --- /dev/null +++ b/queue-4.16/drm-i915-lvds-move-acpi-lid-notification-registration-to-registration-phase.patch @@ -0,0 +1,152 @@ +From b9eb9c92899a509fe258d38dd6c214b1de69eee0 Mon Sep 17 00:00:00 2001 +From: Chris Wilson +Date: Fri, 18 May 2018 08:48:40 +0100 +Subject: drm/i915/lvds: Move acpi lid notification registration to registration phase +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Chris Wilson + +commit b9eb9c92899a509fe258d38dd6c214b1de69eee0 upstream. + +Delay registering ourselves with the acpi lid notification mechanism +until we are registering the connectors after initialisation is +complete. This prevents a possibility of trying to handle the lid +notification before we are ready with the danger of chasing +uninitialised function pointers. + + BUG: unable to handle kernel NULL pointer dereference at 0000000000000000 + IP: (null) + PGD 0 P4D 0 + Oops: 0010 [#1] PREEMPT SMP PTI + Modules linked in: arc4(+) iwldvm(+) i915(+) mac80211 i2c_algo_bit coretemp mei_wdt iwlwifi drm_kms_helper kvm_intel wmi_bmof iTCO_wdt iTCO_vendor_support kvm snd_hda_codec_conexant snd_hda_codec_generic drm psmouse cfg80211 irqbypass input_leds pcspkr i2c_i801 snd_hda_intel snd_hda_codec thinkpad_acpi snd_hda_core mei_me lpc_ich snd_hwdep e1000e wmi nvram snd_pcm mei snd_timer shpchp ptp pps_core rfkill syscopyarea snd intel_agp sysfillrect intel_gtt soundcore sysimgblt battery led_class fb_sys_fops ac rtc_cmos agpgart evdev mac_hid acpi_cpufreq ip_tables x_tables ext4 crc32c_generic crc16 mbcache jbd2 fscrypto crypto_simd glue_helper cryptd aes_x86_64 xts algif_skcipher af_alg dm_crypt dm_mod sd_mod uas usb_storage serio_raw atkbd libps2 ahci libahci uhci_hcd libata scsi_mod ehci_pci + ehci_hcd usbcore usb_common i8042 serio + CPU: 1 PID: 378 Comm: systemd-logind Not tainted 4.16.8-1-ARCH #1 + Hardware name: LENOVO 7454CTO/7454CTO, BIOS 6DET72WW (3.22 ) 10/25/2012 + RIP: 0010: (null) + RSP: 0018:ffffaf4580c33a18 EFLAGS: 00010287 + RAX: 0000000000000000 RBX: ffff947533558000 RCX: 000000000000003e + RDX: ffffffffc0aa80c0 RSI: ffffaf4580c33a3c RDI: ffff947534e4c000 + RBP: ffff947533558338 R08: ffff947534598930 R09: ffffffffc0a928b1 + R10: ffffd8f181d5fd40 R11: 0000000000000000 R12: ffffffffc0a928b1 + R13: ffff947533558368 R14: ffffffffc0a928a9 R15: ffff947534e4c000 + FS: 00007f3dc4ddb940(0000) GS:ffff947539280000(0000) knlGS:0000000000000000 + CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 + CR2: 0000000000000000 CR3: 000000006e214000 CR4: 00000000000406e0 + Call Trace: + ? intel_modeset_setup_hw_state+0x385/0xf60 [i915] + ? __intel_display_resume+0x1e/0xc0 [i915] + ? intel_display_resume+0xcc/0x120 [i915] + ? intel_lid_notify+0xbc/0xc0 [i915] + ? notifier_call_chain+0x47/0x70 + ? blocking_notifier_call_chain+0x3e/0x60 + ? acpi_lid_notify_state+0x8f/0x1d0 + ? acpi_lid_update_state+0x49/0x70 + ? acpi_lid_input_open+0x60/0x90 + ? input_open_device+0x5d/0xa0 + ? evdev_open+0x1ba/0x1e0 [evdev] + ? chrdev_open+0xa3/0x1b0 + ? cdev_put.part.0+0x20/0x20 + ? do_dentry_open+0x14c/0x300 + ? path_openat+0x30c/0x1240 + ? current_time+0x16/0x60 + ? do_filp_open+0x93/0x100 + ? __check_object_size+0xfb/0x180 + ? do_sys_open+0x186/0x210 + ? do_syscall_64+0x74/0x190 + ? entry_SYSCALL_64_after_hwframe+0x3d/0xa2 + Code: Bad RIP value. + RIP: (null) RSP: ffffaf4580c33a18 + CR2: 0000000000000000 + +Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106559 +Fixes: c1c7af608920 ("drm/i915: force mode set at lid open time") +Signed-off-by: Chris Wilson +Cc: Maarten Lankhorst +Cc: Ville Syrjälä +Cc: Daniel Vetter +Reviewed-by: Jani Nikula +Link: https://patchwork.freedesktop.org/patch/msgid/20180518074840.16194-1-chris@chris-wilson.co.uk +Cc: stable@vger.kernel.org +(cherry picked from commit e578a570dc7c20475774d1ff993825e3bd7a7011) +Signed-off-by: Joonas Lahtinen +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/i915/intel_lvds.c | 43 ++++++++++++++++++++++++++++---------- + 1 file changed, 32 insertions(+), 11 deletions(-) + +--- a/drivers/gpu/drm/i915/intel_lvds.c ++++ b/drivers/gpu/drm/i915/intel_lvds.c +@@ -567,6 +567,36 @@ exit: + return NOTIFY_OK; + } + ++static int ++intel_lvds_connector_register(struct drm_connector *connector) ++{ ++ struct intel_lvds_connector *lvds = to_lvds_connector(connector); ++ int ret; ++ ++ ret = intel_connector_register(connector); ++ if (ret) ++ return ret; ++ ++ lvds->lid_notifier.notifier_call = intel_lid_notify; ++ if (acpi_lid_notifier_register(&lvds->lid_notifier)) { ++ DRM_DEBUG_KMS("lid notifier registration failed\n"); ++ lvds->lid_notifier.notifier_call = NULL; ++ } ++ ++ return 0; ++} ++ ++static void ++intel_lvds_connector_unregister(struct drm_connector *connector) ++{ ++ struct intel_lvds_connector *lvds = to_lvds_connector(connector); ++ ++ if (lvds->lid_notifier.notifier_call) ++ acpi_lid_notifier_unregister(&lvds->lid_notifier); ++ ++ intel_connector_unregister(connector); ++} ++ + /** + * intel_lvds_destroy - unregister and free LVDS structures + * @connector: connector to free +@@ -579,9 +609,6 @@ static void intel_lvds_destroy(struct dr + struct intel_lvds_connector *lvds_connector = + to_lvds_connector(connector); + +- if (lvds_connector->lid_notifier.notifier_call) +- acpi_lid_notifier_unregister(&lvds_connector->lid_notifier); +- + if (!IS_ERR_OR_NULL(lvds_connector->base.edid)) + kfree(lvds_connector->base.edid); + +@@ -602,8 +629,8 @@ static const struct drm_connector_funcs + .fill_modes = drm_helper_probe_single_connector_modes, + .atomic_get_property = intel_digital_connector_atomic_get_property, + .atomic_set_property = intel_digital_connector_atomic_set_property, +- .late_register = intel_connector_register, +- .early_unregister = intel_connector_unregister, ++ .late_register = intel_lvds_connector_register, ++ .early_unregister = intel_lvds_connector_unregister, + .destroy = intel_lvds_destroy, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, + .atomic_duplicate_state = intel_digital_connector_duplicate_state, +@@ -1138,12 +1165,6 @@ out: + + lvds_encoder->a3_power = lvds & LVDS_A3_POWER_MASK; + +- lvds_connector->lid_notifier.notifier_call = intel_lid_notify; +- if (acpi_lid_notifier_register(&lvds_connector->lid_notifier)) { +- DRM_DEBUG_KMS("lid notifier registration failed\n"); +- lvds_connector->lid_notifier.notifier_call = NULL; +- } +- + return; + + failed: diff --git a/queue-4.16/series b/queue-4.16/series index 585b511b94d..46977b4c8b2 100644 --- a/queue-4.16/series +++ b/queue-4.16/series @@ -41,3 +41,5 @@ mm-huge_memory.c-__split_huge_page-use-atomic-clearpagedirty.patch revert-rt2800-use-txop_backoff-for-probe-frames.patch intel_th-use-correct-device-when-freeing-buffers.patch drm-psr-fix-missed-entry-in-psr-setup-time-table.patch +drm-i915-lvds-move-acpi-lid-notification-registration-to-registration-phase.patch +drm-i915-disable-lvds-on-radiant-p845.patch -- 2.47.3