You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/07/12 06:35:42 UTC
[GitHub] [incubator-nuttx] eenurkka opened a new pull request, #6602: risc-v/mpfs: usb: fix illegal reads
eenurkka opened a new pull request, #6602:
URL: https://github.com/apache/incubator-nuttx/pull/6602
With faster data transfer rates, it was seen that the read
requests occasionally were issued while the USB RX operation
was actually in progress. This patch makes sure the system
doesn't accidentally read the RX fifo while it's being filled
up, but rather, checks for the RXCSRL_REG_EPN_RX_PKT_RDY_MASK
flag. This flag indicates the packet is ready to be read.
Signed-off-by: Eero Nurkkala <ee...@offcode.fi>
## Summary
Higher transfer rates revealed a problem with the USB driver. RX fifo was
being read during RX transaction which caused trouble.
Also remove unnecessary TRACE_DEVERROR(I) trace, which is no error at all.
## Impact
MPFS Polarfire USB
## Testing
Tested with Polarfire MPFS by sending 1.9 Gb images into the device's emmc via
dd using varying block sizes.
--
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] [incubator-nuttx] eenurkka commented on a diff in pull request #6602: risc-v/mpfs: usb: fix illegal reads
Posted by GitBox <gi...@apache.org>.
eenurkka commented on code in PR #6602:
URL: https://github.com/apache/incubator-nuttx/pull/6602#discussion_r918677780
##########
arch/risc-v/src/mpfs/mpfs_usb.c:
##########
@@ -1060,7 +1061,8 @@ static int mpfs_req_read(struct mpfs_usbdev_s *priv,
privreq = NULL;
}
- if ((privreq->inflight) && (count != 0))
+ if ((privreq->inflight) && (count != 0) &&
+ (reg & RXCSRL_REG_EPN_RX_PKT_RDY_MASK))
Review Comment:
Yeah, fixed it, thx for pointing it out
--
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] [incubator-nuttx] xiaoxiang781216 merged pull request #6602: risc-v/mpfs: usb: fix illegal reads
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged PR #6602:
URL: https://github.com/apache/incubator-nuttx/pull/6602
--
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] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6602: risc-v/mpfs: usb: fix illegal reads
Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #6602:
URL: https://github.com/apache/incubator-nuttx/pull/6602#discussion_r918668809
##########
arch/risc-v/src/mpfs/mpfs_usb.c:
##########
@@ -1060,7 +1061,8 @@ static int mpfs_req_read(struct mpfs_usbdev_s *priv,
privreq = NULL;
}
- if ((privreq->inflight) && (count != 0))
+ if ((privreq->inflight) && (count != 0) &&
+ (reg & RXCSRL_REG_EPN_RX_PKT_RDY_MASK))
Review Comment:
Optional
```suggestion
if ((privreq->inflight > 0) && (count != 0) &&
(reg & RXCSRL_REG_EPN_RX_PKT_RDY_MASK) != 0)
```
--
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