Commit 3b6b7664 authored by Malcolm Priestley's avatar Malcolm Priestley Committed by Greg Kroah-Hartman

staging: vt6655: Fix interrupt race condition on device start up.

commit 3b9c2f2e upstream.

It appears on some slower systems that the driver can find its way
out of the workqueue while the interrupt is disabled by continuous polling
by it.

Move MACvIntEnable to vnt_interrupt_work so that it is always enabled
on all routes out of vnt_interrupt_process.

Move MACvIntDisable so that the device doesn't keep polling the system
while the workqueue is being processed.
Signed-off-by: default avatarMalcolm Priestley <tvboxspy@gmail.com>
CC: stable@vger.kernel.org # v4.2+
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b9ddff2a
...@@ -1040,8 +1040,6 @@ static void vnt_interrupt_process(struct vnt_private *priv) ...@@ -1040,8 +1040,6 @@ static void vnt_interrupt_process(struct vnt_private *priv)
return; return;
} }
MACvIntDisable(priv->PortOffset);
spin_lock_irqsave(&priv->lock, flags); spin_lock_irqsave(&priv->lock, flags);
/* Read low level stats */ /* Read low level stats */
...@@ -1129,8 +1127,6 @@ static void vnt_interrupt_process(struct vnt_private *priv) ...@@ -1129,8 +1127,6 @@ static void vnt_interrupt_process(struct vnt_private *priv)
} }
spin_unlock_irqrestore(&priv->lock, flags); spin_unlock_irqrestore(&priv->lock, flags);
MACvIntEnable(priv->PortOffset, IMR_MASK_VALUE);
} }
static void vnt_interrupt_work(struct work_struct *work) static void vnt_interrupt_work(struct work_struct *work)
...@@ -1140,6 +1136,8 @@ static void vnt_interrupt_work(struct work_struct *work) ...@@ -1140,6 +1136,8 @@ static void vnt_interrupt_work(struct work_struct *work)
if (priv->vif) if (priv->vif)
vnt_interrupt_process(priv); vnt_interrupt_process(priv);
MACvIntEnable(priv->PortOffset, IMR_MASK_VALUE);
} }
static irqreturn_t vnt_interrupt(int irq, void *arg) static irqreturn_t vnt_interrupt(int irq, void *arg)
...@@ -1148,6 +1146,8 @@ static irqreturn_t vnt_interrupt(int irq, void *arg) ...@@ -1148,6 +1146,8 @@ static irqreturn_t vnt_interrupt(int irq, void *arg)
schedule_work(&priv->interrupt_work); schedule_work(&priv->interrupt_work);
MACvIntDisable(priv->PortOffset);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
......
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