You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "chenzhihong007 (via GitHub)" <gi...@apache.org> on 2023/07/18 06:47:34 UTC

[GitHub] [nuttx] chenzhihong007 opened a new pull request, #9852: drivers: usbhost_hub: usb communication memory should use DRVR_ALLOC

chenzhihong007 opened a new pull request, #9852:
URL: https://github.com/apache/nuttx/pull/9852

   # usbhost_hub: usb communication memory should use DRVR_ALLOC
   
   ## Summary
   DRVR_CTRLIN buffer must have been allocated using DRVR_ALLOC.  For example, some mcu memory should align cache line.
   
   ## Impact
   only usb host hub.
   
   ## Testing
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] acassis commented on pull request #9852: drivers: usbhost_hub: usb communication memory should use DRVR_ALLOC

Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on PR #9852:
URL: https://github.com/apache/nuttx/pull/9852#issuecomment-1640155858

   MacOS is breaking again


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] xiaoxiang781216 merged pull request #9852: drivers: usbhost_hub: usb communication memory should use DRVR_ALLOC

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 merged PR #9852:
URL: https://github.com/apache/nuttx/pull/9852


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] chenzhihong007 commented on a diff in pull request #9852: drivers: usbhost_hub: usb communication memory should use DRVR_ALLOC

Posted by "chenzhihong007 (via GitHub)" <gi...@apache.org>.
chenzhihong007 commented on code in PR #9852:
URL: https://github.com/apache/nuttx/pull/9852#discussion_r1267490408


##########
drivers/usbhost/usbhost_hub.c:
##########
@@ -538,42 +539,51 @@ static inline int usbhost_hubdesc(FAR struct usbhost_class_s *hubclass)
   usbhost_putle16(ctrlreq->index, 0);
   usbhost_putle16(ctrlreq->len, USB_SIZEOF_HUBDESC);
 
+  ret = DRVR_ALLOC(hport->drvr, (FAR uint8_t **)&hubdesc, &maxlen);
+  if (ret < 0)
+    {
+      uerr("ERROR: DRVR_ALLOC failed: %d\n", ret);
+      return ret;
+    }
+
   ret = DRVR_CTRLIN(hport->drvr, hport->ep0,
-                    ctrlreq, (FAR uint8_t *)&hubdesc);
+                    ctrlreq, (FAR uint8_t *)hubdesc);
   if (ret < 0)
     {
       uerr("ERROR: Failed to read hub descriptor: %d\n", ret);

Review Comment:
   > but you return at 554
   
   Exactly, I add hubdesc free if DRVR_CTRLIN failed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #9852: drivers: usbhost_hub: usb communication memory should use DRVR_ALLOC

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #9852:
URL: https://github.com/apache/nuttx/pull/9852#discussion_r1266977390


##########
drivers/usbhost/usbhost_hub.c:
##########
@@ -538,42 +539,51 @@ static inline int usbhost_hubdesc(FAR struct usbhost_class_s *hubclass)
   usbhost_putle16(ctrlreq->index, 0);
   usbhost_putle16(ctrlreq->len, USB_SIZEOF_HUBDESC);
 
+  ret = DRVR_ALLOC(hport->drvr, (FAR uint8_t **)&hubdesc, &maxlen);
+  if (ret < 0)
+    {
+      uerr("ERROR: DRVR_ALLOC failed: %d\n", ret);
+      return ret;
+    }
+
   ret = DRVR_CTRLIN(hport->drvr, hport->ep0,
-                    ctrlreq, (FAR uint8_t *)&hubdesc);
+                    ctrlreq, (FAR uint8_t *)hubdesc);
   if (ret < 0)
     {
       uerr("ERROR: Failed to read hub descriptor: %d\n", ret);

Review Comment:
   free memory



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #9852: drivers: usbhost_hub: usb communication memory should use DRVR_ALLOC

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #9852:
URL: https://github.com/apache/nuttx/pull/9852#discussion_r1267448817


##########
drivers/usbhost/usbhost_hub.c:
##########
@@ -538,42 +539,51 @@ static inline int usbhost_hubdesc(FAR struct usbhost_class_s *hubclass)
   usbhost_putle16(ctrlreq->index, 0);
   usbhost_putle16(ctrlreq->len, USB_SIZEOF_HUBDESC);
 
+  ret = DRVR_ALLOC(hport->drvr, (FAR uint8_t **)&hubdesc, &maxlen);
+  if (ret < 0)
+    {
+      uerr("ERROR: DRVR_ALLOC failed: %d\n", ret);
+      return ret;
+    }
+
   ret = DRVR_CTRLIN(hport->drvr, hport->ep0,
-                    ctrlreq, (FAR uint8_t *)&hubdesc);
+                    ctrlreq, (FAR uint8_t *)hubdesc);
   if (ret < 0)
     {
       uerr("ERROR: Failed to read hub descriptor: %d\n", ret);

Review Comment:
   but you return at 554



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] chenzhihong007 commented on a diff in pull request #9852: drivers: usbhost_hub: usb communication memory should use DRVR_ALLOC

Posted by "chenzhihong007 (via GitHub)" <gi...@apache.org>.
chenzhihong007 commented on code in PR #9852:
URL: https://github.com/apache/nuttx/pull/9852#discussion_r1267436628


##########
drivers/usbhost/usbhost_hub.c:
##########
@@ -538,42 +539,51 @@ static inline int usbhost_hubdesc(FAR struct usbhost_class_s *hubclass)
   usbhost_putle16(ctrlreq->index, 0);
   usbhost_putle16(ctrlreq->len, USB_SIZEOF_HUBDESC);
 
+  ret = DRVR_ALLOC(hport->drvr, (FAR uint8_t **)&hubdesc, &maxlen);
+  if (ret < 0)
+    {
+      uerr("ERROR: DRVR_ALLOC failed: %d\n", ret);
+      return ret;
+    }
+
   ret = DRVR_CTRLIN(hport->drvr, hport->ep0,
-                    ctrlreq, (FAR uint8_t *)&hubdesc);
+                    ctrlreq, (FAR uint8_t *)hubdesc);
   if (ret < 0)
     {
       uerr("ERROR: Failed to read hub descriptor: %d\n", ret);

Review Comment:
   > free memory
   
   line 586, free hubdesc.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org