Loading drivers/usb/gadget/function/f_gsi.c +7 −22 Original line number Diff line number Diff line Loading @@ -1086,9 +1086,9 @@ static ssize_t gsi_ctrl_dev_write(struct file *fp, const char __user *buf, list_add_tail(&cpkt->list, &c_port->cpkt_resp_q); spin_unlock_irqrestore(&c_port->lock, flags); ret = gsi_ctrl_send_notification(gsi); if (!gsi_ctrl_send_notification(gsi)) c_port->modem_to_host++; log_event_dbg("Exit %zu", count); return ret ? ret : count; Loading Loading @@ -1392,33 +1392,18 @@ static int queue_notification_request(struct f_gsi *gsi) { int ret; unsigned long flags; struct usb_cdc_notification *event; struct gsi_ctrl_pkt *cpkt; ret = usb_func_ep_queue(&gsi->function, gsi->c_port.notify, gsi->c_port.notify_req, GFP_ATOMIC); if (ret == -ENOTSUPP || (ret < 0 && ret != -EAGAIN)) { if (ret < 0) { spin_lock_irqsave(&gsi->c_port.lock, flags); gsi->c_port.notify_req_queued = false; /* check if device disconnected while we dropped lock */ if (atomic_read(&gsi->connected) && !list_empty(&gsi->c_port.cpkt_resp_q)) { cpkt = list_first_entry(&gsi->c_port.cpkt_resp_q, struct gsi_ctrl_pkt, list); list_del(&cpkt->list); log_event_err("%s: drop ctrl pkt of len %d error %d", __func__, cpkt->len, ret); gsi_ctrl_pkt_free(cpkt); } gsi->c_port.cpkt_drop_cnt++; spin_unlock_irqrestore(&gsi->c_port.lock, flags); } else { ret = 0; event = gsi->c_port.notify_req->buf; log_event_dbg("%s: Queued Notify type %02x", __func__, event->bNotificationType); } log_event_dbg("%s: ret:%d req_queued:%d", __func__, ret, gsi->c_port.notify_req_queued); return ret; } Loading Loading @@ -3132,7 +3117,7 @@ MODULE_DESCRIPTION("GSI function driver"); static int fgsi_init(void) { ipa_usb_wq = alloc_workqueue("k_ipa_usb", WQ_UNBOUND | WQ_MEM_RECLAIM, 1); WQ_UNBOUND | WQ_MEM_RECLAIM | WQ_FREEZABLE, 1); if (!ipa_usb_wq) { log_event_err("Failed to create workqueue for IPA"); return -ENOMEM; Loading Loading
drivers/usb/gadget/function/f_gsi.c +7 −22 Original line number Diff line number Diff line Loading @@ -1086,9 +1086,9 @@ static ssize_t gsi_ctrl_dev_write(struct file *fp, const char __user *buf, list_add_tail(&cpkt->list, &c_port->cpkt_resp_q); spin_unlock_irqrestore(&c_port->lock, flags); ret = gsi_ctrl_send_notification(gsi); if (!gsi_ctrl_send_notification(gsi)) c_port->modem_to_host++; log_event_dbg("Exit %zu", count); return ret ? ret : count; Loading Loading @@ -1392,33 +1392,18 @@ static int queue_notification_request(struct f_gsi *gsi) { int ret; unsigned long flags; struct usb_cdc_notification *event; struct gsi_ctrl_pkt *cpkt; ret = usb_func_ep_queue(&gsi->function, gsi->c_port.notify, gsi->c_port.notify_req, GFP_ATOMIC); if (ret == -ENOTSUPP || (ret < 0 && ret != -EAGAIN)) { if (ret < 0) { spin_lock_irqsave(&gsi->c_port.lock, flags); gsi->c_port.notify_req_queued = false; /* check if device disconnected while we dropped lock */ if (atomic_read(&gsi->connected) && !list_empty(&gsi->c_port.cpkt_resp_q)) { cpkt = list_first_entry(&gsi->c_port.cpkt_resp_q, struct gsi_ctrl_pkt, list); list_del(&cpkt->list); log_event_err("%s: drop ctrl pkt of len %d error %d", __func__, cpkt->len, ret); gsi_ctrl_pkt_free(cpkt); } gsi->c_port.cpkt_drop_cnt++; spin_unlock_irqrestore(&gsi->c_port.lock, flags); } else { ret = 0; event = gsi->c_port.notify_req->buf; log_event_dbg("%s: Queued Notify type %02x", __func__, event->bNotificationType); } log_event_dbg("%s: ret:%d req_queued:%d", __func__, ret, gsi->c_port.notify_req_queued); return ret; } Loading Loading @@ -3132,7 +3117,7 @@ MODULE_DESCRIPTION("GSI function driver"); static int fgsi_init(void) { ipa_usb_wq = alloc_workqueue("k_ipa_usb", WQ_UNBOUND | WQ_MEM_RECLAIM, 1); WQ_UNBOUND | WQ_MEM_RECLAIM | WQ_FREEZABLE, 1); if (!ipa_usb_wq) { log_event_err("Failed to create workqueue for IPA"); return -ENOMEM; Loading