Merge branch 'drm-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
[firefly-linux-kernel-4.4.55.git] / drivers / char / istallion.c
index 5e9a81d8ebcfcd74ea5191e48c84b5e5d6a145da..be28391adb79b7de338594ad0a9cd5d865de5fdf 100644 (file)
@@ -954,7 +954,7 @@ static int stli_rawopen(struct stlibrd *brdp, struct stliport *portp, unsigned l
  *     order of opens and closes may not be preserved across shared
  *     memory, so we must wait until it is complete.
  */
-       wait_event_interruptible(portp->raw_wait,
+       wait_event_interruptible_tty(portp->raw_wait,
                        !test_bit(ST_CLOSING, &portp->state));
        if (signal_pending(current)) {
                return -ERESTARTSYS;
@@ -989,7 +989,7 @@ static int stli_rawopen(struct stlibrd *brdp, struct stliport *portp, unsigned l
        set_bit(ST_OPENING, &portp->state);
        spin_unlock_irqrestore(&brd_lock, flags);
 
-       wait_event_interruptible(portp->raw_wait,
+       wait_event_interruptible_tty(portp->raw_wait,
                        !test_bit(ST_OPENING, &portp->state));
        if (signal_pending(current))
                rc = -ERESTARTSYS;
@@ -1020,7 +1020,7 @@ static int stli_rawclose(struct stlibrd *brdp, struct stliport *portp, unsigned
  *     occurs on this port.
  */
        if (wait) {
-               wait_event_interruptible(portp->raw_wait,
+               wait_event_interruptible_tty(portp->raw_wait,
                                !test_bit(ST_CLOSING, &portp->state));
                if (signal_pending(current)) {
                        return -ERESTARTSYS;
@@ -1052,7 +1052,7 @@ static int stli_rawclose(struct stlibrd *brdp, struct stliport *portp, unsigned
  *     to come back.
  */
        rc = 0;
-       wait_event_interruptible(portp->raw_wait,
+       wait_event_interruptible_tty(portp->raw_wait,
                        !test_bit(ST_CLOSING, &portp->state));
        if (signal_pending(current))
                rc = -ERESTARTSYS;
@@ -1073,6 +1073,10 @@ static int stli_rawclose(struct stlibrd *brdp, struct stliport *portp, unsigned
 
 static int stli_cmdwait(struct stlibrd *brdp, struct stliport *portp, unsigned long cmd, void *arg, int size, int copyback)
 {
+       /*
+        * no need for wait_event_tty because clearing ST_CMDING cannot block
+        * on BTM
+        */
        wait_event_interruptible(portp->raw_wait,
                        !test_bit(ST_CMDING, &portp->state));
        if (signal_pending(current))