forked from xuos/xiuos
Fixed a bug in using usb_osal_mq_recv
This commit is contained in:
parent
137247d918
commit
ab8ba67a83
|
@ -689,11 +689,12 @@ static void usbh_hub_thread(void *argument)
|
|||
int ret = 0;
|
||||
struct usbh_bus *usb = (struct usbh_bus *)argument;
|
||||
|
||||
USB_LOG_DBG("usbh_hub_thread usb pointer=%08x\r\n", usb);
|
||||
usb_hc_init(usb->id);
|
||||
while (1) {
|
||||
USB_LOG_DBG("wait event of mq@%p \r\n", usb->hub_mq);
|
||||
ret = usb_osal_mq_recv(usb->hub_mq, (void *)&hub, 0xffffffff);
|
||||
if (ret < 0) {
|
||||
ret = usb_osal_mq_recv(usb->hub_mq, (void *)&hub, 0x7fffffff);
|
||||
if (ret <= 0) {
|
||||
continue;
|
||||
}
|
||||
USB_LOG_DBG("handle event of hub@%p \r\n", hub);
|
||||
|
@ -763,6 +764,7 @@ int usbh_hub_initialize(struct usbh_bus *usb)
|
|||
return -1;
|
||||
}
|
||||
|
||||
USB_LOG_DBG("usbh_hub_initialize usb pointer=%08x\r\n", usb);
|
||||
char thread_name[12];
|
||||
snprintf(thread_name, 12, "usb%d_hub", usb->id);
|
||||
usb->hub_thread = usb_osal_thread_create(thread_name, CONFIG_USBHOST_PSC_STACKSIZE, CONFIG_USBHOST_PSC_PRIO, usbh_hub_thread, usb);
|
||||
|
|
|
@ -99,9 +99,9 @@ static void usb_check_phymode(int id)
|
|||
}
|
||||
|
||||
pipe_phymode = readl ( base_vir + PIPE_PHY_GRF_PIPE_CON0 );
|
||||
USB_LOG_DBG("usbh_initialize PIPE_PHY_GRF_PIPE_CON0=%08X\n", pipe_phymode);
|
||||
USB_LOG_DBG("usb_check_phy PIPE_PHY_GRF_PIPE_CON0=%08X\n", pipe_phymode);
|
||||
if ( (pipe_phymode & 0x000C) != 0x0004) {
|
||||
USB_LOG_ERR("usbh_initialize PIPE_PHY_GRF_PIPE_CON0=%08X is not USB3 mode\n", pipe_phymode);
|
||||
USB_LOG_ERR("usb_check_phy PIPE_PHY_GRF_PIPE_CON0=%08X is not USB3 mode\n", pipe_phymode);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue