Commit cb70e4c1 authored by Sebastian Reichel's avatar Sebastian Reichel

HSI: omap_ssi: convert cawake irq handler to thread

Convert cawake interrupt handler from tasklet to
threaded interrupt handler in preparation of
blocking runtime_pm calls.
Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
Tested-by: default avatarPavel Machek <pavel@ucw.cz>
parent df26d639
...@@ -75,7 +75,6 @@ struct omap_ssm_ctx { ...@@ -75,7 +75,6 @@ struct omap_ssm_ctx {
* @wake_irq: IRQ number for incoming wake line (-1 if none) * @wake_irq: IRQ number for incoming wake line (-1 if none)
* @wake_gpio: GPIO number for incoming wake line (-1 if none) * @wake_gpio: GPIO number for incoming wake line (-1 if none)
* @pio_tasklet: Bottom half for PIO transfers and events * @pio_tasklet: Bottom half for PIO transfers and events
* @wake_tasklet: Bottom half for incoming wake events
* @wkin_cken: Keep track of clock references due to the incoming wake line * @wkin_cken: Keep track of clock references due to the incoming wake line
* @wk_refcount: Reference count for output wake line * @wk_refcount: Reference count for output wake line
* @sys_mpu_enable: Context for the interrupt enable register for irq 0 * @sys_mpu_enable: Context for the interrupt enable register for irq 0
...@@ -99,7 +98,6 @@ struct omap_ssi_port { ...@@ -99,7 +98,6 @@ struct omap_ssi_port {
int wake_irq; int wake_irq;
struct gpio_desc *wake_gpio; struct gpio_desc *wake_gpio;
struct tasklet_struct pio_tasklet; struct tasklet_struct pio_tasklet;
struct tasklet_struct wake_tasklet;
bool wktest:1; /* FIXME: HACK to be removed */ bool wktest:1; /* FIXME: HACK to be removed */
bool wkin_cken:1; /* Workaround */ bool wkin_cken:1; /* Workaround */
unsigned int wk_refcount; unsigned int wk_refcount;
......
...@@ -312,7 +312,7 @@ static int ssi_clk_event(struct notifier_block *nb, unsigned long event, ...@@ -312,7 +312,7 @@ static int ssi_clk_event(struct notifier_block *nb, unsigned long event,
continue; continue;
/* Workaround for SWBREAK + CAwake down race in CMT */ /* Workaround for SWBREAK + CAwake down race in CMT */
tasklet_disable(&omap_port->wake_tasklet); disable_irq(omap_port->wake_irq);
/* stop all ssi communication */ /* stop all ssi communication */
pinctrl_pm_select_idle_state(omap_port->pdev); pinctrl_pm_select_idle_state(omap_port->pdev);
...@@ -338,7 +338,7 @@ static int ssi_clk_event(struct notifier_block *nb, unsigned long event, ...@@ -338,7 +338,7 @@ static int ssi_clk_event(struct notifier_block *nb, unsigned long event,
/* resume ssi communication */ /* resume ssi communication */
pinctrl_pm_select_default_state(omap_port->pdev); pinctrl_pm_select_default_state(omap_port->pdev);
tasklet_enable(&omap_port->wake_tasklet); enable_irq(omap_port->wake_irq);
} }
break; break;
......
...@@ -966,7 +966,7 @@ static irqreturn_t ssi_pio_isr(int irq, void *port) ...@@ -966,7 +966,7 @@ static irqreturn_t ssi_pio_isr(int irq, void *port)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
static void ssi_wake_tasklet(unsigned long ssi_port) static irqreturn_t ssi_wake_thread(int irq __maybe_unused, void *ssi_port)
{ {
struct hsi_port *port = (struct hsi_port *)ssi_port; struct hsi_port *port = (struct hsi_port *)ssi_port;
struct hsi_controller *ssi = to_hsi_controller(port->device.parent); struct hsi_controller *ssi = to_hsi_controller(port->device.parent);
...@@ -1007,13 +1007,6 @@ static void ssi_wake_tasklet(unsigned long ssi_port) ...@@ -1007,13 +1007,6 @@ static void ssi_wake_tasklet(unsigned long ssi_port)
} }
spin_unlock(&omap_port->lock); spin_unlock(&omap_port->lock);
} }
}
static irqreturn_t ssi_wake_isr(int irq __maybe_unused, void *ssi_port)
{
struct omap_ssi_port *omap_port = hsi_port_drvdata(ssi_port);
tasklet_hi_schedule(&omap_port->wake_tasklet);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
...@@ -1051,13 +1044,12 @@ static int ssi_wake_irq(struct hsi_port *port, struct platform_device *pd) ...@@ -1051,13 +1044,12 @@ static int ssi_wake_irq(struct hsi_port *port, struct platform_device *pd)
} }
cawake_irq = gpiod_to_irq(omap_port->wake_gpio); cawake_irq = gpiod_to_irq(omap_port->wake_gpio);
omap_port->wake_irq = cawake_irq; omap_port->wake_irq = cawake_irq;
tasklet_init(&omap_port->wake_tasklet, ssi_wake_tasklet,
(unsigned long)port); err = devm_request_threaded_irq(&port->device, cawake_irq, NULL,
err = devm_request_irq(&port->device, cawake_irq, ssi_wake_isr, ssi_wake_thread,
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
"cawake", port); "SSI cawake", port);
if (err < 0) if (err < 0)
dev_err(&port->device, "Request Wake in IRQ %d failed %d\n", dev_err(&port->device, "Request Wake in IRQ %d failed %d\n",
cawake_irq, err); cawake_irq, err);
...@@ -1234,7 +1226,6 @@ static int ssi_port_remove(struct platform_device *pd) ...@@ -1234,7 +1226,6 @@ static int ssi_port_remove(struct platform_device *pd)
hsi_port_unregister_clients(port); hsi_port_unregister_clients(port);
tasklet_kill(&omap_port->wake_tasklet);
tasklet_kill(&omap_port->pio_tasklet); tasklet_kill(&omap_port->pio_tasklet);
port->async = hsi_dummy_msg; port->async = hsi_dummy_msg;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment