All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vt: Don't check KD_GRAPHICS when binding/unbinding
@ 2015-04-13  9:16 ` Daniel Vetter
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Vetter @ 2015-04-13  9:16 UTC (permalink / raw)
  To: DRI Development, LKML
  Cc: Intel Graphics Development, Daniel Vetter, Greg Kroah-Hartman,
	Antonino A. Daplas, David Herrmann, Peter Hurley, Imre Deak,
	Daniel Vetter

This was introduced in

commit 6db4063c5b72b46e9793b0f141a7a3984ac6facf
Author: Antonino A. Daplas <adaplas@gmail.com>
Date:   Mon Jun 26 00:27:12 2006 -0700

    [PATCH] VT binding: Add sysfs control to the VT layer

with the justification

    "In addition, if any of the consoles are in KD_GRAPHICS mode, binding and
    unbinding will not succeed.  KD_GRAPHICS mode usually indicates that the
    underlying console hardware is used for other purposes other than displaying
    text (ie X).  This feature should prevent binding/unbinding from interfering
    with a graphics application using the VT."

I think we should lift this artificial restriction though:
- KD_GRAPHICS doesn't get cleaned up automatically, which means it's
  easy to have terminals stuck in KD_GRAPHICS when hacking around on
  X.
- X doesn't really care, especially with drm where kms already blocks
  fbdev (and hence fbcon) when there's an active compositor.
- This is a root-only interface with a separate .config option and
  it's possible to hang your machine already anyway if you
  unload/reload drivers and don't know what you're doing.

With this patch i915.ko module reloading works again reliably,
something in the recent fedora upgrades broke things.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Antonino A. Daplas <adaplas@gmail.com>
Cc: David Herrmann <dh.herrmann@gmail.com>
Cc: Peter Hurley <peter@hurleysoftware.com>
Cc: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/tty/vt/vt.c | 22 ++--------------------
 1 file changed, 2 insertions(+), 20 deletions(-)

diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index 6e00572cbeb9..b84f7d80c8b4 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -3185,22 +3185,6 @@ err:
 
 
 #ifdef CONFIG_VT_HW_CONSOLE_BINDING
-static int con_is_graphics(const struct consw *csw, int first, int last)
-{
-	int i, retval = 0;
-
-	for (i = first; i <= last; i++) {
-		struct vc_data *vc = vc_cons[i].d;
-
-		if (vc && vc->vc_mode == KD_GRAPHICS) {
-			retval = 1;
-			break;
-		}
-	}
-
-	return retval;
-}
-
 /* unlocked version of unbind_con_driver() */
 int do_unbind_con_driver(const struct consw *csw, int first, int last, int deflt)
 {
@@ -3286,8 +3270,7 @@ static int vt_bind(struct con_driver *con)
 	const struct consw *defcsw = NULL, *csw = NULL;
 	int i, more = 1, first = -1, last = -1, deflt = 0;
 
- 	if (!con->con || !(con->flag & CON_DRIVER_FLAG_MODULE) ||
-	    con_is_graphics(con->con, con->first, con->last))
+ 	if (!con->con || !(con->flag & CON_DRIVER_FLAG_MODULE))
 		goto err;
 
 	csw = con->con;
@@ -3338,8 +3321,7 @@ static int vt_unbind(struct con_driver *con)
 	int i, more = 1, first = -1, last = -1, deflt = 0;
 	int ret;
 
- 	if (!con->con || !(con->flag & CON_DRIVER_FLAG_MODULE) ||
-	    con_is_graphics(con->con, con->first, con->last))
+ 	if (!con->con || !(con->flag & CON_DRIVER_FLAG_MODULE))
 		goto err;
 
 	csw = con->con;
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH] vt: Don't check KD_GRAPHICS when binding/unbinding
@ 2015-04-13  9:16 ` Daniel Vetter
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Vetter @ 2015-04-13  9:16 UTC (permalink / raw)
  To: DRI Development, LKML
  Cc: Peter Hurley, Greg Kroah-Hartman, Daniel Vetter,
	Intel Graphics Development, Daniel Vetter

This was introduced in

commit 6db4063c5b72b46e9793b0f141a7a3984ac6facf
Author: Antonino A. Daplas <adaplas@gmail.com>
Date:   Mon Jun 26 00:27:12 2006 -0700

    [PATCH] VT binding: Add sysfs control to the VT layer

with the justification

    "In addition, if any of the consoles are in KD_GRAPHICS mode, binding and
    unbinding will not succeed.  KD_GRAPHICS mode usually indicates that the
    underlying console hardware is used for other purposes other than displaying
    text (ie X).  This feature should prevent binding/unbinding from interfering
    with a graphics application using the VT."

I think we should lift this artificial restriction though:
- KD_GRAPHICS doesn't get cleaned up automatically, which means it's
  easy to have terminals stuck in KD_GRAPHICS when hacking around on
  X.
- X doesn't really care, especially with drm where kms already blocks
  fbdev (and hence fbcon) when there's an active compositor.
- This is a root-only interface with a separate .config option and
  it's possible to hang your machine already anyway if you
  unload/reload drivers and don't know what you're doing.

With this patch i915.ko module reloading works again reliably,
something in the recent fedora upgrades broke things.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Antonino A. Daplas <adaplas@gmail.com>
Cc: David Herrmann <dh.herrmann@gmail.com>
Cc: Peter Hurley <peter@hurleysoftware.com>
Cc: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/tty/vt/vt.c | 22 ++--------------------
 1 file changed, 2 insertions(+), 20 deletions(-)

diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index 6e00572cbeb9..b84f7d80c8b4 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -3185,22 +3185,6 @@ err:
 
 
 #ifdef CONFIG_VT_HW_CONSOLE_BINDING
-static int con_is_graphics(const struct consw *csw, int first, int last)
-{
-	int i, retval = 0;
-
-	for (i = first; i <= last; i++) {
-		struct vc_data *vc = vc_cons[i].d;
-
-		if (vc && vc->vc_mode == KD_GRAPHICS) {
-			retval = 1;
-			break;
-		}
-	}
-
-	return retval;
-}
-
 /* unlocked version of unbind_con_driver() */
 int do_unbind_con_driver(const struct consw *csw, int first, int last, int deflt)
 {
@@ -3286,8 +3270,7 @@ static int vt_bind(struct con_driver *con)
 	const struct consw *defcsw = NULL, *csw = NULL;
 	int i, more = 1, first = -1, last = -1, deflt = 0;
 
- 	if (!con->con || !(con->flag & CON_DRIVER_FLAG_MODULE) ||
-	    con_is_graphics(con->con, con->first, con->last))
+ 	if (!con->con || !(con->flag & CON_DRIVER_FLAG_MODULE))
 		goto err;
 
 	csw = con->con;
@@ -3338,8 +3321,7 @@ static int vt_unbind(struct con_driver *con)
 	int i, more = 1, first = -1, last = -1, deflt = 0;
 	int ret;
 
- 	if (!con->con || !(con->flag & CON_DRIVER_FLAG_MODULE) ||
-	    con_is_graphics(con->con, con->first, con->last))
+ 	if (!con->con || !(con->flag & CON_DRIVER_FLAG_MODULE))
 		goto err;
 
 	csw = con->con;
-- 
2.1.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] vt: Don't check KD_GRAPHICS when binding/unbinding
  2015-04-13  9:16 ` Daniel Vetter
  (?)
@ 2015-04-13 13:33 ` shuang.he
  -1 siblings, 0 replies; 5+ messages in thread
From: shuang.he @ 2015-04-13 13:33 UTC (permalink / raw)
  To: shuang.he, ethan.gao, intel-gfx, daniel.vetter

Tested-By: Intel Graphics QA PRTS (Patch Regression Test System Contact: shuang.he@intel.com)
Task id: 6185
-------------------------------------Summary-------------------------------------
Platform          Delta          drm-intel-nightly          Series Applied
PNV                 -4              276/276              272/276
ILK                                  301/301              301/301
SNB                 -21              316/316              295/316
IVB                 -1              328/328              327/328
BYT                                  285/285              285/285
HSW                                  394/394              394/394
BDW                                  321/321              321/321
-------------------------------------Detailed-------------------------------------
Platform  Test                                drm-intel-nightly          Series Applied
 PNV  igt@gen3_render_linear_blits      FAIL(4)PASS(6)      FAIL(2)
 PNV  igt@gen3_render_mixed_blits      FAIL(5)PASS(5)      FAIL(1)PASS(1)
 PNV  igt@gen3_render_tiledx_blits      FAIL(5)PASS(6)      FAIL(1)PASS(1)
 PNV  igt@gen3_render_tiledy_blits      FAIL(4)PASS(6)      FAIL(1)PASS(1)
 SNB  igt@kms_flip@modeset-vs-vblank-race      DMESG_WARN(1)PASS(5)      DMESG_WARN(1)PASS(1)
(dmesg patch applied)drm:intel_dp_start_link_train[i915]]*ERROR*too_many_voltage_retries,give_up@too many voltage .* give up
drm:intel_dp_complete_link_train[i915]]*ERROR*failed_to_train_DP,aborting@failed to train .* aborting
drm:intel_dp_start_link_train[i915]]*ERROR*failed_to_enable_link_training@failed to enable link training
drm:intel_dp_complete_link_train[i915]]*ERROR*failed_to_start_channel_equalization@failed to start channel equalization
 SNB  igt@kms_mmio_vs_cs_flip@setcrtc_vs_cs_flip      NSPT(1)PASS(1)      NSPT(2)
 SNB  igt@kms_mmio_vs_cs_flip@setplane_vs_cs_flip      NSPT(1)PASS(1)      NSPT(2)
 SNB  igt@kms_rotation_crc@primary-rotation      NSPT(1)PASS(1)      NSPT(2)
 SNB  igt@kms_rotation_crc@sprite-rotation      NSPT(1)PASS(3)      NSPT(2)
 SNB  igt@pm_rpm@cursor      NSPT(1)PASS(1)      NSPT(2)
 SNB  igt@pm_rpm@cursor-dpms      NSPT(1)PASS(1)      NSPT(2)
 SNB  igt@pm_rpm@dpms-mode-unset-non-lpsp      NSPT(1)PASS(1)      NSPT(2)
 SNB  igt@pm_rpm@dpms-non-lpsp      NSPT(1)PASS(1)      NSPT(2)
 SNB  igt@pm_rpm@drm-resources-equal      NSPT(1)PASS(1)      NSPT(2)
 SNB  igt@pm_rpm@fences      NSPT(1)PASS(1)      NSPT(2)
 SNB  igt@pm_rpm@fences-dpms      NSPT(1)PASS(1)      NSPT(2)
 SNB  igt@pm_rpm@gem-execbuf      NSPT(1)PASS(1)      NSPT(2)
 SNB  igt@pm_rpm@gem-mmap-cpu      NSPT(1)PASS(1)      NSPT(2)
 SNB  igt@pm_rpm@gem-mmap-gtt      NSPT(1)PASS(1)      NSPT(2)
 SNB  igt@pm_rpm@gem-pread      NSPT(1)PASS(1)      NSPT(2)
 SNB  igt@pm_rpm@i2c      NSPT(1)PASS(1)      NSPT(2)
 SNB  igt@pm_rpm@modeset-non-lpsp      NSPT(1)PASS(1)      NSPT(2)
 SNB  igt@pm_rpm@modeset-non-lpsp-stress-no-wait      NSPT(1)PASS(1)      NSPT(2)
 SNB  igt@pm_rpm@pci-d3-state      NSPT(1)PASS(1)      NSPT(2)
 SNB  igt@pm_rpm@rte      NSPT(1)PASS(1)      NSPT(2)
 IVB  igt@gem_pwrite_pread@uncached-copy-performance      DMESG_WARN(1)PASS(6)      DMESG_WARN(2)
(dmesg patch applied)drm:i915_hangcheck_elapsed[i915]]*ERROR*Hangcheck_timer_elapsed...blitter_ring_idle@Hangcheck timer elapsed... blitter ring idle
Note: You need to pay more attention to line start with '*'
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] vt: Don't check KD_GRAPHICS when binding/unbinding
  2015-04-13  9:16 ` Daniel Vetter
@ 2015-04-17 11:11   ` David Herrmann
  -1 siblings, 0 replies; 5+ messages in thread
From: David Herrmann @ 2015-04-17 11:11 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: DRI Development, LKML, Intel Graphics Development,
	Greg Kroah-Hartman, Antonino A. Daplas, Peter Hurley, Imre Deak,
	Daniel Vetter

Hi

On Mon, Apr 13, 2015 at 11:16 AM, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> This was introduced in
>
> commit 6db4063c5b72b46e9793b0f141a7a3984ac6facf
> Author: Antonino A. Daplas <adaplas@gmail.com>
> Date:   Mon Jun 26 00:27:12 2006 -0700
>
>     [PATCH] VT binding: Add sysfs control to the VT layer
>
> with the justification
>
>     "In addition, if any of the consoles are in KD_GRAPHICS mode, binding and
>     unbinding will not succeed.  KD_GRAPHICS mode usually indicates that the
>     underlying console hardware is used for other purposes other than displaying
>     text (ie X).  This feature should prevent binding/unbinding from interfering
>     with a graphics application using the VT."
>
> I think we should lift this artificial restriction though:
> - KD_GRAPHICS doesn't get cleaned up automatically, which means it's
>   easy to have terminals stuck in KD_GRAPHICS when hacking around on
>   X.
> - X doesn't really care, especially with drm where kms already blocks
>   fbdev (and hence fbcon) when there's an active compositor.
> - This is a root-only interface with a separate .config option and
>   it's possible to hang your machine already anyway if you
>   unload/reload drivers and don't know what you're doing.

I think it tries to prevent vgacon (or other _hw_ consoles) from being
loaded. However, this was only interesting for UMS drivers, which used
this to prevent the kernel from messing with them. But nowadays we
have kernel drivers which control hand-over and hardware ownership, so
I cannot see why this protection is still needed:

Acked-by: David Herrmann <dh.herrmann@gmail.com>

Thanks
David

> With this patch i915.ko module reloading works again reliably,
> something in the recent fedora upgrades broke things.
>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Antonino A. Daplas <adaplas@gmail.com>
> Cc: David Herrmann <dh.herrmann@gmail.com>
> Cc: Peter Hurley <peter@hurleysoftware.com>
> Cc: Imre Deak <imre.deak@intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  drivers/tty/vt/vt.c | 22 ++--------------------
>  1 file changed, 2 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
> index 6e00572cbeb9..b84f7d80c8b4 100644
> --- a/drivers/tty/vt/vt.c
> +++ b/drivers/tty/vt/vt.c
> @@ -3185,22 +3185,6 @@ err:
>
>
>  #ifdef CONFIG_VT_HW_CONSOLE_BINDING
> -static int con_is_graphics(const struct consw *csw, int first, int last)
> -{
> -       int i, retval = 0;
> -
> -       for (i = first; i <= last; i++) {
> -               struct vc_data *vc = vc_cons[i].d;
> -
> -               if (vc && vc->vc_mode == KD_GRAPHICS) {
> -                       retval = 1;
> -                       break;
> -               }
> -       }
> -
> -       return retval;
> -}
> -
>  /* unlocked version of unbind_con_driver() */
>  int do_unbind_con_driver(const struct consw *csw, int first, int last, int deflt)
>  {
> @@ -3286,8 +3270,7 @@ static int vt_bind(struct con_driver *con)
>         const struct consw *defcsw = NULL, *csw = NULL;
>         int i, more = 1, first = -1, last = -1, deflt = 0;
>
> -       if (!con->con || !(con->flag & CON_DRIVER_FLAG_MODULE) ||
> -           con_is_graphics(con->con, con->first, con->last))
> +       if (!con->con || !(con->flag & CON_DRIVER_FLAG_MODULE))
>                 goto err;
>
>         csw = con->con;
> @@ -3338,8 +3321,7 @@ static int vt_unbind(struct con_driver *con)
>         int i, more = 1, first = -1, last = -1, deflt = 0;
>         int ret;
>
> -       if (!con->con || !(con->flag & CON_DRIVER_FLAG_MODULE) ||
> -           con_is_graphics(con->con, con->first, con->last))
> +       if (!con->con || !(con->flag & CON_DRIVER_FLAG_MODULE))
>                 goto err;
>
>         csw = con->con;
> --
> 2.1.0
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] vt: Don't check KD_GRAPHICS when binding/unbinding
@ 2015-04-17 11:11   ` David Herrmann
  0 siblings, 0 replies; 5+ messages in thread
From: David Herrmann @ 2015-04-17 11:11 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: Peter Hurley, Greg Kroah-Hartman, Intel Graphics Development,
	LKML, DRI Development, Daniel Vetter

Hi

On Mon, Apr 13, 2015 at 11:16 AM, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> This was introduced in
>
> commit 6db4063c5b72b46e9793b0f141a7a3984ac6facf
> Author: Antonino A. Daplas <adaplas@gmail.com>
> Date:   Mon Jun 26 00:27:12 2006 -0700
>
>     [PATCH] VT binding: Add sysfs control to the VT layer
>
> with the justification
>
>     "In addition, if any of the consoles are in KD_GRAPHICS mode, binding and
>     unbinding will not succeed.  KD_GRAPHICS mode usually indicates that the
>     underlying console hardware is used for other purposes other than displaying
>     text (ie X).  This feature should prevent binding/unbinding from interfering
>     with a graphics application using the VT."
>
> I think we should lift this artificial restriction though:
> - KD_GRAPHICS doesn't get cleaned up automatically, which means it's
>   easy to have terminals stuck in KD_GRAPHICS when hacking around on
>   X.
> - X doesn't really care, especially with drm where kms already blocks
>   fbdev (and hence fbcon) when there's an active compositor.
> - This is a root-only interface with a separate .config option and
>   it's possible to hang your machine already anyway if you
>   unload/reload drivers and don't know what you're doing.

I think it tries to prevent vgacon (or other _hw_ consoles) from being
loaded. However, this was only interesting for UMS drivers, which used
this to prevent the kernel from messing with them. But nowadays we
have kernel drivers which control hand-over and hardware ownership, so
I cannot see why this protection is still needed:

Acked-by: David Herrmann <dh.herrmann@gmail.com>

Thanks
David

> With this patch i915.ko module reloading works again reliably,
> something in the recent fedora upgrades broke things.
>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Antonino A. Daplas <adaplas@gmail.com>
> Cc: David Herrmann <dh.herrmann@gmail.com>
> Cc: Peter Hurley <peter@hurleysoftware.com>
> Cc: Imre Deak <imre.deak@intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  drivers/tty/vt/vt.c | 22 ++--------------------
>  1 file changed, 2 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
> index 6e00572cbeb9..b84f7d80c8b4 100644
> --- a/drivers/tty/vt/vt.c
> +++ b/drivers/tty/vt/vt.c
> @@ -3185,22 +3185,6 @@ err:
>
>
>  #ifdef CONFIG_VT_HW_CONSOLE_BINDING
> -static int con_is_graphics(const struct consw *csw, int first, int last)
> -{
> -       int i, retval = 0;
> -
> -       for (i = first; i <= last; i++) {
> -               struct vc_data *vc = vc_cons[i].d;
> -
> -               if (vc && vc->vc_mode == KD_GRAPHICS) {
> -                       retval = 1;
> -                       break;
> -               }
> -       }
> -
> -       return retval;
> -}
> -
>  /* unlocked version of unbind_con_driver() */
>  int do_unbind_con_driver(const struct consw *csw, int first, int last, int deflt)
>  {
> @@ -3286,8 +3270,7 @@ static int vt_bind(struct con_driver *con)
>         const struct consw *defcsw = NULL, *csw = NULL;
>         int i, more = 1, first = -1, last = -1, deflt = 0;
>
> -       if (!con->con || !(con->flag & CON_DRIVER_FLAG_MODULE) ||
> -           con_is_graphics(con->con, con->first, con->last))
> +       if (!con->con || !(con->flag & CON_DRIVER_FLAG_MODULE))
>                 goto err;
>
>         csw = con->con;
> @@ -3338,8 +3321,7 @@ static int vt_unbind(struct con_driver *con)
>         int i, more = 1, first = -1, last = -1, deflt = 0;
>         int ret;
>
> -       if (!con->con || !(con->flag & CON_DRIVER_FLAG_MODULE) ||
> -           con_is_graphics(con->con, con->first, con->last))
> +       if (!con->con || !(con->flag & CON_DRIVER_FLAG_MODULE))
>                 goto err;
>
>         csw = con->con;
> --
> 2.1.0
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-04-17 11:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-13  9:16 [PATCH] vt: Don't check KD_GRAPHICS when binding/unbinding Daniel Vetter
2015-04-13  9:16 ` Daniel Vetter
2015-04-13 13:33 ` shuang.he
2015-04-17 11:11 ` David Herrmann
2015-04-17 11:11   ` David Herrmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.