瀏覽代碼

fix(port): reset sem when pipe free

Signed-off-by: sakumisu <1203593632@qq.com>
sakumisu 5 月之前
父節點
當前提交
ccd4354960
共有 4 個文件被更改,包括 8 次插入0 次删除
  1. 2 0
      port/dwc2/usb_hc_dwc2.c
  2. 2 0
      port/ehci/usb_hc_ehci.c
  3. 2 0
      port/musb/usb_hc_musb.c
  4. 2 0
      port/rp2040/usb_hc_rp2040.c

+ 2 - 0
port/dwc2/usb_hc_dwc2.c

@@ -484,6 +484,8 @@ static void dwc2_chan_free(struct dwc2_chan *chan)
 {
     size_t flags;
 
+    usb_osal_sem_reset(chan->waitsem);
+
     flags = usb_osal_enter_critical_section();
     if (chan->urb) {
         chan->urb->hcpriv = NULL;

+ 2 - 0
port/ehci/usb_hc_ehci.c

@@ -98,6 +98,8 @@ static void ehci_qh_free(struct usbh_bus *bus, struct ehci_qh_hw *qh)
     struct ehci_qtd_hw *qtd;
     size_t flags;
 
+    usb_osal_sem_reset(qh->waitsem);
+
     flags = usb_osal_enter_critical_section();
     if (qh->urb) {
         qh->urb->hcpriv = NULL;

+ 2 - 0
port/musb/usb_hc_musb.c

@@ -477,6 +477,8 @@ static int musb_pipe_alloc(void)
 
 static void musb_pipe_free(struct musb_pipe *pipe)
 {
+    usb_osal_sem_reset(pipe->waitsem);
+
     if (pipe->urb) {
         pipe->urb->hcpriv = NULL;
         pipe->urb = NULL;

+ 2 - 0
port/rp2040/usb_hc_rp2040.c

@@ -71,6 +71,8 @@ static void rp2040_pipe_free(struct rp2040_pipe *pipe)
 {
     size_t flags;
 
+    usb_osal_sem_reset(pipe->waitsem);
+
     flags = usb_osal_enter_critical_section();
     if (pipe->urb) {
         pipe->urb->hcpriv = NULL;