linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Revert "rpmsg: smd: Create device for all channels"
@ 2018-03-15 18:12 Bjorn Andersson
  2018-03-15 18:50 ` Stephen Boyd
  0 siblings, 1 reply; 2+ messages in thread
From: Bjorn Andersson @ 2018-03-15 18:12 UTC (permalink / raw)
  To: Ohad Ben-Cohen, Bjorn Andersson, Srinivas Kandagatla
  Cc: linux-remoteproc, linux-kernel, linux-arm-msm

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 | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/rpmsg/qcom_smd.c b/drivers/rpmsg/qcom_smd.c
index 92d0c6a7a837..1bca889bbea5 100644
--- a/drivers/rpmsg/qcom_smd.c
+++ b/drivers/rpmsg/qcom_smd.c
@@ -1234,6 +1234,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;
 
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Revert "rpmsg: smd: Create device for all channels"
  2018-03-15 18:12 [PATCH] Revert "rpmsg: smd: Create device for all channels" Bjorn Andersson
@ 2018-03-15 18:50 ` Stephen Boyd
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Boyd @ 2018-03-15 18:50 UTC (permalink / raw)
  To: Bjorn Andersson, Ohad Ben-Cohen, Srinivas Kandagatla
  Cc: linux-remoteproc, linux-kernel, linux-arm-msm

Quoting Bjorn Andersson (2018-03-15 11:12:44)
> 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.

Is it a funky chicken and egg problem between IPCRTR and smd?

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-03-15 18:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-15 18:12 [PATCH] Revert "rpmsg: smd: Create device for all channels" Bjorn Andersson
2018-03-15 18:50 ` Stephen Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).