rpmsg: glink: Removing glink prepare for SPSS
Spliting glink probe to prepare (in BEFORE_POWERUP) and start (in AFTER_POWERUP) stage in spss results in glink link up callback arriving earlier on spss when one of the destination services is not yet created. This results in spss not finishing the boot flow after ssr. Reverting back to having glink probe to be called in remoteproc's AFTER_POWERUP state. Adding glink fifo reset to be called as part of BEFORE_SHUTDOWN if the underlying driver has callbacks setup for it as is the case in spss rpmsg driver. Change-Id: I24a6dc403feb2098a88942f25a979f1f464a2360 Signed-off-by: Jay Jayanna <jayanna@codeaurora.org>
This commit is contained in:
parent
fc463f949f
commit
8215ad8cc6
@ -72,7 +72,7 @@ struct qcom_spss {
|
||||
u32 bits_arr[2];
|
||||
};
|
||||
|
||||
static int glink_spss_subdev_prepare(struct rproc_subdev *subdev)
|
||||
static int glink_spss_subdev_start(struct rproc_subdev *subdev)
|
||||
{
|
||||
struct qcom_rproc_glink *glink = to_glink_subdev(subdev);
|
||||
|
||||
@ -81,13 +81,6 @@ static int glink_spss_subdev_prepare(struct rproc_subdev *subdev)
|
||||
return PTR_ERR_OR_ZERO(glink->edge);
|
||||
}
|
||||
|
||||
static int glink_spss_subdev_start(struct rproc_subdev *subdev)
|
||||
{
|
||||
struct qcom_rproc_glink *glink = to_glink_subdev(subdev);
|
||||
|
||||
return qcom_glink_spss_start(glink->edge);
|
||||
}
|
||||
|
||||
static void glink_spss_subdev_stop(struct rproc_subdev *subdev, bool crashed)
|
||||
{
|
||||
struct qcom_rproc_glink *glink = to_glink_subdev(subdev);
|
||||
@ -125,7 +118,6 @@ static void qcom_add_glink_spss_subdev(struct rproc *rproc,
|
||||
|
||||
glink->dev = dev;
|
||||
glink->subdev.start = glink_spss_subdev_start;
|
||||
glink->subdev.prepare = glink_spss_subdev_prepare;
|
||||
glink->subdev.stop = glink_spss_subdev_stop;
|
||||
glink->subdev.unprepare = glink_spss_subdev_unprepare;
|
||||
|
||||
|
@ -378,6 +378,15 @@ static void qcom_glink_tx_write(struct qcom_glink *glink,
|
||||
glink->tx_pipe->write(glink->tx_pipe, hdr, hlen, data, dlen);
|
||||
}
|
||||
|
||||
static void qcom_glink_pipe_reset(struct qcom_glink *glink)
|
||||
{
|
||||
if (glink->tx_pipe->reset)
|
||||
glink->tx_pipe->reset(glink->tx_pipe);
|
||||
|
||||
if (glink->rx_pipe->reset)
|
||||
glink->rx_pipe->reset(glink->rx_pipe);
|
||||
}
|
||||
|
||||
static void qcom_glink_send_read_notify(struct qcom_glink *glink)
|
||||
{
|
||||
struct glink_msg msg;
|
||||
@ -2247,6 +2256,13 @@ void qcom_glink_native_remove(struct qcom_glink *glink)
|
||||
|
||||
kthread_flush_worker(&glink->kworker);
|
||||
kthread_stop(glink->task);
|
||||
|
||||
/*
|
||||
* Required for spss only. A cb is provided for this in spss driver. For
|
||||
* others, its done in prepare stage in smem driver. No cb is given.
|
||||
*/
|
||||
qcom_glink_pipe_reset(glink);
|
||||
|
||||
mbox_free_channel(glink->mbox_chan);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(qcom_glink_native_remove);
|
||||
|
@ -45,6 +45,14 @@ struct glink_spss_pipe {
|
||||
|
||||
#define to_spss_pipe(p) container_of(p, struct glink_spss_pipe, native)
|
||||
|
||||
static void glink_spss_reset(struct qcom_glink_pipe *np)
|
||||
{
|
||||
struct glink_spss_pipe *pipe = to_spss_pipe(np);
|
||||
|
||||
*pipe->head = cpu_to_le32(0);
|
||||
*pipe->tail = cpu_to_le32(0);
|
||||
}
|
||||
|
||||
static size_t glink_spss_rx_avail(struct qcom_glink_pipe *np)
|
||||
{
|
||||
struct glink_spss_pipe *pipe = to_spss_pipe(np);
|
||||
@ -291,10 +299,12 @@ struct qcom_glink *qcom_glink_spss_register(struct device *parent,
|
||||
rx_pipe->native.avail = glink_spss_rx_avail;
|
||||
rx_pipe->native.peak = glink_spss_rx_peak;
|
||||
rx_pipe->native.advance = glink_spss_rx_advance;
|
||||
rx_pipe->native.reset = glink_spss_reset;
|
||||
rx_pipe->remote_pid = remote_pid;
|
||||
|
||||
tx_pipe->native.avail = glink_spss_tx_avail;
|
||||
tx_pipe->native.write = glink_spss_tx_write;
|
||||
tx_pipe->native.reset = glink_spss_reset;
|
||||
tx_pipe->remote_pid = remote_pid;
|
||||
|
||||
*rx_pipe->tail = 0;
|
||||
@ -313,6 +323,10 @@ struct qcom_glink *qcom_glink_spss_register(struct device *parent,
|
||||
goto err_put_dev;
|
||||
}
|
||||
|
||||
ret = qcom_glink_native_start(glink);
|
||||
if (ret)
|
||||
goto err_put_dev;
|
||||
|
||||
return glink;
|
||||
|
||||
err_put_dev:
|
||||
@ -322,12 +336,6 @@ struct qcom_glink *qcom_glink_spss_register(struct device *parent,
|
||||
}
|
||||
EXPORT_SYMBOL(qcom_glink_spss_register);
|
||||
|
||||
int qcom_glink_spss_start(struct qcom_glink *glink)
|
||||
{
|
||||
return qcom_glink_native_start(glink);
|
||||
}
|
||||
EXPORT_SYMBOL(qcom_glink_spss_start);
|
||||
|
||||
void qcom_glink_spss_unregister(struct qcom_glink *glink)
|
||||
{
|
||||
qcom_glink_native_remove(glink);
|
||||
|
@ -41,7 +41,6 @@ int qcom_glink_smem_start(struct qcom_glink *glink)
|
||||
struct qcom_glink *qcom_glink_spss_register(struct device *parent,
|
||||
struct device_node *node);
|
||||
void qcom_glink_spss_unregister(struct qcom_glink *glink);
|
||||
int qcom_glink_spss_start(struct qcom_glink *glink);
|
||||
|
||||
#else
|
||||
|
||||
@ -54,10 +53,6 @@ qcom_glink_spss_register(struct device *parent,
|
||||
|
||||
static inline void qcom_glink_spss_unregister(struct qcom_glink *glink) {}
|
||||
|
||||
int qcom_glink_spss_start(struct qcom_glink *glink)
|
||||
{
|
||||
return -ENXIO;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user