summaryrefslogtreecommitdiff
path: root/drivers/hsi/controllers/omap_ssi_port.c
diff options
context:
space:
mode:
authorSebastian Reichel <sre@kernel.org>2016-05-20 06:25:06 +0200
committerSebastian Reichel <sre@kernel.org>2016-06-28 00:40:00 +0200
commit4e552310cdf0c81210b5fc9173f7cf497eeb9feb (patch)
treef9f4e8bdcbb87627e9a4431a55ef39f6d973adba /drivers/hsi/controllers/omap_ssi_port.c
parent604fdfa45886f04ad6070c1b8266c7f4154bc497 (diff)
HSI: omap_ssi: call msg->complete() from process context
msg->complete() should always be called from process context once irq_safe runtime pm flag is no longer set for omap-ssi. Signed-off-by: Sebastian Reichel <sre@kernel.org> Tested-by: Pavel Machek <pavel@ucw.cz>
Diffstat (limited to 'drivers/hsi/controllers/omap_ssi_port.c')
-rw-r--r--drivers/hsi/controllers/omap_ssi_port.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/hsi/controllers/omap_ssi_port.c b/drivers/hsi/controllers/omap_ssi_port.c
index f91c6a4bb1a5..7717c769c4dd 100644
--- a/drivers/hsi/controllers/omap_ssi_port.c
+++ b/drivers/hsi/controllers/omap_ssi_port.c
@@ -193,6 +193,21 @@ static int ssi_debug_add_port(struct omap_ssi_port *omap_port,
}
#endif
+static void ssi_process_errqueue(struct work_struct *work)
+{
+ struct omap_ssi_port *omap_port;
+ struct list_head *head, *tmp;
+ struct hsi_msg *msg;
+
+ omap_port = container_of(work, struct omap_ssi_port, errqueue_work.work);
+
+ list_for_each_safe(head, tmp, &omap_port->errqueue) {
+ msg = list_entry(head, struct hsi_msg, link);
+ msg->complete(msg);
+ list_del(head);
+ }
+}
+
static int ssi_claim_lch(struct hsi_msg *msg)
{
@@ -1170,6 +1185,7 @@ static int ssi_port_probe(struct platform_device *pd)
omap_port->pdev = &pd->dev;
omap_port->port_id = port_id;
+ INIT_DEFERRABLE_WORK(&omap_port->errqueue_work, ssi_process_errqueue);
INIT_WORK(&omap_port->work, start_tx_work);
/* initialize HSI port */
@@ -1237,6 +1253,8 @@ static int ssi_port_remove(struct platform_device *pd)
ssi_debug_remove_port(port);
#endif
+ cancel_delayed_work_sync(&omap_port->errqueue_work);
+
hsi_port_unregister_clients(port);
port->async = hsi_dummy_msg;