Skip to content
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

[RFC] net: vertexcom: mse102x: Fix SPI interrupt handling #10

Open
wants to merge 8 commits into
base: v6.6.23-2.0.0-phy-cb
Choose a base branch
from

Conversation

lategoodbye
Copy link
Member

This series fixes the handling of the SPI interrupt in the MSE102x driver. The current solution is consider as a request for comments.

Additional it improves the related debug capabilites by introducing an optional DT property to use the interrupt line as GPIO (currently not intended for upstream).

It's hard to debug the SPI interrupt level, so implement the possibility
to allocate the SPI interrupt as a GPIO. This allows to debug the current
level with the common tools.

Signed-off-by: Stefan Wahren <[email protected]>
This allows to debug the SPI interrupt level.

Signed-off-by: Stefan Wahren <[email protected]>
Since the SPI implementation on the MSE102x MCU is in software,
it cannot reply to SPI commands in busy state. So drop the scaring
statistics about "invalid" command replies.

Signed-off-by: Stefan Wahren <[email protected]>
The MSE102x doesn't provide any SPI commands for interrupt handling.
So in case the interrupt fired before the driver requests the IRQ,
the interrupt will never fire again. In order to fix this always poll
for pending packets after opening the interface.

Fixes: 2f207cb ("net: vertexcom: Add MSE102x SPI support")
Signed-off-by: Stefan Wahren <[email protected]>
According to the MSE102x documentation the trigger type is a
high level.

Signed-off-by: Stefan Wahren <[email protected]>
Since there is no protection in the SPI protocol against electrical
interferences, the driver shouldn't blindly trust the length payload
of CMD_RTS. So do at least a range check for incoming frames.

Signed-off-by: Stefan Wahren <[email protected]>
According to the MSE102x documentation the trigger type is a
high level.

Fixes: 2717566 ("dt-bindings: net: add Vertexcom MSE102x support")
Signed-off-by: Stefan Wahren <[email protected]>
Since mse102x_rx_pkt_spi is also used for polling and the SPI IRQ
type is level based, there is actually no need for a retry
mechanism within mse102x_rx_pkt_spi. So drop it and simplify
the receive path.

Signed-off-by: Stefan Wahren <[email protected]>
@lategoodbye lategoodbye requested a review from mhei January 23, 2025 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant