Print this page
5513 KM_NORMALPRI should be documented in kmem_alloc(9f) and kmem_cache_create(9f) man pages
14465 Present KM_NOSLEEP_LAZY as documented interface
Change-Id: I002ec28ddf390650f1fcba1ca94f6abfdb241439


10749         }
10750 
10751         switch (set.aiems_op) {
10752         case AHCI_EM_IOC_SET_OP_ADD:
10753         case AHCI_EM_IOC_SET_OP_REM:
10754         case AHCI_EM_IOC_SET_OP_SET:
10755                 break;
10756         default:
10757                 return (EINVAL);
10758         }
10759 
10760         if ((ahci_ctlp->ahcictl_em_flags & AHCI_EM_PRESENT) == 0) {
10761                 return (ENOTSUP);
10762         }
10763 
10764         if ((set.aiems_leds & AHCI_EM_LED_ACTIVITY_DISABLE) != 0 &&
10765             ((ahci_ctlp->ahcictl_em_ctl & AHCI_HBA_EM_CTL_ATTR_ALHD) != 0)) {
10766                 return (ENOTSUP);
10767         }
10768 
10769         task = kmem_alloc(sizeof (*task), KM_NOSLEEP | KM_NORMALPRI);
10770         if (task == NULL) {
10771                 return (ENOMEM);
10772         }
10773 
10774         task->aelta_ctl = ahci_ctlp;
10775         task->aelta_port = (uint8_t)set.aiems_port;
10776         task->aelta_op = set.aiems_op;
10777         task->aelta_state = set.aiems_leds;
10778 
10779         cv_init(&task->aelta_cv, NULL, CV_DRIVER, NULL);
10780 
10781         /*
10782          * Initialize the reference count to two. One for us and one for the
10783          * taskq. This will be used in case we get canceled.
10784          */
10785         task->aelta_ref = 2;
10786 
10787         /*
10788          * Once dispatched, the task state is protected by our global mutex.
10789          */




10749         }
10750 
10751         switch (set.aiems_op) {
10752         case AHCI_EM_IOC_SET_OP_ADD:
10753         case AHCI_EM_IOC_SET_OP_REM:
10754         case AHCI_EM_IOC_SET_OP_SET:
10755                 break;
10756         default:
10757                 return (EINVAL);
10758         }
10759 
10760         if ((ahci_ctlp->ahcictl_em_flags & AHCI_EM_PRESENT) == 0) {
10761                 return (ENOTSUP);
10762         }
10763 
10764         if ((set.aiems_leds & AHCI_EM_LED_ACTIVITY_DISABLE) != 0 &&
10765             ((ahci_ctlp->ahcictl_em_ctl & AHCI_HBA_EM_CTL_ATTR_ALHD) != 0)) {
10766                 return (ENOTSUP);
10767         }
10768 
10769         task = kmem_alloc(sizeof (*task), KM_NOSLEEP_LAZY);
10770         if (task == NULL) {
10771                 return (ENOMEM);
10772         }
10773 
10774         task->aelta_ctl = ahci_ctlp;
10775         task->aelta_port = (uint8_t)set.aiems_port;
10776         task->aelta_op = set.aiems_op;
10777         task->aelta_state = set.aiems_leds;
10778 
10779         cv_init(&task->aelta_cv, NULL, CV_DRIVER, NULL);
10780 
10781         /*
10782          * Initialize the reference count to two. One for us and one for the
10783          * taskq. This will be used in case we get canceled.
10784          */
10785         task->aelta_ref = 2;
10786 
10787         /*
10788          * Once dispatched, the task state is protected by our global mutex.
10789          */