Skip to content

Conversation

@tmon-nordic
Copy link
Contributor

@tmon-nordic tmon-nordic commented Oct 7, 2024

Fixes suspend current when connected to already suspended bus and prevents possible CDC ACM endless workqueue processing.

@tmon-nordic tmon-nordic added this to the ncs-2.8.0 milestone Oct 8, 2024
@tmon-nordic tmon-nordic force-pushed the usb-cherry-picks branch 2 times, most recently from 8a6ffd6 to 27b0794 Compare October 16, 2024 12:02
tmon-nordic and others added 11 commits October 17, 2024 08:26
Peripherals are required to support the suspend state whenever VBUS
is powered, even if bus reset has not occurred (Mandate: Required,
Effective Date: February, 2010).

Remove the stale suspend check that essentially prevented the device
from hibernating when connected to already suspended bus.

(cherry picked from commit f57e78d)
Signed-off-by: Tomasz Moń <[email protected]>
Adhere to programming guide steps on Hibernation Exit on Host Initiated
Reset.

(cherry picked from commit 508bd3e)
Signed-off-by: Tomasz Moń <[email protected]>
Update the documented value range that `uart_irq_tx_ready` returns in
order to provide more information to the callers about the number of
bytes that could be writted with `uart_fifo_fill` without fragmentation.

Signed-off-by: Jordan Yates <[email protected]>
(cherry picked from commit 5bd53b6)
Signed-off-by: Tomasz Moń <[email protected]>
Update the interrupt driver UART drivers that use `struct ring_buf`
internally to report the number of bytes that can be pushed in
`uart_fifo_fill` without fragmentation.

Signed-off-by: Jordan Yates <[email protected]>
(cherry picked from commit 81352d0)
Signed-off-by: Tomasz Moń <[email protected]>
The async IRQ shim supports writes of any size up to the TX buffer size.

Signed-off-by: Jordan Yates <[email protected]>
(cherry picked from commit 3e5c72a)
Signed-off-by: Tomasz Moń <[email protected]>
Update nrfx drivers with the minimum number of bytes that can be sent
in a single call to `uart_fifo_fill`.

Signed-off-by: Jordan Yates <[email protected]>
(cherry picked from commit 0425b04)
Signed-off-by: Tomasz Moń <[email protected]>
…the heading

Move "Built-in functions" section down and increase the heading.

Signed-off-by: Johann Fischer <[email protected]>
(cherry picked from commit fc0437c)
Signed-off-by: Tomasz Moń <[email protected]>
…iven UART API

Align CDC ACM UART with Interrupt-driven UART API behavior description.
Use the same flags in uart_irq_rx_ready(), uart_irq_tx_ready(), and
uart_irq_is_pending(), which are updated after each uart_irq_update()
call. Allow TX FIFO to be filled if there is space.

Signed-off-by: Johann Fischer <[email protected]>
(cherry picked from commit 64ee885)
Signed-off-by: Tomasz Moń <[email protected]>
In general, it mirrors what is described in Interrupt-driven API
documentation, but here a little more explicitly and with a simplified
example, so that we can finally chisel it into the stone.

Signed-off-by: Johann Fischer <[email protected]>
(cherry picked from commit 1867e71)
Signed-off-by: Tomasz Moń <[email protected]>
…acy implementation

Apply changes in commit c152e09
("usb: device: cdc_acm: block in uart_poll_out() routine")
to the new CDC ACM UART poll_out implementation.

Signed-off-by: Johann Fischer <[email protected]>
(cherry picked from commit 6cf2775)
Signed-off-by: Tomasz Moń <[email protected]>
… simultaneously

As it is still accepted practice, allow fifo_fill and poll_out to be
used simultaneously. The lock around fifo_fill was already in place.

Signed-off-by: Johann Fischer <[email protected]>
(cherry picked from commit ef89321)
Signed-off-by: Tomasz Moń <[email protected]>
jfischer-no and others added 4 commits October 17, 2024 08:26
…API behavior

Add note about CDC ACM virtual UART polling API behavior.

Signed-off-by: Johann Fischer <[email protected]>
(cherry picked from commit ece1f51)
Signed-off-by: Tomasz Moń <[email protected]>
…he current MPS

When the controller is connected to a full speed bus, regardless of
whether the controller supports high speed or not, the transfer size for
the bulk OUT endpoint should be equal to the MPS in the current
configuration.

Signed-off-by: Johann Fischer <[email protected]>
(cherry picked from commit 4875aa3)
Signed-off-by: Tomasz Moń <[email protected]>
…C ACM

Use delayable work to reduce CPU load when there is no transfer flow in
the host direction. This also improves the performance of poll out, as
introduced in commit commit fed6bde
("usb: device: cdc_acm: send more than 1 byte in poll out")
for the legacy CDC ACM implementation.

Signed-off-by: Johann Fischer <[email protected]>
(cherry picked from commit fe4d8a6)
Signed-off-by: Tomasz Moń <[email protected]>
…ssion

Verbatim from USB 2.0 specification:
The Remote Wakeup field indicates whether the device is currently enabled
to request remote wakeup. The default mode for devices that support
remote wakeup is disabled. If D1 is reset to zero, the ability of the
device to signal remote wakeup is disabled. If D1 is set to one,
the ability of the device to signal remote wakeup is enabled.
The Remote Wakeup field can be modified by the SetFeature() and
ClearFeature() requests using the DEVICE_REMOTE_WAKEUP feature selector.
This field is reset to zero when the device is reset.

Signed-off-by: Benedek Kupper <[email protected]>
(cherry picked from commit a6b911f)
Signed-off-by: Tomasz Moń <[email protected]>
@tmon-nordic tmon-nordic merged commit fb6c746 into nrfconnect:main Oct 17, 2024
17 checks passed
@tmon-nordic tmon-nordic deleted the usb-cherry-picks branch March 27, 2025 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants