Skip to contentSkip to conversation

drm/i915: prevent crash with .disable_display parameter

PATCH Superseded [email protected] 4 participants 9 messages Jan 18, 2017 – Jan 19, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: prevent crash with .disable_display parameter

From: Clint Taylor <[email protected]>

The .disable_display parameter was causing a fatal crash when fbdev was dereferenced during driver init.

---
 drivers/gpu/drm/i915/i915_drv.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_drv.c +3 -1
index 4e5ea58..b2a9195 100644
@@ -1140,7 +1140,9 @@ static void i915_driver_register(struct drm_i915_private *dev_priv)
 	 * irqs are fully enabled. We do it last so that the async config
 	 * cannot run before the connectors are registered.
 	 */
-	intel_fbdev_initial_config_async(dev);
+	if (dev_priv->fbdev) {
+		intel_fbdev_initial_config_async(dev);
+	}
 }
 
 /**
Signature · 6 lines
1.7.9.5

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

✓ Fi.CI.BAT: success for drm/i915: prevent crash with .disable_display parameter

== Series Details ==

== Series Details ==

Series: drm/i915: prevent crash with .disable_display parameter
URL : https://patchwork.freedesktop.org/series/18151/
State : success

== Summary ==

Series 18151v1 drm/i915: prevent crash with .disable_display parameter
https://patchwork.freedesktop.org/api/1.0/series/18151/revisions/1/mbox/

fi-bdw-5557u     total:246  pass:232  dwarn:0   dfail:0   fail:0   skip:14 
fi-bsw-n3050     total:246  pass:207  dwarn:0   dfail:0   fail:0   skip:39 
fi-bxt-j4205     total:246  pass:224  dwarn:0   dfail:0   fail:0   skip:22 
fi-bxt-t5700     total:82   pass:69   dwarn:0   dfail:0   fail:0   skip:12 
fi-byt-j1900     total:246  pass:219  dwarn:0   dfail:0   fail:0   skip:27 
fi-byt-n2820     total:246  pass:215  dwarn:0   dfail:0   fail:0   skip:31 
fi-hsw-4770      total:246  pass:227  dwarn:0   dfail:0   fail:0   skip:19 
fi-hsw-4770r     total:246  pass:227  dwarn:0   dfail:0   fail:0   skip:19 
fi-ivb-3520m     total:246  pass:225  dwarn:0   dfail:0   fail:0   skip:21 
fi-ivb-3770      total:246  pass:225  dwarn:0   dfail:0   fail:0   skip:21 
fi-kbl-7500u     total:246  pass:225  dwarn:0   dfail:0   fail:0   skip:21 
fi-skl-6260u     total:246  pass:233  dwarn:0   dfail:0   fail:0   skip:13 
fi-skl-6700hq    total:246  pass:226  dwarn:0   dfail:0   fail:0   skip:20 
fi-skl-6700k     total:246  pass:222  dwarn:3   dfail:0   fail:0   skip:21 
fi-skl-6770hq    total:246  pass:233  dwarn:0   dfail:0   fail:0   skip:13 
fi-snb-2520m     total:246  pass:215  dwarn:0   dfail:0   fail:0   skip:31 
fi-snb-2600      total:246  pass:214  dwarn:0   dfail:0   fail:0   skip:32 

d4ca2d2b591f1ca6b50eaf3253412f4c11ec1be2 drm-tip: 2017y-01m-17d-22h-19m-37s UTC integration manifest 400c68c drm/i915: prevent crash with .disable_display parameter

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3535/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw
In reply to [email protected]
Quoted 4 lines · On Tue, Jan 17, 2017 at 04:37:28PM -0800, [email protected] wrote:

From: Clint Taylor <[email protected]>

The .disable_display parameter was causing a fatal crash when fbdev was dereferenced during driver init.

The other guards are within intel_fbdev.c, it would be consistent to put this as the start of intel_fbdev_initial_config_async().

Testcase: igt/drv_module_reload/basic-no-display
-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw
Quoted 10 lines · Chris Wilson
Quoted 4 lines · On Tue, Jan 17, 2017 at 04:37:28PM -0800, [email protected] wrote:

From: Clint Taylor <[email protected]>

The .disable_display parameter was causing a fatal crash when fbdev was dereferenced during driver init.

The other guards are within intel_fbdev.c, it would be consistent to put this as the start of intel_fbdev_initial_config_async().

Testcase: igt/drv_module_reload/basic-no-display

Also

Fixes 43cee314345a ("drm/i915/fbdev: Limit the global async-domain synchronization")
Cc Chris Wilson <[email protected]>
Cc Lukas Wunner <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Jani Nikula <[email protected]>
Cc <[email protected]> # v4.8+
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw
In reply to Chris Wilson
Quoted 8 lines · Chris Wilson
Quoted 4 lines · On Tue, Jan 17, 2017 at 04:37:28PM -0800, [email protected] wrote:

From: Clint Taylor <[email protected]>

The .disable_display parameter was causing a fatal crash when fbdev was dereferenced during driver init.

The other guards are within intel_fbdev.c, it would be consistent to put this as the start of intel_fbdev_initial_config_async().

I came to that conclusion last night as well.

Quoted 4 lines

Testcase: igt/drv_module_reload/basic-no-display
-Chris

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#5 lore raw
In reply to [email protected]
reproduce:

Hi Clint,

[auto build test ERROR on drm-intel/for-linux-next]
[also build test ERROR on v4.10-rc4 next-20170118]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/clinton-a-taylor-intel-com/drm-i915-prevent-crash-with-disable_display-parameter/20170118-230141
base:   git://anongit.freedesktop.org/drm-intel for-linux-next
config: i386-randconfig-x005-201703 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All error/warnings (new ones prefixed by >>):

In file included from include/linux/ioport.h:12:0,

                    from include/linux/acpi.h:25,
                    from drivers/gpu/drm/i915/i915_drv.c:30:
   drivers/gpu/drm/i915/i915_drv.c: In function 'i915_driver_register':
>> drivers/gpu/drm/i915/i915_drv.c:1143:14: error: 'struct drm_i915_private' has no member named 'fbdev'
     if (dev_priv->fbdev) {
                 ^
   include/linux/compiler.h:149:30: note: in definition of macro '__trace_if'
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
                                 ^~~~
>> drivers/gpu/drm/i915/i915_drv.c:1143:2: note: in expansion of macro 'if'
     if (dev_priv->fbdev) {
     ^~
>> drivers/gpu/drm/i915/i915_drv.c:1143:14: error: 'struct drm_i915_private' has no member named 'fbdev'
     if (dev_priv->fbdev) {
                 ^
   include/linux/compiler.h:149:42: note: in definition of macro '__trace_if'
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
                                             ^~~~
>> drivers/gpu/drm/i915/i915_drv.c:1143:2: note: in expansion of macro 'if'
     if (dev_priv->fbdev) {
     ^~
>> drivers/gpu/drm/i915/i915_drv.c:1143:14: error: 'struct drm_i915_private' has no member named 'fbdev'
     if (dev_priv->fbdev) {
                 ^
   include/linux/compiler.h:160:16: note: in definition of macro '__trace_if'
      ______r = !!(cond);     \
                   ^~~~
>> drivers/gpu/drm/i915/i915_drv.c:1143:2: note: in expansion of macro 'if'
     if (dev_priv->fbdev) {
     ^~

vim +1143 drivers/gpu/drm/i915/i915_drv.c

1137 * Some ports require correctly set-up hpd registers for detection to
1138 * work properly (leading to ghost connected connector status), e.g. VGA
1139 * on gm45. Hence we can only set up the initial fbdev config after hpd
1140 * irqs are fully enabled. We do it last so that the async config
1141 * cannot run before the connectors are registered.
1142 */

> 1143		if (dev_priv->fbdev) {

1144 intel_fbdev_initial_config_async(dev);
1145 }
1146 }

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#6 lore raw

PATCH v2 1/1 drm/i915: prevent crash with .disable_display parameter

In reply to [email protected]

From: Clint Taylor <[email protected]>

The .disable_display parameter was causing a fatal crash when fbdev was dereferenced during driver init.

V1: protection in i915_drv.c
V2: Moved protection to intel_fbdev.c

Cc Chris Wilson <[email protected]>
---
 drivers/gpu/drm/i915/intel_fbdev.c |    3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/intel_fbdev.c +3 -0
index bdefa61..bb0e9bf 100644
@@ -742,6 +742,9 @@ void intel_fbdev_initial_config_async(struct drm_device *dev)
 {
 	struct intel_fbdev *ifbdev = to_i915(dev)->fbdev;
 
+	if (!ifbdev)
+		return;
+
 	ifbdev->cookie = async_schedule(intel_fbdev_initial_config, ifbdev);
 }
 
Signature · 6 lines
1.7.9.5

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#7 lore raw
Quoted 11 lines · On Wed, Jan 18, 2017 at 01:38:43PM -0800, [email protected] wrote:

From: Clint Taylor <[email protected]>

The .disable_display parameter was causing a fatal crash when fbdev was dereferenced during driver init.

V1: protection in i915_drv.c
V2: Moved protection to intel_fbdev.c

Cc Chris Wilson <[email protected]>

Added the fixes tags and pushed. Thanks,
-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#8 lore raw

✗ Fi.CI.BAT: failure for drm/i915: prevent crash with .disable_display parameter (rev2)

In reply to [email protected]
== Series Details ==

== Series Details ==

Series: drm/i915: prevent crash with .disable_display parameter (rev2)
URL : https://patchwork.freedesktop.org/series/18151/
State : failure

== Summary ==

Series 18151v2 drm/i915: prevent crash with .disable_display parameter
https://patchwork.freedesktop.org/api/1.0/series/18151/revisions/2/mbox/

Test gem_busy:

        Subgroup basic-hang-default:
                pass       -> FAIL       (fi-hsw-4770r)
Test gvt_basic:
        Subgroup invalid-placeholder-test:
                incomplete -> SKIP       (fi-ivb-3770)
fi-bdw-5557u     total:246  pass:232  dwarn:0   dfail:0   fail:0   skip:14 
fi-bsw-n3050     total:246  pass:207  dwarn:0   dfail:0   fail:0   skip:39 
fi-bxt-j4205     total:246  pass:224  dwarn:0   dfail:0   fail:0   skip:22 
fi-bxt-t5700     total:82   pass:69   dwarn:0   dfail:0   fail:0   skip:12 
fi-byt-j1900     total:246  pass:219  dwarn:0   dfail:0   fail:0   skip:27 
fi-byt-n2820     total:246  pass:215  dwarn:0   dfail:0   fail:0   skip:31 
fi-hsw-4770      total:246  pass:227  dwarn:0   dfail:0   fail:0   skip:19 
fi-hsw-4770r     total:246  pass:226  dwarn:0   dfail:0   fail:1   skip:19 
fi-ivb-3520m     total:246  pass:225  dwarn:0   dfail:0   fail:0   skip:21 
fi-ivb-3770      total:246  pass:225  dwarn:0   dfail:0   fail:0   skip:21 
fi-kbl-7500u     total:246  pass:225  dwarn:0   dfail:0   fail:0   skip:21 
fi-skl-6260u     total:246  pass:233  dwarn:0   dfail:0   fail:0   skip:13 
fi-skl-6700hq    total:246  pass:226  dwarn:0   dfail:0   fail:0   skip:20 
fi-skl-6700k     total:246  pass:222  dwarn:3   dfail:0   fail:0   skip:21 
fi-skl-6770hq    total:246  pass:233  dwarn:0   dfail:0   fail:0   skip:13 
fi-snb-2520m     total:246  pass:215  dwarn:0   dfail:0   fail:0   skip:31 
fi-snb-2600      total:246  pass:214  dwarn:0   dfail:0   fail:0   skip:32 

982f60faead5a1de551c73caae72add8cafc3355 drm-tip: 2017y-01m-18d-15h-09m-06s UTC integration manifest 7716956 drm/i915: prevent crash with .disable_display parameter

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3541/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx