msm: sdio_dmux: Clear pending write queue after reset notification
Fix issue where clients can get notifications of failed
writes before they are notified that a reset has occurred.
Signed-off-by: Vamsi Krishna <vskrishn@codeaurora.org>
diff --git a/arch/arm/mach-msm/sdio_dmux.c b/arch/arm/mach-msm/sdio_dmux.c
index c998403..ae9bfa1 100644
--- a/arch/arm/mach-msm/sdio_dmux.c
+++ b/arch/arm/mach-msm/sdio_dmux.c
@@ -871,23 +871,23 @@
if (sdio_ch[i].receive_cb)
sdio_ch[i].receive_cb(
sdio_ch[i].priv, NULL);
-
- /* cancel any pending writes */
- spin_lock_irqsave(&sdio_mux_write_lock,
- write_lock_flags);
- while ((skb = __skb_dequeue(&sdio_mux_write_pool))) {
- if (sdio_ch[i].write_done)
- sdio_ch[i].write_done(
- sdio_ch[i].priv, skb);
- else
- dev_kfree_skb_any(skb);
- }
- spin_unlock_irqrestore(&sdio_mux_write_lock,
- write_lock_flags);
}
spin_unlock_irqrestore(&sdio_ch[i].lock, ch_lock_flags);
}
+ /* cancel any pending writes */
+ spin_lock_irqsave(&sdio_mux_write_lock, write_lock_flags);
+ while ((skb = __skb_dequeue(&sdio_mux_write_pool))) {
+ i = ((struct sdio_mux_hdr *)skb->data)->ch_id;
+ if (sdio_ch[i].write_done)
+ sdio_ch[i].write_done(
+ sdio_ch[i].priv, skb);
+ else
+ dev_kfree_skb_any(skb);
+ }
+ spin_unlock_irqrestore(&sdio_mux_write_lock,
+ write_lock_flags);
+
return 0;
}