All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: intel-gfx@lists.freedesktop.org
Cc: peter.hutterer@redhat.com
Subject: [PATCH 1/2] intel_device: Don't close the fd on probe failure if it is server managed
Date: Tue, 18 Mar 2014 15:16:30 +0100	[thread overview]
Message-ID: <1395152191-19258-1-git-send-email-hdegoede@redhat.com> (raw)

I hit this corner case when testing a single X server spanning both intel
gfx + an usb display link adapter driven by xf86-video-modesetting.

In this scenario the intel driver gets its platformProbe method called first,
and if it then closes the server managed fd, the xf86-video-modesetting gets
EBADFD errors.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 src/intel_device.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/intel_device.c b/src/intel_device.c
index c0e1582..2d31ec8 100644
--- a/src/intel_device.c
+++ b/src/intel_device.c
@@ -339,7 +339,8 @@ int intel_open_device(int entity_num,
 	return fd;
 
 err_close:
-	close(fd);
+	if (master_count == 0) /* Don't close server-fds */
+		close(fd);
 err_path:
 	free(local_path);
 	return -1;
-- 
1.9.0

             reply	other threads:[~2014-03-18 14:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-18 14:16 Hans de Goede [this message]
2014-03-18 14:16 ` [PATCH 2/2] uxa: Add support for server managed fds Hans de Goede
2014-03-18 15:16   ` Chris Wilson
2014-03-18 16:54     ` Chris Wilson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1395152191-19258-1-git-send-email-hdegoede@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=peter.hutterer@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.