Revert "rpmsg: smd: Create device for all channels"
authorBjorn Andersson <bjorn.andersson@linaro.org>
Thu, 15 Mar 2018 18:12:44 +0000 (11:12 -0700)
committerBjorn Andersson <bjorn.andersson@linaro.org>
Tue, 27 Mar 2018 19:58:16 +0000 (12:58 -0700)
In an effort to pick up channels that are in a funky state we
optimistically tried to open all channels that we found, with the
addition that we failed if the other side did not handshake the opening.

But as we're starting the modem a second time all channels are found -
in a "funky" state - and we try to open them. But the modem firmware
requires the IPCRTR to be up in order to initialize. So any channels we
try to open before that will fail and will not be opened again.

This takes care of the regression, at the cost of reintroducing the
previous behavior of handling of channels with "funky" states.

Reverts commit c12fc4519f60 ("rpmsg: smd: Create device for all channels")

Reported-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
drivers/rpmsg/qcom_smd.c

index 76b1c00b4a19a9945cc768bc2ee62b5228dddf22..b062e9d6e25fb26d534463cb0480649cfd56c99b 100644 (file)
@@ -1235,6 +1235,11 @@ static void qcom_channel_state_worker(struct work_struct *work)
                if (channel->state != SMD_CHANNEL_CLOSED)
                        continue;
 
+               remote_state = GET_RX_CHANNEL_INFO(channel, state);
+               if (remote_state != SMD_CHANNEL_OPENING &&
+                   remote_state != SMD_CHANNEL_OPENED)
+                       continue;
+
                if (channel->registered)
                        continue;