|
@@ -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
|
|
* order of opens and closes may not be preserved across shared
|
|
* memory, so we must wait until it is complete.
|
|
* 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));
|
|
!test_bit(ST_CLOSING, &portp->state));
|
|
if (signal_pending(current)) {
|
|
if (signal_pending(current)) {
|
|
return -ERESTARTSYS;
|
|
return -ERESTARTSYS;
|
|
@@ -989,7 +989,7 @@ static int stli_rawopen(struct stlibrd *brdp, struct stliport *portp, unsigned l
|
|
set_bit(ST_OPENING, &portp->state);
|
|
set_bit(ST_OPENING, &portp->state);
|
|
spin_unlock_irqrestore(&brd_lock, flags);
|
|
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));
|
|
!test_bit(ST_OPENING, &portp->state));
|
|
if (signal_pending(current))
|
|
if (signal_pending(current))
|
|
rc = -ERESTARTSYS;
|
|
rc = -ERESTARTSYS;
|
|
@@ -1020,7 +1020,7 @@ static int stli_rawclose(struct stlibrd *brdp, struct stliport *portp, unsigned
|
|
* occurs on this port.
|
|
* occurs on this port.
|
|
*/
|
|
*/
|
|
if (wait) {
|
|
if (wait) {
|
|
- wait_event_interruptible(portp->raw_wait,
|
|
|
|
|
|
+ wait_event_interruptible_tty(portp->raw_wait,
|
|
!test_bit(ST_CLOSING, &portp->state));
|
|
!test_bit(ST_CLOSING, &portp->state));
|
|
if (signal_pending(current)) {
|
|
if (signal_pending(current)) {
|
|
return -ERESTARTSYS;
|
|
return -ERESTARTSYS;
|
|
@@ -1052,7 +1052,7 @@ static int stli_rawclose(struct stlibrd *brdp, struct stliport *portp, unsigned
|
|
* to come back.
|
|
* to come back.
|
|
*/
|
|
*/
|
|
rc = 0;
|
|
rc = 0;
|
|
- wait_event_interruptible(portp->raw_wait,
|
|
|
|
|
|
+ wait_event_interruptible_tty(portp->raw_wait,
|
|
!test_bit(ST_CLOSING, &portp->state));
|
|
!test_bit(ST_CLOSING, &portp->state));
|
|
if (signal_pending(current))
|
|
if (signal_pending(current))
|
|
rc = -ERESTARTSYS;
|
|
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)
|
|
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,
|
|
wait_event_interruptible(portp->raw_wait,
|
|
!test_bit(ST_CMDING, &portp->state));
|
|
!test_bit(ST_CMDING, &portp->state));
|
|
if (signal_pending(current))
|
|
if (signal_pending(current))
|