Skip to contentSkip to conversation

vt: Grab console_lock around con_is_bound in show_bind

PATCH In review Daniel Vetter 6 participants 8 messages Jul 18, 2019 – Jul 23, 2019

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

PATCH 1/1 vt: Grab console_lock around con_is_bound in show_bind

Not really harmful not to, but also not harm in grabbing the lock. And this shuts up a new WARNING I introduced in commit ddde3c18b700 ("vt:
More locking checks").

Cc Greg Kroah-Hartman <[email protected]>
Cc Nicolas Pitre <[email protected]>
Cc Martin Hostettler <[email protected]>
Cc Adam Borowski <[email protected]>
Cc Mikulas Patocka <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Sam Ravnborg <[email protected]>
---
 drivers/tty/vt/vt.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/tty/vt/vt.c +5 -1
index ec92f36ab5c4..34aa39d1aed9 100644
@@ -3771,7 +3771,11 @@ static ssize_t show_bind(struct device *dev, struct device_attribute *attr,
 			 char *buf)
 {
 	struct con_driver *con = dev_get_drvdata(dev);
-	int bind = con_is_bound(con->con);
+	int bind;
+
+	console_lock();
+	bind = con_is_bound(con->con);
+	console_unlock();
 
 	return snprintf(buf, PAGE_SIZE, "%i\n", bind);
 }
Signature · 1 line
2.20.1
#1 lore raw

✗ Fi.CI.CHECKPATCH: warning for vt: Grab console_lock around con_is_bound in show_bind

== Series Details ==

== Series Details ==

Series: vt: Grab console_lock around con_is_bound in show_bind
URL : https://patchwork.freedesktop.org/series/63866/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
28a5e5adf873 vt: Grab console_lock around con_is_bound in show_bind
-:40: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <[email protected]>'

total: 0 errors, 1 warnings, 0 checks, 12 lines checked

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

#2 lore raw

✓ Fi.CI.BAT: success for vt: Grab console_lock around con_is_bound in show_bind

In reply to Daniel Vetter
== Series Details ==

== Series Details ==

Series: vt: Grab console_lock around con_is_bound in show_bind
URL : https://patchwork.freedesktop.org/series/63866/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_6503 -> Patchwork_13681
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13681/

Known issues
------------

Here are the changes found in Patchwork_13681 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@gem_ctx_create@basic-files:
- fi-cml-u2: [PASS][1] -> [INCOMPLETE][2] ([fdo#110566])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6503/fi-cml-u2/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13681/fi-cml-u2/igt@[email protected]

* igt@i915_selftest@live_execlists:
- fi-skl-gvtdvm: [PASS][3] -> [DMESG-FAIL][4] ([fdo#111108])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6503/fi-skl-gvtdvm/igt@i915_selftest@live_execlists.html
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13681/fi-skl-gvtdvm/igt@i915_selftest@live_execlists.html

#### Possible fixes ####

* igt@kms_busy@basic-flip-c:
- {fi-icl-u4}: [DMESG-WARN][5] ([fdo#105602]) -> [PASS][6] +5 similar issues
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6503/fi-icl-u4/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13681/fi-icl-u4/igt@[email protected]

* igt@kms_chamelium@hdmi-hpd-fast:
- fi-kbl-7500u: [FAIL][7] ([fdo#109485]) -> [PASS][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6503/fi-kbl-7500u/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13681/fi-kbl-7500u/igt@[email protected]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#105602]: https://bugs.freedesktop.org/show_bug.cgi?id=105602
[fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
[fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
[fdo#109485]: https://bugs.freedesktop.org/show_bug.cgi?id=109485
[fdo#110566]: https://bugs.freedesktop.org/show_bug.cgi?id=110566
[fdo#111045]: https://bugs.freedesktop.org/show_bug.cgi?id=111045
[fdo#111108]: https://bugs.freedesktop.org/show_bug.cgi?id=111108

Participating hosts (53 -> 47)
------------------------------

Additional (2): fi-byt-j1900 fi-cml-u
Missing (8): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-icl-y fi-byt-clapper fi-bdw-samus

Build changes
-------------

* Linux: CI_DRM_6503 -> Patchwork_13681

CI_DRM_6503: 40ef4755f8a1f2fc49001b67358dc83c71492d4b @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5102: 6038ace76016d8892f4d13aef5301f71ca1a6e2d @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_13681: 28a5e5adf873d938ae3539f9b443e0a8ddc3c222 @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

28a5e5adf873 vt: Grab console_lock around con_is_bound in show_bind

== Logs ==

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

Acked-by on v1 1/1
#3 lore raw
In reply to Daniel Vetter

Hi Daniel.

Patch looks good. You can add my:

For good measure I checked all other users of con_is_bound() and they looked good from a locking perspective. Then I looked a bit more for missing locking and lost the overview.

Quoted 3 lines · Daniel Vetter

Not really harmful not to, but also not harm in grabbing the lock. And this shuts up a new WARNING I introduced in commit ddde3c18b700 ("vt:
More locking checks").

Maybe add the warning that Jens reported to the changelog, in case someone hits something that looks like this warning. Mainly for google fodder, but also in case changelogs are searched.

Sam

Quoted 37 lines
Cc Greg Kroah-Hartman <[email protected]>
Cc Nicolas Pitre <[email protected]>
Cc Martin Hostettler <[email protected]>
Cc Adam Borowski <[email protected]>
Cc Mikulas Patocka <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Sam Ravnborg <[email protected]>
---
 drivers/tty/vt/vt.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/tty/vt/vt.c +5 -1
index ec92f36ab5c4..34aa39d1aed9 100644
@@ -3771,7 +3771,11 @@ static ssize_t show_bind(struct device *dev, struct device_attribute *attr,
 			 char *buf)
 {
 	struct con_driver *con = dev_get_drvdata(dev);
-	int bind = con_is_bound(con->con);
+	int bind;
+
+	console_lock();
+	bind = con_is_bound(con->con);
+	console_unlock();
 
 	return snprintf(buf, PAGE_SIZE, "%i\n", bind);
 }
Signature · 1 line
2.20.1
Tested-by on v1 1/1
#4 lore raw
In reply to Daniel Vetter

Am 18.07.2019 um 10:09 schrieb Daniel Vetter:

Quoted 17 lines

Not really harmful not to, but also not harm in grabbing the lock. And this shuts up a new WARNING I introduced in commit ddde3c18b700 ("vt:
More locking checks").

Cc Greg Kroah-Hartman <[email protected]>
Cc Nicolas Pitre <[email protected]>
Cc Martin Hostettler <[email protected]>
Cc Adam Borowski <[email protected]>
Cc Mikulas Patocka <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Sam Ravnborg <[email protected]>
Quoted 3 lines
---
  drivers/tty/vt/vt.c | 6 +++++-
  1 file changed, 5 insertions(+), 1 deletion(-)

Thank you for the quick fix! Looks fine to me. Did test with cat as well as our dump2tar utility. The warning is gone.

Regards,
Jens Remus

Signature · 10 lines
Linux on Z and z/VSE Development & Service (D3229)
IBM Systems & Technology Group, Pure Systems & Modular Software Development

IBM Data Privacy Statement: https://www.ibm.com/privacy/us/en/

IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Matthias Hartmann
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Boeblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294
#5 lore raw

✓ Fi.CI.IGT: success for vt: Grab console_lock around con_is_bound in show_bind

In reply to Daniel Vetter
== Series Details ==

== Series Details ==

Series: vt: Grab console_lock around con_is_bound in show_bind
URL : https://patchwork.freedesktop.org/series/63866/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_6503_full -> Patchwork_13681_full
====================================================

Summary
-------

**SUCCESS**

No regressions found.

Known issues
------------

Here are the changes found in Patchwork_13681_full that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@gem_eio@in-flight-suspend:
- shard-skl: [PASS][1] -> [INCOMPLETE][2] ([fdo#104108]) +1 similar issue
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6503/shard-skl3/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13681/shard-skl3/igt@[email protected]

* igt@gem_exec_balancer@smoke:
- shard-iclb: [PASS][3] -> [SKIP][4] ([fdo#110854])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6503/shard-iclb1/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13681/shard-iclb3/igt@[email protected]

* igt@gem_softpin@noreloc-s3:
- shard-kbl: [PASS][5] -> [DMESG-WARN][6] ([fdo#108566])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6503/shard-kbl6/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13681/shard-kbl2/igt@[email protected]

* igt@i915_pm_rpm@i2c:
- shard-hsw: [PASS][7] -> [FAIL][8] ([fdo#104097])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6503/shard-hsw4/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13681/shard-hsw2/igt@[email protected]

* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-blt:
- shard-iclb: [PASS][9] -> [FAIL][10] ([fdo#103167]) +5 similar issues
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6503/shard-iclb1/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13681/shard-iclb5/igt@[email protected]

* igt@kms_frontbuffer_tracking@fbc-suspend:
- shard-apl: [PASS][11] -> [DMESG-WARN][12] ([fdo#108566]) +6 similar issues
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6503/shard-apl7/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13681/shard-apl7/igt@[email protected]

* igt@kms_frontbuffer_tracking@psr-1p-offscren-pri-shrfb-draw-render:
- shard-iclb: [PASS][13] -> [INCOMPLETE][14] ([fdo#106978] / [fdo#107713])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6503/shard-iclb1/igt@kms_frontbuffer_tracking@psr-1p-offscren-pri-shrfb-draw-render.html
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13681/shard-iclb7/igt@kms_frontbuffer_tracking@psr-1p-offscren-pri-shrfb-draw-render.html

* igt@kms_plane_alpha_blend@pipe-c-coverage-7efc:
- shard-skl: [PASS][15] -> [FAIL][16] ([fdo#108145] / [fdo#110403])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6503/shard-skl9/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13681/shard-skl5/igt@[email protected]

* igt@kms_plane_lowres@pipe-a-tiling-x:
- shard-iclb: [PASS][17] -> [FAIL][18] ([fdo#103166])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6503/shard-iclb4/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13681/shard-iclb5/igt@[email protected]

* igt@kms_psr2_su@frontbuffer:
- shard-iclb: [PASS][19] -> [SKIP][20] ([fdo#109642] / [fdo#111068])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6503/shard-iclb2/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13681/shard-iclb1/igt@[email protected]

* igt@kms_setmode@basic:
- shard-kbl: [PASS][21] -> [FAIL][22] ([fdo#99912])
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6503/shard-kbl2/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13681/shard-kbl4/igt@[email protected]

#### Possible fixes ####

* igt@gem_ctx_isolation@rcs0-s3:
- shard-kbl: [DMESG-WARN][23] ([fdo#108566]) -> [PASS][24] +2 similar issues
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6503/shard-kbl2/igt@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13681/shard-kbl6/igt@[email protected]

* igt@kms_cursor_crc@pipe-b-cursor-64x21-onscreen:
- shard-skl: [FAIL][25] ([fdo#103232]) -> [PASS][26]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6503/shard-skl5/igt@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13681/shard-skl9/igt@[email protected]

* igt@kms_cursor_legacy@2x-long-cursor-vs-flip-atomic:
- shard-hsw: [FAIL][27] ([fdo#105767]) -> [PASS][28]
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6503/shard-hsw8/igt@[email protected]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13681/shard-hsw1/igt@[email protected]

* igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions:
- shard-hsw: [INCOMPLETE][29] ([fdo#103540]) -> [PASS][30]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6503/shard-hsw4/igt@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13681/shard-hsw2/igt@[email protected]

* igt@kms_flip@2x-flip-vs-expired-vblank:
- shard-hsw: [FAIL][31] ([fdo#102887]) -> [PASS][32]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6503/shard-hsw7/igt@[email protected]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13681/shard-hsw8/igt@[email protected]

* igt@kms_flip@flip-vs-expired-vblank-interruptible:
- shard-skl: [FAIL][33] ([fdo#105363]) -> [PASS][34]
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6503/shard-skl8/igt@[email protected]
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13681/shard-skl2/igt@[email protected]

* igt@kms_flip@flip-vs-suspend-interruptible:
- shard-snb: [INCOMPLETE][35] ([fdo#105411]) -> [PASS][36]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6503/shard-snb1/igt@[email protected]
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13681/shard-snb6/igt@[email protected]

* igt@kms_flip@plain-flip-ts-check-interruptible:
- shard-apl: [FAIL][37] ([fdo#100368]) -> [PASS][38]
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6503/shard-apl7/igt@[email protected]
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13681/shard-apl7/igt@[email protected]

* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-shrfb-plflip-blt:
- shard-iclb: [FAIL][39] ([fdo#103167]) -> [PASS][40] +6 similar issues
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6503/shard-iclb5/igt@[email protected]
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13681/shard-iclb7/igt@[email protected]

* igt@kms_plane@plane-panning-bottom-right-suspend-pipe-a-planes:
- shard-apl: [DMESG-WARN][41] ([fdo#108566]) -> [PASS][42]
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6503/shard-apl8/igt@[email protected]
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13681/shard-apl2/igt@[email protected]

* igt@kms_plane_alpha_blend@pipe-b-constant-alpha-min:
- shard-skl: [FAIL][43] ([fdo#108145]) -> [PASS][44]
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6503/shard-skl5/igt@[email protected]
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13681/shard-skl9/igt@[email protected]

* igt@kms_psr@psr2_primary_blt:
- shard-iclb: [SKIP][45] ([fdo#109441]) -> [PASS][46]
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6503/shard-iclb3/igt@kms_psr@psr2_primary_blt.html
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13681/shard-iclb2/igt@kms_psr@psr2_primary_blt.html

#### Warnings ####

* igt@kms_frontbuffer_tracking@fbc-1p-offscren-pri-shrfb-draw-mmap-wc:
- shard-skl: [FAIL][47] ([fdo#108040]) -> [FAIL][48] ([fdo#103167])
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6503/shard-skl5/igt@kms_frontbuffer_tracking@fbc-1p-offscren-pri-shrfb-draw-mmap-wc.html
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13681/shard-skl10/igt@kms_frontbuffer_tracking@fbc-1p-offscren-pri-shrfb-draw-mmap-wc.html

[fdo#100368]: https://bugs.freedesktop.org/show_bug.cgi?id=100368
[fdo#102887]: https://bugs.freedesktop.org/show_bug.cgi?id=102887
[fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
[fdo#103540]: https://bugs.freedesktop.org/show_bug.cgi?id=103540
[fdo#104097]: https://bugs.freedesktop.org/show_bug.cgi?id=104097
[fdo#104108]: https://bugs.freedesktop.org/show_bug.cgi?id=104108
[fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
[fdo#105411]: https://bugs.freedesktop.org/show_bug.cgi?id=105411
[fdo#105767]: https://bugs.freedesktop.org/show_bug.cgi?id=105767
[fdo#106978]: https://bugs.freedesktop.org/show_bug.cgi?id=106978
[fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
[fdo#108040]: https://bugs.freedesktop.org/show_bug.cgi?id=108040
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[fdo#109642]: https://bugs.freedesktop.org/show_bug.cgi?id=109642
[fdo#110403]: https://bugs.freedesktop.org/show_bug.cgi?id=110403
[fdo#110854]: https://bugs.freedesktop.org/show_bug.cgi?id=110854
[fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
[fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912

Participating hosts (10 -> 10)
------------------------------

No changes in participating hosts

Build changes
-------------

* Linux: CI_DRM_6503 -> Patchwork_13681

CI_DRM_6503: 40ef4755f8a1f2fc49001b67358dc83c71492d4b @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5102: 6038ace76016d8892f4d13aef5301f71ca1a6e2d @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_13681: 28a5e5adf873d938ae3539f9b443e0a8ddc3c222 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

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

#6 lore raw
In reply to Daniel Vetter

Hi Greg,

Do you plan to pick this up in your console/vt/whatever-fixes branch? There's no reason for me to route this through drm-fixes. -Daniel

Quoted 41 lines · Daniel Vetter

Not really harmful not to, but also not harm in grabbing the lock. And this shuts up a new WARNING I introduced in commit ddde3c18b700 ("vt:
More locking checks").

Cc Greg Kroah-Hartman <[email protected]>
Cc Nicolas Pitre <[email protected]>
Cc Martin Hostettler <[email protected]>
Cc Adam Borowski <[email protected]>
Cc Mikulas Patocka <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Sam Ravnborg <[email protected]>
---
 drivers/tty/vt/vt.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/tty/vt/vt.c +5 -1
index ec92f36ab5c4..34aa39d1aed9 100644
@@ -3771,7 +3771,11 @@ static ssize_t show_bind(struct device *dev, struct device_attribute *attr,
 			 char *buf)
 {
 	struct con_driver *con = dev_get_drvdata(dev);
-	int bind = con_is_bound(con->con);
+	int bind;
+
+	console_lock();
+	bind = con_is_bound(con->con);
+	console_unlock();
 
 	return snprintf(buf, PAGE_SIZE, "%i\n", bind);
 }
Signature · 1 line
2.20.1
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
#7 lore raw
Quoted 3 lines · Daniel Vetter

Hi Greg,

Do you plan to pick this up in your console/vt/whatever-fixes branch?

Yes, now that the merge window is closed, I will be picking this up.

thanks,

greg k-h