debian/changelog | 12 ++++ debian/patches/drm_device_keep_trying.patch | 75 ++++++++++++++++++++++++++++ debian/patches/series | 1 3 files changed, 88 insertions(+)
New commits: commit 7e9446f8760566140ba8b9ee3c0421ec41590e67 Author: Bryce Harrington <br...@canonical.com> Date: Wed Mar 6 13:17:16 2013 -0800 Update for release to raring diff --git a/debian/changelog b/debian/changelog index 8b4e430..dd5a23e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,11 @@ -xorg-server (2:1.13.2-0ubuntu3~lp982889~2) raring; urgency=low +xorg-server (2:1.13.2-0ubuntu3) raring; urgency=low * Add drm_device_keep_trying.patch: When kernel reports drm device is not available, don't give up immediately, but keep retrying for a little bit. Fixes boot failures due to a race condition with plymouth or the kernel. Typical symptom is xserver error exit, "Cannot run in - framebuffer mode". + framebuffer mode" and Xorg.0.log messages about "setversion 1.4 + failed". (LP: #982889) -- Bryce Harrington <br...@ubuntu.com> Tue, 19 Feb 2013 07:58:24 -0800 commit 034f6dc742b0115ac5efdcb98aeb03b094fcaf72 Author: Bryce Harrington <br...@canonical.com> Date: Tue Mar 5 14:36:52 2013 -0800 Provide clearer error messages to differentiate EACCES vs. EAGAIN diff --git a/debian/changelog b/debian/changelog index 27183f3..8b4e430 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,10 @@ -xorg-server (2:1.13.2-0ubuntu3~lp982889~1) raring; urgency=low +xorg-server (2:1.13.2-0ubuntu3~lp982889~2) raring; urgency=low - * Add drm_device_keep_trying.patch: When kernel reports drm device is not available, - don't give up immediately, but keep retrying for a little bit. Fixes boot failures - due to a race condition with plymouth or the kernel. Typical symptom is xserver error - exit, "Cannot run in framebuffer mode". + * Add drm_device_keep_trying.patch: When kernel reports drm device is + not available, don't give up immediately, but keep retrying for a + little bit. Fixes boot failures due to a race condition with plymouth + or the kernel. Typical symptom is xserver error exit, "Cannot run in + framebuffer mode". (LP: #982889) -- Bryce Harrington <br...@ubuntu.com> Tue, 19 Feb 2013 07:58:24 -0800 diff --git a/debian/patches/drm_device_keep_trying.patch b/debian/patches/drm_device_keep_trying.patch index d7a6f9c..13b5f5d 100644 --- a/debian/patches/drm_device_keep_trying.patch +++ b/debian/patches/drm_device_keep_trying.patch @@ -1,34 +1,47 @@ -From d650ecb5e638cf5d9e8d6b789412cb1fb5225a73 Mon Sep 17 00:00:00 2001 +From fe5802680b5ecf5ecef55b839f2f555882207d41 Mon Sep 17 00:00:00 2001 From: Bryce Harrington <br...@canonical.com> Date: Wed, 13 Feb 2013 11:39:34 -0800 Subject: [PATCH] If drm device couldn't be opened, keep trying for a sec. -The kernel returns EAGAIN on drm open when the drm device is +The kernel returns EACCES or EAGAIN on drm open when the drm device is currently unavailable, such as if it is in use by another process -(e.g. plymouth), or hasn't finished initializing (e.g. on a really -fast SSD). Check for this error code, and if it's hit then block -until it either resolved or some other error returned (and in which -case, log the appropriate messages to that effect). +(e.g. plymouth), or hasn't finished initializing (e.g. on a really fast +SSD). Check for errors when trying to open the device, and continue +retrying for a short period before giving up. + +Fixes: https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/982889 Signed-off-by: Bryce Harrington <br...@canonical.com> --- - hw/xfree86/os-support/linux/lnx_platform.c | 16 +++++++++++++--- - 1 file changed, 13 insertions(+), 3 deletions(-) + hw/xfree86/os-support/linux/lnx_platform.c | 29 +++++++++++++++++++++++++--- + 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/hw/xfree86/os-support/linux/lnx_platform.c b/hw/xfree86/os-support/linux/lnx_platform.c -index 76f5583..32107a9 100644 +index 76f5583..e26ef25 100644 --- a/hw/xfree86/os-support/linux/lnx_platform.c +++ b/hw/xfree86/os-support/linux/lnx_platform.c -@@ -23,6 +23,8 @@ get_drm_info(struct OdevAttributes *attribs, char *path) +@@ -7,6 +7,7 @@ + #include <xf86drm.h> + #include <fcntl.h> + #include <unistd.h> ++#include <errno.h> + + /* Linux platform device support */ + #include "xf86_OSproc.h" +@@ -23,6 +24,12 @@ get_drm_info(struct OdevAttributes *attribs, char *path) drmSetVersion sv; char *buf; int fd; + int err = 0; -+ int counter = 100000; ++ int drm_wait_total = 2; /* Max seconds we'll wait for drm */ ++ int drm_wait_usleep = 50; /* How frequently we'll re-check */ ++ int drm_wait_max_msgs = 10; /* Max errors we'll print to logs */ ++ int drm_wait_counter = drm_wait_total * 1000000 / drm_wait_usleep; ++ int drm_wait_msg_time = drm_wait_counter / drm_wait_max_msgs; fd = open(path, O_RDWR, O_CLOEXEC); if (fd == -1) -@@ -32,9 +34,17 @@ get_drm_info(struct OdevAttributes *attribs, char *path) +@@ -32,9 +39,25 @@ get_drm_info(struct OdevAttributes *attribs, char *path) sv.drm_di_minor = 4; sv.drm_dd_major = -1; /* Don't care */ sv.drm_dd_minor = -1; /* Don't care */ @@ -36,12 +49,20 @@ index 76f5583..32107a9 100644 - ErrorF("setversion 1.4 failed\n"); - return FALSE; + err = drmSetInterfaceVersion(fd, &sv); -+ while (err!=0 && counter>0) { -+ /* TODO: Check if it's returning EAGAIN, and only loop on that */ -+ ErrorF("drm device not ready (%d), sleeping for 20us\n", err); -+ usleep(20); ++ while (err && drm_wait_counter--) { ++ if (drm_wait_counter % drm_wait_msg_time == 0) { ++ if (err == -EACCES) { ++ ErrorF("drm device access denied\n"); ++ } else if (err == -EAGAIN) { ++ LogMessage(X_INFO, "get_drm_info: waiting on drm device\n"); ++ } else { ++ ErrorF("drm device not ready (%d)\n", err); ++ } ++ } ++ usleep(drm_wait_usleep); + err = drmSetInterfaceVersion(fd, &sv); -+ counter--; ++ if (!err) ++ ErrorF("drm setversion 1.4 succeeded after wait\n"); + } + if (err) { + ErrorF("setversion 1.4 failed\n"); commit 254e19de7439ccc30e9036f722dd62335e0e30ad Author: Bryce Harrington <br...@canonical.com> Date: Wed Feb 20 02:43:47 2013 -0800 Add drm_device_keep_trying.patch diff --git a/debian/changelog b/debian/changelog index d214cb0..27183f3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +xorg-server (2:1.13.2-0ubuntu3~lp982889~1) raring; urgency=low + + * Add drm_device_keep_trying.patch: When kernel reports drm device is not available, + don't give up immediately, but keep retrying for a little bit. Fixes boot failures + due to a race condition with plymouth or the kernel. Typical symptom is xserver error + exit, "Cannot run in framebuffer mode". + (LP: #982889) + + -- Bryce Harrington <br...@ubuntu.com> Tue, 19 Feb 2013 07:58:24 -0800 + xorg-server (2:1.13.2-0ubuntu2) raring; urgency=low * Restore selinux support now that audit has been promoted to main. diff --git a/debian/patches/drm_device_keep_trying.patch b/debian/patches/drm_device_keep_trying.patch new file mode 100644 index 0000000..d7a6f9c --- /dev/null +++ b/debian/patches/drm_device_keep_trying.patch @@ -0,0 +1,54 @@ +From d650ecb5e638cf5d9e8d6b789412cb1fb5225a73 Mon Sep 17 00:00:00 2001 +From: Bryce Harrington <br...@canonical.com> +Date: Wed, 13 Feb 2013 11:39:34 -0800 +Subject: [PATCH] If drm device couldn't be opened, keep trying for a sec. + +The kernel returns EAGAIN on drm open when the drm device is +currently unavailable, such as if it is in use by another process +(e.g. plymouth), or hasn't finished initializing (e.g. on a really +fast SSD). Check for this error code, and if it's hit then block +until it either resolved or some other error returned (and in which +case, log the appropriate messages to that effect). + +Signed-off-by: Bryce Harrington <br...@canonical.com> +--- + hw/xfree86/os-support/linux/lnx_platform.c | 16 +++++++++++++--- + 1 file changed, 13 insertions(+), 3 deletions(-) + +diff --git a/hw/xfree86/os-support/linux/lnx_platform.c b/hw/xfree86/os-support/linux/lnx_platform.c +index 76f5583..32107a9 100644 +--- a/hw/xfree86/os-support/linux/lnx_platform.c ++++ b/hw/xfree86/os-support/linux/lnx_platform.c +@@ -23,6 +23,8 @@ get_drm_info(struct OdevAttributes *attribs, char *path) + drmSetVersion sv; + char *buf; + int fd; ++ int err = 0; ++ int counter = 100000; + + fd = open(path, O_RDWR, O_CLOEXEC); + if (fd == -1) +@@ -32,9 +34,17 @@ get_drm_info(struct OdevAttributes *attribs, char *path) + sv.drm_di_minor = 4; + sv.drm_dd_major = -1; /* Don't care */ + sv.drm_dd_minor = -1; /* Don't care */ +- if (drmSetInterfaceVersion(fd, &sv)) { +- ErrorF("setversion 1.4 failed\n"); +- return FALSE; ++ err = drmSetInterfaceVersion(fd, &sv); ++ while (err!=0 && counter>0) { ++ /* TODO: Check if it's returning EAGAIN, and only loop on that */ ++ ErrorF("drm device not ready (%d), sleeping for 20us\n", err); ++ usleep(20); ++ err = drmSetInterfaceVersion(fd, &sv); ++ counter--; ++ } ++ if (err) { ++ ErrorF("setversion 1.4 failed\n"); ++ return FALSE; + } + + xf86_add_platform_device(attribs); +-- +1.7.9.5 + diff --git a/debian/patches/series b/debian/patches/series index 3aff1b9..97273f7 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -28,6 +28,7 @@ 232-xf86compatoutput-valgrind.patch 233-xf86events-valgrind.patch 236-use-fbdev-for-poulsbo-oaktrail-medfield.patch +drm_device_keep_trying.patch ## waiting for review by upstream 111_armel-drv-fallbacks.patch -- To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/e1udlik-0000gn...@vasks.debian.org