Print this page
8634 epoll fails to wake on certain edge-triggered conditions
8635 epoll should not emit POLLNVAL
8636 recursive epoll should emit EPOLLRDNORM
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Igor Kozhukhov <igor@dilos.org>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/1394/targets/av1394/av1394_async.c
          +++ new/usr/src/uts/common/io/1394/targets/av1394/av1394_async.c
↓ open down ↓ 17 lines elided ↑ open up ↑
  18   18   * information: Portions Copyright [yyyy] [name of copyright owner]
  19   19   *
  20   20   * CDDL HEADER END
  21   21   */
  22   22  /*
  23   23   * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
  25   25   */
  26   26  
  27   27  /*
  28      - * Copyright (c) 2014, Joyent, Inc. All rights reserved.
       28 + * Copyright 2017 Joyent, Inc.
  29   29   */
  30   30  
  31   31  /*
  32   32   * av1394 asynchronous module
  33   33   */
  34   34  #include <sys/stat.h>
  35   35  #include <sys/file.h>
  36   36  #include <sys/ddi.h>
  37   37  #include <sys/sunddi.h>
  38   38  #include <sys/1394/targets/av1394/av1394_impl.h>
↓ open down ↓ 277 lines elided ↑ open up ↑
 316  316                  }
 317  317          }
 318  318  
 319  319          AV1394_TNF_EXIT(av1394_async_write);
 320  320          return (ret);
 321  321  }
 322  322  
 323  323  /*ARGSUSED*/
 324  324  int
 325  325  av1394_async_ioctl(av1394_inst_t *avp, int cmd, intptr_t arg, int mode,
 326      -                int *rvalp)
      326 +    int *rvalp)
 327  327  {
 328  328          int     ret = EINVAL;
 329  329  
 330  330          AV1394_TNF_ENTER(av1394_async_ioctl);
 331  331  
 332  332          switch (cmd) {
 333  333          case IEC61883_ARQ_GET_IBUF_SIZE:
 334  334                  ret = av1394_ioctl_arq_get_ibuf_size(avp, (void *)arg, mode);
 335  335                  break;
 336  336          case IEC61883_ARQ_SET_IBUF_SIZE:
↓ open down ↓ 6 lines elided ↑ open up ↑
 343  343                  ret = av1394_ioctl_node_get_uid(avp, (void *)arg, mode);
 344  344                  break;
 345  345          case IEC61883_NODE_GET_TEXT_LEAF:
 346  346                  ret = av1394_ioctl_node_get_text_leaf(avp, (void *)arg, mode);
 347  347          }
 348  348  
 349  349          AV1394_TNF_EXIT(av1394_async_ioctl);
 350  350          return (ret);
 351  351  }
 352  352  
 353      -/*ARGSUSED*/
 354  353  int
 355  354  av1394_async_poll(av1394_inst_t *avp, short events, int anyyet, short *reventsp,
 356      -                struct pollhead **phpp)
      355 +    struct pollhead **phpp)
 357  356  {
 358  357          av1394_async_t  *ap = &avp->av_a;
 359  358          av1394_queue_t  *rq = &ap->a_rq;
 360  359  
 361  360          AV1394_TNF_ENTER(av1394_async_poll);
 362  361  
 363      -        if (events & POLLIN) {
 364      -                if (av1394_peekq(rq))
      362 +        if (events & (POLLIN | POLLET)) {
      363 +                if ((events & POLLIN) && av1394_peekq(rq)) {
 365  364                          *reventsp |= POLLIN;
      365 +                }
 366  366  
 367  367                  if ((!*reventsp && !anyyet) || (events & POLLET)) {
 368  368                          mutex_enter(&ap->a_mutex);
 369      -                        ap->a_pollevents |= POLLIN;
      369 +                        if (events & POLLIN) {
      370 +                                ap->a_pollevents |= POLLIN;
      371 +                        }
 370  372                          *phpp = &ap->a_pollhead;
 371  373                          mutex_exit(&ap->a_mutex);
 372  374                  }
 373  375          }
 374  376  
 375  377          AV1394_TNF_EXIT(av1394_async_poll);
 376  378          return (0);
 377  379  }
 378  380  
 379  381  
↓ open down ↓ 178 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX