Commit 12855cac authored by Manu Abraham's avatar Manu Abraham Committed by Mauro Carvalho Chehab

V4L/DVB (13740): [Mantis] Schedule the work instead of handling the task directly

Signed-off-by: default avatarManu Abraham <manu@linuxtv.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 3062b157
...@@ -151,4 +151,8 @@ extern int mantis_dvb_exit(struct mantis_pci *mantis); ...@@ -151,4 +151,8 @@ extern int mantis_dvb_exit(struct mantis_pci *mantis);
extern void mantis_dma_xfer(unsigned long data); extern void mantis_dma_xfer(unsigned long data);
extern void gpio_set_bits(struct mantis_pci *mantis, u32 bitpos, u8 value); extern void gpio_set_bits(struct mantis_pci *mantis, u32 bitpos, u8 value);
extern struct dvb_device *mantis_ca_init(struct mantis_pci *mantis);
extern void mantis_ca_exit(struct mantis_pci *mantis);
#endif //__MANTIS_COMMON_H #endif //__MANTIS_COMMON_H
...@@ -22,9 +22,9 @@ ...@@ -22,9 +22,9 @@
#include "mantis_link.h" #include "mantis_link.h"
#include "mantis_hif.h" #include "mantis_hif.h"
void mantis_hifevm_tasklet(unsigned long data) static void mantis_hifevm_work(struct work_struct *work)
{ {
struct mantis_ca *ca = (struct mantis_ca *) data; struct mantis_ca *ca = container_of(work, struct mantis_ca, hif_evm_work);
struct mantis_pci *mantis = ca->ca_priv; struct mantis_pci *mantis = ca->ca_priv;
u32 gpif_stat, gpif_mask; u32 gpif_stat, gpif_mask;
...@@ -38,15 +38,13 @@ void mantis_hifevm_tasklet(unsigned long data) ...@@ -38,15 +38,13 @@ void mantis_hifevm_tasklet(unsigned long data)
if (gpif_stat & MANTIS_CARD_PLUGIN) { if (gpif_stat & MANTIS_CARD_PLUGIN) {
dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): CAM Plugin", mantis->num); dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): CAM Plugin", mantis->num);
mmwrite(0xdada0000, MANTIS_CARD_RESET); mmwrite(0xdada0000, MANTIS_CARD_RESET);
// Plugin call here mantis_event_cam_plugin(ca);
gpif_stat = 0; // crude !
} }
} else { } else {
if (gpif_stat & MANTIS_CARD_PLUGOUT) { if (gpif_stat & MANTIS_CARD_PLUGOUT) {
dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): CAM Unplug", mantis->num); dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): CAM Unplug", mantis->num);
mmwrite(0xdada0000, MANTIS_CARD_RESET); mmwrite(0xdada0000, MANTIS_CARD_RESET);
// Unplug call here mantis_event_cam_unplug(ca);
gpif_stat = 0; // crude !
} }
} }
...@@ -91,9 +89,9 @@ int mantis_evmgr_init(struct mantis_ca *ca) ...@@ -91,9 +89,9 @@ int mantis_evmgr_init(struct mantis_ca *ca)
struct mantis_pci *mantis = ca->ca_priv; struct mantis_pci *mantis = ca->ca_priv;
dprintk(verbose, MANTIS_DEBUG, 1, "Initializing Mantis Host I/F Event manager"); dprintk(verbose, MANTIS_DEBUG, 1, "Initializing Mantis Host I/F Event manager");
tasklet_init(&ca->hif_evm_tasklet, mantis_hifevm_tasklet, (unsigned long) ca); INIT_WORK(&ca->hif_evm_work, mantis_hifevm_work);
mantis_pcmcia_init(ca); mantis_pcmcia_init(ca);
schedule_work(&ca->hif_evm_work);
return 0; return 0;
} }
...@@ -103,7 +101,6 @@ void mantis_evmgr_exit(struct mantis_ca *ca) ...@@ -103,7 +101,6 @@ void mantis_evmgr_exit(struct mantis_ca *ca)
struct mantis_pci *mantis = ca->ca_priv; struct mantis_pci *mantis = ca->ca_priv;
dprintk(verbose, MANTIS_DEBUG, 1, "Mantis Host I/F Event manager exiting"); dprintk(verbose, MANTIS_DEBUG, 1, "Mantis Host I/F Event manager exiting");
tasklet_kill(&ca->hif_evm_tasklet); flush_scheduled_work();
mantis_pcmcia_exit(ca); mantis_pcmcia_exit(ca);
} }
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
#ifndef __MANTIS_LINK_H #ifndef __MANTIS_LINK_H
#define __MANTIS_LINK_H #define __MANTIS_LINK_H
#include <linux/workqueue.h>
enum mantis_sbuf_status { enum mantis_sbuf_status {
MANTIS_SBUF_DATA_AVAIL = 1, MANTIS_SBUF_DATA_AVAIL = 1,
MANTIS_SBUF_DATA_EMPTY = 2, MANTIS_SBUF_DATA_EMPTY = 2,
...@@ -40,7 +42,7 @@ enum mantis_slot_state { ...@@ -40,7 +42,7 @@ enum mantis_slot_state {
struct mantis_ca { struct mantis_ca {
struct mantis_slot slot; struct mantis_slot slot;
struct tasklet_struct hif_evm_tasklet; struct work_struct hif_evm_work;
u32 hif_event; u32 hif_event;
wait_queue_head_t hif_opdone_wq; wait_queue_head_t hif_opdone_wq;
......
...@@ -77,7 +77,7 @@ static irqreturn_t mantis_pci_irq(int irq, void *dev_id) ...@@ -77,7 +77,7 @@ static irqreturn_t mantis_pci_irq(int irq, void *dev_id)
} }
if (stat & MANTIS_INT_IRQ0) { if (stat & MANTIS_INT_IRQ0) {
dprintk(verbose, MANTIS_DEBUG, 0, "* INT IRQ-0 *"); dprintk(verbose, MANTIS_DEBUG, 0, "* INT IRQ-0 *");
tasklet_schedule(&ca->hif_evm_tasklet); schedule_work(&ca->hif_evm_work);
} }
if (stat & MANTIS_INT_IRQ1) { if (stat & MANTIS_INT_IRQ1) {
dprintk(verbose, MANTIS_DEBUG, 0, "* INT IRQ-1 *"); dprintk(verbose, MANTIS_DEBUG, 0, "* INT IRQ-1 *");
......
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