Skip to content

Commit 1368e5f

Browse files
committed
modem: pipe: Don't return EPERM on closed pipe
When working on CMUX power saving, it is typical that we end up closing the pipe before the last RX_READY event is handled from workqueue, so we end up receiving -EPERM which is not really a fatal error. Pipes recover when they are re-opened. So drop this error and return zero instead, like modem_pipe_open() and close() does. Signed-off-by: Seppo Takalo <[email protected]>
1 parent 130d884 commit 1368e5f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

subsys/modem/modem_pipe.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ void modem_pipe_attach(struct modem_pipe *pipe, modem_pipe_api_callback callback
136136
int modem_pipe_transmit(struct modem_pipe *pipe, const uint8_t *buf, size_t size)
137137
{
138138
if (!pipe_test_events(pipe, PIPE_EVENT_OPENED_BIT)) {
139-
return -EPERM;
139+
return 0;
140140
}
141141

142142
pipe_clear_events(pipe, PIPE_EVENT_TRANSMIT_IDLE_BIT);
@@ -146,7 +146,7 @@ int modem_pipe_transmit(struct modem_pipe *pipe, const uint8_t *buf, size_t size
146146
int modem_pipe_receive(struct modem_pipe *pipe, uint8_t *buf, size_t size)
147147
{
148148
if (!pipe_test_events(pipe, PIPE_EVENT_OPENED_BIT)) {
149-
return -EPERM;
149+
return 0;
150150
}
151151

152152
pipe_clear_events(pipe, PIPE_EVENT_RECEIVE_READY_BIT);

0 commit comments

Comments
 (0)