-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drivers: usb_dc_sam: free endpoint memory on End of Reset event #25243
drivers: usb_dc_sam: free endpoint memory on End of Reset event #25243
Conversation
Tweak logging for enable, disable, configure. Signed-off-by: Johann Fischer <j.fischer@phytec.de>
Free endpoint memory on End of Reset event (EORST). Fixes: zephyrproject-rtos#24626 Signed-off-by: Johann Fischer <j.fischer@phytec.de>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the datasheet, this should not be needed as the endpoint is supposed to be disabled and its memory de-allocated upon receiving a USB reset. However I confirm this is not what happens on the hardware and that your changes actually fix the issue. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jfischer-phytec-iot thank you for the PR.
@@ -469,7 +469,7 @@ int usb_dc_ep_configure(const struct usb_dc_ep_cfg_data *const cfg) | |||
return -EBUSY; | |||
} | |||
|
|||
LOG_DBG("ep %x, mps %d, type %d", cfg->ep_addr, cfg->ep_mps, | |||
LOG_INF("Configure ep %x, mps %d, type %d", cfg->ep_addr, cfg->ep_mps, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On my view we can keep logs as LOG_DBG.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although the reason why EP 1-3 do not get disabled after reset, as stated in the datasheet, may require further investigation, this patch does fix the problem described in #24626.
[00:00:09.270,000] <inf> usb_cdc_acm: USB device configured
>>from EORST ISR<<
EP 0: enabled
EP 1: enabled
EP 2: enabled
EP 3: enabled
EP 4: disabled
EP 5: disabled
EP 6: disabled
EP 7: disabled
EP 8: disabled
EP 9: disabled
Free endpoint memory on End of Reset event (EORST).
Fixes: #24626
I also tweaked logging a little to see what happens during configuration, but I can remove commit f689a5a if not desired.